@instructure/quiz-core 18.3.1-rc.4 → 18.3.1-rc.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,6 +10,7 @@ import { removeSharedBank, updateSharedBankPermission as updateSharedBankPermiss
10
10
  import { clear, newActiveBankEntry, newActiveBank } from "../../common/actions/ui.js";
11
11
  import t from '@instructure/quiz-i18n/es/format-message';
12
12
  import { handleError } from "../../common/api/helpers.js";
13
+ import { removeFromPolling } from "./copyingBanksPoller.js";
13
14
  import { BANKS_BANK_PAGINATION, BANKS_BANK_ENTRY_PAGINATION, DELETE_BANK_CALL, UPDATE_BANK_CALL, CAN_EDIT, READ_ONLY, REMOVED_ACCESS, SHARED_WITH_USER, SHARED_WITH_COURSE } from '@instructure/quiz-common';
14
15
  import { noop } from 'lodash';
15
16
  import { NIL } from 'uuid';
@@ -160,6 +161,7 @@ export var updateBank = function updateBank(bank) {
160
161
  };
161
162
  };
162
163
  export var deleteBank = function deleteBank(bankId) {
164
+ removeFromPolling([bankId]);
163
165
  var url = "".concat(banksApiEndpoint, "/").concat(bankId);
164
166
  return function (dispatch, getState) {
165
167
  var fetcher = new Fetcher({
@@ -19,6 +19,11 @@ export var addToPolling = function addToPolling(bankId, bankTitle) {
19
19
  }
20
20
  };
21
21
  };
22
+ export var removeFromPolling = function removeFromPolling(removeIds) {
23
+ pollingBanks = pollingBanks.filter(function (bank) {
24
+ return !removeIds.includes(bank.id);
25
+ });
26
+ };
22
27
 
23
28
  var handlePollingBanks = /*#__PURE__*/function () {
24
29
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch) {
@@ -69,7 +74,7 @@ var handlePollingBanks = /*#__PURE__*/function () {
69
74
  finishedCopyingIds = finishedCopying.map(function (bank) {
70
75
  return bank.id;
71
76
  });
72
- removeFinishedCopies(finishedCopyingIds);
77
+ removeFromPolling(finishedCopyingIds);
73
78
 
74
79
  if (pollingBanks.length > 0) {
75
80
  setTimeout(function () {
@@ -90,10 +95,4 @@ var handlePollingBanks = /*#__PURE__*/function () {
90
95
  return function handlePollingBanks(_x) {
91
96
  return _ref.apply(this, arguments);
92
97
  };
93
- }();
94
-
95
- var removeFinishedCopies = function removeFinishedCopies(finishedCopyingIds) {
96
- pollingBanks = pollingBanks.filter(function (bank) {
97
- return !finishedCopyingIds.includes(bank.id);
98
- });
99
- };
98
+ }();
@@ -32,6 +32,8 @@ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/f
32
32
 
33
33
  var _helpers = require("../../common/api/helpers.js");
34
34
 
35
+ var _copyingBanksPoller = require("./copyingBanksPoller.js");
36
+
35
37
  var _quizCommon = require("@instructure/quiz-common");
36
38
 
37
39
  var _lodash = require("lodash");
@@ -204,6 +206,7 @@ var updateBank = function updateBank(bank) {
204
206
  exports.updateBank = updateBank;
205
207
 
206
208
  var deleteBank = function deleteBank(bankId) {
209
+ (0, _copyingBanksPoller.removeFromPolling)([bankId]);
207
210
  var url = "".concat(banksApiEndpoint, "/").concat(bankId);
208
211
  return function (dispatch, getState) {
209
212
  var fetcher = new _Fetcher.default({
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.addToPolling = void 0;
8
+ exports.removeFromPolling = exports.addToPolling = void 0;
9
9
 
10
10
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
11
 
@@ -37,6 +37,14 @@ var addToPolling = function addToPolling(bankId, bankTitle) {
37
37
 
38
38
  exports.addToPolling = addToPolling;
39
39
 
40
+ var removeFromPolling = function removeFromPolling(removeIds) {
41
+ pollingBanks = pollingBanks.filter(function (bank) {
42
+ return !removeIds.includes(bank.id);
43
+ });
44
+ };
45
+
46
+ exports.removeFromPolling = removeFromPolling;
47
+
40
48
  var handlePollingBanks = /*#__PURE__*/function () {
41
49
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(dispatch) {
42
50
  var getSpecificBanksFn,
@@ -86,7 +94,7 @@ var handlePollingBanks = /*#__PURE__*/function () {
86
94
  finishedCopyingIds = finishedCopying.map(function (bank) {
87
95
  return bank.id;
88
96
  });
89
- removeFinishedCopies(finishedCopyingIds);
97
+ removeFromPolling(finishedCopyingIds);
90
98
 
91
99
  if (pollingBanks.length > 0) {
92
100
  setTimeout(function () {
@@ -107,10 +115,4 @@ var handlePollingBanks = /*#__PURE__*/function () {
107
115
  return function handlePollingBanks(_x) {
108
116
  return _ref.apply(this, arguments);
109
117
  };
110
- }();
111
-
112
- var removeFinishedCopies = function removeFinishedCopies(finishedCopyingIds) {
113
- pollingBanks = pollingBanks.filter(function (bank) {
114
- return !finishedCopyingIds.includes(bank.id);
115
- });
116
- };
118
+ }();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "18.3.1-rc.4+609e9cddc",
3
+ "version": "18.3.1-rc.6+b62a430d4",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -42,11 +42,11 @@
42
42
  "dependencies": {
43
43
  "@instructure/grading-utils": "^1.0.0",
44
44
  "@instructure/outcomes-ui": "^2.1.9",
45
- "@instructure/quiz-common": "18.3.1-rc.4+609e9cddc",
46
- "@instructure/quiz-i18n": "18.3.1-rc.4+609e9cddc",
47
- "@instructure/quiz-interactions": "18.3.1-rc.4+609e9cddc",
48
- "@instructure/quiz-number-input": "18.3.1-rc.4+609e9cddc",
49
- "@instructure/quiz-rce": "18.3.1-rc.4+609e9cddc",
45
+ "@instructure/quiz-common": "18.3.1-rc.6+b62a430d4",
46
+ "@instructure/quiz-i18n": "18.3.1-rc.6+b62a430d4",
47
+ "@instructure/quiz-interactions": "18.3.1-rc.6+b62a430d4",
48
+ "@instructure/quiz-number-input": "18.3.1-rc.6+b62a430d4",
49
+ "@instructure/quiz-rce": "18.3.1-rc.6+b62a430d4",
50
50
  "@instructure/ui-a11y-content": "^7.22.1",
51
51
  "@instructure/ui-alerts": "^7.22.1",
52
52
  "@instructure/ui-avatar": "^7.22.1",
@@ -107,7 +107,7 @@
107
107
  "eventemitter3": "^3.1.0",
108
108
  "humps": "^2.0.0",
109
109
  "immutable": "^3.8.1",
110
- "instructure-validations": "18.3.1-rc.4+609e9cddc",
110
+ "instructure-validations": "18.3.1-rc.6+b62a430d4",
111
111
  "ipaddr.js": "^1.5.4",
112
112
  "isomorphic-fetch": "^2.2.0",
113
113
  "isuuid": "^0.1.0",
@@ -158,7 +158,7 @@
158
158
  "intl": "^1.2.4",
159
159
  "jquery": "^2.2.3",
160
160
  "most-subject": "^5.3.0",
161
- "quiz-presets": "18.3.1-rc.4+609e9cddc",
161
+ "quiz-presets": "18.3.1-rc.6+b62a430d4",
162
162
  "react": "^16.8.6",
163
163
  "react-addons-test-utils": "^15.6.2",
164
164
  "react-dom": "^16.8.6",
@@ -174,5 +174,5 @@
174
174
  "publishConfig": {
175
175
  "access": "public"
176
176
  },
177
- "gitHead": "609e9cddce2517de68c527262aef7c97ed64efe9"
177
+ "gitHead": "b62a430d4c697ed85bfe57cc5c9b5d09c22deab3"
178
178
  }