217 Commits

Author SHA1 Message Date
Paul Holden
7143cf4cbc
MDL-79397 reportbuilder: update existing entity table definitions. 2023-12-07 17:19:01 +00:00
Ilya Tregubov
8d7511b230
Merge branch 'MDL-79446' of https://github.com/paulholden/moodle 2023-11-06 09:13:47 +08:00
Paul Holden
28134fe199
MDL-79446 reportbuilder: native support for parameter name suffixes. 2023-11-02 09:27:07 +00:00
Paul Holden
934a851705
MDL-79346 cohort: add "visible" filter/condition to report source.
Add to report as part of default setup.
2023-10-13 10:52:22 +01:00
Paul Holden
db5c663fb9
MDL-76902 course: create categories datasource for custom reporting.
New report source based on the course category entity, joined to the
course, cohort and role assignment/user entities to provide data for
the reportbuilder editor.
2023-08-23 13:42:27 +01:00
Ilya Tregubov
5f7839f06b
MDL-78522 cohort: Fix capability/visibility check. 2023-07-07 15:41:14 +08:00
Paul Holden
05ee8a20a6
MDL-78071 cohort: disable report actions for managed cohorts. 2023-06-19 15:01:14 +01:00
Paul Holden
695fa397f2
MDL-77532 cohort: include custom fields in cohort report entity. 2023-05-19 18:11:50 +01:00
Dmitrii Metelkin
c11d4284be MDL-77130 cohort: add custom fields 2023-04-04 13:01:40 +10:00
Mathew May
e5ca7766e7 MDL-52805 core: Remove legacy log calls 2023-03-07 13:08:46 +08:00
Paul Holden
2f73d7a232 MDL-76611 cohort: prevent duplicate idnumber in inplace editable. 2023-02-13 10:33:23 +00:00
David Matamoros
cf86329c7a MDL-77058 reportbuilder: Fix for cohort null idnumber column 2023-01-27 13:53:44 +01:00
Andrew Nicols
a3cc26f8bb MDL-76583 core: Update uses of external_* classes 2023-01-19 07:34:09 +08:00
David Mudrák
50ba9dc72c MDL-76739 lang: Use the fixed strings in the tests, too 2023-01-12 09:17:27 +08:00
Marina Glancy
064eccd4fc MDL-75525 reportbuilder: specify initial sorting for datasources 2022-11-07 15:43:45 +01:00
Paul Holden
429508a7b4 MDL-76142 cohort: cross DB support for description filter.
Specifically avoids Oracle exception ORA-00932.
2022-11-01 14:05:39 +00:00
David Matamoros
b0802f49a6 MDL-73141 core_cohort: Convert cohort listing to Report Builder 2022-10-29 12:45:50 +02:00
Paul Holden
b3828cebd2 MDL-75034 reportbuilder: move classes into consistent namespace.
Use `reportbuilder` level two namespace for report related classes
(entities, system reports, etc) within components and sub-systems.
2022-10-07 15:05:34 +01:00
Paul Holden
3c3f6abd43 MDL-74284 cohort: set page title on upload tab.
Override active URL when viewing system/all cohorts for consistent
breadcrumb navigation.
2022-09-20 13:09:11 +01:00
Paul Holden
b40d438fbf MDL-75708 reportbuilder: consider stress tests as requiring longtest.
We should respect the value of the PHPUNIT_LONGTEST constant in the
report source stress tests, as it was discovered after 165e26fa that
the default configuration of some CIs (GHA) was not sufficient to run
them.

