88 Commits

Author SHA1 Message Date
Andrew Nicols
7e77e66350
MDL-78938 course: Wrap manual completion toggle in pending
This commit makes two changes to reduce random failures in behat:
- wrap the toggling of manually configured completion in pendingjs
- set the loading spinner content without forcing the completion toggle
  ws to wait for the loading spinner to update.
2023-08-16 20:05:24 +08:00
Amaia Anabitarte
3a38791d62 MDL-76993 core_course: Recover move right/left functionality
This is a backport of MDL-76990
2023-04-11 13:28:00 +02:00
Laurent David
fbbdfefdb6 MDL-77712 core_course: Fix exception with inplace editor
* On fresh install, an exception is raised when we try to modify
the name of a newly inserted activity in the front page
2023-04-03 10:43:11 +02:00
Andrew Nicols
cd48ae56c7 MDL-77559 js: Rebuild all JS with Node 16 2023-03-09 09:53:19 +08:00
Andrew Nicols
288620b0b4 MDL-75012 js: Full build of all grunt things 2023-03-02 12:15:25 +08:00
Sara Arjona
78a1791e24 Merge branch 'MDL-75567-master' of https://github.com/justusdieckmann/moodle 2022-11-17 13:06:28 +01:00
Justus Dieckmann
877474fb37 MDL-75567 core_course: Other hidden badges remain when adding new one 2022-10-08 23:01:29 +02:00
Mihail Geshoski
383e1893b2 MDL-68437 course: ws support to optionally fetch only active users
Modifies the 'core_course_get_enrolled_users_by_cmid' webservice and
the generic js methods that call this webservice and enables defining
whether the ws should only return the active users or all enrolled
users in the course.
2022-09-30 02:23:18 +08:00
Ferran Recio
8777705827 MDL-73933 core_courseformat: hide and show reactive action
Hide, show and stealth actions were still using the old YUI
module. Now they are using the new course editor
2022-09-15 16:39:29 +02:00
Andrew Nicols
4bb0feb176 MDL-73952 course: Revert iscurrent => highlighted rename 2022-03-28 14:37:55 +08:00
Andrew Nicols
495da02824 MDL-73952 core_course: Rename iscurrent to highlighted
The term 'iscurrent' suggests that something is current, when this may
not be technically true. The term highlight is more appropriate as we
are highlighting content. Whether that content is for the current week
may also be true, but it may be that some course formats allow multiple
sections to be highlighted.
2022-03-28 13:15:12 +08:00
Andrew Nicols
a313795354 Merge branch 'MDL-73952-master' of https://github.com/bmbrands/moodle 2022-03-28 13:09:55 +08:00
Andrew Nicols
44a4e78075 MDL-74112 course: Support multiple mforms in format chooser
The format chooser JS assumes that it is the only mform on the page. If
it is not, and another mform appears before it, then the jump will not
work.

This change:
* updates the formatchooser to modern JS
* allows multiple forms to exist on the page
* stops using id fields
* always hide the format selection button
2022-03-17 11:11:53 +08:00
Bas Brands
c3f0f59134 MDL-73952 core_course: update section badges using JS 2022-03-14 09:10:07 +01:00
Jun Pataleta
baf360a7ba Merge branch 'MDL-73915-master-terser' of https://github.com/andrewnicols/moodle 2022-02-24 17:29:17 +08: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
Ferran Recio
d8b8f9bc3b MDL-73683 core_courseformat: match hasRestrictions criteria
Orignally, the lock icon in the course index and the course content
represents different things and it was confusing for users. Now both
section and cm state data calculate the hasRestrictions attribute the
same way as the course content lock icons.
2022-02-18 12:51:15 +01:00
Michael Hawkins
e01f2d514a MDL-73068 timeline: Update courses view to omit courses without events
Previously, the timeline block courses view included all courses in
alphabetical order, whether they contained any events matching the
relevant filters or not. This could be tedious and misleading if there
were many courses with no events appearing before a course which did
have matching events. Now, courses are only included if they contain
events matching the currently set time filter and search term. When
those values are modified, the block will be refreshed and fetch
results for the current values, and also takes these into
consideration when determining whether to display the show more courses
button.
2022-01-18 18:22:45 +08:00
Bas Brands
cdb651d46a MDL-71691 core_course: section styling 2021-12-08 13:14:05 +01:00
Ferran Recio
675f8e24ca MDL-72776 theme_boost: new editing progress effect 2021-11-22 08:57:10 +01:00
Ferran Recio
461226ed27 MDL-72569 core_courseformat: aria-tree to move tool 2021-11-02 16:00:12 +01:00
Ferran Recio
3d2a6eacae MDL-71779 core_courseformat: reactive add and delete sections 2021-10-28 16:41:17 +02:00
Ferran Recio
fb7d246a29 MDL-71663 core_courseformat: add move tool 2021-10-20 15:27:45 +02:00
Ferran Recio
639a99014d MDL-71834 course: lock elements
Now components has a new property lock to disable all user interactions.
This is applied directly into the course index and course content to
freeze an element if some action is performed over it. To set this
locked value there are 2 new mutations cmLock and sectionLock.
2021-09-29 11:34:43 +02:00
Ferran Recio
23499e6447 MDL-71664 course: add browser native drag and drop 2021-09-22 11:08:06 +02:00
Ferran Recio
7659a18993 MDL-71228 course: sorting course on section state change 2021-09-09 11:16:10 +02:00
Ferran Recio
ef745009ed MDL-71209 courseformat: add state suport to legacy action
Adapt the current course editing libraries to modify also
the course state data. This way, any UI component that
watches the course structure can react to the changes.
2021-08-20 16:49:06 +02:00
Ferran Recio
21d93554d4 MDL-71863 courseformat: create courseformat subsystem 2021-06-28 13:50:18 +02: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
Ferran Recio
e6779782dc MDL-71134 course: new course editor reactive module
The new course editor for Moodle 4.0 is the first AMD
module that will use the new reactive library. This
commit creates creates the initial structure of the
new course editor frontend.
2021-06-10 16:08:39 +02:00
Jun Pataleta
13f88df351 MDL-70821 course: Cover availability conditions for manual completion
When an activity has manual completion tracking, pressing the manual
completion checkbox reloads the page after toggling the completion
state when the activity is linked to availability conditions.
The "Mark as done" button needs to mimic this behaviour as well.

