57 Commits

Author SHA1 Message Date
Paul Holden
58d9babe56
MDL-79629 javascript: native promises enhancing autocomplete module.
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>
2023-11-08 20:05:35 +00:00
Sara Arjona
2fc405aa35
Merge branch 'MDL-79629' of https://github.com/paulholden/moodle 2023-11-08 09:57:30 +01:00
Paul Holden
07bf09c063
MDL-79646 reportbuilder: transition effect after drag/drop in editor. 2023-11-02 14:58:52 +00:00
Paul Holden
aa304792f9
MDL-79629 reportbuilder: enhance condition/filter selection in editor.
Enhance the select element used for each with the autocomplete module.

Co-authored-by: Mikel Martín <mikel@moodle.com>
2023-11-02 14:50:10 +00:00
Andrew Nicols
af7719682d
MDL-79064 core: Update all get_strings as uses 2023-08-29 10:57:54 +08:00
Paul Holden
b9a5a3626e
MDL-77067 reportbuilder: indicate when audiences are used in schedules.
Indicate in each audience card whether it's used as part of a report
schedule, and inform user again upon deletion of said audience.
2023-08-23 16:09:17 +01:00
Paul Holden
ecf47ff23b
MDL-78350 reportbuilder: parse javascript before rendering template. 2023-06-21 17:33:40 +01:00
Andrew Nicols
511401f4f6 MDL-77559 js: Rebuild all JS with Node 16 2023-03-09 09:53:19 +08:00
Andrew Nicols
33b1e41f13 MDL-75012 js: Full build of all grunt things 2023-03-02 11:55:32 +08:00
Paul Holden
d58b28d97e MDL-77352 javascript: declare debouncer outside the event handler.
It needs to be declared as such, otherwise each time the event is
triggered a new debouncer is created.
2023-02-21 22:38:59 +00:00
Alex Morris
ab03eb210d
MDL-76304 reportbuilder: Add pagesize parameter to get webservice 2022-12-19 16:59:27 +13:00
David Matamoros
0e449ae6ee MDL-75883 reportbuilder: Don't reload content when filter is deleted
- When filter is deleted in editing mode content does not need
to be reloaded
2022-10-07 08:31:58 +02:00
Paul Holden
cc59c2d4c3 MDL-75723 reportbuilder: show loading icon when toggling edit mode. 2022-09-12 12:24:40 +01:00
Paul Holden
905b394176 MDL-75205 reportbuilder: include report parameters on filters reset.
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).
2022-08-02 12:43:52 +01:00
Paul Holden
5b91dabaac MDL-75235 reportbuilder: external method to set report filter values. 2022-07-28 10:47:42 +01:00
Jun Pataleta
09410d2f91 Merge branch 'MDL-74715' of https://github.com/paulholden/moodle 2022-06-20 21:57:39 +08:00
Paul Holden
f961443652 MDL-74715 reportbuilder: switch event for adding filters/conditions.
Switch the select element event listener to that provided by custom
events helper, for adding report filters and conditions. This improves
cross-platform support.
2022-06-20 09:09:10 +01:00
Paul Holden
07d4be70f8 MDL-74694 reportbuilder: standardize report exporter boolean values.
Specify boolean properties as such, avoid direct interpolation into
templates.
2022-06-12 19:46:39 +01:00
Mikel Martín
e71b737e16 MDL-74377 reportbuilder: Fix dimmed text for dropdown items
To show inactive/unavailable rows '.dimmed_text' class usages have been replaced with '.text-muted'.
2022-05-18 13:41:40 +02:00
Paul Holden
e5434fac25 MDL-74353 reportbuilder: improvements to report sidebar searching.
* Filter on item textContent instead of dataset, which isn't always
  present;