Hence, use the PHPUNIT_LONGTEST to determine whether to execute said
tests. Note this constant is enabled on internal CI.
2022-09-09 11:11:39 +01:00
Paul Holden
208adcf3d1 MDL-73938 reportbuilder: better Oracle support of long text columns.
Specifically during column grouping/aggregation, we need to avoid CLOB
datatype inconsistencies (ORA-00932).
2022-09-05 12:08:54 +01:00
Paul Holden
165e26fad9 MDL-73938 reportbuilder: helper methods for automating report tests.
Implement stress tester methods for iterating over report columns,
aggregation and conditions. Assert that each works correctly in
isolation, and when used in conjunction with other columns.
2022-09-05 12:07:17 +01:00
Víctor Déniz
5087f56905 Merge branch 'MDL-75119' of https://github.com/paulholden/moodle 2022-07-19 13:48:58 +01:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Paul Holden
dc60fe6662 MDL-75119 reportbuilder: preload context data for column callbacks.
This prevents additional requests for context instances in the
callback methods, by preloading all required data in the initial
field select.
2022-07-04 13:07:02 +01:00
Sara Arjona
47097ae519 Merge branch 'MDL-74678' of https://github.com/lostrogit/moodle 2022-06-07 17:01:18 +02:00
Paul Holden
40c574cd74 MDL-73988 reportbuilder: support for getting entity joins in reports.
This allow reports using multiple entities to more easily define the
relationship between them, specifically when they share common joined
tables.
2022-05-19 16:35:09 +01:00
Carlos Castillo
0b82e9e9b3 MDL-74678 reportbuilder: Allow null in category description callback
Since category description is a nullable column, we need to allow null
value in category description column callback in category entity
2022-05-13 08:08:37 -05:00
David Matamoros
5e68da7868 MDL-74497 reportbuilder: Use new methods in existing datasources
- Replace all individual calls to add all columns, filters and
conditions on the cohorts datasource with the new
method add_all_from_entities().

- Replace all individual calls to add all columns, filters and
conditions on the courses datasource with the new
method add_all_from_entities().

- Replace all individual calls to add all columns, filters and
conditions on the users datasource with the new
method add_all_from_entity().
2022-05-13 08:36:31 +02:00
Sujith Haridasan
aa1c2e2382 MDL-73848 administration: Fix the breadcrumbs and nav highlights
Create or update the breadcrumbs in the site administration
pages where it is required.
Highlight the corresponding site adminstration tab.
Highlight the primary nav to Site administration when user
is navigating to any of the site administration pages.

Also changed the boostnavbar so that the nodes in the secondary
navigation are not shown in the breadcrumbs when user is in site
administration page.
2022-03-25 17:44:47 +08:00
Paul Holden
b73a69b920 MDL-74175 cohort: correct type/callback of entity category column. 2022-03-15 15:28:54 +00:00
Eloy Lafuente (stronk7)
4003e31983 MDL-73785 phpunit: Move more tests to use correct names and namespaces
Applied the following changes to various testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:

- When belonging to other components and being valid api:
  - analytics related tests have been moved to tests/analytics subdir.
  - backup & restore related tests have been moved to tests/backup subdir.
  - events related tests have been moved to tests/event subdir.
  - privacy related tests have been moved to tests/privacy.
  - task related tests have been moved to tests/task subdir.
- Some simple renames, not including the component part anymore (not
  needed now that they are namespaced):
  - some xxxlib_test.php have been renamed lib_test.php
    (when they where testing the corresponding lib.php).
  - cache stores tests have been all renamed store_test, originally
    each one had its own name (file_test, apcu_test, redis_test...)
  - assign feedback tests have been all renamed feedback_test, originally
    each one had its own name (file_test, editpdf_test...)
2022-03-03 12:19:30 +01:00
Mihail Geshoski
0cbe8704ee MDL-73169 core_cohort: Update course category breadcrumb nodes 2022-03-02 17:27:38 +08:00
Eloy Lafuente (stronk7)
100bc51f1d MDL-73485 phpunit: externallib, generator and filter tescase names
All externallib_test, generator_test and filter_test classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to tests under testing/tests:

1) The core_testing component doesn't exist.
2) But testing/tests are allowed because there is a suite pointing to it (phpunit.xml).
3) So, the only possible namespace for them is "core".
4) And to avoid problems with other core testcases (under lib/tests)
   they have been renamed to have testing_xxxx as prefix.

Finally, also modified calendar/tests/events/events_test.php because it uses
some renamed (core_calendar_externallib_testcase => \core_calendar\externallib_test)
classes.
2022-01-21 19:48:23 +01:00
Eloy Lafuente (stronk7)
e4a2d9c1d4 MDL-73348 phpunit: normalize all privacy provider tests
As far as now all them have correct privacy level2 namespace:
- Move them to "privacy" subdir.
- Rename the files to "provider_test.php", this includes old
  privacy_test.php and privacy_provider_test.php files
- Rename the testcase to provider_test too (to match file name)

