@elice/material-assignment 1.230325.0 → 1.230418.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/_virtual/_rollupPluginBabelHelpers.js +393 -0
- package/cjs/components/material-assignment/MaterialAssignment.js +12 -11
- package/cjs/components/material-assignment/MaterialAssignmentContent.js +100 -105
- package/cjs/components/material-assignment/MaterialAssignmentUploadModal.js +113 -93
- package/cjs/components/material-assignment/locales.js +2 -2
- package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.js +19 -20
- package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.styled.js +15 -9
- package/cjs/components/material-assignment-admin/MaterialAssignmentAdminContent.js +363 -281
- package/cjs/components/material-assignment-admin/MaterialAssignmentAdminContentTa.js +157 -126
- package/cjs/components/shared/MaterialAssignmentContainer.js +9 -9
- package/cjs/index.js +2 -2
- package/es/_virtual/_rollupPluginBabelHelpers.js +382 -0
- package/es/components/material-assignment/MaterialAssignment.js +8 -9
- package/es/components/material-assignment/MaterialAssignmentContent.js +95 -102
- package/es/components/material-assignment/MaterialAssignmentUploadModal.js +111 -93
- package/es/components/material-assignment/locales.js +2 -2
- package/es/components/material-assignment-admin/MaterialAssignmentAdmin.js +14 -17
- package/es/components/material-assignment-admin/MaterialAssignmentAdmin.styled.js +15 -9
- package/es/components/material-assignment-admin/MaterialAssignmentAdminContent.js +361 -281
- package/es/components/material-assignment-admin/MaterialAssignmentAdminContentTa.js +154 -125
- package/es/components/shared/MaterialAssignmentContainer.js +6 -8
- package/package.json +8 -8
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
3
6
|
var React = require('react');
|
|
4
7
|
var reactHookForm = require('react-hook-form');
|
|
5
8
|
var reactIntl = require('react-intl');
|
|
@@ -17,129 +20,173 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
17
20
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
18
21
|
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
materialAssignmentId,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const gradeEditFormMethods = reactHookForm.useForm({
|
|
23
|
+
var MaterialAssignmentAdminContentTa = function MaterialAssignmentAdminContentTa(_ref) {
|
|
24
|
+
var materialAssignmentId = _ref.materialAssignmentId,
|
|
25
|
+
userId = _ref.userId,
|
|
26
|
+
adminUserId = _ref.adminUserId;
|
|
27
|
+
var _a;
|
|
28
|
+
// Form
|
|
29
|
+
var gradeEditFormMethods = reactHookForm.useForm({
|
|
29
30
|
defaultValues: {
|
|
30
31
|
score: 0,
|
|
31
32
|
comment: ''
|
|
32
33
|
},
|
|
33
34
|
mode: 'onChange'
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
35
|
+
});
|
|
36
|
+
// State related with component
|
|
37
|
+
var _React$useState = React__default["default"].useState(false),
|
|
38
|
+
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
39
|
+
showGradeEditModal = _React$useState2[0],
|
|
40
|
+
setShowGradeEditModal = _React$useState2[1];
|
|
41
|
+
// State related with api
|
|
42
|
+
var _React$useState3 = React__default["default"].useState(null),
|
|
43
|
+
_React$useState4 = _rollupPluginBabelHelpers.slicedToArray(_React$useState3, 2),
|
|
44
|
+
user = _React$useState4[0],
|
|
45
|
+
setUser = _React$useState4[1];
|
|
46
|
+
var _React$useState5 = React__default["default"].useState(null),
|
|
47
|
+
_React$useState6 = _rollupPluginBabelHelpers.slicedToArray(_React$useState5, 2),
|
|
48
|
+
materialAssignment = _React$useState6[0],
|
|
49
|
+
setMaterialAssignment = _React$useState6[1];
|
|
50
|
+
var _React$useState7 = React__default["default"].useState(null),
|
|
51
|
+
_React$useState8 = _rollupPluginBabelHelpers.slicedToArray(_React$useState7, 2),
|
|
52
|
+
userSubmission = _React$useState8[0],
|
|
53
|
+
setUserSubmission = _React$useState8[1];
|
|
54
|
+
var _React$useState9 = React__default["default"].useState(null),
|
|
55
|
+
_React$useState10 = _rollupPluginBabelHelpers.slicedToArray(_React$useState9, 2),
|
|
56
|
+
gradeResult = _React$useState10[0],
|
|
57
|
+
setGradeResult = _React$useState10[1];
|
|
58
|
+
var _React$useState11 = React__default["default"].useState(null),
|
|
59
|
+
_React$useState12 = _rollupPluginBabelHelpers.slicedToArray(_React$useState11, 2),
|
|
60
|
+
myGrade = _React$useState12[0],
|
|
61
|
+
setMyGrade = _React$useState12[1];
|
|
62
|
+
var isAssignmentClosed = dayjs__default["default"]().isAfter(dayjs__default["default"](materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.closeDatetime));
|
|
63
|
+
var isScoreFinalized = Boolean(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.scoreFinalizedDatetime);
|
|
64
|
+
var isUserSubmitted = Boolean(userSubmission);
|
|
65
|
+
// API Status
|
|
66
|
+
var isReady = materialSharedUtils.useMaterialConfigApiClientUpdate(apiClient.config.init);
|
|
67
|
+
var _React$useState13 = React__default["default"].useState('idle'),
|
|
68
|
+
_React$useState14 = _rollupPluginBabelHelpers.slicedToArray(_React$useState13, 2),
|
|
69
|
+
submissionListGetStatus = _React$useState14[0],
|
|
70
|
+
setSubmissionListGetStatus = _React$useState14[1];
|
|
71
|
+
var fetchUserGet = React__default["default"].useCallback(function () {
|
|
50
72
|
void apiClient.getOrgUserGet({
|
|
51
|
-
userId
|
|
52
|
-
}).then(
|
|
73
|
+
userId: userId
|
|
74
|
+
}).then(function (res) {
|
|
75
|
+
return res.user;
|
|
76
|
+
}).then(setUser);
|
|
53
77
|
}, [userId]);
|
|
54
|
-
|
|
78
|
+
var fetchMaterialAssignmentGet = React__default["default"].useCallback(function () {
|
|
55
79
|
void apiClient.getOrgMaterialAssignmentGet({
|
|
56
|
-
materialAssignmentId
|
|
57
|
-
}).then(
|
|
80
|
+
materialAssignmentId: materialAssignmentId
|
|
81
|
+
}).then(function (res) {
|
|
82
|
+
return res.materialAssignment;
|
|
83
|
+
}).then(setMaterialAssignment);
|
|
58
84
|
}, [materialAssignmentId]);
|
|
59
|
-
|
|
85
|
+
var fetchSubmissionList = React__default["default"].useCallback(function () {
|
|
60
86
|
setSubmissionListGetStatus('pending');
|
|
61
87
|
void apiClient.getOrgMaterialAssignmentSubmissionList({
|
|
62
|
-
materialAssignmentId,
|
|
88
|
+
materialAssignmentId: materialAssignmentId,
|
|
63
89
|
offset: 0,
|
|
64
90
|
count: 1,
|
|
65
91
|
filterConditions: {
|
|
66
92
|
isLast: true,
|
|
67
93
|
userIds: [userId]
|
|
68
94
|
}
|
|
69
|
-
}).then(
|
|
95
|
+
}).then(function (res) {
|
|
96
|
+
return res.materialAssignmentSubmissions[0];
|
|
97
|
+
}).then(function (submission) {
|
|
70
98
|
setUserSubmission(submission !== null && submission !== void 0 ? submission : null);
|
|
71
99
|
setSubmissionListGetStatus('resolved');
|
|
72
|
-
}).catch(err
|
|
100
|
+
}).catch(function (err) {
|
|
73
101
|
console.error(err);
|
|
74
102
|
setSubmissionListGetStatus('rejected');
|
|
75
103
|
});
|
|
76
104
|
}, [materialAssignmentId, userId]);
|
|
77
|
-
|
|
105
|
+
var fetchGradeResult = React__default["default"].useCallback(function () {
|
|
78
106
|
void apiClient.getOrgMaterialAssignmentGradeResultGet({
|
|
79
|
-
materialAssignmentId,
|
|
80
|
-
userId
|
|
81
|
-
}).then(
|
|
107
|
+
materialAssignmentId: materialAssignmentId,
|
|
108
|
+
userId: userId
|
|
109
|
+
}).then(function (res) {
|
|
110
|
+
return res.materialAssignmentGradeResult;
|
|
111
|
+
}).then(setGradeResult).catch(function () {
|
|
82
112
|
setGradeResult(null);
|
|
83
113
|
});
|
|
84
114
|
}, [materialAssignmentId, userId]);
|
|
85
|
-
|
|
115
|
+
var fetchMyGrade = React__default["default"].useCallback(function () {
|
|
86
116
|
void apiClient.getOrgMaterialAssignmentGradeList({
|
|
87
|
-
materialAssignmentId,
|
|
117
|
+
materialAssignmentId: materialAssignmentId,
|
|
88
118
|
offset: 0,
|
|
89
119
|
count: 1,
|
|
90
120
|
filterConditions: {
|
|
91
|
-
userId,
|
|
121
|
+
userId: userId,
|
|
92
122
|
gradeUserId: adminUserId
|
|
93
123
|
}
|
|
94
|
-
}).then(
|
|
124
|
+
}).then(function (res) {
|
|
125
|
+
return res.materialAssignmentGrades[0];
|
|
126
|
+
}).then(function (grade) {
|
|
127
|
+
return setMyGrade(grade !== null && grade !== void 0 ? grade : null);
|
|
128
|
+
});
|
|
95
129
|
}, [adminUserId, materialAssignmentId, userId]);
|
|
96
|
-
|
|
97
|
-
const handleGradeEditClick = () => {
|
|
130
|
+
var handleGradeEditClick = function handleGradeEditClick() {
|
|
98
131
|
var _a, _b;
|
|
99
|
-
|
|
100
132
|
setShowGradeEditModal(true);
|
|
101
133
|
gradeEditFormMethods.reset({
|
|
102
134
|
score: (_a = myGrade === null || myGrade === void 0 ? void 0 : myGrade.score) !== null && _a !== void 0 ? _a : 0,
|
|
103
135
|
comment: (_b = myGrade === null || myGrade === void 0 ? void 0 : myGrade.comment) !== null && _b !== void 0 ? _b : ''
|
|
104
136
|
});
|
|
105
137
|
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
138
|
+
var handleGradeEditSubmit = gradeEditFormMethods.handleSubmit( /*#__PURE__*/function () {
|
|
139
|
+
var _ref3 = _rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee(_ref2) {
|
|
140
|
+
var score, comment;
|
|
141
|
+
return _rollupPluginBabelHelpers.regeneratorRuntime().wrap(function _callee$(_context) {
|
|
142
|
+
while (1) switch (_context.prev = _context.next) {
|
|
143
|
+
case 0:
|
|
144
|
+
score = _ref2.score, comment = _ref2.comment;
|
|
145
|
+
_context.prev = 1;
|
|
146
|
+
_context.next = 4;
|
|
147
|
+
return apiClient.postOrgMaterialAssignmentGradeEdit({
|
|
148
|
+
materialAssignmentGradeId: myGrade === null || myGrade === void 0 ? void 0 : myGrade.id,
|
|
149
|
+
materialAssignmentId: materialAssignmentId,
|
|
150
|
+
userId: userId,
|
|
151
|
+
score: score,
|
|
152
|
+
comment: comment
|
|
153
|
+
});
|
|
154
|
+
case 4:
|
|
155
|
+
fetchMyGrade();
|
|
156
|
+
blocks.Notification.success('저장되었습니다');
|
|
157
|
+
_context.next = 12;
|
|
158
|
+
break;
|
|
159
|
+
case 8:
|
|
160
|
+
_context.prev = 8;
|
|
161
|
+
_context.t0 = _context["catch"](1);
|
|
162
|
+
console.error(_context.t0);
|
|
163
|
+
blocks.Notification.error('오류가 발생했습니다.');
|
|
164
|
+
case 12:
|
|
165
|
+
_context.prev = 12;
|
|
166
|
+
setShowGradeEditModal(false);
|
|
167
|
+
return _context.finish(12);
|
|
168
|
+
case 15:
|
|
169
|
+
case "end":
|
|
170
|
+
return _context.stop();
|
|
171
|
+
}
|
|
172
|
+
}, _callee, null, [[1, 8, 12, 15]]);
|
|
173
|
+
}));
|
|
174
|
+
return function (_x) {
|
|
175
|
+
return _ref3.apply(this, arguments);
|
|
176
|
+
};
|
|
177
|
+
}());
|
|
178
|
+
React__default["default"].useEffect(function () {
|
|
129
179
|
if (!isReady) {
|
|
130
180
|
return;
|
|
131
181
|
}
|
|
132
|
-
|
|
133
182
|
fetchUserGet();
|
|
134
183
|
fetchMyGrade();
|
|
135
184
|
fetchGradeResult();
|
|
136
185
|
fetchSubmissionList();
|
|
137
186
|
fetchMaterialAssignmentGet();
|
|
138
187
|
}, [isReady, fetchUserGet, fetchMyGrade, fetchGradeResult, fetchSubmissionList, fetchMaterialAssignmentGet]);
|
|
139
|
-
|
|
140
|
-
const renderHeader = () => {
|
|
188
|
+
var renderHeader = function renderHeader() {
|
|
141
189
|
var _a;
|
|
142
|
-
|
|
143
190
|
return React__default["default"].createElement(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminHeader, {
|
|
144
191
|
align: "center",
|
|
145
192
|
padding: "1rem",
|
|
@@ -162,7 +209,7 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
162
209
|
}, "\uC810\uC218"), React__default["default"].createElement(blocks.Text, {
|
|
163
210
|
size: "small",
|
|
164
211
|
role: "white"
|
|
165
|
-
}, (gradeResult === null || gradeResult === void 0 ? void 0 : gradeResult.score) && isScoreFinalized ?
|
|
212
|
+
}, (gradeResult === null || gradeResult === void 0 ? void 0 : gradeResult.score) && isScoreFinalized ? "".concat(gradeResult.score, "\uC810(\uACF5\uAC1C\uB428)") : '--')), React__default["default"].createElement(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminHeaderCell, null, React__default["default"].createElement(blocks.Text, {
|
|
166
213
|
size: "tiny",
|
|
167
214
|
role: "gray4"
|
|
168
215
|
}, "\uC81C\uCD9C \uC77C\uC2DC"), React__default["default"].createElement(blocks.Text, {
|
|
@@ -175,8 +222,7 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
175
222
|
hour12: false
|
|
176
223
|
}) : '--')));
|
|
177
224
|
};
|
|
178
|
-
|
|
179
|
-
const renderGradeResult = () => {
|
|
225
|
+
var renderGradeResult = function renderGradeResult() {
|
|
180
226
|
return React__default["default"].createElement(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminGradeWrapper, {
|
|
181
227
|
wrap: true,
|
|
182
228
|
width: "100%",
|
|
@@ -188,7 +234,7 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
188
234
|
role: "navy1",
|
|
189
235
|
size: "small",
|
|
190
236
|
lineHeight: "1.375rem"
|
|
191
|
-
}, user ?
|
|
237
|
+
}, user ? "".concat(user.fullname, " \uB2D8\uC758 \uC810\uC218") : null), React__default["default"].createElement(blocks.Hspace, {
|
|
192
238
|
width: 0.25
|
|
193
239
|
}), React__default["default"].createElement(blocks.Tooltip, {
|
|
194
240
|
useMaxWidth: true,
|
|
@@ -202,15 +248,13 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
202
248
|
}), React__default["default"].createElement(blocks.Text, {
|
|
203
249
|
bold: true,
|
|
204
250
|
role: "white"
|
|
205
|
-
}, (gradeResult === null || gradeResult === void 0 ? void 0 : gradeResult.score) && isScoreFinalized ?
|
|
251
|
+
}, (gradeResult === null || gradeResult === void 0 ? void 0 : gradeResult.score) && isScoreFinalized ? "".concat(gradeResult.score, "\uC810(\uACF5\uAC1C\uB428)") : '--')));
|
|
206
252
|
};
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
const statusText = (() => {
|
|
253
|
+
var renderSubmissionInfo = function renderSubmissionInfo() {
|
|
254
|
+
var statusText = function () {
|
|
210
255
|
if (submissionListGetStatus === 'pending') {
|
|
211
256
|
return null;
|
|
212
257
|
}
|
|
213
|
-
|
|
214
258
|
switch (true) {
|
|
215
259
|
case !isUserSubmitted && isAssignmentClosed:
|
|
216
260
|
return React__default["default"].createElement(blocks.Text, {
|
|
@@ -218,21 +262,18 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
218
262
|
role: "danger",
|
|
219
263
|
size: "small"
|
|
220
264
|
}, "\uC81C\uCD9C \uAE30\uD55C \uB9CC\uB8CC");
|
|
221
|
-
|
|
222
265
|
case isScoreFinalized:
|
|
223
266
|
return React__default["default"].createElement(blocks.Text, {
|
|
224
267
|
bold: true,
|
|
225
268
|
role: "lightpurple",
|
|
226
269
|
size: "small"
|
|
227
270
|
}, "\uCC44\uC810 \uC644\uB8CC");
|
|
228
|
-
|
|
229
271
|
case isUserSubmitted:
|
|
230
272
|
return React__default["default"].createElement(blocks.Text, {
|
|
231
273
|
bold: true,
|
|
232
274
|
role: "success",
|
|
233
275
|
size: "small"
|
|
234
276
|
}, "\uC81C\uCD9C\uB428");
|
|
235
|
-
|
|
236
277
|
case !isUserSubmitted:
|
|
237
278
|
return React__default["default"].createElement(blocks.Text, {
|
|
238
279
|
bold: true,
|
|
@@ -240,15 +281,13 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
240
281
|
size: "small"
|
|
241
282
|
}, "\uBBF8\uC81C\uCD9C");
|
|
242
283
|
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
const submissionAttachment = (() => {
|
|
284
|
+
}();
|
|
285
|
+
var submissionAttachment = function () {
|
|
246
286
|
if (!userSubmission) {
|
|
247
287
|
return '--';
|
|
248
288
|
}
|
|
249
|
-
|
|
250
289
|
if (userSubmission.assignmentFileUrl) {
|
|
251
|
-
|
|
290
|
+
var assignmentFilename = decodeURIComponent(userSubmission.assignmentFileUrl && new URL(userSubmission.assignmentFileUrl).pathname.split('/').pop() || '');
|
|
252
291
|
return React__default["default"].createElement("a", {
|
|
253
292
|
href: userSubmission.assignmentFileUrl,
|
|
254
293
|
download: assignmentFilename,
|
|
@@ -261,7 +300,6 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
261
300
|
size: "small"
|
|
262
301
|
}, assignmentFilename));
|
|
263
302
|
}
|
|
264
|
-
|
|
265
303
|
if (userSubmission === null || userSubmission === void 0 ? void 0 : userSubmission.assignmentUrl) {
|
|
266
304
|
return React__default["default"].createElement("a", {
|
|
267
305
|
href: userSubmission.assignmentUrl,
|
|
@@ -274,8 +312,7 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
274
312
|
size: "small"
|
|
275
313
|
}, userSubmission.assignmentUrl));
|
|
276
314
|
}
|
|
277
|
-
}
|
|
278
|
-
|
|
315
|
+
}();
|
|
279
316
|
return React__default["default"].createElement(blocks.InfoTable, {
|
|
280
317
|
dark: true
|
|
281
318
|
}, React__default["default"].createElement("tbody", null, React__default["default"].createElement("tr", null, React__default["default"].createElement("td", null, "\uC0C1\uD0DC"), React__default["default"].createElement("td", null, statusText)), React__default["default"].createElement("tr", null, React__default["default"].createElement("td", null, "\uACFC\uC81C \uC81C\uCD9C \uAE30\uD55C"), React__default["default"].createElement("td", null, React__default["default"].createElement(reactIntl.FormattedDate, {
|
|
@@ -290,23 +327,18 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
290
327
|
hour12: false
|
|
291
328
|
}) : '--')), React__default["default"].createElement("tr", null, React__default["default"].createElement("td", null, "\uC5C5\uB85C\uB4DC\uB41C \uACFC\uC81C"), React__default["default"].createElement("td", null, submissionAttachment))));
|
|
292
329
|
};
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
const tooltipTitle = (() => {
|
|
330
|
+
var renderGrade = function renderGrade() {
|
|
331
|
+
var isGradeEditDisabled = !isAssignmentClosed || !isUserSubmitted || isScoreFinalized;
|
|
332
|
+
var tooltipTitle = function () {
|
|
298
333
|
switch (true) {
|
|
299
334
|
case isScoreFinalized:
|
|
300
335
|
return '공개 이후 채점이 불가합니다.';
|
|
301
|
-
|
|
302
336
|
case !isAssignmentClosed:
|
|
303
337
|
return '제출 기한이 지난 이후 채점할 수 있습니다.';
|
|
304
|
-
|
|
305
338
|
case !isUserSubmitted:
|
|
306
339
|
return '미제출인 경우 채점할 수 없습니다.';
|
|
307
340
|
}
|
|
308
|
-
}
|
|
309
|
-
|
|
341
|
+
}();
|
|
310
342
|
return React__default["default"].createElement(blocks.Flex, {
|
|
311
343
|
column: true,
|
|
312
344
|
align: "center"
|
|
@@ -375,12 +407,10 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
375
407
|
}] : []
|
|
376
408
|
}));
|
|
377
409
|
};
|
|
378
|
-
|
|
379
|
-
const renderGradeEditModal = () => {
|
|
410
|
+
var renderGradeEditModal = function renderGradeEditModal() {
|
|
380
411
|
if (!showGradeEditModal) {
|
|
381
412
|
return null;
|
|
382
413
|
}
|
|
383
|
-
|
|
384
414
|
return React__default["default"].createElement(blocks.Modal, {
|
|
385
415
|
title: Boolean(myGrade) ? '내 채점 수정' : '과제 채점',
|
|
386
416
|
footerButtons: [{
|
|
@@ -394,11 +424,11 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
394
424
|
label: '취소',
|
|
395
425
|
size: 'small',
|
|
396
426
|
role: 'gray1',
|
|
397
|
-
onClick: ()
|
|
427
|
+
onClick: function onClick() {
|
|
398
428
|
setShowGradeEditModal(false);
|
|
399
429
|
}
|
|
400
430
|
}],
|
|
401
|
-
onHide: ()
|
|
431
|
+
onHide: function onHide() {
|
|
402
432
|
setShowGradeEditModal(false);
|
|
403
433
|
}
|
|
404
434
|
}, React__default["default"].createElement(blocks.Label, {
|
|
@@ -417,15 +447,16 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
417
447
|
min: 0,
|
|
418
448
|
max: 100
|
|
419
449
|
},
|
|
420
|
-
render: ({
|
|
421
|
-
field,
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
450
|
+
render: function render(_ref4) {
|
|
451
|
+
var field = _ref4.field,
|
|
452
|
+
fieldState = _ref4.fieldState;
|
|
453
|
+
return React__default["default"].createElement(blocks.Input, Object.assign({}, field, {
|
|
454
|
+
invalid: fieldState.invalid,
|
|
455
|
+
size: "small",
|
|
456
|
+
width: "xsmall",
|
|
457
|
+
type: "number"
|
|
458
|
+
}));
|
|
459
|
+
}
|
|
429
460
|
}), React__default["default"].createElement(blocks.Hspace, {
|
|
430
461
|
width: 0.5
|
|
431
462
|
}), React__default["default"].createElement(blocks.Text, {
|
|
@@ -448,17 +479,17 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
448
479
|
rules: {
|
|
449
480
|
maxLength: 1000
|
|
450
481
|
},
|
|
451
|
-
render: ({
|
|
452
|
-
field
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
482
|
+
render: function render(_ref5) {
|
|
483
|
+
var field = _ref5.field;
|
|
484
|
+
return React__default["default"].createElement(blocks.Textarea, {
|
|
485
|
+
value: field.value,
|
|
486
|
+
wordLimit: 1000,
|
|
487
|
+
rows: 8,
|
|
488
|
+
onChange: field.onChange
|
|
489
|
+
});
|
|
490
|
+
}
|
|
459
491
|
}));
|
|
460
492
|
};
|
|
461
|
-
|
|
462
493
|
return React__default["default"].createElement(React__default["default"].Fragment, null, renderHeader(), React__default["default"].createElement(blocks.Flex, {
|
|
463
494
|
column: true,
|
|
464
495
|
auto: true,
|
|
@@ -467,7 +498,7 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
467
498
|
height: "100%",
|
|
468
499
|
overflow: "hidden",
|
|
469
500
|
align: "center"
|
|
470
|
-
}, React__default["default"].createElement(MaterialAssignmentContainer, {
|
|
501
|
+
}, React__default["default"].createElement(MaterialAssignmentContainer["default"], {
|
|
471
502
|
title: (_a = materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.title) !== null && _a !== void 0 ? _a : ''
|
|
472
503
|
}, renderGradeResult(), React__default["default"].createElement(blocks.Vspace, {
|
|
473
504
|
height: 1.25
|
|
@@ -476,4 +507,4 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
476
507
|
}), renderGrade())), renderGradeEditModal());
|
|
477
508
|
};
|
|
478
509
|
|
|
479
|
-
|
|
510
|
+
exports["default"] = MaterialAssignmentAdminContentTa;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
var React = require('react');
|
|
4
6
|
var blocks = require('@elice/blocks');
|
|
5
7
|
var designTokens = require('@elice/design-tokens');
|
|
@@ -10,20 +12,18 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
12
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
13
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
var StyledMaterialAssignmentContainer = styled__default["default"].div.withConfig({
|
|
14
16
|
componentId: "sc-sdhlog-0"
|
|
15
17
|
})(["height:100%;width:100%;max-width:55rem;border-radius:0.5rem;overflow:hidden;"]);
|
|
16
|
-
|
|
18
|
+
var StyledMaterialAssignmentContainerHeader = styled__default["default"].div.withConfig({
|
|
17
19
|
componentId: "sc-sdhlog-1"
|
|
18
20
|
})(["padding:1rem 1.5rem;height:3.5rem;display:flex;align-items:center;background-color:", ";"], designTokens.base.color.navy7);
|
|
19
|
-
|
|
21
|
+
var StyledMaterialAssignmentContainerContent = styled__default["default"].div.withConfig({
|
|
20
22
|
componentId: "sc-sdhlog-2"
|
|
21
23
|
})(["padding:1.5rem;overflow-y:auto;height:calc(100% - 3.5rem);background-color:", ";"], designTokens.base.color.navy8);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
children
|
|
26
|
-
}) => {
|
|
24
|
+
var MaterialAssignmentContainer = function MaterialAssignmentContainer(_ref) {
|
|
25
|
+
var title = _ref.title,
|
|
26
|
+
children = _ref.children;
|
|
27
27
|
return React__default["default"].createElement(StyledMaterialAssignmentContainer, null, React__default["default"].createElement(StyledMaterialAssignmentContainerHeader, null, React__default["default"].createElement(blocks.Text, {
|
|
28
28
|
bold: true,
|
|
29
29
|
role: "navy0",
|
|
@@ -31,4 +31,4 @@ const MaterialAssignmentContainer = ({
|
|
|
31
31
|
}, title)), React__default["default"].createElement(StyledMaterialAssignmentContainerContent, null, children));
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
exports["default"] = MaterialAssignmentContainer;
|
package/cjs/index.js
CHANGED
|
@@ -7,5 +7,5 @@ var MaterialAssignment = require('./components/material-assignment/MaterialAssig
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.MaterialAssignmentAdmin = MaterialAssignmentAdmin;
|
|
11
|
-
exports.MaterialAssignment = MaterialAssignment;
|
|
10
|
+
exports.MaterialAssignmentAdmin = MaterialAssignmentAdmin["default"];
|
|
11
|
+
exports.MaterialAssignment = MaterialAssignment["default"];
|