The approach being taken here is to add a core_course/view JS module
for the course homepage which listens for the manualCompletionToggled
event and reloads the page when the activity module has availability
conditions tied to it.

Perhaps for future development, instead of reloading the page, the
container of the restricted course sections/activities can reloaded via
AJAX as well.
2021-04-12 11:41:37 +08:00
Jun Pataleta
642059155c MDL-70821 course: Create manualCompletionToggled event
Add a new "manualCompletionToggled" course event and dispatch this
when the manual completion state for an activity is toggled.
2021-04-12 11:41:37 +08:00
Jun Pataleta
dd32d65f3a MDL-70817 core_course: Create an activity information output component
The activity information output component displays information about
an activity module that can contain:
1. Activity dates
2. Completion information
   a. A manual completion button; or
   b. A list of automatic completion conditions and their statuses.

This patch also includes a new JS module called
core_course/manual_completion_toggle for toggling the
completion state of activities that support manual completion.
2021-04-02 21:53:20 +08:00
Jun Pataleta
3c5b29e75d MDL-70817 core_course: Add manual completion toggle to repository
Add the functionality of toggling the completion state of an
activity with manual completion to the core_course/repository
JS module.
2021-04-02 21:53:20 +08:00
Jun Pataleta
3a960c15a4 MDL-70817 core_course: Convert core_course/repository to ES6 2021-04-02 21:53:20 +08:00
Shamim Rezaie
7bd6145d13 MDL-69301 course: Remove custom keyboard navigation code 2020-12-02 22:57:44 +11:00
Michael Hawkins
d1f0ca6e3c MDL-70033 course: Update download content event handling for Classic 2020-11-03 11:53:57 +08:00
Michael Hawkins
d661b1148b MDL-69559 course: Add course content download UI and execution page 2020-10-26 10:00:47 +08:00
Bas Brands
c549ca5d35 MDL-69454 core_search: consistent activity chooser search 2020-09-21 11:54:53 +02:00
Mihail Geshoski
3295288d6e MDL-69079 course: Handle fetch module data failures in activity chooser 2020-07-24 10:33:50 +08:00
Mihail Geshoski
8ee9fbca8d MDL-60621 core_course: Disable scrollable in the activity chooser modal 2020-06-30 10:18:19 +08:00
Peter Dias
c8388ead0f MDL-69065 course: Provide the id for the sr param
* Pass the section return id to the activity chooser
* Additional behat test to cover the case
2020-06-23 13:19:07 +08:00
Mathew May
16d77f1884 MDL-67883 core: Make core ready for MoodleNet. 2020-06-05 11:47:42 +08:00
Mathew May
e74bcf19f3 MDL-68821 course: Add a attr check for the chooser 2020-06-02 11:11:15 +08:00
Mathew May
e146a2ca74 MDL-68662 core_course: Add new tabs to the chooser
We now have two more tabs in the chooser.
Activities & Resources aer now offered in different tabs.
2020-05-20 15:53:06 +08:00
Adrian Greeve
5ec37d28a6 Merge branch 'master_MDL-64843_course_copy_ui' of https://github.com/catalyst/moodle 2020-05-18 10:35:44 +08:00
Matt Porritt
01436f7539 MDL-64843 Backup: Course copy user interface
This patch adds better core support for copying courses.
There is now a simplified and dedicated UI for copying
courses. This can be accessed from the course context
menu or course management screens.

All backups are done asynchronously and there can be multiple
copies of a course in flight at once.
2020-05-15 06:02:02 +00:00