@instructure/quiz-core 20.38.0 → 21.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +0 -4
- package/es/common/components/ConfirmationModal/presenter.js +10 -7
- 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/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/PrintTrigger/presenter.js +0 -5
- package/es/reporting/components/resources/OutcomeAnalysis/presenter.js +1 -11
- 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 +0 -4
- package/lib/common/components/ConfirmationModal/presenter.js +10 -7
- 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/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/PrintTrigger/presenter.js +0 -5
- package/lib/reporting/components/resources/OutcomeAnalysis/presenter.js +1 -11
- package/package.json +57 -58
- 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
|
@@ -446,7 +446,7 @@ export var BanksList = (_dec = withStyleOverrides(generateStyle, generateCompone
|
|
|
446
446
|
}, jsx(Table.Row, null, this.renderTableSortHeader('name', t('Name')), this.renderTableSortHeader('updated_at', t('Updated')), jsx(Table.ColHeader, {
|
|
447
447
|
id: "header-num-questions",
|
|
448
448
|
width: "1"
|
|
449
|
-
}, t('Questions')), this.renderTableSortHeader('last_used', t('Last Used')), this.renderTableSortHeader('created_at', t('Created')),
|
|
449
|
+
}, t('Questions')), this.renderTableSortHeader('last_used', t('Last Used')), this.renderTableSortHeader('created_at', t('Created')), jsx(Table.ColHeader, {
|
|
450
450
|
id: "header-option-links",
|
|
451
451
|
width: "1"
|
|
452
452
|
}, jsx(ScreenReaderContent, null, t('Bank option links'))))), jsx(Table.Body, null, (this.props.banks.toArray() || []).map(function (bank) {
|
|
@@ -2,9 +2,9 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
var
|
|
5
|
+
var _CreateBankModal;
|
|
6
6
|
/** @jsx jsx */
|
|
7
|
-
import { Component } from 'react';
|
|
7
|
+
import React, { Component } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import { Button, CloseButton } from '@instructure/ui-buttons';
|
|
10
10
|
import { Checkbox } from '@instructure/ui-checkbox';
|
|
@@ -14,19 +14,14 @@ import { jsx } from '@instructure/emotion';
|
|
|
14
14
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
15
15
|
import Bank from "../../../common/records/Bank.js";
|
|
16
16
|
import { toErrors } from "../../../common/util/instUIMessages.js";
|
|
17
|
-
import { Modal, ModalHeader, ModalBody, ModalFooter, TextInput, XSMALL_SIDE_MARGIN
|
|
18
|
-
|
|
19
|
-
import generateComponentTheme from "./theme.js";
|
|
20
|
-
export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_CreateBankModal = /*#__PURE__*/function (_Component) {
|
|
17
|
+
import { Modal, ModalHeader, ModalBody, ModalFooter, TextInput, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
|
|
18
|
+
export var CreateBankModal = /*#__PURE__*/function (_Component) {
|
|
21
19
|
_inherits(CreateBankModal, _Component);
|
|
22
20
|
var _super = _createSuper(CreateBankModal);
|
|
23
|
-
function CreateBankModal() {
|
|
21
|
+
function CreateBankModal(props) {
|
|
24
22
|
var _this;
|
|
25
23
|
_classCallCheck(this, CreateBankModal);
|
|
26
|
-
|
|
27
|
-
args[_key] = arguments[_key];
|
|
28
|
-
}
|
|
29
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
24
|
+
_this = _super.call(this, props);
|
|
30
25
|
_this.state = {
|
|
31
26
|
shareWithCourse: false
|
|
32
27
|
};
|
|
@@ -38,7 +33,8 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
|
|
|
38
33
|
_this.props.onCreateBank();
|
|
39
34
|
_this.closeAction();
|
|
40
35
|
} else {
|
|
41
|
-
_this
|
|
36
|
+
var _this$bankNameInput$c;
|
|
37
|
+
(_this$bankNameInput$c = _this.bankNameInput.current) === null || _this$bankNameInput$c === void 0 ? void 0 : _this$bankNameInput$c.focus();
|
|
42
38
|
}
|
|
43
39
|
};
|
|
44
40
|
_this.closeAction = function () {
|
|
@@ -68,6 +64,7 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
|
|
|
68
64
|
shareWithCourse: event.target.checked
|
|
69
65
|
});
|
|
70
66
|
};
|
|
67
|
+
_this.bankNameInput = /*#__PURE__*/React.createRef();
|
|
71
68
|
return _this;
|
|
72
69
|
}
|
|
73
70
|
_createClass(CreateBankModal, [{
|
|
@@ -92,17 +89,14 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
|
|
|
92
89
|
}, {
|
|
93
90
|
key: "renderContent",
|
|
94
91
|
value: function renderContent() {
|
|
95
|
-
return jsx("div", {
|
|
96
|
-
css: this.props.styles.bankNameInput
|
|
97
|
-
}, jsx(TextInput, {
|
|
92
|
+
return jsx("div", null, jsx(TextInput, {
|
|
98
93
|
messages: this.getErrors(),
|
|
99
94
|
onChange: this.onNameChange,
|
|
100
|
-
renderLabel:
|
|
101
|
-
|
|
102
|
-
}, t('Bank Name')),
|
|
95
|
+
renderLabel: t('Bank Name'),
|
|
96
|
+
isRequired: true,
|
|
103
97
|
type: "text",
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
"data-automation": "sdk-create-bank-name-textinput",
|
|
99
|
+
ref: this.bankNameInput
|
|
106
100
|
}), this.renderCheckbox());
|
|
107
101
|
}
|
|
108
102
|
}, {
|
|
@@ -134,7 +128,6 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
|
|
|
134
128
|
label: t('Item Bank'),
|
|
135
129
|
"data-automation": "sdk-create-bank-modal"
|
|
136
130
|
}, jsx(ModalHeader, null, jsx(Heading, {
|
|
137
|
-
level: "reset",
|
|
138
131
|
as: "h2"
|
|
139
132
|
}, t('New Item Bank')), jsx(CloseButton, {
|
|
140
133
|
onClick: this.closeAction,
|
|
@@ -146,7 +139,11 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
|
|
|
146
139
|
}]);
|
|
147
140
|
CreateBankModal.displayName = "CreateBankModal";
|
|
148
141
|
return CreateBankModal;
|
|
149
|
-
}(Component)
|
|
142
|
+
}(Component);
|
|
143
|
+
_CreateBankModal = CreateBankModal;
|
|
144
|
+
CreateBankModal.displayName = 'CreateBankModal';
|
|
145
|
+
CreateBankModal.componentId = "Quizzes".concat(_CreateBankModal.displayName);
|
|
146
|
+
CreateBankModal.propTypes = {
|
|
150
147
|
modalOpen: PropTypes.bool.isRequired,
|
|
151
148
|
modalTrigger: PropTypes.instanceOf(Component),
|
|
152
149
|
temporaryBank: PropTypes.instanceOf(Bank).isRequired,
|
|
@@ -169,11 +166,12 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
|
|
|
169
166
|
root_account_name: PropTypes.string
|
|
170
167
|
}),
|
|
171
168
|
styles: PropTypes.object
|
|
172
|
-
}
|
|
169
|
+
};
|
|
170
|
+
CreateBankModal.defaultProps = {
|
|
173
171
|
displayError: false,
|
|
174
172
|
modalTrigger: null,
|
|
175
173
|
showShareBankOnCreate: false,
|
|
176
174
|
itemBanksScope: {},
|
|
177
175
|
onCreateBank: function onCreateBank() {}
|
|
178
|
-
}
|
|
176
|
+
};
|
|
179
177
|
export default CreateBankModal;
|
|
@@ -2,34 +2,32 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
var
|
|
5
|
+
var _EditBankModal;
|
|
6
6
|
/** @jsx jsx */
|
|
7
|
-
import { Component } from 'react';
|
|
7
|
+
import React, { Component } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import { Button, CloseButton } from '@instructure/ui-buttons';
|
|
10
10
|
import { Heading } from '@instructure/ui-heading';
|
|
11
11
|
import { jsx } from '@instructure/emotion';
|
|
12
12
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
13
13
|
import { toErrors } from "../../../common/util/instUIMessages.js";
|
|
14
|
-
import { Modal, ModalHeader, ModalBody, ModalFooter, TextInput, XSMALL_SIDE_MARGIN
|
|
14
|
+
import { Modal, ModalHeader, ModalBody, ModalFooter, TextInput, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
|
|
15
15
|
import Bank from "../../../common/records/Bank.js";
|
|
16
|
-
|
|
17
|
-
import generateComponentTheme from "./theme.js";
|
|
18
|
-
export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_EditBankModal = /*#__PURE__*/function (_Component) {
|
|
16
|
+
export var EditBankModal = /*#__PURE__*/function (_Component) {
|
|
19
17
|
_inherits(EditBankModal, _Component);
|
|
20
18
|
var _super = _createSuper(EditBankModal);
|
|
21
|
-
function EditBankModal() {
|
|
19
|
+
function EditBankModal(props) {
|
|
22
20
|
var _this;
|
|
23
21
|
_classCallCheck(this, EditBankModal);
|
|
24
|
-
|
|
25
|
-
args[_key] = arguments[_key];
|
|
26
|
-
}
|
|
27
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
22
|
+
_this = _super.call(this, props);
|
|
28
23
|
_this.continueAction = function () {
|
|
29
24
|
_this.props.showError(_this.props.errorKey);
|
|
30
25
|
if (_this.props.workingBank.isValid()) {
|
|
31
26
|
_this.props.updateBank(_this.props.workingBank);
|
|
32
27
|
_this.closeAction();
|
|
28
|
+
} else {
|
|
29
|
+
var _this$bankNameInput$c;
|
|
30
|
+
(_this$bankNameInput$c = _this.bankNameInput.current) === null || _this$bankNameInput$c === void 0 ? void 0 : _this$bankNameInput$c.focus();
|
|
33
31
|
}
|
|
34
32
|
};
|
|
35
33
|
_this.closeAction = function () {
|
|
@@ -51,6 +49,7 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
|
|
|
51
49
|
return toErrors(_this.props.workingBank.errorsFor('title').toJS());
|
|
52
50
|
}
|
|
53
51
|
};
|
|
52
|
+
_this.bankNameInput = /*#__PURE__*/React.createRef();
|
|
54
53
|
return _this;
|
|
55
54
|
}
|
|
56
55
|
_createClass(EditBankModal, [{
|
|
@@ -75,17 +74,16 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
|
|
|
75
74
|
}, {
|
|
76
75
|
key: "renderContent",
|
|
77
76
|
value: function renderContent() {
|
|
78
|
-
return jsx(
|
|
79
|
-
css: this.props.styles.bankNameInput
|
|
80
|
-
}, jsx(TextInput, {
|
|
77
|
+
return jsx(TextInput, {
|
|
81
78
|
value: this.props.workingBank.title,
|
|
82
79
|
messages: this.getErrors(),
|
|
83
80
|
onChange: this.onNameChange,
|
|
84
|
-
renderLabel:
|
|
81
|
+
renderLabel: t('Bank Name'),
|
|
85
82
|
type: "text",
|
|
86
|
-
|
|
87
|
-
"data-automation": "sdk-edit-bank-name-textinput"
|
|
88
|
-
|
|
83
|
+
isRequired: true,
|
|
84
|
+
"data-automation": "sdk-edit-bank-name-textinput",
|
|
85
|
+
ref: this.bankNameInput
|
|
86
|
+
});
|
|
89
87
|
}
|
|
90
88
|
}, {
|
|
91
89
|
key: "render",
|
|
@@ -97,7 +95,6 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
|
|
|
97
95
|
label: t('Item Bank'),
|
|
98
96
|
"data-automation": "sdk-edit-bank-modal"
|
|
99
97
|
}, jsx(ModalHeader, null, jsx(Heading, {
|
|
100
|
-
level: "reset",
|
|
101
98
|
as: "h2"
|
|
102
99
|
}, t('Edit Item Bank')), jsx(CloseButton, {
|
|
103
100
|
onClick: this.closeAction,
|
|
@@ -109,7 +106,11 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
|
|
|
109
106
|
}]);
|
|
110
107
|
EditBankModal.displayName = "EditBankModal";
|
|
111
108
|
return EditBankModal;
|
|
112
|
-
}(Component)
|
|
109
|
+
}(Component);
|
|
110
|
+
_EditBankModal = EditBankModal;
|
|
111
|
+
EditBankModal.displayName = 'EditBankModal';
|
|
112
|
+
EditBankModal.componentId = "Quizzes".concat(_EditBankModal.displayName);
|
|
113
|
+
EditBankModal.propTypes = {
|
|
113
114
|
modalOpen: PropTypes.bool.isRequired,
|
|
114
115
|
modalTrigger: PropTypes.instanceOf(Component),
|
|
115
116
|
workingBank: PropTypes.instanceOf(Bank).isRequired,
|
|
@@ -122,8 +123,9 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
|
|
|
122
123
|
hideError: PropTypes.func.isRequired,
|
|
123
124
|
closeModal: PropTypes.func.isRequired,
|
|
124
125
|
styles: PropTypes.object
|
|
125
|
-
}
|
|
126
|
+
};
|
|
127
|
+
EditBankModal.defaultProps = {
|
|
126
128
|
displayError: false,
|
|
127
129
|
modalTrigger: null
|
|
128
|
-
}
|
|
130
|
+
};
|
|
129
131
|
export default EditBankModal;
|
|
@@ -22,7 +22,6 @@ import { Grid } from '@instructure/ui-grid';
|
|
|
22
22
|
import { Tabs } from '@instructure/ui-tabs';
|
|
23
23
|
import { Text } from '@instructure/ui-text';
|
|
24
24
|
import { jsx } from '@instructure/emotion';
|
|
25
|
-
import elementsForSelectors from "../../../common/util/ElementsForSelectors.js";
|
|
26
25
|
import CustomPropTypes from "../../../common/util/CustomPropTypes.js";
|
|
27
26
|
import ShareList from "./ShareList/index.js";
|
|
28
27
|
import AsyncSearch from "../AsyncSearch/index.js";
|
|
@@ -54,9 +53,6 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
|
|
|
54
53
|
};
|
|
55
54
|
_this.shareListRef = null;
|
|
56
55
|
_this.shareButtonRef = null;
|
|
57
|
-
_this.applicationElement = function () {
|
|
58
|
-
return elementsForSelectors(_this.props.appContainer);
|
|
59
|
-
};
|
|
60
56
|
// =============
|
|
61
57
|
// LIFECYCLE
|
|
62
58
|
// =============
|
|
@@ -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;
|
|
@@ -2,17 +2,14 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
var
|
|
5
|
+
var _SecondaryNavBarButton;
|
|
6
6
|
/** @jsx jsx */
|
|
7
7
|
import { Component } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import { TopNavBar } from '@instructure/ui-top-nav-bar';
|
|
10
|
-
import {
|
|
10
|
+
import { jsx } from '@instructure/emotion';
|
|
11
11
|
import { omitProps } from '@instructure/ui-react-utils';
|
|
12
|
-
|
|
13
|
-
import generateComponentTheme from "./theme.js";
|
|
14
|
-
import { withStyleOverrides } from '@instructure/quiz-common';
|
|
15
|
-
export var SecondaryNavBarButton = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_SecondaryNavBarButton = /*#__PURE__*/function (_Component) {
|
|
12
|
+
export var SecondaryNavBarButton = /*#__PURE__*/function (_Component) {
|
|
16
13
|
_inherits(SecondaryNavBarButton, _Component);
|
|
17
14
|
var _super = _createSuper(SecondaryNavBarButton);
|
|
18
15
|
function SecondaryNavBarButton() {
|
|
@@ -20,37 +17,21 @@ export var SecondaryNavBarButton = (_dec = withStyleOverrides(generateStyle, gen
|
|
|
20
17
|
return _super.apply(this, arguments);
|
|
21
18
|
}
|
|
22
19
|
_createClass(SecondaryNavBarButton, [{
|
|
23
|
-
key: "componentDidMount",
|
|
24
|
-
value: function componentDidMount() {
|
|
25
|
-
this.props.makeStyles();
|
|
26
|
-
}
|
|
27
|
-
}, {
|
|
28
|
-
key: "componentDidUpdate",
|
|
29
|
-
value: function componentDidUpdate() {
|
|
30
|
-
this.props.makeStyles();
|
|
31
|
-
}
|
|
32
|
-
}, {
|
|
33
20
|
key: "render",
|
|
34
21
|
value: function render() {
|
|
35
|
-
return jsx(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
BaseButton: {
|
|
39
|
-
primaryColor: this.props.styles.textColor,
|
|
40
|
-
primaryBackground: this.props.styles.backgroundColor,
|
|
41
|
-
primaryHoverBackground: this.props.styles.backgroundHoverColor,
|
|
42
|
-
primaryBorderColor: this.props.styles.borderColor
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}, jsx(TopNavBar.Item, omitProps(this.props, this.constructor.propTypes), this.props.children));
|
|
22
|
+
return jsx(TopNavBar.Item, Object.assign({
|
|
23
|
+
color: "secondary"
|
|
24
|
+
}, omitProps(this.props, this.constructor.propTypes)), this.props.children);
|
|
47
25
|
}
|
|
48
26
|
}]);
|
|
49
27
|
SecondaryNavBarButton.displayName = "SecondaryNavBarButton";
|
|
50
28
|
return SecondaryNavBarButton;
|
|
51
|
-
}(Component)
|
|
29
|
+
}(Component);
|
|
30
|
+
_SecondaryNavBarButton = SecondaryNavBarButton;
|
|
31
|
+
SecondaryNavBarButton.displayName = 'TopNavBarItem';
|
|
32
|
+
SecondaryNavBarButton.componentId = "Quizzes".concat(_SecondaryNavBarButton.displayName);
|
|
33
|
+
SecondaryNavBarButton.propTypes = {
|
|
52
34
|
children: PropTypes.string.isRequired,
|
|
53
|
-
styles: PropTypes.object
|
|
54
|
-
|
|
55
|
-
}, _SecondaryNavBarButton)) || _class);
|
|
35
|
+
styles: PropTypes.object
|
|
36
|
+
};
|
|
56
37
|
export default SecondaryNavBarButton;
|
|
@@ -93,9 +93,6 @@ export var NavBar = (_dec = withStyleOverrides(generateStyle, generateComponentT
|
|
|
93
93
|
desktopBottomBorderInverse: false
|
|
94
94
|
} : {}),
|
|
95
95
|
navLabel: t('Quizzes navigation bar'),
|
|
96
|
-
desktopConfig: {
|
|
97
|
-
hideActionsUserSeparator: true
|
|
98
|
-
},
|
|
99
96
|
smallViewportConfig: {
|
|
100
97
|
dropdownMenuToggleButtonLabel: t('Toggle Menu'),
|
|
101
98
|
dropdownMenuLabel: t('Main Menu')
|
|
@@ -13,7 +13,6 @@ import componentForItem from "../../../../util/componentForItem.js";
|
|
|
13
13
|
import { liveRegion, COMPONENT_EDIT, FormFieldGroup } from '@instructure/quiz-common';
|
|
14
14
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
15
15
|
import { propsForInteractionEdit } from "../../../../util/interactionTypePropsHelper.js";
|
|
16
|
-
import elementsForSelectors from "../../../../../common/util/ElementsForSelectors.js";
|
|
17
16
|
import { toErrors } from "../../../../util/instUIMessages.js";
|
|
18
17
|
export var ItemEdit = /*#__PURE__*/function (_Component) {
|
|
19
18
|
_inherits(ItemEdit, _Component);
|
|
@@ -32,9 +31,6 @@ export var ItemEdit = /*#__PURE__*/function (_Component) {
|
|
|
32
31
|
}
|
|
33
32
|
return null;
|
|
34
33
|
};
|
|
35
|
-
_this.applicationElement = function () {
|
|
36
|
-
return elementsForSelectors(_this.props.appContainer);
|
|
37
|
-
};
|
|
38
34
|
_this.onModalOpen = function () {
|
|
39
35
|
_this.props.occludeQuizEntries(true);
|
|
40
36
|
};
|
|
@@ -97,7 +93,6 @@ export var ItemEdit = /*#__PURE__*/function (_Component) {
|
|
|
97
93
|
component: /*#__PURE__*/React.createElement(OutcomeAlignments, Object.assign({
|
|
98
94
|
artifactType: "quizEntry",
|
|
99
95
|
artifactId: itemId,
|
|
100
|
-
applicationElement: this.applicationElement,
|
|
101
96
|
alignmentSetId: outcomeAlignmentSetGuid,
|
|
102
97
|
contextUuid: this.props.contextUuid
|
|
103
98
|
}, launchContexts.length > 0 && {
|
|
@@ -9,7 +9,6 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
import { Popover } from '@instructure/ui-popover';
|
|
10
10
|
import { jsx } from '@instructure/emotion';
|
|
11
11
|
import CustomPropTypes from "../../../../../util/CustomPropTypes.js";
|
|
12
|
-
import elementsForSelectors from "../../../../../util/ElementsForSelectors.js";
|
|
13
12
|
import { onPhone, onTablet } from "../../../../../util/windowChecks.js";
|
|
14
13
|
import AddContentButton from "../Button/index.js";
|
|
15
14
|
import AddContentBody from "../Body/index.js";
|
|
@@ -26,9 +25,6 @@ export var AddContentPopover = (_dec = withStyleOverrides(generateStyle, generat
|
|
|
26
25
|
args[_key] = arguments[_key];
|
|
27
26
|
}
|
|
28
27
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
29
|
-
_this.applicationElement = function () {
|
|
30
|
-
return elementsForSelectors(_this.props.appContainer);
|
|
31
|
-
};
|
|
32
28
|
_this.showContent = function () {
|
|
33
29
|
_this.props.switchOnEditing();
|
|
34
30
|
};
|
|
@@ -108,7 +108,7 @@ export var SessionItemResult = (_dec = withStyleOverrides(generateStyle, generat
|
|
|
108
108
|
size: "small",
|
|
109
109
|
margin: "small"
|
|
110
110
|
}, jsx(Text, {
|
|
111
|
-
color: "
|
|
111
|
+
color: "alert"
|
|
112
112
|
}, t("Regrade score { possible, plural,\n one {{points, number} / # point}\n other {{points, number} / # points}\n }", {
|
|
113
113
|
points: this.props.sessionItemResult.regradeInfo.get('newScore') || 0,
|
|
114
114
|
possible: this.props.sessionItemResult.regradeInfo.get('newPointsPossible')
|
|
@@ -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
|
})));
|
|
@@ -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",
|