To minimise performance issues when displaying courses in Summary view,
we need to conditionally show the "All" paging option. This commit
will prevent the "All" paging option to be shown if there are more than
100 courses to be shown.
* With the summary data being excluded in card/list display modes,
it means that switching to the summary display mode will render the
courses in summary view without the summary text. This patch will ensure
that course summary text are included when switching to the summary
view.
* For list and card views, we only need the course
fields ('id', 'fullname', 'shortname', 'showcoursecategory',
'showshortname', 'visible', and 'enddate').
* For summary view, in addition to the fields from list/card views,
we only need the 'summary' and 'summaryformat'.
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.
Fixed a regression caused by MDL-64194 resulting in Dashboard - Course
overview pagination not working from second page of courses onwards.
Course overview block should now do the following:
- Display no pagination controls when user has no courses
- Display no pagination controls when less than 12 courses to display
- Only display pagination controls up to the number of courses user is
enrolled in
- Work correctly when on a page greater than the second page.
Added additional pagination options based on the amount of courses the user is enrolled in.
This will allow the user to display all courses on one page if they wish, and scale based on their total
courses up to pages of 96 courses, now defaults to `All` if they have less than 12 courses and hides the
dropdown menu as there is only one choice.
Added an admin setting which allows the administrator to set the available layouts for users and which
defaults to all layouts being available, or the card layout only if no layouts are enabled.
If only one layout is enabled, the dropdown `nav-display-selector` template will not be displayed as
it can no longer be utilised.
If the user preference is set to a layout that is no longer available, this is ignored and the first
available layout defaulted to.
Added an administrator setting to set the visibility of the course category for the my overview
block on the users dashboard to support usage scenarios where displaying the course categories will
clutter course overviews.
The pagination was found to be incorrect due to the all the items event not being triggered if the amount
of courses the user has is equal to the amount set via pagination.
The condition could not just be changed to `>=` as this would trigger the event when there were further
pages to display.
A check of `remainingCourses` was added to condition so if the amount of courses on the current loaded
page is less than the pagination amount, or there are no remaining courses, the all items event is
triggered and the pagination bar hidden correctly.
* providers for paging preferences
* Moved the user pref persistence to the factory
* Added client defined namespace in config
* Define custom client events in the client instead of passing to the
factory
* add new preferences for hidden courses
* Modified course filter to use the user preference
* Behat test
* Regex update
* Toggle hide/show
* Update enrolled_course getter to pass hidden value
* provider
* unit tests