Commit graph

951 commits

Author SHA1 Message Date
Ferran Recio
3cb49765a4 MDL-79194 core_courseformat: optimize section reload
* When reloading a section, we also forced the reloading of
course modules, resulting in doing the same work twice (once for
the section reload and once for the course module reload)
* Debounce the reloading process so prevent unwanted duplicate
reloads
2023-10-26 11:03:52 +02:00
Andrew Nicols
37092a6485
MDL-79693 core: Move toast regions to document on modal close 2023-10-13 14:16:52 +01:00
Sara Arjona
563851857f
Merge branch 'MDL-79602-master' of https://github.com/HuongNV13/moodle 2023-10-05 13:03:46 +02:00
Huong Nguyen
d0294388d7
MDL-79602 core: Handle empty selection for MoodleNet 2023-10-05 12:10:11 +07:00
Ilya Tregubov
f2ba761bef
Merge branch 'MDL-79157-master' of https://github.com/ferranrecio/moodle 2023-10-04 18:49:19 +08:00
Ferran Recio
0c6a581f1e MDL-79157 output: fix menu subpanels keyboard navigation 2023-10-04 11:07:45 +02:00
Huong Nguyen
5602cc2488
Merge branch 'MDL-79548-master' of https://github.com/mickhawkins/moodle 2023-10-04 10:21:41 +07:00
Ferran Recio
3f985bf3cf
MDL-79458 output: fix subpanels in classic 2023-10-03 13:32:27 +02:00
Michael Hawkins
83998b9ba9
MDL-79548 core: Update MoodleNet modal strings so they can be translated
Previously, the type of share (course/activity) was being injected into
the string, but not from a translation, so did not fully translate. The
MoodleNet type (resource) was working, but has also been replaced here
to avoid inserting one string into another (this was also unnecessary
while resource is the only possible option). This also meant the latter
string could be deprecated.
2023-10-03 18:52:38 +08:00
Huong Nguyen
4a7259f236
Merge branch 'MDL-79224_master' of https://github.com/marxjohnson/moodle 2023-10-03 09:38:53 +07:00
Mark Johnson
6401ca4959 MDL-79224 core: Make Binary datafilter redisplay selected value
The Binary datafilter was returning a single value where all parts of
the API expect an array of values. This was working in most places by
fluke as this value was a single-character string, so doing $value[0]
returned the value. However, it was not working when deciding which
option to mark as selected when re-displaying the filter.

