Commit graph

369 commits

Author SHA1 Message Date
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
Shamim Rezaie
d038fd822d Merge branch 'MDL-72952' of https://github.com/roland04/moodle 2021-11-11 10:38:26 +11:00
Eloy Lafuente (stronk7)
2b18fad922 Merge branch 'MDL-72696' of https://github.com/paulholden/moodle 2021-11-10 19:20:39 +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
Ilya Tregubov
90b40b99fd Merge branch 'MDL-73001-master' of https://github.com/dravek/moodle 2021-11-09 14:55:30 +02:00
Paul Holden
7a7375df4d MDL-72696 behat: support inplace editable fields of type select.
If an inplace editable field is using the "select" type, we should
treat it as a select field when setting it's value during scenarios.
2021-11-08 13:09:05 +00:00
David Matamoros
aaa041a9bd MDL-73001 reportbuilder: Allow to set custom title to fullname columns 2021-11-08 13:54:41 +01:00
Sara Arjona
2a0c4a8a73 Merge branch 'MDL-72978-master' of https://github.com/dravek/moodle 2021-11-08 09:59:47 +01:00
Sara Arjona
f2d2d7810b Merge branch 'MDL-72959' of https://github.com/paulholden/moodle 2021-11-08 08:57:04 +01:00
Eloy Lafuente (stronk7)
37fa747b30 Merge branch 'MDL-72968' of https://github.com/paulholden/moodle 2021-11-04 17:33:38 +01:00
Ilya Tregubov
6b0b757124 Merge branch 'MDL-72961' of https://github.com/paulholden/moodle 2021-11-04 14:40:26 +02:00
Eloy Lafuente (stronk7)
7faf678b59 Merge branch 'MDL-72987' of https://github.com/paulholden/moodle 2021-11-04 12:52:38 +01:00
Sara Arjona
61fef90a74 Merge branch 'MDL-72962' of git://github.com/paulholden/moodle 2021-11-04 12:30:27 +01:00
Eloy Lafuente (stronk7)
9e40598409 Merge branch 'MDL-72960' of https://github.com/paulholden/moodle 2021-11-03 19:09:11 +01:00
Paul Holden
3191443f47 MDL-72987 reportbuilder: reset manager cache between Behat tests. 2021-11-03 15:31:08 +00:00
Paul Holden
c7a7a54495 MDL-72959 reportbuilder: format course/category names in entities. 2021-11-02 16:21:45 +00:00
Paul Holden
628fcdee55 MDL-72962 reportbuilder: format editable element names for output. 2021-11-02 15:43:07 +00:00
David Matamoros
741f47ea7a MDL-72978 reportbuilder: Report name can't have only blank spaces
- Don't allow to set a report name containing only blank spaces when
creating a new report or editing an existing report name.
- Removed TODO from code related to MDL-71086
2021-11-02 16:27:20 +01:00
Paul Holden
d7e10c3dd1 MDL-72968 reportbuilder: breadcrumb navigation for edit/view report. 2021-11-01 16:00:16 +00:00
Paul Holden
cac0068d88 MDL-72961 reportbuilder: move category elements to correct entity. 2021-11-01 15:44:14 +00:00
Paul Holden
677c2df9d6 MDL-72961 reportbuilder: more defensive usage of report elements.
We should gracefully handle invalid element models that refer to
columns, filters, conditions that are no longer defined within the
report/entity they are linked to.
2021-11-01 14:24:27 +00:00
Paul Holden
31ba06b837 MDL-72588 reportbuilder: fix expected exception message in tests.
See change to exception strings in 07b74820.
2021-11-01 11:21:07 +00:00
Paul Holden
8f27f246a5 MDL-72960 reportbuilder: unique delimeters between concat'd fields.
Use delimeters that are less likely to conflict with genuine row
content, for both column fields and field values, in the group
concatenation aggregation methods.
2021-11-01 08:03:59 +00:00
Jun Pataleta
6f7defeeb6 Merge branch 'MDL-72588' of git://github.com/dravek/moodle 2021-11-01 11:22:48 +08:00
Paul Holden
0188af39a1 MDL-72588 reportbuilder: performance improvement to report loader.
Statically cache list of loaded reports during request lifecycle,
this ensures that computationally heavy initialisation routines
in system reports are only executed once (e.g. the access tab).
2021-10-29 12:50:20 +02:00
Paul Holden
42481d5c43 MDL-72588 reportbuilder: fix dynamic loading of report parameters.
This fixes an issue for system reports that are initialised with
parameters (such as the access report). Previously these parameters
were not preserved, when sorting/paging them via AJAX requests.

We now defer the initialisation of the report until the table
filterset has been set, ensuring all parameters are available.
2021-10-29 12:50:20 +02: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
David Matamoros
70085ef7ac MDL-72588 reportbuilder: implement audience helpers and classes.
Create the base audience class, to be extended by all audience types
across the site. Implement types allowing audiences to be created per
user, cohort or system role assignment.

The helper class is used for interrogating report audience instances
and retrieving access lists of those users able to view specific
reports.

Co-authored-by: Paul Holden <paulh@moodle.com>
2021-10-29 12:28:24 +02:00
Eloy Lafuente (stronk7)
4f271297ce Merge branch 'MDL-72879-master-enfix' of git://github.com/mudrd8mz/moodle 2021-10-27 22:12:11 +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
David Matamoros
b2dd94ab8b MDL-72588 reportbuilder: define schema/models for report audiences. 2021-10-27 10:05:44 +02:00
David Mudrák
53bb0947b6 MDL-72879 lang: Use fixed strings in tests, too 2021-10-27 07:37:03 +02:00
Ilya Tregubov
ff33ad50f3 Merge branch 'MDL-72663' of git://github.com/paulholden/moodle 2021-10-26 15:11:49 +02:00
Paul Holden
bd9abebcd1 MDL-72280 course: implement course datasource for custom reporting.
Create new entity for exposing report data on course categories,
joining it to the course entity to provide data for the reportbuilder
editor.

Co-authored-by: Carlos Castillo <carlos.castillo@moodle.com>
2021-10-22 17:19:33 +01:00
Paul Holden
5ec86bf501 MDL-72663 reportbuilder: improvements to column aggregation methods.
The group concatenation types now consistently sort the returned values
and support aggregating columns containing multiple fields and those
with defined callbacks.
2021-10-22 16:17:31 +01:00
Paul Holden
16a65f73e7 MDL-72663 reportbuilder: column API changes to improve aggregation.
Refinements to how columns can be defined in relation to available
aggregation methods:

* Disable aggregation types;
* Set column GROUP BY during aggregation;
* Defer column sorting to that of the aggregation method
2021-10-22 16:17:17 +01: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
Mikel Martín
9000d8d1a0 MDL-70795 reportbuilder: theme updates for custom report editor.
Includes nice interactions for element drag & drop, consistent
styling for templates and tidy up of element alignment/spacing.
2021-10-19 13:56:04 +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
David Matamoros
22d896e063 MDL-70795 reportbuilder: add interface for creating reports.
Implement elements for creating/editing reports, along with
new system report for listing and accompanying JS modules for
user interaction.

Create "Users" datasource as proof-of-concept.

Co-authored-By: Paul Holden <paulh@moodle.com>
2021-10-19 13:55:30 +01:00
Paul Holden
95967d62d5 MDL-70795 reportbuilder: define updated schema for custom reports.
Define new filter/column models, and updated database schema to
match.
2021-10-19 13:48:27 +01:00
Paul Holden
15d5f7a919 MDL-72774 reportbuilder: consistent layout of date/duration filters. 2021-10-13 13:33:49 +01:00