@instructure/quiz-core 20.17.3-rc.2 → 20.17.3-rc.3

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.
@@ -339,7 +339,8 @@ export var Bank = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
339
339
  checked: this.state.sharedWithCourse,
340
340
  label: label,
341
341
  onChange: this.toggleCheckbox,
342
- disabled: this.props.bank.canEdit() ? this.state.shareWithCourseCheckboxDisabled : true
342
+ disabled: this.props.bank.canEdit() ? this.state.shareWithCourseCheckboxDisabled : true,
343
+ "data-automation": "sdk-share-bank-with-course-checkbox"
343
344
  }));
344
345
  }
345
346
  }, {
@@ -371,7 +372,8 @@ export var Bank = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
371
372
  return jsx(Button, {
372
373
  onClick: this.addBankToQuiz,
373
374
  margin: "small none",
374
- renderIcon: IconPlusLine
375
+ renderIcon: IconPlusLine,
376
+ "data-automation": "sdk-add-bank-to-quiz-button"
375
377
  }, jsx(AccessibleContent, {
376
378
  alt: t('Add this bank to quiz')
377
379
  }, t('All / Random')));
@@ -141,7 +141,8 @@ export var BankSearch = (_dec = withStyle(generateStyle, generateComponentTheme)
141
141
  type: "search",
142
142
  placeholder: t('Search'),
143
143
  onChange: this.updateSearch,
144
- value: this.props.search.get('text', '') || ''
144
+ value: this.props.search.get('text', '') || '',
145
+ "data-automation": "sdk-bank-search-input"
145
146
  })), jsx(Flex.Item, null, jsx(Button, {
146
147
  onClick: toggleFilters,
147
148
  margin: "none none none small",
@@ -285,7 +285,8 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
285
285
  onChange: this.handleBanksParentChange,
286
286
  value: this.props.scopeType,
287
287
  renderLabel: t('Filter By'),
288
- width: "13rem"
288
+ width: "13rem",
289
+ "data-automation": "sdk-banks-filter-select"
289
290
  }, scopeOptions.map(function (option) {
290
291
  return jsx(SimpleSelect.Option, {
291
292
  id: searchFiltersSelectOptionIdPrefix + option.slug,
@@ -174,6 +174,14 @@ export var BanksList = (_dec = withStyle(generateStyle, generateComponentTheme),
174
174
  }
175
175
  return bank.sharedCount;
176
176
  };
177
+ _this.handleTableRef = function (element) {
178
+ if (element) {
179
+ var simpleSelect = element.querySelector('[role="combobox"]');
180
+ if (simpleSelect) {
181
+ simpleSelect.setAttribute('data-automation', 'sdk-banks-sorting-select');
182
+ }
183
+ }
184
+ };
177
185
  _this.renderBankInfo = function (bank) {
178
186
  var navigateToBank = function navigateToBank(bankId) {
179
187
  return function () {
@@ -250,6 +258,7 @@ export var BanksList = (_dec = withStyle(generateStyle, generateComponentTheme),
250
258
  onClick: _this.openDuplicateBankModal(bank),
251
259
  name: "Duplicate",
252
260
  size: "small",
261
+ "data-automation": "sdk-duplicate-bank-button",
253
262
  renderIcon: IconCopyLine,
254
263
  withBackground: false,
255
264
  withBorder: false,
@@ -423,7 +432,8 @@ export var BanksList = (_dec = withStyle(generateStyle, generateComponentTheme),
423
432
  return jsx(Table, {
424
433
  margin: "small 0",
425
434
  caption: t('Banks'),
426
- layout: this.props.isCompact ? 'stacked' : 'auto'
435
+ layout: this.props.isCompact ? 'stacked' : 'auto',
436
+ elementRef: this.handleTableRef
427
437
  }, jsx(Table.Head, {
428
438
  renderSortLabel: t('Sort By')
429
439
  }, jsx(Table.Row, null, this.renderTableSortHeader('name', t('Name')), this.renderTableSortHeader('updated_at', t('Updated')), jsx(Table.ColHeader, {
@@ -50,7 +50,8 @@ export var RootAccountSharing = (_dec = withStyle(generateStyle, generateCompone
50
50
  variant: "toggle",
51
51
  value: "accountPermission",
52
52
  checked: this.isSharedWithAccount(),
53
- onChange: this.props.onShareChange
53
+ onChange: this.props.onShareChange,
54
+ "data-automation": "sdk-share-bank-with-institution-toggle"
54
55
  })), this.isSharedWithAccount() && /*#__PURE__*/React.createElement(Grid.Col, {
55
56
  width: "auto"
56
57
  }, /*#__PURE__*/React.createElement(SimpleSelect, {
@@ -48,7 +48,8 @@ export var ItemFeedbackModal = (_dec = withStyle(generateStyle, generateComponen
48
48
  value: function cancelButton() {
49
49
  return jsx(Button, {
50
50
  onClick: this.closeAction,
51
- margin: XSMALL_SIDE_MARGIN
51
+ margin: XSMALL_SIDE_MARGIN,
52
+ "data-automation": "sdk-item-feedback-modal-cancel-button"
52
53
  }, t('Cancel'));
53
54
  }
54
55
  }, {
@@ -57,7 +58,8 @@ export var ItemFeedbackModal = (_dec = withStyle(generateStyle, generateComponen
57
58
  return jsx(Button, {
58
59
  color: "primary",
59
60
  onClick: this.continueAction,
60
- margin: XSMALL_SIDE_MARGIN
61
+ margin: XSMALL_SIDE_MARGIN,
62
+ "data-automation": "sdk-item-feedback-modal-done-button"
61
63
  }, t('Done'));
62
64
  }
63
65
  }, {
@@ -158,7 +158,8 @@ export var QuizInstructions = (_dec = withStyle(generateStyle, generateComponent
158
158
  screenreaderText: t('Edit Instructions'),
159
159
  scrollKey: this.props.scrollKey,
160
160
  onClick: this.toggleEditing,
161
- ref: this.setRef('editButton')
161
+ ref: this.setRef('editButton'),
162
+ "data-automation": "sdk-build-edit-instructions-button"
162
163
  }))));
163
164
  }
164
165
  }]);
@@ -36,7 +36,8 @@ export var Pin = /*#__PURE__*/function (_Component) {
36
36
  withBackground: false,
37
37
  withBorder: false,
38
38
  renderIcon: this.props.isPinned ? IconPinSolid : IconPinLine,
39
- screenReaderLabel: message
39
+ screenReaderLabel: message,
40
+ "data-automation": "sdk-pin-question-button"
40
41
  });
41
42
  }
42
43
  }]);
@@ -104,9 +104,11 @@ export var Sidebar = (_dec = withStyle(generateStyle, generateComponentTheme), _
104
104
  onClick: this.scrollToTitle,
105
105
  renderIcon: _IconQuizTitleLine || (_IconQuizTitleLine = jsx(IconQuizTitleLine, {
106
106
  color: "primary"
107
- }))
107
+ })),
108
+ "data-automation": "sidebar-title-button"
108
109
  }, jsx(ScreenReaderContent, null, t('Navigate to title'))), jsx(PresentationContent, null, jsx("span", {
109
110
  css: this.props.styles.sidebar.description,
111
+ "data-automation": "sidebar-title-text",
110
112
  onClick: this.scrollToTitle,
111
113
  tabIndex: "-1"
112
114
  }, this.props.title || t('Title'))));
@@ -63,7 +63,8 @@ export var ResetQuiz = /*#__PURE__*/function (_Component) {
63
63
  ref: this.reopenButtonRef,
64
64
  onClick: this.reopenQuizSession,
65
65
  disabled: !this.props.isComplete,
66
- margin: "small none"
66
+ margin: "small none",
67
+ "data-automation": "sdk-reopen-quiz-button"
67
68
  }, t('Reopen')) : null);
68
69
  }