Also, change some relative paths and comments to point to new
locations.
2021-12-17 14:21:02 +01:00
Eloy Lafuente (stronk7)
57e6fb7ad9 MDL-73348 phpunit: privacy and privacy_provider testcase names
All privacy_test and privacy_provider_test classes:

- Namespaced with component\privacy.
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed.
- Renamed a few files to make all be privacy_test or privacy_provider_test.php
- All them passing individually.
- Complete runs passing too.
2021-12-17 14:21:02 +01:00
abgreeve
fcd4de8639 MDL-72090 navigation: Update to behat feature files for navigation.
This updates feature files to use the new steps to navigate to certain
pages.
2021-12-09 11:13:35 +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
881dccaa7d MDL-73069 reportbuilder: filter/condition for selecting user.
This allows a report creator to create personalised reports
according to the user who is viewing the report.
2021-11-22 09:17:52 +00:00
Paul Holden
7071e4dfd4 MDL-72172 reportbuilder: fix cohort report source tests.
Choose aggregation method that has availability across all
supported databases; and allows sorting.

"Comma separated distinct values" doesn't fulfill either of
these criteria.
2021-11-01 15:42:35 +02:00
Ilya Tregubov
2b45c78426 Merge branch 'MDL-72172-master' of git://github.com/dravek/moodle 2021-11-01 07:26:34 +01: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
Paul Holden
bbf95413fb MDL-72172 cohort: implement cohort datasource for custom reporting.
Create two entities exposing reportable data on site cohorts and
their members, via column and filter definitions.

Create report source bringing them together along with the user
entity to provide data for the reportbuilder editor.

Co-authored-by: Carlos Castillo <carlos.castillo@moodle.com>
2021-10-26 15:36:36 +02:00
Paul Holden
0645319e62 MDL-72309 course: make category a required field in forms.
Course category fields were changed en masse from simple select
elements to autocompletes in 93d72205, but weren't defined as
required fields. This could lead to exceptions and/or unexpected
behaviour if their values were cleared prior to form submission.
2021-10-04 08:11:32 +01:00
Jun Pataleta
385438b463 Merge branch 'MDL-72589' of https://github.com/stronk7/moodle 2021-09-16 09:46:56 +08:00
Eloy Lafuente (stronk7)
9f9fe79c26 MDL-72589 behat: Add @skip_chrome_zerosize to failing scenarios
All the scenarios failing with Chrome zero-size errors are
getting the @skip_chrome_zerosize to be able to keep them apart from
regular runs. See MDL-71108 for more information about
that error.

They will be run by another job, specifically using that tag to
keep them failing and under control.
2021-09-15 20:25:11 +02:00
Sara Arjona
3f2f2e85bb MDL-72115 course: Rename Miscellaneous category
The "Miscellaneous" course category has been renamed to Category 1.
Besides, the description field has been set from FORMAT_MOODLE to
FORMAT_HTML.
2021-09-13 08:36:17 +02:00
Adrian Greeve
7d435fb5f2 MDL-70196 navigation: Update to feature files.
- Part of: MDL-69588
A lot of tests rely on the last element of the breadcrumb being
active. This updates feature files to not rely on this anymore.
2021-08-23 17:46:38 +08:00
Paul Holden
42a59cbc66 MDL-71661 cohort: support custom user profile fields. 2021-05-24 15:02:35 +01:00
Eloy Lafuente (stronk7)
8a14a7bd22 MDL-71036 phpunit: assertContains() now performs strict comparison
The methods assertContains() and assertNotContains() now perform
strict (type and value) comparison, pretty much like assertSame()
does.

A couple of new assertContainsEquals() and assertNotContainsEquals()
methods have been created to provide old (non-strict) behavior, pretty
much like assertEquals() do.

Apart from replacing the calls needing a relaxed comparison to those
new methods, there are also a couple of alternative, about how to
fix this, depending of every case:

- If the test is making any array_values() conversion, then it's better
  to remove that conversion and use assertArrayHasKey(), that is not
  strict.
- Sometimes if may be also possible to, simply, cast the expectation
  to the exact type coming in the array. I've not applied this technique
  to any of the cases in core.

Link: https://github.com/sebastianbergmann/phpunit/issues/3426
2021-03-11 23:04:31 +01:00