This change makes the filter return an array containing a single integer
value to match the rest of the API, then internally selects that single
value for comparison when deciding if an option should be selected.
2023-10-02 11:50:44 +01:00
Ilya Tregubov
c80e366051
Merge branch 'MDL-79458-master' of https://github.com/ferranrecio/moodle 2023-10-02 13:30:07 +08:00
Jun Pataleta
336ec5580a
Merge branch 'MDL-79041-master-2' of https://github.com/HuongNV13/moodle 2023-09-29 11:59:39 +08:00
Huong Nguyen
f61b060182
Merge branch 'MDL-78813-master' of https://github.com/mihailges/moodle 2023-09-28 12:01:25 +07:00
Huong Nguyen
5c131030fd
MDL-79041 core: Fix typo for MoodleNet resource URL 2023-09-28 11:33:00 +07:00
Mihail Geshoski
4fa621a62f MDL-78813 core: Event to notify when the sticky footer has been toggled
New event in core/sticky-footer that is fired when the sticky footer has
been enabled or disabled. Leveraging this event, modules can create
event listeners and execute actions once the sticky footer has been
toggled.
2023-09-27 10:02:03 +02:00
Ilya Tregubov
386f29a46d
Merge branch 'MDL-77708-master' of https://github.com/sarjona/moodle 2023-09-27 09:07:10 +08:00
Ferran Recio
0184a477d5 MDL-79458 output: fix action menu subpanel behats 2023-09-26 13:22:51 +02:00
Sara Arjona
cc9430929d
MDL-77708 docs: Update references from docs.moodle.org/dev 2023-09-26 10:30:19 +02:00
Jun Pataleta
7a369aa0a8
Merge branch 'MDL-79420-master' of https://github.com/HuongNV13/moodle 2023-09-26 10:57:46 +08:00
Mihail Geshoski
c2628ac3b9 MDL-77035 core: Base js class for a bulk action
Implements a base js class that each individual bulk action
implementation needs to extend. This class contains all common event
listeners, methods (including abstract) that each implementation need
to use. Also, it introduces a default mustache template for the bulk
action trigger elements.
2023-09-20 23:53:43 +02:00
Mihail Geshoski
662a2fca9c MDL-77035 core: Base js class for a bulk actions area
Introduces a base js class that bulk actions area implementations need
to extend. This class contains all common selectors, event listeners,
methods (including abstract) that each implementation would use.
Also, introduces a common template for the bulk actions area.
2023-09-20 23:53:43 +02:00
Huong Nguyen
90e3a3d994
MDL-79420 core: Remove invalid MoodleNet template call 2023-09-20 11:38:54 +07:00
Jake Dallimore
6b214f1c81
MDL-79384 core: fix modal footer logic when rendering it from template
If the footer property is a Templates.render() promise, and the modal is
set to show immediately (show=true), the show() logic - which contains
the footer show/hide logic - can run before the footer content is set
(i.e. before the promise chain is complete). In such cases, the footer
will be marked as hidden and must be made visible again.
2023-09-18 16:04:58 +08:00
Ilya Tregubov
f5050ab31f
Merge branch 'MDL-78255-master' of https://github.com/davewoloszyn/moodle 2023-09-14 17:50:24 +08:00
Huong Nguyen
4ead50e696
MDL-78267 core: Partial course sharing for MoodleNet 2023-09-14 14:59:50 +07:00
Jun Pataleta
9cd44cbf4c
Merge branch 'MDL-79356-master' of https://github.com/HuongNV13/moodle 2023-09-14 11:52:12 +08:00
Huong Nguyen
e1cff527b9
MDL-79356 core: Convert MoodleNet modals to use new static methods 2023-09-14 09:44:19 +07:00
Jun Pataleta
f8b16ea91f
Merge branch 'MDL-78826-master' of https://github.com/roland04/moodle 2023-09-13 19:28:25 +08:00
Andrew Nicols
82761c582c
MDL-78324 core: Deprecate core/modal_factory 2023-09-09 00:05:04 +08:00
Andrew Nicols
48bc688ccd
MDL-78324 core: Convert modals to use new static methods
This commit takes all modals which were not using the legacy
ModalFactory.create triggers and migrates them to the new Modal.create
method.
2023-09-09 00:04:11 +08:00
Andrew Nicols
a797020524
MDL-78324 core: Convert core/tag to esm
This module is converted to ESM in preparation for simplification of
Modal instantiation.
2023-09-09 00:04:03 +08:00
Andrew Nicols
98f0aebde6
MDL-78324 gradereport_singleview: Update modal usage to drop factory use
This change includes some additional simplifications to support this
change, including conversion from done/fail to then/catch, and some
simplification of Promise usage.

There were a number of cases of nested Modal usage which have been
removed.
2023-09-09 00:04:03 +08:00
Andrew Nicols
a54ba682a4
MDL-78324 core: Create modal factory in core/modal
This commits adds a new static `create()` method to replace the existing
ModalFactory.create approach.

This allows the creation of a modal to now be simplified to:

```js
import SomeModalClass from 'mymodule/wherever';

// ...

const modal = await SomeModalClass.create();
```

Prior to this change the modal was instantiated via the ModalFactory,
but the Type of modal was typically pulled from the ModalClass itself
via the registry. Essentially it used to require three modules to
instantiate a single Modal, and now it takes just one.
2023-09-08 23:49:13 +08:00
Andrew Nicols
9073225c98
MDL-78324 core: Simplify modal configuration
This change moves configuration of the modal from the ModalFactory to
a new `configure` function on the Modal class which does exactly the
same thing. This means that the API is fully encapsulated within the
Modal, and an individual Modal can specify its own configuration more
easily.

