@instructure/quiz-core 20.9.1-rc.7 → 20.10.0
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/CHANGELOG.md +17 -0
- package/es/banks/components/Bank/presenter.js +24 -6
- package/es/banks/components/Bank/styles.js +3 -0
- package/es/banks/components/Bank/theme.js +3 -2
- package/es/banks/components/BankEntry/presenter.js +35 -12
- package/es/banks/components/BankEntry/styles.js +3 -0
- package/es/banks/components/BankEntry/theme.js +3 -0
- package/es/banks/components/Banks/presenter.js +16 -4
- package/es/banks/components/Banks/styles.js +5 -3
- package/es/banks/components/Banks/theme.js +3 -2
- package/es/banks/components/HeaderBreadCrumb/index.js +106 -0
- package/es/banks/components/NavWrapper/presenter.js +51 -41
- package/es/common/components/shared/return_button/ReturnButton.js +15 -2
- package/lib/banks/components/Bank/presenter.js +39 -20
- package/lib/banks/components/Bank/styles.js +3 -0
- package/lib/banks/components/Bank/theme.js +3 -2
- package/lib/banks/components/BankEntry/presenter.js +54 -30
- package/lib/banks/components/BankEntry/styles.js +3 -0
- package/lib/banks/components/BankEntry/theme.js +3 -0
- package/lib/banks/components/Banks/presenter.js +26 -13
- package/lib/banks/components/Banks/styles.js +5 -3
- package/lib/banks/components/Banks/theme.js +3 -2
- package/lib/banks/components/HeaderBreadCrumb/index.js +131 -0
- package/lib/banks/components/NavWrapper/presenter.js +53 -39
- package/lib/common/components/shared/return_button/ReturnButton.js +16 -2
- package/package.json +10 -10
|
@@ -51,11 +51,13 @@ var _uiCheckbox = require("@instructure/ui-checkbox");
|
|
|
51
51
|
|
|
52
52
|
var _uiView = require("@instructure/ui-view");
|
|
53
53
|
|
|
54
|
+
var _index = require("../HeaderBreadCrumb/index.js");
|
|
55
|
+
|
|
54
56
|
var _Bank = _interopRequireDefault(require("../../../common/records/Bank.js"));
|
|
55
57
|
|
|
56
|
-
var
|
|
58
|
+
var _index2 = _interopRequireDefault(require("../../../common/components/layout/Page/index.js"));
|
|
57
59
|
|
|
58
|
-
var
|
|
60
|
+
var _index3 = _interopRequireDefault(require("../../../common/components/shared/PaginatedCollection/index.js"));
|
|
59
61
|
|
|
60
62
|
var _QuizEntry = _interopRequireDefault(require("../../../common/records/QuizEntry.js"));
|
|
61
63
|
|
|
@@ -63,15 +65,15 @@ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/f
|
|
|
63
65
|
|
|
64
66
|
var _debounceLatestPromise = _interopRequireDefault(require("../../../common/util/debounceLatestPromise.js"));
|
|
65
67
|
|
|
66
|
-
var
|
|
68
|
+
var _index4 = _interopRequireDefault(require("../../../banks/components/AddBankEntryModal/index.js"));
|
|
67
69
|
|
|
68
|
-
var
|
|
70
|
+
var _index5 = _interopRequireDefault(require("../../../banks/components/BankEntriesList/index.js"));
|
|
69
71
|
|
|
70
|
-
var
|
|
72
|
+
var _index6 = _interopRequireDefault(require("../../../banks/components/BankSearch/index.js"));
|
|
71
73
|
|
|
72
|
-
var
|
|
74
|
+
var _index7 = _interopRequireDefault(require("../../../banks/components/HeaderMenu/index.js"));
|
|
73
75
|
|
|
74
|
-
var
|
|
76
|
+
var _index8 = _interopRequireDefault(require("../NavWrapper/index.js"));
|
|
75
77
|
|
|
76
78
|
var _quizCommon = require("@instructure/quiz-common");
|
|
77
79
|
|
|
@@ -109,7 +111,7 @@ var Bank = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
109
111
|
|
|
110
112
|
_this.renderHeaderMenu = function () {
|
|
111
113
|
if (!_this.props.isCompact) {
|
|
112
|
-
return (0, _emotion.jsx)(
|
|
114
|
+
return (0, _emotion.jsx)(_index7.default, {
|
|
113
115
|
bank: _this.props.bank
|
|
114
116
|
});
|
|
115
117
|
}
|
|
@@ -119,6 +121,12 @@ var Bank = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
119
121
|
_this.createBankEntryButton = c;
|
|
120
122
|
};
|
|
121
123
|
|
|
124
|
+
_this.renderBankBreadCrumbLink = function () {
|
|
125
|
+
return (0, _emotion.jsx)(_uiBreadcrumb.BreadcrumbLink, {
|
|
126
|
+
key: "bank"
|
|
127
|
+
}, _this.props.bank.title);
|
|
128
|
+
};
|
|
129
|
+
|
|
122
130
|
_this.toggleCheckbox = function () {
|
|
123
131
|
// disable until request resolves
|
|
124
132
|
_this.setState({
|
|
@@ -266,7 +274,7 @@ var Bank = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
266
274
|
|
|
267
275
|
_this.renderRecords = function (recordIds) {
|
|
268
276
|
var addEntryFunc = _this.props.isCompact && _this.props.addEntryToQuiz || null;
|
|
269
|
-
return (0, _emotion.jsx)(
|
|
277
|
+
return (0, _emotion.jsx)(_index5.default, {
|
|
270
278
|
addEntryToQuiz: addEntryFunc,
|
|
271
279
|
bank: _this.props.bank,
|
|
272
280
|
navigateToBankEntry: _this.props.navigateToBankEntry,
|
|
@@ -348,16 +356,18 @@ var Bank = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
348
356
|
navigateToBuild = _this$props3.navigateToBuild,
|
|
349
357
|
returnToUrl = _this$props3.returnToUrl;
|
|
350
358
|
var isScopeEmpty = !Object.keys(scope).length;
|
|
351
|
-
return (0, _emotion.jsx)(
|
|
359
|
+
return (0, _emotion.jsx)(_index8.default, {
|
|
352
360
|
closeTray: closeTray,
|
|
353
361
|
navigateToBanks: navigateToBanks,
|
|
354
362
|
navigateToBuild: navigateToBuild,
|
|
355
363
|
renderHeaderMenu: this.renderHeaderMenu,
|
|
356
364
|
returnToUrl: isScopeEmpty ? null : returnToUrl,
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
365
|
+
scope: scope,
|
|
366
|
+
isCompact: this.props.isCompact,
|
|
367
|
+
iceTopNavBarEnabled: this.props.iceTopNavBarEnabled,
|
|
368
|
+
menuItemPath: "/banks/".concat(this.props.bankId) // eslint-disable-line react/jsx-no-literals
|
|
369
|
+
|
|
370
|
+
}, this.renderBankBreadCrumbLink());
|
|
361
371
|
}
|
|
362
372
|
}, {
|
|
363
373
|
key: "renderName",
|
|
@@ -372,7 +382,7 @@ var Bank = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
372
382
|
key: "renderAddBankEntryModal",
|
|
373
383
|
value: function renderAddBankEntryModal() {
|
|
374
384
|
if (!this.props.isCompact) {
|
|
375
|
-
return (0, _emotion.jsx)(
|
|
385
|
+
return (0, _emotion.jsx)(_index4.default, {
|
|
376
386
|
bankId: this.props.bankId,
|
|
377
387
|
navigateToBankEntry: this.props.navigateToBankEntry
|
|
378
388
|
});
|
|
@@ -469,7 +479,7 @@ var Bank = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
469
479
|
if (this.props.bank.filters !== null && this.props.useBankSearch) {
|
|
470
480
|
var its = this.props.bank.filters.interaction_types;
|
|
471
481
|
var tags = this.props.bank.filters.tags;
|
|
472
|
-
return (0, _emotion.jsx)(
|
|
482
|
+
return (0, _emotion.jsx)(_index6.default, {
|
|
473
483
|
interactionTypes: its,
|
|
474
484
|
tags: tags,
|
|
475
485
|
pageStateKey: this.stateKey(),
|
|
@@ -495,11 +505,18 @@ var Bank = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
495
505
|
}, {
|
|
496
506
|
key: "render",
|
|
497
507
|
value: function render() {
|
|
498
|
-
return (0, _emotion.jsx)(
|
|
508
|
+
return (0, _emotion.jsx)(_index2.default, null, this.renderModals(), this.renderNav(), (0, _emotion.jsx)("div", {
|
|
499
509
|
css: this.props.styles.content
|
|
500
|
-
}, this.
|
|
510
|
+
}, this.props.iceTopNavBarEnabled && (0, _emotion.jsx)("div", {
|
|
511
|
+
css: this.props.styles.breadcrumb
|
|
512
|
+
}, (0, _emotion.jsx)(_index.HeaderBreadCrumb, {
|
|
513
|
+
returnToUrl: this.props.returnToUrl,
|
|
514
|
+
scope: this.props.scope,
|
|
515
|
+
navigateToBanks: this.props.navigateToBanks,
|
|
516
|
+
navigateToBuild: this.props.navigateToBuild
|
|
517
|
+
}, this.renderBankBreadCrumbLink())), this.renderName(), this.renderCheckbox(), (0, _emotion.jsx)("div", {
|
|
501
518
|
css: this.props.styles.topMenu
|
|
502
|
-
}, this.renderTopLeftMenu(), this.renderTopRightMenu()), this.renderSearch(), (0, _emotion.jsx)(
|
|
519
|
+
}, this.renderTopLeftMenu(), this.renderTopRightMenu()), this.renderSearch(), (0, _emotion.jsx)(_index3.default, {
|
|
503
520
|
empty: this.emptyLoadText(),
|
|
504
521
|
params: this.props.search,
|
|
505
522
|
getPage: this.getPageDebounced,
|
|
@@ -548,6 +565,7 @@ var Bank = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
548
565
|
showShareBankFromTray: _propTypes.default.bool,
|
|
549
566
|
updateSharedBankPermission: _propTypes.default.func.isRequired,
|
|
550
567
|
withConfirm: _propTypes.default.func.isRequired,
|
|
568
|
+
iceTopNavBarEnabled: _propTypes.default.bool,
|
|
551
569
|
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
552
570
|
styles: _propTypes.default.object
|
|
553
571
|
}, _class2.defaultProps = {
|
|
@@ -565,7 +583,8 @@ var Bank = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
565
583
|
returnToUrl: null,
|
|
566
584
|
isQuizContentLocked: false,
|
|
567
585
|
showShareBankFromTray: false,
|
|
568
|
-
courseSharedBank: null
|
|
586
|
+
courseSharedBank: null,
|
|
587
|
+
iceTopNavBarEnabled: false
|
|
569
588
|
}, _temp)) || _class);
|
|
570
589
|
exports.Bank = Bank;
|
|
571
590
|
var _default = Bank;
|
|
@@ -25,6 +25,9 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
25
25
|
}, mq, {
|
|
26
26
|
padding: "".concat(componentTheme.phoneContentPadding, " 0")
|
|
27
27
|
}),
|
|
28
|
+
breadcrumb: {
|
|
29
|
+
marginBottom: "".concat(componentTheme.breadCrumbMarginBottom)
|
|
30
|
+
},
|
|
28
31
|
topMenu: menuStyles,
|
|
29
32
|
topLeftMenu: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, menuStyles), {}, {
|
|
30
33
|
flex: '50%'
|
|
@@ -11,9 +11,10 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
11
11
|
breakpoints = _ref.breakpoints;
|
|
12
12
|
return {
|
|
13
13
|
contentBackgroundColor: colors.white,
|
|
14
|
-
contentPaddingTopBottom: spacing.
|
|
14
|
+
contentPaddingTopBottom: spacing.medium,
|
|
15
15
|
contentPaddingLeftRight: spacing.medium,
|
|
16
|
-
|
|
16
|
+
breadCrumbMarginBottom: spacing.large,
|
|
17
|
+
bankNamePaddingBottom: spacing.large,
|
|
17
18
|
phoneBreakPoint: "max-width: ".concat(breakpoints.medium),
|
|
18
19
|
phoneContentPadding: spacing.small,
|
|
19
20
|
filtersMarginTop: spacing.large
|
|
@@ -57,25 +57,27 @@ var _uiTextInput = require("@instructure/ui-text-input");
|
|
|
57
57
|
|
|
58
58
|
var _emotion = require("@instructure/emotion");
|
|
59
59
|
|
|
60
|
-
var _index =
|
|
60
|
+
var _index = require("../HeaderBreadCrumb/index.js");
|
|
61
61
|
|
|
62
|
-
var _index2 = _interopRequireDefault(require("../../../common/components/resources/
|
|
62
|
+
var _index2 = _interopRequireDefault(require("../../../common/components/resources/entry/EntrySave/index.js"));
|
|
63
63
|
|
|
64
|
-
var _index3 = _interopRequireDefault(require("../../../
|
|
64
|
+
var _index3 = _interopRequireDefault(require("../../../common/components/resources/item/ItemEdit/index.js"));
|
|
65
65
|
|
|
66
|
-
var _index4 = _interopRequireDefault(require("../../../
|
|
66
|
+
var _index4 = _interopRequireDefault(require("../../../building/components/resources/ItemFeedbackModal/index.js"));
|
|
67
67
|
|
|
68
|
-
var _index5 = _interopRequireDefault(require("../../../common/components/
|
|
68
|
+
var _index5 = _interopRequireDefault(require("../../../common/components/resources/item/ItemShow/index.js"));
|
|
69
|
+
|
|
70
|
+
var _index6 = _interopRequireDefault(require("../../../common/components/layout/Page/index.js"));
|
|
69
71
|
|
|
70
72
|
var _Spinner = _interopRequireDefault(require("../../../common/components/shared/spinner/Spinner.js"));
|
|
71
73
|
|
|
72
|
-
var
|
|
74
|
+
var _index7 = _interopRequireDefault(require("../../../common/components/resources/stimulus/StimulusEditInfo/index.js"));
|
|
73
75
|
|
|
74
|
-
var
|
|
76
|
+
var _index8 = _interopRequireDefault(require("../../../common/components/resources/stimulus/StimulusShowInfo/index.js"));
|
|
75
77
|
|
|
76
|
-
var
|
|
78
|
+
var _index9 = _interopRequireDefault(require("../../../common/components/shared/TagSuggestSelect/index.js"));
|
|
77
79
|
|
|
78
|
-
var
|
|
80
|
+
var _index10 = _interopRequireDefault(require("../../../common/components/resources/WarningWrapper/index.js"));
|
|
79
81
|
|
|
80
82
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
81
83
|
|
|
@@ -85,7 +87,7 @@ var _stimuli = require("../../../building/api/stimuli.js");
|
|
|
85
87
|
|
|
86
88
|
var _warningHelpers = require("../../../common/util/warningHelpers.js");
|
|
87
89
|
|
|
88
|
-
var
|
|
90
|
+
var _index11 = _interopRequireDefault(require("../NavWrapper/index.js"));
|
|
89
91
|
|
|
90
92
|
var _quizCommon = require("@instructure/quiz-common");
|
|
91
93
|
|
|
@@ -333,6 +335,22 @@ var BankEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
333
335
|
return this.isItemEntry() ? (0, _formatMessage.default)('Edit Question') : (0, _formatMessage.default)('Edit Stimulus');
|
|
334
336
|
}
|
|
335
337
|
}
|
|
338
|
+
}, {
|
|
339
|
+
key: "renderBankBreadCrumbLink",
|
|
340
|
+
value: function renderBankBreadCrumbLink() {
|
|
341
|
+
return (0, _emotion.jsx)(_uiBreadcrumb.BreadcrumbLink, {
|
|
342
|
+
key: "bank",
|
|
343
|
+
onClick: this.navigateToBank,
|
|
344
|
+
ref: this.setNavToBankRef
|
|
345
|
+
}, this.props.bank.title);
|
|
346
|
+
}
|
|
347
|
+
}, {
|
|
348
|
+
key: "renderBankEntryBreadCrumbLink",
|
|
349
|
+
value: function renderBankEntryBreadCrumbLink() {
|
|
350
|
+
return (0, _emotion.jsx)(_uiBreadcrumb.BreadcrumbLink, {
|
|
351
|
+
key: "bankEntry"
|
|
352
|
+
}, this.entryLinkName());
|
|
353
|
+
}
|
|
336
354
|
}, {
|
|
337
355
|
key: "renderNav",
|
|
338
356
|
value: function renderNav() {
|
|
@@ -341,22 +359,19 @@ var BankEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
341
359
|
closeTray = _this$props.closeTray,
|
|
342
360
|
navigateToBanks = _this$props.navigateToBanks,
|
|
343
361
|
navigateToBuild = _this$props.navigateToBuild,
|
|
344
|
-
returnToUrl = _this$props.returnToUrl
|
|
345
|
-
bank = _this$props.bank;
|
|
362
|
+
returnToUrl = _this$props.returnToUrl;
|
|
346
363
|
var isScopeEmpty = !Object.keys(scope).length;
|
|
347
|
-
return (0, _emotion.jsx)(
|
|
364
|
+
return (0, _emotion.jsx)(_index11.default, {
|
|
348
365
|
closeTray: closeTray,
|
|
349
366
|
navigateToBanks: navigateToBanks,
|
|
350
367
|
navigateToBuild: navigateToBuild,
|
|
351
368
|
returnToUrl: isScopeEmpty ? null : returnToUrl,
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
},
|
|
358
|
-
key: "bankEntry"
|
|
359
|
-
}, this.entryLinkName()));
|
|
369
|
+
scope: scope,
|
|
370
|
+
isCompact: this.props.isCompact,
|
|
371
|
+
iceTopNavBarEnabled: this.props.iceTopNavBarEnabled,
|
|
372
|
+
menuItemPath: "/banks/".concat(this.props.bankId, "/bank_entries/").concat(this.props.bankEntryId || 'new') // eslint-disable-line react/jsx-no-literals
|
|
373
|
+
|
|
374
|
+
}, this.renderBankBreadCrumbLink(), this.renderBankEntryBreadCrumbLink());
|
|
360
375
|
}
|
|
361
376
|
}, {
|
|
362
377
|
key: "renderTitle",
|
|
@@ -396,7 +411,7 @@ var BankEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
396
411
|
as: "h2"
|
|
397
412
|
}, entryName, (0, _emotion.jsx)(_uiA11yContent.PresentationContent, null, separator), itemIdentifier))), this.renderTitle(entry), (0, _emotion.jsx)("div", {
|
|
398
413
|
css: this.props.styles.rightHeader
|
|
399
|
-
}, (0, _emotion.jsx)(
|
|
414
|
+
}, (0, _emotion.jsx)(_index2.default, props)));
|
|
400
415
|
}
|
|
401
416
|
}, {
|
|
402
417
|
key: "hasPendingTagModifications",
|
|
@@ -634,14 +649,14 @@ var BankEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
634
649
|
var propsFunc = this.isItemEntry() ? _warningHelpers.propsForItemVersioningWrapper : _warningHelpers.propsForStimulusVersioningWrapper;
|
|
635
650
|
var versioningProps = propsFunc(entry.isImmutable(), this.props.shouldClone, this.props.setShouldClone, this.navigateToBank, true);
|
|
636
651
|
var canEdit = !entry.isImmutable() || this.props.shouldClone;
|
|
637
|
-
var ItemComponent = canEdit ?
|
|
638
|
-
var StimulusComponent = canEdit ?
|
|
652
|
+
var ItemComponent = canEdit ? _index3.default : _index5.default;
|
|
653
|
+
var StimulusComponent = canEdit ? _index7.default : _index8.default;
|
|
639
654
|
var EntryComponent = this.isItemEntry() ? ItemComponent : StimulusComponent;
|
|
640
655
|
var entryType = bankEntry.entryType;
|
|
641
656
|
var entryId = this.getBankEntryId(bankEntry);
|
|
642
657
|
|
|
643
658
|
var tags = function tags() {
|
|
644
|
-
return (0, _emotion.jsx)(
|
|
659
|
+
return (0, _emotion.jsx)(_index9.default, {
|
|
645
660
|
allowNewTags: true,
|
|
646
661
|
noMatchText: (0, _formatMessage.default)('Enter a tag to find or create'),
|
|
647
662
|
parentType: entryType,
|
|
@@ -654,7 +669,7 @@ var BankEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
654
669
|
var editWarning = this.isItemEntry() ? (0, _formatMessage.default)('Edits made here will appear on any assessment using this question.') : (0, _formatMessage.default)('Edits made here will appear on any assessment using this stimulus.');
|
|
655
670
|
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)("div", {
|
|
656
671
|
css: this.props.styles.entryEdit
|
|
657
|
-
}, (0, _emotion.jsx)(
|
|
672
|
+
}, (0, _emotion.jsx)(_index10.default, versioningProps, canEdit && (0, _emotion.jsx)(_uiAlerts.Alert, {
|
|
658
673
|
renderCloseButtonLabel: (0, _formatMessage.default)('Dismiss'),
|
|
659
674
|
margin: "0 0 medium 0"
|
|
660
675
|
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
@@ -665,7 +680,7 @@ var BankEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
665
680
|
css: this.props.styles.leftFooter
|
|
666
681
|
}, this.renderFeedbackSection()), (0, _emotion.jsx)("div", {
|
|
667
682
|
css: this.props.styles.rightFooter
|
|
668
|
-
}, (0, _emotion.jsx)(
|
|
683
|
+
}, (0, _emotion.jsx)(_index2.default, props))));
|
|
669
684
|
}
|
|
670
685
|
}, {
|
|
671
686
|
key: "render",
|
|
@@ -676,9 +691,16 @@ var BankEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
676
691
|
return _ref3;
|
|
677
692
|
}
|
|
678
693
|
|
|
679
|
-
return (0, _emotion.jsx)(
|
|
694
|
+
return (0, _emotion.jsx)(_index6.default, null, this.renderNav(), (0, _emotion.jsx)("div", {
|
|
680
695
|
css: this.props.styles.content
|
|
681
|
-
}, this.
|
|
696
|
+
}, this.props.iceTopNavBarEnabled && (0, _emotion.jsx)("div", {
|
|
697
|
+
css: this.props.styles.breadcrumb
|
|
698
|
+
}, (0, _emotion.jsx)(_index.HeaderBreadCrumb, {
|
|
699
|
+
returnToUrl: this.props.returnToUrl,
|
|
700
|
+
scope: this.props.scope,
|
|
701
|
+
navigateToBanks: this.props.navigateToBanks,
|
|
702
|
+
navigateToBuild: this.props.navigateToBuild
|
|
703
|
+
}, this.renderBankBreadCrumbLink(), this.renderBankEntryBreadCrumbLink())), this.renderHeader(entry), this.renderEntry(entry), !this.props.isCompact && (0, _emotion.jsx)(_index4.default, {
|
|
682
704
|
parentId: this.props.bankId,
|
|
683
705
|
parentType: _quizCommon.PARENT_TYPE_BANK
|
|
684
706
|
})));
|
|
@@ -731,6 +753,7 @@ var BankEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
731
753
|
updateItem: _propTypes.default.func.isRequired,
|
|
732
754
|
updateStimulus: _propTypes.default.func.isRequired,
|
|
733
755
|
useBankTags: _propTypes.default.bool,
|
|
756
|
+
iceTopNavBarEnabled: _propTypes.default.bool,
|
|
734
757
|
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
735
758
|
styles: _propTypes.default.object
|
|
736
759
|
}, _class2.defaultProps = {
|
|
@@ -744,7 +767,8 @@ var BankEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
744
767
|
pendingDeletionTags: _immutable.default.List(),
|
|
745
768
|
tagAssociations: _immutable.default.List(),
|
|
746
769
|
tagInput: null,
|
|
747
|
-
useBankTags: false
|
|
770
|
+
useBankTags: false,
|
|
771
|
+
iceTopNavBarEnabled: false
|
|
748
772
|
}, _temp)) || _class);
|
|
749
773
|
exports.BankEntry = BankEntry;
|
|
750
774
|
var _default = BankEntry;
|
|
@@ -19,6 +19,9 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
19
19
|
padding: "".concat(componentTheme.contentPaddingTopBottom, " ").concat(componentTheme.contentPaddingLeftRight),
|
|
20
20
|
backgroundColor: componentTheme.contentBackgroundColor
|
|
21
21
|
},
|
|
22
|
+
breadcrumb: {
|
|
23
|
+
marginBottom: "".concat(componentTheme.breadCrumbMarginBottom)
|
|
24
|
+
},
|
|
22
25
|
entryRow: {
|
|
23
26
|
marginBottom: componentTheme.entryRowMargin
|
|
24
27
|
},
|
|
@@ -12,6 +12,9 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
12
12
|
borders = _ref.borders;
|
|
13
13
|
return {
|
|
14
14
|
contentBackgroundColor: colors.white,
|
|
15
|
+
contentPaddingTopBottom: 0,
|
|
16
|
+
contentPaddingLeftRight: 0,
|
|
17
|
+
breadCrumbMarginBottom: spacing.large,
|
|
15
18
|
entryRowMargin: spacing.small,
|
|
16
19
|
headerRowColor: colors.ash,
|
|
17
20
|
headerRowPadding: spacing.small,
|
|
@@ -51,17 +51,19 @@ var _debounce = _interopRequireDefault(require("lodash/fp/debounce"));
|
|
|
51
51
|
|
|
52
52
|
var _index = _interopRequireDefault(require("../../../common/components/layout/Page/index.js"));
|
|
53
53
|
|
|
54
|
-
var _index2 =
|
|
54
|
+
var _index2 = require("../HeaderBreadCrumb/index.js");
|
|
55
|
+
|
|
56
|
+
var _index3 = _interopRequireDefault(require("../../../common/components/shared/PaginatedCollection/index.js"));
|
|
55
57
|
|
|
56
58
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
57
59
|
|
|
58
60
|
var _quizCommon = require("@instructure/quiz-common");
|
|
59
61
|
|
|
60
|
-
var
|
|
62
|
+
var _index4 = _interopRequireDefault(require("../../../banks/components/BanksList/index.js"));
|
|
61
63
|
|
|
62
|
-
var
|
|
64
|
+
var _index5 = _interopRequireDefault(require("../../../banks/components/CreateBankModal/index.js"));
|
|
63
65
|
|
|
64
|
-
var
|
|
66
|
+
var _index6 = _interopRequireDefault(require("../NavWrapper/index.js"));
|
|
65
67
|
|
|
66
68
|
var _noResults = _interopRequireDefault(require("../noResults.svg"));
|
|
67
69
|
|
|
@@ -69,7 +71,7 @@ var _styles = _interopRequireDefault(require("./styles.js"));
|
|
|
69
71
|
|
|
70
72
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
71
73
|
|
|
72
|
-
var
|
|
74
|
+
var _index7 = _interopRequireDefault(require("../AsyncSearch/index.js"));
|
|
73
75
|
|
|
74
76
|
var _dec, _class, _class2, _temp;
|
|
75
77
|
|
|
@@ -220,7 +222,7 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
220
222
|
};
|
|
221
223
|
|
|
222
224
|
_this.renderRecords = function (recordIds) {
|
|
223
|
-
return (0, _emotion.jsx)(
|
|
225
|
+
return (0, _emotion.jsx)(_index4.default, {
|
|
224
226
|
createBankButton: _this.createBankButton,
|
|
225
227
|
currentUser: _this.props.currentUser,
|
|
226
228
|
focusCreateBankButton: _this.focusCreateBankButton,
|
|
@@ -354,7 +356,7 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
354
356
|
"data-automation": "sdk-search-bank-textinput"
|
|
355
357
|
})), this.props.subAccountBankSharingEnabled && (0, _emotion.jsx)(_uiGrid.Grid.Col, {
|
|
356
358
|
width: 4
|
|
357
|
-
}, (0, _emotion.jsx)(
|
|
359
|
+
}, (0, _emotion.jsx)(_index7.default, {
|
|
358
360
|
getShareableSubaccounts: this.props.getShareableSubaccounts,
|
|
359
361
|
improvedBankSharingEnabled: this.props.improvedBankSharingEnabled,
|
|
360
362
|
minChars: this.props.minChars,
|
|
@@ -417,7 +419,7 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
417
419
|
key: "renderHeader",
|
|
418
420
|
value: function renderHeader() {
|
|
419
421
|
return (0, _emotion.jsx)("div", {
|
|
420
|
-
css: [this.props.styles.
|
|
422
|
+
css: [this.props.styles.header, !this.props.improvedBankSharingEnabled ? this.props.styles.borderedBottom : {}]
|
|
421
423
|
}, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
422
424
|
as: this.props.isCompact ? 'h2' : 'h1',
|
|
423
425
|
level: "h1"
|
|
@@ -441,17 +443,20 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
441
443
|
navigateToBuild = _this$props.navigateToBuild,
|
|
442
444
|
returnToUrl = _this$props.returnToUrl;
|
|
443
445
|
var isScopeEmpty = !Object.keys(scope).length;
|
|
444
|
-
return (0, _emotion.jsx)(
|
|
446
|
+
return (0, _emotion.jsx)(_index6.default, {
|
|
445
447
|
closeTray: closeTray,
|
|
446
448
|
navigateToBuild: navigateToBuild,
|
|
447
449
|
returnToUrl: isScopeEmpty ? null : returnToUrl,
|
|
448
|
-
|
|
450
|
+
scope: scope,
|
|
451
|
+
isCompact: this.props.isCompact,
|
|
452
|
+
iceTopNavBarEnabled: this.props.iceTopNavBarEnabled,
|
|
453
|
+
menuItemPath: "/banks"
|
|
449
454
|
});
|
|
450
455
|
}
|
|
451
456
|
}, {
|
|
452
457
|
key: "renderBanksSearchResults",
|
|
453
458
|
value: function renderBanksSearchResults() {
|
|
454
|
-
return (0, _emotion.jsx)(
|
|
459
|
+
return (0, _emotion.jsx)(_index3.default, {
|
|
455
460
|
empty: this.emptyPage(),
|
|
456
461
|
getPage: this.getPage,
|
|
457
462
|
renderRecords: this.renderRecords,
|
|
@@ -463,7 +468,13 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
463
468
|
value: function render() {
|
|
464
469
|
return (0, _emotion.jsx)(_index.default, null, this.renderNav(), (0, _emotion.jsx)("div", {
|
|
465
470
|
css: this.props.styles.content
|
|
466
|
-
}, this.
|
|
471
|
+
}, this.props.iceTopNavBarEnabled && (0, _emotion.jsx)("div", {
|
|
472
|
+
css: this.props.styles.breadcrumb
|
|
473
|
+
}, (0, _emotion.jsx)(_index2.HeaderBreadCrumb, {
|
|
474
|
+
returnToUrl: this.props.returnToUrl,
|
|
475
|
+
scope: this.props.scope,
|
|
476
|
+
navigateToBuild: this.props.navigateToBuild
|
|
477
|
+
})), this.renderHeader(), this.props.improvedBankSharingEnabled && this.renderFilters(), this.renderBanksSearchResults(), (0, _emotion.jsx)(_index5.default, {
|
|
467
478
|
itemBanksScope: this.props.scope
|
|
468
479
|
})));
|
|
469
480
|
}
|
|
@@ -532,6 +543,7 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
532
543
|
itemBankSearchTableEnabled: _propTypes.default.bool,
|
|
533
544
|
setUI: _propTypes.default.func.isRequired,
|
|
534
545
|
subAccountBankSharingEnabled: _propTypes.default.bool,
|
|
546
|
+
iceTopNavBarEnabled: _propTypes.default.bool,
|
|
535
547
|
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
536
548
|
styles: _propTypes.default.object
|
|
537
549
|
}, _class2.defaultProps = {
|
|
@@ -559,7 +571,8 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
559
571
|
newItemBankFilterNamesEnabled: false,
|
|
560
572
|
usedByCourseEnabled: false,
|
|
561
573
|
itemBankSearchTableEnabled: false,
|
|
562
|
-
subAccountBankSharingEnabled: false
|
|
574
|
+
subAccountBankSharingEnabled: false,
|
|
575
|
+
iceTopNavBarEnabled: false
|
|
563
576
|
}, _class2.contextTypes = {
|
|
564
577
|
locale: _propTypes.default.string
|
|
565
578
|
}, _temp)) || _class);
|
|
@@ -11,11 +11,14 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
11
11
|
padding: "".concat(componentTheme.contentPaddingTopBottom, " ").concat(componentTheme.contentPaddingLeftRight),
|
|
12
12
|
backgroundColor: componentTheme.contentBackgroundColor
|
|
13
13
|
},
|
|
14
|
+
breadcrumb: {
|
|
15
|
+
marginBottom: "".concat(componentTheme.breadCrumbMarginBottom)
|
|
16
|
+
},
|
|
14
17
|
header: {
|
|
15
18
|
display: 'flex',
|
|
16
19
|
flexDirection: 'row',
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
justifyContent: 'space-between',
|
|
21
|
+
paddingBottom: "".concat(componentTheme.headerPaddingBottom)
|
|
19
22
|
},
|
|
20
23
|
borderedBottom: {
|
|
21
24
|
borderBottom: "".concat(componentTheme.headerBorderWidth, " solid ").concat(componentTheme.headerBorderColor)
|
|
@@ -24,7 +27,6 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
24
27
|
paddingBottom: '2rem'
|
|
25
28
|
},
|
|
26
29
|
filtersRow: {
|
|
27
|
-
marginTop: '1.5rem',
|
|
28
30
|
display: 'flex',
|
|
29
31
|
flexDirection: 'row'
|
|
30
32
|
}
|
|
@@ -11,9 +11,10 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
11
11
|
borders = _ref.borders;
|
|
12
12
|
return {
|
|
13
13
|
contentBackgroundColor: colors.white,
|
|
14
|
-
contentPaddingTopBottom: spacing.
|
|
14
|
+
contentPaddingTopBottom: spacing.medium,
|
|
15
15
|
contentPaddingLeftRight: spacing.xLarge,
|
|
16
|
-
|
|
16
|
+
breadCrumbMarginBottom: spacing.large,
|
|
17
|
+
headerPaddingBottom: spacing.large,
|
|
17
18
|
headerBorderWidth: borders.widthSmall,
|
|
18
19
|
headerBorderColor: colors.tiara
|
|
19
20
|
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = exports.HeaderBreadCrumb = void 0;
|
|
11
|
+
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
+
|
|
16
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
+
|
|
18
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
|
+
|
|
20
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
+
|
|
22
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
|
+
|
|
24
|
+
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
25
|
+
|
|
26
|
+
var _uiBreadcrumb = require("@instructure/ui-breadcrumb");
|
|
27
|
+
|
|
28
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
29
|
+
|
|
30
|
+
var HeaderBreadCrumb = /*#__PURE__*/function (_Component) {
|
|
31
|
+
(0, _inherits2.default)(HeaderBreadCrumb, _Component);
|
|
32
|
+
|
|
33
|
+
var _super = (0, _createSuper2.default)(HeaderBreadCrumb);
|
|
34
|
+
|
|
35
|
+
function HeaderBreadCrumb() {
|
|
36
|
+
var _this;
|
|
37
|
+
|
|
38
|
+
(0, _classCallCheck2.default)(this, HeaderBreadCrumb);
|
|
39
|
+
|
|
40
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
41
|
+
args[_key] = arguments[_key];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
45
|
+
|
|
46
|
+
_this.setItemBanksRef = function (node) {
|
|
47
|
+
_this.itemBanksRef = node;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return _this;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
(0, _createClass2.default)(HeaderBreadCrumb, [{
|
|
54
|
+
key: "componentDidMount",
|
|
55
|
+
value: function componentDidMount() {
|
|
56
|
+
if (this.props.navigateToBuild && this.props.navigateToBanks && this.itemBanksRef) {
|
|
57
|
+
_reactDom.default.findDOMNode(this.itemBanksRef).focus();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "render",
|
|
62
|
+
value: function render() {
|
|
63
|
+
var _this$props = this.props,
|
|
64
|
+
returnToUrl = _this$props.returnToUrl,
|
|
65
|
+
scope = _this$props.scope,
|
|
66
|
+
navigateToBanks = _this$props.navigateToBanks,
|
|
67
|
+
renderIcon = _this$props.renderIcon,
|
|
68
|
+
setItemBanksRef = _this$props.setItemBanksRef,
|
|
69
|
+
children = _this$props.children;
|
|
70
|
+
var isScopeEmpty = !Object.keys(scope).length;
|
|
71
|
+
var canvasReferrerLinkText = isScopeEmpty ? null : scope.title;
|
|
72
|
+
|
|
73
|
+
var canvasReferrerLink = returnToUrl && canvasReferrerLinkText && /*#__PURE__*/_react.default.createElement(_uiBreadcrumb.BreadcrumbLink, {
|
|
74
|
+
key: "Context",
|
|
75
|
+
href: returnToUrl,
|
|
76
|
+
target: "_top"
|
|
77
|
+
}, canvasReferrerLinkText);
|
|
78
|
+
|
|
79
|
+
var banksLink = /*#__PURE__*/_react.default.createElement(_uiBreadcrumb.BreadcrumbLink, {
|
|
80
|
+
key: "Banks",
|
|
81
|
+
onClick: navigateToBanks,
|
|
82
|
+
renderIcon: renderIcon,
|
|
83
|
+
ref: setItemBanksRef || this.setItemBanksRef
|
|
84
|
+
}, (0, _formatMessage.default)('Item Banks')); // If Breadcrumb has multiple children (even if 2nd is null), it will
|
|
85
|
+
// render the `>` icon, which we don't want if there are no children.
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
var breadCrumbLinks = [banksLink];
|
|
89
|
+
|
|
90
|
+
if (children) {
|
|
91
|
+
breadCrumbLinks = breadCrumbLinks.concat(children);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (canvasReferrerLink) breadCrumbLinks.unshift(canvasReferrerLink);
|
|
95
|
+
return /*#__PURE__*/_react.default.createElement(_uiBreadcrumb.Breadcrumb, {
|
|
96
|
+
label: (0, _formatMessage.default)('You are here:'),
|
|
97
|
+
size: this.props.isCompact ? 'small' : 'medium'
|
|
98
|
+
}, breadCrumbLinks);
|
|
99
|
+
}
|
|
100
|
+
}]);
|
|
101
|
+
HeaderBreadCrumb.displayName = "HeaderBreadCrumb";
|
|
102
|
+
return HeaderBreadCrumb;
|
|
103
|
+
}(_react.Component);
|
|
104
|
+
|
|
105
|
+
exports.HeaderBreadCrumb = HeaderBreadCrumb;
|
|
106
|
+
HeaderBreadCrumb.propTypes = {
|
|
107
|
+
returnToUrl: _propTypes.default.string,
|
|
108
|
+
scope: _propTypes.default.objectOf(_propTypes.default.shape({
|
|
109
|
+
type: _propTypes.default.string,
|
|
110
|
+
uuid: _propTypes.default.string,
|
|
111
|
+
title: _propTypes.default.string
|
|
112
|
+
})),
|
|
113
|
+
navigateToBuild: _propTypes.default.func,
|
|
114
|
+
navigateToBanks: _propTypes.default.func,
|
|
115
|
+
isCompact: _propTypes.default.bool,
|
|
116
|
+
setItemBanksRef: _propTypes.default.func,
|
|
117
|
+
renderIcon: _propTypes.default.node,
|
|
118
|
+
children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node])
|
|
119
|
+
};
|
|
120
|
+
HeaderBreadCrumb.defaultProps = {
|
|
121
|
+
returnToUrl: null,
|
|
122
|
+
scope: {},
|
|
123
|
+
navigateToBuild: null,
|
|
124
|
+
navigateToBanks: null,
|
|
125
|
+
isCompact: false,
|
|
126
|
+
setItemBanksRef: null,
|
|
127
|
+
renderIcon: null,
|
|
128
|
+
children: null
|
|
129
|
+
};
|
|
130
|
+
var _default = HeaderBreadCrumb;
|
|
131
|
+
exports.default = _default;
|