This commit adds new steps related to action menus to support:
* Choosing an item in a named action menu
* Choosing an item in a named action menu within a container
* Confirming that an action menu item does or does not exist in a named
action menu
* Confirming that an action menu item does or does not exist in a named
action menu within a container
The existing action menu steps were insufficient as they assume that
there is only one action menu within he container, which is not
necessarily the case.
The existing action menu steps are not non-JS friendly and will error if
JS is disabled, without providing any fallback when one is easily
available.
Unfortunately these steps cannot be used to replace the existing steps
without manual intervention.
On the Database page:
- The List/single view is displayed in the right.
- The buttons Import entries, export entries and Export to portfolio
have been moved to the Actions menu.
- The List/Single view headings have been removed.
- The "Save settings" secondary button is hidden when advanced search
is enabled.
- The result (Found X out of Y entries, No records found) are not
displayed as notifications anymore.
On the Presets page:
- The buttons (Import, Export and Save as preset) have been moved to an
actions menu to the tertiary navigation. Some of these options have been
renamed.
- Remove the Action column heading from the table.
On the Presets preview page:
- Move the preset name to the heading in the tertiary navigation (Preview
of xxxxx), and remove the current preset name from the page.
- Align the List/single template to the right in the tertiary navigation.
- Make primary the "Use this preset" button.
On the Fields page:
- Remove the "Manage fields" menu.
- Remove the Export and Save as preset from the tertiary navigation.
- Align Create a field to the right in the tertiary navigation.
- Add a description at the top of the page.
- Remove the Action column heading from the table.
- Move field actions (Edit and Delete) to ellipsis.
On the Templates page:
- Move Export and Save as preset to the Actions menu.
- Move the templates list to a tertiary navigation selector and remove
the template heading.
- Reorder the templates list (Add entry template should be displayed
at the begining, instead of List template).
- Rename "Enable editor" to "Enable code editor".
* 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
Each template should display at the top the information about the
user who has created the entry, when it was created and modified.
Apart from that, this commit also includes:
- For the Journal preset, a link on each card entry title has been
added, to open the Single view.
- For the Resources preset, the Author field has been renamed to
"Author of resource" and the Description to "Content".
- For the Resources preset, the Author and Type fields will be
hidden in the List view for small devices.
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.
Apart from updating the default templates, to make them look better,
they have been also moved to mustache files, in order to make it easier
to edit them.
The 'user' parameter has been added to the 'mod_data > presets'
generator, to let define the author of the preset.
When it's not defined, admin is used as the author.
From now on, the data_generate_default_template method will always return
a string with the template content or an empty string when there is no
content available (for instance, when the database has no fields).
This method won't return a boolean anymore.
The 'user' parameter has been added to the 'mod_data > entries'
generator, to let define the author of the entry.
When it's not defined, admin is used as the author.
For a long time, Moodle has had the feature to force the language
for a whole course. This change adds the same feature at activity
level.
The course-level feature was controlled by a capability
moodle/course:setforcedlanguage, and I decided to use the same
capability to control this feature. I think a new capability would be
overkill.
This is a regression from MDL-75146, when the manager class was created.
The field class was not found in the Single view, because the field.class.php
file was not included (so the base class was used in all the cases for this
view). That's why the image field was displaying only the image name instead
of building the <img element or the URLs were displaying only the text, instead
of creating a link for them.
This commit adds support to description field for presets:
- For plugin presets, description will be stored in the module_help
string in lang files.
- For saved presets, a new element, <description>, has been added
to the preset.xml file, to include this information.
A new field has been added to the "Save as preset" modal, to let users
define description (which is empty by default, to support pre-existing
presets that won't have it).
Apart from that, the "Save as preset" workflow has been slightly improved,
following the Product UX/UX suggestions to hide the checkbox to overwrite
the preset by default and show it only if the user tries to save a preset
with an existing name.
- Add a new help text.
- Add captions to table columns.
- Move action icons to action menu, and fix code to display the remove
action only for presets created by users.
- CSS improvements to fit the prototype.
In order to achive the previous points, the renderer has been improved,
to return the data and let the mustache to print it properly (instead of
returning the formatted HTML table).
This activity currently supports two different preset types:
- Datapreset plugins, that can be installed copying them to the
mod/data/preset folder.
- Presets saved manually by users.
This commit adds an attribute to the presets to mark them, in order
to identify them later (because, for instance, the plugins can't be
removed).
Apart from that, the methods in lib.php, involved with this issue, have
been deprecated. New methods have been implemented in the manager class,
covering them with PHPUnit tests.