When a single template is reset, the string displayed in the modal should
not reference to "all templates" to avoid confusion, as it was shown in the
original prototype for the 4.1 database project.
* Add "Preview" and "Use this preset" menus to the preset plugin page's
burger menu
* Refactor importmapping dialogue to use the 'data-action' selector
* Add a new set_kebab_trigger action menu method
* Use set_additional_classes method for action menu
* Remove redundant parameter to add_action_menu
This change makes the JS in for preset management more resilient.
Previously, if the button was not on the page then an error was thrown.
Instead this code changes the listener to listen to the document and
filters the clicked element based on the same selector. This is a much
safer approach as it will not error if the selector was not found on the
page.
In this case the behat test introduced elsewhere in this issue is
testing a scenario where the Save as preset button is not present
because there are no fields to store as a preset.
* Use a modal instead of a standard page to select the preset file
and import it.
* Change the zero state import button to a modal dialog so it uses the same
workflow as on the preset page
The mod_data is forcing teachers to understand how to write templates
even if they want to use basic forms. With this patch the default
templates will be auto updated unless the user manually define the
templates.