@instructure/quiz-core 20.36.1-rc.40 → 20.36.1-rc.41
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/common/components/ConfirmationModal/presenter.js +10 -7
- 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/lib/common/components/ConfirmationModal/presenter.js +10 -7
- 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/package.json +9 -9
|
@@ -57,19 +57,20 @@ export var ConfirmationModal = /*#__PURE__*/function (_Component) {
|
|
|
57
57
|
continueText = _this$props2.continueText,
|
|
58
58
|
size = _this$props2.size,
|
|
59
59
|
shouldReturnFocus = _this$props2.shouldReturnFocus,
|
|
60
|
-
continueVariant = _this$props2.continueVariant
|
|
60
|
+
continueVariant = _this$props2.continueVariant,
|
|
61
|
+
automationPrefix = _this$props2.automationPrefix;
|
|
61
62
|
return /*#__PURE__*/React.createElement(ImportantModal, {
|
|
62
63
|
open: this.props.modalOpen,
|
|
63
64
|
size: size || 'small',
|
|
64
65
|
label: title || t('Confirm'),
|
|
65
66
|
onDismiss: this.cancelAction,
|
|
66
|
-
"data-automation": "sdk-confirmation-modal",
|
|
67
|
+
"data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal") : 'sdk-confirmation-modal',
|
|
67
68
|
shouldReturnFocus: shouldReturnFocus,
|
|
68
69
|
onClose: this.doAction
|
|
69
70
|
}, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(Heading, {
|
|
70
71
|
level: "reset",
|
|
71
72
|
as: "h2",
|
|
72
|
-
"data-automation": "sdk-confirmation-modal-heading"
|
|
73
|
+
"data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-heading") : 'sdk-confirmation-modal-heading'
|
|
73
74
|
}, title || t('Confirm')), /*#__PURE__*/React.createElement(CloseButton, {
|
|
74
75
|
onClick: this.cancelAction,
|
|
75
76
|
placement: "end",
|
|
@@ -80,12 +81,12 @@ export var ConfirmationModal = /*#__PURE__*/function (_Component) {
|
|
|
80
81
|
}, text || t('Are you sure?'))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
81
82
|
onClick: this.cancelAction,
|
|
82
83
|
margin: XSMALL_SIDE_MARGIN,
|
|
83
|
-
"data-automation": "sdk-confirmation-modal-cancel"
|
|
84
|
+
"data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-cancel") : 'sdk-confirmation-modal-cancel'
|
|
84
85
|
}, cancelText || t('Cancel')), /*#__PURE__*/React.createElement(Button, {
|
|
85
86
|
color: continueVariant || 'primary',
|
|
86
87
|
onClick: this.continueAction,
|
|
87
88
|
margin: XSMALL_SIDE_MARGIN,
|
|
88
|
-
"data-automation": "sdk-confirmation-modal-confirm"
|
|
89
|
+
"data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-confirm") : 'sdk-confirmation-modal-confirm'
|
|
89
90
|
}, continueText || t('Confirm'))));
|
|
90
91
|
}
|
|
91
92
|
}]);
|
|
@@ -103,7 +104,8 @@ ConfirmationModal.propTypes = {
|
|
|
103
104
|
size: PropTypes.string,
|
|
104
105
|
shouldReturnFocus: PropTypes.bool,
|
|
105
106
|
onContinue: PropTypes.func,
|
|
106
|
-
onCancel: PropTypes.func
|
|
107
|
+
onCancel: PropTypes.func,
|
|
108
|
+
automationPrefix: PropTypes.string
|
|
107
109
|
};
|
|
108
110
|
ConfirmationModal.defaultProps = {
|
|
109
111
|
title: null,
|
|
@@ -114,6 +116,7 @@ ConfirmationModal.defaultProps = {
|
|
|
114
116
|
size: null,
|
|
115
117
|
shouldReturnFocus: true,
|
|
116
118
|
onContinue: null,
|
|
117
|
-
onCancel: null
|
|
119
|
+
onCancel: null,
|
|
120
|
+
automationPrefix: null
|
|
118
121
|
};
|
|
119
122
|
export default ConfirmationModal;
|
|
@@ -67,6 +67,11 @@ export var Stimulus = (_dec = withStyleOverrides(generateStyle, generateComponen
|
|
|
67
67
|
lockBlueprintContentEnabled = _this$props2.lockBlueprintContentEnabled;
|
|
68
68
|
return lockBlueprintContentEnabled && isContentLockedByBlueprint;
|
|
69
69
|
}
|
|
70
|
+
}, {
|
|
71
|
+
key: "isPassage",
|
|
72
|
+
value: function isPassage() {
|
|
73
|
+
return this.props.stimulus.passage;
|
|
74
|
+
}
|
|
70
75
|
}, {
|
|
71
76
|
key: "renderChildQuizEntries",
|
|
72
77
|
value: function renderChildQuizEntries() {
|
|
@@ -94,9 +99,10 @@ export var Stimulus = (_dec = withStyleOverrides(generateStyle, generateComponen
|
|
|
94
99
|
key: "renderStimulusPanel",
|
|
95
100
|
value: function renderStimulusPanel() {
|
|
96
101
|
var StimulusComponent = this.props.isEditing ? StimulusEdit : StimulusShow;
|
|
102
|
+
var automationPrefix = this.isPassage() ? 'passage' : 'stimulus';
|
|
97
103
|
var connectDragPreview = this.props.connectDragPreview;
|
|
98
104
|
return connectDragPreview(jsx("div", {
|
|
99
|
-
"data-automation": "sdk-
|
|
105
|
+
"data-automation": "sdk-".concat(automationPrefix, "-LeftPanelShow")
|
|
100
106
|
}, jsx(StimulusComponent, {
|
|
101
107
|
bankEntryWarningWrapperProps: this.props.bankEntryWarningWrapperProps,
|
|
102
108
|
connectDragSource: this.props.connectDragSource,
|
|
@@ -121,18 +127,18 @@ export var Stimulus = (_dec = withStyleOverrides(generateStyle, generateComponen
|
|
|
121
127
|
}, {
|
|
122
128
|
key: "renderPanels",
|
|
123
129
|
value: function renderPanels(propsForDnDZone) {
|
|
124
|
-
var
|
|
130
|
+
var automationPrefix = this.isPassage() ? 'passage' : 'stimulus';
|
|
125
131
|
return jsx("div", {
|
|
126
132
|
css: this.props.styles.stimulus,
|
|
127
133
|
ref: this.props.dndRef,
|
|
128
|
-
"data-automation": "sdk-
|
|
134
|
+
"data-automation": "sdk-".concat(automationPrefix)
|
|
129
135
|
}, jsx("div", {
|
|
130
136
|
css: this.props.styles.leftPanel
|
|
131
137
|
}, this.renderStimulusPanel()), jsx("div", {
|
|
132
138
|
css: this.props.styles.itemPanel
|
|
133
|
-
}, jsx("div", null), this.renderChildQuizEntries(), !isPassage && jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
|
|
139
|
+
}, jsx("div", null), this.renderChildQuizEntries(), !this.isPassage() && jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
|
|
134
140
|
location: "in"
|
|
135
|
-
})), this.props.childEntries.size === 0 && !this.isQuizContentLocked() && !isPassage && jsx(AddContentPopover, {
|
|
141
|
+
})), this.props.childEntries.size === 0 && !this.isQuizContentLocked() && !this.isPassage() && jsx(AddContentPopover, {
|
|
136
142
|
allowStimulusCreation: false,
|
|
137
143
|
stimulusId: this.props.stimulus.id,
|
|
138
144
|
parentEntryId: this.props.quizEntry.id,
|
|
@@ -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
|
})));
|
|
@@ -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;
|
|
@@ -74,6 +74,11 @@ var Stimulus = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _the
|
|
|
74
74
|
lockBlueprintContentEnabled = _this$props2.lockBlueprintContentEnabled;
|
|
75
75
|
return lockBlueprintContentEnabled && isContentLockedByBlueprint;
|
|
76
76
|
}
|
|
77
|
+
}, {
|
|
78
|
+
key: "isPassage",
|
|
79
|
+
value: function isPassage() {
|
|
80
|
+
return this.props.stimulus.passage;
|
|
81
|
+
}
|
|
77
82
|
}, {
|
|
78
83
|
key: "renderChildQuizEntries",
|
|
79
84
|
value: function renderChildQuizEntries() {
|
|
@@ -101,9 +106,10 @@ var Stimulus = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _the
|
|
|
101
106
|
key: "renderStimulusPanel",
|
|
102
107
|
value: function renderStimulusPanel() {
|
|
103
108
|
var StimulusComponent = this.props.isEditing ? _index2.default : _index3.default;
|
|
109
|
+
var automationPrefix = this.isPassage() ? 'passage' : 'stimulus';
|
|
104
110
|
var connectDragPreview = this.props.connectDragPreview;
|
|
105
111
|
return connectDragPreview((0, _emotion.jsx)("div", {
|
|
106
|
-
"data-automation": "sdk-
|
|
112
|
+
"data-automation": "sdk-".concat(automationPrefix, "-LeftPanelShow")
|
|
107
113
|
}, (0, _emotion.jsx)(StimulusComponent, {
|
|
108
114
|
bankEntryWarningWrapperProps: this.props.bankEntryWarningWrapperProps,
|
|
109
115
|
connectDragSource: this.props.connectDragSource,
|
|
@@ -128,18 +134,18 @@ var Stimulus = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _the
|
|
|
128
134
|
}, {
|
|
129
135
|
key: "renderPanels",
|
|
130
136
|
value: function renderPanels(propsForDnDZone) {
|
|
131
|
-
var
|
|
137
|
+
var automationPrefix = this.isPassage() ? 'passage' : 'stimulus';
|
|
132
138
|
return (0, _emotion.jsx)("div", {
|
|
133
139
|
css: this.props.styles.stimulus,
|
|
134
140
|
ref: this.props.dndRef,
|
|
135
|
-
"data-automation": "sdk-
|
|
141
|
+
"data-automation": "sdk-".concat(automationPrefix)
|
|
136
142
|
}, (0, _emotion.jsx)("div", {
|
|
137
143
|
css: this.props.styles.leftPanel
|
|
138
144
|
}, this.renderStimulusPanel()), (0, _emotion.jsx)("div", {
|
|
139
145
|
css: this.props.styles.itemPanel
|
|
140
|
-
}, (0, _emotion.jsx)("div", null), this.renderChildQuizEntries(), !isPassage && (0, _emotion.jsx)(_index4.default, Object.assign({}, propsForDnDZone, {
|
|
146
|
+
}, (0, _emotion.jsx)("div", null), this.renderChildQuizEntries(), !this.isPassage() && (0, _emotion.jsx)(_index4.default, Object.assign({}, propsForDnDZone, {
|
|
141
147
|
location: "in"
|
|
142
|
-
})), this.props.childEntries.size === 0 && !this.isQuizContentLocked() && !isPassage && (0, _emotion.jsx)(_index.default, {
|
|
148
|
+
})), this.props.childEntries.size === 0 && !this.isQuizContentLocked() && !this.isPassage() && (0, _emotion.jsx)(_index.default, {
|
|
143
149
|
allowStimulusCreation: false,
|
|
144
150
|
stimulusId: this.props.stimulus.id,
|
|
145
151
|
parentEntryId: this.props.quizEntry.id,
|
|
@@ -65,6 +65,7 @@ var StimulusEdit = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
65
65
|
_this.props.setUi(_quizCommon.SHOULD_CLONE_ITEM, false);
|
|
66
66
|
};
|
|
67
67
|
_this.handleDeleteTemporary = function () {
|
|
68
|
+
var isPassage = _this.isPassage();
|
|
68
69
|
_this.props.withConfirm(function () {
|
|
69
70
|
_this.onCancel();
|
|
70
71
|
_this.props.setUi(_quizCommon.DELETED_QUIZ_ENTRY, {
|
|
@@ -72,10 +73,11 @@ var StimulusEdit = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
72
73
|
inStimulus: false
|
|
73
74
|
});
|
|
74
75
|
}, {
|
|
75
|
-
title: (0, _formatMessage.default)('Confirm Stimulus Removal'),
|
|
76
|
-
text: (0, _formatMessage.default)('Are you sure you want to remove this stimulus?'),
|
|
77
|
-
continueText: (0, _formatMessage.default)('Remove Stimulus'),
|
|
78
|
-
cancelText: (0, _formatMessage.default)('Keep Stimulus')
|
|
76
|
+
title: isPassage ? (0, _formatMessage.default)('Confirm Passage Removal') : (0, _formatMessage.default)('Confirm Stimulus Removal'),
|
|
77
|
+
text: isPassage ? (0, _formatMessage.default)('Are you sure you want to remove this passage?') : (0, _formatMessage.default)('Are you sure you want to remove this stimulus?'),
|
|
78
|
+
continueText: isPassage ? (0, _formatMessage.default)('Remove Passage') : (0, _formatMessage.default)('Remove Stimulus'),
|
|
79
|
+
cancelText: isPassage ? (0, _formatMessage.default)('Keep Passage ') : (0, _formatMessage.default)('Keep Stimulus'),
|
|
80
|
+
automationPrefix: isPassage ? 'passage' : 'stimulus'
|
|
79
81
|
});
|
|
80
82
|
};
|
|
81
83
|
_this.handleDeleteStimulus = function () {
|
|
@@ -300,6 +302,12 @@ var StimulusEdit = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
300
302
|
outsideApp = _checkClickedNode.outsideApp;
|
|
301
303
|
return outsideApp || !isEndEditingTrigger;
|
|
302
304
|
}
|
|
305
|
+
}, {
|
|
306
|
+
key: "isPassage",
|
|
307
|
+
value: function isPassage() {
|
|
308
|
+
var _this$props$stimulus;
|
|
309
|
+
return (_this$props$stimulus = this.props.stimulus) === null || _this$props$stimulus === void 0 ? void 0 : _this$props$stimulus.passage;
|
|
310
|
+
}
|
|
303
311
|
}, {
|
|
304
312
|
key: "afterSubmit",
|
|
305
313
|
value: function afterSubmit() {
|
|
@@ -327,8 +335,7 @@ var StimulusEdit = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
327
335
|
}, {
|
|
328
336
|
key: "renderAddToBankOptions",
|
|
329
337
|
value: function renderAddToBankOptions() {
|
|
330
|
-
var
|
|
331
|
-
var paddingTopStyle = ((_this$props$stimulus = this.props.stimulus) === null || _this$props$stimulus === void 0 ? void 0 : _this$props$stimulus.passage) ? {
|
|
338
|
+
var paddingTopStyle = this.isPassage() ? {
|
|
332
339
|
padding: 'small 0 0'
|
|
333
340
|
} : {};
|
|
334
341
|
return (0, _emotion.jsx)(_uiView.View, Object.assign({
|
|
@@ -353,7 +360,8 @@ var StimulusEdit = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
353
360
|
}, {
|
|
354
361
|
key: "renderStimulusEdit",
|
|
355
362
|
value: function renderStimulusEdit() {
|
|
356
|
-
var stimulusLabel = this.
|
|
363
|
+
var stimulusLabel = this.isPassage() ? (0, _formatMessage.default)('Passage') : (0, _formatMessage.default)('Stimulus');
|
|
364
|
+
var automationPrefix = this.isPassage() ? 'passage' : 'stimulus';
|
|
357
365
|
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)("div", {
|
|
358
366
|
css: this.props.styles.stimulus,
|
|
359
367
|
ref: this.handleRef
|
|
@@ -387,7 +395,7 @@ var StimulusEdit = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
387
395
|
}, (0, _emotion.jsx)(_uiButtons.Button, {
|
|
388
396
|
type: "button",
|
|
389
397
|
onClick: this.onCancel,
|
|
390
|
-
"data-automation": "sdk-
|
|
398
|
+
"data-automation": "sdk-".concat(automationPrefix, "-discardButton")
|
|
391
399
|
}, (0, _formatMessage.default)('Cancel'))), (0, _emotion.jsx)("div", {
|
|
392
400
|
className: "submitButtonWrapper",
|
|
393
401
|
css: this.props.styles.buttonWrapper
|
|
@@ -396,7 +404,7 @@ var StimulusEdit = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
396
404
|
color: "primary",
|
|
397
405
|
disabled: !this.state.canSubmit,
|
|
398
406
|
onClick: this.onSubmit,
|
|
399
|
-
"data-automation": "sdk-
|
|
407
|
+
"data-automation": "sdk-".concat(automationPrefix, "-done-button")
|
|
400
408
|
}, (0, _formatMessage.default)('Done')))));
|
|
401
409
|
}
|
|
402
410
|
}, {
|
|
@@ -146,6 +146,7 @@ var StimulusEditInfo = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defau
|
|
|
146
146
|
var stimulus = this.props.workingStimulus;
|
|
147
147
|
var textAreaId = "stimulusBodyEdit_".concat(stimulus.id, "_").concat(this.props.isBankedContent);
|
|
148
148
|
var stimulusBodyId = "stimulusBodyEdit_".concat(stimulus.id, "_body");
|
|
149
|
+
var automationPrefix = stimulus.passage ? 'passage' : 'stimulus';
|
|
149
150
|
return (0, _emotion.jsx)(_quizCommon.FormFieldGroup, {
|
|
150
151
|
messages: this.inputErrors('onSelf'),
|
|
151
152
|
description: (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Edit Stimulus'))
|
|
@@ -161,7 +162,7 @@ var StimulusEditInfo = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defau
|
|
|
161
162
|
ref: this.props.setTitleRef,
|
|
162
163
|
onChange: this.onTextInputChange('title'),
|
|
163
164
|
value: stimulus.get('title'),
|
|
164
|
-
"data-automation": "sdk-
|
|
165
|
+
"data-automation": "sdk-".concat(automationPrefix, "-title-input")
|
|
165
166
|
})), this.renderInstructions(stimulus), (0, _emotion.jsx)("div", {
|
|
166
167
|
css: this.props.styles.section
|
|
167
168
|
}, (0, _emotion.jsx)(_quizCommon.FormField, {
|
|
@@ -27,7 +27,9 @@ var StimulusShowInfo = /*#__PURE__*/function (_Component) {
|
|
|
27
27
|
(0, _createClass2.default)(StimulusShowInfo, [{
|
|
28
28
|
key: "render",
|
|
29
29
|
value: function render() {
|
|
30
|
-
var
|
|
30
|
+
var stimulus = this.props.stimulus;
|
|
31
|
+
var automationPrefix = stimulus.passage ? 'passage' : 'stimulus';
|
|
32
|
+
var instructions = stimulus.instructions && /*#__PURE__*/_react.default.createElement(_uiView.View, {
|
|
31
33
|
as: "div",
|
|
32
34
|
padding: "small",
|
|
33
35
|
margin: "x-small 0 0 0",
|
|
@@ -46,10 +48,10 @@ var StimulusShowInfo = /*#__PURE__*/function (_Component) {
|
|
|
46
48
|
color: "primary",
|
|
47
49
|
size: "small",
|
|
48
50
|
weight: "bold"
|
|
49
|
-
},
|
|
51
|
+
}, stimulus.instructions))));
|
|
50
52
|
return /*#__PURE__*/_react.default.createElement(_uiView.View, {
|
|
51
53
|
as: "div"
|
|
52
|
-
},
|
|
54
|
+
}, stimulus.title && /*#__PURE__*/_react.default.createElement(_uiHeading.Heading, {
|
|
53
55
|
level: "h3",
|
|
54
56
|
as: "h2",
|
|
55
57
|
color: "primary",
|
|
@@ -57,8 +59,8 @@ var StimulusShowInfo = /*#__PURE__*/function (_Component) {
|
|
|
57
59
|
themeOverride: {
|
|
58
60
|
h2FontWeight: '700'
|
|
59
61
|
}
|
|
60
|
-
},
|
|
61
|
-
"data-automation": "sdk-
|
|
62
|
+
}, stimulus.title), instructions, /*#__PURE__*/_react.default.createElement("div", {
|
|
63
|
+
"data-automation": "sdk-".concat(automationPrefix, "-LeftPanelShow-content")
|
|
62
64
|
}, /*#__PURE__*/_react.default.createElement(_quizRce.RichContentRenderer, {
|
|
63
65
|
content: this.props.stimulus.body
|
|
64
66
|
})));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "20.36.1-rc.
|
|
3
|
+
"version": "20.36.1-rc.41+d0be154bb",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"@instructure/emotion": "^9.11.1",
|
|
47
47
|
"@instructure/grading-utils": "^1.0.0",
|
|
48
48
|
"@instructure/outcomes-ui": "^3.2.2",
|
|
49
|
-
"@instructure/quiz-common": "^20.36.1-rc.
|
|
50
|
-
"@instructure/quiz-i18n": "^20.36.1-rc.
|
|
51
|
-
"@instructure/quiz-interactions": "^20.36.1-rc.
|
|
52
|
-
"@instructure/quiz-number-input": "^20.36.1-rc.
|
|
53
|
-
"@instructure/quiz-rce": "^20.36.1-rc.
|
|
49
|
+
"@instructure/quiz-common": "^20.36.1-rc.41+d0be154bb",
|
|
50
|
+
"@instructure/quiz-i18n": "^20.36.1-rc.41+d0be154bb",
|
|
51
|
+
"@instructure/quiz-interactions": "^20.36.1-rc.41+d0be154bb",
|
|
52
|
+
"@instructure/quiz-number-input": "^20.36.1-rc.41+d0be154bb",
|
|
53
|
+
"@instructure/quiz-rce": "^20.36.1-rc.41+d0be154bb",
|
|
54
54
|
"@instructure/ui-a11y-content": "^9.11.1",
|
|
55
55
|
"@instructure/ui-alerts": "^9.11.1",
|
|
56
56
|
"@instructure/ui-avatar": "^9.11.1",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"file-saver": "~2.0.5",
|
|
110
110
|
"humps": "^2.0.0",
|
|
111
111
|
"immutable": "^3.8.1",
|
|
112
|
-
"instructure-validations": "^20.36.1-rc.
|
|
112
|
+
"instructure-validations": "^20.36.1-rc.41+d0be154bb",
|
|
113
113
|
"ipaddr.js": "^1.5.4",
|
|
114
114
|
"isomorphic-fetch": "^2.2.0",
|
|
115
115
|
"isuuid": "^0.1.0",
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"jquery": "^2.2.3",
|
|
160
160
|
"karma-junit-reporter": "^2.0.1",
|
|
161
161
|
"most-subject": "^5.3.0",
|
|
162
|
-
"quiz-presets": "^20.36.1-rc.
|
|
162
|
+
"quiz-presets": "^20.36.1-rc.41+d0be154bb",
|
|
163
163
|
"react": "^16.8.6",
|
|
164
164
|
"react-addons-test-utils": "^15.6.2",
|
|
165
165
|
"react-dom": "^16.8.6",
|
|
@@ -175,5 +175,5 @@
|
|
|
175
175
|
"publishConfig": {
|
|
176
176
|
"access": "public"
|
|
177
177
|
},
|
|
178
|
-
"gitHead": "
|
|
178
|
+
"gitHead": "d0be154bb09a4e8553baab4d9fe0e6e86cbb1985"
|
|
179
179
|
}
|