@instructure/quiz-core 20.11.3 → 20.11.4-rc.1

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.
@@ -56,7 +56,11 @@ 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 === 'account' && _this.props.scope.type === 'account' && _this.props.scope.launch_context_uuid && _this.props.rootAccountUuid && _this.props.scope.launch_context_uuid !== _this.props.rootAccountUuid;
59
+ return _this.props.scopeType === 'account' && _this.displayThisAccount();
60
+ };
61
+
62
+ _this.displayThisAccount = function () {
63
+ return _this.props.scope.type === 'account' && _this.props.scope.launch_context_uuid && _this.props.rootAccountUuid && _this.props.scope.launch_context_uuid !== _this.props.rootAccountUuid;
60
64
  };
61
65
 
62
66
  _this.onCreateBank = function () {
@@ -217,7 +221,7 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
217
221
  if (_this.props.scopeType === 'course') {
218
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\"");
219
223
  } else if (_this.props.scopeType === 'account') {
220
- if (_this.props.subAccountBankSharingEnabled && _this.hideAccountSearch()) {
224
+ if (_this.props.subAccountBankSharingEnabled && _this.displayThisAccount()) {
221
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\"");
222
226
  } else {
223
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\"");
@@ -263,7 +267,7 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
263
267
  translation: this.props.newItemBankFilterNamesEnabled ? t('All Banks') : t('All My Banks')
264
268
  }, {
265
269
  slug: 'account',
266
- translation: this.props.subAccountBankSharingEnabled && this.hideAccountSearch() ? t('This Account') : t('Institution Banks')
270
+ translation: this.props.subAccountBankSharingEnabled && this.displayThisAccount() ? t('This Account') : t('Institution Banks')
267
271
  }, {
268
272
  slug: 'courses',
269
273
  translation: this.props.newItemBankFilterNamesEnabled ? t('Banks Shared to Course') : t('All My Course Banks')
@@ -78,7 +78,6 @@ export var ShareList = (_dec = withStyle(generateStyle, null), _dec(_class = (_t
78
78
  _this.renderEntity = function (entity) {
79
79
  var isEntityRemoved = entity.get('permission') === REMOVED_ACCESS;
80
80
  var isCourse = entity.get('entityType') === SHARED_WITH_COURSE;
81
- var isOnlyEntity = _this.props.shares.size <= 1;
82
81
  var originalEntity = _this.props.sharedBanks.find(function (sb) {
83
82
  return sb.get('id') == entity.get('id');
84
83
  }) || Map();
@@ -95,7 +94,7 @@ export var ShareList = (_dec = withStyle(generateStyle, null), _dec(_class = (_t
95
94
  })), jsx(Grid.Col, null, jsx("span", {
96
95
  css: isEntityRemoved ? _this.props.styles.labelRemoved : null,
97
96
  "data-automation": isEntityRemoved ? 'sdk-shared-entity-removed' : null
98
- }, entity.get('title'))), _this.props.improvedBankSharingEnabled && !isOnlyEntity && jsx(Grid.Col, {
97
+ }, entity.get('title'))), _this.props.improvedBankSharingEnabled && jsx(Grid.Col, {
99
98
  width: "auto"
100
99
  }, jsx(SimpleSelect, {
101
100
  onChange: _this.handlePermissionChange(entity),
@@ -112,7 +111,7 @@ export var ShareList = (_dec = withStyle(generateStyle, null), _dec(_class = (_t
112
111
  value: CAN_EDIT
113
112
  }, t('Can edit')))), jsx(Grid.Col, {
114
113
  width: "auto"
115
- }, !isOnlyEntity && _this.props.canEdit && (_this.props.improvedBankSharingEnabled || !isCourse) && _this.renderRemoveButton(entity, isEntityRemoved)));
114
+ }, _this.props.canEdit && (_this.props.improvedBankSharingEnabled || !isCourse) && _this.renderRemoveButton(entity, isEntityRemoved)));
116
115
  };
117
116
 
118
117
  return _this;
@@ -141,14 +140,6 @@ export var ShareList = (_dec = withStyle(generateStyle, null), _dec(_class = (_t
141
140
  onPermissionChange: PropTypes.func.isRequired,
142
141
  onEntityRemove: PropTypes.func.isRequired,
143
142
  sharedBanks: ImmutablePropTypes.list,
144
- shares: ImmutablePropTypes.listOf(ImmutablePropTypes.contains({
145
- avatar: PropTypes.string,
146
- title: PropTypes.string.isRequired,
147
- entityType: PropTypes.string.isRequired,
148
- entityId: PropTypes.string.isRequired,
149
- permission: PropTypes.string.isRequired,
150
- id: PropTypes.string.isRequired
151
- })).isRequired,
152
143
  // eslint-disable-next-line react/require-default-props,react/forbid-prop-types
153
144
  styles: PropTypes.object
154
145
  }, _temp)) || _class);
