@instructure/quiz-core 20.17.3-rc.1 → 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.
- package/es/banks/components/Bank/presenter.js +4 -2
- package/es/banks/components/BankSearch/presenter.js +2 -1
- package/es/banks/components/Banks/presenter.js +2 -1
- package/es/banks/components/BanksList/presenter.js +11 -1
- package/es/banks/components/SharingModal/RootAccountSharing.js +2 -1
- package/es/building/components/resources/ItemFeedbackModal/presenter.js +4 -2
- package/es/building/components/resources/quiz/instructions/Instructions/presenter.js +2 -1
- package/es/common/components/Pin/presenter.js +2 -1
- package/es/common/components/layout/sidebar/Sidebar/index.js +3 -1
- package/es/moderating/components/resources/ModerateTable/presenter.js +4 -2
- package/es/moderating/components/sidebar/ModerateTray/presenter.js +54 -28
- package/es/moderating/components/sidebar/ResetQuiz/presenter.js +2 -1
- package/lib/banks/components/Bank/presenter.js +4 -2
- package/lib/banks/components/BankSearch/presenter.js +2 -1
- package/lib/banks/components/Banks/presenter.js +2 -1
- package/lib/banks/components/BanksList/presenter.js +11 -1
- package/lib/banks/components/SharingModal/RootAccountSharing.js +2 -1
- package/lib/building/components/resources/ItemFeedbackModal/presenter.js +4 -2
- package/lib/building/components/resources/quiz/instructions/Instructions/presenter.js +2 -1
- package/lib/common/components/Pin/presenter.js +2 -1
- package/lib/common/components/layout/sidebar/Sidebar/index.js +3 -1
- package/lib/moderating/components/resources/ModerateTable/presenter.js +4 -2
- package/lib/moderating/components/sidebar/ModerateTray/presenter.js +53 -27
- package/lib/moderating/components/sidebar/ResetQuiz/presenter.js +2 -1
- package/package.json +9 -9
|
@@ -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'))));
|
|
@@ -322,8 +322,9 @@ export var ModerateTable = (_dec = withStyle(generateStyle, generateComponentThe
|
|
|
322
322
|
return jsx("div", {
|
|
323
323
|
css: this.props.styles.page
|
|
324
324
|
}, jsx(ModerateTray, {
|
|
325
|
-
onClose: this.onCloseTray
|
|
326
|
-
|
|
325
|
+
onClose: this.onCloseTray,
|
|
326
|
+
onSave: this.props.onSaveTray
|
|
327
|
+
}, jsx(Flex.Item, null, !this.props.anonymousGrading && (_ResetQuiz || (_ResetQuiz = jsx(ResetQuiz, null)))), this.props.children), this.renderContent());
|
|
327
328
|
}
|
|
328
329
|
}]);
|
|
329
330
|
}(Component), _ModerateTable.propTypes = {
|
|
@@ -337,6 +338,7 @@ export var ModerateTable = (_dec = withStyle(generateStyle, generateComponentThe
|
|
|
337
338
|
onOpenTray: PropTypes.func,
|
|
338
339
|
onResultsLinkClick: PropTypes.func,
|
|
339
340
|
openTray: PropTypes.func.isRequired,
|
|
341
|
+
onSaveTray: PropTypes.func.isRequired,
|
|
340
342
|
sessionTimeLimitInSeconds: PropTypes.number,
|
|
341
343
|
hasSessionTimeLimit: PropTypes.bool,
|
|
342
344
|
sendSessionTimeLimit: PropTypes.func,
|
|
@@ -5,11 +5,13 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
|
5
5
|
import React, { Component } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
8
|
+
import { Flex } from '@instructure/ui-flex';
|
|
8
9
|
import { View } from '@instructure/ui-view';
|
|
9
10
|
import { Tooltip } from '@instructure/ui-tooltip';
|
|
10
11
|
import { Tray } from '@instructure/ui-tray';
|
|
11
|
-
import { CloseButton } from '@instructure/ui-buttons';
|
|
12
|
+
import { Button, CloseButton } from '@instructure/ui-buttons';
|
|
12
13
|
import { TruncateText } from '@instructure/ui-truncate-text';
|
|
14
|
+
import { Modal } from '@instructure/ui-modal';
|
|
13
15
|
import { liveRegion } from '@instructure/quiz-common';
|
|
14
16
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
15
17
|
export var ModerateTray = /*#__PURE__*/function (_Component) {
|
|
@@ -38,6 +40,38 @@ export var ModerateTray = /*#__PURE__*/function (_Component) {
|
|
|
38
40
|
isTruncated: false
|
|
39
41
|
});
|
|
40
42
|
};
|
|
43
|
+
_this.setCloseRef = function (el) {
|
|
44
|
+
return _this.closeRef = el;
|
|
45
|
+
};
|
|
46
|
+
_this.setTrayRef = function (el) {
|
|
47
|
+
return _this.trayRef = el;
|
|
48
|
+
};
|
|
49
|
+
_this.getTrayRef = function () {
|
|
50
|
+
return _this.trayRef;
|
|
51
|
+
};
|
|
52
|
+
_this.handleSave = function () {
|
|
53
|
+
_this.props.onSave();
|
|
54
|
+
_this.props.closeTray();
|
|
55
|
+
};
|
|
56
|
+
_this.renderTitleAndCloseButton = function () {
|
|
57
|
+
return /*#__PURE__*/React.createElement(Flex, null, /*#__PURE__*/React.createElement(Flex.Item, {
|
|
58
|
+
shouldGrow: true,
|
|
59
|
+
shouldShrink: true
|
|
60
|
+
}, _this.state.isTruncated ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
61
|
+
placement: "start",
|
|
62
|
+
renderTip: _this.labelText(),
|
|
63
|
+
mountNode: _this.getTrayRef || null
|
|
64
|
+
}, function (_ref) {
|
|
65
|
+
var focused = _ref.focused;
|
|
66
|
+
return _this.renderName({
|
|
67
|
+
focused: focused
|
|
68
|
+
});
|
|
69
|
+
}) : _this.renderName()), /*#__PURE__*/React.createElement(Flex.Item, null, /*#__PURE__*/React.createElement(CloseButton, {
|
|
70
|
+
onClick: _this.props.closeTray,
|
|
71
|
+
elementRef: _this.setCloseRef,
|
|
72
|
+
screenReaderLabel: t('Close')
|
|
73
|
+
})));
|
|
74
|
+
};
|
|
41
75
|
_this.renderChildren = function () {
|
|
42
76
|
return React.Children.map(_this.props.children, function (child) {
|
|
43
77
|
if (!child) return null;
|
|
@@ -48,14 +82,15 @@ export var ModerateTray = /*#__PURE__*/function (_Component) {
|
|
|
48
82
|
});
|
|
49
83
|
});
|
|
50
84
|
};
|
|
51
|
-
_this.
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
85
|
+
_this.renderFooter = function () {
|
|
86
|
+
return /*#__PURE__*/React.createElement(Modal.Footer, null, /*#__PURE__*/React.createElement(Button, {
|
|
87
|
+
onClick: _this.props.closeTray,
|
|
88
|
+
margin: "0 x-small 0 0"
|
|
89
|
+
}, t('Cancel')), /*#__PURE__*/React.createElement(Button, {
|
|
90
|
+
color: "primary",
|
|
91
|
+
type: "submit",
|
|
92
|
+
onClick: _this.handleSave
|
|
93
|
+
}, t('Apply')));
|
|
59
94
|
};
|
|
60
95
|
return _this;
|
|
61
96
|
}
|
|
@@ -95,7 +130,6 @@ export var ModerateTray = /*#__PURE__*/function (_Component) {
|
|
|
95
130
|
}, {
|
|
96
131
|
key: "render",
|
|
97
132
|
value: function render() {
|
|
98
|
-
var _this2 = this;
|
|
99
133
|
return /*#__PURE__*/React.createElement(Tray, {
|
|
100
134
|
label: this.labelText(),
|
|
101
135
|
liveRegion: liveRegion,
|
|
@@ -106,25 +140,16 @@ export var ModerateTray = /*#__PURE__*/function (_Component) {
|
|
|
106
140
|
placement: "end",
|
|
107
141
|
shouldCloseOnDocumentClick: true,
|
|
108
142
|
ref: this.setTrayRef
|
|
109
|
-
}, /*#__PURE__*/React.createElement(
|
|
110
|
-
placement: "start",
|
|
111
|
-
offset: "x-small",
|
|
112
|
-
onClick: this.props.closeTray,
|
|
113
|
-
elementRef: this.setCloseRef,
|
|
114
|
-
screenReaderLabel: t('Close')
|
|
115
|
-
}), /*#__PURE__*/React.createElement(View, {
|
|
143
|
+
}, /*#__PURE__*/React.createElement(Flex, {
|
|
116
144
|
as: "div",
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
focused: focused
|
|
126
|
-
});
|
|
127
|
-
}) : this.renderName(), this.renderChildren()));
|
|
145
|
+
direction: "column",
|
|
146
|
+
height: "100vh"
|
|
147
|
+
}, /*#__PURE__*/React.createElement(Flex.Item, {
|
|
148
|
+
padding: "small medium"
|
|
149
|
+
}, this.renderTitleAndCloseButton()), /*#__PURE__*/React.createElement(Flex.Item, {
|
|
150
|
+
shouldGrow: true,
|
|
151
|
+
padding: "0 medium"
|
|
152
|
+
}, this.renderChildren()), /*#__PURE__*/React.createElement(Flex.Item, null, this.renderFooter())));
|
|
128
153
|
}
|
|
129
154
|
}]);
|
|
130
155
|
}(Component);
|
|
@@ -133,6 +158,7 @@ ModerateTray.propTypes = {
|
|
|
133
158
|
closeTray: PropTypes.func.isRequired,
|
|
134
159
|
isOpen: PropTypes.bool.isRequired,
|
|
135
160
|
onClose: PropTypes.func,
|
|
161
|
+
onSave: PropTypes.func.isRequired,
|
|
136
162
|
participantName: PropTypes.string
|
|
137
163
|
};
|
|
138
164
|
ModerateTray.defaultProps = {
|
|
@@ -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'))));
|
|
@@ -329,8 +329,9 @@ var ModerateTable = exports.ModerateTable = (_dec = (0, _emotion.withStyle)(_sty
|
|
|
329
329
|
return (0, _emotion.jsx)("div", {
|
|
330
330
|
css: this.props.styles.page
|
|
331
331
|
}, (0, _emotion.jsx)(_ModerateTray.default, {
|
|
332
|
-
onClose: this.onCloseTray
|
|
333
|
-
|
|
332
|
+
onClose: this.onCloseTray,
|
|
333
|
+
onSave: this.props.onSaveTray
|
|
334
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, null, !this.props.anonymousGrading && (_ResetQuiz || (_ResetQuiz = (0, _emotion.jsx)(_ResetQuiz2.default, null)))), this.props.children), this.renderContent());
|
|
334
335
|
}
|
|
335
336
|
}]);
|
|
336
337
|
}(_react.Component), _ModerateTable.propTypes = {
|
|
@@ -344,6 +345,7 @@ var ModerateTable = exports.ModerateTable = (_dec = (0, _emotion.withStyle)(_sty
|
|
|
344
345
|
onOpenTray: _propTypes.default.func,
|
|
345
346
|
onResultsLinkClick: _propTypes.default.func,
|
|
346
347
|
openTray: _propTypes.default.func.isRequired,
|
|
348
|
+
onSaveTray: _propTypes.default.func.isRequired,
|
|
347
349
|
sessionTimeLimitInSeconds: _propTypes.default.number,
|
|
348
350
|
hasSessionTimeLimit: _propTypes.default.bool,
|
|
349
351
|
sendSessionTimeLimit: _propTypes.default.func,
|
|
@@ -13,11 +13,13 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
15
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
16
|
+
var _uiFlex = require("@instructure/ui-flex");
|
|
16
17
|
var _uiView = require("@instructure/ui-view");
|
|
17
18
|
var _uiTooltip = require("@instructure/ui-tooltip");
|
|
18
19
|
var _uiTray = require("@instructure/ui-tray");
|
|
19
20
|
var _uiButtons = require("@instructure/ui-buttons");
|
|
20
21
|
var _uiTruncateText = require("@instructure/ui-truncate-text");
|
|
22
|
+
var _uiModal = require("@instructure/ui-modal");
|
|
21
23
|
var _quizCommon = require("@instructure/quiz-common");
|
|
22
24
|
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
23
25
|
var ModerateTray = exports.ModerateTray = /*#__PURE__*/function (_Component) {
|
|
@@ -46,6 +48,38 @@ var ModerateTray = exports.ModerateTray = /*#__PURE__*/function (_Component) {
|
|
|
46
48
|
isTruncated: false
|
|
47
49
|
});
|
|
48
50
|
};
|
|
51
|
+
_this.setCloseRef = function (el) {
|
|
52
|
+
return _this.closeRef = el;
|
|
53
|
+
};
|
|
54
|
+
_this.setTrayRef = function (el) {
|
|
55
|
+
return _this.trayRef = el;
|
|
56
|
+
};
|
|
57
|
+
_this.getTrayRef = function () {
|
|
58
|
+
return _this.trayRef;
|
|
59
|
+
};
|
|
60
|
+
_this.handleSave = function () {
|
|
61
|
+
_this.props.onSave();
|
|
62
|
+
_this.props.closeTray();
|
|
63
|
+
};
|
|
64
|
+
_this.renderTitleAndCloseButton = function () {
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, null, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
66
|
+
shouldGrow: true,
|
|
67
|
+
shouldShrink: true
|
|
68
|
+
}, _this.state.isTruncated ? /*#__PURE__*/_react.default.createElement(_uiTooltip.Tooltip, {
|
|
69
|
+
placement: "start",
|
|
70
|
+
renderTip: _this.labelText(),
|
|
71
|
+
mountNode: _this.getTrayRef || null
|
|
72
|
+
}, function (_ref) {
|
|
73
|
+
var focused = _ref.focused;
|
|
74
|
+
return _this.renderName({
|
|
75
|
+
focused: focused
|
|
76
|
+
});
|
|
77
|
+
}) : _this.renderName()), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, /*#__PURE__*/_react.default.createElement(_uiButtons.CloseButton, {
|
|
78
|
+
onClick: _this.props.closeTray,
|
|
79
|
+
elementRef: _this.setCloseRef,
|
|
80
|
+
screenReaderLabel: (0, _formatMessage.default)('Close')
|
|
81
|
+
})));
|
|
82
|
+
};
|
|
49
83
|
_this.renderChildren = function () {
|
|
50
84
|
return _react.default.Children.map(_this.props.children, function (child) {
|
|
51
85
|
if (!child) return null;
|
|
@@ -56,14 +90,15 @@ var ModerateTray = exports.ModerateTray = /*#__PURE__*/function (_Component) {
|
|
|
56
90
|
});
|
|
57
91
|
});
|
|
58
92
|
};
|
|
59
|
-
_this.
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
93
|
+
_this.renderFooter = function () {
|
|
94
|
+
return /*#__PURE__*/_react.default.createElement(_uiModal.Modal.Footer, null, /*#__PURE__*/_react.default.createElement(_uiButtons.Button, {
|
|
95
|
+
onClick: _this.props.closeTray,
|
|
96
|
+
margin: "0 x-small 0 0"
|
|
97
|
+
}, (0, _formatMessage.default)('Cancel')), /*#__PURE__*/_react.default.createElement(_uiButtons.Button, {
|
|
98
|
+
color: "primary",
|
|
99
|
+
type: "submit",
|
|
100
|
+
onClick: _this.handleSave
|
|
101
|
+
}, (0, _formatMessage.default)('Apply')));
|
|
67
102
|
};
|
|
68
103
|
return _this;
|
|
69
104
|
}
|
|
@@ -103,7 +138,6 @@ var ModerateTray = exports.ModerateTray = /*#__PURE__*/function (_Component) {
|
|
|
103
138
|
}, {
|
|
104
139
|
key: "render",
|
|
105
140
|
value: function render() {
|
|
106
|
-
var _this2 = this;
|
|
107
141
|
return /*#__PURE__*/_react.default.createElement(_uiTray.Tray, {
|
|
108
142
|
label: this.labelText(),
|
|
109
143
|
liveRegion: _quizCommon.liveRegion,
|
|
@@ -114,25 +148,16 @@ var ModerateTray = exports.ModerateTray = /*#__PURE__*/function (_Component) {
|
|
|
114
148
|
placement: "end",
|
|
115
149
|
shouldCloseOnDocumentClick: true,
|
|
116
150
|
ref: this.setTrayRef
|
|
117
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
118
|
-
placement: "start",
|
|
119
|
-
offset: "x-small",
|
|
120
|
-
onClick: this.props.closeTray,
|
|
121
|
-
elementRef: this.setCloseRef,
|
|
122
|
-
screenReaderLabel: (0, _formatMessage.default)('Close')
|
|
123
|
-
}), /*#__PURE__*/_react.default.createElement(_uiView.View, {
|
|
151
|
+
}, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, {
|
|
124
152
|
as: "div",
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
focused: focused
|
|
134
|
-
});
|
|
135
|
-
}) : this.renderName(), this.renderChildren()));
|
|
153
|
+
direction: "column",
|
|
154
|
+
height: "100vh"
|
|
155
|
+
}, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
156
|
+
padding: "small medium"
|
|
157
|
+
}, this.renderTitleAndCloseButton()), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
158
|
+
shouldGrow: true,
|
|
159
|
+
padding: "0 medium"
|
|
160
|
+
}, this.renderChildren()), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, this.renderFooter())));
|
|
136
161
|
}
|
|
137
162
|
}]);
|
|
138
163
|
}(_react.Component);
|
|
@@ -141,6 +166,7 @@ ModerateTray.propTypes = {
|
|
|
141
166
|
closeTray: _propTypes.default.func.isRequired,
|
|
142
167
|
isOpen: _propTypes.default.bool.isRequired,
|
|
143
168
|
onClose: _propTypes.default.func,
|
|
169
|
+
onSave: _propTypes.default.func.isRequired,
|
|
144
170
|
participantName: _propTypes.default.string
|
|
145
171
|
};
|
|
146
172
|
ModerateTray.defaultProps = {
|
|
@@ -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.
|
|
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.
|
|
48
|
-
"@instructure/quiz-i18n": "20.17.3-rc.
|
|
49
|
-
"@instructure/quiz-interactions": "20.17.3-rc.
|
|
50
|
-
"@instructure/quiz-number-input": "20.17.3-rc.
|
|
51
|
-
"@instructure/quiz-rce": "20.17.3-rc.
|
|
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.
|
|
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.
|
|
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": "
|
|
179
|
+
"gitHead": "9b710b87929cc2d203de0f9f68e75a5e2b1a3150"
|
|
180
180
|
}
|