* Fix hiding of cards when they have no matching items
2022-03-30 21:17:45 +01:00
Paul Holden
dcda9c08e2 MDL-74342 reportbuilder: remove unnecessary template/dataset values. 2022-03-29 09:46:55 +01:00
Paul Holden
a896ea6473 MDL-74342 reportbuilder: allow audiences to be immediately renamed.
Return rendered editable component in response to form submission
so that the audience card can be updated straight away.
2022-03-28 22:28:03 +01:00
Andrew Nicols
e1b9d5f3cd MDL-73915 js: Drop support for IE and android
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.
2022-02-23 08:55:20 +08:00
Andrew Nicols
0a4047ab31 MDL-73915 js: Switch amd minification to terser
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.
2022-02-23 08:55:09 +08:00
Andrew Nicols
aa7f7957ea MDL-73915 js: Upgrade babel and eslint 2022-02-23 08:53:54 +08:00
David Matamoros
ad35d520c8 MDL-72061 reportbuilder: Fix lost focus on action menu items 2022-02-09 17:19:48 +01:00
Mikel Martín
268157743f MDL-73116 reportbuilder: Use triggerElement parameter to return focus 2022-02-07 11:33:35 +01:00
Mikel Martín
795087462f MDL-73470 core: Move toggle template to core 2022-01-25 18:04:58 +01:00
Paul Holden
a05683d027 MDL-72598 reportbuilder: interface elements for creating schedules.
Add new tab to the report editor, with system report, external API
and Javascript modules for managing report schedules.
2021-12-21 08:57:17 +00:00
Paul Holden
b103060753 MDL-73103 reportbuilder: use new notification confirmation method.
Prefetch all language strings used by editor modules.

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2021-12-03 13:01:58 +00:00
Jun Pataleta
f95cc84aa5 Merge branch 'MDL-72770' of https://github.com/roland04/moodle 2021-12-02 11:08:50 +08:00
Mikel Martín
6a6ebbac63 MDL-72770 reportbuilder: Display editor in full screen layout
- 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
2021-12-01 17:12:45 +01:00
Paul Holden
171c615a1b MDL-73149 reportbuilder: update sorting options after aggregation.
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.
2021-12-01 09:12:07 +00:00
Mikel Martín
08d31c6657 MDL-72822 core_reportbuilder: Fix focus lost after applying changes
- 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
2021-11-24 13:13:08 +01:00
Paul Holden
f4bf4dca36 MDL-73112 reportbuilder: improve handling of concatenated columns.
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
2021-11-22 09:14:41 +00:00
Paul Holden
80dd297a62 MDL-73090 reportbuilder: confirmation before resetting conditions.
Also prefetch all lang strings used by conditions editor.
2021-11-17 16:27:50 +00:00
Mikel Martín
68eb55b8e6 MDL-72565 reportbuilder: Add card view functionality
Use card view settings to show a 'card view' for custom reports in small devices
2021-11-11 13:55:32 +01:00
Mikel Martín
aaa7a5a445 MDL-72565 reportbuilder: Add 'Card view' settings to custom reports
- Create a new 'settings' column in reportbuilder_report table and provide an API to manage it
- Add new card view settings to custom reports
2021-11-11 13:55:29 +01:00
Mikel Martín
f2582cc823 MDL-72565 reportbuilder: Use same template for system/custom reports
- rename 'system_report' template to 'report'
- view.php now uses 'report' template

Co-authored-by: Paul Holden <paulh@moodle.com>
2021-11-11 13:44:23 +01:00
Mikel Martín
5a2624c472 MDL-72952 reportbuilder: UX behaviour improvements in audiences
- 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>
2021-11-10 17:22:00 +01:00
David Matamoros
8a1e7d913f MDL-72588 reportbuilder: add report access tab.
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>
2021-10-29 12:50:20 +02:00
Mikel Martín
144084a2ac MDL-72588 reportbuilder: interface for managing report audiences.
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>
2021-10-29 12:50:15 +02:00
Mikel Martín
9113f9d2f9 MDL-72588 reportbuilder: convert editing interface into a tab.
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>
2021-10-27 10:05:53 +02:00
Andrew Nicols
349312143d MDL-72013 js: Fix jsdocs to meet stricter eslint 2021-10-21 13:28:00 +08:00
David Matamoros
0457fb6675 MDL-70795 reportbuilder: allow user to view custom reports.
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>
2021-10-19 13:57:30 +01:00
Paul Holden
f47e89a9bd MDL-70795 reportbuilder: editor elements to set column aggregation.
Aggregation of report columns allows the report editor to perform
common types of data aggregation (concatenation, sum, count, etc)
on given columns.
2021-10-19 13:56:05 +01:00
David Matamoros
db7102eba5 MDL-70795 reportbuilder: report configuration for default sorting.
Co-authored-By: Mikel Martín <mikel@moodle.com>
2021-10-19 13:56:05 +01:00
David Matamoros
09b69d04e3 MDL-70795 reportbuilder: custom report filters editor.
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>
2021-10-19 13:56:04 +01:00
Paul Holden
ab596ec11a MDL-70795 reportbuilder: custom report condition editor.
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.
2021-10-19 13:56:04 +01:00
Paul Holden
8ca9e04f9a MDL-70795 reportbuilder: beginnings of the report editor.
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>
2021-10-19 13:56:02 +01:00