87 Commits

Author SHA1 Message Date
Jun Pataleta
e0ef590b00
MDL-78370 block_myoverview: Ensure curry functions use current filters 2024-02-20 13:48:24 +08:00
Jun Pataleta
8c26445d8d
MDL-78370 block_myoverview: Conditionally show "All" paging option
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.
2024-02-20 13:48:24 +08:00
Jun Pataleta
3056f6cdbd
MDL-78370 block_myoverview: Ensure that the summary text will be loaded
* 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.
2024-02-20 13:48:23 +08:00
Jun Pataleta
40c329064b
MDL-78370 block_myoverview: Define required fields for views
* 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'.
2024-02-20 13:48:23 +08:00
Paul Holden
c5d1f72dca
MDL-62859 javascript: replace user preference calls with new methods. 2023-05-22 13:51:39 +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
Eloy Lafuente (stronk7)
89e020a872 Merge branch 'MDL-74114-master' of https://github.com/aanabit/moodle 2022-03-16 22:13:57 +01:00
Shamim Rezaie
06b64c8284 MDL-73865 blocks_myoverview: Increase debounce wait to 1 second 2022-03-15 12:45:35 +11:00
Amaia Anabitarte
9bfefc4975 MDL-74114 block_myoverview: Fix set favourite changes 2022-03-14 17:19:49 +01:00
Amaia Anabitarte
7d5190433a MDL-72504 block_myoverview: Show starred course changes 2022-03-08 13:40:43 +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
Amaia Anabitarte
615027ea75 MDL-73343 block_myoverview: Add link to create course for empty content 2022-01-13 09:39:43 +01:00
Huong Nguyen
1f6a45ba21 MDL-72650 Blocks: Use search_input_auto for Course overview and Timeline 2021-12-06 10:49:48 +07:00
Amaia Anabitarte
21eec081fb MDL-73113 block_myoverview: Change All filter names 2021-11-30 18:57:16 +01:00
Mathew May
ccd62d2884 MDL-58579 block_myoverview: Implement searching within myoverview 2021-08-24 16:26:50 +08:00
Mathew May
6cce0bf42e MDL-58579 block_myoverview: Refactor AMD to ES6 2021-08-24 13:43:04 +08:00
Andrew Nicols
4f422785c6 MDL-71113 javascript: Improve basic JS Documentation 2021-06-18 09:38:05 +08:00
Andrew Nicols
92179b7057 MDL-71113 js: Fix all jsdoc warnings 2021-06-18 09:38:05 +08:00
Tom Dickman
c00fc9707f MDL-67623 block overview: fix pagination regression
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.
2020-12-14 13:15:26 +11:00
Andrew Nicols
7cc18dc2ad MDL-68390 js: Update to use Aria mod 2020-07-15 14:40:49 +08:00
Davo Smith
8d166d7745 MDL-66017 block_myoverview: filter by custom course field 2019-10-09 14:25:52 +01:00
Mihail Geshoski
93ad530e8f MDL-64438 block_myoverview: Optionally display course category 2019-09-18 17:55:46 +08:00
Alexander Bias
cd4abbc740 MDL-66016 block_myoverview: Add 'All' course filter 2019-08-23 20:44:19 +02:00
Tom Dickman
c0add7c713 MDL-64860 block_myoverview: added additional pagination options
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.
2019-07-29 09:12:07 +10:00
Ryan Wyllie
195ea4480b MDL-62497 javascript: build AMD modules with new transpiler 2019-07-19 14:12:49 +08:00
Tom Dickman
5f59a4c063 MDL-64901 block_myoverview: admin settings to control available layouts
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.
2019-06-04 08:34:52 +10:00
David Monllaó
a733fce3ac Merge branch 'MDL-64855-37_block_myoverview_course_category_display' of https://github.com/tomdickman/moodle 2019-04-15 07:50:45 +02:00
Tom Dickman
5ae4db8852 MDL-64855 block_myoverview: add setting for course categories display
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.
2019-03-29 12:06:07 +11:00
Tom Dickman
e04b82d30d MDL-64194 block_myoverview: incorrect pagination
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.
2019-03-29 11:54:08 +11:00
Ryan Wyllie
6d9727628a MDL-64376 recentlyaccessedcourses: stop reloading on favourite
Stop reloading the whole content when a single course is favourited
or unfavourited.
2019-02-27 10:50:32 +08:00
Mathew May
a29135f883 MDL-63880 core_course: Move common templates to core_course
Remove repeated templates from myoverview, recentlyaccessedcourse &
starredcourses blocks.
2019-02-07 13:45:12 +08:00
Peter
11988d74b4 MDL-63793 block_myoverview: Persist the user's paging limit preference
* 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
2018-11-19 09:43:00 +08:00
Peter
645cb7dd0f MDL-63457 block_myoverview: Bug fixes
* Updated bootstrap theme to match boost
* Fix up logical errors in js
2018-11-02 10:44:32 +08:00
Andrew Nicols
033adb0242 MDL-63457 block_myoverview: Whitespace fix 2018-11-01 15:10:10 +08:00
Andrew Nicols
f3d077d0a7 Merge branch 'MDL-63457-master' of git://github.com/peterRd/moodle 2018-11-01 15:03:34 +08:00
Peter
fd955097e4 MDL-63457 block_myoverview: JS update to avoid constant network requests
* Expose paged content factory to trigger last page updates
* Remove repetitive network requests on hide/show courses
* Manually do paged dataset modification
2018-11-01 13:36:52 +08:00
lameze
07fdb5a0a3 MDL-63064 block_starredcourses: change events to use pubsub 2018-10-31 10:44:08 -04:00
lameze
0bb6f0b719 MDL-63064 block_myoverview: trigger event when course is starred 2018-10-31 10:44:03 -04:00
Bas Brands
fd68f5a9e0 MDL-63457 block_myoverview: Rerender the paged content and jump
Jump to the page the user was last on after hiding
2018-10-29 08:36:59 +08:00
Peter
c896546ce7 MDL-63457 block_myoverview: Functionality and test updates
* Add identifiers for each card in the view
* Update js to hide instead of reload block
* Behat test updates
2018-10-29 08:36:59 +08:00
Peter
e6f03948d7 MDL-63457 block_myoverview: Hide courses from individual overview blocks
* 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
2018-10-29 08:32:05 +08:00
Andrew Nicols
7583dd6902 MDL-63058 block_myoverview: Whitespace fixes 2018-10-25 14:32:59 +08:00
Bas Brands
4fd6b77043 MDL-63058 block_myoverview: allowing reuse of css classes 2018-10-22 19:28:23 +02:00
Bas Brands
3cfff88516 MDL-63058 block_myoverview: starring and storing preferences 2018-10-20 17:53:35 +02:00
Jun Pataleta
c99b10368f MDL-63337 block_myoverview: Fix illegal whitespaces 2018-10-15 22:06:55 +08:00
Bas Brands
e4b4b9e7da MDL-63337 block_myoverview: add improved block myoverview 2018-10-15 08:42:08 +02:00
Ryan Wyllie
44eb44e415 MDL-63044 block_myoverview: remove timeline view 2018-09-27 13:10:45 +08:00