69
70
  }]);
@@ -347,7 +347,8 @@ var Bank = exports.Bank = (_dec = (0, _emotion.withStyle)(_styles.default, _them
347
347
  checked: this.state.sharedWithCourse,
348
348
  label: label,
349
349
  onChange: this.toggleCheckbox,
350
- disabled: this.props.bank.canEdit() ? this.state.shareWithCourseCheckboxDisabled : true
350
+ disabled: this.props.bank.canEdit() ? this.state.shareWithCourseCheckboxDisabled : true,
351
+ "data-automation": "sdk-share-bank-with-course-checkbox"
351
352
  }));
352
353
  }
353
354
  }, {
@@ -379,7 +380,8 @@ var Bank = exports.Bank = (_dec = (0, _emotion.withStyle)(_styles.default, _them
379
380
  return (0, _emotion.jsx)(_uiButtons.Button, {
380
381
  onClick: this.addBankToQuiz,
381
382
  margin: "small none",
382
- renderIcon: _uiIcons.IconPlusLine
383
+ renderIcon: _uiIcons.IconPlusLine,
384
+ "data-automation": "sdk-add-bank-to-quiz-button"
383
385
  }, (0, _emotion.jsx)(_uiA11yContent.AccessibleContent, {
384
386
  alt: (0, _formatMessage.default)('Add this bank to quiz')
385
387
  }, (0, _formatMessage.default)('All / Random')));
@@ -148,7 +148,8 @@ var BankSearch = exports.BankSearch = (_dec = (0, _emotion.withStyle)(_styles.de
148
148
  type: "search",
149
149
  placeholder: (0, _formatMessage.default)('Search'),
150
150
  onChange: this.updateSearch,
151
- value: this.props.search.get('text', '') || ''
151
+ value: this.props.search.get('text', '') || '',
152
+ "data-automation": "sdk-bank-search-input"
152
153
  })), (0, _emotion.jsx)(_uiFlex.Flex.Item, null, (0, _emotion.jsx)(_uiButtons.Button, {
153
154
  onClick: toggleFilters,
154
155
  margin: "none none none small",
@@ -293,7 +293,8 @@ var Banks = exports.Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _th
293
293
  onChange: this.handleBanksParentChange,
294
294
  value: this.props.scopeType,
295
295
  renderLabel: (0, _formatMessage.default)('Filter By'),
296
- width: "13rem"
296
+ width: "13rem",
297
+ "data-automation": "sdk-banks-filter-select"
297
298
  }, scopeOptions.map(function (option) {
298
299
  return (0, _emotion.jsx)(_uiSimpleSelect.SimpleSelect.Option, {
299
300
  id: searchFiltersSelectOptionIdPrefix + option.slug,
@@ -182,6 +182,14 @@ var BanksList = exports.BanksList = (_dec = (0, _emotion.withStyle)(_styles.defa
182
182
  }
183
183
  return bank.sharedCount;
184
184
  };
185
+ _this.handleTableRef = function (element) {
186
+ if (element) {
187
+ var simpleSelect = element.querySelector('[role="combobox"]');
188
+ if (simpleSelect) {
189
+ simpleSelect.setAttribute('data-automation', 'sdk-banks-sorting-select');
190
+ }
191
+ }
192
+ };
185
193
  _this.renderBankInfo = function (bank) {
186
194
  var navigateToBank = function navigateToBank(bankId) {
187
195
  return function () {
@@ -258,6 +266,7 @@ var BanksList = exports.BanksList = (_dec = (0, _emotion.withStyle)(_styles.defa
258
266
  onClick: _this.openDuplicateBankModal(bank),
259
267
  name: "Duplicate",
260
268
  size: "small",
269
+ "data-automation": "sdk-duplicate-bank-button",
261
270
  renderIcon: _uiIcons.IconCopyLine,
262
271
  withBackground: false,
263
272
  withBorder: false,
@@ -431,7 +440,8 @@ var BanksList = exports.BanksList = (_dec = (0, _emotion.withStyle)(_styles.defa
431
440
  return (0, _emotion.jsx)(_uiTable.Table, {
432
441
  margin: "small 0",
433
442
  caption: (0, _formatMessage.default)('Banks'),
434
- layout: this.props.isCompact ? 'stacked' : 'auto'
443
+ layout: this.props.isCompact ? 'stacked' : 'auto',
444
+ elementRef: this.handleTableRef
435
445
  }, (0, _emotion.jsx)(_uiTable.Table.Head, {
436
446
  renderSortLabel: (0, _formatMessage.default)('Sort By')
437
447
  }, (0, _emotion.jsx)(_uiTable.Table.Row, null, this.renderTableSortHeader('name', (0, _formatMessage.default)('Name')), this.renderTableSortHeader('updated_at', (0, _formatMessage.default)('Updated')), (0, _emotion.jsx)(_uiTable.Table.ColHeader, {
@@ -58,7 +58,8 @@ var RootAccountSharing = exports.RootAccountSharing = (_dec = (0, _emotion.withS
58
58
  variant: "toggle",
59
59
  value: "accountPermission",
60
60
  checked: this.isSharedWithAccount(),
61
- onChange: this.props.onShareChange
61
+ onChange: this.props.onShareChange,
62
+ "data-automation": "sdk-share-bank-with-institution-toggle"
62
63
  })), this.isSharedWithAccount() && /*#__PURE__*/_react.default.createElement(_uiGrid.Grid.Col, {
63
64
  width: "auto"
64
65
  }, /*#__PURE__*/_react.default.createElement(_uiSimpleSelect.SimpleSelect, {
@@ -55,7 +55,8 @@ var ItemFeedbackModal = exports.ItemFeedbackModal = (_dec = (0, _emotion.withSty
55
55
  value: function cancelButton() {
56
56
  return (0, _emotion.jsx)(_uiButtons.Button, {
57
57
  onClick: this.closeAction,
58
- margin: _quizCommon.XSMALL_SIDE_MARGIN
58
+ margin: _quizCommon.XSMALL_SIDE_MARGIN,
59
+ "data-automation": "sdk-item-feedback-modal-cancel-button"
59
60
  }, (0, _formatMessage.default)('Cancel'));
60
61
  }
61
62
  }, {
@@ -64,7 +65,8 @@ var ItemFeedbackModal = exports.ItemFeedbackModal = (_dec = (0, _emotion.withSty
64
65
  return (0, _emotion.jsx)(_uiButtons.Button, {
65
66
  color: "primary",
66
67
  onClick: this.continueAction,
67
- margin: _quizCommon.XSMALL_SIDE_MARGIN
68
+ margin: _quizCommon.XSMALL_SIDE_MARGIN,
69
+ "data-automation": "sdk-item-feedback-modal-done-button"
68
70
  }, (0, _formatMessage.default)('Done'));
69
71
  }
70
72
  }, {
@@ -161,7 +161,8 @@ var QuizInstructions = exports.QuizInstructions = (_dec = (0, _emotion.withStyle
161
161
  screenreaderText: (0, _formatMessage.default)('Edit Instructions'),
162
162
  scrollKey: this.props.scrollKey,
163
163
  onClick: this.toggleEditing,
164
- ref: this.setRef('editButton')
164
+ ref: this.setRef('editButton'),
165
+ "data-automation": "sdk-build-edit-instructions-button"
165
166
  }))));
166
167
  }
167
168
  }]);
@@ -44,7 +44,8 @@ var Pin = exports.Pin = /*#__PURE__*/function (_Component) {
44
44
  withBackground: false,
45
45
  withBorder: false,
46
46
  renderIcon: this.props.isPinned ? _uiIcons.IconPinSolid : _uiIcons.IconPinLine,
47
- screenReaderLabel: message
47
+ screenReaderLabel: message,
48
+ "data-automation": "sdk-pin-question-button"
48
49
  });
49
50
  }
50
51
  }]);
@@ -111,9 +111,11 @@ var Sidebar = exports.Sidebar = (_dec = (0, _emotion.withStyle)(_styles.default,
111
111
  onClick: this.scrollToTitle,
112
112
  renderIcon: _IconQuizTitleLine || (_IconQuizTitleLine = (0, _emotion.jsx)(_uiIcons.IconQuizTitleLine, {
113
113
  color: "primary"
114
- }))
114
+ })),
115
+ "data-automation": "sidebar-title-button"
115
116
  }, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Navigate to title'))), (0, _emotion.jsx)(_uiA11yContent.PresentationContent, null, (0, _emotion.jsx)("span", {
116
117
  css: this.props.styles.sidebar.description,
118
+ "data-automation": "sidebar-title-text",
117
119
  onClick: this.scrollToTitle,
118
120
  tabIndex: "-1"
119
121
  }, this.props.title || (0, _formatMessage.default)('Title'))));
@@ -71,7 +71,8 @@ var ResetQuiz = exports.ResetQuiz = /*#__PURE__*/function (_Component) {
71
71
  ref: this.reopenButtonRef,
72
72
  onClick: this.reopenQuizSession,
73
73
  disabled: !this.props.isComplete,
74
- margin: "small none"
74
+ margin: "small none",
75
+ "data-automation": "sdk-reopen-quiz-button"
75
76
  }, (0, _formatMessage.default)('Reopen')) : null);
76
77
  }
77
78
  }]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "20.17.3-rc.2+e41ad88aa",
3
+ "version": "20.17.3-rc.3+9b710b879",
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.2",
47
- "@instructure/quiz-common": "20.17.3-rc.2+e41ad88aa",
48
- "@instructure/quiz-i18n": "20.17.3-rc.2+e41ad88aa",
49
- "@instructure/quiz-interactions": "20.17.3-rc.2+e41ad88aa",
50
- "@instructure/quiz-number-input": "20.17.3-rc.2+e41ad88aa",
51
- "@instructure/quiz-rce": "20.17.3-rc.2+e41ad88aa",
47
+ "@instructure/quiz-common": "20.17.3-rc.3+9b710b879",
48
+ "@instructure/quiz-i18n": "20.17.3-rc.3+9b710b879",
49
+ "@instructure/quiz-interactions": "20.17.3-rc.3+9b710b879",
50
+ "@instructure/quiz-number-input": "20.17.3-rc.3+9b710b879",
51
+ "@instructure/quiz-rce": "20.17.3-rc.3+9b710b879",
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",
@@ -111,7 +111,7 @@
111
111
  "file-saver": "~2.0.5",
112
112
  "humps": "^2.0.0",
113
113
  "immutable": "^3.8.1",
114
- "instructure-validations": "20.17.3-rc.2+e41ad88aa",
114
+ "instructure-validations": "20.17.3-rc.3+9b710b879",
115
115
  "ipaddr.js": "^1.5.4",
116
116
  "isomorphic-fetch": "^2.2.0",
117
117
  "isuuid": "^0.1.0",
@@ -160,7 +160,7 @@
160
160
  "jquery": "^2.2.3",
161
161
  "karma-junit-reporter": "^2.0.1",
162
162
  "most-subject": "^5.3.0",
163
- "quiz-presets": "20.17.3-rc.2+e41ad88aa",
163
+ "quiz-presets": "20.17.3-rc.3+9b710b879",
164
164
  "react": "^16.8.6",
165
165
  "react-addons-test-utils": "^15.6.2",
166
166
  "react-dom": "^16.8.6",
@@ -176,5 +176,5 @@
176
176
  "publishConfig": {
177
177
  "access": "public"
178
178
  },
179
- "gitHead": "e41ad88aaef2af576f53ff0e212c6d793db74bf4"
179
+ "gitHead": "9b710b87929cc2d203de0f9f68e75a5e2b1a3150"
180
180
  }