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

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/components/material-assignment/MaterialAssignment.js +17 -23
  2. package/cjs/components/material-assignment/MaterialAssignmentContent.js +194 -281
  3. package/cjs/components/material-assignment/MaterialAssignmentUploadModal.js +138 -181
  4. package/cjs/components/material-assignment/constants/color.js +1 -1
  5. package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.js +24 -32
  6. package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.styled.js +9 -19
  7. package/cjs/components/material-assignment-admin/MaterialAssignmentAdminContent.js +548 -774
  8. package/cjs/components/material-assignment-admin/MaterialAssignmentAdminContentTa.js +303 -436
  9. package/cjs/components/shared/MaterialAssignmentContainer.js +13 -23
  10. package/es/components/material-assignment/MaterialAssignment.js +17 -18
  11. package/es/components/material-assignment/MaterialAssignmentContent.js +194 -276
  12. package/es/components/material-assignment/MaterialAssignmentUploadModal.js +139 -177
  13. package/es/components/material-assignment/constants/color.js +1 -1
  14. package/es/components/material-assignment-admin/MaterialAssignmentAdmin.js +25 -29
  15. package/es/components/material-assignment-admin/MaterialAssignmentAdmin.styled.js +9 -15
  16. package/es/components/material-assignment-admin/MaterialAssignmentAdminContent.js +549 -770
  17. package/es/components/material-assignment-admin/MaterialAssignmentAdminContentTa.js +304 -432
  18. package/es/components/shared/MaterialAssignmentContainer.js +13 -19
  19. package/package.json +12 -9
  20. package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -383
  21. package/cjs/components/index.js +0 -9
  22. package/cjs/components/material-assignment/index.js +0 -7
  23. package/cjs/components/material-assignment/locales/index.js +0 -13
  24. package/cjs/components/material-assignment-admin/index.js +0 -7
  25. package/es/_virtual/_rollupPluginBabelHelpers.js +0 -374
  26. package/es/components/index.js +0 -2
  27. package/es/components/material-assignment/index.js +0 -1
  28. package/es/components/material-assignment/locales/index.js +0 -4
  29. package/es/components/material-assignment-admin/index.js +0 -1
@@ -2,8 +2,6 @@
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');
9
7
  var apiClient = require('@elice/api-client');
@@ -16,18 +14,14 @@ var dayjs = require('dayjs');
16
14
  var MaterialAssignmentContainer = require('../shared/MaterialAssignmentContainer.js');
17
15
  var MaterialAssignmentAdmin_styled = require('./MaterialAssignmentAdmin.styled.js');
18
16
 
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;
17
+ const MaterialAssignmentAdminContentTa = ({
18
+ materialAssignmentId,
19
+ userId,
20
+ adminUserId
21
+ }) => {
28
22
  var _a;
29
23
  // Form
30
- var gradeEditFormMethods = reactHookForm.useForm({
24
+ const gradeEditFormMethods = reactHookForm.useForm({
31
25
  defaultValues: {
32
26
  score: 0,
33
27
  comment: ''
@@ -35,100 +29,67 @@ var MaterialAssignmentAdminContentTa = function MaterialAssignmentAdminContentTa
35
29
  mode: 'onChange'
36
30
  });
37
31
  // State related with component
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];
32
+ const [showGradeEditModal, setShowGradeEditModal] = React.useState(false);
42
33
  // State related with api
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);
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);
66
42
  // API Status
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 () {
43
+ const isReady = materialSharedUtils.useMaterialConfigApiClientUpdate(apiClient.config.init);
44
+ const [submissionListGetStatus, setSubmissionListGetStatus] = React.useState('idle');
45
+ const fetchUserGet = React.useCallback(() => {
73
46
  void apiClient.getOrgUserGet({
74
- userId: userId
75
- }).then(function (res) {
76
- return res.user;
77
- }).then(setUser);
47
+ userId
48
+ }).then(res => res.user).then(setUser);
78
49
  }, [userId]);
