@elice/material-assignment 1.240718.0-trasncript.0 → 1.240718.0-trasncript.2

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.
Files changed (29) hide show
  1. package/cjs/_virtual/_rollupPluginBabelHelpers.js +383 -0
  2. package/cjs/components/index.js +9 -0
  3. package/cjs/components/material-assignment/MaterialAssignment.js +23 -17
  4. package/cjs/components/material-assignment/MaterialAssignmentContent.js +281 -194
  5. package/cjs/components/material-assignment/MaterialAssignmentUploadModal.js +181 -138
  6. package/cjs/components/material-assignment/constants/color.js +1 -1
  7. package/cjs/components/material-assignment/index.js +7 -0
  8. package/cjs/components/material-assignment/locales/index.js +13 -0
  9. package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.js +32 -24
  10. package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.styled.js +19 -9
  11. package/cjs/components/material-assignment-admin/MaterialAssignmentAdminContent.js +774 -548
  12. package/cjs/components/material-assignment-admin/MaterialAssignmentAdminContentTa.js +436 -303
  13. package/cjs/components/material-assignment-admin/index.js +7 -0
  14. package/cjs/components/shared/MaterialAssignmentContainer.js +23 -13
  15. package/es/_virtual/_rollupPluginBabelHelpers.js +374 -0
  16. package/es/components/index.js +2 -0
  17. package/es/components/material-assignment/MaterialAssignment.js +18 -17
  18. package/es/components/material-assignment/MaterialAssignmentContent.js +276 -194
  19. package/es/components/material-assignment/MaterialAssignmentUploadModal.js +177 -139
  20. package/es/components/material-assignment/constants/color.js +1 -1
  21. package/es/components/material-assignment/index.js +1 -0
  22. package/es/components/material-assignment/locales/index.js +4 -0
  23. package/es/components/material-assignment-admin/MaterialAssignmentAdmin.js +29 -25
  24. package/es/components/material-assignment-admin/MaterialAssignmentAdmin.styled.js +15 -9
  25. package/es/components/material-assignment-admin/MaterialAssignmentAdminContent.js +770 -549
  26. package/es/components/material-assignment-admin/MaterialAssignmentAdminContentTa.js +432 -304
  27. package/es/components/material-assignment-admin/index.js +1 -0
  28. package/es/components/shared/MaterialAssignmentContainer.js +19 -13
  29. package/package.json +9 -12
@@ -2,6 +2,8 @@
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');
5
7
  var React = require('react');
6
8
  var reactHookForm = require('react-hook-form');
7
9
  var apiClient = require('@elice/api-client');
@@ -14,14 +16,18 @@ var dayjs = require('dayjs');
14
16
  var MaterialAssignmentContainer = require('../shared/MaterialAssignmentContainer.js');
15
17
  var MaterialAssignmentAdmin_styled = require('./MaterialAssignmentAdmin.styled.js');
16
18
 
