@instructure/quiz-core 17.29.2-rc.2 → 17.29.2-rc.5

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.
@@ -29,9 +29,10 @@ var _fetchBanks = function _fetchBanks(dispatch) {
29
29
 
30
30
  export var getBanks = function getBanks() {
31
31
  var params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
32
- var getCourseAssignments = arguments.length > 1 ? arguments[1] : void 0;
32
+ var usedByCourseEnabled = arguments.length > 1 ? arguments[1] : void 0;
33
+ var getCourseAssignments = arguments.length > 2 ? arguments[2] : void 0;
33
34
  return function (dispatch, getState) {
34
- if (params['course_id'] && getCourseAssignments) {
35
+ if (usedByCourseEnabled && params['course_id'] && getCourseAssignments) {
35
36
  return getCourseAssignments(params['course_id']).then(function (assignments) {
36
37
  return _fetchBanks(dispatch, _objectSpread(_objectSpread({}, params), {}, {
37
38
  quiz_ids: assignments.json.map(function (a) {
@@ -18,6 +18,7 @@ function mapStateToProps(state, props) {
18
18
  return {
19
19
  filtersEnabled: featureOn('improved_bank_sharing'),
20
20
  newItemBankFilterNamesEnabled: featureOn('new_item_bank_filter_names'),
21
+ usedByCourseEnabled: featureOn('filter_item_banks_used_by_course'),
21
22
  scopeType: scopeType,
22
23
  sortBy: sortBy,
23
24
  sortOrder: sortOrder,
@@ -106,7 +106,7 @@ export var Banks = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cla
106
106
 
107
107
  return _this.props.getBanks(_objectSpread({
108
108
  page: page
109
- }, params), _this.props.getCourseAssignments);
109
+ }, params), _this.props.usedByCourseEnabled, _this.props.getCourseAssignments);
110
110
  };
111
111
 
112
112
  _this.focusCreateBankButton = function () {
@@ -404,11 +404,11 @@ export var Banks = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cla
404
404
  onShare: PropTypes.func,
405
405
  // from consumer
406
406
  openModal: PropTypes.func.isRequired,
407
- scope: PropTypes.objectOf(PropTypes.shape({
407
+ scope: PropTypes.shape({
408
408
  type: PropTypes.string,
409
409
  uuid: PropTypes.string,
410
410
  title: PropTypes.string
411
- })).isRequired,
411
+ }).isRequired,
412
412
  returnToUrl: PropTypes.string,
413
413
  // from consumer
414
414
  filtersEnabled: PropTypes.bool,
@@ -417,7 +417,8 @@ export var Banks = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cla
417
417
  sortBy: PropTypes.string,
418
418
  sortOrder: PropTypes.string,
419
419
  searchTerms: PropTypes.string,
420
- newItemBankFilterNamesEnabled: PropTypes.bool
420
+ newItemBankFilterNamesEnabled: PropTypes.bool,
421
+ usedByCourseEnabled: PropTypes.bool
421
422
  }, _class2.defaultProps = {
422
423
  currentUser: null,
423
424
  getCourseInfo: null,
@@ -438,7 +439,8 @@ export var Banks = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cla
438
439
  sortBy: 'name',
439
440
  sortOrder: 'ASC',
440
441
  searchTerms: null,
441
- newItemBankFilterNamesEnabled: false
442
+ newItemBankFilterNamesEnabled: false,
443
+ usedByCourseEnabled: false
442
444
  }, _class2.contextTypes = {
443
445
  locale: PropTypes.string
444
446
  }, _temp)) || _class);
@@ -52,9 +52,10 @@ var _fetchBanks = function _fetchBanks(dispatch) {
52
52
 
53
53
  var getBanks = function getBanks() {
54
54
  var params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
55
- var getCourseAssignments = arguments.length > 1 ? arguments[1] : void 0;
55
+ var usedByCourseEnabled = arguments.length > 1 ? arguments[1] : void 0;
56
+ var getCourseAssignments = arguments.length > 2 ? arguments[2] : void 0;
56
57
  return function (dispatch, getState) {
57
- if (params['course_id'] && getCourseAssignments) {
58
+ if (usedByCourseEnabled && params['course_id'] && getCourseAssignments) {
58
59
  return getCourseAssignments(params['course_id']).then(function (assignments) {
59
60
  return _fetchBanks(dispatch, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
60
61
  quiz_ids: assignments.json.map(function (a) {
@@ -36,6 +36,7 @@ function mapStateToProps(state, props) {
36
36
  return {
37
37
  filtersEnabled: (0, _featureCheck.featureOn)('improved_bank_sharing'),
38
38
  newItemBankFilterNamesEnabled: (0, _featureCheck.featureOn)('new_item_bank_filter_names'),
39
+ usedByCourseEnabled: (0, _featureCheck.featureOn)('filter_item_banks_used_by_course'),
39
40
  scopeType: scopeType,
40
41
  sortBy: sortBy,
41
42
  sortOrder: sortOrder,
@@ -142,7 +142,7 @@ var Banks = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
142
142
 
143
143
  return _this.props.getBanks((0, _objectSpread2.default)({
144
144
  page: page
145
- }, params), _this.props.getCourseAssignments);
145
+ }, params), _this.props.usedByCourseEnabled, _this.props.getCourseAssignments);
146
146
  };
147
147
 
148
148
  _this.focusCreateBankButton = function () {
@@ -442,11 +442,11 @@ var Banks = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
442
442
  onShare: _propTypes.default.func,
443
443
  // from consumer
444
444
  openModal: _propTypes.default.func.isRequired,
445
- scope: _propTypes.default.objectOf(_propTypes.default.shape({
445
+ scope: _propTypes.default.shape({
446
446
  type: _propTypes.default.string,
447
447
  uuid: _propTypes.default.string,
448
448
  title: _propTypes.default.string
449
- })).isRequired,
449
+ }).isRequired,
450
450
  returnToUrl: _propTypes.default.string,
451
451
  // from consumer
452
452
  filtersEnabled: _propTypes.default.bool,
@@ -455,7 +455,8 @@ var Banks = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
455
455
  sortBy: _propTypes.default.string,
456
456
  sortOrder: _propTypes.default.string,
457
457
  searchTerms: _propTypes.default.string,
458
- newItemBankFilterNamesEnabled: _propTypes.default.bool
458
+ newItemBankFilterNamesEnabled: _propTypes.default.bool,
459
+ usedByCourseEnabled: _propTypes.default.bool
459
460
  }, _class2.defaultProps = {
460
461
  currentUser: null,
461
462
  getCourseInfo: null,
@@ -476,7 +477,8 @@ var Banks = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
476
477
  sortBy: 'name',
477
478
  sortOrder: 'ASC',
478
479
  searchTerms: null,
479
- newItemBankFilterNamesEnabled: false
480
+ newItemBankFilterNamesEnabled: false,
481
+ usedByCourseEnabled: false
480
482
  }, _class2.contextTypes = {
481
483
  locale: _propTypes.default.string
482
484
  }, _temp)) || _class);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "17.29.2-rc.2+c855f2277",
3
+ "version": "17.29.2-rc.5+c370c1cc5",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -41,11 +41,11 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@instructure/outcomes-ui": "^2.1.2",
44
- "@instructure/quiz-common": "17.29.2-rc.2+c855f2277",
45
- "@instructure/quiz-i18n": "17.29.2-rc.2+c855f2277",
46
- "@instructure/quiz-interactions": "17.29.2-rc.2+c855f2277",
47
- "@instructure/quiz-number-input": "17.29.2-rc.2+c855f2277",
48
- "@instructure/quiz-rce": "17.29.2-rc.2+c855f2277",
44
+ "@instructure/quiz-common": "17.29.2-rc.5+c370c1cc5",
45
+ "@instructure/quiz-i18n": "17.29.2-rc.5+c370c1cc5",
46
+ "@instructure/quiz-interactions": "17.29.2-rc.5+c370c1cc5",
47
+ "@instructure/quiz-number-input": "17.29.2-rc.5+c370c1cc5",
48
+ "@instructure/quiz-rce": "17.29.2-rc.5+c370c1cc5",
49
49
  "@instructure/ui-a11y-content": "^7.11.0",
50
50
  "@instructure/ui-alerts": "^7.11.0",
51
51
  "@instructure/ui-avatar": "^7.11.0",
@@ -106,7 +106,7 @@
106
106
  "eventemitter3": "^3.1.0",
107
107
  "humps": "^2.0.0",
108
108
  "immutable": "^3.8.1",
109
- "instructure-validations": "17.29.2-rc.2+c855f2277",
109
+ "instructure-validations": "17.29.2-rc.5+c370c1cc5",
110
110
  "ipaddr.js": "^1.5.4",
111
111
  "isomorphic-fetch": "^2.2.0",
112
112
  "isuuid": "^0.1.0",
@@ -137,7 +137,7 @@
137
137
  "uuid": "^3.2.1"
138
138
  },
139
139
  "devDependencies": {
140
- "@instructure/quiz-scripts": "17.29.2-rc.2+c855f2277",
140
+ "@instructure/quiz-scripts": "17.29.2-rc.5+c370c1cc5",
141
141
  "@instructure/ui-axe-check": "^7.11.0",
142
142
  "@instructure/ui-babel-preset": "^7.11.0",
143
143
  "@instructure/ui-karma-config": "^7.11.0",
@@ -156,7 +156,7 @@
156
156
  "intl": "^1.2.4",
157
157
  "jquery": "^2.2.3",
158
158
  "most-subject": "^5.3.0",
159
- "quiz-presets": "17.29.2-rc.2+c855f2277",
159
+ "quiz-presets": "17.29.2-rc.5+c370c1cc5",
160
160
  "react": "^16.8.6",
161
161
  "react-addons-test-utils": "^15.6.2",
162
162
  "react-dom": "^16.8.6",
@@ -172,5 +172,5 @@
172
172
  "publishConfig": {
173
173
  "access": "public"
174
174
  },
175
- "gitHead": "c855f22770c15778586986bcf00260daa2e162e7"
175
+ "gitHead": "c370c1cc5153c1ca2ae83a62f2abdafd52a97250"
176
176
  }