@elice/material-assignment 1.240306.0-runboxtutoring.0 → 1.240306.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/cjs/components/material-assignment/MaterialAssignment.d.ts +3 -3
- package/cjs/components/material-assignment/MaterialAssignment.js +22 -34
- package/cjs/components/material-assignment/MaterialAssignmentContent.js +195 -299
- package/cjs/components/material-assignment/MaterialAssignmentUploadModal.js +142 -185
- package/cjs/components/material-assignment/locales.d.ts +39 -0
- package/cjs/components/material-assignment/locales.js +81 -0
- package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.d.ts +2 -4
- package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.js +26 -35
- package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.styled.d.ts +2 -0
- package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.styled.js +17 -19
- package/cjs/components/material-assignment-admin/MaterialAssignmentAdminContent.js +565 -863
- package/cjs/components/material-assignment-admin/MaterialAssignmentAdminContentTa.js +314 -467
- package/cjs/components/shared/MaterialAssignmentContainer.js +13 -23
- package/es/components/material-assignment/MaterialAssignment.d.ts +3 -3
- package/es/components/material-assignment/MaterialAssignment.js +23 -29
- package/es/components/material-assignment/MaterialAssignmentContent.js +193 -292
- package/es/components/material-assignment/MaterialAssignmentUploadModal.js +140 -178
- package/es/components/material-assignment/locales.d.ts +39 -0
- package/es/components/material-assignment/locales.js +78 -0
- package/es/components/material-assignment-admin/MaterialAssignmentAdmin.d.ts +2 -4
- package/es/components/material-assignment-admin/MaterialAssignmentAdmin.js +27 -32
- package/es/components/material-assignment-admin/MaterialAssignmentAdmin.styled.d.ts +2 -0
- package/es/components/material-assignment-admin/MaterialAssignmentAdmin.styled.js +16 -16
- package/es/components/material-assignment-admin/MaterialAssignmentAdminContent.js +567 -860
- package/es/components/material-assignment-admin/MaterialAssignmentAdminContentTa.js +316 -464
- package/es/components/shared/MaterialAssignmentContainer.js +13 -19
- package/package.json +15 -12
- package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -383
- package/cjs/components/index.js +0 -9
- package/cjs/components/material-assignment/constants/color.d.ts +0 -1
- package/cjs/components/material-assignment/constants/color.js +0 -5
- package/cjs/components/material-assignment/index.js +0 -7
- package/cjs/components/material-assignment/locales/en.json.js +0 -7
- package/cjs/components/material-assignment/locales/index.d.ts +0 -4
- package/cjs/components/material-assignment/locales/index.js +0 -13
- package/cjs/components/material-assignment/locales/ja.json.js +0 -7
- package/cjs/components/material-assignment/locales/ko.json.js +0 -7
- package/cjs/components/material-assignment/locales/th.json.js +0 -7
- package/cjs/components/material-assignment-admin/index.js +0 -7
- package/cjs/components/material-assignment-admin/locales/en.json.js +0 -7
- package/cjs/components/material-assignment-admin/locales/index.d.ts +0 -4
- package/cjs/components/material-assignment-admin/locales/index.js +0 -13
- package/cjs/components/material-assignment-admin/locales/ja.json.js +0 -7
- package/cjs/components/material-assignment-admin/locales/ko.json.js +0 -7
- package/cjs/components/material-assignment-admin/locales/th.json.js +0 -7
- package/es/_virtual/_rollupPluginBabelHelpers.js +0 -374
- package/es/components/index.js +0 -2
- package/es/components/material-assignment/constants/color.d.ts +0 -1
- package/es/components/material-assignment/constants/color.js +0 -3
- package/es/components/material-assignment/index.js +0 -1
- package/es/components/material-assignment/locales/en.json.js +0 -3
- package/es/components/material-assignment/locales/index.d.ts +0 -4
- package/es/components/material-assignment/locales/index.js +0 -4
- package/es/components/material-assignment/locales/ja.json.js +0 -3
- package/es/components/material-assignment/locales/ko.json.js +0 -3
- package/es/components/material-assignment/locales/th.json.js +0 -3
- package/es/components/material-assignment-admin/index.js +0 -1
- package/es/components/material-assignment-admin/locales/en.json.js +0 -3
- package/es/components/material-assignment-admin/locales/index.d.ts +0 -4
- package/es/components/material-assignment-admin/locales/index.js +0 -4
- package/es/components/material-assignment-admin/locales/ja.json.js +0 -3
- package/es/components/material-assignment-admin/locales/ko.json.js +0 -3
- package/es/components/material-assignment-admin/locales/th.json.js +0 -3
|
@@ -1,104 +1,77 @@
|
|
|
1
|
-
import { slicedToArray as _slicedToArray, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
1
|
import React from 'react';
|
|
4
2
|
import { useForm, Controller } from 'react-hook-form';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
5
4
|
import { postOrgMaterialAssignmentSubmissionAdd } from '@elice/api-client';
|
|
6
|
-
import { Files, Modal, Alert, Vspace, Radio, RadioButton, Input, Checkbox, Text
|
|
5
|
+
import { Files, Notification, Modal, Alert, Vspace, Radio, RadioButton, Input, Checkbox, Text } from '@elice/blocks';
|
|
7
6
|
import { base } from '@elice/design-tokens';
|
|
8
|
-
import { useRawEliceIntl } from '@elice/intl';
|
|
9
7
|
import { validateUrl } from '@elice/utils';
|
|
10
8
|
import styled from 'styled-components';
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
const StyledAssignmentContentFiles = styled(Files).withConfig({
|
|
13
11
|
componentId: "sc-9bizrf-0"
|
|
14
12
|
})(["width:100%;.eb-files__choose-button{border-color:", ";background-color:", ";}"], base.color.primary5, base.color.primary5);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
const MaterialAssignmentUploadModal = ({
|
|
14
|
+
materialAssignment,
|
|
15
|
+
onClose,
|
|
16
|
+
onSubmitCallback
|
|
17
|
+
}) => {
|
|
18
|
+
const intl = useIntl();
|
|
19
|
+
const abortCtrl = React.useRef(new AbortController());
|
|
21
20
|
/** Select submission method */
|
|
22
|
-
|
|
23
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
24
|
-
assignmentMode = _React$useState2[0],
|
|
25
|
-
setAssignmentMode = _React$useState2[1];
|
|
21
|
+
const [assignmentMode, setAssignmentMode] = React.useState('attachment');
|
|
26
22
|
/** Check "Once you submit it, you cannot submit it again." */
|
|
27
|
-
|
|
28
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
29
|
-
isAgreedSubmit = _React$useState4[0],
|
|
30
|
-
setAgreedSubmit = _React$useState4[1];
|
|
23
|
+
const [isAgreedSubmit, setAgreedSubmit] = React.useState(false);
|
|
31
24
|
/** Check if the submission time is past */
|
|
32
|
-
|
|
25
|
+
const isAssignmentClosed = Boolean(materialAssignment.closeDatetime < Date.now());
|
|
33
26
|
/** Check if it is possible to resubmit */
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
const isAssignmentResubmitEnabled = Boolean(materialAssignment.isResubmitEnabled);
|
|
28
|
+
const {
|
|
29
|
+
control,
|
|
30
|
+
formState,
|
|
31
|
+
handleSubmit,
|
|
32
|
+
reset
|
|
33
|
+
} = useForm({
|
|
34
|
+
mode: 'onChange'
|
|
35
|
+
});
|
|
42
36
|
/**
|
|
43
37
|
* Submit assignment.
|
|
44
38
|
*/
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (!(_context.t0.name === 'AbortError')) {
|
|
72
|
-
_context.next = 12;
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
return _context.abrupt("return", Notification.error(intl.formatMessage({
|
|
76
|
-
id: 'materialAssignment.notification.submit.cancel'
|
|
77
|
-
})));
|
|
78
|
-
case 12:
|
|
79
|
-
Notification.error(intl.formatMessage({
|
|
80
|
-
id: 'materialAssignment.notification.submit.failure'
|
|
81
|
-
}));
|
|
82
|
-
case 13:
|
|
83
|
-
case "end":
|
|
84
|
-
return _context.stop();
|
|
85
|
-
}
|
|
86
|
-
}, _callee, null, [[0, 8]]);
|
|
87
|
-
}));
|
|
88
|
-
return function (_x) {
|
|
89
|
-
return _ref2.apply(this, arguments);
|
|
90
|
-
};
|
|
91
|
-
}());
|
|
39
|
+
const submitAssignment = handleSubmit(async data => {
|
|
40
|
+
var _a;
|
|
41
|
+
try {
|
|
42
|
+
await postOrgMaterialAssignmentSubmissionAdd(Object.assign(Object.assign({}, data), {
|
|
43
|
+
materialAssignmentId: (_a = materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.id) !== null && _a !== void 0 ? _a : 0
|
|
44
|
+
}), {
|
|
45
|
+
signal: abortCtrl.current.signal
|
|
46
|
+
});
|
|
47
|
+
onClose();
|
|
48
|
+
Notification.success(intl.formatMessage({
|
|
49
|
+
id: 'materialAssignment.notification.submit.success'
|
|
50
|
+
}));
|
|
51
|
+
if (typeof onSubmitCallback === 'function') {
|
|
52
|
+
onSubmitCallback();
|
|
53
|
+
}
|
|
54
|
+
} catch (error) {
|
|
55
|
+
if (error.name === 'AbortError') {
|
|
56
|
+
return Notification.error(intl.formatMessage({
|
|
57
|
+
id: 'materialAssignment.notification.submit.cancel'
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
Notification.error(intl.formatMessage({
|
|
61
|
+
id: 'materialAssignment.notification.submit.failure'
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
});
|
|
92
65
|
//
|
|
93
66
|
//
|
|
94
67
|
//
|
|
95
|
-
React.useEffect(
|
|
96
|
-
|
|
97
|
-
return
|
|
68
|
+
React.useEffect(() => {
|
|
69
|
+
const _abortCtrl = abortCtrl.current;
|
|
70
|
+
return () => {
|
|
98
71
|
_abortCtrl.abort();
|
|
99
72
|
};
|
|
100
73
|
}, []);
|
|
101
|
-
return
|
|
74
|
+
return React.createElement(Modal, {
|
|
102
75
|
title: intl.formatMessage({
|
|
103
76
|
id: 'materialAssignment.modal.title'
|
|
104
77
|
}),
|
|
@@ -116,108 +89,97 @@ var MaterialAssignmentUploadModal = function MaterialAssignmentUploadModal(_ref)
|
|
|
116
89
|
role: 'gray1',
|
|
117
90
|
onClick: onClose
|
|
118
91
|
}],
|
|
119
|
-
onHide: onClose
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
onChange
|
|
174
|
-
if (Array.isArray(newFiles) && newFiles[0] instanceof File) {
|
|
175
|
-
field.onChange(newFiles[0]);
|
|
176
|
-
} else {
|
|
177
|
-
field.onChange(undefined);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}));
|
|
181
|
-
}
|
|
182
|
-
}) : jsx(Controller, {
|
|
183
|
-
control: control,
|
|
184
|
-
name: "assignmentUrl",
|
|
185
|
-
rules: {
|
|
186
|
-
required: true,
|
|
187
|
-
validate: function validate(url) {
|
|
188
|
-
return validateUrl(url !== null && url !== void 0 ? url : '') ? true : intl.formatMessage({
|
|
189
|
-
id: 'materialAssignment.input.invalid'
|
|
190
|
-
});
|
|
92
|
+
onHide: onClose
|
|
93
|
+
}, React.createElement(Alert, {
|
|
94
|
+
role: isAssignmentResubmitEnabled ? 'primary' : 'warning'
|
|
95
|
+
}, intl.formatMessage({
|
|
96
|
+
id: isAssignmentResubmitEnabled ? 'materialAssignment.alert.oftenSubmit' : 'materialAssignment.alert.onceSubmit'
|
|
97
|
+
})), React.createElement(Vspace, {
|
|
98
|
+
height: 1.5
|
|
99
|
+
}), React.createElement(Radio, {
|
|
100
|
+
purpleWhite: true,
|
|
101
|
+
borderRound: true,
|
|
102
|
+
value: assignmentMode,
|
|
103
|
+
onChange: value => {
|
|
104
|
+
reset();
|
|
105
|
+
setAgreedSubmit(false);
|
|
106
|
+
setAssignmentMode(value);
|
|
107
|
+
}
|
|
108
|
+
}, React.createElement(RadioButton, {
|
|
109
|
+
value: "attachment"
|
|
110
|
+
}, intl.formatMessage({
|
|
111
|
+
id: 'materialAssignment.radio.option.attachment'
|
|
112
|
+
})), React.createElement(RadioButton, {
|
|
113
|
+
value: "url"
|
|
114
|
+
}, intl.formatMessage({
|
|
115
|
+
id: 'materialAssignment.radio.option.url'
|
|
116
|
+
}))), React.createElement(Vspace, {
|
|
117
|
+
height: 1
|
|
118
|
+
}), assignmentMode === 'attachment' ? React.createElement(Controller, {
|
|
119
|
+
control: control,
|
|
120
|
+
name: "assignmentFile",
|
|
121
|
+
rules: {
|
|
122
|
+
required: true
|
|
123
|
+
},
|
|
124
|
+
render: ({
|
|
125
|
+
field
|
|
126
|
+
}) => React.createElement(StyledAssignmentContentFiles, Object.assign({}, field, {
|
|
127
|
+
ref: null,
|
|
128
|
+
files: field.value ? [field.value] : undefined,
|
|
129
|
+
accept: "*",
|
|
130
|
+
maxCount: 1,
|
|
131
|
+
maxSize: 300,
|
|
132
|
+
disabled: isAssignmentClosed,
|
|
133
|
+
dropMessage: intl.formatMessage({
|
|
134
|
+
id: 'materialAssignment.attachment.dropMessage'
|
|
135
|
+
}),
|
|
136
|
+
buttonMessage: intl.formatMessage({
|
|
137
|
+
id: 'materialAssignment.attachment.button'
|
|
138
|
+
}),
|
|
139
|
+
maxSizeMessage: intl.formatMessage({
|
|
140
|
+
id: 'materialAssignment.attachment.maxSizeMessage'
|
|
141
|
+
}),
|
|
142
|
+
onChange: newFiles => {
|
|
143
|
+
if (Array.isArray(newFiles) && newFiles[0] instanceof File) {
|
|
144
|
+
field.onChange(newFiles[0]);
|
|
145
|
+
} else {
|
|
146
|
+
field.onChange(undefined);
|
|
191
147
|
}
|
|
192
|
-
},
|
|
193
|
-
render: function render(_ref4) {
|
|
194
|
-
var field = _ref4.field,
|
|
195
|
-
fieldState = _ref4.fieldState;
|
|
196
|
-
var _a;
|
|
197
|
-
return jsx(Input, Object.assign({}, field, {
|
|
198
|
-
width: "full",
|
|
199
|
-
size: "small",
|
|
200
|
-
placeholder: "http(s)://",
|
|
201
|
-
invalid: fieldState.invalid,
|
|
202
|
-
invalidText: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message
|
|
203
|
-
}));
|
|
204
148
|
}
|
|
205
|
-
})
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
149
|
+
}))
|
|
150
|
+
}) : React.createElement(Controller, {
|
|
151
|
+
control: control,
|
|
152
|
+
name: "assignmentUrl",
|
|
153
|
+
rules: {
|
|
154
|
+
required: true,
|
|
155
|
+
validate: url => validateUrl(url !== null && url !== void 0 ? url : '') ? true : intl.formatMessage({
|
|
156
|
+
id: 'materialAssignment.input.invalid'
|
|
157
|
+
})
|
|
158
|
+
},
|
|
159
|
+
render: ({
|
|
160
|
+
field,
|
|
161
|
+
fieldState
|
|
162
|
+
}) => {
|
|
163
|
+
var _a;
|
|
164
|
+
return React.createElement(Input, Object.assign({}, field, {
|
|
165
|
+
width: "full",
|
|
209
166
|
size: "small",
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
167
|
+
placeholder: "http(s)://",
|
|
168
|
+
invalid: fieldState.invalid,
|
|
169
|
+
invalidText: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message
|
|
170
|
+
}));
|
|
171
|
+
}
|
|
172
|
+
}), isAssignmentResubmitEnabled ? null : React.createElement(React.Fragment, null, React.createElement(Vspace, {
|
|
173
|
+
height: 1
|
|
174
|
+
}), React.createElement(Checkbox, {
|
|
175
|
+
size: "small",
|
|
176
|
+
value: isAgreedSubmit,
|
|
177
|
+
onChange: setAgreedSubmit
|
|
178
|
+
}, React.createElement(Text, {
|
|
179
|
+
size: "small"
|
|
180
|
+
}, intl.formatMessage({
|
|
181
|
+
id: 'materialAssignment.attachment.checkbox.onceSubmit'
|
|
182
|
+
})))));
|
|
221
183
|
};
|
|
222
184
|
|
|
223
185
|
export { MaterialAssignmentUploadModal as default };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const en: {
|
|
2
|
+
'materialAssignment.button.upload': string;
|
|
3
|
+
'materialAssignment.error': string;
|
|
4
|
+
'materialAssignment.status.noSubmitted': string;
|
|
5
|
+
'materialAssignment.status.submitted': string;
|
|
6
|
+
'materialAssignment.status.graded': string;
|
|
7
|
+
'materialAssignment.status.deadlineExpired': string;
|
|
8
|
+
'materialAssignment.table.column.status': string;
|
|
9
|
+
'materialAssignment.table.column.deadlineDatetime': string;
|
|
10
|
+
'materialAssignment.table.column.lastSubmitDatetime': string;
|
|
11
|
+
'materialAssignment.table.column.uploadedFile': string;
|
|
12
|
+
'materialAssignment.table.column.assignmentScore': string;
|
|
13
|
+
'materialAssignment.table.column.score': string;
|
|
14
|
+
'materialAssignment.table.column.totalPoint': string;
|
|
15
|
+
'materialAssignment.table.header.index': string;
|
|
16
|
+
'materialAssignment.table.header.feedback': string;
|
|
17
|
+
'materialAssignment.table.empty.noAssignment': string;
|
|
18
|
+
'materialAssignment.table.empty.noFeedback': string;
|
|
19
|
+
'materialAssignment.label.general': string;
|
|
20
|
+
'materialAssignment.label.feedback': string;
|
|
21
|
+
'materialAssignment.description.general': string;
|
|
22
|
+
'materialAssignment.description.feedback': string;
|
|
23
|
+
'materialAssignment.notification.submit.success': string;
|
|
24
|
+
'materialAssignment.notification.submit.failure': string;
|
|
25
|
+
'materialAssignment.notification.submit.cancel': string;
|
|
26
|
+
'materialAssignment.modal.title': string;
|
|
27
|
+
'materialAssignment.modal.button.submit': string;
|
|
28
|
+
'materialAssignment.modal.button.cancel': string;
|
|
29
|
+
'materialAssignment.alert.onceSubmit': string;
|
|
30
|
+
'materialAssignment.alert.oftenSubmit': string;
|
|
31
|
+
'materialAssignment.radio.option.attachment': string;
|
|
32
|
+
'materialAssignment.radio.option.url': string;
|
|
33
|
+
'materialAssignment.attachment.dropMessage': string;
|
|
34
|
+
'materialAssignment.attachment.maxSizeMessage': string;
|
|
35
|
+
'materialAssignment.attachment.button': string;
|
|
36
|
+
'materialAssignment.attachment.checkbox.onceSubmit': string;
|
|
37
|
+
'materialAssignment.input.invalid': string;
|
|
38
|
+
};
|
|
39
|
+
export declare const ko: typeof en;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const en = {
|
|
2
|
+
'materialAssignment.button.upload': 'Upload assignment',
|
|
3
|
+
'materialAssignment.error': 'Failed to fetch assignment',
|
|
4
|
+
'materialAssignment.status.noSubmitted': 'No submitted',
|
|
5
|
+
'materialAssignment.status.submitted': 'Submitted',
|
|
6
|
+
'materialAssignment.status.graded': 'Graded',
|
|
7
|
+
'materialAssignment.status.deadlineExpired': 'Deadline expired',
|
|
8
|
+
'materialAssignment.table.column.status': 'Status',
|
|
9
|
+
'materialAssignment.table.column.deadlineDatetime': 'Deadline datetime',
|
|
10
|
+
'materialAssignment.table.column.lastSubmitDatetime': 'Last submit datetime',
|
|
11
|
+
'materialAssignment.table.column.uploadedFile': 'Uploaded file',
|
|
12
|
+
'materialAssignment.table.column.assignmentScore': 'Assignment Score',
|
|
13
|
+
'materialAssignment.table.column.score': '{score}',
|
|
14
|
+
'materialAssignment.table.column.totalPoint': '/ {point} point',
|
|
15
|
+
'materialAssignment.table.header.index': 'Index',
|
|
16
|
+
'materialAssignment.table.header.feedback': 'Feedback',
|
|
17
|
+
'materialAssignment.table.empty.noAssignment': 'Grading has not been completed yet.',
|
|
18
|
+
'materialAssignment.table.empty.noFeedback': 'No feedback has been created.',
|
|
19
|
+
'materialAssignment.label.general': 'General',
|
|
20
|
+
'materialAssignment.label.feedback': 'Feedback',
|
|
21
|
+
'materialAssignment.description.general': 'You can view basic information related to the task.',
|
|
22
|
+
'materialAssignment.description.feedback': 'Check your feedback.',
|
|
23
|
+
'materialAssignment.notification.submit.success': 'Assignment has been submitted.',
|
|
24
|
+
'materialAssignment.notification.submit.failure': 'Error occurred while submitting assignment.',
|
|
25
|
+
'materialAssignment.notification.submit.cancel': 'The assignment submission has been canceled.',
|
|
26
|
+
'materialAssignment.modal.title': 'Upload assignment',
|
|
27
|
+
'materialAssignment.modal.button.submit': 'Submit',
|
|
28
|
+
'materialAssignment.modal.button.cancel': 'Cancel',
|
|
29
|
+
'materialAssignment.alert.onceSubmit': 'The number of submissions is limited to one. Please note that the assignment cannot be modified after submission.',
|
|
30
|
+
'materialAssignment.alert.oftenSubmit': 'You can modify and resubmit it before the deadline after submission.',
|
|
31
|
+
'materialAssignment.radio.option.attachment': 'Attachment',
|
|
32
|
+
'materialAssignment.radio.option.url': 'URL',
|
|
33
|
+
'materialAssignment.attachment.dropMessage': 'Add files with drag and drop.',
|
|
34
|
+
'materialAssignment.attachment.maxSizeMessage': 'Up to 300MB can be uploaded.',
|
|
35
|
+
'materialAssignment.attachment.button': 'Select file',
|
|
36
|
+
'materialAssignment.attachment.checkbox.onceSubmit': 'I have checked all the circumstances and agree to submit the assignment.',
|
|
37
|
+
'materialAssignment.input.invalid': 'The URL is not of a valid format.'
|
|
38
|
+
};
|
|
39
|
+
const ko = {
|
|
40
|
+
'materialAssignment.button.upload': '과제 업로드',
|
|
41
|
+
'materialAssignment.error': '과제를 불러오는데 실패했습니다.\n잠시 후 다시 시도해주세요.',
|
|
42
|
+
'materialAssignment.status.noSubmitted': '미제출',
|
|
43
|
+
'materialAssignment.status.submitted': '제출됨',
|
|
44
|
+
'materialAssignment.status.graded': '채점 완료',
|
|
45
|
+
'materialAssignment.status.deadlineExpired': '제출 기한 만료',
|
|
46
|
+
'materialAssignment.table.column.status': '상태',
|
|
47
|
+
'materialAssignment.table.column.deadlineDatetime': '과제 제출 기한',
|
|
48
|
+
'materialAssignment.table.column.lastSubmitDatetime': '제출 일시',
|
|
49
|
+
'materialAssignment.table.column.uploadedFile': '업로드한 과제',
|
|
50
|
+
'materialAssignment.table.column.assignmentScore': '과제 점수',
|
|
51
|
+
'materialAssignment.table.column.score': '{score}점',
|
|
52
|
+
'materialAssignment.table.column.totalPoint': '/ {point}점 만점',
|
|
53
|
+
'materialAssignment.table.header.index': '번호',
|
|
54
|
+
'materialAssignment.table.header.feedback': '피드백',
|
|
55
|
+
'materialAssignment.table.empty.noAssignment': '아직 채점이 완료되지 않았습니다.',
|
|
56
|
+
'materialAssignment.table.empty.noFeedback': '작성된 피드백이 없습니다.',
|
|
57
|
+
'materialAssignment.label.general': '기본 정보',
|
|
58
|
+
'materialAssignment.label.feedback': '피드백',
|
|
59
|
+
'materialAssignment.description.general': '과제와 관련된 기본 정보를 볼 수 있습니다.',
|
|
60
|
+
'materialAssignment.description.feedback': '선생님의 피드백을 확인해 보세요.',
|
|
61
|
+
'materialAssignment.notification.submit.success': '과제가 제출되었습니다.',
|
|
62
|
+
'materialAssignment.notification.submit.failure': '과제 제출 중 문제가 발생하였습니다.',
|
|
63
|
+
'materialAssignment.notification.submit.cancel': '과제 제출을 취소하였습니다.',
|
|
64
|
+
'materialAssignment.modal.title': '과제 업로드',
|
|
65
|
+
'materialAssignment.modal.button.submit': '저장',
|
|
66
|
+
'materialAssignment.modal.button.cancel': '취소',
|
|
67
|
+
'materialAssignment.alert.onceSubmit': '제출 횟수가 1회로 제한됩니다. 제출 후 과제 수정이 불가하니 유의해 주세요.',
|
|
68
|
+
'materialAssignment.alert.oftenSubmit': '제출 마감 기한 전까지 다시 제출할 수 있습니다.',
|
|
69
|
+
'materialAssignment.radio.option.attachment': '파일 업로드',
|
|
70
|
+
'materialAssignment.radio.option.url': 'URL 입력',
|
|
71
|
+
'materialAssignment.attachment.dropMessage': '드래그 앤 드롭으로 파일을 추가하세요.',
|
|
72
|
+
'materialAssignment.attachment.maxSizeMessage': '최대 300MB까지 업로드 가능합니다.',
|
|
73
|
+
'materialAssignment.attachment.button': '파일 선택',
|
|
74
|
+
'materialAssignment.attachment.checkbox.onceSubmit': '모든 상황을 확인했으며 과제 제출에 동의합니다.',
|
|
75
|
+
'materialAssignment.input.invalid': '올바른 형식의 URL이 아닙니다.'
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export { en, ko };
|
|
@@ -10,7 +10,5 @@ export interface MaterialAssignmentAdminProps {
|
|
|
10
10
|
courseRole: enums.CourseRole;
|
|
11
11
|
updateMaterialUserBrowserResponse?: (userId: number) => void;
|
|
12
12
|
}
|
|
13
|
-
declare const
|
|
14
|
-
|
|
15
|
-
} & React.RefAttributes<MaterialAssignmentAdminApis>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl">, "ref"> & React.RefAttributes<MaterialAssignmentAdminApis>>;
|
|
16
|
-
export default _default;
|
|
13
|
+
declare const MaterialAssignmentAdmin: React.ForwardRefExoticComponent<MaterialAssignmentAdminProps & React.RefAttributes<MaterialAssignmentAdminApis>>;
|
|
14
|
+
export default MaterialAssignmentAdmin;
|
|
@@ -1,59 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { IntlProvider } from 'react-intl';
|
|
3
3
|
import { config } from '@elice/api-client';
|
|
4
4
|
import { Flex, Spinner } from '@elice/blocks';
|
|
5
|
-
import { RawEliceIntlProvider, IntlComponentBuilder } from '@elice/intl';
|
|
6
5
|
import { useMaterialConfigApiClientUpdate } from '@elice/material-shared-utils';
|
|
7
6
|
import { enums } from '@elice/types';
|
|
8
7
|
import classnames from 'classnames';
|
|
9
|
-
import messageEn from './locales/en.json.js';
|
|
10
|
-
import messageKo from './locales/ko.json.js';
|
|
11
8
|
import MaterialAssignmentAdminContent from './MaterialAssignmentAdminContent.js';
|
|
12
9
|
import MaterialAssignmentAdminContentTa from './MaterialAssignmentAdminContentTa.js';
|
|
13
10
|
import { StyledMaterialAssignmentAdminContainer } from './MaterialAssignmentAdmin.styled.js';
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
const MaterialAssignmentAdmin = forwardRef(({
|
|
13
|
+
locale = 'en',
|
|
14
|
+
className,
|
|
15
|
+
materialAssignmentId,
|
|
16
|
+
userId,
|
|
17
|
+
adminUserId,
|
|
18
|
+
courseRole,
|
|
19
|
+
updateMaterialUserBrowserResponse
|
|
20
|
+
}, ref) => {
|
|
21
|
+
const prefixCls = 'em-material-assignment-admin';
|
|
24
22
|
// TODO: initialize in custom hook or withMaterial hoc.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
const isReady = useMaterialConfigApiClientUpdate(config.init);
|
|
24
|
+
const isCourseRoleAboveTa = courseRole > enums.CourseRole.TA;
|
|
25
|
+
const renderContent = () => {
|
|
28
26
|
if (!isReady) {
|
|
29
|
-
return
|
|
27
|
+
return React.createElement(Flex, {
|
|
30
28
|
align: "center",
|
|
31
29
|
justify: "center",
|
|
32
30
|
width: "100%",
|
|
33
|
-
height: "100%"
|
|
34
|
-
|
|
35
|
-
});
|
|
31
|
+
height: "100%"
|
|
32
|
+
}, React.createElement(Spinner, null));
|
|
36
33
|
}
|
|
37
|
-
return isCourseRoleAboveTa ?
|
|
34
|
+
return isCourseRoleAboveTa ? React.createElement(MaterialAssignmentAdminContent, {
|
|
38
35
|
ref: ref,
|
|
39
36
|
userId: userId,
|
|
40
37
|
adminUserId: adminUserId,
|
|
41
38
|
materialAssignmentId: materialAssignmentId,
|
|
42
39
|
updateMaterialUserBrowserResponse: updateMaterialUserBrowserResponse
|
|
43
|
-
}) :
|
|
40
|
+
}) : React.createElement(MaterialAssignmentAdminContentTa, {
|
|
44
41
|
userId: userId,
|
|
45
42
|
adminUserId: adminUserId,
|
|
46
43
|
materialAssignmentId: materialAssignmentId
|
|
47
44
|
});
|
|
48
45
|
};
|
|
49
|
-
return
|
|
50
|
-
className: classnames(prefixCls, className)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
});
|
|
46
|
+
return React.createElement(StyledMaterialAssignmentAdminContainer, {
|
|
47
|
+
className: classnames(prefixCls, className)
|
|
48
|
+
}, React.createElement(IntlProvider, {
|
|
49
|
+
locale: locale,
|
|
50
|
+
defaultLocale: "en"
|
|
51
|
+
}, renderContent()));
|
|
56
52
|
});
|
|
57
|
-
var MaterialAssignmentAdmin$1 = new IntlComponentBuilder(MaterialAssignmentAdmin).add('en', messageEn).add('ko', messageKo).addAsync('th', import('./locales/th.json.js')).addAsync('ja', import('./locales/ja.json.js')).build();
|
|
58
53
|
|
|
59
|
-
export { MaterialAssignmentAdmin
|
|
54
|
+
export { MaterialAssignmentAdmin as default };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Text } from '@elice/blocks';
|
|
3
3
|
export declare const StyledMaterialAssignmentAdminContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const StyledMaterialAssignmentAdminHeader: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elice/blocks").FlexProps & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
5
|
+
export declare const StyledMaterialAssignmentAdminHeaderCell: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
6
|
export declare const StyledMaterialAssignmentAdminGradeWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elice/blocks").FlexProps & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
5
7
|
export declare const StyledMaterialAssignmentAdminTextareaWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
8
|
export declare const StyledMaterialAssignmentAdminManualScoreEditButtonWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
@@ -2,26 +2,26 @@ import { Flex, Text } from '@elice/blocks';
|
|
|
2
2
|
import { base } from '@elice/design-tokens';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const StyledMaterialAssignmentAdminContainer = styled.div.withConfig({
|
|
6
6
|
componentId: "sc-1czd3o6-0"
|
|
7
7
|
})(["display:flex;flex-direction:column;align-items:center;width:100%;height:100%;background-color:", ";"], base.color.navy9);
|
|
8
|
-
|
|
8
|
+
const StyledMaterialAssignmentAdminHeader = styled(Flex).withConfig({
|
|
9
9
|
componentId: "sc-1czd3o6-1"
|
|
10
|
-
})(["background-color:", ";
|
|
11
|
-
|
|
10
|
+
})(["background-color:", ";"], base.color.navy8);
|
|
11
|
+
const StyledMaterialAssignmentAdminHeaderCell = styled.div.withConfig({
|
|
12
12
|
componentId: "sc-1czd3o6-2"
|
|
13
|
-
})(["
|
|
14
|
-
|
|
13
|
+
})(["display:flex;flex-direction:column;align-items:flex-end;justify-content:space-between;padding:0 1.5rem;height:100%;border-right:1px solid ", ";&:last-of-type{border-right:none;}"], base.color.gray6);
|
|
14
|
+
const StyledMaterialAssignmentAdminGradeWrapper = styled(Flex).withConfig({
|
|
15
15
|
componentId: "sc-1czd3o6-3"
|
|
16
|
-
})(["
|
|
17
|
-
|
|
18
|
-
}, function (props) {
|
|
19
|
-
return props.disabled ? 0.5 : 1;
|
|
20
|
-
});
|
|
21
|
-
var StyledMaterialAssignmentAdminManualScoreEditButton = styled(Text).withConfig({
|
|
16
|
+
})(["background-color:", ";width:100%;padding:0 1.5rem;height:4.5rem;border:1px solid ", ";border-radius:0.5rem;"], base.color.navy7, base.color.navy6);
|
|
17
|
+
const StyledMaterialAssignmentAdminTextareaWrapper = styled.div.withConfig({
|
|
22
18
|
componentId: "sc-1czd3o6-4"
|
|
23
|
-
})(["
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
})(["background-color:", ";"], base.color.gray2);
|
|
20
|
+
const StyledMaterialAssignmentAdminManualScoreEditButtonWrapper = styled.div.withConfig({
|
|
21
|
+
componentId: "sc-1czd3o6-5"
|
|
22
|
+
})(["cursor:", ";opacity:", ";"], props => props.disabled ? 'not-allowed' : 'pointer', props => props.disabled ? 0.5 : 1);
|
|
23
|
+
const StyledMaterialAssignmentAdminManualScoreEditButton = styled(Text).withConfig({
|
|
24
|
+
componentId: "sc-1czd3o6-6"
|
|
25
|
+
})(["pointer-events:", ";"], props => props.disabled ? 'none' : 'auto');
|
|
26
26
|
|
|
27
|
-
export { StyledMaterialAssignmentAdminContainer, StyledMaterialAssignmentAdminGradeWrapper, StyledMaterialAssignmentAdminManualScoreEditButton, StyledMaterialAssignmentAdminManualScoreEditButtonWrapper, StyledMaterialAssignmentAdminTextareaWrapper };
|
|
27
|
+
export { StyledMaterialAssignmentAdminContainer, StyledMaterialAssignmentAdminGradeWrapper, StyledMaterialAssignmentAdminHeader, StyledMaterialAssignmentAdminHeaderCell, StyledMaterialAssignmentAdminManualScoreEditButton, StyledMaterialAssignmentAdminManualScoreEditButtonWrapper, StyledMaterialAssignmentAdminTextareaWrapper };
|