Follow-up from "Resolve "Update `GitlabUiFormBuilder` to support rendering of the submit button with Button ViewComponent""
The following discussions from !93285 (merged) should be addressed:
-
@peterhegman started a discussion: (+1 comment) question (non-blocking): To help level up my Ruby knowledge, quick question...
Why do we use the bang version here instead of just
except
? -
@peterhegman started a discussion: thought (non-blocking): I wonder if we might have issues with a button like ee/app/views/admin/application_settings/_add_license.html.haml#L43. Since
Pajamas::ButtonComponent
expectsdisabled
as a keyword argument, but with the current setup it would be passed in thebutton_options
keyword argument. Thedisabled
argument is the main one that I think could be an issue. But we can always follow-up and add this functionality if needed. -
@peterhegman started a discussion: question (non-blocking): Looks like without the
pajamas_button
argument thedata-disable-with="Save"
attribute is added so Rails handles disabling the button after submitting the form.With the
pajamas_button
this functionality still works but it appears it is coming from app/assets/javascripts/main.js#L205So my question is do we want to rely on the Rails JS or the JS in app/assets/javascripts/main.js#L205?
🤔 One thing we will have to be carful of is submit buttons like app/views/projects/imports/new.html.haml#L19 we will want to add the
.js-no-auto-disable
class when migrating to Pajamas. But there is only one instance so not a big concern.Anyways this discussion can be a follow-up. I am not sure what is better to use, Rails UJS or custom jQuery
😬