@instructure/quiz-core 20.38.0 → 21.0.1-rc.2
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/BankEntry/presenter.js +2 -2
- package/es/banks/components/BanksList/presenter.js +1 -1
- package/es/banks/components/CreateBankModal/presenter.js +22 -24
- package/es/banks/components/EditBankModal/presenter.js +24 -22
- package/es/banks/components/SharingModal/presenter.js +2 -6
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +2 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +2 -2
- package/es/common/components/ConfirmationModal/presenter.js +10 -7
- package/es/common/components/PrintFontSizeModal/presenter.js +2 -2
- package/es/common/components/SDKApp/index.js +4 -4
- package/es/common/components/layout/navbar/SecondaryNavBarButton/index.js +13 -32
- package/es/common/components/layout/navbar/index.js +0 -3
- package/es/common/components/resources/entry/EntrySave/presenter.js +2 -2
- package/es/common/components/resources/item/ItemEdit/presenter.js +0 -5
- package/es/common/components/resources/quiz/AddContent/Popover/presenter.js +0 -4
- package/es/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +1 -1
- package/es/common/components/resources/stimulus/Stimulus/presenter.js +11 -5
- package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +17 -9
- package/es/common/components/resources/stimulus/StimulusEditInfo/presenter.js +2 -1
- package/es/common/components/resources/stimulus/StimulusShowInfo/index.js +7 -5
- package/es/common/components/shared/PaginatedCollection/presenter.js +2 -2
- package/es/common/components/shared/PrintTrigger/presenter.js +0 -5
- package/es/common/components/shared/TimeUnitsInput/index.js +2 -2
- package/es/common/components/shared/functionality/makeEditable.js +2 -2
- package/es/moderating/components/resources/AccommodationsModal/ExtraTimeMultiplier/index.js +2 -2
- package/es/reporting/components/resources/OutcomeAnalysis/presenter.js +1 -11
- package/es/reporting/components/resources/QuizAndItemAnalysis/presenter.js +2 -2
- package/lib/banks/components/BankEntry/presenter.js +2 -2
- package/lib/banks/components/BanksList/presenter.js +1 -1
- package/lib/banks/components/CreateBankModal/presenter.js +23 -24
- package/lib/banks/components/EditBankModal/presenter.js +25 -22
- package/lib/banks/components/SharingModal/presenter.js +2 -6
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +2 -2
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +2 -2
- package/lib/common/components/ConfirmationModal/presenter.js +10 -7
- package/lib/common/components/PrintFontSizeModal/presenter.js +2 -2
- package/lib/common/components/SDKApp/index.js +4 -4
- package/lib/common/components/layout/navbar/SecondaryNavBarButton/index.js +13 -32
- package/lib/common/components/layout/navbar/index.js +0 -3
- package/lib/common/components/resources/entry/EntrySave/presenter.js +2 -2
- package/lib/common/components/resources/item/ItemEdit/presenter.js +0 -5
- package/lib/common/components/resources/quiz/AddContent/Popover/presenter.js +0 -4
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +1 -1
- package/lib/common/components/resources/stimulus/Stimulus/presenter.js +11 -5
- package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +17 -9
- package/lib/common/components/resources/stimulus/StimulusEditInfo/presenter.js +2 -1
- package/lib/common/components/resources/stimulus/StimulusShowInfo/index.js +7 -5
- package/lib/common/components/shared/PaginatedCollection/presenter.js +2 -2
- package/lib/common/components/shared/PrintTrigger/presenter.js +0 -5
- package/lib/common/components/shared/TimeUnitsInput/index.js +2 -2
- package/lib/common/components/shared/functionality/makeEditable.js +2 -2
- package/lib/moderating/components/resources/AccommodationsModal/ExtraTimeMultiplier/index.js +2 -2
- package/lib/reporting/components/resources/OutcomeAnalysis/presenter.js +1 -11
- package/lib/reporting/components/resources/QuizAndItemAnalysis/presenter.js +2 -2
- package/package.json +78 -78
- package/es/banks/components/CreateBankModal/styles.js +0 -15
- package/es/banks/components/CreateBankModal/theme.js +0 -10
- package/es/banks/components/EditBankModal/styles.js +0 -12
- package/es/banks/components/EditBankModal/theme.js +0 -9
- package/es/common/components/layout/navbar/SecondaryNavBarButton/styles.js +0 -9
- package/es/common/components/layout/navbar/SecondaryNavBarButton/theme.js +0 -10
- package/lib/banks/components/CreateBankModal/styles.js +0 -22
- package/lib/banks/components/CreateBankModal/theme.js +0 -17
- package/lib/banks/components/EditBankModal/styles.js +0 -19
- package/lib/banks/components/EditBankModal/theme.js +0 -16
- package/lib/common/components/layout/navbar/SecondaryNavBarButton/styles.js +0 -16
- package/lib/common/components/layout/navbar/SecondaryNavBarButton/theme.js +0 -17
|
@@ -58,6 +58,7 @@ export var StimulusEdit = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
58
58
|
_this.props.setUi(SHOULD_CLONE_ITEM, false);
|
|
59
59
|
};
|
|
60
60
|
_this.handleDeleteTemporary = function () {
|
|
61
|
+
var isPassage = _this.isPassage();
|
|
61
62
|
_this.props.withConfirm(function () {
|
|
62
63
|
_this.onCancel();
|
|
63
64
|
_this.props.setUi(DELETED_QUIZ_ENTRY, {
|
|
@@ -65,10 +66,11 @@ export var StimulusEdit = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
65
66
|
inStimulus: false
|
|
66
67
|
});
|
|
67
68
|
}, {
|
|
68
|
-
title: t('Confirm Stimulus Removal'),
|
|
69
|
-
text: t('Are you sure you want to remove this stimulus?'),
|
|
70
|
-
continueText: t('Remove Stimulus'),
|
|
71
|
-
cancelText: t('Keep Stimulus')
|
|
69
|
+
title: isPassage ? t('Confirm Passage Removal') : t('Confirm Stimulus Removal'),
|
|
70
|
+
text: isPassage ? t('Are you sure you want to remove this passage?') : t('Are you sure you want to remove this stimulus?'),
|
|
71
|
+
continueText: isPassage ? t('Remove Passage') : t('Remove Stimulus'),
|
|
72
|
+
cancelText: isPassage ? t('Keep Passage ') : t('Keep Stimulus'),
|
|
73
|
+
automationPrefix: isPassage ? 'passage' : 'stimulus'
|
|
72
74
|
});
|
|
73
75
|
};
|
|
74
76
|
_this.handleDeleteStimulus = function () {
|
|
@@ -293,6 +295,12 @@ export var StimulusEdit = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
293
295
|
outsideApp = _checkClickedNode.outsideApp;
|
|
294
296
|
return outsideApp || !isEndEditingTrigger;
|
|
295
297
|
}
|
|
298
|
+
}, {
|
|
299
|
+
key: "isPassage",
|
|
300
|
+
value: function isPassage() {
|
|
301
|
+
var _this$props$stimulus;
|
|
302
|
+
return (_this$props$stimulus = this.props.stimulus) === null || _this$props$stimulus === void 0 ? void 0 : _this$props$stimulus.passage;
|
|
303
|
+
}
|
|
296
304
|
}, {
|
|
297
305
|
key: "afterSubmit",
|
|
298
306
|
value: function afterSubmit() {
|
|
@@ -320,8 +328,7 @@ export var StimulusEdit = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
320
328
|
}, {
|
|
321
329
|
key: "renderAddToBankOptions",
|
|
322
330
|
value: function renderAddToBankOptions() {
|
|
323
|
-
var
|
|
324
|
-
var paddingTopStyle = ((_this$props$stimulus = this.props.stimulus) === null || _this$props$stimulus === void 0 ? void 0 : _this$props$stimulus.passage) ? {
|
|
331
|
+
var paddingTopStyle = this.isPassage() ? {
|
|
325
332
|
padding: 'small 0 0'
|
|
326
333
|
} : {};
|
|
327
334
|
return jsx(View, Object.assign({
|
|
@@ -346,7 +353,8 @@ export var StimulusEdit = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
346
353
|
}, {
|
|
347
354
|
key: "renderStimulusEdit",
|
|
348
355
|
value: function renderStimulusEdit() {
|
|
349
|
-
var stimulusLabel = this.
|
|
356
|
+
var stimulusLabel = this.isPassage() ? t('Passage') : t('Stimulus');
|
|
357
|
+
var automationPrefix = this.isPassage() ? 'passage' : 'stimulus';
|
|
350
358
|
return jsx("div", null, jsx("div", {
|
|
351
359
|
css: this.props.styles.stimulus,
|
|
352
360
|
ref: this.handleRef
|
|
@@ -380,7 +388,7 @@ export var StimulusEdit = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
380
388
|
}, jsx(Button, {
|
|
381
389
|
type: "button",
|
|
382
390
|
onClick: this.onCancel,
|
|
383
|
-
"data-automation": "sdk-
|
|
391
|
+
"data-automation": "sdk-".concat(automationPrefix, "-discardButton")
|
|
384
392
|
}, t('Cancel'))), jsx("div", {
|
|
385
393
|
className: "submitButtonWrapper",
|
|
386
394
|
css: this.props.styles.buttonWrapper
|
|
@@ -389,7 +397,7 @@ export var StimulusEdit = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
389
397
|
color: "primary",
|
|
390
398
|
disabled: !this.state.canSubmit,
|
|
391
399
|
onClick: this.onSubmit,
|
|
392
|
-
"data-automation": "sdk-
|
|
400
|
+
"data-automation": "sdk-".concat(automationPrefix, "-done-button")
|
|
393
401
|
}, t('Done')))));
|
|
394
402
|
}
|
|
395
403
|
}, {
|
|
@@ -139,6 +139,7 @@ export var StimulusEditInfo = (_dec = withStyleOverrides(generateStyle, generate
|
|
|
139
139
|
var stimulus = this.props.workingStimulus;
|
|
140
140
|
var textAreaId = "stimulusBodyEdit_".concat(stimulus.id, "_").concat(this.props.isBankedContent);
|
|
141
141
|
var stimulusBodyId = "stimulusBodyEdit_".concat(stimulus.id, "_body");
|
|
142
|
+
var automationPrefix = stimulus.passage ? 'passage' : 'stimulus';
|
|
142
143
|
return jsx(FormFieldGroup, {
|
|
143
144
|
messages: this.inputErrors('onSelf'),
|
|
144
145
|
description: jsx(ScreenReaderContent, null, t('Edit Stimulus'))
|
|
@@ -154,7 +155,7 @@ export var StimulusEditInfo = (_dec = withStyleOverrides(generateStyle, generate
|
|
|
154
155
|
ref: this.props.setTitleRef,
|
|
155
156
|
onChange: this.onTextInputChange('title'),
|
|
156
157
|
value: stimulus.get('title'),
|
|
157
|
-
"data-automation": "sdk-
|
|
158
|
+
"data-automation": "sdk-".concat(automationPrefix, "-title-input")
|
|
158
159
|
})), this.renderInstructions(stimulus), jsx("div", {
|
|
159
160
|
css: this.props.styles.section
|
|
160
161
|
}, jsx(FormField, {
|
|
@@ -19,7 +19,9 @@ var StimulusShowInfo = /*#__PURE__*/function (_Component) {
|
|
|
19
19
|
_createClass(StimulusShowInfo, [{
|
|
20
20
|
key: "render",
|
|
21
21
|
value: function render() {
|
|
22
|
-
var
|
|
22
|
+
var stimulus = this.props.stimulus;
|
|
23
|
+
var automationPrefix = stimulus.passage ? 'passage' : 'stimulus';
|
|
24
|
+
var instructions = stimulus.instructions && /*#__PURE__*/React.createElement(View, {
|
|
23
25
|
as: "div",
|
|
24
26
|
padding: "small",
|
|
25
27
|
margin: "x-small 0 0 0",
|
|
@@ -38,10 +40,10 @@ var StimulusShowInfo = /*#__PURE__*/function (_Component) {
|
|
|
38
40
|
color: "primary",
|
|
39
41
|
size: "small",
|
|
40
42
|
weight: "bold"
|
|
41
|
-
},
|
|
43
|
+
}, stimulus.instructions))));
|
|
42
44
|
return /*#__PURE__*/React.createElement(View, {
|
|
43
45
|
as: "div"
|
|
44
|
-
},
|
|
46
|
+
}, stimulus.title && /*#__PURE__*/React.createElement(Heading, {
|
|
45
47
|
level: "h3",
|
|
46
48
|
as: "h2",
|
|
47
49
|
color: "primary",
|
|
@@ -49,8 +51,8 @@ var StimulusShowInfo = /*#__PURE__*/function (_Component) {
|
|
|
49
51
|
themeOverride: {
|
|
50
52
|
h2FontWeight: '700'
|
|
51
53
|
}
|
|
52
|
-
},
|
|
53
|
-
"data-automation": "sdk-
|
|
54
|
+
}, stimulus.title), instructions, /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
"data-automation": "sdk-".concat(automationPrefix, "-LeftPanelShow-content")
|
|
54
56
|
}, /*#__PURE__*/React.createElement(RichContentRenderer, {
|
|
55
57
|
content: this.props.stimulus.body
|
|
56
58
|
})));
|
|
@@ -54,8 +54,8 @@ export var PaginatedCollection = (_dec = withStyleOverrides(generateStyle, gener
|
|
|
54
54
|
this.getPage(this.props.stateKey, this.props.currentPage, this.props.params);
|
|
55
55
|
}
|
|
56
56
|
}, {
|
|
57
|
-
key: "
|
|
58
|
-
value: function
|
|
57
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
58
|
+
value: function UNSAFE_componentWillReceiveProps(_ref) {
|
|
59
59
|
var merge = _ref.merge,
|
|
60
60
|
params = _ref.params,
|
|
61
61
|
set = _ref.set,
|
|
@@ -8,7 +8,6 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import { Overlay, Mask } from '@instructure/ui-overlays';
|
|
9
9
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
10
10
|
import { QuizzesSpinner as Spinner } from "../spinner/Spinner.js";
|
|
11
|
-
import elementsForSelectors from "../../../util/ElementsForSelectors.js";
|
|
12
11
|
import CustomPropTypes from "../../../util/CustomPropTypes.js";
|
|
13
12
|
import { printWithCss, ensureImagesLoaded } from "../../../util/printUtils.js";
|
|
14
13
|
import PrintFontSizeModal from "../../PrintFontSizeModal/index.js";
|
|
@@ -74,9 +73,6 @@ export var PrintTrigger = /*#__PURE__*/function (_Component) {
|
|
|
74
73
|
});
|
|
75
74
|
_this.props.openPrintFontSizeModal();
|
|
76
75
|
};
|
|
77
|
-
_this.applicationElement = function () {
|
|
78
|
-
return elementsForSelectors(_this.props.appContainer);
|
|
79
|
-
};
|
|
80
76
|
_this.onExited = function () {};
|
|
81
77
|
_this.fontSize = '';
|
|
82
78
|
return _this;
|
|
@@ -85,7 +81,6 @@ export var PrintTrigger = /*#__PURE__*/function (_Component) {
|
|
|
85
81
|
key: "render",
|
|
86
82
|
value: function render() {
|
|
87
83
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Overlay, {
|
|
88
|
-
applicationElement: this.applicationElement,
|
|
89
84
|
open: this.state.waitingForPrintingToBeReady,
|
|
90
85
|
shouldContainFocus: true,
|
|
91
86
|
transition: "fade",
|
|
@@ -179,8 +179,8 @@ export var TimeUnitsInput = /*#__PURE__*/function (_Component) {
|
|
|
179
179
|
return _this;
|
|
180
180
|
}
|
|
181
181
|
_createClass(TimeUnitsInput, [{
|
|
182
|
-
key: "
|
|
183
|
-
value: function
|
|
182
|
+
key: "UNSAFE_componentWillMount",
|
|
183
|
+
value: function UNSAFE_componentWillMount() {
|
|
184
184
|
var _breakdownSeconds5 = breakdownSeconds(this.props.timeInSeconds, this.props.includeDays),
|
|
185
185
|
days = _breakdownSeconds5.days,
|
|
186
186
|
hours = _breakdownSeconds5.hours,
|
|
@@ -55,8 +55,8 @@ var giveEditProps = function giveEditProps(ComposedComponent) {
|
|
|
55
55
|
return _this;
|
|
56
56
|
}
|
|
57
57
|
_createClass(_Class, [{
|
|
58
|
-
key: "
|
|
59
|
-
value: function
|
|
58
|
+
key: "UNSAFE_componentWillMount",
|
|
59
|
+
value: function UNSAFE_componentWillMount() {
|
|
60
60
|
this._uniqId = uniqueId("".concat(ComposedComponent.displayName, "_"));
|
|
61
61
|
}
|
|
62
62
|
}, {
|
|
@@ -83,8 +83,8 @@ var ExtraTimeMultiplier = /*#__PURE__*/function (_withI18nSupport) {
|
|
|
83
83
|
return _this;
|
|
84
84
|
}
|
|
85
85
|
_createClass(ExtraTimeMultiplier, [{
|
|
86
|
-
key: "
|
|
87
|
-
value: function
|
|
86
|
+
key: "UNSAFE_componentWillMount",
|
|
87
|
+
value: function UNSAFE_componentWillMount() {
|
|
88
88
|
var multiplierValue = Math.max(this.props.timerMultiplierValue, this.props.minMultiplier);
|
|
89
89
|
var multiplierValueString = this.formatDecimal2FractionDigits(multiplierValue);
|
|
90
90
|
this.setState({
|
|
@@ -7,21 +7,12 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import OutcomesPerStudentReport from '@instructure/outcomes-ui/es/containers/OutcomesPerStudentReport';
|
|
8
8
|
import { liveRegion } from '@instructure/quiz-common';
|
|
9
9
|
import CustomPropTypes from "../../../../common/util/CustomPropTypes.js";
|
|
10
|
-
import elementsForSelectors from "../../../../common/util/ElementsForSelectors.js";
|
|
11
10
|
export var OutcomeAnalysis = /*#__PURE__*/function (_Component) {
|
|
12
11
|
_inherits(OutcomeAnalysis, _Component);
|
|
13
12
|
var _super = _createSuper(OutcomeAnalysis);
|
|
14
13
|
function OutcomeAnalysis() {
|
|
15
|
-
var _this;
|
|
16
14
|
_classCallCheck(this, OutcomeAnalysis);
|
|
17
|
-
|
|
18
|
-
args[_key] = arguments[_key];
|
|
19
|
-
}
|
|
20
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
21
|
-
_this.applicationElement = function () {
|
|
22
|
-
return elementsForSelectors(_this.props.appContainer);
|
|
23
|
-
};
|
|
24
|
-
return _this;
|
|
15
|
+
return _super.apply(this, arguments);
|
|
25
16
|
}
|
|
26
17
|
_createClass(OutcomeAnalysis, [{
|
|
27
18
|
key: "render",
|
|
@@ -34,7 +25,6 @@ export var OutcomeAnalysis = /*#__PURE__*/function (_Component) {
|
|
|
34
25
|
loadUsersOverride = _this$props.loadUsersOverride,
|
|
35
26
|
showRollups = _this$props.showRollups;
|
|
36
27
|
return /*#__PURE__*/React.createElement(OutcomesPerStudentReport, {
|
|
37
|
-
applicationElement: this.applicationElement,
|
|
38
28
|
artifactType: "quizzes.quiz",
|
|
39
29
|
artifactId: quizId,
|
|
40
30
|
contextUuid: contextUuid,
|
|
@@ -40,8 +40,8 @@ export var QuizAndItemAnalysis = (_dec = withStyleOverrides(generateStyle, gener
|
|
|
40
40
|
this.getAnalyses(this.props.activeQuizId);
|
|
41
41
|
}
|
|
42
42
|
}, {
|
|
43
|
-
key: "
|
|
44
|
-
value: function
|
|
43
|
+
key: "UNSAFE_componentWillUpdate",
|
|
44
|
+
value: function UNSAFE_componentWillUpdate(nextProps) {
|
|
45
45
|
if (this.props.activeQuizId !== nextProps.activeQuizId) {
|
|
46
46
|
this.getAnalyses(nextProps.activeQuizId);
|
|
47
47
|
}
|
|
@@ -219,8 +219,8 @@ var BankEntry = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _th
|
|
|
219
219
|
this.props.setShouldClone(false);
|
|
220
220
|
}
|
|
221
221
|
}, {
|
|
222
|
-
key: "
|
|
223
|
-
value: function
|
|
222
|
+
key: "UNSAFE_componentWillMount",
|
|
223
|
+
value: function UNSAFE_componentWillMount() {
|
|
224
224
|
this.props.setShouldClone(false);
|
|
225
225
|
}
|
|
226
226
|
}, {
|
|
@@ -454,7 +454,7 @@ var BanksList = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _th
|
|
|
454
454
|
}, (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, {
|
|
455
455
|
id: "header-num-questions",
|
|
456
456
|
width: "1"
|
|
457
|
-
}, (0, _formatMessage.default)('Questions')), this.renderTableSortHeader('last_used', (0, _formatMessage.default)('Last Used')), this.renderTableSortHeader('created_at', (0, _formatMessage.default)('Created')),
|
|
457
|
+
}, (0, _formatMessage.default)('Questions')), this.renderTableSortHeader('last_used', (0, _formatMessage.default)('Last Used')), this.renderTableSortHeader('created_at', (0, _formatMessage.default)('Created')), (0, _emotion.jsx)(_uiTable.Table.ColHeader, {
|
|
458
458
|
id: "header-option-links",
|
|
459
459
|
width: "1"
|
|
460
460
|
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Bank option links'))))), (0, _emotion.jsx)(_uiTable.Table.Body, null, (this.props.banks.toArray() || []).map(function (bank) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
@@ -9,7 +10,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
9
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
11
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
11
12
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
12
|
-
var _react = require("react");
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
15
|
var _uiButtons = require("@instructure/ui-buttons");
|
|
15
16
|
var _uiCheckbox = require("@instructure/ui-checkbox");
|
|
@@ -20,20 +21,15 @@ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/f
|
|
|
20
21
|
var _Bank = _interopRequireDefault(require("../../../common/records/Bank.js"));
|
|
21
22
|
var _instUIMessages = require("../../../common/util/instUIMessages.js");
|
|
22
23
|
var _quizCommon = require("@instructure/quiz-common");
|
|
23
|
-
var
|
|
24
|
-
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
25
|
-
var _dec, _class, _CreateBankModal;
|
|
24
|
+
var _CreateBankModal;
|
|
26
25
|
/** @jsx jsx */
|
|
27
|
-
var CreateBankModal =
|
|
26
|
+
var CreateBankModal = /*#__PURE__*/function (_Component) {
|
|
28
27
|
(0, _inherits2.default)(CreateBankModal, _Component);
|
|
29
28
|
var _super = (0, _createSuper2.default)(CreateBankModal);
|
|
30
|
-
function CreateBankModal() {
|
|
29
|
+
function CreateBankModal(props) {
|
|
31
30
|
var _this;
|
|
32
31
|
(0, _classCallCheck2.default)(this, CreateBankModal);
|
|
33
|
-
|
|
34
|
-
args[_key] = arguments[_key];
|
|
35
|
-
}
|
|
36
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
32
|
+
_this = _super.call(this, props);
|
|
37
33
|
_this.state = {
|
|
38
34
|
shareWithCourse: false
|
|
39
35
|
};
|
|
@@ -45,7 +41,8 @@ var CreateBankModal = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defaul
|
|
|
45
41
|
_this.props.onCreateBank();
|
|
46
42
|
_this.closeAction();
|
|
47
43
|
} else {
|
|
48
|
-
_this
|
|
44
|
+
var _this$bankNameInput$c;
|
|
45
|
+
(_this$bankNameInput$c = _this.bankNameInput.current) === null || _this$bankNameInput$c === void 0 ? void 0 : _this$bankNameInput$c.focus();
|
|
49
46
|
}
|
|
50
47
|
};
|
|
51
48
|
_this.closeAction = function () {
|
|
@@ -75,6 +72,7 @@ var CreateBankModal = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defaul
|
|
|
75
72
|
shareWithCourse: event.target.checked
|
|
76
73
|
});
|
|
77
74
|
};
|
|
75
|
+
_this.bankNameInput = /*#__PURE__*/_react.default.createRef();
|
|
78
76
|
return _this;
|
|
79
77
|
}
|
|
80
78
|
(0, _createClass2.default)(CreateBankModal, [{
|
|
@@ -99,17 +97,14 @@ var CreateBankModal = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defaul
|
|
|
99
97
|
}, {
|
|
100
98
|
key: "renderContent",
|
|
101
99
|
value: function renderContent() {
|
|
102
|
-
return (0, _emotion.jsx)("div", {
|
|
103
|
-
css: this.props.styles.bankNameInput
|
|
104
|
-
}, (0, _emotion.jsx)(_quizCommon.TextInput, {
|
|
100
|
+
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)(_quizCommon.TextInput, {
|
|
105
101
|
messages: this.getErrors(),
|
|
106
102
|
onChange: this.onNameChange,
|
|
107
|
-
renderLabel: (0,
|
|
108
|
-
|
|
109
|
-
}, (0, _formatMessage.default)('Bank Name')),
|
|
103
|
+
renderLabel: (0, _formatMessage.default)('Bank Name'),
|
|
104
|
+
isRequired: true,
|
|
110
105
|
type: "text",
|
|
111
|
-
|
|
112
|
-
|
|
106
|
+
"data-automation": "sdk-create-bank-name-textinput",
|
|
107
|
+
ref: this.bankNameInput
|
|
113
108
|
}), this.renderCheckbox());
|
|
114
109
|
}
|
|
115
110
|
}, {
|
|
@@ -141,7 +136,6 @@ var CreateBankModal = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defaul
|
|
|
141
136
|
label: (0, _formatMessage.default)('Item Bank'),
|
|
142
137
|
"data-automation": "sdk-create-bank-modal"
|
|
143
138
|
}, (0, _emotion.jsx)(_quizCommon.ModalHeader, null, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
144
|
-
level: "reset",
|
|
145
139
|
as: "h2"
|
|
146
140
|
}, (0, _formatMessage.default)('New Item Bank')), (0, _emotion.jsx)(_uiButtons.CloseButton, {
|
|
147
141
|
onClick: this.closeAction,
|
|
@@ -153,7 +147,12 @@ var CreateBankModal = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defaul
|
|
|
153
147
|
}]);
|
|
154
148
|
CreateBankModal.displayName = "CreateBankModal";
|
|
155
149
|
return CreateBankModal;
|
|
156
|
-
}(_react.Component)
|
|
150
|
+
}(_react.Component);
|
|
151
|
+
exports.CreateBankModal = CreateBankModal;
|
|
152
|
+
_CreateBankModal = CreateBankModal;
|
|
153
|
+
CreateBankModal.displayName = 'CreateBankModal';
|
|
154
|
+
CreateBankModal.componentId = "Quizzes".concat(_CreateBankModal.displayName);
|
|
155
|
+
CreateBankModal.propTypes = {
|
|
157
156
|
modalOpen: _propTypes.default.bool.isRequired,
|
|
158
157
|
modalTrigger: _propTypes.default.instanceOf(_react.Component),
|
|
159
158
|
temporaryBank: _propTypes.default.instanceOf(_Bank.default).isRequired,
|
|
@@ -176,13 +175,13 @@ var CreateBankModal = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defaul
|
|
|
176
175
|
root_account_name: _propTypes.default.string
|
|
177
176
|
}),
|
|
178
177
|
styles: _propTypes.default.object
|
|
179
|
-
}
|
|
178
|
+
};
|
|
179
|
+
CreateBankModal.defaultProps = {
|
|
180
180
|
displayError: false,
|
|
181
181
|
modalTrigger: null,
|
|
182
182
|
showShareBankOnCreate: false,
|
|
183
183
|
itemBanksScope: {},
|
|
184
184
|
onCreateBank: function onCreateBank() {}
|
|
185
|
-
}
|
|
186
|
-
exports.CreateBankModal = CreateBankModal;
|
|
185
|
+
};
|
|
187
186
|
var _default = CreateBankModal;
|
|
188
187
|
exports.default = _default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
@@ -9,7 +10,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
9
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
11
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
11
12
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
12
|
-
var _react = require("react");
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
15
|
var _uiButtons = require("@instructure/ui-buttons");
|
|
15
16
|
var _uiHeading = require("@instructure/ui-heading");
|
|
@@ -18,25 +19,23 @@ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/f
|
|
|
18
19
|
var _instUIMessages = require("../../../common/util/instUIMessages.js");
|
|
19
20
|
var _quizCommon = require("@instructure/quiz-common");
|
|
20
21
|
var _Bank = _interopRequireDefault(require("../../../common/records/Bank.js"));
|
|
21
|
-
var
|
|
22
|
-
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
23
|
-
var _dec, _class, _EditBankModal;
|
|
22
|
+
var _EditBankModal;
|
|
24
23
|
/** @jsx jsx */
|
|
25
|
-
var EditBankModal =
|
|
24
|
+
var EditBankModal = /*#__PURE__*/function (_Component) {
|
|
26
25
|
(0, _inherits2.default)(EditBankModal, _Component);
|
|
27
26
|
var _super = (0, _createSuper2.default)(EditBankModal);
|
|
28
|
-
function EditBankModal() {
|
|
27
|
+
function EditBankModal(props) {
|
|
29
28
|
var _this;
|
|
30
29
|
(0, _classCallCheck2.default)(this, EditBankModal);
|
|
31
|
-
|
|
32
|
-
args[_key] = arguments[_key];
|
|
33
|
-
}
|
|
34
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
30
|
+
_this = _super.call(this, props);
|
|
35
31
|
_this.continueAction = function () {
|
|
36
32
|
_this.props.showError(_this.props.errorKey);
|
|
37
33
|
if (_this.props.workingBank.isValid()) {
|
|
38
34
|
_this.props.updateBank(_this.props.workingBank);
|
|
39
35
|
_this.closeAction();
|
|
36
|
+
} else {
|
|
37
|
+
var _this$bankNameInput$c;
|
|
38
|
+
(_this$bankNameInput$c = _this.bankNameInput.current) === null || _this$bankNameInput$c === void 0 ? void 0 : _this$bankNameInput$c.focus();
|
|
40
39
|
}
|
|
41
40
|
};
|
|
42
41
|
_this.closeAction = function () {
|
|
@@ -58,6 +57,7 @@ var EditBankModal = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
58
57
|
return (0, _instUIMessages.toErrors)(_this.props.workingBank.errorsFor('title').toJS());
|
|
59
58
|
}
|
|
60
59
|
};
|
|
60
|
+
_this.bankNameInput = /*#__PURE__*/_react.default.createRef();
|
|
61
61
|
return _this;
|
|
62
62
|
}
|
|
63
63
|
(0, _createClass2.default)(EditBankModal, [{
|
|
@@ -82,17 +82,16 @@ var EditBankModal = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
82
82
|
}, {
|
|
83
83
|
key: "renderContent",
|
|
84
84
|
value: function renderContent() {
|
|
85
|
-
return (0, _emotion.jsx)(
|
|
86
|
-
css: this.props.styles.bankNameInput
|
|
87
|
-
}, (0, _emotion.jsx)(_quizCommon.TextInput, {
|
|
85
|
+
return (0, _emotion.jsx)(_quizCommon.TextInput, {
|
|
88
86
|
value: this.props.workingBank.title,
|
|
89
87
|
messages: this.getErrors(),
|
|
90
88
|
onChange: this.onNameChange,
|
|
91
|
-
renderLabel: (0,
|
|
89
|
+
renderLabel: (0, _formatMessage.default)('Bank Name'),
|
|
92
90
|
type: "text",
|
|
93
|
-
|
|
94
|
-
"data-automation": "sdk-edit-bank-name-textinput"
|
|
95
|
-
|
|
91
|
+
isRequired: true,
|
|
92
|
+
"data-automation": "sdk-edit-bank-name-textinput",
|
|
93
|
+
ref: this.bankNameInput
|
|
94
|
+
});
|
|
96
95
|
}
|
|
97
96
|
}, {
|
|
98
97
|
key: "render",
|
|
@@ -104,7 +103,6 @@ var EditBankModal = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
104
103
|
label: (0, _formatMessage.default)('Item Bank'),
|
|
105
104
|
"data-automation": "sdk-edit-bank-modal"
|
|
106
105
|
}, (0, _emotion.jsx)(_quizCommon.ModalHeader, null, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
107
|
-
level: "reset",
|
|
108
106
|
as: "h2"
|
|
109
107
|
}, (0, _formatMessage.default)('Edit Item Bank')), (0, _emotion.jsx)(_uiButtons.CloseButton, {
|
|
110
108
|
onClick: this.closeAction,
|
|
@@ -116,7 +114,12 @@ var EditBankModal = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
116
114
|
}]);
|
|
117
115
|
EditBankModal.displayName = "EditBankModal";
|
|
118
116
|
return EditBankModal;
|
|
119
|
-
}(_react.Component)
|
|
117
|
+
}(_react.Component);
|
|
118
|
+
exports.EditBankModal = EditBankModal;
|
|
119
|
+
_EditBankModal = EditBankModal;
|
|
120
|
+
EditBankModal.displayName = 'EditBankModal';
|
|
121
|
+
EditBankModal.componentId = "Quizzes".concat(_EditBankModal.displayName);
|
|
122
|
+
EditBankModal.propTypes = {
|
|
120
123
|
modalOpen: _propTypes.default.bool.isRequired,
|
|
121
124
|
modalTrigger: _propTypes.default.instanceOf(_react.Component),
|
|
122
125
|
workingBank: _propTypes.default.instanceOf(_Bank.default).isRequired,
|
|
@@ -129,10 +132,10 @@ var EditBankModal = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
129
132
|
hideError: _propTypes.default.func.isRequired,
|
|
130
133
|
closeModal: _propTypes.default.func.isRequired,
|
|
131
134
|
styles: _propTypes.default.object
|
|
132
|
-
}
|
|
135
|
+
};
|
|
136
|
+
EditBankModal.defaultProps = {
|
|
133
137
|
displayError: false,
|
|
134
138
|
modalTrigger: null
|
|
135
|
-
}
|
|
136
|
-
exports.EditBankModal = EditBankModal;
|
|
139
|
+
};
|
|
137
140
|
var _default = EditBankModal;
|
|
138
141
|
exports.default = _default;
|
|
@@ -28,7 +28,6 @@ var _uiGrid = require("@instructure/ui-grid");
|
|
|
28
28
|
var _uiTabs = require("@instructure/ui-tabs");
|
|
29
29
|
var _uiText = require("@instructure/ui-text");
|
|
30
30
|
var _emotion = require("@instructure/emotion");
|
|
31
|
-
var _ElementsForSelectors = _interopRequireDefault(require("../../../common/util/ElementsForSelectors.js"));
|
|
32
31
|
var _CustomPropTypes = _interopRequireDefault(require("../../../common/util/CustomPropTypes.js"));
|
|
33
32
|
var _index = _interopRequireDefault(require("./ShareList/index.js"));
|
|
34
33
|
var _index2 = _interopRequireDefault(require("../AsyncSearch/index.js"));
|
|
@@ -62,9 +61,6 @@ var SharingModalPresenter = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.
|
|
|
62
61
|
};
|
|
63
62
|
_this.shareListRef = null;
|
|
64
63
|
_this.shareButtonRef = null;
|
|
65
|
-
_this.applicationElement = function () {
|
|
66
|
-
return (0, _ElementsForSelectors.default)(_this.props.appContainer);
|
|
67
|
-
};
|
|
68
64
|
// =============
|
|
69
65
|
// LIFECYCLE
|
|
70
66
|
// =============
|
|
@@ -341,8 +337,8 @@ var SharingModalPresenter = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.
|
|
|
341
337
|
});
|
|
342
338
|
}
|
|
343
339
|
}, {
|
|
344
|
-
key: "
|
|
345
|
-
value: function
|
|
340
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
341
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
346
342
|
this.setState({
|
|
347
343
|
accountPermission: nextProps.bank.accountPermission,
|
|
348
344
|
shares: nextProps.sharedBanks
|
|
@@ -94,8 +94,8 @@ var QuizEntryEditFooter = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.de
|
|
|
94
94
|
return _this;
|
|
95
95
|
}
|
|
96
96
|
(0, _createClass2.default)(QuizEntryEditFooter, [{
|
|
97
|
-
key: "
|
|
98
|
-
value: function
|
|
97
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
98
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
99
99
|
var points = this.getPoints(nextProps);
|
|
100
100
|
this.setState({
|
|
101
101
|
points: points,
|
|
@@ -284,8 +284,8 @@ var QuizEntryEdit = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
284
284
|
this.props.onEditQuizEntryToggle(this.props.quizEntry.id);
|
|
285
285
|
}
|
|
286
286
|
}, {
|
|
287
|
-
key: "
|
|
288
|
-
value: function
|
|
287
|
+
key: "UNSAFE_componentWillMount",
|
|
288
|
+
value: function UNSAFE_componentWillMount() {
|
|
289
289
|
this.props.setUi(_quizCommon.SHOULD_CLONE_ITEM, false);
|
|
290
290
|
}
|
|
291
291
|
}, {
|
|
@@ -65,19 +65,20 @@ var ConfirmationModal = /*#__PURE__*/function (_Component) {
|
|
|
65
65
|
continueText = _this$props2.continueText,
|
|
66
66
|
size = _this$props2.size,
|
|
67
67
|
shouldReturnFocus = _this$props2.shouldReturnFocus,
|
|
68
|
-
continueVariant = _this$props2.continueVariant
|
|
68
|
+
continueVariant = _this$props2.continueVariant,
|
|
69
|
+
automationPrefix = _this$props2.automationPrefix;
|
|
69
70
|
return /*#__PURE__*/_react.default.createElement(_quizCommon.ImportantModal, {
|
|
70
71
|
open: this.props.modalOpen,
|
|
71
72
|
size: size || 'small',
|
|
72
73
|
label: title || (0, _formatMessage.default)('Confirm'),
|
|
73
74
|
onDismiss: this.cancelAction,
|
|
74
|
-
"data-automation": "sdk-confirmation-modal",
|
|
75
|
+
"data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal") : 'sdk-confirmation-modal',
|
|
75
76
|
shouldReturnFocus: shouldReturnFocus,
|
|
76
77
|
onClose: this.doAction
|
|
77
78
|
}, /*#__PURE__*/_react.default.createElement(_quizCommon.ModalHeader, null, /*#__PURE__*/_react.default.createElement(_uiHeading.Heading, {
|
|
78
79
|
level: "reset",
|
|
79
80
|
as: "h2",
|
|
80
|
-
"data-automation": "sdk-confirmation-modal-heading"
|
|
81
|
+
"data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-heading") : 'sdk-confirmation-modal-heading'
|
|
81
82
|
}, title || (0, _formatMessage.default)('Confirm')), /*#__PURE__*/_react.default.createElement(_uiButtons.CloseButton, {
|
|
82
83
|
onClick: this.cancelAction,
|
|
83
84
|
placement: "end",
|
|
@@ -88,12 +89,12 @@ var ConfirmationModal = /*#__PURE__*/function (_Component) {
|
|
|
88
89
|
}, text || (0, _formatMessage.default)('Are you sure?'))), /*#__PURE__*/_react.default.createElement(_quizCommon.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_uiButtons.Button, {
|
|
89
90
|
onClick: this.cancelAction,
|
|
90
91
|
margin: _quizCommon.XSMALL_SIDE_MARGIN,
|
|
91
|
-
"data-automation": "sdk-confirmation-modal-cancel"
|
|
92
|
+
"data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-cancel") : 'sdk-confirmation-modal-cancel'
|
|
92
93
|
}, cancelText || (0, _formatMessage.default)('Cancel')), /*#__PURE__*/_react.default.createElement(_uiButtons.Button, {
|
|
93
94
|
color: continueVariant || 'primary',
|
|
94
95
|
onClick: this.continueAction,
|
|
95
96
|
margin: _quizCommon.XSMALL_SIDE_MARGIN,
|
|
96
|
-
"data-automation": "sdk-confirmation-modal-confirm"
|
|
97
|
+
"data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-confirm") : 'sdk-confirmation-modal-confirm'
|
|
97
98
|
}, continueText || (0, _formatMessage.default)('Confirm'))));
|
|
98
99
|
}
|
|
99
100
|
}]);
|
|
@@ -112,7 +113,8 @@ ConfirmationModal.propTypes = {
|
|
|
112
113
|
size: _propTypes.default.string,
|
|
113
114
|
shouldReturnFocus: _propTypes.default.bool,
|
|
114
115
|
onContinue: _propTypes.default.func,
|
|
115
|
-
onCancel: _propTypes.default.func
|
|
116
|
+
onCancel: _propTypes.default.func,
|
|
117
|
+
automationPrefix: _propTypes.default.string
|
|
116
118
|
};
|
|
117
119
|
ConfirmationModal.defaultProps = {
|
|
118
120
|
title: null,
|
|
@@ -123,7 +125,8 @@ ConfirmationModal.defaultProps = {
|
|
|
123
125
|
size: null,
|
|
124
126
|
shouldReturnFocus: true,
|
|
125
127
|
onContinue: null,
|
|
126
|
-
onCancel: null
|
|
128
|
+
onCancel: null,
|
|
129
|
+
automationPrefix: null
|
|
127
130
|
};
|
|
128
131
|
var _default = ConfirmationModal;
|
|
129
132
|
exports.default = _default;
|
|
@@ -92,8 +92,8 @@ var PrintFontSizeModal = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.def
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
}, {
|
|
95
|
-
key: "
|
|
96
|
-
value: function
|
|
95
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
96
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
97
97
|
this.setState({
|
|
98
98
|
selectedFontSize: nextProps.persistedPrintFontSize || this.state.selectedFontSize,
|
|
99
99
|
rememberTextSizeSetting: !!this.props.persistedPrintFontSize || this.state.rememberTextSizeSetting
|