-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Move buttons definition to separate file #15194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move buttons definition to separate file #15194
Conversation
@jissereitsma thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
Hi @jissereitsma. Thank you for collaboration. Please check the tests that are failed on the Travis. |
@jissereitsma thanks. |
@VladimirZaets Sorry for the delays and the coding errors: It worked perfectly in my own development environment, but I didn't carefully setup my GitHub clone to copy the right changes: This is fixed now and the checks have passed. Let me know if you need anything else. |
Hi @jissereitsma. Thank you for your contribution. Please, consider porting this solution across release lines. |
When trying to add new buttons with new actions (besides
reset
,save
andsaveAndContinue
) to a UiComponent form in the backend, it is needed to extend upon at least 2 files:Magento_Ui/js/form/adapter
andMagento_Ui/js/form/form
. The second file is easily extendable using mixins, but the first one is not: Mainly because thebuttons
definition is based on a local variable. This PR fixes this by moving thebuttons
definition in a separate file.Description
This PR adds a new file
buttons.js
that is called for inadapter
so that someone could create a mixin like follows:RequireJS configuration:
And in
Foo_Bar/js/form/form-mixin
:Unfortunately, this PR does not deal with how to use
foobar
in the end, which is hugely complex.Manual testing scenarios
Save
andSave And Continue
are still working in the backendContribution checklist