MDL-68977 enrol_manual: Add pending promises to enrol modal
authorAndrew Nicols <andrew@nicols.co.uk>
Wed, 10 Jun 2020 00:16:03 +0000 (08:16 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Wed, 10 Jun 2020 00:16:03 +0000 (08:16 +0800)
enrol/manual/amd/build/quickenrolment.min.js
enrol/manual/amd/build/quickenrolment.min.js.map
enrol/manual/amd/src/quickenrolment.js

index a451f2b..02411ec 100644 (file)
Binary files a/enrol/manual/amd/build/quickenrolment.min.js and b/enrol/manual/amd/build/quickenrolment.min.js differ
index 7561852..d587cfe 100644 (file)
Binary files a/enrol/manual/amd/build/quickenrolment.min.js.map and b/enrol/manual/amd/build/quickenrolment.min.js.map differ
index ee67d3c..1034c2b 100644 (file)
@@ -29,6 +29,7 @@ import ModalEvents from 'core/modal_events';
 import ModalFactory from 'core/modal_factory';
 import Notification from 'core/notification';
 import jQuery from 'jquery';
+import Pending from 'core/pending';
 import Prefetch from 'core/prefetch';
 
 const Selectors = {
@@ -85,6 +86,8 @@ const registerEventListeners = contextId => {
  * @returns {Promise}
  */
 const showModal = (dynamicTable, contextId) => {
+    const pendingPromise = new Pending('enrol_manual/quickenrolment:showModal');
+
     return ModalFactory.create({
         type: ModalFactory.types.SAVE_CANCEL,
         large: true,
@@ -130,6 +133,8 @@ const showModal = (dynamicTable, contextId) => {
         })
         .catch();
 
+        pendingPromise.resolve();
+
         return modal;
     })
     .catch(Notification.exception);