This change will make it much easier to instantiate new modals,
significantly reducing boilerplate in many instances.

This change allows modals to extend the `configure()` method to provide
their own defaults, or to override standard ones.

```js
class MyModal extends Modal {
    static TYPE = 'my_module/mymodal';
    static TEMPLATE = 'my_module/mymodal';

    configure(params = {}) {
        // Override the default value for large.
        params.large = true;

        super.configure(params);

        // Handle our own properties here.
        const {
          makeSound = true,
        } = params;

        this.setSoundEmitter(makeSound);
    }
```

Prior to this change, it was common to see this happen in the _calling_
code, rather than the modal itself.
2023-09-08 23:49:12 +08:00
Ferran Recio
c87fe6036d MDL-78826 javascript: add dropdown js controls 2023-09-08 10:23:13 +02:00
Andrew Nicols
4bfd20983d
MDL-78779 core: Do not re-render combo searchresults if term unchanged 2023-09-06 12:28:36 +08:00
Andrew Nicols
c7a05345b6
MDL-78779 core: Wrap combobox debounce in pending Promise
This addresses a random failure with the combobox search results where
the debounce causes the results to be shown, and then the same search
result is returned again, re-rendered, and replaced after Behat has
moved on.
2023-09-06 12:27:45 +08:00
Mark Johnson
4b160a7c7b
MDL-72321 datafilter: Stop disabling jointype field
This was causing behat test failures due to the test trying to
set the disabled jointype field before the filter type was selected.
2023-09-01 23:43:20 +08:00
David Woloszyn
ce706f4c3e MDL-78255 lib: Upgrade emoji-data to 15.0.1 2023-09-01 19:01:04 +10:00
Ilya Tregubov
e90d73974a
Merge branch 'MDL-79198-master' of https://github.com/junpataleta/moodle 2023-09-01 11:03:22 +08:00
Andrew Nicols
1ce54ee87e
Merge branch 'MDL-72321_master-squashed' of https://github.com/marxjohnson/moodle 2023-08-31 23:02:35 +08:00
Mark Johnson
2e02264945 MDL-72321 core: Support disabled options in form-autocomplete
Autocomplete fields can now include disabled options in the suggestion
list. When calling .enchance() on a select list with disabled options,
those options will be added to the autocomplete suggestions with the
aria-disabled arribute set, and will not be selectable.

Datafilters using the autocomplete element can also hook into this by
including disabled options in their list of values.
2023-08-31 15:00:38 +01:00
Mark Johnson
7091a3210c MDL-72321 core: Allow datafilters to specify a subset of join types
A datafilter can now specify a subset of jointypes that it supports from
the default list of all, any or none. By default all options will be
available, but an individual filter can ovveride this to include just
those options that make sense for the filter. If only one option is
allowed, the select list will be hidden to simplify the UI.
2023-08-31 15:00:37 +01:00
Nathan Nguyen
ef8c11328b MDL-72321 core: Add binary datafilter
This adds a new datafilter type which provides a single binary choice
(for example yes/no).
2023-08-31 15:00:37 +01:00
Sara Arjona
2ec4ac7e4a
Merge branch 'MDL-78612-master' of https://github.com/andrewnicols/moodle 2023-08-30 17:55:32 +02:00
Andrew Nicols
c85cca3e33
MDL-78612 core: Wrap modal_factory.create in pendingPromise 2023-08-30 12:41:37 +08:00
Jun Pataleta
59fff99a94
MDL-79198 core: Increment static variable properly 2023-08-29 16:44:16 +08:00
Jun Pataleta
cc7bc1a553
Merge branch 'MDL-79064-master' of https://github.com/andrewnicols/moodle 2023-08-29 13:32:45 +08:00
Andrew Nicols
af7719682d
MDL-79064 core: Update all get_strings as uses 2023-08-29 10:57:54 +08:00