Preserve existing `enhance` method return of jQuery style promises to
allow calling code to continue relying on that (e.g. when calling old
style `.done` and `.fail`).
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
When resetting report filters, we need to include the original report
parameters in the external method call to ensure all those that are
required during validation are present (e.g. when determining if user
can view the current system report).
Switch the select element event listener to that provided by custom
events helper, for adding report filters and conditions. This improves
cross-platform support.
Moodle announced that support for IE would be dropped back in August
2020 with Moodle 3.9 but not active steps were taken at that time. That
decision was made in MDLSITE-6109 and this particular step was meant to
be taken in Moodle 3.10.
This is the first step taken to actively drop support for IE.
This commit also bumps the browser support pattern from 0.25% to 0.3%.
The percentage here includes any browser where at least this percentage
of users worldwide may be using a browser. In this case it causes
support for Android 4.3-4.4 to be dropped, which relate to Android
KitKat (released 2013).
This combination of changes means that all of the supported browsers in
our compatibility list support modern features including async,
for...of, classes, native Promises, and more which has a huge impact on
the ease of debugging code, and drastically reduces the minified file
size because a number of native Polyfills included by Babel are no
longer included.
Unfortunately the babel minify-mangle plugin seems to be abandoned and
in certain circumstances can be very buggy. The only safe options are to
disable it, or to switch to a different minification library.
Not minifying our javascript is not ideal, so this commit updates the
javascript tasks to use a rollup, combined with babel, and terser.
Babel still converts code from ES/UMD/AMD to AMD modules with the
relevant browser support, whilst terser minifies the code.
The rollup bundler handles tracking and creation of sourcemaps, and
supports better parallelisation of the tasks.
Since the upgrade to Node LTS/Gallium requires an upgrade to @babel/core
and eslint, which change the built files anyway, this seems like the
ideal time to make this change.
- use 'popup' layout in editor page and create a custom navbar
- remove 'Settings' toggle button and show settings right sidebar with fixed position
- add 'Edit details' button on navbar that opens a modal to modify report basic settings
Aggregation types can disable column sorting, e.g. both the current
group concatenation types. If such a type is selected for a column
we should update the report sorting options, ensuring that only those
columns that can be sorted are available for selection.
- Fix focus after adding conditions in the editor
- Fix focus after adding Filters in the editor
- Fix focus after applying sorting settings in editor
- Fix focus after selecting column aggregation in editor
This change overcomes limitations in certain DB engines (such as
MySQL[1]) which can lead to truncation of data when applying group
concatenation to columns.
Ensure we account for that by validating that we are able to extract
the expected number of fields from each concatenated value.
[1] https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_group_concat_max_len
- Show a toast notification when saving an audience
- Add form change checker when adding a new audience to prevent user from navigating away if it is not saved
- Remove expand/collapse animation in audience sidebar to be consistent with editor
Co-authored-By: Paul Holden <paulh@moodle.com>
This tab includes a system report that provides a listing of all
users who can access the report, taking into account all audiences
that have been created for it. Update page of users available
reports to obey audience configuration.
Fix filters JS form to ensure it is only loaded once.
Co-authored-by: Mikel Martín <mikel@moodle.com>
Add new tab to editor, allowing user to select from available audience
types in order to grant access to their reports.
Co-authored-by: David Matamoros <davidmc@moodle.com>
In preparation for further tabs in this interface, convert the report
editor to use the Dynamic tabs API.
At the same time, update the editor JS and it's modules to add listeners
on `document` instead of the report element itself, which will move in
and out of the current DOM in the future as tabs are switched.
Co-authored-by: Paul Holden <paulh@moodle.com>
Reports can be viewed via two methods. Non-editing users can
access them via their report listing page, and report editors
can switch between editing and preview mode while working on
their reports.
Clean up remaining string definitions.
Co-authored-by: Mikel Martín <mikel@moodle.com>
Implement module for filters editing, allowing the report
editor to define which filters are available when users
are viewing the report.
These filters allow those users viewing the report to further
limit the data being displayed (after conditions have been
applied), by selecting their own values for each filter.
Co-authored-by: Paul Holden <paulh@moodle.com>
Report conditions allow report creators to limit which data
is displayed when the report is viewed. Users viewing the
report cannot override these condition values.
Implement UI elements for editing columns of a report, taking their
definitions from the selected datasource.
Co-authored-By: David Matamoros <davidmc@moodle.com>
Co-authored-By: Mikel Martín <mikel@moodle.com>