@instructure/quiz-core 20.1.0 → 20.1.1-rc.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/BankEntry/presenter.js +43 -56
- package/es/banks/components/BankEntry/styles.js +65 -0
- package/es/banks/components/BankEntry/theme.js +4 -2
- package/es/banks/components/BankEntryRow/presenter.js +55 -65
- package/es/banks/components/BankEntryRow/styles.js +50 -0
- package/es/banks/components/BankEntryRow/theme.js +4 -2
- package/es/banks/components/BankSearch/presenter.js +29 -34
- package/es/banks/components/BankSearch/styles.js +17 -0
- package/es/banks/components/BankSearch/theme.js +5 -5
- package/es/banks/components/Banks/presenter.js +46 -57
- package/es/banks/components/Banks/styles.js +32 -0
- package/es/banks/components/Banks/theme.js +4 -2
- package/es/banks/components/BanksList/presenter.js +80 -90
- package/es/banks/components/BanksList/styles.js +45 -0
- package/es/banks/components/BanksList/theme.js +4 -2
- package/lib/banks/components/BankEntry/presenter.js +41 -57
- package/lib/banks/components/BankEntry/styles.js +75 -0
- package/lib/banks/components/BankEntry/theme.js +6 -3
- package/lib/banks/components/BankEntryRow/presenter.js +54 -69
- package/lib/banks/components/BankEntryRow/styles.js +58 -0
- package/lib/banks/components/BankEntryRow/theme.js +6 -3
- package/lib/banks/components/BankSearch/presenter.js +28 -37
- package/lib/banks/components/BankSearch/styles.js +25 -0
- package/lib/banks/components/BankSearch/theme.js +7 -6
- package/lib/banks/components/Banks/presenter.js +45 -61
- package/lib/banks/components/Banks/styles.js +40 -0
- package/lib/banks/components/Banks/theme.js +6 -3
- package/lib/banks/components/BanksList/presenter.js +73 -88
- package/lib/banks/components/BanksList/styles.js +53 -0
- package/lib/banks/components/BanksList/theme.js +6 -3
- package/package.json +10 -10
|
@@ -7,7 +7,8 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
7
7
|
|
|
8
8
|
var _dec, _class, _class2, _temp;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/** @jsx jsx */
|
|
11
|
+
import { Component } from 'react';
|
|
11
12
|
import ReactDOM from 'react-dom';
|
|
12
13
|
import PropTypes from 'prop-types';
|
|
13
14
|
import Immutable from 'immutable';
|
|
@@ -25,7 +26,7 @@ import { Heading } from '@instructure/ui-heading';
|
|
|
25
26
|
import { IconDiscussionLine, IconDiscussionSolid } from '@instructure/ui-icons';
|
|
26
27
|
import { PresentationContent, ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
27
28
|
import { TextInput } from '@instructure/ui-text-input';
|
|
28
|
-
import {
|
|
29
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
29
30
|
import EntrySave from "../../../common/components/resources/entry/EntrySave/index.js";
|
|
30
31
|
import ItemEdit from "../../../common/components/resources/item/ItemEdit/index.js";
|
|
31
32
|
import ItemFeedbackModal from "../../../building/components/resources/ItemFeedbackModal/index.js";
|
|
@@ -42,28 +43,12 @@ import { createStimulus } from "../../../building/api/stimuli.js";
|
|
|
42
43
|
import { propsForItemVersioningWrapper, propsForStimulusVersioningWrapper } from "../../../common/util/warningHelpers.js";
|
|
43
44
|
import NavWrapper from "../NavWrapper/index.js";
|
|
44
45
|
import { API_INPUT_VALIDATION_ERROR, CLEAR_ALL_INPUT_VALIDATION_ERRORS, ITEM_FEEDBACK_MODAL, ITEM_FEEDBACK_MODAL_ITEM, ITEM_FEEDBACK_MODAL_FEEDBACK, PARENT_TYPE_BANK } from '@instructure/quiz-common';
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
'entryRow': 'dhhIK_blfJ',
|
|
52
|
-
'headerRow': 'dhhIK_dlpV',
|
|
53
|
-
'leftHeader': 'dhhIK_cKlw',
|
|
54
|
-
'headerText': 'dhhIK_fAhB',
|
|
55
|
-
'header': 'dhhIK_fsuY',
|
|
56
|
-
'rightHeader': 'dhhIK_IoDT',
|
|
57
|
-
'footer': 'dhhIK_cjWK',
|
|
58
|
-
'leftFooter': 'dhhIK_bVuu',
|
|
59
|
-
'rightFooter': 'dhhIK_ekxs',
|
|
60
|
-
'entryEdit': 'dhhIK_eNDu'
|
|
61
|
-
};
|
|
62
|
-
import theme from "./theme.js";
|
|
63
|
-
|
|
64
|
-
var _ref3 = /*#__PURE__*/React.createElement(Spinner, null);
|
|
65
|
-
|
|
66
|
-
export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
46
|
+
import generateStyle from "./styles.js";
|
|
47
|
+
import generateComponentTheme from "./theme.js";
|
|
48
|
+
|
|
49
|
+
var _ref3 = jsx(Spinner, null);
|
|
50
|
+
|
|
51
|
+
export var BankEntry = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
67
52
|
_inherits(BankEntry, _Component);
|
|
68
53
|
|
|
69
54
|
var _super = _createSuper(BankEntry);
|
|
@@ -310,17 +295,17 @@ export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
310
295
|
returnToUrl = _this$props.returnToUrl,
|
|
311
296
|
bank = _this$props.bank;
|
|
312
297
|
var isScopeEmpty = !Object.keys(scope).length;
|
|
313
|
-
return
|
|
298
|
+
return jsx(NavWrapper, {
|
|
314
299
|
closeTray: closeTray,
|
|
315
300
|
navigateToBanks: navigateToBanks,
|
|
316
301
|
navigateToBuild: navigateToBuild,
|
|
317
302
|
returnToUrl: isScopeEmpty ? null : returnToUrl,
|
|
318
303
|
canvasReferrerLinkText: isScopeEmpty ? null : scope.title
|
|
319
|
-
},
|
|
304
|
+
}, jsx(BreadcrumbLink, {
|
|
320
305
|
key: "bank",
|
|
321
306
|
onClick: this.navigateToBank,
|
|
322
307
|
ref: this.setNavToBankRef
|
|
323
|
-
}, bank.title),
|
|
308
|
+
}, bank.title), jsx(BreadcrumbLink, {
|
|
324
309
|
key: "bankEntry"
|
|
325
310
|
}, this.entryLinkName()));
|
|
326
311
|
}
|
|
@@ -328,8 +313,8 @@ export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
328
313
|
key: "renderTitle",
|
|
329
314
|
value: function renderTitle(entry) {
|
|
330
315
|
if (this.isItemEntry()) {
|
|
331
|
-
return
|
|
332
|
-
renderLabel:
|
|
316
|
+
return jsx(TextInput, {
|
|
317
|
+
renderLabel: jsx(ScreenReaderContent, null, t('Edit question title')),
|
|
333
318
|
type: "text",
|
|
334
319
|
placeholder: t('Question Title'),
|
|
335
320
|
onChange: this.handleTitleChange,
|
|
@@ -351,18 +336,18 @@ export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
351
336
|
var itemIdentifier = this.isTemporary() ? tempIdentifier : identifier;
|
|
352
337
|
var entryName = this.isItemEntry() ? entry.getInteractionType().name : t('Stimulus');
|
|
353
338
|
var separator = ' | ';
|
|
354
|
-
return
|
|
355
|
-
|
|
356
|
-
},
|
|
357
|
-
|
|
358
|
-
},
|
|
359
|
-
|
|
360
|
-
},
|
|
339
|
+
return jsx("div", {
|
|
340
|
+
css: this.props.styles.header
|
|
341
|
+
}, jsx("div", {
|
|
342
|
+
css: this.props.styles.leftHeader
|
|
343
|
+
}, jsx("div", {
|
|
344
|
+
css: this.props.styles.headerText
|
|
345
|
+
}, jsx(Heading, {
|
|
361
346
|
level: "reset",
|
|
362
347
|
as: "h2"
|
|
363
|
-
}, entryName,
|
|
364
|
-
|
|
365
|
-
},
|
|
348
|
+
}, entryName, jsx(PresentationContent, null, separator), itemIdentifier))), this.renderTitle(entry), jsx("div", {
|
|
349
|
+
css: this.props.styles.rightHeader
|
|
350
|
+
}, jsx(EntrySave, props)));
|
|
366
351
|
}
|
|
367
352
|
}, {
|
|
368
353
|
key: "hasPendingTagModifications",
|
|
@@ -544,7 +529,7 @@ export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
544
529
|
text = t('Edit Question Level Feedback');
|
|
545
530
|
}
|
|
546
531
|
|
|
547
|
-
return
|
|
532
|
+
return jsx(IconButton, {
|
|
548
533
|
onClick: this.openFeedbackModal,
|
|
549
534
|
withBackground: false,
|
|
550
535
|
withBorder: false,
|
|
@@ -607,7 +592,7 @@ export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
607
592
|
var entryId = this.getBankEntryId(bankEntry);
|
|
608
593
|
|
|
609
594
|
var tags = function tags() {
|
|
610
|
-
return
|
|
595
|
+
return jsx(TagSuggestSelect, {
|
|
611
596
|
allowNewTags: true,
|
|
612
597
|
noMatchText: t('Enter a tag to find or create'),
|
|
613
598
|
parentType: entryType,
|
|
@@ -618,20 +603,20 @@ export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
618
603
|
};
|
|
619
604
|
|
|
620
605
|
var editWarning = this.isItemEntry() ? t('Edits made here will appear on any assessment using this question.') : t('Edits made here will appear on any assessment using this stimulus.');
|
|
621
|
-
return
|
|
622
|
-
|
|
623
|
-
},
|
|
606
|
+
return jsx("div", null, jsx("div", {
|
|
607
|
+
css: this.props.styles.entryEdit
|
|
608
|
+
}, jsx(WarningWrapper, versioningProps, canEdit && jsx(Alert, {
|
|
624
609
|
renderCloseButtonLabel: t('Dismiss'),
|
|
625
610
|
margin: "0 0 medium 0"
|
|
626
|
-
},
|
|
611
|
+
}, jsx(Text, {
|
|
627
612
|
color: "primary"
|
|
628
|
-
}, editWarning)),
|
|
629
|
-
|
|
630
|
-
},
|
|
631
|
-
|
|
632
|
-
}, this.renderFeedbackSection()),
|
|
633
|
-
|
|
634
|
-
},
|
|
613
|
+
}, editWarning)), jsx(EntryComponent, props), useBankTags && tags())), jsx("div", {
|
|
614
|
+
css: this.props.styles.footer
|
|
615
|
+
}, jsx("div", {
|
|
616
|
+
css: this.props.styles.leftFooter
|
|
617
|
+
}, this.renderFeedbackSection()), jsx("div", {
|
|
618
|
+
css: this.props.styles.rightFooter
|
|
619
|
+
}, jsx(EntrySave, props))));
|
|
635
620
|
}
|
|
636
621
|
}, {
|
|
637
622
|
key: "render",
|
|
@@ -642,9 +627,9 @@ export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
642
627
|
return _ref3;
|
|
643
628
|
}
|
|
644
629
|
|
|
645
|
-
return
|
|
646
|
-
|
|
647
|
-
}, this.renderHeader(entry), this.renderEntry(entry), !this.props.isCompact &&
|
|
630
|
+
return jsx(Page, null, this.renderNav(), jsx("div", {
|
|
631
|
+
css: this.props.styles.content
|
|
632
|
+
}, this.renderHeader(entry), this.renderEntry(entry), !this.props.isCompact && jsx(ItemFeedbackModal, {
|
|
648
633
|
parentId: this.props.bankId,
|
|
649
634
|
parentType: PARENT_TYPE_BANK
|
|
650
635
|
})));
|
|
@@ -697,7 +682,9 @@ export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
697
682
|
tagInput: PropTypes.string,
|
|
698
683
|
updateItem: PropTypes.func.isRequired,
|
|
699
684
|
updateStimulus: PropTypes.func.isRequired,
|
|
700
|
-
useBankTags: PropTypes.bool
|
|
685
|
+
useBankTags: PropTypes.bool,
|
|
686
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
687
|
+
styles: PropTypes.object
|
|
701
688
|
}, _class2.defaultProps = {
|
|
702
689
|
closeTray: function closeTray() {},
|
|
703
690
|
entry: null,
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
|
|
3
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
4
|
+
var footerStyles = {
|
|
5
|
+
display: 'flex',
|
|
6
|
+
flexDirection: 'row'
|
|
7
|
+
};
|
|
8
|
+
return {
|
|
9
|
+
content: {
|
|
10
|
+
padding: "".concat(componentTheme.contentPaddingTopBottom, " ").concat(componentTheme.contentPaddingLeftRight),
|
|
11
|
+
backgroundColor: componentTheme.contentBackgroundColor
|
|
12
|
+
},
|
|
13
|
+
entryRow: {
|
|
14
|
+
marginBottom: componentTheme.entryRowMargin
|
|
15
|
+
},
|
|
16
|
+
headerRow: {
|
|
17
|
+
display: 'flex',
|
|
18
|
+
flexDirection: 'row',
|
|
19
|
+
justifyContent: 'space-between',
|
|
20
|
+
alignItems: 'flex-start',
|
|
21
|
+
color: componentTheme.headerRowColor,
|
|
22
|
+
padding: componentTheme.headerRowPadding
|
|
23
|
+
},
|
|
24
|
+
leftHeader: {
|
|
25
|
+
flex: '0 0 auto',
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexDirection: 'column',
|
|
28
|
+
alignItems: 'flex-start',
|
|
29
|
+
marginRight: componentTheme.leftHeaderMargin
|
|
30
|
+
},
|
|
31
|
+
headerText: {
|
|
32
|
+
fontSize: componentTheme.headerTextFontSize
|
|
33
|
+
},
|
|
34
|
+
header: {
|
|
35
|
+
backgroundColor: componentTheme.headerBackgroundColor,
|
|
36
|
+
color: componentTheme.headerColor,
|
|
37
|
+
padding: "".concat(componentTheme.headerPaddingTopBottom, " ").concat(componentTheme.headerPaddingLeftRight),
|
|
38
|
+
display: 'flex',
|
|
39
|
+
justifyContent: 'space-between',
|
|
40
|
+
verticalAlign: 'middle',
|
|
41
|
+
alignItems: 'center'
|
|
42
|
+
},
|
|
43
|
+
rightHeader: {
|
|
44
|
+
textAlign: 'right',
|
|
45
|
+
paddingLeft: componentTheme.rightHeaderPaddingLeft
|
|
46
|
+
},
|
|
47
|
+
footer: _objectSpread(_objectSpread({}, footerStyles), {}, {
|
|
48
|
+
textAlign: 'left',
|
|
49
|
+
paddingBottom: componentTheme.footerPaddingBottom,
|
|
50
|
+
paddingTop: componentTheme.footerPaddingTop
|
|
51
|
+
}),
|
|
52
|
+
leftFooter: footerStyles,
|
|
53
|
+
rightFooter: _objectSpread(_objectSpread({}, footerStyles), {}, {
|
|
54
|
+
flex: '8 0 0',
|
|
55
|
+
justifyContent: 'flex-end',
|
|
56
|
+
paddingLeft: componentTheme.rightFooterPaddingLeftRight,
|
|
57
|
+
paddingRight: componentTheme.rightFooterPaddingLeftRight
|
|
58
|
+
}),
|
|
59
|
+
entryEdit: {
|
|
60
|
+
borderBottom: "".concat(componentTheme.entryEditBorderWidth, " solid ").concat(componentTheme.entryEditBorderColor)
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
colors = _ref.colors,
|
|
4
4
|
typography = _ref.typography,
|
|
@@ -21,4 +21,6 @@ export default function generator(_ref) {
|
|
|
21
21
|
entryEditBorderWidth: borders.widthSmall,
|
|
22
22
|
entryEditBorderColor: colors.tiara
|
|
23
23
|
};
|
|
24
|
-
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default generateComponentTheme;
|
|
@@ -5,10 +5,12 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
|
|
10
|
+
/* eslint-disable-next-line no-unused-vars */
|
|
8
11
|
import React, { Component } from 'react';
|
|
9
12
|
import PropTypes from 'prop-types';
|
|
10
13
|
import partial from 'lodash/partial';
|
|
11
|
-
import classNames from 'classnames';
|
|
12
14
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
13
15
|
import Immutable from 'immutable';
|
|
14
16
|
import { IconEditLine, IconPlusLine, IconCopyLine, IconTrashLine } from '@instructure/ui-icons';
|
|
@@ -18,9 +20,9 @@ import { List } from '@instructure/ui-list';
|
|
|
18
20
|
import { Heading } from '@instructure/ui-heading';
|
|
19
21
|
import { PresentationContent } from '@instructure/ui-a11y-content';
|
|
20
22
|
import { Alert } from '@instructure/ui-alerts';
|
|
21
|
-
import {
|
|
22
|
-
import { RichContentRenderer } from '@instructure/quiz-rce';
|
|
23
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
23
24
|
import { BUILD_TRAY_POSITION, COPY_MOVE_BANK_ENTRY_MODAL, SET_EDIT_BUTTON_FOCUS, withI18nSupport } from '@instructure/quiz-common';
|
|
25
|
+
import { RichContentRendererEmotion } from '@instructure/quiz-rce';
|
|
24
26
|
import { extractTextFromHtml } from '@instructure/quiz-interactions';
|
|
25
27
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
26
28
|
import CopyMoveBankEntryModal from "../CopyMoveBankEntryModal/index.js";
|
|
@@ -30,27 +32,12 @@ import Overlay from "../../../common/components/shared/overlay/Overlay.js";
|
|
|
30
32
|
import ItemShow from "../../../common/components/resources/item/ItemShow/index.js";
|
|
31
33
|
import StimulusShowInfo from "../../../common/components/resources/stimulus/StimulusShowInfo/index.js";
|
|
32
34
|
import TagDisplay from "../../../common/components/shared/TagDisplay/index.js";
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
template: function template(theme) {
|
|
36
|
-
return "\n\n.eQXFj_IXXK{padding:".concat(theme.entryDetailPadding || 'inherit', "}\n\n.eQXFj_dlpV{align-items:flex-start;color:").concat(theme.headerRowColor || 'inherit', ";display:flex;flex-direction:row;justify-content:space-between}\n\n.eQXFj_exDh{display:inline-flex;position:relative;z-index:").concat(theme.buttonsZIndex || 'inherit', "}\n\n.eQXFj_bTHH{border-left:").concat(theme.expandButtonContainerBorderWidth || 'inherit', " solid ").concat(theme.expandButtonContainerBorderColor || 'inherit', "}\n\n.eQXFj_AHIw{display:block}\n\n.eQXFj_eTBd{margin-bottom:").concat(theme.deletePrefaceMargin || 'inherit', "}\n\n.eQXFj_ftIe{margin-bottom:").concat(theme.addButtonMargin || 'inherit', "}\n\n.eQXFj_fAhB{color:").concat(theme.headerTextColor || 'inherit', ";font-size:").concat(theme.headerTextFontSize || 'inherit', "}\n\n.eQXFj_cloC{font-size:").concat(theme.stemFontSize || 'inherit', ";line-height:").concat(theme.stemLineHeight || 'inherit', ";overflow-x:auto}\n\n.eQXFj_cloC p{margin:0}\n\n.eQXFj_cjWK{border-top:").concat(theme.footerBorderWidth || 'inherit', " solid ").concat(theme.footerBorderColor || 'inherit', ";font-size:").concat(theme.footerFontSize || 'inherit', ";padding:").concat(theme.footerPadding || 'inherit', "}");
|
|
37
|
-
},
|
|
38
|
-
'entryDetail': 'eQXFj_IXXK',
|
|
39
|
-
'headerRow': 'eQXFj_dlpV',
|
|
40
|
-
'buttons': 'eQXFj_exDh',
|
|
41
|
-
'expandButtonContainer': 'eQXFj_bTHH',
|
|
42
|
-
'deleteAlert': 'eQXFj_AHIw',
|
|
43
|
-
'deletePreface': 'eQXFj_eTBd',
|
|
44
|
-
'addButton': 'eQXFj_ftIe',
|
|
45
|
-
'headerText': 'eQXFj_fAhB',
|
|
46
|
-
'stem': 'eQXFj_cloC',
|
|
47
|
-
'footer': 'eQXFj_cjWK'
|
|
48
|
-
};
|
|
49
|
-
import theme from "./theme.js";
|
|
35
|
+
import generateStyle from "./styles.js";
|
|
36
|
+
import generateComponentTheme from "./theme.js";
|
|
50
37
|
|
|
51
|
-
var _ref2 =
|
|
38
|
+
var _ref2 = jsx("div", null);
|
|
52
39
|
|
|
53
|
-
export var BankEntryRow = (_dec =
|
|
40
|
+
export var BankEntryRow = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_withI18nSupport) {
|
|
54
41
|
_inherits(BankEntryRow, _withI18nSupport);
|
|
55
42
|
|
|
56
43
|
var _super = _createSuper(BankEntryRow);
|
|
@@ -72,20 +59,20 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
72
59
|
|
|
73
60
|
_this.deleteBankEntry = function () {
|
|
74
61
|
var deletePreface = _this.isItemEntry() ? t('Deleting this question:') : t('Deleting this stimulus:');
|
|
75
|
-
var confirmBody =
|
|
62
|
+
var confirmBody = jsx(Alert, {
|
|
76
63
|
variant: "error",
|
|
77
64
|
padding: "0"
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
}, deletePreface),
|
|
65
|
+
}, jsx("div", {
|
|
66
|
+
css: _this.props.styles.deleteAlert
|
|
67
|
+
}, jsx("div", {
|
|
68
|
+
css: _this.props.styles.deletePreface
|
|
69
|
+
}, deletePreface), jsx(List, null, jsx(List.Item, null, t.rich('will <0>NOT</0> remove it from any assessments', [function (_ref) {
|
|
83
70
|
var children = _ref.children;
|
|
84
|
-
return
|
|
71
|
+
return jsx(Text, {
|
|
85
72
|
weight: "bold",
|
|
86
73
|
key: "0"
|
|
87
74
|
}, children);
|
|
88
|
-
}])),
|
|
75
|
+
}])), jsx(List.Item, null, t('will lose its statistical link in reporting')), jsx(List.Item, null, t('will remove access for all users with whom this bank has been shared')))));
|
|
89
76
|
|
|
90
77
|
_this.props.withConfirm(partial(_this.props.removeBankEntry, _this.props.bank.id, _this.props.bankEntry.id), {
|
|
91
78
|
title: t('Delete {type}', {
|
|
@@ -138,7 +125,7 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
138
125
|
var title = t('Delete {type}', {
|
|
139
126
|
type: _this.type()
|
|
140
127
|
});
|
|
141
|
-
return
|
|
128
|
+
return jsx(IconButton, {
|
|
142
129
|
size: "medium",
|
|
143
130
|
withBackground: false,
|
|
144
131
|
withBorder: false,
|
|
@@ -207,12 +194,13 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
207
194
|
}) : t('Expand {type} details', {
|
|
208
195
|
type: type
|
|
209
196
|
});
|
|
210
|
-
return
|
|
211
|
-
|
|
212
|
-
},
|
|
197
|
+
return jsx("div", {
|
|
198
|
+
css: this.props.styles.expandButtonContainer
|
|
199
|
+
}, jsx(ExpandButton, {
|
|
213
200
|
onClick: this.props.toggleExpanded,
|
|
214
201
|
title: title,
|
|
215
|
-
isExpanded: this.props.isExpanded
|
|
202
|
+
isExpanded: this.props.isExpanded,
|
|
203
|
+
"data-automation": "expand-bank-question-button"
|
|
216
204
|
}));
|
|
217
205
|
}
|
|
218
206
|
}, {
|
|
@@ -222,9 +210,9 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
222
210
|
var title = t('Add {type} to this quiz', {
|
|
223
211
|
type: this.type()
|
|
224
212
|
});
|
|
225
|
-
return
|
|
226
|
-
|
|
227
|
-
},
|
|
213
|
+
return jsx("div", {
|
|
214
|
+
css: [this.props.styles.buttons, this.props.styles.addButton]
|
|
215
|
+
}, jsx(IconButton, {
|
|
228
216
|
color: "primary",
|
|
229
217
|
shape: "circle",
|
|
230
218
|
size: "small",
|
|
@@ -244,7 +232,7 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
244
232
|
key: "renderMoveButton",
|
|
245
233
|
value: function renderMoveButton() {
|
|
246
234
|
var title = this.moveModalTitle();
|
|
247
|
-
return
|
|
235
|
+
return jsx(IconButton, {
|
|
248
236
|
ref: this.storeCopyMoveBankEntryButtonRef,
|
|
249
237
|
size: "medium",
|
|
250
238
|
withBackground: false,
|
|
@@ -265,16 +253,16 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
265
253
|
key: "renderHeader",
|
|
266
254
|
value: function renderHeader() {
|
|
267
255
|
var separator = ' | ';
|
|
268
|
-
return
|
|
269
|
-
|
|
270
|
-
}, this.renderAddButton(),
|
|
271
|
-
|
|
272
|
-
}, this.props.bank.canEdit() &&
|
|
273
|
-
|
|
274
|
-
},
|
|
256
|
+
return jsx("div", null, jsx("div", {
|
|
257
|
+
css: this.props.styles.headerRow
|
|
258
|
+
}, this.renderAddButton(), jsx("div", {
|
|
259
|
+
css: this.props.styles.buttons
|
|
260
|
+
}, this.props.bank.canEdit() && jsx(React.Fragment, null, this.renderEditButton(), this.renderMoveButton(), this.renderTrashButton()), this.renderExpandButton())), jsx("div", {
|
|
261
|
+
css: this.props.styles.headerText
|
|
262
|
+
}, jsx(Heading, {
|
|
275
263
|
level: "reset",
|
|
276
264
|
as: "h2"
|
|
277
|
-
}, this.entryHeader(),
|
|
265
|
+
}, this.entryHeader(), jsx(PresentationContent, null, separator), this.entryIdentifier())));
|
|
278
266
|
}
|
|
279
267
|
}, {
|
|
280
268
|
key: "renderEntryCollapsed",
|
|
@@ -283,13 +271,13 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
283
271
|
// or title plain text
|
|
284
272
|
|
|
285
273
|
if (itemOrStimulus.itemBody) {
|
|
286
|
-
return
|
|
287
|
-
customStyles: styles.stem,
|
|
274
|
+
return jsx(RichContentRendererEmotion, {
|
|
275
|
+
customStyles: this.props.styles.stem,
|
|
288
276
|
content: itemOrStimulus.itemBody
|
|
289
277
|
});
|
|
290
278
|
} else {
|
|
291
|
-
return
|
|
292
|
-
|
|
279
|
+
return jsx("div", {
|
|
280
|
+
css: this.props.styles.stem
|
|
293
281
|
}, itemOrStimulus.title);
|
|
294
282
|
}
|
|
295
283
|
}
|
|
@@ -299,12 +287,12 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
299
287
|
var entry = this.getEntry();
|
|
300
288
|
|
|
301
289
|
if (this.isItemEntry()) {
|
|
302
|
-
return
|
|
290
|
+
return jsx(ItemShow, {
|
|
303
291
|
entry: entry,
|
|
304
292
|
guid: this.props.bankEntry.id
|
|
305
293
|
});
|
|
306
294
|
} else {
|
|
307
|
-
return
|
|
295
|
+
return jsx(StimulusShowInfo, {
|
|
308
296
|
stimulus: entry
|
|
309
297
|
});
|
|
310
298
|
}
|
|
@@ -315,7 +303,7 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
315
303
|
var title = t('Edit {type}', {
|
|
316
304
|
type: this.type()
|
|
317
305
|
});
|
|
318
|
-
return
|
|
306
|
+
return jsx(IconButton, {
|
|
319
307
|
ref: this.storeEditButtonRef,
|
|
320
308
|
size: "medium",
|
|
321
309
|
withBackground: false,
|
|
@@ -334,7 +322,7 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
334
322
|
return null;
|
|
335
323
|
}
|
|
336
324
|
|
|
337
|
-
return
|
|
325
|
+
return jsx(TagDisplay, {
|
|
338
326
|
tagAssociations: this.props.tagAssociations
|
|
339
327
|
});
|
|
340
328
|
}
|
|
@@ -344,7 +332,7 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
344
332
|
var lastUpdate = t.rich('<0>Last Update</0> { updatedAt }', {
|
|
345
333
|
0: function _(_ref3) {
|
|
346
334
|
var children = _ref3.children;
|
|
347
|
-
return
|
|
335
|
+
return jsx(Text, {
|
|
348
336
|
key: "lastUpdate",
|
|
349
337
|
weight: "bold",
|
|
350
338
|
color: "primary"
|
|
@@ -352,24 +340,24 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
352
340
|
},
|
|
353
341
|
updatedAt: this.formatDatetimeMedium(this.props.bankEntry.get('updatedAt'))
|
|
354
342
|
});
|
|
355
|
-
return
|
|
356
|
-
|
|
357
|
-
},
|
|
343
|
+
return jsx("div", {
|
|
344
|
+
css: this.props.styles.footer
|
|
345
|
+
}, jsx("span", null, lastUpdate), this.renderTags());
|
|
358
346
|
}
|
|
359
347
|
}, {
|
|
360
348
|
key: "render",
|
|
361
349
|
value: function render() {
|
|
362
350
|
var isExpanded = this.props.isExpanded;
|
|
363
|
-
return
|
|
351
|
+
return jsx(Overlay, {
|
|
364
352
|
onClick: this.props.toggleExpanded,
|
|
365
353
|
tabIndex: "-1",
|
|
366
354
|
ariaLabel: this.entryIdentifier()
|
|
367
|
-
},
|
|
355
|
+
}, jsx("div", {
|
|
368
356
|
role: "group"
|
|
369
|
-
},
|
|
370
|
-
|
|
357
|
+
}, jsx("div", {
|
|
358
|
+
css: this.props.styles.entryDetail,
|
|
371
359
|
"data-automation": "sdk-bankEntryItem"
|
|
372
|
-
}, this.renderHeader(), isExpanded ? this.renderEntryExpanded() : this.renderEntryCollapsed()), isExpanded && this.renderFooter()),
|
|
360
|
+
}, this.renderHeader(), isExpanded ? this.renderEntryExpanded() : this.renderEntryCollapsed()), isExpanded && this.renderFooter()), jsx(CopyMoveBankEntryModal, {
|
|
373
361
|
createEntry: this.createEntryForBank,
|
|
374
362
|
label: this.moveModalTitle(),
|
|
375
363
|
sourceBankId: this.props.bank.id,
|
|
@@ -405,7 +393,9 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
405
393
|
toggleExpanded: PropTypes.func.isRequired,
|
|
406
394
|
withConfirm: PropTypes.func.isRequired,
|
|
407
395
|
locale: PropTypes.string,
|
|
408
|
-
timezone: PropTypes.string
|
|
396
|
+
timezone: PropTypes.string,
|
|
397
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
398
|
+
styles: PropTypes.object
|
|
409
399
|
}, _class2.defaultProps = {
|
|
410
400
|
activeQuizId: null,
|
|
411
401
|
addEntryToQuiz: null,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
entryDetail: {
|
|
4
|
+
padding: componentTheme.entryDetailPadding
|
|
5
|
+
},
|
|
6
|
+
headerRow: {
|
|
7
|
+
display: 'flex',
|
|
8
|
+
flexDirection: 'row',
|
|
9
|
+
justifyContent: 'space-between',
|
|
10
|
+
alignItems: 'flex-start',
|
|
11
|
+
color: componentTheme.headerRowColor
|
|
12
|
+
},
|
|
13
|
+
buttons: {
|
|
14
|
+
position: 'relative',
|
|
15
|
+
display: 'inline-flex',
|
|
16
|
+
zIndex: componentTheme.buttonsZIndex
|
|
17
|
+
},
|
|
18
|
+
expandButtonContainer: {
|
|
19
|
+
borderLeft: "".concat(componentTheme.expandButtonContainerBorderWidth, " solid ").concat(componentTheme.expandButtonContainerBorderColor)
|
|
20
|
+
},
|
|
21
|
+
deleteAlert: {
|
|
22
|
+
display: 'block'
|
|
23
|
+
},
|
|
24
|
+
deletePreface: {
|
|
25
|
+
marginBottom: componentTheme.deletePrefaceMargin
|
|
26
|
+
},
|
|
27
|
+
addButton: {
|
|
28
|
+
marginBottom: componentTheme.addButtonMargin
|
|
29
|
+
},
|
|
30
|
+
headerText: {
|
|
31
|
+
color: componentTheme.headerTextColor,
|
|
32
|
+
fontSize: componentTheme.headerTextFontSize
|
|
33
|
+
},
|
|
34
|
+
stem: {
|
|
35
|
+
overflowX: 'auto',
|
|
36
|
+
fontSize: componentTheme.stemFontSize,
|
|
37
|
+
lineHeight: componentTheme.stemLineHeight,
|
|
38
|
+
'& p': {
|
|
39
|
+
margin: 0
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
footer: {
|
|
43
|
+
padding: componentTheme.footerPadding,
|
|
44
|
+
borderTop: "".concat(componentTheme.footerBorderWidth, " solid ").concat(componentTheme.footerBorderColor),
|
|
45
|
+
fontSize: componentTheme.footerFontSize
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
colors = _ref.colors,
|
|
4
4
|
borders = _ref.borders,
|
|
@@ -20,4 +20,6 @@ export default function generator(_ref) {
|
|
|
20
20
|
footerFontSize: typography.fontSizeXSmall,
|
|
21
21
|
deletePrefaceMargin: spacing.xxSmall
|
|
22
22
|
};
|
|
23
|
-
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default generateComponentTheme;
|