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