@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
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [20.2.0](https://gerrit.instructure.com/quizzes-ui/compare/v20.1.0...v20.2.0) (2024-01-19)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/quiz-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [20.1.0](https://gerrit.instructure.com/quizzes-ui/compare/v20.0.0...v20.1.0) (2024-01-16)
|
|
7
15
|
|
|
8
16
|
|
|
@@ -5,7 +5,8 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { Component } from 'react';
|
|
9
10
|
import ReactDOM from 'react-dom';
|
|
10
11
|
import PropTypes from 'prop-types';
|
|
11
12
|
import { Children } from '@instructure/ui-prop-types';
|
|
@@ -14,23 +15,16 @@ import { CloseButton, Button } from '@instructure/ui-buttons';
|
|
|
14
15
|
import { Breadcrumb, BreadcrumbLink } from '@instructure/ui-breadcrumb';
|
|
15
16
|
import { IconBankLine } from '@instructure/ui-icons';
|
|
16
17
|
import { View } from '@instructure/ui-view';
|
|
17
|
-
import {
|
|
18
|
+
import { withStyle, jsx, Global } from '@instructure/emotion';
|
|
18
19
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
'nav': 'fooBc_diTj',
|
|
25
|
-
'crumbs': 'fooBc_ZXRE'
|
|
26
|
-
};
|
|
27
|
-
import theme from "./theme.js";
|
|
28
|
-
|
|
29
|
-
var _ref = /*#__PURE__*/React.createElement(IconBankLine, {
|
|
20
|
+
import generateStyle from "./styles.js";
|
|
21
|
+
import generateComponentTheme from "./theme.js";
|
|
22
|
+
|
|
23
|
+
var _ref = jsx(IconBankLine, {
|
|
30
24
|
size: "x-small"
|
|
31
25
|
});
|
|
32
26
|
|
|
33
|
-
var NavWrapper = (_dec =
|
|
27
|
+
var NavWrapper = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
34
28
|
_inherits(NavWrapper, _Component);
|
|
35
29
|
|
|
36
30
|
var _super = _createSuper(NavWrapper);
|
|
@@ -75,12 +69,12 @@ var NavWrapper = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class
|
|
|
75
69
|
var _this$props = this.props,
|
|
76
70
|
returnToUrl = _this$props.returnToUrl,
|
|
77
71
|
canvasReferrerLinkText = _this$props.canvasReferrerLinkText;
|
|
78
|
-
var canvasReferrerLink = returnToUrl && canvasReferrerLinkText &&
|
|
72
|
+
var canvasReferrerLink = returnToUrl && canvasReferrerLinkText && jsx(BreadcrumbLink, {
|
|
79
73
|
key: "Context",
|
|
80
74
|
href: returnToUrl,
|
|
81
75
|
target: "_top"
|
|
82
76
|
}, canvasReferrerLinkText);
|
|
83
|
-
var banksLinks =
|
|
77
|
+
var banksLinks = jsx(BreadcrumbLink, {
|
|
84
78
|
ref: this.setItemBanksRef,
|
|
85
79
|
renderIcon: _ref,
|
|
86
80
|
key: "Banks",
|
|
@@ -102,11 +96,11 @@ var NavWrapper = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class
|
|
|
102
96
|
returnToUrl = _this$props2.returnToUrl;
|
|
103
97
|
|
|
104
98
|
if (!closeTray && returnToUrl) {
|
|
105
|
-
return
|
|
99
|
+
return jsx(ReturnButton, {
|
|
106
100
|
returnToUrl: returnToUrl
|
|
107
101
|
});
|
|
108
102
|
} else if (navigateToBuild) {
|
|
109
|
-
return
|
|
103
|
+
return jsx(Button, {
|
|
110
104
|
onClick: navigateToBuild
|
|
111
105
|
}, t('Return'));
|
|
112
106
|
}
|
|
@@ -115,7 +109,7 @@ var NavWrapper = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class
|
|
|
115
109
|
key: "renderCloseButton",
|
|
116
110
|
value: function renderCloseButton() {
|
|
117
111
|
if (this.props.closeTray) {
|
|
118
|
-
return
|
|
112
|
+
return jsx(CloseButton, {
|
|
119
113
|
elementRef: this.setCloseButtonRef,
|
|
120
114
|
placement: "start",
|
|
121
115
|
onClick: this.props.closeTray,
|
|
@@ -126,11 +120,17 @@ var NavWrapper = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class
|
|
|
126
120
|
}, {
|
|
127
121
|
key: "render",
|
|
128
122
|
value: function render() {
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
123
|
+
return jsx(View, null, jsx(Global, {
|
|
124
|
+
styles: {
|
|
125
|
+
'body.tox-fullscreen .nav': {
|
|
126
|
+
'display': 'none'
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}), jsx("div", {
|
|
130
|
+
css: this.props.styles.nav
|
|
131
|
+
}, this.renderCloseButton(), jsx("div", {
|
|
132
|
+
css: this.props.styles.crumbs
|
|
133
|
+
}, jsx(Breadcrumb, {
|
|
134
134
|
size: "small",
|
|
135
135
|
label: t('You are here:')
|
|
136
136
|
}, this.renderBreadcrumbLinks())), this.renderReturnButton(), this.props.renderHeaderMenu()));
|
|
@@ -147,7 +147,9 @@ var NavWrapper = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class
|
|
|
147
147
|
renderHeaderMenu: PropTypes.func,
|
|
148
148
|
trayOpen: PropTypes.bool.isRequired,
|
|
149
149
|
returnToUrl: PropTypes.string,
|
|
150
|
-
canvasReferrerLinkText: PropTypes.string
|
|
150
|
+
canvasReferrerLinkText: PropTypes.string,
|
|
151
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
152
|
+
styles: PropTypes.object
|
|
151
153
|
}, _class2.defaultProps = {
|
|
152
154
|
children: null,
|
|
153
155
|
closeTray: null,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
nav: {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
flexDirection: 'row',
|
|
6
|
+
alignItems: 'center',
|
|
7
|
+
padding: "".concat(componentTheme.navPaddingTopBottom, " ").concat(componentTheme.navPaddingLeftRight),
|
|
8
|
+
borderBottom: "".concat(componentTheme.navBorderWidth, " solid ").concat(componentTheme.navBorderColor),
|
|
9
|
+
backgroundColor: componentTheme.navBackgroundColor,
|
|
10
|
+
position: 'sticky',
|
|
11
|
+
top: 0,
|
|
12
|
+
width: '100%',
|
|
13
|
+
boxSizing: 'border-box',
|
|
14
|
+
zIndex: 4444,
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* For MS Edge
|
|
18
|
+
* When they switch to chromium
|
|
19
|
+
* check to see if sticky works.
|
|
20
|
+
*/
|
|
21
|
+
'@supports (-ms-ime-align: auto)': {
|
|
22
|
+
position: 'relative'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
crumbs: {
|
|
26
|
+
flex: 1
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
borders = _ref.borders,
|
|
4
4
|
colors = _ref.colors,
|
|
@@ -14,4 +14,6 @@ export default function generator(_ref) {
|
|
|
14
14
|
bankIconFontSize: typography.fontSizeLarge,
|
|
15
15
|
bankIconPadding: spacing.xSmall
|
|
16
16
|
};
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default generateComponentTheme;
|
|
@@ -5,7 +5,8 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { Component } from 'react';
|
|
9
10
|
import PropTypes from 'prop-types';
|
|
10
11
|
import { List, Map } from 'immutable';
|
|
11
12
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
@@ -16,25 +17,18 @@ import { Grid } from '@instructure/ui-grid';
|
|
|
16
17
|
import { Text } from '@instructure/ui-text';
|
|
17
18
|
import { Avatar } from '@instructure/ui-avatar';
|
|
18
19
|
import { Tabs } from '@instructure/ui-tabs';
|
|
19
|
-
import {
|
|
20
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
20
21
|
import { ContextualIconButton } from "../ContextualIconButton/index.js";
|
|
21
22
|
import { SimpleSelect } from '@instructure/ui-simple-select';
|
|
22
|
-
|
|
23
|
-
componentId: 'edByO',
|
|
24
|
-
template: function template(theme) {
|
|
25
|
-
return "\n\n.edByO_bqPU{text-decoration:line-through}";
|
|
26
|
-
},
|
|
27
|
-
'labelRemoved': 'edByO_bqPU'
|
|
28
|
-
};
|
|
29
|
-
import theme from "./theme.js";
|
|
23
|
+
import generateStyle from "./styles.js";
|
|
30
24
|
import { CAN_EDIT, READ_ONLY, REMOVED_ACCESS, SHARED_WITH_USER, SHARED_WITH_COURSE } from '@instructure/quiz-common';
|
|
31
25
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
32
26
|
|
|
33
|
-
var _ref4 =
|
|
27
|
+
var _ref4 = jsx(IconCoursesLine, {
|
|
34
28
|
size: "small"
|
|
35
29
|
});
|
|
36
30
|
|
|
37
|
-
export var ShareList = (_dec =
|
|
31
|
+
export var ShareList = (_dec = withStyle(generateStyle, null), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
38
32
|
_inherits(ShareList, _Component);
|
|
39
33
|
|
|
40
34
|
var _super = _createSuper(ShareList);
|
|
@@ -81,7 +75,7 @@ export var ShareList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
81
75
|
entity: entity,
|
|
82
76
|
isEntityRemoved: isEntityRemoved
|
|
83
77
|
};
|
|
84
|
-
return
|
|
78
|
+
return jsx(ContextualIconButton, {
|
|
85
79
|
context: context // eslint-disable-next-line react/jsx-no-literals
|
|
86
80
|
,
|
|
87
81
|
"data-automation": "sdk-unshare-bank-entity-".concat(entity.get('entityId')),
|
|
@@ -103,34 +97,34 @@ export var ShareList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
103
97
|
return sb.get('id') == entity.get('id');
|
|
104
98
|
}) || Map();
|
|
105
99
|
var originalPermission = originalEntity.get('permission', READ_ONLY);
|
|
106
|
-
return
|
|
100
|
+
return jsx(Grid.Row, {
|
|
107
101
|
key: entity.get('entityId'),
|
|
108
102
|
"data-automation": "sdk-shared-with-entity-row"
|
|
109
|
-
},
|
|
103
|
+
}, jsx(Grid.Col, {
|
|
110
104
|
width: 1
|
|
111
|
-
}, isCourse ? _ref4 :
|
|
105
|
+
}, isCourse ? _ref4 : jsx(Avatar, {
|
|
112
106
|
name: entity.get('title'),
|
|
113
107
|
src: entity.get('avatar'),
|
|
114
108
|
size: "small"
|
|
115
|
-
})),
|
|
116
|
-
|
|
109
|
+
})), jsx(Grid.Col, null, jsx("span", {
|
|
110
|
+
css: isEntityRemoved ? _this.props.styles.labelRemoved : null,
|
|
117
111
|
"data-automation": isEntityRemoved ? 'sdk-shared-entity-removed' : null
|
|
118
|
-
}, entity.get('title'))), _this.props.improvedBankSharingEnabled && !isOnlyEntity &&
|
|
112
|
+
}, entity.get('title'))), _this.props.improvedBankSharingEnabled && !isOnlyEntity && jsx(Grid.Col, {
|
|
119
113
|
width: "auto"
|
|
120
|
-
},
|
|
114
|
+
}, jsx(SimpleSelect, {
|
|
121
115
|
onChange: _this.handlePermissionChange(entity),
|
|
122
116
|
value: entity.get('permission') === REMOVED_ACCESS ? originalPermission : entity.get('permission'),
|
|
123
|
-
renderLabel:
|
|
117
|
+
renderLabel: jsx(ScreenReaderContent, null, t('Access for {entity}', {
|
|
124
118
|
entity: entity.get('title')
|
|
125
119
|
})),
|
|
126
120
|
disabled: isEntityRemoved || !_this.props.canEdit
|
|
127
|
-
},
|
|
121
|
+
}, jsx(SimpleSelect.Option, {
|
|
128
122
|
id: "share-list-select-option-can-view",
|
|
129
123
|
value: READ_ONLY
|
|
130
|
-
}, t('Can view')),
|
|
124
|
+
}, t('Can view')), jsx(SimpleSelect.Option, {
|
|
131
125
|
id: "share-list-select-option-can-edit",
|
|
132
126
|
value: CAN_EDIT
|
|
133
|
-
}, t('Can edit')))),
|
|
127
|
+
}, t('Can edit')))), jsx(Grid.Col, {
|
|
134
128
|
width: "auto"
|
|
135
129
|
}, !isOnlyEntity && _this.props.canEdit && (_this.props.improvedBankSharingEnabled || !isCourse) && _this.removeButton(entity, isEntityRemoved)));
|
|
136
130
|
};
|
|
@@ -142,10 +136,10 @@ export var ShareList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
142
136
|
key: "renderNewEntities",
|
|
143
137
|
value: function renderNewEntities() {
|
|
144
138
|
if (!this.props.newEntities.isEmpty()) {
|
|
145
|
-
return
|
|
139
|
+
return jsx(View, {
|
|
146
140
|
as: "div",
|
|
147
141
|
margin: "0 0 medium 0"
|
|
148
|
-
},
|
|
142
|
+
}, jsx(Grid, {
|
|
149
143
|
vAlign: "middle"
|
|
150
144
|
}, this.props.newEntities.map(this.renderEntity)));
|
|
151
145
|
}
|
|
@@ -168,39 +162,39 @@ export var ShareList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
168
162
|
var existingCourses = existingShares.filter(function (s) {
|
|
169
163
|
return s.get('entityType') === SHARED_WITH_COURSE;
|
|
170
164
|
});
|
|
171
|
-
return
|
|
165
|
+
return jsx("div", {
|
|
172
166
|
className: "fs-mask"
|
|
173
|
-
}, !subAccountBankSharingEnabled &&
|
|
167
|
+
}, !subAccountBankSharingEnabled && jsx(Text, {
|
|
174
168
|
as: "div",
|
|
175
169
|
weight: "bold"
|
|
176
|
-
}, t('Currently shared with')),
|
|
170
|
+
}, t('Currently shared with')), jsx(View, {
|
|
177
171
|
as: "div",
|
|
178
172
|
"data-automation": "sdk-shared-bank-user-list"
|
|
179
|
-
}, !subAccountBankSharingEnabled && this.renderNewEntities(),
|
|
173
|
+
}, !subAccountBankSharingEnabled && this.renderNewEntities(), jsx(Tabs, {
|
|
180
174
|
onRequestTabChange: this.handleTabChange
|
|
181
|
-
},
|
|
175
|
+
}, jsx(Tabs.Panel, {
|
|
182
176
|
renderTitle: t('People ({ peopleCount })', {
|
|
183
177
|
peopleCount: existingPeople.size
|
|
184
178
|
}),
|
|
185
179
|
isSelected: this.state.selectedTabIndex === 0,
|
|
186
180
|
padding: "large 0 0 0"
|
|
187
|
-
}, subAccountBankSharingEnabled && this.props.renderSearchSection(SHARED_WITH_USER), subAccountBankSharingEnabled &&
|
|
181
|
+
}, subAccountBankSharingEnabled && this.props.renderSearchSection(SHARED_WITH_USER), subAccountBankSharingEnabled && jsx(Text, {
|
|
188
182
|
as: "div",
|
|
189
183
|
weight: "bold",
|
|
190
184
|
lineHeight: "double"
|
|
191
|
-
}, t('Currently shared with')),
|
|
185
|
+
}, t('Currently shared with')), jsx(Grid, {
|
|
192
186
|
vAlign: "middle"
|
|
193
|
-
}, existingPeople.map(this.renderEntity))), (!existingCourses.isEmpty() || subAccountBankSharingEnabled) &&
|
|
187
|
+
}, existingPeople.map(this.renderEntity))), (!existingCourses.isEmpty() || subAccountBankSharingEnabled) && jsx(Tabs.Panel, {
|
|
194
188
|
renderTitle: t('Courses ({ coursesCount })', {
|
|
195
189
|
coursesCount: existingCourses.size
|
|
196
190
|
}),
|
|
197
191
|
isSelected: this.state.selectedTabIndex === 1,
|
|
198
192
|
padding: "large 0 0 0"
|
|
199
|
-
}, subAccountBankSharingEnabled && this.props.renderSearchSection(SHARED_WITH_COURSE), subAccountBankSharingEnabled &&
|
|
193
|
+
}, subAccountBankSharingEnabled && this.props.renderSearchSection(SHARED_WITH_COURSE), subAccountBankSharingEnabled && jsx(Text, {
|
|
200
194
|
as: "div",
|
|
201
195
|
weight: "bold",
|
|
202
196
|
lineHeight: "double"
|
|
203
|
-
}, t('Currently shared with')),
|
|
197
|
+
}, t('Currently shared with')), jsx(Grid, {
|
|
204
198
|
vAlign: "middle"
|
|
205
199
|
}, existingCourses.map(this.renderEntity))))));
|
|
206
200
|
}
|
|
@@ -224,7 +218,9 @@ export var ShareList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
224
218
|
permission: PropTypes.string.isRequired,
|
|
225
219
|
id: PropTypes.string.isRequired
|
|
226
220
|
})).isRequired,
|
|
227
|
-
subAccountBankSharingEnabled: PropTypes.bool.isRequired
|
|
221
|
+
subAccountBankSharingEnabled: PropTypes.bool.isRequired,
|
|
222
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
223
|
+
styles: PropTypes.object
|
|
228
224
|
}, _class2.defaultProps = {
|
|
229
225
|
newEntities: List(),
|
|
230
226
|
sharedBanks: List()
|
|
@@ -10,6 +10,9 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
10
10
|
|
|
11
11
|
var _dec, _class, _class2, _temp;
|
|
12
12
|
|
|
13
|
+
/** @jsx jsx */
|
|
14
|
+
|
|
15
|
+
/* eslint-disable-next-line no-unused-vars*/
|
|
13
16
|
import React, { Component } from 'react';
|
|
14
17
|
import PropTypes from 'prop-types';
|
|
15
18
|
import { List, Map } from 'immutable';
|
|
@@ -24,33 +27,27 @@ import { View } from '@instructure/ui-view';
|
|
|
24
27
|
import { Grid } from '@instructure/ui-grid';
|
|
25
28
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
26
29
|
import { SimpleSelect } from '@instructure/ui-simple-select';
|
|
27
|
-
import {
|
|
30
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
28
31
|
import elementsForSelectors from "../../../common/util/ElementsForSelectors.js";
|
|
29
32
|
import CustomPropTypes from "../../../common/util/CustomPropTypes.js";
|
|
30
33
|
import ShareList from "./ShareList/index.js";
|
|
31
34
|
import AsyncSearch from "./asyncSearch.js";
|
|
32
35
|
import Spinner from "../../../common/components/shared/spinner/Spinner.js";
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
template: function template(theme) {
|
|
36
|
-
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%}");
|
|
37
|
-
},
|
|
38
|
-
'separator': 'ccksF_fatK'
|
|
39
|
-
};
|
|
40
|
-
import theme from "./theme.js";
|
|
36
|
+
import generateStyle from "./styles.js";
|
|
37
|
+
import generateComponentTheme from "./theme.js";
|
|
41
38
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
42
39
|
|
|
43
40
|
var noop = function noop() {};
|
|
44
41
|
|
|
45
|
-
var _ref6 =
|
|
42
|
+
var _ref6 = jsx(Grid.Col, {
|
|
46
43
|
width: "auto"
|
|
47
|
-
},
|
|
44
|
+
}, jsx(IconAdminLine, {
|
|
48
45
|
size: "medium"
|
|
49
46
|
}));
|
|
50
47
|
|
|
51
|
-
var _ref7 =
|
|
48
|
+
var _ref7 = jsx(Spinner, null);
|
|
52
49
|
|
|
53
|
-
export var SharingModalPresenter = (_dec =
|
|
50
|
+
export var SharingModalPresenter = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
54
51
|
_inherits(SharingModalPresenter, _Component);
|
|
55
52
|
|
|
56
53
|
var _super = _createSuper(SharingModalPresenter);
|
|
@@ -374,10 +371,10 @@ export var SharingModalPresenter = (_dec = themeable(theme, styles), _dec(_class
|
|
|
374
371
|
|
|
375
372
|
_this.renderSearchSection = function (searchType) {
|
|
376
373
|
if (_this.props.bank.canEdit()) {
|
|
377
|
-
return
|
|
374
|
+
return jsx(React.Fragment, null, jsx(Grid, {
|
|
378
375
|
vAlign: "bottom",
|
|
379
376
|
colSpacing: "small"
|
|
380
|
-
},
|
|
377
|
+
}, jsx(Grid.Row, null, jsx(Grid.Col, null, jsx(AsyncSearch, {
|
|
381
378
|
getShareableCourses: _this.props.getShareableCourses,
|
|
382
379
|
getShareableUsers: _this.props.getShareableUsers,
|
|
383
380
|
improvedBankSharingEnabled: _this.props.improvedBankSharingEnabled,
|
|
@@ -386,27 +383,27 @@ export var SharingModalPresenter = (_dec = themeable(theme, styles), _dec(_class
|
|
|
386
383
|
searchType: searchType,
|
|
387
384
|
selectedOption: _this.state.searchSelection,
|
|
388
385
|
selectionFilter: _this.handleSearchFilter
|
|
389
|
-
})), _this.props.improvedBankSharingEnabled &&
|
|
386
|
+
})), _this.props.improvedBankSharingEnabled && jsx(Grid.Col, {
|
|
390
387
|
width: "auto"
|
|
391
|
-
},
|
|
388
|
+
}, jsx(SimpleSelect, {
|
|
392
389
|
onChange: _this.handleSearchPermissionChange,
|
|
393
390
|
value: _this.state.searchPermission,
|
|
394
391
|
renderLabel: t('Access')
|
|
395
|
-
},
|
|
392
|
+
}, jsx(SimpleSelect.Option, {
|
|
396
393
|
id: "sharing-modal-search-section-select-option-can-view",
|
|
397
394
|
value: READ_ONLY
|
|
398
|
-
}, t('Can view')),
|
|
395
|
+
}, t('Can view')), jsx(SimpleSelect.Option, {
|
|
399
396
|
id: "sharing-modal-search-section-select-option-can-edit",
|
|
400
397
|
value: CAN_EDIT
|
|
401
|
-
}, t('Can edit')))),
|
|
398
|
+
}, t('Can edit')))), jsx(Grid.Col, {
|
|
402
399
|
width: "auto"
|
|
403
|
-
},
|
|
400
|
+
}, jsx(Button, {
|
|
404
401
|
"data-automation": "sdk-shared-bank-add-user-button",
|
|
405
402
|
ref: _this.handleShareButtonRef,
|
|
406
403
|
onClick: _this.handleShare,
|
|
407
404
|
color: _this.state.searchSelection.length ? 'success' : 'secondary'
|
|
408
|
-
}, t('Add'))))),
|
|
409
|
-
|
|
405
|
+
}, t('Add'))))), jsx("div", {
|
|
406
|
+
css: _this.props.styles.separator
|
|
410
407
|
}));
|
|
411
408
|
}
|
|
412
409
|
};
|
|
@@ -455,30 +452,30 @@ export var SharingModalPresenter = (_dec = themeable(theme, styles), _dec(_class
|
|
|
455
452
|
improvedBankSharingEnabled = _this$props2.improvedBankSharingEnabled;
|
|
456
453
|
|
|
457
454
|
if (improvedBankSharingEnabled && (currentUser === null || currentUser === void 0 ? void 0 : currentUser.bank_admin)) {
|
|
458
|
-
return
|
|
455
|
+
return jsx(View, {
|
|
459
456
|
as: "div",
|
|
460
457
|
margin: "0 0 medium 0"
|
|
461
|
-
},
|
|
458
|
+
}, jsx(Grid, {
|
|
462
459
|
colSpacing: "small"
|
|
463
|
-
},
|
|
460
|
+
}, jsx(Grid.Row, null, _ref6, jsx(Grid.Col, null, jsx(View, {
|
|
464
461
|
as: "div",
|
|
465
462
|
padding: "0 0 x-small 0"
|
|
466
|
-
}, currentUser && currentUser.account_name || t('Account')),
|
|
463
|
+
}, currentUser && currentUser.account_name || t('Account')), jsx(Checkbox, {
|
|
467
464
|
label: t('Share with Institution'),
|
|
468
465
|
variant: "toggle",
|
|
469
466
|
value: "accountPermission",
|
|
470
467
|
checked: this.isSharedWithAccount(),
|
|
471
468
|
onChange: this.toggleAccountShare
|
|
472
|
-
})), this.isSharedWithAccount() &&
|
|
469
|
+
})), this.isSharedWithAccount() && jsx(Grid.Col, {
|
|
473
470
|
width: "auto"
|
|
474
|
-
},
|
|
471
|
+
}, jsx(SimpleSelect, {
|
|
475
472
|
onChange: this.handleAccountPermissionChange,
|
|
476
473
|
value: this.state.accountPermission,
|
|
477
|
-
renderLabel:
|
|
478
|
-
},
|
|
474
|
+
renderLabel: jsx(ScreenReaderContent, null, t('Access for account'))
|
|
475
|
+
}, jsx(SimpleSelect.Option, {
|
|
479
476
|
id: "sharing-modal-account-perm-select-option-can-view",
|
|
480
477
|
value: READ_ONLY
|
|
481
|
-
}, t('Can view')),
|
|
478
|
+
}, t('Can view')), jsx(SimpleSelect.Option, {
|
|
482
479
|
id: "sharing-modal-account-perm-select-option-can-edit",
|
|
483
480
|
value: CAN_EDIT
|
|
484
481
|
}, t('Can edit')))))));
|
|
@@ -487,7 +484,7 @@ export var SharingModalPresenter = (_dec = themeable(theme, styles), _dec(_class
|
|
|
487
484
|
}, {
|
|
488
485
|
key: "renderEntitiesSection",
|
|
489
486
|
value: function renderEntitiesSection() {
|
|
490
|
-
return
|
|
487
|
+
return jsx(ShareList, {
|
|
491
488
|
canEdit: this.props.bank.canEdit(),
|
|
492
489
|
entitiesWithChangedPermission: this.state.entitiesWithChangedPermission,
|
|
493
490
|
improvedBankSharingEnabled: this.props.improvedBankSharingEnabled,
|
|
@@ -509,19 +506,19 @@ export var SharingModalPresenter = (_dec = themeable(theme, styles), _dec(_class
|
|
|
509
506
|
key: "renderFooter",
|
|
510
507
|
value: function renderFooter() {
|
|
511
508
|
if (this.props.subAccountBankSharingEnabled) {
|
|
512
|
-
return
|
|
509
|
+
return jsx(Button, {
|
|
513
510
|
color: "primary",
|
|
514
511
|
margin: "0 x-small 0 0",
|
|
515
512
|
onClick: this.handleDismiss
|
|
516
513
|
}, t('Close'));
|
|
517
514
|
}
|
|
518
515
|
|
|
519
|
-
return
|
|
516
|
+
return jsx(React.Fragment, null, jsx(Button, {
|
|
520
517
|
"data-automation": "sdk-shared-bank-cancel-button",
|
|
521
518
|
color: "primary-inverse",
|
|
522
519
|
onClick: this.handleDismiss,
|
|
523
520
|
margin: "0 x-small 0 0"
|
|
524
|
-
}, t('Cancel')),
|
|
521
|
+
}, t('Cancel')), jsx(Button, {
|
|
525
522
|
"data-automation": "sdk-shared-bank-done-button",
|
|
526
523
|
color: "primary",
|
|
527
524
|
onClick: this.handleSubmit,
|
|
@@ -532,19 +529,19 @@ export var SharingModalPresenter = (_dec = themeable(theme, styles), _dec(_class
|
|
|
532
529
|
key: "render",
|
|
533
530
|
value: function render() {
|
|
534
531
|
var subAccountBankSharingEnabled = this.props.subAccountBankSharingEnabled;
|
|
535
|
-
return
|
|
532
|
+
return jsx(Modal, {
|
|
536
533
|
open: this.props.isOpen,
|
|
537
534
|
onDismiss: this.handleDismiss,
|
|
538
535
|
size: "medium",
|
|
539
536
|
label: t('Sharing'),
|
|
540
537
|
shouldCloseOnDocumentClick: true,
|
|
541
538
|
onOpen: this.checkForSharedBanks
|
|
542
|
-
},
|
|
539
|
+
}, jsx(ModalHeader, null, jsx(Heading, null, this.props.bank.title), jsx(CloseButton, {
|
|
543
540
|
onClick: this.handleDismiss,
|
|
544
541
|
placement: "end",
|
|
545
542
|
offset: "medium",
|
|
546
543
|
screenReaderLabel: t('Close')
|
|
547
|
-
})),
|
|
544
|
+
})), jsx(ModalBody, null, !subAccountBankSharingEnabled && this.renderAccountPermissions(), !subAccountBankSharingEnabled && this.renderSearchSection(), this.state.shares.size > 0 ? this.renderEntitiesSection() : _ref7), jsx(ModalFooter, null, this.renderFooter()));
|
|
548
545
|
}
|
|
549
546
|
}]);
|
|
550
547
|
|
|
@@ -582,7 +579,9 @@ export var SharingModalPresenter = (_dec = themeable(theme, styles), _dec(_class
|
|
|
582
579
|
updateBank: PropTypes.func.isRequired,
|
|
583
580
|
updateSharedBankPermission: PropTypes.func.isRequired,
|
|
584
581
|
updateSharedCount: PropTypes.func,
|
|
585
|
-
withConfirm: PropTypes.func.isRequired
|
|
582
|
+
withConfirm: PropTypes.func.isRequired,
|
|
583
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
584
|
+
styles: PropTypes.object
|
|
586
585
|
}, _class2.defaultProps = {
|
|
587
586
|
bank: null,
|
|
588
587
|
currentUser: null,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
separator: {
|
|
4
|
+
width: '100%',
|
|
5
|
+
margin: "".concat(componentTheme.separatorMargin, " 0"),
|
|
6
|
+
padding: 0,
|
|
7
|
+
borderBottom: "solid ".concat(componentTheme.separatorBorderWidth),
|
|
8
|
+
borderColor: componentTheme.separatorColor
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var colors = _ref.colors,
|
|
3
3
|
borders = _ref.borders,
|
|
4
4
|
spacing = _ref.spacing;
|
|
@@ -7,4 +7,6 @@ export default function generator(_ref) {
|
|
|
7
7
|
separatorBorderWidth: borders.widthSmall,
|
|
8
8
|
separatorMargin: spacing.medium
|
|
9
9
|
};
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default generateComponentTheme;
|