79
- var fetchMaterialAssignmentGet = React__default.default.useCallback(function () {
50
+ const fetchMaterialAssignmentGet = React.useCallback(() => {
80
51
  void apiClient.getOrgMaterialAssignmentGet({
81
- materialAssignmentId: materialAssignmentId
82
- }).then(function (res) {
83
- return res.materialAssignment;
84
- }).then(setMaterialAssignment);
52
+ materialAssignmentId
53
+ }).then(res => res.materialAssignment).then(setMaterialAssignment);
85
54
  }, [materialAssignmentId]);
86
- var fetchSubmissionList = React__default.default.useCallback(function () {
55
+ const fetchSubmissionList = React.useCallback(() => {
87
56
  setSubmissionListGetStatus('pending');
88
57
  void apiClient.getOrgMaterialAssignmentSubmissionList({
89
- materialAssignmentId: materialAssignmentId,
58
+ materialAssignmentId,
90
59
  offset: 0,
91
60
  count: 1,
92
61
  filterConditions: {
93
62
  isLast: true,
94
63
  userIds: [userId]
95
64
  }
96
- }).then(function (res) {
97
- return res.materialAssignmentSubmissions[0];
98
- }).then(function (submission) {
65
+ }).then(res => res.materialAssignmentSubmissions[0]).then(submission => {
99
66
  setUserSubmission(submission !== null && submission !== void 0 ? submission : null);
100
67
  setSubmissionListGetStatus('resolved');
101
- }).catch(function (err) {
68
+ }).catch(err => {
102
69
  console.error(err);
103
70
  setSubmissionListGetStatus('rejected');
104
71
  });
105
72
  }, [materialAssignmentId, userId]);
106
- var fetchGradeResult = React__default.default.useCallback(function () {
73
+ const fetchGradeResult = React.useCallback(() => {
107
74
  void apiClient.getOrgMaterialAssignmentGradeResultGet({
108
- materialAssignmentId: materialAssignmentId,
109
- userId: userId
110
- }).then(function (res) {
111
- return res.materialAssignmentGradeResult;
112
- }).then(setGradeResult).catch(function () {
75
+ materialAssignmentId,
76
+ userId
77
+ }).then(res => res.materialAssignmentGradeResult).then(setGradeResult).catch(() => {
113
78
  setGradeResult(null);
114
79
  });
115
80
  }, [materialAssignmentId, userId]);
116
- var fetchMyGrade = React__default.default.useCallback(function () {
81
+ const fetchMyGrade = React.useCallback(() => {
117
82
  void apiClient.getOrgMaterialAssignmentGradeList({
118
- materialAssignmentId: materialAssignmentId,
83
+ materialAssignmentId,
119
84
  offset: 0,
120
85
  count: 1,
121
86
  filterConditions: {
122
- userId: userId,
87
+ userId,
123
88
  gradeUserId: adminUserId
124
89
  }
125
- }).then(function (res) {
126
- return res.materialAssignmentGrades[0];
127
- }).then(function (grade) {
128
- return setMyGrade(grade !== null && grade !== void 0 ? grade : null);
129
- });
90
+ }).then(res => res.materialAssignmentGrades[0]).then(grade => setMyGrade(grade !== null && grade !== void 0 ? grade : null));
130
91
  }, [adminUserId, materialAssignmentId, userId]);
131
- var handleGradeEditClick = function handleGradeEditClick() {
92
+ const handleGradeEditClick = () => {
132
93
  var _a, _b;
133
94
  setShowGradeEditModal(true);
134
95
  gradeEditFormMethods.reset({
@@ -136,47 +97,28 @@ var MaterialAssignmentAdminContentTa = function MaterialAssignmentAdminContentTa
136
97
  comment: (_b = myGrade === null || myGrade === void 0 ? void 0 : myGrade.comment) !== null && _b !== void 0 ? _b : ''
137
98
  });
138
99
  };
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 () {
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(() => {
180
122
  if (!isReady) {
181
123
  return;
182
124
  }
@@ -186,199 +128,148 @@ var MaterialAssignmentAdminContentTa = function MaterialAssignmentAdminContentTa
186
128
  fetchSubmissionList();
187
129
  fetchMaterialAssignmentGet();
188
130
  }, [isReady, fetchUserGet, fetchMyGrade, fetchGradeResult, fetchSubmissionList, fetchMaterialAssignmentGet]);
189
- var renderHeader = function renderHeader() {
131
+ const renderHeader = () => {
190
132
  var _a;
191
- return jsxRuntime.jsxs(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminHeader, {
133
+ return React.createElement(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminHeader, {
192
134
  align: "center",
193
135
  padding: "1rem",
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
- });
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
+ }) : '--')));
235
166
  };
236
- var renderGradeResult = function renderGradeResult() {
237
- return jsxRuntime.jsx(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminGradeWrapper, {
167
+ const renderGradeResult = () => {
168
+ return React.createElement(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminGradeWrapper, {
238
169
  wrap: true,
239
170
  width: "100%",
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
- });
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}점(공개됨)` : '--')));
268
194
  };
269
- var renderSubmissionInfo = function renderSubmissionInfo() {
270
- var statusText = function () {
195
+ const renderSubmissionInfo = () => {
196
+ const statusText = (() => {
271
197
  if (submissionListGetStatus === 'pending') {
272
198
  return null;
273
199
  }
274
200
  switch (true) {
275
201
  case !isUserSubmitted && isAssignmentClosed:
276
- return jsxRuntime.jsx(blocks.Text, {
202
+ return React.createElement(blocks.Text, {
277
203
  bold: true,
278
204
  role: "danger",
279
- size: "small",
280
- children: "\uC81C\uCD9C \uAE30\uD55C \uB9CC\uB8CC"
281
- });
205
+ size: "small"
206
+ }, "\uC81C\uCD9C \uAE30\uD55C \uB9CC\uB8CC");
282
207
  case isScoreFinalized:
283
- return jsxRuntime.jsx(blocks.Text, {
208
+ return React.createElement(blocks.Text, {
284
209
  bold: true,
285
210
  role: "lightpurple",
286
- size: "small",
287
- children: "\uCC44\uC810 \uC644\uB8CC"
288
- });
211
+ size: "small"
212
+ }, "\uCC44\uC810 \uC644\uB8CC");
289
213
  case isUserSubmitted:
290
- return jsxRuntime.jsx(blocks.Text, {
214
+ return React.createElement(blocks.Text, {
291
215
  bold: true,
292
216
  role: "success",
293
- size: "small",
294
- children: "\uC81C\uCD9C\uB428"
295
- });
217
+ size: "small"
218
+ }, "\uC81C\uCD9C\uB428");
296
219
  case !isUserSubmitted:
297
- return jsxRuntime.jsx(blocks.Text, {
220
+ return React.createElement(blocks.Text, {
298
221
  bold: true,
299
222
  role: "warning",
300
- size: "small",
301
- children: "\uBBF8\uC81C\uCD9C"
302
- });
223
+ size: "small"
224
+ }, "\uBBF8\uC81C\uCD9C");
303
225
  }
304
- }();
305
- var submissionAttachment = function () {
226
+ })();
227
+ const submissionAttachment = (() => {
306
228
  if (!userSubmission) {
307
229
  return '--';
308
230
  }
309
231
  if (userSubmission.assignmentFileUrl) {
310
- var assignmentFilename = decodeURIComponent(userSubmission.assignmentFileUrl && new URL(userSubmission.assignmentFileUrl).pathname.split('/').pop() || '');
311
- return jsxRuntime.jsx("a", {
232
+ const assignmentFilename = decodeURIComponent(userSubmission.assignmentFileUrl && new URL(userSubmission.assignmentFileUrl).pathname.split('/').pop() || '');
233
+ return React.createElement("a", {
312
234
  href: userSubmission.assignmentFileUrl,
313
235
  download: assignmentFilename,
314
236
  target: "_blank",
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
- });
237
+ rel: "noopener noreferrer"
238
+ }, React.createElement(blocks.Text, {
239
+ hoverable: true,
240
+ underline: true,
241
+ role: "white",
242
+ size: "small"
243
+ }, assignmentFilename));
324
244
  }
325
245
  if (userSubmission === null || userSubmission === void 0 ? void 0 : userSubmission.assignmentUrl) {
326
- return jsxRuntime.jsx("a", {
246
+ return React.createElement("a", {
327
247
  href: userSubmission.assignmentUrl,
328
248
  target: "_blank",
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
- });
249
+ rel: "noopener noreferrer"
250
+ }, React.createElement(blocks.Text, {
251
+ hoverable: true,
252
+ underline: true,
253
+ role: "white",
254
+ size: "small"
255
+ }, userSubmission.assignmentUrl));
338
256
  }
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
- });
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))));
378
269
  };
379
- var renderGrade = function renderGrade() {
380
- var isGradeEditDisabled = !isAssignmentClosed || !isUserSubmitted || isScoreFinalized;
381
- var tooltipTitle = function () {
270
+ const renderGrade = () => {
271
+ const isGradeEditDisabled = !isAssignmentClosed || !isUserSubmitted || isScoreFinalized;
272
+ const tooltipTitle = (() => {
382
273
  switch (true) {
383
274
  case isScoreFinalized:
384
275
  return '공개 이후 채점이 불가합니다.';
@@ -387,91 +278,79 @@ var MaterialAssignmentAdminContentTa = function MaterialAssignmentAdminContentTa
387
278
  case !isUserSubmitted:
388
279
  return '미제출인 경우 채점할 수 없습니다.';
389
280
  }
390
- }();
391
- return jsxRuntime.jsxs(blocks.Flex, {
281
+ })();
282
+ return React.createElement(blocks.Flex, {
392
283
  column: true,
284
+ align: "center"
285
+ }, React.createElement(blocks.Flex, {
393
286
  align: "center",
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
- });
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
+ }));
469
348
  };
470
- var renderGradeEditModal = function renderGradeEditModal() {
349
+ const renderGradeEditModal = () => {
471
350
  if (!showGradeEditModal) {
472
351
  return null;
473
352
  }
474
- return jsxRuntime.jsxs(blocks.Modal, {
353
+ return React.createElement(blocks.Modal, {
475
354
  title: Boolean(myGrade) ? '내 채점 수정' : '과제 채점',
476
355
  footerButtons: [{
477
356
  label: '확인',
@@ -484,97 +363,85 @@ var MaterialAssignmentAdminContentTa = function MaterialAssignmentAdminContentTa
484
363
  label: '취소',
485
364
  size: 'small',
486
365
  role: 'gray1',
487
- onClick: function onClick() {
366
+ onClick: () => {
488
367
  setShowGradeEditModal(false);
489
368
  }
490
369
  }],
491
- onHide: function onHide() {
370
+ onHide: () => {
492
371
  setShowGradeEditModal(false);
493
- },
494
- children: [jsxRuntime.jsx(blocks.Label, {
495
- bold: true,
496
- block: true,
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: {
497
385
  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
- });
558
- };
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()]
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
+ },
420
+ render: ({
421
+ field
422
+ }) => React.createElement(blocks.Textarea, {
423
+ value: field.value,
424
+ wordLimit: 1000,
425
+ rows: 8,
426
+ onChange: field.onChange
575
427
  })
576
- }), renderGradeEditModal()]
577
- });
428
+ }));
429
+ };
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());
578
445
  };
579
446
 
580
447
  exports.default = MaterialAssignmentAdminContentTa;