@instructure/quiz-core 20.11.4-rc.4 → 20.11.4-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.
@@ -62,7 +62,7 @@ var handlePollingBanks = /*#__PURE__*/function () {
62
62
  });
63
63
 
64
64
  if ((bankInfo === null || bankInfo === void 0 ? void 0 : bankInfo.status) === 'waiting') {
65
- dispatch(addSuccess(t('Created "{name}" successfully! Duplicate can be seen in \'All Banks\' filter.', {
65
+ dispatch(addSuccess(t('Created "{name}" successfully! Duplicate can be seen in \'Shared with Me\' filter.', {
66
66
  name: bank.title
67
67
  })));
68
68
  } else if (!bankInfo) {
@@ -20,7 +20,6 @@ function mapStateToProps(state, props) {
20
20
  return {
21
21
  itemBankSearchTableEnabled: featureOn('item_bank_search_table'),
22
22
  improvedBankSharingEnabled: featureOn('improved_bank_sharing'),
23
- newItemBankFilterNamesEnabled: featureOn('new_item_bank_filter_names'),
24
23
  usedByCourseEnabled: featureOn('filter_item_banks_used_by_course'),
25
24
  subAccountBankSharingEnabled: featureOn('sub_account_bank_sharing'),
26
25
  scopeType: scopeType,
@@ -56,10 +56,14 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
56
56
  _this = _super.apply(this, arguments);
57
57
 
58
58
  _this.hideAccountSearch = function () {
59
- return _this.props.scopeType === 'courses' || _this.props.scopeType === 'course' || _this.props.scopeType === 'account' && _this.displayThisAccount();
59
+ if (_this.props.scopeType === 'course' || _this.props.scopeType === 'courses' || _this.props.scopeType === 'this_account') {
60
+ return true;
61
+ }
62
+
63
+ return false;
60
64
  };
61
65
 
62
- _this.displayThisAccount = function () {
66
+ _this.isSubAccountLaunch = function () {
63
67
  return _this.props.scope.type === 'account' && _this.props.scope.launch_context_uuid && _this.props.rootAccountUuid && _this.props.scope.launch_context_uuid !== _this.props.rootAccountUuid;
64
68
  };
65
69
 
@@ -102,8 +106,9 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
102
106
  params['search'] = _this.props.searchTerms;
103
107
  }
104
108
 
105
- if (_this.props.subAccountBankSharingEnabled && _this.hideAccountSearch()) {
109
+ if (_this.props.scopeType === 'this_account') {
106
110
  params['account_uuids'] = [_this.props.scope.launch_context_uuid];
111
+ params['scope'] = 'account';
107
112
  } else if (_this.props.searchSelection.length > 0) {
108
113
  params['account_uuids'] = _this.props.searchSelection.map(function (account) {
109
114
  return account.uuid;
@@ -219,13 +224,17 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
219
224
  var message;
220
225
 
221
226
  if (_this.props.scopeType === 'course') {
222
- message = t("Your filter is set to \"Courses\" which will narrow what you can search for.\n Try adjusting the filter to \"Institution\" or \"All My Banks\"");
227
+ message = t("Your filter is set to \"Courses\" which will narrow what you can search for.\n Try adjusting the filter to \"{ topLevelBankFilter }\"", {
228
+ topLevelBankFilter: _this.topLevelBankFilterName()
229
+ });
230
+ } else if (_this.props.scopeType === 'this_account') {
231
+ message = t("Your filter is set to \"This Account\" which will narrow what you can search for.\n Try adjusting the filter to \"{ topLevelBankFilter }\"", {
232
+ topLevelBankFilter: _this.topLevelBankFilterName()
233
+ });
223
234
  } else if (_this.props.scopeType === 'account') {
224
- if (_this.props.subAccountBankSharingEnabled && _this.displayThisAccount()) {
225
- message = t("Your filter is set to \"This Account\" which will narrow what you can search for.\n Try adjusting the filter to \"All My Banks\"");
226
- } else {
227
- message = t("Your filter is set to \"Institution\" which will narrow what you can search for.\n Try adjusting the filter to \"All My Banks\"");
228
- }
235
+ message = t("Your filter is set to \"Institution\" which will narrow what you can search for.\n Try adjusting the filter to \"{ topLevelBankFilter }\"", {
236
+ topLevelBankFilter: _this.topLevelBankFilterName()
237
+ });
229
238
  }
230
239
 
231
240
  return jsx(Billboard, {
@@ -256,26 +265,39 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
256
265
  if (prevProps.sortBy !== this.props.sortBy || prevProps.sortOrder !== this.props.sortOrder || prevProps.searchTerms !== this.props.searchTerms || prevProps.scopeType !== this.props.scopeType || !isEqual(prevProps.searchSelection, this.props.searchSelection)) {
257
266
  this.props.clear(BANKS_BANK_PAGINATION);
258
267
  }
259
- } // Only display the account search for the account and all banks filters
268
+ } // We only care about displaying the account search for the Institution Banks and Shared with Me filters
260
269
 
270
+ }, {
271
+ key: "topLevelBankFilterName",
272
+ value: function topLevelBankFilterName() {
273
+ return this.props.subAccountBankSharingEnabled ? t('Shared with Me') : t('All Banks');
274
+ }
261
275
  }, {
262
276
  key: "renderFilters",
263
277
  value: function renderFilters() {
264
278
  var scopeOptions = [{
265
279
  slug: 'user',
266
- translation: this.props.newItemBankFilterNamesEnabled ? t('All Banks') : t('All My Banks')
280
+ translation: this.topLevelBankFilterName()
267
281
  }, {
268
282
  slug: 'account',
269
- translation: this.props.subAccountBankSharingEnabled && this.displayThisAccount() ? t('This Account') : t('Institution Banks')
283
+ translation: t('Institution Banks')
270
284
  }, {
271
285
  slug: 'courses',
272
- translation: this.props.newItemBankFilterNamesEnabled ? t('Banks Shared to Course') : t('All My Course Banks')
286
+ translation: this.props.subAccountBankSharingEnabled ? t('Shared with Courses') : t('Banks Shared to Course')
273
287
  }];
274
288
 
275
289
  if (this.props.scope.uuid) {
276
290
  scopeOptions.push({
277
291
  slug: 'course',
278
- translation: this.props.newItemBankFilterNamesEnabled ? t('This Course') : t('Course Banks')
292
+ translation: t('This Course')
293
+ });
294
+ }
295
+
296
+ if (this.props.subAccountBankSharingEnabled && this.isSubAccountLaunch()) {
297
+ // Put this option below "Insitution Banks"
298
+ scopeOptions.splice(2, 0, {
299
+ slug: 'this_account',
300
+ translation: t('This Account')
279
301
  });
280
302
  } // display options are displayed when using banks list
281
303
  // non-display options are used for sorting of banks table
@@ -494,7 +516,6 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
494
516
  // can be from consumer
495
517
  navigateToBuild: PropTypes.func,
496
518
  // from consumer
497
- newItemBankFilterNamesEnabled: PropTypes.bool,
498
519
  onShare: PropTypes.func,
499
520
  // from consumer
500
521
  openModal: PropTypes.func.isRequired,
@@ -547,7 +568,6 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
547
568
  sortOrder: 'ascending',
548
569
  searchTerms: null,
549
570
  searchSelection: [],
550
- newItemBankFilterNamesEnabled: false,
551
571
  usedByCourseEnabled: false,
552
572
  itemBankSearchTableEnabled: false,
553
573
  subAccountBankSharingEnabled: false,
@@ -154,7 +154,7 @@ export var BanksList = (_dec = withStyle(generateStyle, generateComponentTheme),
154
154
  name: bank.title
155
155
  }));
156
156
 
157
- _this.props.addInfo(t('Creating "{name} Copy". Duplicate will appear in \'All Banks\' filter.', {
157
+ _this.props.addInfo(t('Creating "{name} Copy". Duplicate will appear in \'Shared with Me\' filter.', {
158
158
  name: bank.title
159
159
  }));
160
160
 
@@ -82,7 +82,7 @@ var handlePollingBanks = /*#__PURE__*/function () {
82
82
  });
83
83
 
84
84
  if ((bankInfo === null || bankInfo === void 0 ? void 0 : bankInfo.status) === 'waiting') {
85
- dispatch((0, _alerts.addSuccess)((0, _formatMessage.default)('Created "{name}" successfully! Duplicate can be seen in \'All Banks\' filter.', {
85
+ dispatch((0, _alerts.addSuccess)((0, _formatMessage.default)('Created "{name}" successfully! Duplicate can be seen in \'Shared with Me\' filter.', {
86
86
  name: bank.title
87
87
  })));
88
88
  } else if (!bankInfo) {
@@ -38,7 +38,6 @@ function mapStateToProps(state, props) {
38
38
  return {
39
39
  itemBankSearchTableEnabled: (0, _featureCheck.featureOn)('item_bank_search_table'),
40
40
  improvedBankSharingEnabled: (0, _featureCheck.featureOn)('improved_bank_sharing'),
41
- newItemBankFilterNamesEnabled: (0, _featureCheck.featureOn)('new_item_bank_filter_names'),
42
41
  usedByCourseEnabled: (0, _featureCheck.featureOn)('filter_item_banks_used_by_course'),
43
42
  subAccountBankSharingEnabled: (0, _featureCheck.featureOn)('sub_account_bank_sharing'),
44
43
  scopeType: scopeType,
@@ -96,10 +96,14 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
96
96
  _this = _super.apply(this, arguments);
97
97
 
98
98
  _this.hideAccountSearch = function () {
99
- return _this.props.scopeType === 'courses' || _this.props.scopeType === 'course' || _this.props.scopeType === 'account' && _this.displayThisAccount();
99
+ if (_this.props.scopeType === 'course' || _this.props.scopeType === 'courses' || _this.props.scopeType === 'this_account') {
100
+ return true;
101
+ }
102
+
103
+ return false;
100
104
  };
101
105
 
102
- _this.displayThisAccount = function () {
106
+ _this.isSubAccountLaunch = function () {
103
107
  return _this.props.scope.type === 'account' && _this.props.scope.launch_context_uuid && _this.props.rootAccountUuid && _this.props.scope.launch_context_uuid !== _this.props.rootAccountUuid;
104
108
  };
105
109
 
@@ -142,8 +146,9 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
142
146
  params['search'] = _this.props.searchTerms;
143
147
  }
144
148
 
145
- if (_this.props.subAccountBankSharingEnabled && _this.hideAccountSearch()) {
149
+ if (_this.props.scopeType === 'this_account') {
146
150
  params['account_uuids'] = [_this.props.scope.launch_context_uuid];
151
+ params['scope'] = 'account';
147
152
  } else if (_this.props.searchSelection.length > 0) {
148
153
  params['account_uuids'] = _this.props.searchSelection.map(function (account) {
149
154
  return account.uuid;
@@ -259,13 +264,17 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
259
264
  var message;
260
265
 
261
266
  if (_this.props.scopeType === 'course') {
262
- message = (0, _formatMessage.default)("Your filter is set to \"Courses\" which will narrow what you can search for.\n Try adjusting the filter to \"Institution\" or \"All My Banks\"");
267
+ message = (0, _formatMessage.default)("Your filter is set to \"Courses\" which will narrow what you can search for.\n Try adjusting the filter to \"{ topLevelBankFilter }\"", {
268
+ topLevelBankFilter: _this.topLevelBankFilterName()
269
+ });
270
+ } else if (_this.props.scopeType === 'this_account') {
271
+ message = (0, _formatMessage.default)("Your filter is set to \"This Account\" which will narrow what you can search for.\n Try adjusting the filter to \"{ topLevelBankFilter }\"", {
272
+ topLevelBankFilter: _this.topLevelBankFilterName()
273
+ });
263
274
  } else if (_this.props.scopeType === 'account') {
264
- if (_this.props.subAccountBankSharingEnabled && _this.displayThisAccount()) {
265
- message = (0, _formatMessage.default)("Your filter is set to \"This Account\" which will narrow what you can search for.\n Try adjusting the filter to \"All My Banks\"");
266
- } else {
267
- message = (0, _formatMessage.default)("Your filter is set to \"Institution\" which will narrow what you can search for.\n Try adjusting the filter to \"All My Banks\"");
268
- }
275
+ message = (0, _formatMessage.default)("Your filter is set to \"Institution\" which will narrow what you can search for.\n Try adjusting the filter to \"{ topLevelBankFilter }\"", {
276
+ topLevelBankFilter: _this.topLevelBankFilterName()
277
+ });
269
278
  }
270
279
 
271
280
  return (0, _emotion.jsx)(_uiBillboard.Billboard, {
@@ -296,26 +305,39 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
296
305
  if (prevProps.sortBy !== this.props.sortBy || prevProps.sortOrder !== this.props.sortOrder || prevProps.searchTerms !== this.props.searchTerms || prevProps.scopeType !== this.props.scopeType || !(0, _isEqual.default)(prevProps.searchSelection, this.props.searchSelection)) {
297
306
  this.props.clear(_quizCommon.BANKS_BANK_PAGINATION);
298
307
  }
299
- } // Only display the account search for the account and all banks filters
308
+ } // We only care about displaying the account search for the Institution Banks and Shared with Me filters
300
309
 
310
+ }, {
311
+ key: "topLevelBankFilterName",
312
+ value: function topLevelBankFilterName() {
313
+ return this.props.subAccountBankSharingEnabled ? (0, _formatMessage.default)('Shared with Me') : (0, _formatMessage.default)('All Banks');
314
+ }
301
315
  }, {
302
316
  key: "renderFilters",
303
317
  value: function renderFilters() {
304
318
  var scopeOptions = [{
305
319
  slug: 'user',
306
- translation: this.props.newItemBankFilterNamesEnabled ? (0, _formatMessage.default)('All Banks') : (0, _formatMessage.default)('All My Banks')
320
+ translation: this.topLevelBankFilterName()
307
321
  }, {
308
322
  slug: 'account',
309
- translation: this.props.subAccountBankSharingEnabled && this.displayThisAccount() ? (0, _formatMessage.default)('This Account') : (0, _formatMessage.default)('Institution Banks')
323
+ translation: (0, _formatMessage.default)('Institution Banks')
310
324
  }, {
311
325
  slug: 'courses',
312
- translation: this.props.newItemBankFilterNamesEnabled ? (0, _formatMessage.default)('Banks Shared to Course') : (0, _formatMessage.default)('All My Course Banks')
326
+ translation: this.props.subAccountBankSharingEnabled ? (0, _formatMessage.default)('Shared with Courses') : (0, _formatMessage.default)('Banks Shared to Course')
313
327
  }];
314
328
 
315
329
  if (this.props.scope.uuid) {
316
330
  scopeOptions.push({
317
331
  slug: 'course',
318
- translation: this.props.newItemBankFilterNamesEnabled ? (0, _formatMessage.default)('This Course') : (0, _formatMessage.default)('Course Banks')
332
+ translation: (0, _formatMessage.default)('This Course')
333
+ });
334
+ }
335
+
336
+ if (this.props.subAccountBankSharingEnabled && this.isSubAccountLaunch()) {
337
+ // Put this option below "Insitution Banks"
338
+ scopeOptions.splice(2, 0, {
339
+ slug: 'this_account',
340
+ translation: (0, _formatMessage.default)('This Account')
319
341
  });
320
342
  } // display options are displayed when using banks list
321
343
  // non-display options are used for sorting of banks table
@@ -533,7 +555,6 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
533
555
  // can be from consumer
534
556
  navigateToBuild: _propTypes.default.func,
535
557
  // from consumer
536
- newItemBankFilterNamesEnabled: _propTypes.default.bool,
537
558
  onShare: _propTypes.default.func,
538
559
  // from consumer
539
560
  openModal: _propTypes.default.func.isRequired,
@@ -586,7 +607,6 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
586
607
  sortOrder: 'ascending',
587
608
  searchTerms: null,
588
609
  searchSelection: [],
589
- newItemBankFilterNamesEnabled: false,
590
610
  usedByCourseEnabled: false,
591
611
  itemBankSearchTableEnabled: false,
592
612
  subAccountBankSharingEnabled: false,
@@ -189,7 +189,7 @@ var BanksList = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
189
189
  name: bank.title
190
190
  }));
191
191
 
192
- _this.props.addInfo((0, _formatMessage.default)('Creating "{name} Copy". Duplicate will appear in \'All Banks\' filter.', {
192
+ _this.props.addInfo((0, _formatMessage.default)('Creating "{name} Copy". Duplicate will appear in \'Shared with Me\' filter.', {
193
193
  name: bank.title
194
194
  }));
195
195
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "20.11.4-rc.4+6259006fa",
3
+ "version": "20.11.4-rc.6+d2dbe1927",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -44,11 +44,11 @@
44
44
  "@instructure/emotion": "^8.51.0",
45
45
  "@instructure/grading-utils": "^1.0.0",
46
46
  "@instructure/outcomes-ui": "^3.2.1",
47
- "@instructure/quiz-common": "20.11.4-rc.4+6259006fa",
48
- "@instructure/quiz-i18n": "20.11.4-rc.4+6259006fa",
49
- "@instructure/quiz-interactions": "20.11.4-rc.4+6259006fa",
50
- "@instructure/quiz-number-input": "20.11.4-rc.4+6259006fa",
51
- "@instructure/quiz-rce": "20.11.4-rc.4+6259006fa",
47
+ "@instructure/quiz-common": "20.11.4-rc.6+d2dbe1927",
48
+ "@instructure/quiz-i18n": "20.11.4-rc.6+d2dbe1927",
49
+ "@instructure/quiz-interactions": "20.11.4-rc.6+d2dbe1927",
50
+ "@instructure/quiz-number-input": "20.11.4-rc.6+d2dbe1927",
51
+ "@instructure/quiz-rce": "20.11.4-rc.6+d2dbe1927",
52
52
  "@instructure/ui-a11y-content": "^8.51.0",
53
53
  "@instructure/ui-alerts": "^8.51.0",
54
54
  "@instructure/ui-avatar": "^8.51.0",
@@ -112,7 +112,7 @@
112
112
  "file-saver": "~2.0.5",
113
113
  "humps": "^2.0.0",
114
114
  "immutable": "^3.8.1",
115
- "instructure-validations": "20.11.4-rc.4+6259006fa",
115
+ "instructure-validations": "20.11.4-rc.6+d2dbe1927",
116
116
  "ipaddr.js": "^1.5.4",
117
117
  "isomorphic-fetch": "^2.2.0",
118
118
  "isuuid": "^0.1.0",
@@ -163,7 +163,7 @@
163
163
  "intl": "^1.2.4",
164
164
  "jquery": "^2.2.3",
165
165
  "most-subject": "^5.3.0",
166
- "quiz-presets": "20.11.4-rc.4+6259006fa",
166
+ "quiz-presets": "20.11.4-rc.6+d2dbe1927",
167
167
  "react": "^16.8.6",
168
168
  "react-addons-test-utils": "^15.6.2",
169
169
  "react-dom": "^16.8.6",
@@ -179,5 +179,5 @@
179
179
  "publishConfig": {
180
180
  "access": "public"
181
181
  },
182
- "gitHead": "6259006faed5c298b839380c74085fe49a9b2c53"
182
+ "gitHead": "d2dbe1927e1efad37b079a892f68a637f3017d94"
183
183
  }