@instructure/quiz-core 20.10.1-rc.6 → 20.10.1-rc.8
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/Banks/index.js +3 -1
- package/es/banks/components/Banks/presenter.js +30 -8
- package/es/building/components/layout/header/BuildingButtons/presenter.js +253 -61
- package/es/building/components/layout/header/BuildingButtons/styles.js +8 -4
- package/es/index.js +0 -1
- package/lib/banks/components/Banks/index.js +3 -1
- package/lib/banks/components/Banks/presenter.js +30 -8
- package/lib/building/components/layout/header/BuildingButtons/presenter.js +255 -61
- package/lib/building/components/layout/header/BuildingButtons/styles.js +10 -4
- package/lib/index.js +62 -73
- package/package.json +9 -9
- package/es/building/components/layout/header/BuildingButtonsICE/index.js +0 -40
- package/es/building/components/layout/header/BuildingButtonsICE/presenter.js +0 -249
- package/lib/building/components/layout/header/BuildingButtonsICE/index.js +0 -65
- package/lib/building/components/layout/header/BuildingButtonsICE/presenter.js +0 -274
|
@@ -16,6 +16,7 @@ function mapStateToProps(state, props) {
|
|
|
16
16
|
var sortOrder = pageData.get('sortOrder', 'ascending');
|
|
17
17
|
var searchTerms = pageData.get('searchTerms', null);
|
|
18
18
|
var searchSelection = pageData.get('searchSelection', []);
|
|
19
|
+
var rootAccountUuid = state.getIn(['outcomes', 'contextUuid']);
|
|
19
20
|
return {
|
|
20
21
|
itemBankSearchTableEnabled: featureOn('item_bank_search_table'),
|
|
21
22
|
improvedBankSharingEnabled: featureOn('improved_bank_sharing'),
|
|
@@ -26,7 +27,8 @@ function mapStateToProps(state, props) {
|
|
|
26
27
|
sortBy: sortBy,
|
|
27
28
|
sortOrder: sortOrder,
|
|
28
29
|
searchTerms: searchTerms,
|
|
29
|
-
searchSelection: searchSelection
|
|
30
|
+
searchSelection: searchSelection,
|
|
31
|
+
rootAccountUuid: rootAccountUuid
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
34
|
|
|
@@ -55,6 +55,10 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
55
55
|
|
|
56
56
|
_this = _super.apply(this, arguments);
|
|
57
57
|
|
|
58
|
+
_this.hideAccountSearch = function () {
|
|
59
|
+
return _this.props.scopeType === 'account' && _this.props.scope.type === 'account' && _this.props.scope.launch_context_uuid && _this.props.rootAccountUuid && _this.props.scope.launch_context_uuid !== _this.props.rootAccountUuid;
|
|
60
|
+
};
|
|
61
|
+
|
|
58
62
|
_this.onCreateBank = function () {
|
|
59
63
|
_this.props.createBank({
|
|
60
64
|
language: _this.context.locale
|
|
@@ -94,7 +98,9 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
94
98
|
params['search'] = _this.props.searchTerms;
|
|
95
99
|
}
|
|
96
100
|
|
|
97
|
-
if (_this.props.
|
|
101
|
+
if (_this.props.subAccountBankSharingEnabled && _this.hideAccountSearch()) {
|
|
102
|
+
params['account_uuids'] = [_this.props.scope.launch_context_uuid];
|
|
103
|
+
} else if (_this.props.searchSelection.length > 0) {
|
|
98
104
|
params['account_uuids'] = _this.props.searchSelection.map(function (account) {
|
|
99
105
|
return account.uuid;
|
|
100
106
|
});
|
|
@@ -125,6 +131,12 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
125
131
|
_this.props.merge(BANKS_BANK_FILTERS, {
|
|
126
132
|
scopeType: scopeType
|
|
127
133
|
});
|
|
134
|
+
|
|
135
|
+
if (scopeType === 'account') {
|
|
136
|
+
_this.setState({
|
|
137
|
+
hiddenAccountSearch: true
|
|
138
|
+
});
|
|
139
|
+
}
|
|
128
140
|
};
|
|
129
141
|
|
|
130
142
|
_this.getSortingOrderIcon = function () {
|
|
@@ -211,7 +223,11 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
211
223
|
if (_this.props.scopeType === 'course') {
|
|
212
224
|
message = t("Your filter is set to \"Courses\" which will narrow what you can search for.\n Try adjusting the filter to \"Institution\" or \"All My Banks\"");
|
|
213
225
|
} else if (_this.props.scopeType === 'account') {
|
|
214
|
-
|
|
226
|
+
if (_this.props.subAccountBankSharingEnabled && _this.hideAccountSearch()) {
|
|
227
|
+
message = t("Your filter is set to \"This Account\" which will narrow what you can search for.\n Try adjusting the filter to \"All My Banks\"");
|
|
228
|
+
} else {
|
|
229
|
+
message = t("Your filter is set to \"Institution\" which will narrow what you can search for.\n Try adjusting the filter to \"All My Banks\"");
|
|
230
|
+
}
|
|
215
231
|
}
|
|
216
232
|
|
|
217
233
|
return jsx(Billboard, {
|
|
@@ -242,7 +258,9 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
242
258
|
if (prevProps.sortBy !== this.props.sortBy || prevProps.sortOrder !== this.props.sortOrder || prevProps.searchTerms !== this.props.searchTerms || prevProps.scopeType !== this.props.scopeType || !isEqual(prevProps.searchSelection, this.props.searchSelection)) {
|
|
243
259
|
this.props.clear(BANKS_BANK_PAGINATION);
|
|
244
260
|
}
|
|
245
|
-
}
|
|
261
|
+
} // When the launch is from a subaccount, we want to silently add the subaccount to the account search
|
|
262
|
+
// if the user is on the "This Account" filter
|
|
263
|
+
|
|
246
264
|
}, {
|
|
247
265
|
key: "renderFilters",
|
|
248
266
|
value: function renderFilters() {
|
|
@@ -251,7 +269,7 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
251
269
|
translation: this.props.newItemBankFilterNamesEnabled ? t('All Banks') : t('All My Banks')
|
|
252
270
|
}, {
|
|
253
271
|
slug: 'account',
|
|
254
|
-
translation: t('Institution Banks')
|
|
272
|
+
translation: this.props.subAccountBankSharingEnabled && this.hideAccountSearch() ? t('This Account') : t('Institution Banks')
|
|
255
273
|
}, {
|
|
256
274
|
slug: 'courses',
|
|
257
275
|
translation: this.props.newItemBankFilterNamesEnabled ? t('Banks Shared to Course') : t('All My Course Banks')
|
|
@@ -314,7 +332,7 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
314
332
|
onChange: this.handleSearchInputChange,
|
|
315
333
|
placeholder: t('Search Banks'),
|
|
316
334
|
"data-automation": "sdk-search-bank-textinput"
|
|
317
|
-
})), this.props.subAccountBankSharingEnabled && jsx(Grid.Col, {
|
|
335
|
+
})), this.props.subAccountBankSharingEnabled && !this.hideAccountSearch() && jsx(Grid.Col, {
|
|
318
336
|
width: 4
|
|
319
337
|
}, jsx(AsyncSearch, {
|
|
320
338
|
getShareableSubaccounts: this.props.getShareableSubaccounts,
|
|
@@ -488,7 +506,9 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
488
506
|
scope: PropTypes.shape({
|
|
489
507
|
type: PropTypes.string,
|
|
490
508
|
uuid: PropTypes.string,
|
|
491
|
-
title: PropTypes.string
|
|
509
|
+
title: PropTypes.string,
|
|
510
|
+
launch_context_uuid: PropTypes.string,
|
|
511
|
+
root_account_name: PropTypes.string
|
|
492
512
|
}).isRequired,
|
|
493
513
|
scopeType: PropTypes.string,
|
|
494
514
|
searchTerms: PropTypes.string,
|
|
@@ -506,7 +526,8 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
506
526
|
subAccountBankSharingEnabled: PropTypes.bool,
|
|
507
527
|
iceTopNavBarEnabled: PropTypes.bool,
|
|
508
528
|
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
509
|
-
styles: PropTypes.object
|
|
529
|
+
styles: PropTypes.object,
|
|
530
|
+
rootAccountUuid: PropTypes.string
|
|
510
531
|
}, _class2.defaultProps = {
|
|
511
532
|
closeTray: null,
|
|
512
533
|
currentUser: null,
|
|
@@ -533,7 +554,8 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
533
554
|
usedByCourseEnabled: false,
|
|
534
555
|
itemBankSearchTableEnabled: false,
|
|
535
556
|
subAccountBankSharingEnabled: false,
|
|
536
|
-
iceTopNavBarEnabled: false
|
|
557
|
+
iceTopNavBarEnabled: false,
|
|
558
|
+
rootAccountUuid: null
|
|
537
559
|
}, _class2.contextTypes = {
|
|
538
560
|
locale: PropTypes.string
|
|
539
561
|
}, _temp)) || _class);
|
|
@@ -11,12 +11,18 @@ import PropTypes from 'prop-types';
|
|
|
11
11
|
import { IconButton } from '@instructure/ui-buttons';
|
|
12
12
|
import { Menu } from '@instructure/ui-menu';
|
|
13
13
|
import { IconExportLine, IconMoreSolid, IconImportLine, IconBankLine, IconPrinterLine, IconSpeedGraderLine } from '@instructure/ui-icons';
|
|
14
|
+
import { View } from '@instructure/ui-view';
|
|
15
|
+
import { Drilldown } from '@instructure/ui-drilldown';
|
|
16
|
+
import { TopNavBar } from '@instructure/ui-top-nav-bar';
|
|
14
17
|
import PrintTrigger from "../../../../../common/components/shared/PrintTrigger/index.js";
|
|
15
18
|
import { PRINT_CURRENT_PAGE, PRINT_BLANK } from '@instructure/quiz-common';
|
|
16
19
|
import { withStyle, jsx } from '@instructure/emotion';
|
|
17
20
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
18
21
|
import generateStyle from "./styles.js";
|
|
19
22
|
import generateComponentTheme from "./theme.js";
|
|
23
|
+
|
|
24
|
+
var _ref = jsx(IconSpeedGraderLine, null);
|
|
25
|
+
|
|
20
26
|
export var BuildingButtons = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
21
27
|
_inherits(BuildingButtons, _Component);
|
|
22
28
|
|
|
@@ -73,6 +79,16 @@ export var BuildingButtons = (_dec = withStyle(generateStyle, generateComponentT
|
|
|
73
79
|
}
|
|
74
80
|
|
|
75
81
|
_createClass(BuildingButtons, [{
|
|
82
|
+
key: "componentDidMount",
|
|
83
|
+
value: function componentDidMount() {
|
|
84
|
+
this.props.makeStyles();
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
key: "componentWillUnmount",
|
|
88
|
+
value: function componentWillUnmount() {
|
|
89
|
+
this.props.makeStyles();
|
|
90
|
+
}
|
|
91
|
+
}, {
|
|
76
92
|
key: "renderSavingMessage",
|
|
77
93
|
value: function renderSavingMessage() {
|
|
78
94
|
if (this.props.quizSaving) {
|
|
@@ -86,6 +102,214 @@ export var BuildingButtons = (_dec = withStyle(generateStyle, generateComponentT
|
|
|
86
102
|
value: function isBuildingPage() {
|
|
87
103
|
return 'building' === this.props.app;
|
|
88
104
|
}
|
|
105
|
+
}, {
|
|
106
|
+
key: "renderSpeedGraderButton",
|
|
107
|
+
value: function renderSpeedGraderButton() {
|
|
108
|
+
var key = 'speedgrader';
|
|
109
|
+
var text = t('Speedgrader');
|
|
110
|
+
|
|
111
|
+
if (this.props.iceTopNavBarEnabled) {
|
|
112
|
+
return jsx(Drilldown.Option, {
|
|
113
|
+
id: key,
|
|
114
|
+
key: key,
|
|
115
|
+
onOptionClick: this.openSpeedgraderLink
|
|
116
|
+
}, _ref, jsx(View, {
|
|
117
|
+
as: "span",
|
|
118
|
+
margin: "0 0 0 x-small"
|
|
119
|
+
}, text));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return jsx(Menu.Item, {
|
|
123
|
+
key: key,
|
|
124
|
+
onSelect: this.openSpeedgraderLink
|
|
125
|
+
}, jsx(IconSpeedGraderLine, {
|
|
126
|
+
css: this.props.styles.menuIcon
|
|
127
|
+
}), text);
|
|
128
|
+
}
|
|
129
|
+
}, {
|
|
130
|
+
key: "renderImportContentButton",
|
|
131
|
+
value: function renderImportContentButton() {
|
|
132
|
+
var key = 'import';
|
|
133
|
+
var text = t('Import Content');
|
|
134
|
+
var onClick = this.props.openModal;
|
|
135
|
+
var disabled = !this.props.canImport;
|
|
136
|
+
var menuItemDataAutomation = 'sdk-import-content-menuitem';
|
|
137
|
+
var iconDataAutomation = 'sdk-import-content-icon';
|
|
138
|
+
|
|
139
|
+
if (this.props.iceTopNavBarEnabled) {
|
|
140
|
+
return jsx(Drilldown.Option, {
|
|
141
|
+
id: key,
|
|
142
|
+
key: key,
|
|
143
|
+
disabled: disabled,
|
|
144
|
+
onOptionClick: onClick,
|
|
145
|
+
"data-automation": menuItemDataAutomation
|
|
146
|
+
}, jsx(IconImportLine, {
|
|
147
|
+
"data-automation": iconDataAutomation
|
|
148
|
+
}), jsx(View, {
|
|
149
|
+
as: "span",
|
|
150
|
+
margin: "0 0 0 x-small"
|
|
151
|
+
}, text));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return jsx(Menu.Item, {
|
|
155
|
+
key: key,
|
|
156
|
+
disabled: disabled,
|
|
157
|
+
onSelect: onClick,
|
|
158
|
+
"data-automation": menuItemDataAutomation
|
|
159
|
+
}, jsx(IconImportLine, {
|
|
160
|
+
css: this.props.styles.menuIcon,
|
|
161
|
+
"data-automation": iconDataAutomation
|
|
162
|
+
}), text);
|
|
163
|
+
}
|
|
164
|
+
}, {
|
|
165
|
+
key: "renderContentExportButton",
|
|
166
|
+
value: function renderContentExportButton() {
|
|
167
|
+
var key = 'export';
|
|
168
|
+
var text = t('Export Content');
|
|
169
|
+
var onClick = this.startQuizExportJob;
|
|
170
|
+
var disabled = !this.props.canExport;
|
|
171
|
+
var menuItemDataAutomation = 'sdk-export-content-menuitem';
|
|
172
|
+
var iconDataAutomation = 'sdk-export-content-icon';
|
|
173
|
+
|
|
174
|
+
if (this.props.iceTopNavBarEnabled) {
|
|
175
|
+
return jsx(Drilldown.Option, {
|
|
176
|
+
id: key,
|
|
177
|
+
key: key,
|
|
178
|
+
disabled: disabled,
|
|
179
|
+
onOptionClick: onClick,
|
|
180
|
+
"data-automation": menuItemDataAutomation
|
|
181
|
+
}, jsx(IconExportLine, {
|
|
182
|
+
"data-automation": iconDataAutomation
|
|
183
|
+
}), jsx(View, {
|
|
184
|
+
as: "span",
|
|
185
|
+
margin: "0 0 0 x-small"
|
|
186
|
+
}, text));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return jsx(Menu.Item, {
|
|
190
|
+
key: key,
|
|
191
|
+
disabled: disabled,
|
|
192
|
+
onSelect: onClick,
|
|
193
|
+
"data-automation": menuItemDataAutomation
|
|
194
|
+
}, jsx(IconExportLine, {
|
|
195
|
+
css: this.props.styles.menuIcon,
|
|
196
|
+
"data-automation": iconDataAutomation
|
|
197
|
+
}), text);
|
|
198
|
+
}
|
|
199
|
+
}, {
|
|
200
|
+
key: "renderManageItemBanksButton",
|
|
201
|
+
value: function renderManageItemBanksButton() {
|
|
202
|
+
var key = 'banks';
|
|
203
|
+
var text = t('Manage Item Banks');
|
|
204
|
+
var onClick = this.props.navigateToBanks;
|
|
205
|
+
var menuItemDataAutomation = 'sdk-manage-item-banks-menuitem';
|
|
206
|
+
var iconDataAutomation = 'sdk-manage-item-banks-icon';
|
|
207
|
+
|
|
208
|
+
if (this.props.iceTopNavBarEnabled) {
|
|
209
|
+
return jsx(Drilldown.Option, {
|
|
210
|
+
id: key,
|
|
211
|
+
key: key,
|
|
212
|
+
onOptionClick: onClick,
|
|
213
|
+
"data-automation": menuItemDataAutomation
|
|
214
|
+
}, jsx(IconBankLine, {
|
|
215
|
+
"data-automation": iconDataAutomation
|
|
216
|
+
}), jsx(View, {
|
|
217
|
+
as: "span",
|
|
218
|
+
margin: "0 0 0 x-small"
|
|
219
|
+
}, text));
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return jsx(Menu.Item, {
|
|
223
|
+
key: key,
|
|
224
|
+
onSelect: onClick,
|
|
225
|
+
"data-automation": menuItemDataAutomation
|
|
226
|
+
}, jsx(IconBankLine, {
|
|
227
|
+
css: this.props.styles.menuIcon,
|
|
228
|
+
"data-automation": iconDataAutomation
|
|
229
|
+
}), text);
|
|
230
|
+
}
|
|
231
|
+
}, {
|
|
232
|
+
key: "renderPrintKeyButton",
|
|
233
|
+
value: function renderPrintKeyButton(handlePrint) {
|
|
234
|
+
var key = 'printKey';
|
|
235
|
+
var text = t('Print Key (With Answers)');
|
|
236
|
+
|
|
237
|
+
var onClick = function onClick() {
|
|
238
|
+
return handlePrint(PRINT_CURRENT_PAGE);
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
var disabled = !this.props.hasQuestions || this.props.isEditing;
|
|
242
|
+
var menuItemDataAutomation = 'sdk-print-key-menuitem';
|
|
243
|
+
var iconDataAutomation = 'sdk-print-icon';
|
|
244
|
+
|
|
245
|
+
if (this.props.iceTopNavBarEnabled) {
|
|
246
|
+
return jsx(Drilldown.Option, {
|
|
247
|
+
id: key,
|
|
248
|
+
key: key,
|
|
249
|
+
disabled: disabled,
|
|
250
|
+
onOptionClick: onClick // eslint-disable-line react/jsx-no-bind
|
|
251
|
+
,
|
|
252
|
+
"data-automation": menuItemDataAutomation
|
|
253
|
+
}, jsx(IconPrinterLine, {
|
|
254
|
+
"data-automation": iconDataAutomation
|
|
255
|
+
}), jsx(View, {
|
|
256
|
+
as: "span",
|
|
257
|
+
margin: "0 0 0 x-small"
|
|
258
|
+
}, text));
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return jsx(Menu.Item, {
|
|
262
|
+
key: key,
|
|
263
|
+
disabled: disabled,
|
|
264
|
+
onSelect: onClick // eslint-disable-line react/jsx-no-bind
|
|
265
|
+
,
|
|
266
|
+
"data-automation": menuItemDataAutomation
|
|
267
|
+
}, jsx(IconPrinterLine, {
|
|
268
|
+
css: this.props.styles.menuIcon,
|
|
269
|
+
"data-automation": iconDataAutomation
|
|
270
|
+
}), text);
|
|
271
|
+
}
|
|
272
|
+
}, {
|
|
273
|
+
key: "renderPrintBlankButton",
|
|
274
|
+
value: function renderPrintBlankButton(handlePrint) {
|
|
275
|
+
var key = 'printBlank';
|
|
276
|
+
var text = t('Print Blank Quiz');
|
|
277
|
+
|
|
278
|
+
var onClick = function onClick() {
|
|
279
|
+
return handlePrint(PRINT_BLANK);
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
var disabled = !this.props.hasQuestions || this.props.isEditing;
|
|
283
|
+
var menuItemDataAutomation = 'sdk-print-blank-menuitem';
|
|
284
|
+
var iconDataAutomation = 'sdk-print-blank-icon';
|
|
285
|
+
|
|
286
|
+
if (this.props.iceTopNavBarEnabled) {
|
|
287
|
+
return jsx(Drilldown.Option, {
|
|
288
|
+
id: key,
|
|
289
|
+
key: key,
|
|
290
|
+
disabled: disabled,
|
|
291
|
+
onOptionClick: onClick // eslint-disable-line react/jsx-no-bind
|
|
292
|
+
,
|
|
293
|
+
"data-automation": menuItemDataAutomation
|
|
294
|
+
}, jsx(IconPrinterLine, {
|
|
295
|
+
"data-automation": iconDataAutomation
|
|
296
|
+
}), jsx(View, {
|
|
297
|
+
as: "span",
|
|
298
|
+
margin: "0 0 0 x-small"
|
|
299
|
+
}, text));
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
return jsx(Menu.Item, {
|
|
303
|
+
key: key,
|
|
304
|
+
disabled: disabled,
|
|
305
|
+
onSelect: onClick // eslint-disable-line react/jsx-no-bind
|
|
306
|
+
,
|
|
307
|
+
"data-automation": menuItemDataAutomation
|
|
308
|
+
}, jsx(IconPrinterLine, {
|
|
309
|
+
css: this.props.styles.menuIcon,
|
|
310
|
+
"data-automation": iconDataAutomation
|
|
311
|
+
}), text);
|
|
312
|
+
}
|
|
89
313
|
}, {
|
|
90
314
|
key: "renderMenu",
|
|
91
315
|
value: function renderMenu(handlePrint) {
|
|
@@ -93,79 +317,40 @@ export var BuildingButtons = (_dec = withStyle(generateStyle, generateComponentT
|
|
|
93
317
|
var menuItems = [];
|
|
94
318
|
|
|
95
319
|
if (this.props.speedgraderLink) {
|
|
96
|
-
menuItems.push(
|
|
97
|
-
key: "speedgrader",
|
|
98
|
-
onSelect: this.openSpeedgraderLink
|
|
99
|
-
}, jsx(IconSpeedGraderLine, {
|
|
100
|
-
css: this.props.styles.menuIcon
|
|
101
|
-
}), t('Speedgrader')));
|
|
320
|
+
menuItems.push(this.renderSpeedGraderButton());
|
|
102
321
|
}
|
|
103
322
|
|
|
104
|
-
menuItems.push(
|
|
105
|
-
key: "import",
|
|
106
|
-
disabled: !this.props.canImport,
|
|
107
|
-
onSelect: this.props.openModal,
|
|
108
|
-
"data-automation": "sdk-import-content-menuitem"
|
|
109
|
-
}, jsx(IconImportLine, {
|
|
110
|
-
css: this.props.styles.menuIcon,
|
|
111
|
-
"data-automation": "sdk-import-content-icon"
|
|
112
|
-
}), t('Import Content')));
|
|
323
|
+
menuItems.push(this.renderImportContentButton());
|
|
113
324
|
|
|
114
325
|
if (this.props.contentExportEnabled) {
|
|
115
|
-
menuItems.push(
|
|
116
|
-
key: "export",
|
|
117
|
-
disabled: !this.props.canExport,
|
|
118
|
-
onSelect: this.startQuizExportJob,
|
|
119
|
-
"data-automation": "sdk-export-content-menuitem"
|
|
120
|
-
}, jsx(IconExportLine, {
|
|
121
|
-
css: this.props.styles.menuIcon,
|
|
122
|
-
"data-automation": "sdk-export-content-icon"
|
|
123
|
-
}), t('Export Content')));
|
|
326
|
+
menuItems.push(this.renderContentExportButton());
|
|
124
327
|
}
|
|
125
328
|
|
|
126
329
|
if (this.props.enableItemBanking) {
|
|
127
|
-
menuItems.push(
|
|
128
|
-
key: "banks",
|
|
129
|
-
onSelect: this.props.navigateToBanks,
|
|
130
|
-
"data-automation": "sdk-manage-item-banks-menuitem"
|
|
131
|
-
}, jsx(IconBankLine, {
|
|
132
|
-
css: this.props.styles.menuIcon,
|
|
133
|
-
"data-automation": "sdk-manage-item-banks-icon"
|
|
134
|
-
}), t('Manage Item Banks')));
|
|
330
|
+
menuItems.push(this.renderManageItemBanksButton());
|
|
135
331
|
}
|
|
136
332
|
|
|
137
333
|
if (this.props.printingEnabled) {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
menuItems.push(jsx(Menu.Item, {
|
|
142
|
-
key: "printKey",
|
|
143
|
-
disabled: !this.props.hasQuestions || this.props.isEditing,
|
|
144
|
-
onSelect: function onSelect() {
|
|
145
|
-
return handlePrint(PRINT_CURRENT_PAGE);
|
|
146
|
-
},
|
|
147
|
-
"data-automation": "sdk-print-key-menuitem"
|
|
148
|
-
}, jsx(IconPrinterLine, {
|
|
149
|
-
css: this.props.styles.menuIcon,
|
|
150
|
-
"data-automation": "sdk-print-icon"
|
|
151
|
-
}), t('Print Key (With Answers)')));
|
|
152
|
-
menuItems.push(jsx(Menu.Item, {
|
|
153
|
-
key: "printBlank",
|
|
154
|
-
disabled: !this.props.hasQuestions || this.props.isEditing,
|
|
155
|
-
onSelect: function onSelect() {
|
|
156
|
-
return handlePrint(PRINT_BLANK);
|
|
157
|
-
},
|
|
158
|
-
"data-automation": "sdk-print-blank-menuitem"
|
|
159
|
-
}, jsx(IconPrinterLine, {
|
|
160
|
-
css: this.props.styles.menuIcon,
|
|
161
|
-
"data-automation": "sdk-print-blank-icon"
|
|
162
|
-
}), t('Print Blank Quiz')));
|
|
163
|
-
{
|
|
164
|
-
/* eslint-enable react/jsx-no-bind */
|
|
165
|
-
}
|
|
334
|
+
menuItems.push(this.renderPrintKeyButton(handlePrint));
|
|
335
|
+
menuItems.push(this.renderPrintBlankButton(handlePrint));
|
|
166
336
|
}
|
|
167
337
|
|
|
168
338
|
if (menuItems.length < 1) return;
|
|
339
|
+
|
|
340
|
+
if (this.props.iceTopNavBarEnabled) {
|
|
341
|
+
return jsx(TopNavBar.Item, {
|
|
342
|
+
id: this.props.id,
|
|
343
|
+
variant: "icon",
|
|
344
|
+
renderIcon: this.props.renderIcon,
|
|
345
|
+
showSubmenuChevron: false,
|
|
346
|
+
renderSubmenu: jsx(Drilldown, {
|
|
347
|
+
rootPageId: "root"
|
|
348
|
+
}, jsx(Drilldown.Page, {
|
|
349
|
+
id: "root"
|
|
350
|
+
}, menuItems))
|
|
351
|
+
}, t('More'));
|
|
352
|
+
}
|
|
353
|
+
|
|
169
354
|
return jsx(Menu, {
|
|
170
355
|
trigger: jsx(IconButton, {
|
|
171
356
|
renderIcon: IconMoreSolid,
|
|
@@ -216,6 +401,10 @@ export var BuildingButtons = (_dec = withStyle(generateStyle, generateComponentT
|
|
|
216
401
|
speedgraderLink: PropTypes.string,
|
|
217
402
|
startExport: PropTypes.func.isRequired,
|
|
218
403
|
contextUuid: PropTypes.string,
|
|
404
|
+
iceTopNavBarEnabled: PropTypes.bool,
|
|
405
|
+
id: PropTypes.string,
|
|
406
|
+
renderIcon: PropTypes.element,
|
|
407
|
+
makeStyles: PropTypes.func,
|
|
219
408
|
styles: PropTypes.object
|
|
220
409
|
}, _class2.defaultProps = {
|
|
221
410
|
activeQuizId: null,
|
|
@@ -226,6 +415,9 @@ export var BuildingButtons = (_dec = withStyle(generateStyle, generateComponentT
|
|
|
226
415
|
enableItemBanking: true,
|
|
227
416
|
quizSaving: false,
|
|
228
417
|
speedgraderLink: null,
|
|
229
|
-
contextUuid: null
|
|
418
|
+
contextUuid: null,
|
|
419
|
+
iceTopNavBarEnabled: false,
|
|
420
|
+
id: 'MoreButton',
|
|
421
|
+
renderIcon: jsx(IconMoreSolid, null)
|
|
230
422
|
}, _temp)) || _class);
|
|
231
423
|
export default BuildingButtons;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
|
|
3
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
4
|
+
var iceTopNavBarEnabled = props.iceTopNavBarEnabled;
|
|
2
5
|
return {
|
|
3
6
|
quizSaving: {
|
|
4
7
|
color: componentTheme.quizSavingColor,
|
|
5
8
|
margin: componentTheme.quizSavingMargin
|
|
6
9
|
},
|
|
7
|
-
buttonsHolder: {
|
|
8
|
-
height: '100%'
|
|
10
|
+
buttonsHolder: _objectSpread({
|
|
11
|
+
height: '100%'
|
|
12
|
+
}, !iceTopNavBarEnabled && {
|
|
9
13
|
marginRight: componentTheme.buttonsHolderMargin,
|
|
10
14
|
display: 'flex',
|
|
11
15
|
alignItems: 'center'
|
|
12
|
-
},
|
|
16
|
+
}),
|
|
13
17
|
menuIcon: {
|
|
14
18
|
verticalAlign: 'middle',
|
|
15
19
|
marginRight: componentTheme.menuIconMargin,
|
package/es/index.js
CHANGED
|
@@ -31,7 +31,6 @@ export { Banks as BanksPage } from "./banks/components/Banks/index.js";
|
|
|
31
31
|
export { Bank as BankPage } from "./banks/components/Bank/index.js";
|
|
32
32
|
export { BankEntry as BankEntryPage } from "./banks/components/BankEntry/index.js";
|
|
33
33
|
export { SDKBuildingButtons } from "./building/components/layout/header/SDKBuildingButtons/index.js";
|
|
34
|
-
export { default as SDKBuildingButtonsICE } from "./building/components/layout/header/BuildingButtonsICE/index.js";
|
|
35
34
|
export { Paginator } from "./common/components/shared/Paginator/index.js";
|
|
36
35
|
export { SDKMenuButton } from "./common/components/SDKMenuButton.js";
|
|
37
36
|
export { SDKTimer } from "./common/components/SDKTimer.js";
|
|
@@ -34,6 +34,7 @@ function mapStateToProps(state, props) {
|
|
|
34
34
|
var sortOrder = pageData.get('sortOrder', 'ascending');
|
|
35
35
|
var searchTerms = pageData.get('searchTerms', null);
|
|
36
36
|
var searchSelection = pageData.get('searchSelection', []);
|
|
37
|
+
var rootAccountUuid = state.getIn(['outcomes', 'contextUuid']);
|
|
37
38
|
return {
|
|
38
39
|
itemBankSearchTableEnabled: (0, _featureCheck.featureOn)('item_bank_search_table'),
|
|
39
40
|
improvedBankSharingEnabled: (0, _featureCheck.featureOn)('improved_bank_sharing'),
|
|
@@ -44,7 +45,8 @@ function mapStateToProps(state, props) {
|
|
|
44
45
|
sortBy: sortBy,
|
|
45
46
|
sortOrder: sortOrder,
|
|
46
47
|
searchTerms: searchTerms,
|
|
47
|
-
searchSelection: searchSelection
|
|
48
|
+
searchSelection: searchSelection,
|
|
49
|
+
rootAccountUuid: rootAccountUuid
|
|
48
50
|
};
|
|
49
51
|
}
|
|
50
52
|
|
|
@@ -95,6 +95,10 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
95
95
|
(0, _classCallCheck2.default)(this, Banks);
|
|
96
96
|
_this = _super.apply(this, arguments);
|
|
97
97
|
|
|
98
|
+
_this.hideAccountSearch = function () {
|
|
99
|
+
return _this.props.scopeType === 'account' && _this.props.scope.type === 'account' && _this.props.scope.launch_context_uuid && _this.props.rootAccountUuid && _this.props.scope.launch_context_uuid !== _this.props.rootAccountUuid;
|
|
100
|
+
};
|
|
101
|
+
|
|
98
102
|
_this.onCreateBank = function () {
|
|
99
103
|
_this.props.createBank({
|
|
100
104
|
language: _this.context.locale
|
|
@@ -134,7 +138,9 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
134
138
|
params['search'] = _this.props.searchTerms;
|
|
135
139
|
}
|
|
136
140
|
|
|
137
|
-
if (_this.props.
|
|
141
|
+
if (_this.props.subAccountBankSharingEnabled && _this.hideAccountSearch()) {
|
|
142
|
+
params['account_uuids'] = [_this.props.scope.launch_context_uuid];
|
|
143
|
+
} else if (_this.props.searchSelection.length > 0) {
|
|
138
144
|
params['account_uuids'] = _this.props.searchSelection.map(function (account) {
|
|
139
145
|
return account.uuid;
|
|
140
146
|
});
|
|
@@ -165,6 +171,12 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
165
171
|
_this.props.merge(_quizCommon.BANKS_BANK_FILTERS, {
|
|
166
172
|
scopeType: scopeType
|
|
167
173
|
});
|
|
174
|
+
|
|
175
|
+
if (scopeType === 'account') {
|
|
176
|
+
_this.setState({
|
|
177
|
+
hiddenAccountSearch: true
|
|
178
|
+
});
|
|
179
|
+
}
|
|
168
180
|
};
|
|
169
181
|
|
|
170
182
|
_this.getSortingOrderIcon = function () {
|
|
@@ -251,7 +263,11 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
251
263
|
if (_this.props.scopeType === 'course') {
|
|
252
264
|
message = (0, _formatMessage.default)("Your filter is set to \"Courses\" which will narrow what you can search for.\n Try adjusting the filter to \"Institution\" or \"All My Banks\"");
|
|
253
265
|
} else if (_this.props.scopeType === 'account') {
|
|
254
|
-
|
|
266
|
+
if (_this.props.subAccountBankSharingEnabled && _this.hideAccountSearch()) {
|
|
267
|
+
message = (0, _formatMessage.default)("Your filter is set to \"This Account\" which will narrow what you can search for.\n Try adjusting the filter to \"All My Banks\"");
|
|
268
|
+
} else {
|
|
269
|
+
message = (0, _formatMessage.default)("Your filter is set to \"Institution\" which will narrow what you can search for.\n Try adjusting the filter to \"All My Banks\"");
|
|
270
|
+
}
|
|
255
271
|
}
|
|
256
272
|
|
|
257
273
|
return (0, _emotion.jsx)(_uiBillboard.Billboard, {
|
|
@@ -282,7 +298,9 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
282
298
|
if (prevProps.sortBy !== this.props.sortBy || prevProps.sortOrder !== this.props.sortOrder || prevProps.searchTerms !== this.props.searchTerms || prevProps.scopeType !== this.props.scopeType || !(0, _isEqual.default)(prevProps.searchSelection, this.props.searchSelection)) {
|
|
283
299
|
this.props.clear(_quizCommon.BANKS_BANK_PAGINATION);
|
|
284
300
|
}
|
|
285
|
-
}
|
|
301
|
+
} // When the launch is from a subaccount, we want to silently add the subaccount to the account search
|
|
302
|
+
// if the user is on the "This Account" filter
|
|
303
|
+
|
|
286
304
|
}, {
|
|
287
305
|
key: "renderFilters",
|
|
288
306
|
value: function renderFilters() {
|
|
@@ -291,7 +309,7 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
291
309
|
translation: this.props.newItemBankFilterNamesEnabled ? (0, _formatMessage.default)('All Banks') : (0, _formatMessage.default)('All My Banks')
|
|
292
310
|
}, {
|
|
293
311
|
slug: 'account',
|
|
294
|
-
translation: (0, _formatMessage.default)('Institution Banks')
|
|
312
|
+
translation: this.props.subAccountBankSharingEnabled && this.hideAccountSearch() ? (0, _formatMessage.default)('This Account') : (0, _formatMessage.default)('Institution Banks')
|
|
295
313
|
}, {
|
|
296
314
|
slug: 'courses',
|
|
297
315
|
translation: this.props.newItemBankFilterNamesEnabled ? (0, _formatMessage.default)('Banks Shared to Course') : (0, _formatMessage.default)('All My Course Banks')
|
|
@@ -354,7 +372,7 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
354
372
|
onChange: this.handleSearchInputChange,
|
|
355
373
|
placeholder: (0, _formatMessage.default)('Search Banks'),
|
|
356
374
|
"data-automation": "sdk-search-bank-textinput"
|
|
357
|
-
})), this.props.subAccountBankSharingEnabled && (0, _emotion.jsx)(_uiGrid.Grid.Col, {
|
|
375
|
+
})), this.props.subAccountBankSharingEnabled && !this.hideAccountSearch() && (0, _emotion.jsx)(_uiGrid.Grid.Col, {
|
|
358
376
|
width: 4
|
|
359
377
|
}, (0, _emotion.jsx)(_index7.default, {
|
|
360
378
|
getShareableSubaccounts: this.props.getShareableSubaccounts,
|
|
@@ -527,7 +545,9 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
527
545
|
scope: _propTypes.default.shape({
|
|
528
546
|
type: _propTypes.default.string,
|
|
529
547
|
uuid: _propTypes.default.string,
|
|
530
|
-
title: _propTypes.default.string
|
|
548
|
+
title: _propTypes.default.string,
|
|
549
|
+
launch_context_uuid: _propTypes.default.string,
|
|
550
|
+
root_account_name: _propTypes.default.string
|
|
531
551
|
}).isRequired,
|
|
532
552
|
scopeType: _propTypes.default.string,
|
|
533
553
|
searchTerms: _propTypes.default.string,
|
|
@@ -545,7 +565,8 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
545
565
|
subAccountBankSharingEnabled: _propTypes.default.bool,
|
|
546
566
|
iceTopNavBarEnabled: _propTypes.default.bool,
|
|
547
567
|
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
548
|
-
styles: _propTypes.default.object
|
|
568
|
+
styles: _propTypes.default.object,
|
|
569
|
+
rootAccountUuid: _propTypes.default.string
|
|
549
570
|
}, _class2.defaultProps = {
|
|
550
571
|
closeTray: null,
|
|
551
572
|
currentUser: null,
|
|
@@ -572,7 +593,8 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
572
593
|
usedByCourseEnabled: false,
|
|
573
594
|
itemBankSearchTableEnabled: false,
|
|
574
595
|
subAccountBankSharingEnabled: false,
|
|
575
|
-
iceTopNavBarEnabled: false
|
|
596
|
+
iceTopNavBarEnabled: false,
|
|
597
|
+
rootAccountUuid: null
|
|
576
598
|
}, _class2.contextTypes = {
|
|
577
599
|
locale: _propTypes.default.string
|
|
578
600
|
}, _temp)) || _class);
|