Move buttons definition to separate file#15194
Move buttons definition to separate file#15194magento-engcom-team merged 6 commits intomagento:2.2-developfrom jissereitsma:issue-form-button-provider
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,saveandsaveAndContinue) to a UiComponent form in the backend, it is needed to extend upon at least 2 files:Magento_Ui/js/form/adapterandMagento_Ui/js/form/form. The second file is easily extendable using mixins, but the first one is not: Mainly because thebuttonsdefinition is based on a local variable. This PR fixes this by moving thebuttonsdefinition in a separate file.Description
This PR adds a new file
buttons.jsthat is called for inadapterso 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
foobarin the end, which is hugely complex.Manual testing scenarios
SaveandSave And Continueare still working in the backendContribution checklist