@@ -419,8 +419,7 @@ export var SharingModalPresenter = (_dec = withStyle(generateStyle, generateComp
419
419
  improvedBankSharingEnabled: _this.props.improvedBankSharingEnabled,
420
420
  onPermissionChange: _this.handleEntityPermissionChange,
421
421
  onEntityRemove: _this.handleEntityRemove,
422
- sharedBanks: _this.props.sharedBanks,
423
- shares: _this.state.shares
422
+ sharedBanks: _this.props.sharedBanks
424
423
  });
425
424
  };
426
425
 
@@ -96,7 +96,11 @@ 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 === 'account' && _this.props.scope.type === 'account' && _this.props.scope.launch_context_uuid && _this.props.rootAccountUuid && _this.props.scope.launch_context_uuid !== _this.props.rootAccountUuid;
99
+ return _this.props.scopeType === 'account' && _this.displayThisAccount();
100
+ };
101
+
102
+ _this.displayThisAccount = function () {
103
+ return _this.props.scope.type === 'account' && _this.props.scope.launch_context_uuid && _this.props.rootAccountUuid && _this.props.scope.launch_context_uuid !== _this.props.rootAccountUuid;
100
104
  };
101
105
 
102
106
  _this.onCreateBank = function () {
@@ -257,7 +261,7 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
257
261
  if (_this.props.scopeType === 'course') {
258
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\"");
259
263
  } else if (_this.props.scopeType === 'account') {
260
- if (_this.props.subAccountBankSharingEnabled && _this.hideAccountSearch()) {
264
+ if (_this.props.subAccountBankSharingEnabled && _this.displayThisAccount()) {
261
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\"");
262
266
  } else {
263
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\"");
@@ -303,7 +307,7 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
303
307
  translation: this.props.newItemBankFilterNamesEnabled ? (0, _formatMessage.default)('All Banks') : (0, _formatMessage.default)('All My Banks')
304
308
  }, {
305
309
  slug: 'account',
306
- translation: this.props.subAccountBankSharingEnabled && this.hideAccountSearch() ? (0, _formatMessage.default)('This Account') : (0, _formatMessage.default)('Institution Banks')
310
+ translation: this.props.subAccountBankSharingEnabled && this.displayThisAccount() ? (0, _formatMessage.default)('This Account') : (0, _formatMessage.default)('Institution Banks')
307
311
  }, {
308
312
  slug: 'courses',
309
313
  translation: this.props.newItemBankFilterNamesEnabled ? (0, _formatMessage.default)('Banks Shared to Course') : (0, _formatMessage.default)('All My Course Banks')
@@ -104,7 +104,6 @@ var ShareList = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec(_cl
104
104
 
105
105
  var isCourse = entity.get('entityType') === _quizCommon.SHARED_WITH_COURSE;
106
106
 
107
- var isOnlyEntity = _this.props.shares.size <= 1;
108
107
  var originalEntity = _this.props.sharedBanks.find(function (sb) {
109
108
  return sb.get('id') == entity.get('id');
110
109
  }) || (0, _immutable.Map)();
@@ -121,7 +120,7 @@ var ShareList = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec(_cl
121
120
  })), (0, _emotion.jsx)(_uiGrid.Grid.Col, null, (0, _emotion.jsx)("span", {
122
121
  css: isEntityRemoved ? _this.props.styles.labelRemoved : null,
123
122
  "data-automation": isEntityRemoved ? 'sdk-shared-entity-removed' : null
124
- }, entity.get('title'))), _this.props.improvedBankSharingEnabled && !isOnlyEntity && (0, _emotion.jsx)(_uiGrid.Grid.Col, {
123
+ }, entity.get('title'))), _this.props.improvedBankSharingEnabled && (0, _emotion.jsx)(_uiGrid.Grid.Col, {
125
124
  width: "auto"
126
125
  }, (0, _emotion.jsx)(_uiSimpleSelect.SimpleSelect, {
127
126
  onChange: _this.handlePermissionChange(entity),
@@ -138,7 +137,7 @@ var ShareList = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec(_cl
138
137
  value: _quizCommon.CAN_EDIT
139
138
  }, (0, _formatMessage.default)('Can edit')))), (0, _emotion.jsx)(_uiGrid.Grid.Col, {
140
139
  width: "auto"
141
- }, !isOnlyEntity && _this.props.canEdit && (_this.props.improvedBankSharingEnabled || !isCourse) && _this.renderRemoveButton(entity, isEntityRemoved)));
140
+ }, _this.props.canEdit && (_this.props.improvedBankSharingEnabled || !isCourse) && _this.renderRemoveButton(entity, isEntityRemoved)));
142
141
  };