17
- const MaterialAssignmentAdminContentTa = ({
18
- materialAssignmentId,
19
- userId,
20
- adminUserId
21
- }) => {
19
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
20
+
21
+ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
22
+ var dayjs__default = /*#__PURE__*/_interopDefaultCompat(dayjs);
23
+
24
+ var MaterialAssignmentAdminContentTa = function MaterialAssignmentAdminContentTa(_ref) {
25
+ var materialAssignmentId = _ref.materialAssignmentId,
26
+ userId = _ref.userId,
27
+ adminUserId = _ref.adminUserId;
22
28
  var _a;
23
29
  // Form
24
- const gradeEditFormMethods = reactHookForm.useForm({
30
+ var gradeEditFormMethods = reactHookForm.useForm({
25
31
  defaultValues: {
26
32
  score: 0,
27
33
  comment: ''
@@ -29,67 +35,100 @@ const MaterialAssignmentAdminContentTa = ({
29
35
  mode: 'onChange'
30
36
  });
31
37
  // State related with component
32
- const [showGradeEditModal, setShowGradeEditModal] = React.useState(false);
38
+ var _React$useState = React__default.default.useState(false),
39
+ _React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
40
+ showGradeEditModal = _React$useState2[0],
41
+ setShowGradeEditModal = _React$useState2[1];
33
42
  // State related with api
34
- const [user, setUser] = React.useState(null);
35
- const [materialAssignment, setMaterialAssignment] = React.useState(null);
36
- const [userSubmission, setUserSubmission] = React.useState(null);
37
- const [gradeResult, setGradeResult] = React.useState(null);
38
- const [myGrade, setMyGrade] = React.useState(null);
39
- const isAssignmentClosed = dayjs().isAfter(dayjs(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.closeDatetime));
40
- const isScoreFinalized = Boolean(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.scoreFinalizedDatetime);
41
- const isUserSubmitted = Boolean(userSubmission);
43
+ var _React$useState3 = React__default.default.useState(null),
44
+ _React$useState4 = _rollupPluginBabelHelpers.slicedToArray(_React$useState3, 2),
45
+ user = _React$useState4[0],
46
+ setUser = _React$useState4[1];
47
+ var _React$useState5 = React__default.default.useState(null),
48
+ _React$useState6 = _rollupPluginBabelHelpers.slicedToArray(_React$useState5, 2),
49
+ materialAssignment = _React$useState6[0],
50
+ setMaterialAssignment = _React$useState6[1];
51
+ var _React$useState7 = React__default.default.useState(null),
52
+ _React$useState8 = _rollupPluginBabelHelpers.slicedToArray(_React$useState7, 2),
53
+ userSubmission = _React$useState8[0],
54
+ setUserSubmission = _React$useState8[1];
55
+ var _React$useState9 = React__default.default.useState(null),
56
+ _React$useState10 = _rollupPluginBabelHelpers.slicedToArray(_React$useState9, 2),
57
+ gradeResult = _React$useState10[0],
58
+ setGradeResult = _React$useState10[1];
59
+ var _React$useState11 = React__default.default.useState(null),
60
+ _React$useState12 = _rollupPluginBabelHelpers.slicedToArray(_React$useState11, 2),
61
+ myGrade = _React$useState12[0],
62
+ setMyGrade = _React$useState12[1];
63
+ var isAssignmentClosed = dayjs__default.default().isAfter(dayjs__default.default(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.closeDatetime));
64
+ var isScoreFinalized = Boolean(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.scoreFinalizedDatetime);
65
+ var isUserSubmitted = Boolean(userSubmission);
42
66
  // API Status
43
- const isReady = materialSharedUtils.useMaterialConfigApiClientUpdate(apiClient.config.init);
44
- const [submissionListGetStatus, setSubmissionListGetStatus] = React.useState('idle');
45
- const fetchUserGet = React.useCallback(() => {
67
+ var isReady = materialSharedUtils.useMaterialConfigApiClientUpdate(apiClient.config.init);
68
+ var _React$useState13 = React__default.default.useState('idle'),
69
+ _React$useState14 = _rollupPluginBabelHelpers.slicedToArray(_React$useState13, 2),
70
+ submissionListGetStatus = _React$useState14[0],
71
+ setSubmissionListGetStatus = _React$useState14[1];
72
+ var fetchUserGet = React__default.default.useCallback(function () {
46
73
  void apiClient.getOrgUserGet({
47
- userId
48
- }).then(res => res.user).then(setUser);
74
+ userId: userId
75
+ }).then(function (res) {
76
+ return res.user;
77
+ }).then(setUser);
49
78
  }, [userId]);
50
- const fetchMaterialAssignmentGet = React.useCallback(() => {
79
+ var fetchMaterialAssignmentGet = React__default.default.useCallback(function () {
51
80
  void apiClient.getOrgMaterialAssignmentGet({
52
- materialAssignmentId
53
- }).then(res => res.materialAssignment).then(setMaterialAssignment);
81
+ materialAssignmentId: materialAssignmentId
82
+ }).then(function (res) {
83
+ return res.materialAssignment;
84
+ }).then(setMaterialAssignment);
54
85
  }, [materialAssignmentId]);
55
- const fetchSubmissionList = React.useCallback(() => {
86
+ var fetchSubmissionList = React__default.default.useCallback(function () {
56
87
  setSubmissionListGetStatus('pending');
57
88
  void apiClient.getOrgMaterialAssignmentSubmissionList({
58
- materialAssignmentId,
89
+ materialAssignmentId: materialAssignmentId,
59
90
  offset: 0,
60
91
  count: 1,
61
92
  filterConditions: {
62
93
  isLast: true,
63
94
  userIds: [userId]
64
95
  }
65
- }).then(res => res.materialAssignmentSubmissions[0]).then(submission => {
96
+ }).then(function (res) {
97
+ return res.materialAssignmentSubmissions[0];
98
+ }).then(function (submission) {
66
99
  setUserSubmission(submission !== null && submission !== void 0 ? submission : null);
67
100
  setSubmissionListGetStatus('resolved');
68
- }).catch(err => {
101
+ }).catch(function (err) {
69
102
  console.error(err);
70
103
  setSubmissionListGetStatus('rejected');
71
104
  });
72
105
  }, [materialAssignmentId, userId]);
73
- const fetchGradeResult = React.useCallback(() => {
106
+ var fetchGradeResult = React__default.default.useCallback(function () {
74
107
  void apiClient.getOrgMaterialAssignmentGradeResultGet({
75
- materialAssignmentId,
76
- userId
77
- }).then(res => res.materialAssignmentGradeResult).then(setGradeResult).catch(() => {
108
+ materialAssignmentId: materialAssignmentId,
109
+ userId: userId
110
+ }).then(function (res) {
111
+ return res.materialAssignmentGradeResult;
112
+ }).then(setGradeResult).catch(function () {
78
113
  setGradeResult(null);
79
114
  });
80
115
  }, [materialAssignmentId, userId]);
81
- const fetchMyGrade = React.useCallback(() => {
116
+ var fetchMyGrade = React__default.default.useCallback(function () {
82
117
  void apiClient.getOrgMaterialAssignmentGradeList({
83
- materialAssignmentId,
118
+ materialAssignmentId: materialAssignmentId,
84
119
  offset: 0,
85
120
  count: 1,
86
121
  filterConditions: {
87
- userId,
122
+ userId: userId,
88
123
  gradeUserId: adminUserId
89
124
  }
90
- }).then(res => res.materialAssignmentGrades[0]).then(grade => setMyGrade(grade !== null && grade !== void 0 ? grade : null));
125
+ }).then(function (res) {
126
+ return res.materialAssignmentGrades[0];
127
+ }).then(function (grade) {
128
+ return setMyGrade(grade !== null && grade !== void 0 ? grade : null);
129
+ });
91
130
  }, [adminUserId, materialAssignmentId, userId]);
92
- const handleGradeEditClick = () => {
131
+ var handleGradeEditClick = function handleGradeEditClick() {
93
132
  var _a, _b;
94
133
  setShowGradeEditModal(true);
95
134
  gradeEditFormMethods.reset({
@@ -97,28 +136,47 @@ const MaterialAssignmentAdminContentTa = ({
97
136
  comment: (_b = myGrade === null || myGrade === void 0 ? void 0 : myGrade.comment) !== null && _b !== void 0 ? _b : ''
98
137
  });
99
138
  };
100
- const handleGradeEditSubmit = gradeEditFormMethods.handleSubmit(async ({
101
- score,
102
- comment
103
- }) => {
104
- try {
105
- await apiClient.postOrgMaterialAssignmentGradeEdit({
106
- materialAssignmentGradeId: myGrade === null || myGrade === void 0 ? void 0 : myGrade.id,
107
- materialAssignmentId,
108
- userId,
109
- score,
110
- comment
111
- });
112
- fetchMyGrade();
113
- blocks.Notification.success('저장되었습니다');
114
- } catch (err) {
115
- console.error(err);
116
- blocks.Notification.error('오류가 발생했습니다.');
117
- } finally {
118
- setShowGradeEditModal(false);
119
- }
120
- });
121
- React.useEffect(() => {
139
+ var handleGradeEditSubmit = gradeEditFormMethods.handleSubmit( /*#__PURE__*/function () {
140
+ var _ref3 = _rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee(_ref2) {
141
+ var score, comment;
142
+ return _rollupPluginBabelHelpers.regeneratorRuntime().wrap(function _callee$(_context) {
143
+ while (1) switch (_context.prev = _context.next) {
144
+ case 0:
145
+ score = _ref2.score, comment = _ref2.comment;
146
+ _context.prev = 1;
147
+ _context.next = 4;
148
+ return apiClient.postOrgMaterialAssignmentGradeEdit({
149
+ materialAssignmentGradeId: myGrade === null || myGrade === void 0 ? void 0 : myGrade.id,
150
+ materialAssignmentId: materialAssignmentId,
151
+ userId: userId,
152
+ score: score,
153
+ comment: comment
154
+ });
155
+ case 4:
156
+ fetchMyGrade();
157
+ blocks.Notification.success('저장되었습니다');
158
+ _context.next = 12;
159
+ break;
160
+ case 8:
161
+ _context.prev = 8;
162
+ _context.t0 = _context["catch"](1);
163
+ console.error(_context.t0);
164
+ blocks.Notification.error('오류가 발생했습니다.');
165
+ case 12:
166
+ _context.prev = 12;
167
+ setShowGradeEditModal(false);
168
+ return _context.finish(12);
169
+ case 15:
170
+ case "end":
171
+ return _context.stop();
172
+ }
173
+ }, _callee, null, [[1, 8, 12, 15]]);
174
+ }));
175
+ return function (_x) {
176
+ return _ref3.apply(this, arguments);
177
+ };
178
+ }());
179
+ React__default.default.useEffect(function () {
122
180
  if (!isReady) {
123
181
  return;
124
182
  }
@@ -128,148 +186,199 @@ const MaterialAssignmentAdminContentTa = ({
128
186
  fetchSubmissionList();
129
187
  fetchMaterialAssignmentGet();
130
188
  }, [isReady, fetchUserGet, fetchMyGrade, fetchGradeResult, fetchSubmissionList, fetchMaterialAssignmentGet]);
131
- const renderHeader = () => {
189
+ var renderHeader = function renderHeader() {
132
190
  var _a;
133
- return React.createElement(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminHeader, {
191
+ return jsxRuntime.jsxs(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminHeader, {
134
192
  align: "center",
135
193
  padding: "1rem",
136
- width: "100%"
137
- }, React.createElement(blocks.Flex, {
138
- auto: true,
139
- align: "center"
140
- }, React.createElement(blocks.ProfileImage, {
141
- src: (_a = user === null || user === void 0 ? void 0 : user.profileUrl) !== null && _a !== void 0 ? _a : '',
142
- width: "2.5rem",
143
- height: "2.5rem"
144
- }), React.createElement(blocks.Hspace, {
145
- width: 1
146
- }), React.createElement(blocks.Text, {
147
- size: "small",
148
- role: "warmwhite"
149
- }, user === null || user === void 0 ? void 0 : user.fullname)), React.createElement(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminHeaderCell, null, React.createElement(blocks.Text, {
150
- size: "tiny",
151
- role: "gray4"
152
- }, "\uC810\uC218"), React.createElement(blocks.Text, {
153
- size: "small",
154
- role: "white"
155
- }, (gradeResult === null || gradeResult === void 0 ? void 0 : gradeResult.score) && isScoreFinalized ? `${gradeResult.score}점(공개됨)` : '--')), React.createElement(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminHeaderCell, null, React.createElement(blocks.Text, {
156
- size: "tiny",
157
- role: "gray4"
158
- }, "\uC81C\uCD9C \uC77C\uC2DC"), React.createElement(blocks.Text, {
159
- size: "small",
160
- role: "white"
161
- }, userSubmission ? React.createElement(intl.FormattedDate, {
162
- value: userSubmission.createdDatetime,
163
- dateStyle: "medium",
164
- timeStyle: "short"
165
- }) : '--')));
194
+ width: "100%",
195
+ children: [jsxRuntime.jsxs(blocks.Flex, {
196
+ auto: true,
197
+ align: "center",
198
+ children: [jsxRuntime.jsx(blocks.ProfileImage, {
199
+ src: (_a = user === null || user === void 0 ? void 0 : user.profileUrl) !== null && _a !== void 0 ? _a : '',
200
+ width: "2.5rem",
201
+ height: "2.5rem"
202
+ }), jsxRuntime.jsx(blocks.Hspace, {
203
+ width: 1
204
+ }), jsxRuntime.jsx(blocks.Text, {
205
+ size: "small",
206
+ role: "warmwhite",
207
+ children: user === null || user === void 0 ? void 0 : user.fullname
208
+ })]
209
+ }), jsxRuntime.jsxs(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminHeaderCell, {
210
+ children: [jsxRuntime.jsx(blocks.Text, {
211
+ size: "tiny",
212
+ role: "gray4",
213
+ children: "\uC810\uC218"
214
+ }), jsxRuntime.jsx(blocks.Text, {
215
+ size: "small",
216
+ role: "white",
217
+ children: (gradeResult === null || gradeResult === void 0 ? void 0 : gradeResult.score) && isScoreFinalized ? "".concat(gradeResult.score, "\uC810(\uACF5\uAC1C\uB428)") : '--'
218
+ })]
219
+ }), jsxRuntime.jsxs(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminHeaderCell, {
220
+ children: [jsxRuntime.jsx(blocks.Text, {
221
+ size: "tiny",
222
+ role: "gray4",
223
+ children: "\uC81C\uCD9C \uC77C\uC2DC"
224
+ }), jsxRuntime.jsx(blocks.Text, {
225
+ size: "small",
226
+ role: "white",
227
+ children: userSubmission ? jsxRuntime.jsx(intl.FormattedDate, {
228
+ value: userSubmission.createdDatetime,
229
+ dateStyle: "medium",
230
+ timeStyle: "short"
231
+ }) : '--'
232
+ })]
233
+ })]
234
+ });
166
235
  };
167
- const renderGradeResult = () => {
168
- return React.createElement(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminGradeWrapper, {
236
+ var renderGradeResult = function renderGradeResult() {
237
+ return jsxRuntime.jsx(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminGradeWrapper, {
169
238
  wrap: true,
170
239
  width: "100%",
171
- align: "center"
172
- }, React.createElement(blocks.Flex, {
173
- auto: true,
174
- align: "center"
175
- }, React.createElement(blocks.Text, {
176
- role: "navy1",
177
- size: "small",
178
- lineHeight: "1.375rem"
179
- }, user ? `${user.fullname} 님의 점수` : null), React.createElement(blocks.Hspace, {
180
- width: 0.25
181
- }), React.createElement(blocks.Tooltip, {
182
- useMaxWidth: true,
183
- placement: "top",
184
- title: '최종 점수는 관리자가 모든 채점자의 점수를 고려하여 반영한 후 공개됩니다.'
185
- }, React.createElement(blocks.Icon, {
186
- icon: icons.eilStatusInfo,
187
- color: designTokens.base.color.navy1
188
- })), React.createElement(blocks.Hspace, {
189
- width: 0.75
190
- }), React.createElement(blocks.Text, {
191
- bold: true,
192
- role: "white"
193
- }, (gradeResult === null || gradeResult === void 0 ? void 0 : gradeResult.score) && isScoreFinalized ? `${gradeResult.score}점(공개됨)` : '--')));
240
+ align: "center",
241
+ children: jsxRuntime.jsxs(blocks.Flex, {
242
+ auto: true,
243
+ align: "center",
244
+ children: [jsxRuntime.jsx(blocks.Text, {
245
+ role: "navy1",
246
+ size: "small",
247
+ lineHeight: "1.375rem",
248
+ children: user ? "".concat(user.fullname, " \uB2D8\uC758 \uC810\uC218") : null
249
+ }), jsxRuntime.jsx(blocks.Hspace, {
250
+ width: 0.25
251
+ }), jsxRuntime.jsx(blocks.Tooltip, {
252
+ useMaxWidth: true,
253
+ placement: "top",
254
+ title: '최종 점수는 관리자가 모든 채점자의 점수를 고려하여 반영한 후 공개됩니다.',
255
+ children: jsxRuntime.jsx(blocks.Icon, {
256
+ icon: icons.eilStatusInfo,
257
+ color: designTokens.base.color.navy1
258
+ })
259
+ }), jsxRuntime.jsx(blocks.Hspace, {
260
+ width: 0.75
261
+ }), jsxRuntime.jsx(blocks.Text, {
262
+ bold: true,
263
+ role: "white",
264
+ children: (gradeResult === null || gradeResult === void 0 ? void 0 : gradeResult.score) && isScoreFinalized ? "".concat(gradeResult.score, "\uC810(\uACF5\uAC1C\uB428)") : '--'
265
+ })]
266
+ })
267
+ });
194
268
  };
195
- const renderSubmissionInfo = () => {
196
- const statusText = (() => {
269
+ var renderSubmissionInfo = function renderSubmissionInfo() {
270
+ var statusText = function () {
197
271
  if (submissionListGetStatus === 'pending') {
198
272
  return null;
199
273
  }
200
274
  switch (true) {
201
275
  case !isUserSubmitted && isAssignmentClosed:
202
- return React.createElement(blocks.Text, {
276
+ return jsxRuntime.jsx(blocks.Text, {
203
277
  bold: true,
204
278
  role: "danger",
205
- size: "small"
206
- }, "\uC81C\uCD9C \uAE30\uD55C \uB9CC\uB8CC");
279
+ size: "small",
280
+ children: "\uC81C\uCD9C \uAE30\uD55C \uB9CC\uB8CC"
281
+ });
207
282
  case isScoreFinalized:
208
- return React.createElement(blocks.Text, {
283
+ return jsxRuntime.jsx(blocks.Text, {
209
284
  bold: true,
210
285
  role: "lightpurple",
211
- size: "small"
212
- }, "\uCC44\uC810 \uC644\uB8CC");
286
+ size: "small",
287
+ children: "\uCC44\uC810 \uC644\uB8CC"
288
+ });
213
289
  case isUserSubmitted:
214
- return React.createElement(blocks.Text, {
290
+ return jsxRuntime.jsx(blocks.Text, {
215
291
  bold: true,
216
292
  role: "success",
217
- size: "small"
218
- }, "\uC81C\uCD9C\uB428");
293
+ size: "small",
294
+ children: "\uC81C\uCD9C\uB428"
295
+ });
219
296
  case !isUserSubmitted:
220
- return React.createElement(blocks.Text, {
297
+ return jsxRuntime.jsx(blocks.Text, {
221
298
  bold: true,
222
299
  role: "warning",
223
- size: "small"
224
- }, "\uBBF8\uC81C\uCD9C");
300
+ size: "small",
301
+ children: "\uBBF8\uC81C\uCD9C"
302
+ });
225
303
  }
226
- })();
227
- const submissionAttachment = (() => {
304
+ }();
305
+ var submissionAttachment = function () {
228
306
  if (!userSubmission) {
229
307
  return '--';
230
308
  }
231
309
  if (userSubmission.assignmentFileUrl) {
232
- const assignmentFilename = decodeURIComponent(userSubmission.assignmentFileUrl && new URL(userSubmission.assignmentFileUrl).pathname.split('/').pop() || '');
233
- return React.createElement("a", {
310
+ var assignmentFilename = decodeURIComponent(userSubmission.assignmentFileUrl && new URL(userSubmission.assignmentFileUrl).pathname.split('/').pop() || '');
311
+ return jsxRuntime.jsx("a", {
234
312
  href: userSubmission.assignmentFileUrl,
235
313
  download: assignmentFilename,
236
314
  target: "_blank",
237
- rel: "noopener noreferrer"
238
- }, React.createElement(blocks.Text, {
239
- hoverable: true,
240
- underline: true,
241
- role: "white",
242
- size: "small"
243
- }, assignmentFilename));
315
+ rel: "noopener noreferrer",
316
+ children: jsxRuntime.jsx(blocks.Text, {
317
+ hoverable: true,
318
+ underline: true,
319
+ role: "white",
320
+ size: "small",
321
+ children: assignmentFilename
322
+ })
323
+ });
244
324
  }
245
325
  if (userSubmission === null || userSubmission === void 0 ? void 0 : userSubmission.assignmentUrl) {
246
- return React.createElement("a", {
326
+ return jsxRuntime.jsx("a", {
247
327
  href: userSubmission.assignmentUrl,
248
328
  target: "_blank",
249
- rel: "noopener noreferrer"
250
- }, React.createElement(blocks.Text, {
251
- hoverable: true,
252
- underline: true,
253
- role: "white",
254
- size: "small"
255
- }, userSubmission.assignmentUrl));
329
+ rel: "noopener noreferrer",
330
+ children: jsxRuntime.jsx(blocks.Text, {
331
+ hoverable: true,
332
+ underline: true,
333
+ role: "white",
334
+ size: "small",
335
+ children: userSubmission.assignmentUrl
336
+ })
337
+ });
256
338
  }
257
- })();
258
- return React.createElement(blocks.InfoTable, {
259
- dark: true
260
- }, React.createElement("tbody", null, React.createElement("tr", null, React.createElement("td", null, "\uC0C1\uD0DC"), React.createElement("td", null, statusText)), React.createElement("tr", null, React.createElement("td", null, "\uACFC\uC81C \uC81C\uCD9C \uAE30\uD55C"), React.createElement("td", null, React.createElement(intl.FormattedDate, {
261
- value: materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.closeDatetime,
262
- dateStyle: "medium",
263
- timeStyle: "short"
264
- }))), React.createElement("tr", null, React.createElement("td", null, "\uC81C\uCD9C \uC77C\uC2DC"), React.createElement("td", null, userSubmission ? React.createElement(intl.FormattedDate, {
265
- value: userSubmission.createdDatetime,
266
- dateStyle: "medium",
267
- timeStyle: "short"
268
- }) : '--')), React.createElement("tr", null, React.createElement("td", null, "\uC5C5\uB85C\uB4DC\uB41C \uACFC\uC81C"), React.createElement("td", null, submissionAttachment))));
339
+ }();
340
+ return jsxRuntime.jsx(blocks.InfoTable, {
341
+ dark: true,
342
+ children: jsxRuntime.jsxs("tbody", {
343
+ children: [jsxRuntime.jsxs("tr", {
344
+ children: [jsxRuntime.jsx("td", {
345
+ children: "\uC0C1\uD0DC"
346
+ }), jsxRuntime.jsx("td", {
347
+ children: statusText
348
+ })]
349
+ }), jsxRuntime.jsxs("tr", {
350
+ children: [jsxRuntime.jsx("td", {
351
+ children: "\uACFC\uC81C \uC81C\uCD9C \uAE30\uD55C"
352
+ }), jsxRuntime.jsx("td", {
353
+ children: jsxRuntime.jsx(intl.FormattedDate, {
354
+ value: materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.closeDatetime,
355
+ dateStyle: "medium",
356
+ timeStyle: "short"
357
+ })
358
+ })]
359
+ }), jsxRuntime.jsxs("tr", {
360
+ children: [jsxRuntime.jsx("td", {
361
+ children: "\uC81C\uCD9C \uC77C\uC2DC"
362
+ }), jsxRuntime.jsx("td", {
363
+ children: userSubmission ? jsxRuntime.jsx(intl.FormattedDate, {
364
+ value: userSubmission.createdDatetime,
365
+ dateStyle: "medium",
366
+ timeStyle: "short"
367
+ }) : '--'
368
+ })]
369
+ }), jsxRuntime.jsxs("tr", {
370
+ children: [jsxRuntime.jsx("td", {
371
+ children: "\uC5C5\uB85C\uB4DC\uB41C \uACFC\uC81C"
372
+ }), jsxRuntime.jsx("td", {
373
+ children: submissionAttachment
374
+ })]
375
+ })]
376
+ })
377
+ });
269
378
  };
270
- const renderGrade = () => {
271
- const isGradeEditDisabled = !isAssignmentClosed || !isUserSubmitted || isScoreFinalized;
272
- const tooltipTitle = (() => {
379
+ var renderGrade = function renderGrade() {
380
+ var isGradeEditDisabled = !isAssignmentClosed || !isUserSubmitted || isScoreFinalized;
381
+ var tooltipTitle = function () {
273
382
  switch (true) {
274
383
  case isScoreFinalized:
275
384
  return '공개 이후 채점이 불가합니다.';
@@ -278,79 +387,91 @@ const MaterialAssignmentAdminContentTa = ({
278
387
  case !isUserSubmitted:
279
388
  return '미제출인 경우 채점할 수 없습니다.';
280
389
  }
281
- })();
282
- return React.createElement(blocks.Flex, {
390
+ }();
391
+ return jsxRuntime.jsxs(blocks.Flex, {
283
392
  column: true,
284
- align: "center"
285
- }, React.createElement(blocks.Flex, {
286
393
  align: "center",
287
- width: "100%"
288
- }, React.createElement(blocks.Flex, {
289
- column: true,
290
- auto: true
291
- }, React.createElement(blocks.Text, {
292
- block: true,
293
- bold: true,
294
- role: "white",
295
- lineHeight: 1.375
296
- }, "\uB0B4 \uCC44\uC810"), React.createElement(blocks.Text, {
297
- block: true,
298
- size: "tiny",
299
- role: "navy3",
300
- lineHeight: 1.6
301
- }, "\uB0B4\uAC00 \uB9E4\uAE34 \uD3C9\uAC00\uC640 \uAD00\uB828\uB41C \uC815\uBCF4\uB97C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4.")), React.createElement(blocks.Tooltip, {
302
- placement: "top",
303
- title: tooltipTitle,
304
- visible: isGradeEditDisabled ? undefined : false
305
- }, React.createElement("span", null, React.createElement(blocks.Button, {
306
- size: "small",
307
- role: "lightpurple",
308
- disabled: isGradeEditDisabled,
309
- onClick: handleGradeEditClick
310
- }, Boolean(myGrade) ? '내 채점 수정' : '내 채점 시작')))), React.createElement(blocks.Vspace, {
311
- height: 0.75
312
- }), React.createElement(blocks.TableNext, {
313
- dark: true,
314
- emptyMessage: "\uC544\uC9C1 \uCC44\uC810\uC744 \uC2DC\uC791\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.",
315
- columns: [{
316
- Header: '채점자명',
317
- accessor: 'fullname'
318
- }, {
319
- Header: '과제 점수',
320
- accessor: 'grade'
321
- }, {
322
- Header: '채점 일시',
323
- accessor: 'created',
324
- textAlign: 'left'
325
- }],
326
- data: myGrade ? [{
327
- fullname: React.createElement(blocks.Flex, {
328
- paddingy: "0.25rem"
329
- }, React.createElement(blocks.Text, {
330
- noWrap: true,
331
- role: "navy0",
332
- size: "small"
333
- }, myGrade.gradeUser.fullname), React.createElement(blocks.Hspace, {
334
- width: 0.25
335
- }), React.createElement(blocks.Text, {
336
- ellipsis: true,
337
- role: "navy3",
338
- size: "small"
339
- }, myGrade.gradeUser.email)),
340
- grade: myGrade.score,
341
- created: React.createElement(intl.FormattedDate, {
342
- value: myGrade.createdDatetime,
343
- dateStyle: "medium",
344
- timeStyle: "short"
345
- })
346
- }] : []
347
- }));
394
+ children: [jsxRuntime.jsxs(blocks.Flex, {
395
+ align: "center",
396
+ width: "100%",
397
+ children: [jsxRuntime.jsxs(blocks.Flex, {
398
+ column: true,
399
+ auto: true,
400
+ children: [jsxRuntime.jsx(blocks.Text, {
401
+ block: true,
402
+ bold: true,
403
+ role: "white",
404
+ lineHeight: 1.375,
405
+ children: "\uB0B4 \uCC44\uC810"
406
+ }), jsxRuntime.jsx(blocks.Text, {
407
+ block: true,
408
+ size: "tiny",
409
+ role: "navy3",
410
+ lineHeight: 1.6,
411
+ children: "\uB0B4\uAC00 \uB9E4\uAE34 \uD3C9\uAC00\uC640 \uAD00\uB828\uB41C \uC815\uBCF4\uB97C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."
412
+ })]
413
+ }), jsxRuntime.jsx(blocks.Tooltip, {
414
+ placement: "top",
415
+ title: tooltipTitle,
416
+ visible: isGradeEditDisabled ? undefined : false,
417
+ children: jsxRuntime.jsx("span", {
418
+ children: jsxRuntime.jsx(blocks.Button, {
419
+ size: "small",
420
+ role: "lightpurple",
421
+ disabled: isGradeEditDisabled,
422
+ onClick: handleGradeEditClick,
423
+ children: Boolean(myGrade) ? '내 채점 수정' : '내 채점 시작'
424
+ })
425
+ })
426
+ })]
427
+ }), jsxRuntime.jsx(blocks.Vspace, {
428
+ height: 0.75
429
+ }), jsxRuntime.jsx(blocks.TableNext, {
430
+ dark: true,
431
+ emptyMessage: "\uC544\uC9C1 \uCC44\uC810\uC744 \uC2DC\uC791\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.",
432
+ columns: [{
433
+ Header: '채점자명',
434
+ accessor: 'fullname'
435
+ }, {
436
+ Header: '과제 점수',
437
+ accessor: 'grade'
438
+ }, {
439
+ Header: '채점 일시',
440
+ accessor: 'created',
441
+ textAlign: 'left'
442
+ }],
443
+ data: myGrade ? [{
444
+ fullname: jsxRuntime.jsxs(blocks.Flex, {
445
+ paddingy: "0.25rem",
446
+ children: [jsxRuntime.jsx(blocks.Text, {
447
+ noWrap: true,
448
+ role: "navy0",
449
+ size: "small",
450
+ children: myGrade.gradeUser.fullname
451
+ }), jsxRuntime.jsx(blocks.Hspace, {
452
+ width: 0.25
453
+ }), jsxRuntime.jsx(blocks.Text, {
454
+ ellipsis: true,
455
+ role: "navy3",
456
+ size: "small",
457
+ children: myGrade.gradeUser.email
458
+ })]
459
+ }),
460
+ grade: myGrade.score,
461
+ created: jsxRuntime.jsx(intl.FormattedDate, {
462
+ value: myGrade.createdDatetime,
463
+ dateStyle: "medium",
464
+ timeStyle: "short"
465
+ })
466
+ }] : []
467
+ })]
468
+ });
348
469
  };
349
- const renderGradeEditModal = () => {
470
+ var renderGradeEditModal = function renderGradeEditModal() {
350
471
  if (!showGradeEditModal) {
351
472
  return null;
352
473
  }
353
- return React.createElement(blocks.Modal, {
474
+ return jsxRuntime.jsxs(blocks.Modal, {
354
475
  title: Boolean(myGrade) ? '내 채점 수정' : '과제 채점',
355
476
  footerButtons: [{
356
477
  label: '확인',
@@ -363,85 +484,97 @@ const MaterialAssignmentAdminContentTa = ({
363
484
  label: '취소',
364
485
  size: 'small',
365
486
  role: 'gray1',
366
- onClick: () => {
487
+ onClick: function onClick() {
367
488
  setShowGradeEditModal(false);
368
489
  }
369
490
  }],
370
- onHide: () => {
491
+ onHide: function onHide() {
371
492
  setShowGradeEditModal(false);
372
- }
373
- }, React.createElement(blocks.Label, {
374
- bold: true,
375
- block: true,
376
- required: true
377
- }, "\uC810\uC218"), React.createElement(blocks.Vspace, {
378
- height: 0.5
379
- }), React.createElement(blocks.Flex, {
380
- align: "center"
381
- }, React.createElement(reactHookForm.Controller, {
382
- control: gradeEditFormMethods.control,
383
- name: "score",
384
- rules: {
385
- required: true,
386
- min: 0,
387
- max: 100
388
- },
389
- render: ({
390
- field,
391
- fieldState
392
- }) => React.createElement(blocks.Input, Object.assign({}, field, {
393
- invalid: fieldState.invalid,
394
- size: "small",
395
- width: "xsmall",
396
- type: "number"
397
- }))
398
- }), React.createElement(blocks.Hspace, {
399
- width: 0.5
400
- }), React.createElement(blocks.Text, {
401
- bold: true,
402
- role: "gray9",
403
- size: "small"
404
- }, "\uC810"), React.createElement(blocks.Text, {
405
- role: "gray6",
406
- size: "small"
407
- }, ' / 100점 만점')), React.createElement(blocks.Vspace, {
408
- height: 1.25
409
- }), React.createElement(blocks.Label, {
410
- bold: true,
411
- block: true
412
- }, "\uD53C\uB4DC\uBC31"), React.createElement(blocks.Vspace, {
413
- height: 0.5
414
- }), React.createElement(reactHookForm.Controller, {
415
- control: gradeEditFormMethods.control,
416
- name: "comment",
417
- rules: {
418
- maxLength: 1000
419
493
  },
420
- render: ({
421
- field
422
- }) => React.createElement(blocks.Textarea, {
423
- value: field.value,
424
- wordLimit: 1000,
425
- rows: 8,
426
- onChange: field.onChange
427
- })
428
- }));
494
+ children: [jsxRuntime.jsx(blocks.Label, {
495
+ bold: true,
496
+ block: true,
497
+ required: true,
498
+ children: "\uC810\uC218"
499
+ }), jsxRuntime.jsx(blocks.Vspace, {
500
+ height: 0.5
501
+ }), jsxRuntime.jsxs(blocks.Flex, {
502
+ align: "center",
503
+ children: [jsxRuntime.jsx(reactHookForm.Controller, {
504
+ control: gradeEditFormMethods.control,
505
+ name: "score",
506
+ rules: {
507
+ required: true,
508
+ min: 0,
509
+ max: 100
510
+ },
511
+ render: function render(_ref4) {
512
+ var field = _ref4.field,
513
+ fieldState = _ref4.fieldState;
514
+ return jsxRuntime.jsx(blocks.Input, Object.assign({}, field, {
515
+ invalid: fieldState.invalid,
516
+ size: "small",
517
+ width: "xsmall",
518
+ type: "number"
519
+ }));
520
+ }
521
+ }), jsxRuntime.jsx(blocks.Hspace, {
522
+ width: 0.5
523
+ }), jsxRuntime.jsx(blocks.Text, {
524
+ bold: true,
525
+ role: "gray9",
526
+ size: "small",
527
+ children: "\uC810"
528
+ }), jsxRuntime.jsx(blocks.Text, {
529
+ role: "gray6",
530
+ size: "small",
531
+ children: ' / 100점 만점'
532
+ })]
533
+ }), jsxRuntime.jsx(blocks.Vspace, {
534
+ height: 1.25
535
+ }), jsxRuntime.jsx(blocks.Label, {
536
+ bold: true,
537
+ block: true,
538
+ children: "\uD53C\uB4DC\uBC31"
539
+ }), jsxRuntime.jsx(blocks.Vspace, {
540
+ height: 0.5
541
+ }), jsxRuntime.jsx(reactHookForm.Controller, {
542
+ control: gradeEditFormMethods.control,
543
+ name: "comment",
544
+ rules: {
545
+ maxLength: 1000
546
+ },
547
+ render: function render(_ref5) {
548
+ var field = _ref5.field;
549
+ return jsxRuntime.jsx(blocks.Textarea, {
550
+ value: field.value,
551
+ wordLimit: 1000,
552
+ rows: 8,
553
+ onChange: field.onChange
554
+ });
555
+ }
556
+ })]
557
+ });
429
558
  };
430
- return React.createElement(React.Fragment, null, renderHeader(), React.createElement(blocks.Flex, {
431
- column: true,
432
- auto: true,
433
- padding: "3.625rem",
434
- width: "100%",
435
- height: "100%",
436
- overflow: "hidden",
437
- align: "center"
438
- }, React.createElement(MaterialAssignmentContainer.default, {
439
- title: (_a = materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.title) !== null && _a !== void 0 ? _a : ''
440
- }, renderGradeResult(), React.createElement(blocks.Vspace, {
441
- height: 1.25
442
- }), renderSubmissionInfo(), React.createElement(blocks.Vspace, {
443
- height: 1.5
444
- }), renderGrade())), renderGradeEditModal());
559
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
560
+ children: [renderHeader(), jsxRuntime.jsx(blocks.Flex, {
561
+ column: true,
562
+ auto: true,
563
+ padding: "3.625rem",
564
+ width: "100%",
565
+ height: "100%",
566
+ overflow: "hidden",
567
+ align: "center",
568
+ children: jsxRuntime.jsxs(MaterialAssignmentContainer.default, {
569
+ title: (_a = materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.title) !== null && _a !== void 0 ? _a : '',
570
+ children: [renderGradeResult(), jsxRuntime.jsx(blocks.Vspace, {
571
+ height: 1.25
572
+ }), renderSubmissionInfo(), jsxRuntime.jsx(blocks.Vspace, {
573
+ height: 1.5
574
+ }), renderGrade()]
575
+ })
576
+ }), renderGradeEditModal()]
577
+ });
445
578
  };
446
579
 
447
580
  exports.default = MaterialAssignmentAdminContentTa;