@instructure/quiz-core 20.1.1-rc.4 → 20.2.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 +8 -0
- package/es/banks/components/NavWrapper/presenter.js +27 -25
- package/es/banks/components/NavWrapper/styles.js +31 -0
- package/es/banks/components/NavWrapper/theme.js +4 -2
- package/es/banks/components/SharingModal/ShareList/index.js +33 -37
- package/es/banks/components/SharingModal/ShareList/styles.js +9 -0
- package/es/banks/components/SharingModal/presenter.js +39 -40
- package/es/banks/components/SharingModal/styles.js +13 -0
- package/es/banks/components/SharingModal/theme.js +4 -2
- package/lib/banks/components/NavWrapper/presenter.js +25 -29
- package/lib/banks/components/NavWrapper/styles.js +39 -0
- package/lib/banks/components/NavWrapper/theme.js +6 -3
- package/lib/banks/components/SharingModal/ShareList/index.js +32 -40
- package/lib/banks/components/SharingModal/ShareList/styles.js +17 -0
- package/lib/banks/components/SharingModal/presenter.js +36 -40
- package/lib/banks/components/SharingModal/styles.js +21 -0
- package/lib/banks/components/SharingModal/theme.js +6 -3
- package/package.json +10 -10
- package/es/banks/components/SharingModal/ShareList/theme.js +0 -3
- package/lib/banks/components/SharingModal/ShareList/theme.js +0 -10
|
@@ -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
|
});
|
|
@@ -17,7 +15,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
17
15
|
|
|
18
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
17
|
|
|
20
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
21
19
|
|
|
22
20
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
23
21
|
|
|
@@ -35,28 +33,21 @@ var _uiIcons = require("@instructure/ui-icons");
|
|
|
35
33
|
|
|
36
34
|
var _uiView = require("@instructure/ui-view");
|
|
37
35
|
|
|
38
|
-
var
|
|
36
|
+
var _emotion = require("@instructure/emotion");
|
|
39
37
|
|
|
40
38
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
41
39
|
|
|
40
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
41
|
+
|
|
42
42
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
43
43
|
|
|
44
44
|
var _dec, _class, _class2, _temp;
|
|
45
45
|
|
|
46
|
-
var
|
|
47
|
-
componentId: 'fooBc',
|
|
48
|
-
template: function template(theme) {
|
|
49
|
-
return "\n\n.fooBc_diTj{align-items:center;background-color:".concat(theme.navBackgroundColor || 'inherit', ";border-bottom:").concat(theme.navBorderWidth || 'inherit', " solid ").concat(theme.navBorderColor || 'inherit', ";box-sizing:border-box;display:flex;flex-direction:row;padding:").concat(theme.navPaddingTopBottom || 'inherit', " ").concat(theme.navPaddingLeftRight || 'inherit', ";position:sticky;top:0;width:100%;z-index:4444}\n\nbody.tox-fullscreen .fooBc_diTj{display:none}\n\n@supports (-ms-ime-align:auto){.fooBc_diTj{position:relative}}\n\n.fooBc_ZXRE{flex:1}");
|
|
50
|
-
},
|
|
51
|
-
'nav': 'fooBc_diTj',
|
|
52
|
-
'crumbs': 'fooBc_ZXRE'
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
var _ref = /*#__PURE__*/_react.default.createElement(_uiIcons.IconBankLine, {
|
|
46
|
+
var _ref = (0, _emotion.jsx)(_uiIcons.IconBankLine, {
|
|
56
47
|
size: "x-small"
|
|
57
48
|
});
|
|
58
49
|
|
|
59
|
-
var NavWrapper = (_dec = (0,
|
|
50
|
+
var NavWrapper = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
60
51
|
(0, _inherits2.default)(NavWrapper, _Component);
|
|
61
52
|
|
|
62
53
|
var _super = (0, _createSuper2.default)(NavWrapper);
|
|
@@ -101,14 +92,12 @@ var NavWrapper = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
101
92
|
var _this$props = this.props,
|
|
102
93
|
returnToUrl = _this$props.returnToUrl,
|
|
103
94
|
canvasReferrerLinkText = _this$props.canvasReferrerLinkText;
|
|
104
|
-
|
|
105
|
-
var canvasReferrerLink = returnToUrl && canvasReferrerLinkText && /*#__PURE__*/_react.default.createElement(_uiBreadcrumb.BreadcrumbLink, {
|
|
95
|
+
var canvasReferrerLink = returnToUrl && canvasReferrerLinkText && (0, _emotion.jsx)(_uiBreadcrumb.BreadcrumbLink, {
|
|
106
96
|
key: "Context",
|
|
107
97
|
href: returnToUrl,
|
|
108
98
|
target: "_top"
|
|
109
99
|
}, canvasReferrerLinkText);
|
|
110
|
-
|
|
111
|
-
var banksLinks = /*#__PURE__*/_react.default.createElement(_uiBreadcrumb.BreadcrumbLink, {
|
|
100
|
+
var banksLinks = (0, _emotion.jsx)(_uiBreadcrumb.BreadcrumbLink, {
|
|
112
101
|
ref: this.setItemBanksRef,
|
|
113
102
|
renderIcon: _ref,
|
|
114
103
|
key: "Banks",
|
|
@@ -116,7 +105,6 @@ var NavWrapper = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
116
105
|
}, (0, _formatMessage.default)('Item Banks')); // If Breadcrumb has multiple children (even if 2nd is null), it will
|
|
117
106
|
// render the `>` icon, which we don't want if there are no children.
|
|
118
107
|
|
|
119
|
-
|
|
120
108
|
var breadCrumbLinks = [banksLinks];
|
|
121
109
|
if (this.props.children) breadCrumbLinks.push(this.props.children);
|
|
122
110
|
if (canvasReferrerLink) breadCrumbLinks.unshift(canvasReferrerLink);
|
|
@@ -131,11 +119,11 @@ var NavWrapper = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
131
119
|
returnToUrl = _this$props2.returnToUrl;
|
|
132
120
|
|
|
133
121
|
if (!closeTray && returnToUrl) {
|
|
134
|
-
return
|
|
122
|
+
return (0, _emotion.jsx)(_ReturnButton.ReturnButton, {
|
|
135
123
|
returnToUrl: returnToUrl
|
|
136
124
|
});
|
|
137
125
|
} else if (navigateToBuild) {
|
|
138
|
-
return
|
|
126
|
+
return (0, _emotion.jsx)(_uiButtons.Button, {
|
|
139
127
|
onClick: navigateToBuild
|
|
140
128
|
}, (0, _formatMessage.default)('Return'));
|
|
141
129
|
}
|
|
@@ -144,7 +132,7 @@ var NavWrapper = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
144
132
|
key: "renderCloseButton",
|
|
145
133
|
value: function renderCloseButton() {
|
|
146
134
|
if (this.props.closeTray) {
|
|
147
|
-
return
|
|
135
|
+
return (0, _emotion.jsx)(_uiButtons.CloseButton, {
|
|
148
136
|
elementRef: this.setCloseButtonRef,
|
|
149
137
|
placement: "start",
|
|
150
138
|
onClick: this.props.closeTray,
|
|
@@ -155,11 +143,17 @@ var NavWrapper = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
155
143
|
}, {
|
|
156
144
|
key: "render",
|
|
157
145
|
value: function render() {
|
|
158
|
-
return
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
146
|
+
return (0, _emotion.jsx)(_uiView.View, null, (0, _emotion.jsx)(_emotion.Global, {
|
|
147
|
+
styles: {
|
|
148
|
+
'body.tox-fullscreen .nav': {
|
|
149
|
+
'display': 'none'
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}), (0, _emotion.jsx)("div", {
|
|
153
|
+
css: this.props.styles.nav
|
|
154
|
+
}, this.renderCloseButton(), (0, _emotion.jsx)("div", {
|
|
155
|
+
css: this.props.styles.crumbs
|
|
156
|
+
}, (0, _emotion.jsx)(_uiBreadcrumb.Breadcrumb, {
|
|
163
157
|
size: "small",
|
|
164
158
|
label: (0, _formatMessage.default)('You are here:')
|
|
165
159
|
}, this.renderBreadcrumbLinks())), this.renderReturnButton(), this.props.renderHeaderMenu()));
|
|
@@ -175,7 +169,9 @@ var NavWrapper = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
175
169
|
renderHeaderMenu: _propTypes.default.func,
|
|
176
170
|
trayOpen: _propTypes.default.bool.isRequired,
|
|
177
171
|
returnToUrl: _propTypes.default.string,
|
|
178
|
-
canvasReferrerLinkText: _propTypes.default.string
|
|
172
|
+
canvasReferrerLinkText: _propTypes.default.string,
|
|
173
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
174
|
+
styles: _propTypes.default.object
|
|
179
175
|
}, _class2.defaultProps = {
|
|
180
176
|
children: null,
|
|
181
177
|
closeTray: null,
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
9
|
+
return {
|
|
10
|
+
nav: {
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexDirection: 'row',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
padding: "".concat(componentTheme.navPaddingTopBottom, " ").concat(componentTheme.navPaddingLeftRight),
|
|
15
|
+
borderBottom: "".concat(componentTheme.navBorderWidth, " solid ").concat(componentTheme.navBorderColor),
|
|
16
|
+
backgroundColor: componentTheme.navBackgroundColor,
|
|
17
|
+
position: 'sticky',
|
|
18
|
+
top: 0,
|
|
19
|
+
width: '100%',
|
|
20
|
+
boxSizing: 'border-box',
|
|
21
|
+
zIndex: 4444,
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* For MS Edge
|
|
25
|
+
* When they switch to chromium
|
|
26
|
+
* check to see if sticky works.
|
|
27
|
+
*/
|
|
28
|
+
'@supports (-ms-ime-align: auto)': {
|
|
29
|
+
position: 'relative'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
crumbs: {
|
|
33
|
+
flex: 1
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var _default = generateStyle;
|
|
39
|
+
exports.default = _default;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
9
|
var spacing = _ref.spacing,
|
|
10
10
|
borders = _ref.borders,
|
|
11
11
|
colors = _ref.colors,
|
|
@@ -21,4 +21,7 @@ function generator(_ref) {
|
|
|
21
21
|
bankIconFontSize: typography.fontSizeLarge,
|
|
22
22
|
bankIconPadding: spacing.xSmall
|
|
23
23
|
};
|
|
24
|
-
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var _default = generateComponentTheme;
|
|
27
|
+
exports.default = _default;
|
|
@@ -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
|
});
|
|
@@ -17,7 +15,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
17
15
|
|
|
18
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
17
|
|
|
20
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
21
19
|
|
|
22
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
21
|
|
|
@@ -39,13 +37,13 @@ var _uiAvatar = require("@instructure/ui-avatar");
|
|
|
39
37
|
|
|
40
38
|
var _uiTabs = require("@instructure/ui-tabs");
|
|
41
39
|
|
|
42
|
-
var
|
|
40
|
+
var _emotion = require("@instructure/emotion");
|
|
43
41
|
|
|
44
42
|
var _index = require("../ContextualIconButton/index.js");
|
|
45
43
|
|
|
46
44
|
var _uiSimpleSelect = require("@instructure/ui-simple-select");
|
|
47
45
|
|
|
48
|
-
var
|
|
46
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
49
47
|
|
|
50
48
|
var _quizCommon = require("@instructure/quiz-common");
|
|
51
49
|
|
|
@@ -53,19 +51,11 @@ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/f
|
|
|
53
51
|
|
|
54
52
|
var _dec, _class, _class2, _temp;
|
|
55
53
|
|
|
56
|
-
var
|
|
57
|
-
componentId: 'edByO',
|
|
58
|
-
template: function template(theme) {
|
|
59
|
-
return "\n\n.edByO_bqPU{text-decoration:line-through}";
|
|
60
|
-
},
|
|
61
|
-
'labelRemoved': 'edByO_bqPU'
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
var _ref4 = /*#__PURE__*/_react.default.createElement(_uiIcons.IconCoursesLine, {
|
|
54
|
+
var _ref4 = (0, _emotion.jsx)(_uiIcons.IconCoursesLine, {
|
|
65
55
|
size: "small"
|
|
66
56
|
});
|
|
67
57
|
|
|
68
|
-
var ShareList = (_dec = (0,
|
|
58
|
+
var ShareList = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
69
59
|
(0, _inherits2.default)(ShareList, _Component);
|
|
70
60
|
|
|
71
61
|
var _super = (0, _createSuper2.default)(ShareList);
|
|
@@ -112,7 +102,7 @@ var ShareList = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
112
102
|
entity: entity,
|
|
113
103
|
isEntityRemoved: isEntityRemoved
|
|
114
104
|
};
|
|
115
|
-
return
|
|
105
|
+
return (0, _emotion.jsx)(_index.ContextualIconButton, {
|
|
116
106
|
context: context // eslint-disable-next-line react/jsx-no-literals
|
|
117
107
|
,
|
|
118
108
|
"data-automation": "sdk-unshare-bank-entity-".concat(entity.get('entityId')),
|
|
@@ -136,34 +126,34 @@ var ShareList = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
136
126
|
return sb.get('id') == entity.get('id');
|
|
137
127
|
}) || (0, _immutable.Map)();
|
|
138
128
|
var originalPermission = originalEntity.get('permission', _quizCommon.READ_ONLY);
|
|
139
|
-
return
|
|
129
|
+
return (0, _emotion.jsx)(_uiGrid.Grid.Row, {
|
|
140
130
|
key: entity.get('entityId'),
|
|
141
131
|
"data-automation": "sdk-shared-with-entity-row"
|
|
142
|
-
},
|
|
132
|
+
}, (0, _emotion.jsx)(_uiGrid.Grid.Col, {
|
|
143
133
|
width: 1
|
|
144
|
-
}, isCourse ? _ref4 :
|
|
134
|
+
}, isCourse ? _ref4 : (0, _emotion.jsx)(_uiAvatar.Avatar, {
|
|
145
135
|
name: entity.get('title'),
|
|
146
136
|
src: entity.get('avatar'),
|
|
147
137
|
size: "small"
|
|
148
|
-
})),
|
|
149
|
-
|
|
138
|
+
})), (0, _emotion.jsx)(_uiGrid.Grid.Col, null, (0, _emotion.jsx)("span", {
|
|
139
|
+
css: isEntityRemoved ? _this.props.styles.labelRemoved : null,
|
|
150
140
|
"data-automation": isEntityRemoved ? 'sdk-shared-entity-removed' : null
|
|
151
|
-
}, entity.get('title'))), _this.props.improvedBankSharingEnabled && !isOnlyEntity &&
|
|
141
|
+
}, entity.get('title'))), _this.props.improvedBankSharingEnabled && !isOnlyEntity && (0, _emotion.jsx)(_uiGrid.Grid.Col, {
|
|
152
142
|
width: "auto"
|
|
153
|
-
},
|
|
143
|
+
}, (0, _emotion.jsx)(_uiSimpleSelect.SimpleSelect, {
|
|
154
144
|
onChange: _this.handlePermissionChange(entity),
|
|
155
145
|
value: entity.get('permission') === _quizCommon.REMOVED_ACCESS ? originalPermission : entity.get('permission'),
|
|
156
|
-
renderLabel:
|
|
146
|
+
renderLabel: (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Access for {entity}', {
|
|
157
147
|
entity: entity.get('title')
|
|
158
148
|
})),
|
|
159
149
|
disabled: isEntityRemoved || !_this.props.canEdit
|
|
160
|
-
},
|
|
150
|
+
}, (0, _emotion.jsx)(_uiSimpleSelect.SimpleSelect.Option, {
|
|
161
151
|
id: "share-list-select-option-can-view",
|
|
162
152
|
value: _quizCommon.READ_ONLY
|
|
163
|
-
}, (0, _formatMessage.default)('Can view')),
|
|
153
|
+
}, (0, _formatMessage.default)('Can view')), (0, _emotion.jsx)(_uiSimpleSelect.SimpleSelect.Option, {
|
|
164
154
|
id: "share-list-select-option-can-edit",
|
|
165
155
|
value: _quizCommon.CAN_EDIT
|
|
166
|
-
}, (0, _formatMessage.default)('Can edit')))),
|
|
156
|
+
}, (0, _formatMessage.default)('Can edit')))), (0, _emotion.jsx)(_uiGrid.Grid.Col, {
|
|
167
157
|
width: "auto"
|
|
168
158
|
}, !isOnlyEntity && _this.props.canEdit && (_this.props.improvedBankSharingEnabled || !isCourse) && _this.removeButton(entity, isEntityRemoved)));
|
|
169
159
|
};
|
|
@@ -175,10 +165,10 @@ var ShareList = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
175
165
|
key: "renderNewEntities",
|
|
176
166
|
value: function renderNewEntities() {
|
|
177
167
|
if (!this.props.newEntities.isEmpty()) {
|
|
178
|
-
return
|
|
168
|
+
return (0, _emotion.jsx)(_uiView.View, {
|
|
179
169
|
as: "div",
|
|
180
170
|
margin: "0 0 medium 0"
|
|
181
|
-
},
|
|
171
|
+
}, (0, _emotion.jsx)(_uiGrid.Grid, {
|
|
182
172
|
vAlign: "middle"
|
|
183
173
|
}, this.props.newEntities.map(this.renderEntity)));
|
|
184
174
|
}
|
|
@@ -201,39 +191,39 @@ var ShareList = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
201
191
|
var existingCourses = existingShares.filter(function (s) {
|
|
202
192
|
return s.get('entityType') === _quizCommon.SHARED_WITH_COURSE;
|
|
203
193
|
});
|
|
204
|
-
return
|
|
194
|
+
return (0, _emotion.jsx)("div", {
|
|
205
195
|
className: "fs-mask"
|
|
206
|
-
}, !subAccountBankSharingEnabled &&
|
|
196
|
+
}, !subAccountBankSharingEnabled && (0, _emotion.jsx)(_uiText.Text, {
|
|
207
197
|
as: "div",
|
|
208
198
|
weight: "bold"
|
|
209
|
-
}, (0, _formatMessage.default)('Currently shared with')),
|
|
199
|
+
}, (0, _formatMessage.default)('Currently shared with')), (0, _emotion.jsx)(_uiView.View, {
|
|
210
200
|
as: "div",
|
|
211
201
|
"data-automation": "sdk-shared-bank-user-list"
|
|
212
|
-
}, !subAccountBankSharingEnabled && this.renderNewEntities(),
|
|
202
|
+
}, !subAccountBankSharingEnabled && this.renderNewEntities(), (0, _emotion.jsx)(_uiTabs.Tabs, {
|
|
213
203
|
onRequestTabChange: this.handleTabChange
|
|
214
|
-
},
|
|
204
|
+
}, (0, _emotion.jsx)(_uiTabs.Tabs.Panel, {
|
|
215
205
|
renderTitle: (0, _formatMessage.default)('People ({ peopleCount })', {
|
|
216
206
|
peopleCount: existingPeople.size
|
|
217
207
|
}),
|
|
218
208
|
isSelected: this.state.selectedTabIndex === 0,
|
|
219
209
|
padding: "large 0 0 0"
|
|
220
|
-
}, subAccountBankSharingEnabled && this.props.renderSearchSection(_quizCommon.SHARED_WITH_USER), subAccountBankSharingEnabled &&
|
|
210
|
+
}, subAccountBankSharingEnabled && this.props.renderSearchSection(_quizCommon.SHARED_WITH_USER), subAccountBankSharingEnabled && (0, _emotion.jsx)(_uiText.Text, {
|
|
221
211
|
as: "div",
|
|
222
212
|
weight: "bold",
|
|
223
213
|
lineHeight: "double"
|
|
224
|
-
}, (0, _formatMessage.default)('Currently shared with')),
|
|
214
|
+
}, (0, _formatMessage.default)('Currently shared with')), (0, _emotion.jsx)(_uiGrid.Grid, {
|
|
225
215
|
vAlign: "middle"
|
|
226
|
-
}, existingPeople.map(this.renderEntity))), (!existingCourses.isEmpty() || subAccountBankSharingEnabled) &&
|
|
216
|
+
}, existingPeople.map(this.renderEntity))), (!existingCourses.isEmpty() || subAccountBankSharingEnabled) && (0, _emotion.jsx)(_uiTabs.Tabs.Panel, {
|
|
227
217
|
renderTitle: (0, _formatMessage.default)('Courses ({ coursesCount })', {
|
|
228
218
|
coursesCount: existingCourses.size
|
|
229
219
|
}),
|
|
230
220
|
isSelected: this.state.selectedTabIndex === 1,
|
|
231
221
|
padding: "large 0 0 0"
|
|
232
|
-
}, subAccountBankSharingEnabled && this.props.renderSearchSection(_quizCommon.SHARED_WITH_COURSE), subAccountBankSharingEnabled &&
|
|
222
|
+
}, subAccountBankSharingEnabled && this.props.renderSearchSection(_quizCommon.SHARED_WITH_COURSE), subAccountBankSharingEnabled && (0, _emotion.jsx)(_uiText.Text, {
|
|
233
223
|
as: "div",
|
|
234
224
|
weight: "bold",
|
|
235
225
|
lineHeight: "double"
|
|
236
|
-
}, (0, _formatMessage.default)('Currently shared with')),
|
|
226
|
+
}, (0, _formatMessage.default)('Currently shared with')), (0, _emotion.jsx)(_uiGrid.Grid, {
|
|
237
227
|
vAlign: "middle"
|
|
238
228
|
}, existingCourses.map(this.renderEntity))))));
|
|
239
229
|
}
|
|
@@ -256,7 +246,9 @@ var ShareList = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
256
246
|
permission: _propTypes.default.string.isRequired,
|
|
257
247
|
id: _propTypes.default.string.isRequired
|
|
258
248
|
})).isRequired,
|
|
259
|
-
subAccountBankSharingEnabled: _propTypes.default.bool.isRequired
|
|
249
|
+
subAccountBankSharingEnabled: _propTypes.default.bool.isRequired,
|
|
250
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
251
|
+
styles: _propTypes.default.object
|
|
260
252
|
}, _class2.defaultProps = {
|
|
261
253
|
newEntities: (0, _immutable.List)(),
|
|
262
254
|
sharedBanks: (0, _immutable.List)()
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
9
|
+
return {
|
|
10
|
+
labelRemoved: {
|
|
11
|
+
textDecoration: 'line-through'
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var _default = generateStyle;
|
|
17
|
+
exports.default = _default;
|
|
@@ -55,7 +55,7 @@ var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
|
55
55
|
|
|
56
56
|
var _uiSimpleSelect = require("@instructure/ui-simple-select");
|
|
57
57
|
|
|
58
|
-
var
|
|
58
|
+
var _emotion = require("@instructure/emotion");
|
|
59
59
|
|
|
60
60
|
var _ElementsForSelectors = _interopRequireDefault(require("../../../common/util/ElementsForSelectors.js"));
|
|
61
61
|
|
|
@@ -67,31 +67,25 @@ var _asyncSearch = _interopRequireDefault(require("./asyncSearch.js"));
|
|
|
67
67
|
|
|
68
68
|
var _Spinner = _interopRequireDefault(require("../../../common/components/shared/spinner/Spinner.js"));
|
|
69
69
|
|
|
70
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
71
|
+
|
|
70
72
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
71
73
|
|
|
72
74
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
73
75
|
|
|
74
76
|
var _dec, _class, _class2, _temp;
|
|
75
77
|
|
|
76
|
-
var styles = {
|
|
77
|
-
componentId: 'ccksF',
|
|
78
|
-
template: function template(theme) {
|
|
79
|
-
return "\n\n.ccksF_fatK{border-bottom:solid ".concat(theme.separatorBorderWidth || 'inherit', ";border-color:").concat(theme.separatorColor || 'inherit', ";margin:").concat(theme.separatorMargin || 'inherit', " 0;padding:0;width:100%}");
|
|
80
|
-
},
|
|
81
|
-
'separator': 'ccksF_fatK'
|
|
82
|
-
};
|
|
83
|
-
|
|
84
78
|
var noop = function noop() {};
|
|
85
79
|
|
|
86
|
-
var _ref6 =
|
|
80
|
+
var _ref6 = (0, _emotion.jsx)(_uiGrid.Grid.Col, {
|
|
87
81
|
width: "auto"
|
|
88
|
-
},
|
|
82
|
+
}, (0, _emotion.jsx)(_uiIcons.IconAdminLine, {
|
|
89
83
|
size: "medium"
|
|
90
84
|
}));
|
|
91
85
|
|
|
92
|
-
var _ref7 =
|
|
86
|
+
var _ref7 = (0, _emotion.jsx)(_Spinner.default, null);
|
|
93
87
|
|
|
94
|
-
var SharingModalPresenter = (_dec = (0,
|
|
88
|
+
var SharingModalPresenter = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
95
89
|
(0, _inherits2.default)(SharingModalPresenter, _Component);
|
|
96
90
|
|
|
97
91
|
var _super = (0, _createSuper2.default)(SharingModalPresenter);
|
|
@@ -415,10 +409,10 @@ var SharingModalPresenter = (_dec = (0, _uiThemeable.themeable)(_theme.default,
|
|
|
415
409
|
|
|
416
410
|
_this.renderSearchSection = function (searchType) {
|
|
417
411
|
if (_this.props.bank.canEdit()) {
|
|
418
|
-
return
|
|
412
|
+
return (0, _emotion.jsx)(_react.default.Fragment, null, (0, _emotion.jsx)(_uiGrid.Grid, {
|
|
419
413
|
vAlign: "bottom",
|
|
420
414
|
colSpacing: "small"
|
|
421
|
-
},
|
|
415
|
+
}, (0, _emotion.jsx)(_uiGrid.Grid.Row, null, (0, _emotion.jsx)(_uiGrid.Grid.Col, null, (0, _emotion.jsx)(_asyncSearch.default, {
|
|
422
416
|
getShareableCourses: _this.props.getShareableCourses,
|
|
423
417
|
getShareableUsers: _this.props.getShareableUsers,
|
|
424
418
|
improvedBankSharingEnabled: _this.props.improvedBankSharingEnabled,
|
|
@@ -427,27 +421,27 @@ var SharingModalPresenter = (_dec = (0, _uiThemeable.themeable)(_theme.default,
|
|
|
427
421
|
searchType: searchType,
|
|
428
422
|
selectedOption: _this.state.searchSelection,
|
|
429
423
|
selectionFilter: _this.handleSearchFilter
|
|
430
|
-
})), _this.props.improvedBankSharingEnabled &&
|
|
424
|
+
})), _this.props.improvedBankSharingEnabled && (0, _emotion.jsx)(_uiGrid.Grid.Col, {
|
|
431
425
|
width: "auto"
|
|
432
|
-
},
|
|
426
|
+
}, (0, _emotion.jsx)(_uiSimpleSelect.SimpleSelect, {
|
|
433
427
|
onChange: _this.handleSearchPermissionChange,
|
|
434
428
|
value: _this.state.searchPermission,
|
|
435
429
|
renderLabel: (0, _formatMessage.default)('Access')
|
|
436
|
-
},
|
|
430
|
+
}, (0, _emotion.jsx)(_uiSimpleSelect.SimpleSelect.Option, {
|
|
437
431
|
id: "sharing-modal-search-section-select-option-can-view",
|
|
438
432
|
value: _quizCommon.READ_ONLY
|
|
439
|
-
}, (0, _formatMessage.default)('Can view')),
|
|
433
|
+
}, (0, _formatMessage.default)('Can view')), (0, _emotion.jsx)(_uiSimpleSelect.SimpleSelect.Option, {
|
|
440
434
|
id: "sharing-modal-search-section-select-option-can-edit",
|
|
441
435
|
value: _quizCommon.CAN_EDIT
|
|
442
|
-
}, (0, _formatMessage.default)('Can edit')))),
|
|
436
|
+
}, (0, _formatMessage.default)('Can edit')))), (0, _emotion.jsx)(_uiGrid.Grid.Col, {
|
|
443
437
|
width: "auto"
|
|
444
|
-
},
|
|
438
|
+
}, (0, _emotion.jsx)(_uiButtons.Button, {
|
|
445
439
|
"data-automation": "sdk-shared-bank-add-user-button",
|
|
446
440
|
ref: _this.handleShareButtonRef,
|
|
447
441
|
onClick: _this.handleShare,
|
|
448
442
|
color: _this.state.searchSelection.length ? 'success' : 'secondary'
|
|
449
|
-
}, (0, _formatMessage.default)('Add'))))),
|
|
450
|
-
|
|
443
|
+
}, (0, _formatMessage.default)('Add'))))), (0, _emotion.jsx)("div", {
|
|
444
|
+
css: _this.props.styles.separator
|
|
451
445
|
}));
|
|
452
446
|
}
|
|
453
447
|
};
|
|
@@ -496,30 +490,30 @@ var SharingModalPresenter = (_dec = (0, _uiThemeable.themeable)(_theme.default,
|
|
|
496
490
|
improvedBankSharingEnabled = _this$props2.improvedBankSharingEnabled;
|
|
497
491
|
|
|
498
492
|
if (improvedBankSharingEnabled && (currentUser === null || currentUser === void 0 ? void 0 : currentUser.bank_admin)) {
|
|
499
|
-
return
|
|
493
|
+
return (0, _emotion.jsx)(_uiView.View, {
|
|
500
494
|
as: "div",
|
|
501
495
|
margin: "0 0 medium 0"
|
|
502
|
-
},
|
|
496
|
+
}, (0, _emotion.jsx)(_uiGrid.Grid, {
|
|
503
497
|
colSpacing: "small"
|
|
504
|
-
},
|
|
498
|
+
}, (0, _emotion.jsx)(_uiGrid.Grid.Row, null, _ref6, (0, _emotion.jsx)(_uiGrid.Grid.Col, null, (0, _emotion.jsx)(_uiView.View, {
|
|
505
499
|
as: "div",
|
|
506
500
|
padding: "0 0 x-small 0"
|
|
507
|
-
}, currentUser && currentUser.account_name || (0, _formatMessage.default)('Account')),
|
|
501
|
+
}, currentUser && currentUser.account_name || (0, _formatMessage.default)('Account')), (0, _emotion.jsx)(_uiCheckbox.Checkbox, {
|
|
508
502
|
label: (0, _formatMessage.default)('Share with Institution'),
|
|
509
503
|
variant: "toggle",
|
|
510
504
|
value: "accountPermission",
|
|
511
505
|
checked: this.isSharedWithAccount(),
|
|
512
506
|
onChange: this.toggleAccountShare
|
|
513
|
-
})), this.isSharedWithAccount() &&
|
|
507
|
+
})), this.isSharedWithAccount() && (0, _emotion.jsx)(_uiGrid.Grid.Col, {
|
|
514
508
|
width: "auto"
|
|
515
|
-
},
|
|
509
|
+
}, (0, _emotion.jsx)(_uiSimpleSelect.SimpleSelect, {
|
|
516
510
|
onChange: this.handleAccountPermissionChange,
|
|
517
511
|
value: this.state.accountPermission,
|
|
518
|
-
renderLabel:
|
|
519
|
-
},
|
|
512
|
+
renderLabel: (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Access for account'))
|
|
513
|
+
}, (0, _emotion.jsx)(_uiSimpleSelect.SimpleSelect.Option, {
|
|
520
514
|
id: "sharing-modal-account-perm-select-option-can-view",
|
|
521
515
|
value: _quizCommon.READ_ONLY
|
|
522
|
-
}, (0, _formatMessage.default)('Can view')),
|
|
516
|
+
}, (0, _formatMessage.default)('Can view')), (0, _emotion.jsx)(_uiSimpleSelect.SimpleSelect.Option, {
|
|
523
517
|
id: "sharing-modal-account-perm-select-option-can-edit",
|
|
524
518
|
value: _quizCommon.CAN_EDIT
|
|
525
519
|
}, (0, _formatMessage.default)('Can edit')))))));
|
|
@@ -528,7 +522,7 @@ var SharingModalPresenter = (_dec = (0, _uiThemeable.themeable)(_theme.default,
|
|
|
528
522
|
}, {
|
|
529
523
|
key: "renderEntitiesSection",
|
|
530
524
|
value: function renderEntitiesSection() {
|
|
531
|
-
return
|
|
525
|
+
return (0, _emotion.jsx)(_index.default, {
|
|
532
526
|
canEdit: this.props.bank.canEdit(),
|
|
533
527
|
entitiesWithChangedPermission: this.state.entitiesWithChangedPermission,
|
|
534
528
|
improvedBankSharingEnabled: this.props.improvedBankSharingEnabled,
|
|
@@ -550,19 +544,19 @@ var SharingModalPresenter = (_dec = (0, _uiThemeable.themeable)(_theme.default,
|
|
|
550
544
|
key: "renderFooter",
|
|
551
545
|
value: function renderFooter() {
|
|
552
546
|
if (this.props.subAccountBankSharingEnabled) {
|
|
553
|
-
return
|
|
547
|
+
return (0, _emotion.jsx)(_uiButtons.Button, {
|
|
554
548
|
color: "primary",
|
|
555
549
|
margin: "0 x-small 0 0",
|
|
556
550
|
onClick: this.handleDismiss
|
|
557
551
|
}, (0, _formatMessage.default)('Close'));
|
|
558
552
|
}
|
|
559
553
|
|
|
560
|
-
return
|
|
554
|
+
return (0, _emotion.jsx)(_react.default.Fragment, null, (0, _emotion.jsx)(_uiButtons.Button, {
|
|
561
555
|
"data-automation": "sdk-shared-bank-cancel-button",
|
|
562
556
|
color: "primary-inverse",
|
|
563
557
|
onClick: this.handleDismiss,
|
|
564
558
|
margin: "0 x-small 0 0"
|
|
565
|
-
}, (0, _formatMessage.default)('Cancel')),
|
|
559
|
+
}, (0, _formatMessage.default)('Cancel')), (0, _emotion.jsx)(_uiButtons.Button, {
|
|
566
560
|
"data-automation": "sdk-shared-bank-done-button",
|
|
567
561
|
color: "primary",
|
|
568
562
|
onClick: this.handleSubmit,
|
|
@@ -573,19 +567,19 @@ var SharingModalPresenter = (_dec = (0, _uiThemeable.themeable)(_theme.default,
|
|
|
573
567
|
key: "render",
|
|
574
568
|
value: function render() {
|
|
575
569
|
var subAccountBankSharingEnabled = this.props.subAccountBankSharingEnabled;
|
|
576
|
-
return
|
|
570
|
+
return (0, _emotion.jsx)(_quizCommon.Modal, {
|
|
577
571
|
open: this.props.isOpen,
|
|
578
572
|
onDismiss: this.handleDismiss,
|
|
579
573
|
size: "medium",
|
|
580
574
|
label: (0, _formatMessage.default)('Sharing'),
|
|
581
575
|
shouldCloseOnDocumentClick: true,
|
|
582
576
|
onOpen: this.checkForSharedBanks
|
|
583
|
-
},
|
|
577
|
+
}, (0, _emotion.jsx)(_quizCommon.ModalHeader, null, (0, _emotion.jsx)(_uiHeading.Heading, null, this.props.bank.title), (0, _emotion.jsx)(_uiButtons.CloseButton, {
|
|
584
578
|
onClick: this.handleDismiss,
|
|
585
579
|
placement: "end",
|
|
586
580
|
offset: "medium",
|
|
587
581
|
screenReaderLabel: (0, _formatMessage.default)('Close')
|
|
588
|
-
})),
|
|
582
|
+
})), (0, _emotion.jsx)(_quizCommon.ModalBody, null, !subAccountBankSharingEnabled && this.renderAccountPermissions(), !subAccountBankSharingEnabled && this.renderSearchSection(), this.state.shares.size > 0 ? this.renderEntitiesSection() : _ref7), (0, _emotion.jsx)(_quizCommon.ModalFooter, null, this.renderFooter()));
|
|
589
583
|
}
|
|
590
584
|
}]);
|
|
591
585
|
SharingModalPresenter.displayName = "SharingModalPresenter";
|
|
@@ -622,7 +616,9 @@ var SharingModalPresenter = (_dec = (0, _uiThemeable.themeable)(_theme.default,
|
|
|
622
616
|
updateBank: _propTypes.default.func.isRequired,
|
|
623
617
|
updateSharedBankPermission: _propTypes.default.func.isRequired,
|
|
624
618
|
updateSharedCount: _propTypes.default.func,
|
|
625
|
-
withConfirm: _propTypes.default.func.isRequired
|
|
619
|
+
withConfirm: _propTypes.default.func.isRequired,
|
|
620
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
621
|
+
styles: _propTypes.default.object
|
|
626
622
|
}, _class2.defaultProps = {
|
|
627
623
|
bank: null,
|
|
628
624
|
currentUser: null,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
9
|
+
return {
|
|
10
|
+
separator: {
|
|
11
|
+
width: '100%',
|
|
12
|
+
margin: "".concat(componentTheme.separatorMargin, " 0"),
|
|
13
|
+
padding: 0,
|
|
14
|
+
borderBottom: "solid ".concat(componentTheme.separatorBorderWidth),
|
|
15
|
+
borderColor: componentTheme.separatorColor
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
var _default = generateStyle;
|
|
21
|
+
exports.default = _default;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
9
|
var colors = _ref.colors,
|
|
10
10
|
borders = _ref.borders,
|
|
11
11
|
spacing = _ref.spacing;
|
|
@@ -14,4 +14,7 @@ function generator(_ref) {
|
|
|
14
14
|
separatorBorderWidth: borders.widthSmall,
|
|
15
15
|
separatorMargin: spacing.medium
|
|
16
16
|
};
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var _default = generateComponentTheme;
|
|
20
|
+
exports.default = _default;
|