143
142
 
144
143
  return _this;
@@ -166,14 +165,6 @@ var ShareList = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec(_cl
166
165
  onPermissionChange: _propTypes.default.func.isRequired,
167
166
  onEntityRemove: _propTypes.default.func.isRequired,
168
167
  sharedBanks: _reactImmutableProptypes.default.list,
169
- shares: _reactImmutableProptypes.default.listOf(_reactImmutableProptypes.default.contains({
170
- avatar: _propTypes.default.string,
171
- title: _propTypes.default.string.isRequired,
172
- entityType: _propTypes.default.string.isRequired,
173
- entityId: _propTypes.default.string.isRequired,
174
- permission: _propTypes.default.string.isRequired,
175
- id: _propTypes.default.string.isRequired
176
- })).isRequired,
177
168
  // eslint-disable-next-line react/require-default-props,react/forbid-prop-types
178
169
  styles: _propTypes.default.object
179
170
  }, _temp)) || _class);
@@ -457,8 +457,7 @@ var SharingModalPresenter = (_dec = (0, _emotion.withStyle)(_styles.default, _th
457
457
  improvedBankSharingEnabled: _this.props.improvedBankSharingEnabled,
458
458
  onPermissionChange: _this.handleEntityPermissionChange,
459
459
  onEntityRemove: _this.handleEntityRemove,
460
- sharedBanks: _this.props.sharedBanks,
461
- shares: _this.state.shares
460
+ sharedBanks: _this.props.sharedBanks
462
461
  });
463
462
  };
464
463
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "20.11.3",
3
+ "version": "20.11.4-rc.1+6f88b53e9",
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.3",
48
- "@instructure/quiz-i18n": "^20.11.3",
49
- "@instructure/quiz-interactions": "^20.11.3",
50
- "@instructure/quiz-number-input": "^20.11.3",
51
- "@instructure/quiz-rce": "^20.11.3",
47
+ "@instructure/quiz-common": "20.11.4-rc.1+6f88b53e9",
48
+ "@instructure/quiz-i18n": "20.11.4-rc.1+6f88b53e9",
49
+ "@instructure/quiz-interactions": "20.11.4-rc.1+6f88b53e9",
50
+ "@instructure/quiz-number-input": "20.11.4-rc.1+6f88b53e9",
51
+ "@instructure/quiz-rce": "20.11.4-rc.1+6f88b53e9",
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.3",
115
+ "instructure-validations": "20.11.4-rc.1+6f88b53e9",
116
116
  "ipaddr.js": "^1.5.4",
117
117
  "isomorphic-fetch": "^2.2.0",
118
118
  "isuuid": "^0.1.0",
@@ -143,7 +143,7 @@
143
143
  "uuid": "^3.2.1"
144
144
  },
145
145
  "devDependencies": {
146
- "@instructure/quiz-scripts": "^20.11.3",
146
+ "@instructure/quiz-scripts": "20.11.3",
147
147
  "@instructure/ui-axe-check": "^8.51.0",
148
148
  "@instructure/ui-babel-preset": "^7.22.1",
149
149
  "@instructure/ui-karma-config": "^7.22.1",
@@ -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.3",
166
+ "quiz-presets": "20.11.4-rc.1+6f88b53e9",
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": "82650fb1ff86ce3b6766f4b919ad72922f029e3d"
182
+ "gitHead": "6f88b53e91fdb3b7e66d04147d27b7fdc271df81"
183
183
  }