@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,6 +7,8 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
7
7
|
|
|
8
8
|
var _dec, _class, _class2, _temp;
|
|
9
9
|
|
|
10
|
+
/** @jsx jsx */
|
|
11
|
+
|
|
10
12
|
/* eslint "react/jsx-no-bind": "warn" */
|
|
11
13
|
import React, { Component } from 'react';
|
|
12
14
|
import PropTypes from 'prop-types';
|
|
@@ -22,39 +24,25 @@ import { IconEditLine, IconTrashLine, IconShareSolid, IconCopyLine } from '@inst
|
|
|
22
24
|
import { Alert } from '@instructure/ui-alerts';
|
|
23
25
|
import { Spinner } from '@instructure/ui-spinner';
|
|
24
26
|
import { Table } from '@instructure/ui-table';
|
|
25
|
-
import {
|
|
27
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
26
28
|
import { EDIT_BANK_MODAL, withI18nSupport } from '@instructure/quiz-common';
|
|
27
29
|
import CustomPropTypes from "../../../common/util/CustomPropTypes.js";
|
|
28
30
|
import IfFeature from "../../../common/components/shared/IfFeature/index.js";
|
|
29
31
|
import EditBankModal from "../EditBankModal/index.js";
|
|
30
32
|
import SharingModal from "../SharingModal/index.js";
|
|
31
33
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
'deletePreface': 'DyOOn_eTBd',
|
|
45
|
-
'rowHeader': 'DyOOn_fXqC'
|
|
46
|
-
};
|
|
47
|
-
import theme from "./theme.js";
|
|
48
|
-
|
|
49
|
-
var _ref4 = /*#__PURE__*/React.createElement(Table.Cell, null);
|
|
50
|
-
|
|
51
|
-
var _ref5 = /*#__PURE__*/React.createElement(Table.Cell, null);
|
|
52
|
-
|
|
53
|
-
var _ref6 = /*#__PURE__*/React.createElement(Table.Cell, null);
|
|
54
|
-
|
|
55
|
-
var _ref7 = /*#__PURE__*/React.createElement(Table.Cell, null);
|
|
56
|
-
|
|
57
|
-
export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_withI18nSupport) {
|
|
34
|
+
import generateStyle from "./styles.js";
|
|
35
|
+
import generateComponentTheme from "./theme.js";
|
|
36
|
+
|
|
37
|
+
var _ref4 = jsx(Table.Cell, null);
|
|
38
|
+
|
|
39
|
+
var _ref5 = jsx(Table.Cell, null);
|
|
40
|
+
|
|
41
|
+
var _ref6 = jsx(Table.Cell, null);
|
|
42
|
+
|
|
43
|
+
var _ref7 = jsx(Table.Cell, null);
|
|
44
|
+
|
|
45
|
+
export var BanksList = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_withI18nSupport) {
|
|
58
46
|
_inherits(BanksList, _withI18nSupport);
|
|
59
47
|
|
|
60
48
|
var _super = _createSuper(BanksList);
|
|
@@ -113,22 +101,22 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
113
101
|
creatorFullName = resp && resp[0] && resp[0].fullName;
|
|
114
102
|
|
|
115
103
|
case 7:
|
|
116
|
-
confirmBody =
|
|
104
|
+
confirmBody = jsx("div", null, !deletingOwnBank && (creatorFullName ? t('You are about to delete an Item Bank that you did not create. This Item Bank was created by {creator}, proceed with caution.', {
|
|
117
105
|
creator: creatorFullName
|
|
118
|
-
}) : t('You are about to delete an Item Bank that you did not create. Proceed with caution.')),
|
|
106
|
+
}) : t('You are about to delete an Item Bank that you did not create. Proceed with caution.')), jsx(Alert, {
|
|
119
107
|
variant: "error",
|
|
120
108
|
padding: "0"
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
}, t('Once deleted, items from this bank:')),
|
|
109
|
+
}, jsx("div", {
|
|
110
|
+
css: _this.props.styles.deleteAlert
|
|
111
|
+
}, jsx("div", {
|
|
112
|
+
css: _this.props.styles.deletePreface
|
|
113
|
+
}, t('Once deleted, items from this bank:')), jsx(List, null, jsx(List.Item, null, t('will no longer be accessible to others who currently have shared access')), jsx(List.Item, null, t.rich('will <0>NOT</0> be removed from any assessments', [function (_ref2) {
|
|
126
114
|
var children = _ref2.children;
|
|
127
|
-
return
|
|
115
|
+
return jsx(Text, {
|
|
128
116
|
weight: "bold",
|
|
129
117
|
key: "0"
|
|
130
118
|
}, children);
|
|
131
|
-
}])),
|
|
119
|
+
}])), jsx(List.Item, null, t('will lose their statistical link in reporting (if they were part of an assessment)')), jsx(List.Item, null, t('will no longer be available to any assessments attempting a random/batch pull of items (removing the pull will resolve the issue)'))))));
|
|
132
120
|
|
|
133
121
|
_this.props.withConfirm(partial(_this.deleteBank, bank.id), {
|
|
134
122
|
text: confirmBody,
|
|
@@ -243,35 +231,35 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
243
231
|
};
|
|
244
232
|
|
|
245
233
|
if (bank.status === 'copying') {
|
|
246
|
-
return
|
|
247
|
-
|
|
234
|
+
return jsx("div", {
|
|
235
|
+
css: _this.props.styles.bankInfo,
|
|
248
236
|
"data-automation": "sdk-bank-info",
|
|
249
237
|
tabIndex: "-1"
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
},
|
|
238
|
+
}, jsx("div", {
|
|
239
|
+
css: _this.props.styles.bankTitle
|
|
240
|
+
}, jsx(Heading, {
|
|
253
241
|
as: "h2",
|
|
254
242
|
level: "reset",
|
|
255
243
|
"data-automation": "sdk-banks-list-bank-title-heading"
|
|
256
|
-
}, bank.title)),
|
|
257
|
-
|
|
244
|
+
}, bank.title)), jsx("div", {
|
|
245
|
+
css: _this.props.styles.bankDetails,
|
|
258
246
|
"data-automation": "sdk-banks-list-bank-details"
|
|
259
247
|
}, t('Currently duplicating')));
|
|
260
248
|
} else {
|
|
261
|
-
return
|
|
262
|
-
|
|
249
|
+
return jsx("div", {
|
|
250
|
+
css: _this.props.styles.bankInfo,
|
|
263
251
|
"data-automation": "sdk-bank-info",
|
|
264
252
|
tabIndex: "-1"
|
|
265
|
-
},
|
|
266
|
-
|
|
267
|
-
},
|
|
253
|
+
}, jsx("div", {
|
|
254
|
+
css: _this.props.styles.bankTitle
|
|
255
|
+
}, jsx(Link, {
|
|
268
256
|
onClick: navigateToBank(bank.id),
|
|
269
257
|
themeOverride: {
|
|
270
|
-
color: _this.
|
|
271
|
-
hoverColor: _this.
|
|
258
|
+
color: _this.props.styles.bankTitleLinkColor,
|
|
259
|
+
hoverColor: _this.props.styles.bankTitleLinkHoverColor
|
|
272
260
|
},
|
|
273
261
|
"data-automation": "sdk-banks-list-bank-title-link"
|
|
274
|
-
},
|
|
262
|
+
}, jsx(Heading, {
|
|
275
263
|
as: "h2",
|
|
276
264
|
level: "reset",
|
|
277
265
|
"data-automation": "sdk-banks-list-bank-title-heading"
|
|
@@ -280,7 +268,7 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
280
268
|
};
|
|
281
269
|
|
|
282
270
|
_this.renderBankOptions = function (bank) {
|
|
283
|
-
var bankEditOptions =
|
|
271
|
+
var bankEditOptions = jsx(React.Fragment, null, jsx(IconButton, {
|
|
284
272
|
onClick: _this.openModal(bank),
|
|
285
273
|
name: "Edit",
|
|
286
274
|
size: "small",
|
|
@@ -294,7 +282,7 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
294
282
|
screenReaderLabel: t('Edit bank {name}', {
|
|
295
283
|
name: bank.title
|
|
296
284
|
})
|
|
297
|
-
}),
|
|
285
|
+
}), jsx(IconButton, {
|
|
298
286
|
onClick: _this.openDeleteBankModal(bank),
|
|
299
287
|
name: "Delete",
|
|
300
288
|
size: "small",
|
|
@@ -309,7 +297,7 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
309
297
|
name: bank.title
|
|
310
298
|
})
|
|
311
299
|
}));
|
|
312
|
-
var duplicateBankOption =
|
|
300
|
+
var duplicateBankOption = jsx(IconButton, {
|
|
313
301
|
onClick: _this.openDuplicateBankModal(bank),
|
|
314
302
|
name: "Duplicate",
|
|
315
303
|
size: "small",
|
|
@@ -325,19 +313,19 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
325
313
|
});
|
|
326
314
|
|
|
327
315
|
if (bank.status === 'copying') {
|
|
328
|
-
return
|
|
329
|
-
|
|
330
|
-
}, t('Duplicating'),
|
|
316
|
+
return jsx("div", {
|
|
317
|
+
css: _this.props.styles.bankOptions
|
|
318
|
+
}, t('Duplicating'), jsx(Spinner, {
|
|
331
319
|
renderTitle: t('Loading'),
|
|
332
320
|
size: "x-small",
|
|
333
321
|
margin: "0 0 0 small"
|
|
334
322
|
}));
|
|
335
323
|
} else {
|
|
336
|
-
return
|
|
337
|
-
|
|
338
|
-
}, _this.props.duplicateItemBanks ? duplicateBankOption : null,
|
|
324
|
+
return jsx("div", {
|
|
325
|
+
css: _this.props.styles.bankOptions
|
|
326
|
+
}, _this.props.duplicateItemBanks ? duplicateBankOption : null, jsx(IfFeature, {
|
|
339
327
|
name: "item_bank_sharing"
|
|
340
|
-
},
|
|
328
|
+
}, jsx(IconButton, {
|
|
341
329
|
onClick: _this.openSharingModal(bank),
|
|
342
330
|
name: "Share",
|
|
343
331
|
size: "small",
|
|
@@ -356,11 +344,11 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
356
344
|
};
|
|
357
345
|
|
|
358
346
|
_this.renderBank = function (bank) {
|
|
359
|
-
return
|
|
347
|
+
return jsx("div", {
|
|
360
348
|
key: bank.id,
|
|
361
|
-
|
|
349
|
+
css: _this.props.styles.bankRow,
|
|
362
350
|
"data-automation": "sdk-banks-list-bank-row"
|
|
363
|
-
},
|
|
351
|
+
}, jsx(EditBankModal, {
|
|
364
352
|
workingBank: bank.getWorkingInstance()
|
|
365
353
|
}), _this.renderBankInfo(bank), _this.renderBankOptions(bank));
|
|
366
354
|
};
|
|
@@ -389,22 +377,22 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
389
377
|
key: "renderDetails",
|
|
390
378
|
value: function renderDetails(bank) {
|
|
391
379
|
var separator = ' | ';
|
|
392
|
-
var lastUsedInfo = bank.lastUsed() &&
|
|
380
|
+
var lastUsedInfo = bank.lastUsed() && jsx(React.Fragment, null, jsx(PresentationContent, null, separator), t('Last used { lastUsedDate }', {
|
|
393
381
|
lastUsedDate: this.formatDateMedium(bank.lastUsed())
|
|
394
382
|
}));
|
|
395
|
-
return
|
|
396
|
-
|
|
383
|
+
return jsx("div", {
|
|
384
|
+
css: this.props.styles.bankDetails,
|
|
397
385
|
"data-automation": "sdk-banks-list-bank-details"
|
|
398
|
-
},
|
|
386
|
+
}, jsx("div", null, t('Updated { updatedDate }', {
|
|
399
387
|
updatedDate: this.formatDateMedium(bank.updatedAt())
|
|
400
|
-
}),
|
|
388
|
+
}), jsx(PresentationContent, null, separator), t("{\n count, plural,\n one {# Question Total}\n other {# Questions Total}\n }", {
|
|
401
389
|
count: bank.itemEntryCount
|
|
402
390
|
}), lastUsedInfo));
|
|
403
391
|
}
|
|
404
392
|
}, {
|
|
405
393
|
key: "renderSharingModal",
|
|
406
394
|
value: function renderSharingModal() {
|
|
407
|
-
return
|
|
395
|
+
return jsx(SharingModal, {
|
|
408
396
|
appContainer: this.props.appContainer,
|
|
409
397
|
bank: this.state.sharingModalBank,
|
|
410
398
|
currentUser: this.props.currentUser,
|
|
@@ -427,9 +415,9 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
427
415
|
var _this3 = this;
|
|
428
416
|
|
|
429
417
|
if (bank.status === 'copying') {
|
|
430
|
-
return
|
|
431
|
-
|
|
432
|
-
},
|
|
418
|
+
return jsx(Table.RowHeader, null, jsx("div", {
|
|
419
|
+
css: this.props.styles.rowHeader
|
|
420
|
+
}, jsx(Heading, {
|
|
433
421
|
as: "h2",
|
|
434
422
|
level: "reset",
|
|
435
423
|
"data-automation": "sdk-banks-list-bank-title-heading"
|
|
@@ -441,15 +429,15 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
441
429
|
};
|
|
442
430
|
};
|
|
443
431
|
|
|
444
|
-
return
|
|
445
|
-
|
|
446
|
-
},
|
|
432
|
+
return jsx(Table.RowHeader, null, jsx("div", {
|
|
433
|
+
css: this.props.styles.rowHeader
|
|
434
|
+
}, jsx(EditBankModal, {
|
|
447
435
|
workingBank: bank.getWorkingInstance()
|
|
448
|
-
}),
|
|
436
|
+
}), jsx(Link, {
|
|
449
437
|
isWithinText: false,
|
|
450
438
|
onClick: navigateToBank(bank.id),
|
|
451
439
|
"data-automation": "sdk-banks-list-bank-title-link"
|
|
452
|
-
},
|
|
440
|
+
}, jsx(Heading, {
|
|
453
441
|
as: "h2",
|
|
454
442
|
level: "reset",
|
|
455
443
|
"data-automation": "sdk-banks-list-bank-title-heading"
|
|
@@ -460,15 +448,15 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
460
448
|
key: "renderTableRow",
|
|
461
449
|
value: function renderTableRow(bank) {
|
|
462
450
|
if (bank.status === 'copying') {
|
|
463
|
-
return
|
|
451
|
+
return jsx(Table.Row, {
|
|
464
452
|
key: bank.id
|
|
465
|
-
}, this.renderTableRowHeader(bank), _ref4, _ref5, _ref6, _ref7, !this.props.isCompact &&
|
|
453
|
+
}, this.renderTableRowHeader(bank), _ref4, _ref5, _ref6, _ref7, !this.props.isCompact && jsx(Table.Cell, {
|
|
466
454
|
textAlign: "end"
|
|
467
455
|
}, this.renderBankOptions(bank)));
|
|
468
456
|
} else {
|
|
469
|
-
return
|
|
457
|
+
return jsx(Table.Row, {
|
|
470
458
|
key: bank.id
|
|
471
|
-
}, this.renderTableRowHeader(bank),
|
|
459
|
+
}, this.renderTableRowHeader(bank), jsx(Table.Cell, null, this.formatDateMedium(bank.updatedAt())), jsx(Table.Cell, null, bank.itemEntryCount), jsx(Table.Cell, null, bank.lastUsed() ? this.formatDateMedium(bank.lastUsed()) : ''), jsx(Table.Cell, null, this.formatDateMedium(bank.createdAt())), !this.props.isCompact && jsx(Table.Cell, {
|
|
472
460
|
textAlign: "end"
|
|
473
461
|
}, this.renderBankOptions(bank)));
|
|
474
462
|
}
|
|
@@ -476,7 +464,7 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
476
464
|
}, {
|
|
477
465
|
key: "renderTableSortHeader",
|
|
478
466
|
value: function renderTableSortHeader(headerId, headerText) {
|
|
479
|
-
return
|
|
467
|
+
return jsx(Table.ColHeader, {
|
|
480
468
|
id: headerId,
|
|
481
469
|
key: headerId,
|
|
482
470
|
onRequestSort: this.props.onChangeSort(headerId, this.props.order),
|
|
@@ -488,26 +476,26 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
488
476
|
value: function renderTable() {
|
|
489
477
|
var _this4 = this;
|
|
490
478
|
|
|
491
|
-
return
|
|
479
|
+
return jsx(Table, {
|
|
492
480
|
margin: "small 0",
|
|
493
481
|
caption: t('Banks'),
|
|
494
482
|
layout: this.props.isCompact ? 'stacked' : 'auto'
|
|
495
|
-
},
|
|
483
|
+
}, jsx(Table.Head, {
|
|
496
484
|
renderSortLabel: t('Sort By')
|
|
497
|
-
},
|
|
485
|
+
}, jsx(Table.Row, null, this.renderTableSortHeader('name', t('Bank')), this.renderTableSortHeader('updated_at', t('Updated')), jsx(Table.ColHeader, {
|
|
498
486
|
id: "header-num-questions",
|
|
499
487
|
width: "1"
|
|
500
|
-
}, t('Questions')), this.renderTableSortHeader('last_used', t('Last Used')), this.renderTableSortHeader('created_at', t('Created')), !this.props.isCompact &&
|
|
488
|
+
}, t('Questions')), this.renderTableSortHeader('last_used', t('Last Used')), this.renderTableSortHeader('created_at', t('Created')), !this.props.isCompact && jsx(Table.ColHeader, {
|
|
501
489
|
id: "header-option-links",
|
|
502
490
|
width: "1"
|
|
503
|
-
},
|
|
491
|
+
}, jsx(ScreenReaderContent, null, t('Bank option links'))))), jsx(Table.Body, null, (this.props.banks.toArray() || []).map(function (bank) {
|
|
504
492
|
return _this4.renderTableRow(bank);
|
|
505
493
|
})));
|
|
506
494
|
}
|
|
507
495
|
}, {
|
|
508
496
|
key: "render",
|
|
509
497
|
value: function render() {
|
|
510
|
-
return
|
|
498
|
+
return jsx("div", null, this.state.sharingModalBank && this.renderSharingModal(), this.props.itemBankSearchTableEnabled ? this.renderTable() : this.props.banks.toArray().map(this.renderBank));
|
|
511
499
|
}
|
|
512
500
|
}]);
|
|
513
501
|
|
|
@@ -540,7 +528,9 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
540
528
|
openModal: PropTypes.func.isRequired,
|
|
541
529
|
withConfirm: PropTypes.func.isRequired,
|
|
542
530
|
locale: PropTypes.string,
|
|
543
|
-
timezone: PropTypes.string
|
|
531
|
+
timezone: PropTypes.string,
|
|
532
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
533
|
+
styles: PropTypes.object
|
|
544
534
|
}, _class2.defaultProps = {
|
|
545
535
|
currentUser: null,
|
|
546
536
|
getCourseInfo: null,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
bankRow: {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
flexDirection: 'row',
|
|
6
|
+
borderBottom: "".concat(componentTheme.bankRowBorderWidth, " solid ").concat(componentTheme.bankRowBorderColor)
|
|
7
|
+
},
|
|
8
|
+
bankInfo: {
|
|
9
|
+
margin: "".concat(componentTheme.bankInfoMargin, " 0"),
|
|
10
|
+
flex: 1
|
|
11
|
+
},
|
|
12
|
+
bankTitle: {
|
|
13
|
+
fontSize: componentTheme.bankTitleFontSize,
|
|
14
|
+
paddingBottom: componentTheme.bankTitlePadding
|
|
15
|
+
},
|
|
16
|
+
bankDetails: {
|
|
17
|
+
color: componentTheme.bankDetailsColor,
|
|
18
|
+
fontSize: componentTheme.bankDetailsFontSize
|
|
19
|
+
},
|
|
20
|
+
bankOptions: {
|
|
21
|
+
display: 'flex',
|
|
22
|
+
flexDirection: 'row',
|
|
23
|
+
alignItems: 'center'
|
|
24
|
+
},
|
|
25
|
+
bankOptionIcon: {
|
|
26
|
+
verticalAlign: 'middle',
|
|
27
|
+
marginRight: componentTheme.BankOptionIconMargin,
|
|
28
|
+
fontSize: componentTheme.BankOptionIconFontSize
|
|
29
|
+
},
|
|
30
|
+
bankTitleLinkColor: componentTheme.bankTitleLinkColor,
|
|
31
|
+
bankTitleLinkHoverColor: componentTheme.bankTitleLinkHoverColor,
|
|
32
|
+
deleteAlert: {
|
|
33
|
+
display: 'block'
|
|
34
|
+
},
|
|
35
|
+
deletePreface: {
|
|
36
|
+
marginBottom: componentTheme.deletePrefaceMargin
|
|
37
|
+
},
|
|
38
|
+
rowHeader: {
|
|
39
|
+
display: 'flex',
|
|
40
|
+
justifyContent: 'space-between'
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var borders = _ref.borders,
|
|
3
3
|
colors = _ref.colors,
|
|
4
4
|
typography = _ref.typography,
|
|
@@ -18,4 +18,6 @@ export default function generator(_ref) {
|
|
|
18
18
|
BankOptionIconFontSize: typography.fontSizeMedium,
|
|
19
19
|
deletePrefaceMargin: spacing.xxSmall
|
|
20
20
|
};
|
|
21
|
-
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default generateComponentTheme;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -21,7 +19,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
21
19
|
|
|
22
20
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
23
21
|
|
|
24
|
-
var _react =
|
|
22
|
+
var _react = require("react");
|
|
25
23
|
|
|
26
24
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
27
25
|
|
|
@@ -57,7 +55,7 @@ var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
|
57
55
|
|
|
58
56
|
var _uiTextInput = require("@instructure/ui-text-input");
|
|
59
57
|
|
|
60
|
-
var
|
|
58
|
+
var _emotion = require("@instructure/emotion");
|
|
61
59
|
|
|
62
60
|
var _index = _interopRequireDefault(require("../../../common/components/resources/entry/EntrySave/index.js"));
|
|
63
61
|
|
|
@@ -91,31 +89,15 @@ var _index10 = _interopRequireDefault(require("../NavWrapper/index.js"));
|
|
|
91
89
|
|
|
92
90
|
var _quizCommon = require("@instructure/quiz-common");
|
|
93
91
|
|
|
92
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
93
|
+
|
|
94
94
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
95
95
|
|
|
96
96
|
var _dec, _class, _class2, _temp;
|
|
97
97
|
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
return "\n\n.dhhIK_caGd{background-color:".concat(theme.contentBackgroundColor || 'inherit', ";padding:").concat(theme.contentPaddingTopBottom || 'inherit', " ").concat(theme.contentPaddingLeftRight || 'inherit', "}\n\n.dhhIK_blfJ{margin-bottom:").concat(theme.entryRowMargin || 'inherit', "}\n\n.dhhIK_dlpV{color:").concat(theme.headerRowColor || 'inherit', ";flex-direction:row;justify-content:space-between;padding:").concat(theme.headerRowPadding || 'inherit', "}\n\n.dhhIK_dlpV,.dhhIK_cKlw{align-items:flex-start;display:flex}\n\n.dhhIK_cKlw{flex:0 0 auto;flex-direction:column;margin-right:").concat(theme.leftHeaderMargin || 'inherit', "}\n\n.dhhIK_fAhB{font-size:").concat(theme.headerTextFontSize || 'inherit', "}\n\n.dhhIK_fsuY{align-items:center;background-color:").concat(theme.headerBackgroundColor || 'inherit', ";color:").concat(theme.headerColor || 'inherit', ";display:flex;justify-content:space-between;padding:").concat(theme.headerPaddingTopBottom || 'inherit', " ").concat(theme.headerPaddingLeftRight || 'inherit', ";vertical-align:middle}\n\n.dhhIK_IoDT{padding-left:").concat(theme.rightHeaderPaddingLeft || 'inherit', ";text-align:right}\n\n[dir=ltr] .dhhIK_IoDT,[dir=rtl] .dhhIK_IoDT{text-align:right}\n\n.dhhIK_cjWK,.dhhIK_bVuu,.dhhIK_ekxs{display:flex;flex-direction:row}\n\n.dhhIK_cjWK{padding-bottom:").concat(theme.footerPaddingBottom || 'inherit', ";padding-top:").concat(theme.footerPaddingTop || 'inherit', ";text-align:left}\n\n[dir=ltr] .dhhIK_cjWK,[dir=rtl] .dhhIK_cjWK{text-align:left}\n\n.dhhIK_ekxs{flex:8 0 0;justify-content:flex-end;padding-left:").concat(theme.rightFooterPaddingLeftRight || 'inherit', ";padding-right:").concat(theme.rightFooterPaddingLeftRight || 'inherit', "}\n\n.dhhIK_eNDu{border-bottom:").concat(theme.entryEditBorderWidth || 'inherit', " solid ").concat(theme.entryEditBorderColor || 'inherit', "}");
|
|
102
|
-
},
|
|
103
|
-
'content': 'dhhIK_caGd',
|
|
104
|
-
'entryRow': 'dhhIK_blfJ',
|
|
105
|
-
'headerRow': 'dhhIK_dlpV',
|
|
106
|
-
'leftHeader': 'dhhIK_cKlw',
|
|
107
|
-
'headerText': 'dhhIK_fAhB',
|
|
108
|
-
'header': 'dhhIK_fsuY',
|
|
109
|
-
'rightHeader': 'dhhIK_IoDT',
|
|
110
|
-
'footer': 'dhhIK_cjWK',
|
|
111
|
-
'leftFooter': 'dhhIK_bVuu',
|
|
112
|
-
'rightFooter': 'dhhIK_ekxs',
|
|
113
|
-
'entryEdit': 'dhhIK_eNDu'
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
var _ref3 = /*#__PURE__*/_react.default.createElement(_Spinner.default, null);
|
|
117
|
-
|
|
118
|
-
var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
98
|
+
var _ref3 = (0, _emotion.jsx)(_Spinner.default, null);
|
|
99
|
+
|
|
100
|
+
var BankEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
119
101
|
(0, _inherits2.default)(BankEntry, _Component);
|
|
120
102
|
|
|
121
103
|
var _super = (0, _createSuper2.default)(BankEntry);
|
|
@@ -362,17 +344,17 @@ var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
362
344
|
returnToUrl = _this$props.returnToUrl,
|
|
363
345
|
bank = _this$props.bank;
|
|
364
346
|
var isScopeEmpty = !Object.keys(scope).length;
|
|
365
|
-
return
|
|
347
|
+
return (0, _emotion.jsx)(_index10.default, {
|
|
366
348
|
closeTray: closeTray,
|
|
367
349
|
navigateToBanks: navigateToBanks,
|
|
368
350
|
navigateToBuild: navigateToBuild,
|
|
369
351
|
returnToUrl: isScopeEmpty ? null : returnToUrl,
|
|
370
352
|
canvasReferrerLinkText: isScopeEmpty ? null : scope.title
|
|
371
|
-
},
|
|
353
|
+
}, (0, _emotion.jsx)(_uiBreadcrumb.BreadcrumbLink, {
|
|
372
354
|
key: "bank",
|
|
373
355
|
onClick: this.navigateToBank,
|
|
374
356
|
ref: this.setNavToBankRef
|
|
375
|
-
}, bank.title),
|
|
357
|
+
}, bank.title), (0, _emotion.jsx)(_uiBreadcrumb.BreadcrumbLink, {
|
|
376
358
|
key: "bankEntry"
|
|
377
359
|
}, this.entryLinkName()));
|
|
378
360
|
}
|
|
@@ -380,8 +362,8 @@ var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
380
362
|
key: "renderTitle",
|
|
381
363
|
value: function renderTitle(entry) {
|
|
382
364
|
if (this.isItemEntry()) {
|
|
383
|
-
return
|
|
384
|
-
renderLabel:
|
|
365
|
+
return (0, _emotion.jsx)(_uiTextInput.TextInput, {
|
|
366
|
+
renderLabel: (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Edit question title')),
|
|
385
367
|
type: "text",
|
|
386
368
|
placeholder: (0, _formatMessage.default)('Question Title'),
|
|
387
369
|
onChange: this.handleTitleChange,
|
|
@@ -403,18 +385,18 @@ var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
403
385
|
var itemIdentifier = this.isTemporary() ? tempIdentifier : identifier;
|
|
404
386
|
var entryName = this.isItemEntry() ? entry.getInteractionType().name : (0, _formatMessage.default)('Stimulus');
|
|
405
387
|
var separator = ' | ';
|
|
406
|
-
return
|
|
407
|
-
|
|
408
|
-
},
|
|
409
|
-
|
|
410
|
-
},
|
|
411
|
-
|
|
412
|
-
},
|
|
388
|
+
return (0, _emotion.jsx)("div", {
|
|
389
|
+
css: this.props.styles.header
|
|
390
|
+
}, (0, _emotion.jsx)("div", {
|
|
391
|
+
css: this.props.styles.leftHeader
|
|
392
|
+
}, (0, _emotion.jsx)("div", {
|
|
393
|
+
css: this.props.styles.headerText
|
|
394
|
+
}, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
413
395
|
level: "reset",
|
|
414
396
|
as: "h2"
|
|
415
|
-
}, entryName,
|
|
416
|
-
|
|
417
|
-
},
|
|
397
|
+
}, entryName, (0, _emotion.jsx)(_uiA11yContent.PresentationContent, null, separator), itemIdentifier))), this.renderTitle(entry), (0, _emotion.jsx)("div", {
|
|
398
|
+
css: this.props.styles.rightHeader
|
|
399
|
+
}, (0, _emotion.jsx)(_index.default, props)));
|
|
418
400
|
}
|
|
419
401
|
}, {
|
|
420
402
|
key: "hasPendingTagModifications",
|
|
@@ -596,7 +578,7 @@ var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
596
578
|
text = (0, _formatMessage.default)('Edit Question Level Feedback');
|
|
597
579
|
}
|
|
598
580
|
|
|
599
|
-
return
|
|
581
|
+
return (0, _emotion.jsx)(_uiButtons.IconButton, {
|
|
600
582
|
onClick: this.openFeedbackModal,
|
|
601
583
|
withBackground: false,
|
|
602
584
|
withBorder: false,
|
|
@@ -659,7 +641,7 @@ var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
659
641
|
var entryId = this.getBankEntryId(bankEntry);
|
|
660
642
|
|
|
661
643
|
var tags = function tags() {
|
|
662
|
-
return
|
|
644
|
+
return (0, _emotion.jsx)(_index8.default, {
|
|
663
645
|
allowNewTags: true,
|
|
664
646
|
noMatchText: (0, _formatMessage.default)('Enter a tag to find or create'),
|
|
665
647
|
parentType: entryType,
|
|
@@ -670,20 +652,20 @@ var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
670
652
|
};
|
|
671
653
|
|
|
672
654
|
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.');
|
|
673
|
-
return
|
|
674
|
-
|
|
675
|
-
},
|
|
655
|
+
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)("div", {
|
|
656
|
+
css: this.props.styles.entryEdit
|
|
657
|
+
}, (0, _emotion.jsx)(_index9.default, versioningProps, canEdit && (0, _emotion.jsx)(_uiAlerts.Alert, {
|
|
676
658
|
renderCloseButtonLabel: (0, _formatMessage.default)('Dismiss'),
|
|
677
659
|
margin: "0 0 medium 0"
|
|
678
|
-
},
|
|
660
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
679
661
|
color: "primary"
|
|
680
|
-
}, editWarning)),
|
|
681
|
-
|
|
682
|
-
},
|
|
683
|
-
|
|
684
|
-
}, this.renderFeedbackSection()),
|
|
685
|
-
|
|
686
|
-
},
|
|
662
|
+
}, editWarning)), (0, _emotion.jsx)(EntryComponent, props), useBankTags && tags())), (0, _emotion.jsx)("div", {
|
|
663
|
+
css: this.props.styles.footer
|
|
664
|
+
}, (0, _emotion.jsx)("div", {
|
|
665
|
+
css: this.props.styles.leftFooter
|
|
666
|
+
}, this.renderFeedbackSection()), (0, _emotion.jsx)("div", {
|
|
667
|
+
css: this.props.styles.rightFooter
|
|
668
|
+
}, (0, _emotion.jsx)(_index.default, props))));
|
|
687
669
|
}
|
|
688
670
|
}, {
|
|
689
671
|
key: "render",
|
|
@@ -694,9 +676,9 @@ var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
694
676
|
return _ref3;
|
|
695
677
|
}
|
|
696
678
|
|
|
697
|
-
return
|
|
698
|
-
|
|
699
|
-
}, this.renderHeader(entry), this.renderEntry(entry), !this.props.isCompact &&
|
|
679
|
+
return (0, _emotion.jsx)(_index5.default, null, this.renderNav(), (0, _emotion.jsx)("div", {
|
|
680
|
+
css: this.props.styles.content
|
|
681
|
+
}, this.renderHeader(entry), this.renderEntry(entry), !this.props.isCompact && (0, _emotion.jsx)(_index3.default, {
|
|
700
682
|
parentId: this.props.bankId,
|
|
701
683
|
parentType: _quizCommon.PARENT_TYPE_BANK
|
|
702
684
|
})));
|
|
@@ -748,7 +730,9 @@ var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
748
730
|
tagInput: _propTypes.default.string,
|
|
749
731
|
updateItem: _propTypes.default.func.isRequired,
|
|
750
732
|
updateStimulus: _propTypes.default.func.isRequired,
|
|
751
|
-
useBankTags: _propTypes.default.bool
|
|
733
|
+
useBankTags: _propTypes.default.bool,
|
|
734
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
735
|
+
styles: _propTypes.default.object
|
|
752
736
|
}, _class2.defaultProps = {
|
|
753
737
|
closeTray: function closeTray() {},
|
|
754
738
|
entry: null,
|