@elice/material-assignment 1.240306.0-runboxtutoring.0 → 1.240306.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/cjs/components/material-assignment/MaterialAssignment.d.ts +3 -3
  2. package/cjs/components/material-assignment/MaterialAssignment.js +22 -34
  3. package/cjs/components/material-assignment/MaterialAssignmentContent.js +195 -299
  4. package/cjs/components/material-assignment/MaterialAssignmentUploadModal.js +142 -185
  5. package/cjs/components/material-assignment/locales.d.ts +39 -0
  6. package/cjs/components/material-assignment/locales.js +81 -0
  7. package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.d.ts +2 -4
  8. package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.js +26 -35
  9. package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.styled.d.ts +2 -0
  10. package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.styled.js +17 -19
  11. package/cjs/components/material-assignment-admin/MaterialAssignmentAdminContent.js +565 -863
  12. package/cjs/components/material-assignment-admin/MaterialAssignmentAdminContentTa.js +314 -467
  13. package/cjs/components/shared/MaterialAssignmentContainer.js +13 -23
  14. package/es/components/material-assignment/MaterialAssignment.d.ts +3 -3
  15. package/es/components/material-assignment/MaterialAssignment.js +23 -29
  16. package/es/components/material-assignment/MaterialAssignmentContent.js +193 -292
  17. package/es/components/material-assignment/MaterialAssignmentUploadModal.js +140 -178
  18. package/es/components/material-assignment/locales.d.ts +39 -0
  19. package/es/components/material-assignment/locales.js +78 -0
  20. package/es/components/material-assignment-admin/MaterialAssignmentAdmin.d.ts +2 -4
  21. package/es/components/material-assignment-admin/MaterialAssignmentAdmin.js +27 -32
  22. package/es/components/material-assignment-admin/MaterialAssignmentAdmin.styled.d.ts +2 -0
  23. package/es/components/material-assignment-admin/MaterialAssignmentAdmin.styled.js +16 -16
  24. package/es/components/material-assignment-admin/MaterialAssignmentAdminContent.js +567 -860
  25. package/es/components/material-assignment-admin/MaterialAssignmentAdminContentTa.js +316 -464
  26. package/es/components/shared/MaterialAssignmentContainer.js +13 -19
  27. package/package.json +15 -12
  28. package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -383
  29. package/cjs/components/index.js +0 -9
  30. package/cjs/components/material-assignment/constants/color.d.ts +0 -1
  31. package/cjs/components/material-assignment/constants/color.js +0 -5
  32. package/cjs/components/material-assignment/index.js +0 -7
  33. package/cjs/components/material-assignment/locales/en.json.js +0 -7
  34. package/cjs/components/material-assignment/locales/index.d.ts +0 -4
  35. package/cjs/components/material-assignment/locales/index.js +0 -13
  36. package/cjs/components/material-assignment/locales/ja.json.js +0 -7
  37. package/cjs/components/material-assignment/locales/ko.json.js +0 -7
  38. package/cjs/components/material-assignment/locales/th.json.js +0 -7
  39. package/cjs/components/material-assignment-admin/index.js +0 -7
  40. package/cjs/components/material-assignment-admin/locales/en.json.js +0 -7
  41. package/cjs/components/material-assignment-admin/locales/index.d.ts +0 -4
  42. package/cjs/components/material-assignment-admin/locales/index.js +0 -13
  43. package/cjs/components/material-assignment-admin/locales/ja.json.js +0 -7
  44. package/cjs/components/material-assignment-admin/locales/ko.json.js +0 -7
  45. package/cjs/components/material-assignment-admin/locales/th.json.js +0 -7
  46. package/es/_virtual/_rollupPluginBabelHelpers.js +0 -374
  47. package/es/components/index.js +0 -2
  48. package/es/components/material-assignment/constants/color.d.ts +0 -1
  49. package/es/components/material-assignment/constants/color.js +0 -3
  50. package/es/components/material-assignment/index.js +0 -1
  51. package/es/components/material-assignment/locales/en.json.js +0 -3
  52. package/es/components/material-assignment/locales/index.d.ts +0 -4
  53. package/es/components/material-assignment/locales/index.js +0 -4
  54. package/es/components/material-assignment/locales/ja.json.js +0 -3
  55. package/es/components/material-assignment/locales/ko.json.js +0 -3
  56. package/es/components/material-assignment/locales/th.json.js +0 -3
  57. package/es/components/material-assignment-admin/index.js +0 -1
  58. package/es/components/material-assignment-admin/locales/en.json.js +0 -3
  59. package/es/components/material-assignment-admin/locales/index.d.ts +0 -4
  60. package/es/components/material-assignment-admin/locales/index.js +0 -4
  61. package/es/components/material-assignment-admin/locales/ja.json.js +0 -3
  62. package/es/components/material-assignment-admin/locales/ko.json.js +0 -3
  63. package/es/components/material-assignment-admin/locales/th.json.js +0 -3
@@ -1,185 +1,130 @@
1
- import { slicedToArray as _slicedToArray, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
1
  import React, { forwardRef } from 'react';
4
2
  import { useForm, Controller } from 'react-hook-form';
3
+ import { FormattedDate } from 'react-intl';
5
4
  import { config, getOrgUserGet, getOrgMaterialAssignmentGet, getOrgMaterialAssignmentSubmissionList, getOrgMaterialAssignmentGradeResultGet, getOrgMaterialAssignmentGradeList, postOrgMaterialAssignmentGradeEdit, postOrgMaterialAssignmentGradeResultManualScoreEdit, postOrgMaterialAssignmentGradeDelete } from '@elice/api-client';
6
- import { Flex, Vspace, Text, Hspace, Tooltip, Icon, InfoTable, Button, TableNext, IconButton, Pagination, Modal, Label, Input, Textarea, Alert, Notification } from '@elice/blocks';
5
+ import { Notification, Flex, Vspace, ProfileImage, Hspace, Text, Tooltip, Icon, InfoTable, Button, TableNext, IconButton, Pagination, Modal, Label, Input, Textarea, Alert } from '@elice/blocks';
7
6
  import { base } from '@elice/design-tokens';
8
7
  import { eilStatusInfo, eilChat, eilDelete, eilArrowRightwardsBasic } from '@elice/icons';
9
- import { useRawEliceIntl, FormattedDate } from '@elice/intl';
10
8
  import { useMaterialConfigApiClientUpdate } from '@elice/material-shared-utils';
11
9
  import dayjs from 'dayjs';
12
10
  import MaterialAssignmentContainer from '../shared/MaterialAssignmentContainer.js';
13
- import { StyledMaterialAssignmentAdminGradeWrapper, StyledMaterialAssignmentAdminTextareaWrapper, StyledMaterialAssignmentAdminManualScoreEditButtonWrapper, StyledMaterialAssignmentAdminManualScoreEditButton } from './MaterialAssignmentAdmin.styled.js';
11
+ import { StyledMaterialAssignmentAdminHeader, StyledMaterialAssignmentAdminHeaderCell, StyledMaterialAssignmentAdminGradeWrapper, StyledMaterialAssignmentAdminTextareaWrapper, StyledMaterialAssignmentAdminManualScoreEditButtonWrapper, StyledMaterialAssignmentAdminManualScoreEditButton } from './MaterialAssignmentAdmin.styled.js';
14
12
 
15
- var FETCH_GRADE_LIST_COUNT = 5;
16
- var MaterialAssignmentAdminContent = forwardRef(function (_ref, ref) {
17
- var materialAssignmentId = _ref.materialAssignmentId,
18
- userId = _ref.userId,
19
- adminUserId = _ref.adminUserId,
20
- updateMaterialUserBrowserResponse = _ref.updateMaterialUserBrowserResponse;
13
+ const FETCH_GRADE_LIST_COUNT = 5;
14
+ const MaterialAssignmentAdminContent = forwardRef(({
15
+ materialAssignmentId,
16
+ userId,
17
+ adminUserId,
18
+ updateMaterialUserBrowserResponse
19
+ }, ref) => {
21
20
  var _a;
22
- var intl = useRawEliceIntl();
23
21
  // Form
24
- var gradeEditFormMethods = useForm({
22
+ const gradeEditFormMethods = useForm({
25
23
  defaultValues: {
26
24
  score: 0,
27
25
  comment: ''
28
26
  },
29
27
  mode: 'onChange'
30
28
  });
31
- var manualScoreEditFormMethods = useForm({
29
+ const manualScoreEditFormMethods = useForm({
32
30
  defaultValues: {
33
31
  manualScore: 0
34
32
  },
35
33
  mode: 'onChange'
36
34
  });
37
35
  // API Status
38
- var isReady = useMaterialConfigApiClientUpdate(config.init);
39
- var _React$useState = React.useState('idle'),
40
- _React$useState2 = _slicedToArray(_React$useState, 2),
41
- submissionListGetStatus = _React$useState2[0],
42
- setSubmissionListGetStatus = _React$useState2[1];
43
- var _React$useState3 = React.useState('idle'),
44
- _React$useState4 = _slicedToArray(_React$useState3, 2),
45
- gradeDeleteStatus = _React$useState4[0],
46
- setGradeDeleteStatus = _React$useState4[1];
36
+ const isReady = useMaterialConfigApiClientUpdate(config.init);
37
+ const [submissionListGetStatus, setSubmissionListGetStatus] = React.useState('idle');
38
+ const [gradeDeleteStatus, setGradeDeleteStatus] = React.useState('idle');
47
39
  // State related with component
48
- var _React$useState5 = React.useState(false),
49
- _React$useState6 = _slicedToArray(_React$useState5, 2),
50
- showGradeEditModal = _React$useState6[0],
51
- setShowGradeEditModal = _React$useState6[1];
52
- var _React$useState7 = React.useState(false),
53
- _React$useState8 = _slicedToArray(_React$useState7, 2),
54
- showManualScoreEditModal = _React$useState8[0],
55
- setShowManualScoreEditModal = _React$useState8[1];
56
- var _React$useState9 = React.useState(null),
57
- _React$useState10 = _slicedToArray(_React$useState9, 2),
58
- selectedGradeForShow = _React$useState10[0],
59
- setSelectedGradeForShow = _React$useState10[1];
60
- var _React$useState11 = React.useState(null),
61
- _React$useState12 = _slicedToArray(_React$useState11, 2),
62
- selectedGradeForDelete = _React$useState12[0],
63
- setSelectedGradeForDelete = _React$useState12[1];
40
+ const [showGradeEditModal, setShowGradeEditModal] = React.useState(false);
41
+ const [showManualScoreEditModal, setShowManualScoreEditModal] = React.useState(false);
42
+ const [selectedGradeForShow, setSelectedGradeForShow] = React.useState(null);
43
+ const [selectedGradeForDelete, setSelectedGradeForDelete] = React.useState(null);
64
44
  // State related with api
65
- var _React$useState13 = React.useState(null),
66
- _React$useState14 = _slicedToArray(_React$useState13, 2),
67
- user = _React$useState14[0],
68
- setUser = _React$useState14[1];
69
- var _React$useState15 = React.useState(null),
70
- _React$useState16 = _slicedToArray(_React$useState15, 2),
71
- materialAssignment = _React$useState16[0],
72
- setMaterialAssignment = _React$useState16[1];
73
- var _React$useState17 = React.useState(null),
74
- _React$useState18 = _slicedToArray(_React$useState17, 2),
75
- userSubmission = _React$useState18[0],
76
- setUserSubmission = _React$useState18[1];
77
- var _React$useState19 = React.useState(null),
78
- _React$useState20 = _slicedToArray(_React$useState19, 2),
79
- myGrade = _React$useState20[0],
80
- setMyGrade = _React$useState20[1];
81
- var _React$useState21 = React.useState(null),
82
- _React$useState22 = _slicedToArray(_React$useState21, 2),
83
- gradeResult = _React$useState22[0],
84
- setGradeResult = _React$useState22[1];
85
- var _React$useState23 = React.useState([]),
86
- _React$useState24 = _slicedToArray(_React$useState23, 2),
87
- gradeList = _React$useState24[0],
88
- setGradeList = _React$useState24[1];
89
- var _React$useState25 = React.useState(0),
90
- _React$useState26 = _slicedToArray(_React$useState25, 2),
91
- gradeListCount = _React$useState26[0],
92
- setGradeListCount = _React$useState26[1];
93
- var _React$useState27 = React.useState(1),
94
- _React$useState28 = _slicedToArray(_React$useState27, 2),
95
- gradeListPage = _React$useState28[0],
96
- setGradeListPage = _React$useState28[1];
97
- var gradeListOffset = (gradeListPage - 1) * FETCH_GRADE_LIST_COUNT;
98
- var isAssignmentClosed = dayjs().isAfter(dayjs(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.closeDatetime));
99
- var isScoreFinalized = Boolean(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.scoreFinalizedDatetime);
100
- var isUserSubmitted = Boolean(userSubmission);
101
- var fetchUserGet = React.useCallback(function () {
45
+ const [user, setUser] = React.useState(null);
46
+ const [materialAssignment, setMaterialAssignment] = React.useState(null);
47
+ const [userSubmission, setUserSubmission] = React.useState(null);
48
+ const [myGrade, setMyGrade] = React.useState(null);
49
+ const [gradeResult, setGradeResult] = React.useState(null);
50
+ const [gradeList, setGradeList] = React.useState([]);
51
+ const [gradeListCount, setGradeListCount] = React.useState(0);
52
+ const [gradeListPage, setGradeListPage] = React.useState(1);
53
+ const gradeListOffset = (gradeListPage - 1) * FETCH_GRADE_LIST_COUNT;
54
+ const isAssignmentClosed = dayjs().isAfter(dayjs(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.closeDatetime));
55
+ const isScoreFinalized = Boolean(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.scoreFinalizedDatetime);
56
+ const isUserSubmitted = Boolean(userSubmission);
57
+ const fetchUserGet = React.useCallback(() => {
102
58
  void getOrgUserGet({
103
- userId: userId
104
- }).then(function (res) {
105
- return res.user;
106
- }).then(setUser);
59
+ userId
60
+ }).then(res => res.user).then(setUser);
107
61
  }, [userId]);
108
- var fetchMaterialAssignmentGet = React.useCallback(function () {
62
+ const fetchMaterialAssignmentGet = React.useCallback(() => {
109
63
  void getOrgMaterialAssignmentGet({
110
- materialAssignmentId: materialAssignmentId
111
- }).then(function (res) {
112
- return res.materialAssignment;
113
- }).then(setMaterialAssignment);
64
+ materialAssignmentId
65
+ }).then(res => res.materialAssignment).then(setMaterialAssignment);
114
66
  }, [materialAssignmentId]);
115
- var fetchSubmissionList = React.useCallback(function () {
67
+ const fetchSubmissionList = React.useCallback(() => {
116
68
  setSubmissionListGetStatus('pending');
117
69
  void getOrgMaterialAssignmentSubmissionList({
118
- materialAssignmentId: materialAssignmentId,
70
+ materialAssignmentId,
119
71
  offset: 0,
120
72
  count: 1,
121
73
  filterConditions: {
122
74
  isLast: true,
123
75
  userIds: [userId]
124
76
  }
125
- }).then(function (res) {
126
- return res.materialAssignmentSubmissions[0];
127
- }).then(function (submission) {
77
+ }).then(res => res.materialAssignmentSubmissions[0]).then(submission => {
128
78
  setUserSubmission(submission !== null && submission !== void 0 ? submission : null);
129
79
  setSubmissionListGetStatus('resolved');
130
- }).catch(function (err) {
80
+ }).catch(err => {
131
81
  console.error(err);
132
82
  setSubmissionListGetStatus('rejected');
133
83
  });
134
84
  }, [materialAssignmentId, userId]);
135
- var fetchGradeResult = React.useCallback(function () {
85
+ const fetchGradeResult = React.useCallback(() => {
136
86
  void getOrgMaterialAssignmentGradeResultGet({
137
- materialAssignmentId: materialAssignmentId,
138
- userId: userId
139
- }).then(function (res) {
140
- return res.materialAssignmentGradeResult;
141
- }).then(setGradeResult).catch(function () {
87
+ materialAssignmentId,
88
+ userId
89
+ }).then(res => res.materialAssignmentGradeResult).then(setGradeResult).catch(() => {
142
90
  setGradeResult(null);
143
91
  });
144
92
  }, [materialAssignmentId, userId]);
145
- var fetchGradeList = React.useCallback(function () {
93
+ const fetchGradeList = React.useCallback(() => {
146
94
  void getOrgMaterialAssignmentGradeList({
147
- materialAssignmentId: materialAssignmentId,
95
+ materialAssignmentId,
148
96
  offset: gradeListOffset,
149
97
  count: FETCH_GRADE_LIST_COUNT,
150
98
  filterConditions: {
151
- userId: userId
99
+ userId
152
100
  }
153
- }).then(function (_ref2) {
154
- var materialAssignmentGrades = _ref2.materialAssignmentGrades,
155
- materialAssignmentGradeCount = _ref2.materialAssignmentGradeCount;
101
+ }).then(({
102
+ materialAssignmentGrades,
103
+ materialAssignmentGradeCount
104
+ }) => {
156
105
  setGradeList(materialAssignmentGrades);
157
106
  setGradeListCount(materialAssignmentGradeCount);
158
107
  });
159
108
  }, [gradeListOffset, materialAssignmentId, userId]);
160
- var fetchMyGrade = React.useCallback(function () {
109
+ const fetchMyGrade = React.useCallback(() => {
161
110
  void getOrgMaterialAssignmentGradeList({
162
- materialAssignmentId: materialAssignmentId,
111
+ materialAssignmentId,
163
112
  offset: 0,
164
113
  count: 1,
165
114
  filterConditions: {
166
- userId: userId,
115
+ userId,
167
116
  gradeUserId: adminUserId
168
117
  }
169
- }).then(function (res) {
170
- return res.materialAssignmentGrades[0];
171
- }).then(function (grade) {
172
- return setMyGrade(grade !== null && grade !== void 0 ? grade : null);
173
- });
118
+ }).then(res => res.materialAssignmentGrades[0]).then(grade => setMyGrade(grade !== null && grade !== void 0 ? grade : null));
174
119
  }, [adminUserId, materialAssignmentId, userId]);
175
- var handleManualScoreEditClick = function handleManualScoreEditClick() {
120
+ const handleManualScoreEditClick = () => {
176
121
  var _a, _b;
177
122
  setShowManualScoreEditModal(true);
178
123
  manualScoreEditFormMethods.reset({
179
124
  manualScore: (_b = (_a = gradeResult === null || gradeResult === void 0 ? void 0 : gradeResult.manualScore) !== null && _a !== void 0 ? _a : gradeResult === null || gradeResult === void 0 ? void 0 : gradeResult.avgCalcScore) !== null && _b !== void 0 ? _b : 0
180
125
  });
181
126
  };
182
- var handleGradeEditClick = function handleGradeEditClick() {
127
+ const handleGradeEditClick = () => {
183
128
  var _a, _b;
184
129
  setShowGradeEditModal(true);
185
130
  gradeEditFormMethods.reset({
@@ -187,156 +132,82 @@ var MaterialAssignmentAdminContent = forwardRef(function (_ref, ref) {
187
132
  comment: (_b = myGrade === null || myGrade === void 0 ? void 0 : myGrade.comment) !== null && _b !== void 0 ? _b : ''
188
133
  });
189
134
  };
190
- var handleGradeEditSubmit = gradeEditFormMethods.handleSubmit( /*#__PURE__*/function () {
191
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref3) {
192
- var score, comment;
193
- return _regeneratorRuntime().wrap(function _callee$(_context) {
194
- while (1) switch (_context.prev = _context.next) {
195
- case 0:
196
- score = _ref3.score, comment = _ref3.comment;
197
- _context.prev = 1;
198
- _context.next = 4;
199
- return postOrgMaterialAssignmentGradeEdit({
200
- materialAssignmentGradeId: myGrade === null || myGrade === void 0 ? void 0 : myGrade.id,
201
- materialAssignmentId: materialAssignmentId,
202
- userId: userId,
203
- score: score,
204
- comment: comment
205
- });
206
- case 4:
207
- fetchMyGrade();
208
- fetchGradeResult();
209
- fetchGradeList();
210
- if (typeof updateMaterialUserBrowserResponse === 'function') {
211
- updateMaterialUserBrowserResponse(userId);
212
- }
213
- Notification.success(intl.formatMessage({
214
- id: 'materialAssignment.notify.success'
215
- }));
216
- _context.next = 15;
217
- break;
218
- case 11:
219
- _context.prev = 11;
220
- _context.t0 = _context["catch"](1);
221
- console.error(_context.t0);
222
- Notification.error(intl.formatMessage({
223
- id: 'materialAssignment.notify.error'
224
- }));
225
- case 15:
226
- _context.prev = 15;
227
- setShowGradeEditModal(false);
228
- return _context.finish(15);
229
- case 18:
230
- case "end":
231
- return _context.stop();
232
- }
233
- }, _callee, null, [[1, 11, 15, 18]]);
234
- }));
235
- return function (_x) {
236
- return _ref4.apply(this, arguments);
237
- };
238
- }());
239
- var handleGradeDeleteSubmit = /*#__PURE__*/function () {
240
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
241
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
242
- while (1) switch (_context2.prev = _context2.next) {
243
- case 0:
244
- if (selectedGradeForDelete) {
245
- _context2.next = 2;
246
- break;
247
- }
248
- return _context2.abrupt("return");
249
- case 2:
250
- _context2.prev = 2;
251
- setGradeDeleteStatus('pending');
252
- _context2.next = 6;
253
- return postOrgMaterialAssignmentGradeDelete({
254
- materialAssignmentGradeId: selectedGradeForDelete.id
255
- });
256
- case 6:
257
- // If delete my grade, re-fetch my grade data.
258
- if (adminUserId === selectedGradeForDelete.gradeUser.id) {
259
- fetchMyGrade();
260
- }
261
- fetchGradeList();
262
- fetchGradeResult();
263
- setGradeDeleteStatus('resolved');
264
- if (typeof updateMaterialUserBrowserResponse === 'function') {
265
- updateMaterialUserBrowserResponse(userId);
266
- }
267
- Notification.success(intl.formatMessage({
268
- id: 'materialAssignment.notify.success'
269
- }));
270
- _context2.next = 19;
271
- break;
272
- case 14:
273
- _context2.prev = 14;
274
- _context2.t0 = _context2["catch"](2);
275
- console.error(_context2.t0);
276
- setGradeDeleteStatus('rejected');
277
- Notification.error(intl.formatMessage({
278
- id: 'materialAssignment.notify.error'
279
- }));
280
- case 19:
281
- _context2.prev = 19;
282
- setSelectedGradeForDelete(null);
283
- return _context2.finish(19);
284
- case 22:
285
- case "end":
286
- return _context2.stop();
287
- }
288
- }, _callee2, null, [[2, 14, 19, 22]]);
289
- }));
290
- return function handleGradeDeleteSubmit() {
291
- return _ref5.apply(this, arguments);
292
- };
293
- }();
294
- var handleManualScoreEditSubmit = manualScoreEditFormMethods.handleSubmit( /*#__PURE__*/function () {
295
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref6) {
296
- var manualScore;
297
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
298
- while (1) switch (_context3.prev = _context3.next) {
299
- case 0:
300
- manualScore = _ref6.manualScore;
301
- _context3.prev = 1;
302
- _context3.next = 4;
303
- return postOrgMaterialAssignmentGradeResultManualScoreEdit({
304
- userId: userId,
305
- manualScore: manualScore,
306
- materialAssignmentId: materialAssignmentId
307
- });
308
- case 4:
309
- fetchGradeResult();
310
- if (typeof updateMaterialUserBrowserResponse === 'function') {
311
- updateMaterialUserBrowserResponse(userId);
312
- }
313
- Notification.success(intl.formatMessage({
314
- id: 'materialAssignment.notify.success'
315
- }));
316
- _context3.next = 13;
317
- break;
318
- case 9:
319
- _context3.prev = 9;
320
- _context3.t0 = _context3["catch"](1);
321
- console.error(_context3.t0);
322
- Notification.error(intl.formatMessage({
323
- id: 'materialAssignment.notify.error'
324
- }));
325
- case 13:
326
- _context3.prev = 13;
327
- setShowManualScoreEditModal(false);
328
- return _context3.finish(13);
329
- case 16:
330
- case "end":
331
- return _context3.stop();
332
- }
333
- }, _callee3, null, [[1, 9, 13, 16]]);
334
- }));
335
- return function (_x2) {
336
- return _ref7.apply(this, arguments);
337
- };
338
- }());
339
- React.useEffect(function () {
135
+ const handleGradeEditSubmit = gradeEditFormMethods.handleSubmit(async ({
136
+ score,
137
+ comment
138
+ }) => {
139
+ try {
140
+ await postOrgMaterialAssignmentGradeEdit({
141
+ materialAssignmentGradeId: myGrade === null || myGrade === void 0 ? void 0 : myGrade.id,
142
+ materialAssignmentId,
143
+ userId,
144
+ score,
145
+ comment
146
+ });
147
+ fetchMyGrade();
148
+ fetchGradeResult();
149
+ fetchGradeList();
150
+ if (typeof updateMaterialUserBrowserResponse === 'function') {
151
+ updateMaterialUserBrowserResponse(userId);
152
+ }
153
+ Notification.success('저장되었습니다');
154
+ } catch (err) {
155
+ console.error(err);
156
+ Notification.error('오류가 발생했습니다.');
157
+ } finally {
158
+ setShowGradeEditModal(false);
159
+ }
160
+ });
161
+ const handleGradeDeleteSubmit = async () => {
162
+ if (!selectedGradeForDelete) {
163
+ return;
164
+ }
165
+ try {
166
+ setGradeDeleteStatus('pending');
167
+ await postOrgMaterialAssignmentGradeDelete({
168
+ materialAssignmentGradeId: selectedGradeForDelete.id
169
+ });
170
+ // If delete my grade, re-fetch my grade data.
171
+ if (adminUserId === selectedGradeForDelete.gradeUser.id) {
172
+ fetchMyGrade();
173
+ }
174
+ fetchGradeList();
175
+ fetchGradeResult();
176
+ setGradeDeleteStatus('resolved');
177
+ if (typeof updateMaterialUserBrowserResponse === 'function') {
178
+ updateMaterialUserBrowserResponse(userId);
179
+ }
180
+ Notification.success('저장되었습니다');
181
+ } catch (err) {
182
+ console.error(err);
183
+ setGradeDeleteStatus('rejected');
184
+ Notification.error('오류가 발생했습니다.');
185
+ } finally {
186
+ setSelectedGradeForDelete(null);
187
+ }
188
+ };
189
+ const handleManualScoreEditSubmit = manualScoreEditFormMethods.handleSubmit(async ({
190
+ manualScore
191
+ }) => {
192
+ try {
193
+ await postOrgMaterialAssignmentGradeResultManualScoreEdit({
194
+ userId,
195
+ manualScore,
196
+ materialAssignmentId
197
+ });
198
+ fetchGradeResult();
199
+ if (typeof updateMaterialUserBrowserResponse === 'function') {
200
+ updateMaterialUserBrowserResponse(userId);
201
+ }
202
+ Notification.success('저장되었습니다');
203
+ } catch (err) {
204
+ console.error(err);
205
+ Notification.error('오류가 발생했습니다.');
206
+ } finally {
207
+ setShowManualScoreEditModal(false);
208
+ }
209
+ });
210
+ React.useEffect(() => {
340
211
  if (!isReady) {
341
212
  return;
342
213
  }
@@ -347,709 +218,545 @@ var MaterialAssignmentAdminContent = forwardRef(function (_ref, ref) {
347
218
  fetchSubmissionList();
348
219
  fetchMaterialAssignmentGet();
349
220
  }, [isReady, fetchUserGet, fetchMyGrade, fetchGradeList, fetchGradeResult, fetchSubmissionList, fetchMaterialAssignmentGet]);
350
- React.useImperativeHandle(ref, function () {
351
- return {
352
- refreshMaterialAssignment: function refreshMaterialAssignment() {
353
- fetchMaterialAssignmentGet();
354
- }
355
- };
356
- }, [fetchMaterialAssignmentGet]);
357
- var renderManualScoreEditButton = function renderManualScoreEditButton() {
358
- return jsx(Tooltip, {
221
+ React.useImperativeHandle(ref, () => ({
222
+ refreshMaterialAssignment: () => {
223
+ fetchMaterialAssignmentGet();
224
+ }
225
+ }), [fetchMaterialAssignmentGet]);
226
+ const renderHeader = () => {
227
+ var _a, _b, _c;
228
+ return React.createElement(StyledMaterialAssignmentAdminHeader, {
229
+ align: "center",
230
+ padding: "1rem",
231
+ width: "100%"
232
+ }, React.createElement(Flex, {
233
+ auto: true,
234
+ align: "center"
235
+ }, React.createElement(ProfileImage, {
236
+ src: (_a = user === null || user === void 0 ? void 0 : user.profileUrl) !== null && _a !== void 0 ? _a : '',
237
+ width: "2.5rem",
238
+ height: "2.5rem"
239
+ }), React.createElement(Hspace, {
240
+ width: 1
241
+ }), React.createElement(Text, {
242
+ size: "small",
243
+ role: "warmwhite"
244
+ }, user === null || user === void 0 ? void 0 : user.fullname)), React.createElement(StyledMaterialAssignmentAdminHeaderCell, null, React.createElement(Text, {
245
+ size: "tiny",
246
+ role: "gray4"
247
+ }, "\uC810\uC218"), React.createElement(Text, {
248
+ size: "small",
249
+ role: "white"
250
+ }, gradeResult ? `${(_c = (_b = gradeResult.manualScore) !== null && _b !== void 0 ? _b : gradeResult.avgCalcScore) !== null && _c !== void 0 ? _c : 0}${isScoreFinalized ? '(공개됨)' : '(비공개)'}` : '--')), React.createElement(StyledMaterialAssignmentAdminHeaderCell, null, React.createElement(Text, {
251
+ size: "tiny",
252
+ role: "gray4"
253
+ }, "\uC81C\uCD9C \uC77C\uC2DC"), React.createElement(Text, {
254
+ size: "small",
255
+ role: "white"
256
+ }, userSubmission ? React.createElement(FormattedDate, {
257
+ value: userSubmission.createdDatetime,
258
+ dateStyle: "medium",
259
+ timeStyle: "short"
260
+ }) : '--')));
261
+ };
262
+ const renderManualScoreEditButton = () => {
263
+ return React.createElement(Tooltip, {
359
264
  placement: "top",
360
- title: intl.formatMessage({
361
- id: isUserSubmitted ? 'materialAssignment.tooltip.manual-score-edit.submit' : 'materialAssignment.tooltip.manual-score-edit.not-submit'
362
- }),
363
- visible: !isAssignmentClosed || !isUserSubmitted ? undefined : false,
364
- children: jsx(StyledMaterialAssignmentAdminManualScoreEditButtonWrapper, {
365
- disabled: !isAssignmentClosed || !isUserSubmitted,
366
- children: jsx(StyledMaterialAssignmentAdminManualScoreEditButton, {
367
- disabled: !isAssignmentClosed || !isUserSubmitted,
368
- underline: true,
369
- role: "navy3",
370
- size: "tiny",
371
- onClick: handleManualScoreEditClick,
372
- children: intl.formatMessage({
373
- id: 'materialAssignment.button.manual-score-edit'
374
- })
375
- })
376
- })
377
- });
265
+ title: isUserSubmitted ? '제출 기한이 지난 이후 조정할 수 있습니다.' : '미제출인 경우 조정할 수 없습니다.',
266
+ visible: !isAssignmentClosed || !isUserSubmitted ? undefined : false
267
+ }, React.createElement(StyledMaterialAssignmentAdminManualScoreEditButtonWrapper, {
268
+ disabled: !isAssignmentClosed || !isUserSubmitted
269
+ }, React.createElement(StyledMaterialAssignmentAdminManualScoreEditButton, {
270
+ disabled: !isAssignmentClosed || !isUserSubmitted,
271
+ underline: true,
272
+ role: "navy3",
273
+ size: "tiny",
274
+ onClick: handleManualScoreEditClick
275
+ }, "\uC810\uC218 \uC870\uC815\uD558\uAE30")));
378
276
  };
379
- var renderGradeResult = function renderGradeResult() {
277
+ const renderGradeResult = () => {
380
278
  var _a, _b;
381
- return jsxs(StyledMaterialAssignmentAdminGradeWrapper, {
279
+ return React.createElement(StyledMaterialAssignmentAdminGradeWrapper, {
382
280
  wrap: true,
383
281
  width: "100%",
384
- align: "center",
385
- children: [jsxs(Flex, {
386
- auto: true,
387
- align: "center",
388
- children: [jsx(Text, {
389
- role: "navy1",
390
- size: "small",
391
- lineHeight: "1.375rem",
392
- children: user ? "".concat(user.fullname, " ").concat(intl.formatMessage({
393
- id: 'materialAssignment.username.subfix'
394
- })) : null
395
- }), jsx(Hspace, {
396
- width: 0.25
397
- }), jsx(Tooltip, {
398
- useMaxWidth: true,
399
- placement: "top",
400
- title: intl.formatMessage({
401
- id: 'materialAssignment.tooltip.grade-result-button'
402
- }),
403
- children: jsx(Icon, {
404
- icon: eilStatusInfo,
405
- color: base.color.navy1
406
- })
407
- }), jsx(Hspace, {
408
- width: 0.75
409
- }), jsx(Text, {
410
- bold: true,
411
- role: "white",
412
- children: gradeResult ? "".concat((_b = (_a = gradeResult.manualScore) !== null && _a !== void 0 ? _a : gradeResult.avgCalcScore) !== null && _b !== void 0 ? _b : 0).concat(isScoreFinalized ? intl.formatMessage({
413
- id: 'materialAssignment.reveal'
414
- }) : intl.formatMessage({
415
- id: 'materialAssignment.private'
416
- })) : '--'
417
- })]
418
- }), renderManualScoreEditButton()]
419
- });
282
+ align: "center"
283
+ }, React.createElement(Flex, {
284
+ auto: true,
285
+ align: "center"
286
+ }, React.createElement(Text, {
287
+ role: "navy1",
288
+ size: "small",
289
+ lineHeight: "1.375rem"
290
+ }, user ? `${user.fullname} 님의 점수` : null), React.createElement(Hspace, {
291
+ width: 0.25
292
+ }), React.createElement(Tooltip, {
293
+ useMaxWidth: true,
294
+ placement: "top",
295
+ title: "모든 채점 점수의 평균값이 반영된 종합 점수입니다. 평균값을 사용하지 않으려면 ‘조정하기'를 클릭해 직접 점수를 입력하세요."
296
+ }, React.createElement(Icon, {
297
+ icon: eilStatusInfo,
298
+ color: base.color.navy1
299
+ })), React.createElement(Hspace, {
300
+ width: 0.75
301
+ }), React.createElement(Text, {
302
+ bold: true,
303
+ role: "white"
304
+ }, gradeResult ? `${(_b = (_a = gradeResult.manualScore) !== null && _a !== void 0 ? _a : gradeResult.avgCalcScore) !== null && _b !== void 0 ? _b : 0}${isScoreFinalized ? '(공개됨)' : '(비공개)'}` : '--')), renderManualScoreEditButton());
420
305
  };
421
- var renderSubmissionInfo = function renderSubmissionInfo() {
422
- var statusText = function () {
306
+ const renderSubmissionInfo = () => {
307
+ const statusText = (() => {
423
308
  if (submissionListGetStatus === 'pending') {
424
309
  return null;
425
310
  }
426
311
  switch (true) {
427
312
  case !isUserSubmitted && isAssignmentClosed:
428
- return jsx(Text, {
313
+ return React.createElement(Text, {
429
314
  bold: true,
430
315
  role: "danger",
431
- size: "small",
432
- children: intl.formatMessage({
433
- id: 'materialAssignment.status.deadlineExpired'
434
- })
435
- });
316
+ size: "small"
317
+ }, "\uC81C\uCD9C \uAE30\uD55C \uB9CC\uB8CC");
436
318
  case isScoreFinalized:
437
- return jsx(Text, {
319
+ return React.createElement(Text, {
438
320
  bold: true,
439
321
  role: "lightpurple",
440
- size: "small",
441
- children: intl.formatMessage({
442
- id: 'materialAssignment.status.graded'
443
- })
444
- });
322
+ size: "small"
323
+ }, "\uCC44\uC810 \uC644\uB8CC");
445
324
  case isUserSubmitted:
446
- return jsx(Text, {
325
+ return React.createElement(Text, {
447
326
  bold: true,
448
327
  role: "success",
449
- size: "small",
450
- children: intl.formatMessage({
451
- id: 'materialAssignment.status.submitted'
452
- })
453
- });
328
+ size: "small"
329
+ }, "\uC81C\uCD9C\uB428");
454
330
  case !isUserSubmitted:
455
- return jsx(Text, {
331
+ return React.createElement(Text, {
456
332
  bold: true,
457
333
  role: "warning",
458
- size: "small",
459
- children: intl.formatMessage({
460
- id: 'materialAssignment.status.noSubmitted'
461
- })
462
- });
334
+ size: "small"
335
+ }, "\uBBF8\uC81C\uCD9C");
463
336
  }
464
- }();
465
- var submissionAttachment = function () {
337
+ })();
338
+ const submissionAttachment = (() => {
466
339
  if (!userSubmission) {
467
340
  return '--';
468
341
  }
469
342
  if (userSubmission.assignmentFileUrl) {
470
- var assignmentFilename = decodeURIComponent(userSubmission.assignmentFileUrl && new URL(userSubmission.assignmentFileUrl).pathname.split('/').pop() || '');
471
- return jsx("a", {
343
+ const assignmentFilename = decodeURIComponent(userSubmission.assignmentFileUrl && new URL(userSubmission.assignmentFileUrl).pathname.split('/').pop() || '');
344
+ return React.createElement("a", {
472
345
  href: userSubmission.assignmentFileUrl,
473
346
  download: assignmentFilename,
474
347
  target: "_blank",
475
- rel: "noopener noreferrer",
476
- children: jsx(Text, {
477
- hoverable: true,
478
- underline: true,
479
- role: "white",
480
- size: "small",
481
- children: assignmentFilename
482
- })
483
- });
348
+ rel: "noopener noreferrer"
349
+ }, React.createElement(Text, {
350
+ hoverable: true,
351
+ underline: true,
352
+ role: "white",
353
+ size: "small"
354
+ }, assignmentFilename));
484
355
  }
485
356
  if (userSubmission === null || userSubmission === void 0 ? void 0 : userSubmission.assignmentUrl) {
486
- return jsx("a", {
357
+ return React.createElement("a", {
487
358
  href: userSubmission.assignmentUrl,
488
359
  target: "_blank",
489
- rel: "noopener noreferrer",
490
- children: jsx(Text, {
491
- hoverable: true,
492
- underline: true,
493
- role: "white",
494
- size: "small",
495
- children: userSubmission.assignmentUrl
496
- })
497
- });
360
+ rel: "noopener noreferrer"
361
+ }, React.createElement(Text, {
362
+ hoverable: true,
363
+ underline: true,
364
+ role: "white",
365
+ size: "small"
366
+ }, userSubmission.assignmentUrl));
498
367
  }
499
- }();
500
- return jsx(InfoTable, {
501
- dark: true,
502
- children: jsxs("tbody", {
503
- children: [jsxs("tr", {
504
- children: [jsx("td", {
505
- children: intl.formatMessage({
506
- id: 'materialAssignment.table.column.status'
507
- })
508
- }), jsx("td", {
509
- children: statusText
510
- })]
511
- }), jsxs("tr", {
512
- children: [jsx("td", {
513
- children: intl.formatMessage({
514
- id: 'materialAssignment.table.column.deadlineDatetime'
515
- })
516
- }), jsx("td", {
517
- children: jsx(FormattedDate, {
518
- value: materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.closeDatetime,
519
- dateStyle: "medium",
520
- timeStyle: "short"
521
- })
522
- })]
523
- }), jsxs("tr", {
524
- children: [jsx("td", {
525
- children: intl.formatMessage({
526
- id: 'materialAssignment.table.column.lastSubmitDatetime'
527
- })
528
- }), jsx("td", {
529
- children: userSubmission ? jsx(FormattedDate, {
530
- value: userSubmission.createdDatetime,
531
- dateStyle: "medium",
532
- timeStyle: "short"
533
- }) : '--'
534
- })]
535
- }), jsxs("tr", {
536
- children: [jsx("td", {
537
- children: intl.formatMessage({
538
- id: 'materialAssignment.table.column.uploadedAssignments'
539
- })
540
- }), jsx("td", {
541
- children: submissionAttachment
542
- })]
543
- })]
544
- })
545
- });
368
+ })();
369
+ return React.createElement(InfoTable, {
370
+ dark: true
371
+ }, 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(FormattedDate, {
372
+ value: materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.closeDatetime,
373
+ dateStyle: "medium",
374
+ timeStyle: "short"
375
+ }))), React.createElement("tr", null, React.createElement("td", null, "\uC81C\uCD9C \uC77C\uC2DC"), React.createElement("td", null, userSubmission ? React.createElement(FormattedDate, {
376
+ value: userSubmission.createdDatetime,
377
+ dateStyle: "medium",
378
+ timeStyle: "short"
379
+ }) : '--')), React.createElement("tr", null, React.createElement("td", null, "\uC5C5\uB85C\uB4DC\uB41C \uACFC\uC81C"), React.createElement("td", null, submissionAttachment))));
546
380
  };
547
- var renderGradeList = function renderGradeList() {
548
- return jsxs(Flex, {
381
+ const renderGradeList = () => {
382
+ return React.createElement(Flex, {
549
383
  column: true,
384
+ align: "center"
385
+ }, React.createElement(Flex, {
550
386
  align: "center",
551
- children: [jsxs(Flex, {
552
- align: "center",
553
- width: "100%",
554
- children: [jsxs(Flex, {
555
- column: true,
556
- auto: true,
557
- children: [jsx(Text, {
558
- block: true,
559
- bold: true,
560
- role: "white",
561
- lineHeight: 1.375,
562
- children: intl.formatMessage({
563
- id: 'materialAssignment.grade-list'
564
- })
565
- }), jsx(Text, {
566
- block: true,
567
- size: "tiny",
568
- role: "navy3",
569
- lineHeight: 1.6,
570
- children: intl.formatMessage({
571
- id: 'materialAssignment.grade-list.description'
572
- })
573
- })]
574
- }), jsx(Tooltip, {
575
- placement: "top",
576
- title: intl.formatMessage({
577
- id: isUserSubmitted ? 'materialAssignment.grade-list.tooltip.submitted' : 'materialAssignment.grade-list.tooltip.not-submitted'
578
- }),
579
- visible: !isAssignmentClosed || !isUserSubmitted ? undefined : false,
580
- children: jsx("span", {
581
- children: jsx(Button, {
582
- size: "small",
583
- role: "lightpurple",
584
- disabled: !isAssignmentClosed || !isUserSubmitted,
585
- onClick: handleGradeEditClick,
586
- children: intl.formatMessage({
587
- id: Boolean(myGrade) ? 'materialAssignment.edit-grading' : 'materialAssignment.start-grading'
588
- })
589
- })
590
- })
591
- })]
592
- }), jsx(Vspace, {
593
- height: 0.75
594
- }), jsx(TableNext, {
595
- dark: true,
596
- emptyMessage: intl.formatMessage({
597
- id: 'materialAssignment.table.empty-smg'
598
- }),
599
- columns: [{
600
- Header: intl.formatMessage({
601
- id: 'materialAssignment.table-col.fullname'
602
- }),
603
- accessor: 'fullname'
604
- }, {
605
- Header: intl.formatMessage({
606
- id: 'materialAssignment.table.column.assignmentScore'
607
- }),
608
- accessor: 'grade'
609
- }, {
610
- Header: intl.formatMessage({
611
- id: 'materialAssignment.table-col.grade-datetime'
612
- }),
613
- accessor: 'created',
614
- textAlign: 'left'
615
- }],
616
- data: gradeList.map(function (grade) {
617
- return {
618
- fullname: jsxs(Flex, {
619
- children: [jsx(Text, {
620
- noWrap: true,
621
- role: "navy0",
622
- size: "small",
623
- children: "".concat(grade.gradeUser.fullname).concat(grade.gradeUser.id === adminUserId ? intl.formatMessage({
624
- id: 'materialAssignment.me'
625
- }) : '')
626
- }), jsx(Hspace, {
627
- width: 0.25
628
- }), jsx(Text, {
629
- ellipsis: true,
630
- role: "navy3",
631
- size: "small",
632
- children: grade.gradeUser.email
633
- })]
634
- }),
635
- grade: grade.score,
636
- created: jsxs(Flex, {
637
- align: "center",
638
- justify: "space-between",
639
- children: [jsx(FormattedDate, {
640
- value: grade.createdDatetime,
641
- dateStyle: "medium",
642
- timeStyle: "short"
643
- }), jsxs(Flex, {
644
- align: "center",
645
- children: [jsx(IconButton, {
646
- icon: eilChat,
647
- size: "tiny",
648
- role: "navy3",
649
- onClick: function onClick() {
650
- setSelectedGradeForShow(grade);
651
- }
652
- }), jsx(Hspace, {
653
- width: 0.5
654
- }), jsx(IconButton, {
655
- icon: eilDelete,
656
- size: "tiny",
657
- role: "navy3",
658
- onClick: function onClick() {
659
- setSelectedGradeForDelete(grade);
660
- }
661
- })]
662
- })]
663
- })
664
- };
665
- })
666
- }), jsx(Vspace, {
667
- height: 0.5
668
- }), jsx(Pagination, {
669
- dark: true,
670
- offset: gradeListOffset,
671
- count: FETCH_GRADE_LIST_COUNT,
672
- total: gradeListCount,
673
- isNext: gradeListOffset + FETCH_GRADE_LIST_COUNT < gradeListCount,
674
- isPrev: gradeListOffset > 0,
675
- onClickNext: function onClickNext() {
676
- setGradeListPage(gradeListPage + 1);
677
- },
678
- onClickPrev: function onClickPrev() {
679
- setGradeListPage(gradeListPage - 1);
680
- }
681
- })]
682
- });
387
+ width: "100%"
388
+ }, React.createElement(Flex, {
389
+ column: true,
390
+ auto: true
391
+ }, React.createElement(Text, {
392
+ block: true,
393
+ bold: true,
394
+ role: "white",
395
+ lineHeight: 1.375
396
+ }, "\uCC44\uC810 \uD604\uD669"), React.createElement(Text, {
397
+ block: true,
398
+ size: "tiny",
399
+ role: "navy3",
400
+ lineHeight: 1.6
401
+ }, "\uCC44\uC810\uC644\uB8CC\uD55C \uCC44\uC810\uC790\uC758 \uC810\uC218\uC640 \uD53C\uB4DC\uBC31\uC744 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4.")), React.createElement(Tooltip, {
402
+ placement: "top",
403
+ title: isUserSubmitted ? '제출 기한이 지난 이후 채점할 수 있습니다.' : '미제출인 경우 채점할 수 없습니다.',
404
+ visible: !isAssignmentClosed || !isUserSubmitted ? undefined : false
405
+ }, React.createElement("span", null, React.createElement(Button, {
406
+ size: "small",
407
+ role: "lightpurple",
408
+ disabled: !isAssignmentClosed || !isUserSubmitted,
409
+ onClick: handleGradeEditClick
410
+ }, Boolean(myGrade) ? '내 채점 수정' : '내 채점 시작')))), React.createElement(Vspace, {
411
+ height: 0.75
412
+ }), React.createElement(TableNext, {
413
+ dark: true,
414
+ emptyMessage: "\uCC44\uC810 \uC644\uB8CC\uD55C \uCC44\uC810\uC790\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",
415
+ columns: [{
416
+ Header: '채점자명',
417
+ accessor: 'fullname'
418
+ }, {
419
+ Header: '과제 점수',
420
+ accessor: 'grade'
421
+ }, {
422
+ Header: '채점 일시',
423
+ accessor: 'created',
424
+ textAlign: 'left'
425
+ }],
426
+ data: gradeList.map(grade => ({
427
+ fullname: React.createElement(Flex, null, React.createElement(Text, {
428
+ noWrap: true,
429
+ role: "navy0",
430
+ size: "small"
431
+ }, `${grade.gradeUser.fullname}${grade.gradeUser.id === adminUserId ? '(나)' : ''}`), React.createElement(Hspace, {
432
+ width: 0.25
433
+ }), React.createElement(Text, {
434
+ ellipsis: true,
435
+ role: "navy3",
436
+ size: "small"
437
+ }, grade.gradeUser.email)),
438
+ grade: grade.score,
439
+ created: React.createElement(Flex, {
440
+ align: "center",
441
+ justify: "space-between"
442
+ }, React.createElement(FormattedDate, {
443
+ value: grade.createdDatetime,
444
+ dateStyle: "medium",
445
+ timeStyle: "short"
446
+ }), React.createElement(Flex, {
447
+ align: "center"
448
+ }, React.createElement(IconButton, {
449
+ icon: eilChat,
450
+ size: "tiny",
451
+ role: "navy3",
452
+ onClick: () => {
453
+ setSelectedGradeForShow(grade);
454
+ }
455
+ }), React.createElement(Hspace, {
456
+ width: 0.5
457
+ }), React.createElement(IconButton, {
458
+ icon: eilDelete,
459
+ size: "tiny",
460
+ role: "navy3",
461
+ onClick: () => {
462
+ setSelectedGradeForDelete(grade);
463
+ }
464
+ })))
465
+ }))
466
+ }), React.createElement(Vspace, {
467
+ height: 0.5
468
+ }), React.createElement(Pagination, {
469
+ dark: true,
470
+ offset: gradeListOffset,
471
+ count: FETCH_GRADE_LIST_COUNT,
472
+ total: gradeListCount,
473
+ isNext: gradeListOffset + FETCH_GRADE_LIST_COUNT < gradeListCount,
474
+ isPrev: gradeListOffset > 0,
475
+ onClickNext: () => {
476
+ setGradeListPage(gradeListPage + 1);
477
+ },
478
+ onClickPrev: () => {
479
+ setGradeListPage(gradeListPage - 1);
480
+ }
481
+ }));
683
482
  };
684
- var renderGradeEditModal = function renderGradeEditModal() {
483
+ const renderGradeEditModal = () => {
685
484
  if (!showGradeEditModal) {
686
485
  return null;
687
486
  }
688
- return jsxs(Modal, {
689
- title: intl.formatMessage({
690
- id: Boolean(myGrade) ? 'materialAssignment.edit-grading' : 'materialAssignment.grading-assignments'
691
- }),
487
+ return React.createElement(Modal, {
488
+ title: Boolean(myGrade) ? '내 채점 수정' : '과제 채점',
692
489
  footerButtons: [{
693
- label: intl.formatMessage({
694
- id: 'materialAssignment.modal.button.confirm'
695
- }),
490
+ label: '확인',
696
491
  size: 'small',
697
492
  role: 'primary',
698
493
  loading: gradeEditFormMethods.formState.isSubmitting,
699
494
  disabled: gradeEditFormMethods.formState.isSubmitting || !gradeEditFormMethods.formState.isValid,
700
495
  onClick: handleGradeEditSubmit
701
496
  }, {
702
- label: intl.formatMessage({
703
- id: 'materialAssignment.modal.button.cancel'
704
- }),
497
+ label: '취소',
705
498
  size: 'small',
706
499
  role: 'gray1',
707
- onClick: function onClick() {
500
+ onClick: () => {
708
501
  setShowGradeEditModal(false);
709
502
  }
710
503
  }],
711
- onHide: function onHide() {
504
+ onHide: () => {
712
505
  setShowGradeEditModal(false);
713
- },
714
- children: [jsx(Label, {
715
- bold: true,
716
- block: true,
506
+ }
507
+ }, React.createElement(Label, {
508
+ bold: true,
509
+ block: true,
510
+ required: true
511
+ }, "\uC810\uC218"), React.createElement(Vspace, {
512
+ height: 0.5
513
+ }), React.createElement(Flex, {
514
+ align: "center"
515
+ }, React.createElement(Controller, {
516
+ control: gradeEditFormMethods.control,
517
+ name: "score",
518
+ rules: {
717
519
  required: true,
718
- children: intl.formatMessage({
719
- id: 'materialAssignment.score'
720
- })
721
- }), jsx(Vspace, {
722
- height: 0.5
723
- }), jsxs(Flex, {
724
- align: "center",
725
- children: [jsx(Controller, {
726
- control: gradeEditFormMethods.control,
727
- name: "score",
728
- rules: {
729
- required: true,
730
- min: 0,
731
- max: 100
732
- },
733
- render: function render(_ref8) {
734
- var field = _ref8.field,
735
- fieldState = _ref8.fieldState;
736
- return jsx(Input, Object.assign({}, field, {
737
- invalid: fieldState.invalid,
738
- size: "small",
739
- width: "xsmall",
740
- type: "number"
741
- }));
742
- }
743
- }), jsx(Hspace, {
744
- width: 0.5
745
- }), jsx(Text, {
746
- bold: true,
747
- role: "gray9",
748
- size: "small",
749
- children: intl.formatMessage({
750
- id: 'materialAssignment.dot'
751
- })
752
- }), jsx(Text, {
753
- role: "gray6",
754
- size: "small",
755
- children: intl.formatMessage({
756
- id: 'materialAssignment.table.column.totalPoint'
757
- }, {
758
- point: 100
759
- })
760
- })]
761
- }), jsx(Vspace, {
762
- height: 1.25
763
- }), jsx(Label, {
764
- bold: true,
765
- block: true,
766
- children: intl.formatMessage({
767
- id: 'materialAssignment.table.header.feedback'
768
- })
769
- }), jsx(Vspace, {
770
- height: 0.5
771
- }), jsx(Controller, {
772
- control: gradeEditFormMethods.control,
773
- name: "comment",
774
- rules: {
775
- maxLength: 1000
776
- },
777
- render: function render(_ref9) {
778
- var field = _ref9.field;
779
- return jsx(Textarea, {
780
- value: field.value,
781
- wordLimit: 1000,
782
- rows: 8,
783
- onChange: field.onChange
784
- });
785
- }
786
- })]
787
- });
520
+ min: 0,
521
+ max: 100
522
+ },
523
+ render: ({
524
+ field,
525
+ fieldState
526
+ }) => React.createElement(Input, Object.assign({}, field, {
527
+ invalid: fieldState.invalid,
528
+ size: "small",
529
+ width: "xsmall",
530
+ type: "number"
531
+ }))
532
+ }), React.createElement(Hspace, {
533
+ width: 0.5
534
+ }), React.createElement(Text, {
535
+ bold: true,
536
+ role: "gray9",
537
+ size: "small"
538
+ }, "\uC810"), React.createElement(Text, {
539
+ role: "gray6",
540
+ size: "small"
541
+ }, ' / 100점 만점')), React.createElement(Vspace, {
542
+ height: 1.25
543
+ }), React.createElement(Label, {
544
+ bold: true,
545
+ block: true
546
+ }, "\uD53C\uB4DC\uBC31"), React.createElement(Vspace, {
547
+ height: 0.5
548
+ }), React.createElement(Controller, {
549
+ control: gradeEditFormMethods.control,
550
+ name: "comment",
551
+ rules: {
552
+ maxLength: 1000
553
+ },
554
+ render: ({
555
+ field
556
+ }) => React.createElement(Textarea, {
557
+ value: field.value,
558
+ wordLimit: 1000,
559
+ rows: 8,
560
+ onChange: field.onChange
561
+ })
562
+ }));
788
563
  };
789
- var renderGradeShowModal = function renderGradeShowModal() {
564
+ const renderGradeShowModal = () => {
790
565
  if (!selectedGradeForShow) {
791
566
  return null;
792
567
  }
793
- return jsxs(Modal, {
794
- title: intl.formatMessage({
795
- id: 'materialAssignment.modal.grade-result.title'
796
- }),
568
+ return React.createElement(Modal, {
569
+ title: "\uCC44\uC810 \uACB0\uACFC \uD655\uC778",
797
570
  footerButtons: [{
798
- label: intl.formatMessage({
799
- id: 'materialAssignment.modal.button.confirm'
800
- }),
571
+ label: '확인',
801
572
  size: 'small',
802
573
  role: 'primary',
803
- onClick: function onClick() {
574
+ onClick: () => {
804
575
  setSelectedGradeForShow(null);
805
576
  }
806
577
  }],
807
- onHide: function onHide() {
578
+ onHide: () => {
808
579
  setSelectedGradeForShow(null);
809
- },
810
- children: [jsx(Label, {
811
- bold: true,
812
- block: true,
813
- required: true,
814
- children: intl.formatMessage({
815
- id: 'materialAssignment.score'
816
- })
817
- }), jsx(Vspace, {
818
- height: 0.5
819
- }), jsxs(Flex, {
820
- align: "center",
821
- children: [jsx(Input, {
822
- disabled: true,
823
- value: selectedGradeForShow.score,
824
- size: "small",
825
- width: "xsmall",
826
- type: "number"
827
- }), jsx(Hspace, {
828
- width: 0.5
829
- }), jsx(Text, {
830
- bold: true,
831
- role: "gray9",
832
- size: "small",
833
- children: intl.formatMessage({
834
- id: 'materialAssignment.dot'
835
- })
836
- }), jsx(Text, {
837
- role: "gray6",
838
- size: "small",
839
- children: intl.formatMessage({
840
- id: 'materialAssignment.table.column.totalPoint'
841
- }, {
842
- point: 100
843
- })
844
- })]
845
- }), jsx(Vspace, {
846
- height: 1.25
847
- }), jsx(Label, {
848
- bold: true,
849
- block: true,
850
- children: intl.formatMessage({
851
- id: 'materialAssignment.table.header.feedback'
852
- })
853
- }), jsx(Vspace, {
854
- height: 0.5
855
- }), jsx(StyledMaterialAssignmentAdminTextareaWrapper, {
856
- children: jsx(Textarea, {
857
- disabled: true,
858
- value: selectedGradeForShow.comment,
859
- wordLimit: 1000,
860
- rows: 8
861
- })
862
- })]
863
- });
580
+ }
581
+ }, React.createElement(Label, {
582
+ bold: true,
583
+ block: true,
584
+ required: true
585
+ }, "\uC810\uC218"), React.createElement(Vspace, {
586
+ height: 0.5
587
+ }), React.createElement(Flex, {
588
+ align: "center"
589
+ }, React.createElement(Input, {
590
+ disabled: true,
591
+ value: selectedGradeForShow.score,
592
+ size: "small",
593
+ width: "xsmall",
594
+ type: "number"
595
+ }), React.createElement(Hspace, {
596
+ width: 0.5
597
+ }), React.createElement(Text, {
598
+ bold: true,
599
+ role: "gray9",
600
+ size: "small"
601
+ }, "\uC810"), React.createElement(Text, {
602
+ role: "gray6",
603
+ size: "small"
604
+ }, ' / 100점 만점')), React.createElement(Vspace, {
605
+ height: 1.25
606
+ }), React.createElement(Label, {
607
+ bold: true,
608
+ block: true
609
+ }, "\uD53C\uB4DC\uBC31"), React.createElement(Vspace, {
610
+ height: 0.5
611
+ }), React.createElement(StyledMaterialAssignmentAdminTextareaWrapper, null, React.createElement(Textarea, {
612
+ disabled: true,
613
+ value: selectedGradeForShow.comment,
614
+ wordLimit: 1000,
615
+ rows: 8
616
+ })));
864
617
  };
865
- var renderGradeDeleteModal = function renderGradeDeleteModal() {
618
+ const renderGradeDeleteModal = () => {
866
619
  if (!selectedGradeForDelete) {
867
620
  return null;
868
621
  }
869
- return jsxs(Modal, {
870
- title: intl.formatMessage({
871
- id: 'materialAssignment.modal.delete-grading'
872
- }),
622
+ return React.createElement(Modal, {
623
+ title: "\uCC44\uC810 \uC0AD\uC81C",
873
624
  width: "narrow",
874
625
  footerButtons: [{
875
- label: intl.formatMessage({
876
- id: 'materialAssignment.modal.button.confirm'
877
- }),
626
+ label: '확인',
878
627
  size: 'small',
879
628
  role: 'primary',
880
629
  loading: gradeDeleteStatus === 'pending',
881
630
  disabled: gradeDeleteStatus === 'pending',
882
631
  onClick: handleGradeDeleteSubmit
883
632
  }, {
884
- label: intl.formatMessage({
885
- id: 'materialAssignment.modal.button.cancel'
886
- }),
633
+ label: '취소',
887
634
  size: 'small',
888
635
  role: 'gray1',
889
- onClick: function onClick() {
636
+ onClick: () => {
890
637
  setSelectedGradeForDelete(null);
891
638
  }
892
639
  }],
893
- onHide: function onHide() {
640
+ onHide: () => {
894
641
  setSelectedGradeForDelete(null);
895
- },
896
- children: [jsx(Text, {
897
- role: "gray9",
898
- children: intl.formatMessage({
899
- id: 'materialAssignment.modal.delete-grading.description'
900
- })
901
- }), jsx(Vspace, {
902
- height: 0.75
903
- }), jsx(TableNext, {
904
- columns: [{
905
- Header: intl.formatMessage({
906
- id: 'materialAssignment.table-col.fullname'
907
- }),
908
- accessor: 'fullname'
909
- }, {
910
- Header: intl.formatMessage({
911
- id: 'materialAssignment.final-score'
912
- }),
913
- accessor: 'score'
914
- }],
915
- data: [{
916
- fullname: jsxs(Flex, {
917
- children: [jsx(Text, {
918
- noWrap: true,
919
- role: "gray9",
920
- size: "small",
921
- children: selectedGradeForDelete.gradeUser.fullname
922
- }), jsx(Hspace, {
923
- width: 0.25
924
- }), jsx(Text, {
925
- ellipsis: true,
926
- role: "gray5",
927
- size: "small",
928
- children: selectedGradeForDelete.gradeUser.email
929
- })]
930
- }),
931
- score: selectedGradeForDelete.score
932
- }]
933
- })]
934
- });
642
+ }
643
+ }, React.createElement(Text, {
644
+ role: "gray9"
645
+ }, "\uC0AD\uC81C\uB41C \uC810\uC218\uC640 \uD53C\uB4DC\uBC31\uC740 \uB2E4\uC2DC \uBCF5\uAD6C\uB420 \uC218 \uC5C6\uC73C\uBA70 \uD559\uC0DD\uC758 \uD3C9\uADE0 \uC810\uC218\uAC00 \uBCC0\uACBD\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4."), React.createElement(Vspace, {
646
+ height: 0.75
647
+ }), React.createElement(TableNext, {
648
+ columns: [{
649
+ Header: '채점자명',
650
+ accessor: 'fullname'
651
+ }, {
652
+ Header: '최종 점수',
653
+ accessor: 'score'
654
+ }],
655
+ data: [{
656
+ fullname: React.createElement(Flex, null, React.createElement(Text, {
657
+ noWrap: true,
658
+ role: "gray9",
659
+ size: "small"
660
+ }, selectedGradeForDelete.gradeUser.fullname), React.createElement(Hspace, {
661
+ width: 0.25
662
+ }), React.createElement(Text, {
663
+ ellipsis: true,
664
+ role: "gray5",
665
+ size: "small"
666
+ }, selectedGradeForDelete.gradeUser.email)),
667
+ score: selectedGradeForDelete.score
668
+ }]
669
+ }));
935
670
  };
936
- var renderManualScoreEditModal = function renderManualScoreEditModal() {
671
+ const renderManualScoreEditModal = () => {
937
672
  var _a, _b;
938
673
  if (!showManualScoreEditModal) {
939
674
  return null;
940
675
  }
941
- return jsxs(Modal, {
942
- title: intl.formatMessage({
943
- id: 'materialAssignment.modal.edit-grading'
944
- }),
676
+ return React.createElement(Modal, {
677
+ title: "\uC810\uC218 \uC870\uC815",
945
678
  width: "narrow",
946
679
  footerButtons: [{
947
- label: intl.formatMessage({
948
- id: 'materialAssignment.modal.button.confirm'
949
- }),
680
+ label: '확인',
950
681
  size: 'small',
951
682
  role: 'primary',
952
683
  loading: manualScoreEditFormMethods.formState.isSubmitting,
953
684
  disabled: manualScoreEditFormMethods.formState.isSubmitting || !manualScoreEditFormMethods.formState.isValid,
954
685
  onClick: handleManualScoreEditSubmit
955
686
  }, {
956
- label: intl.formatMessage({
957
- id: 'materialAssignment.modal.button.cancel'
958
- }),
687
+ label: '취소',
959
688
  size: 'small',
960
689
  role: 'gray1',
961
- onClick: function onClick() {
690
+ onClick: () => {
962
691
  setShowManualScoreEditModal(false);
963
692
  }
964
693
  }],
965
- onHide: function onHide() {
694
+ onHide: () => {
966
695
  setShowManualScoreEditModal(false);
696
+ }
697
+ }, React.createElement(Alert, {
698
+ role: "warning"
699
+ }, "\uC810\uC218 \uC870\uC815 \uC774\uD6C4 \uB2E4\uC2DC \uD3C9\uADE0\uAC12\uC73C\uB85C \uB418\uB3CC\uB9B4 \uC218 \uC5C6\uC73C\uB2C8 \uC720\uC758\uD574 \uC8FC\uC138\uC694."), React.createElement(Vspace, {
700
+ height: 1
701
+ }), React.createElement(Flex, {
702
+ align: "center"
703
+ }, React.createElement(Input, {
704
+ disabled: true,
705
+ size: "small",
706
+ width: "xsmall",
707
+ type: "number",
708
+ label: "\uC774\uC804 \uC810\uC218",
709
+ value: (_b = (_a = gradeResult === null || gradeResult === void 0 ? void 0 : gradeResult.manualScore) !== null && _a !== void 0 ? _a : gradeResult === null || gradeResult === void 0 ? void 0 : gradeResult.avgCalcScore) !== null && _b !== void 0 ? _b : 0
710
+ }), React.createElement(Hspace, {
711
+ width: 1
712
+ }), React.createElement(Icon, {
713
+ icon: eilArrowRightwardsBasic
714
+ }), React.createElement(Hspace, {
715
+ width: 1
716
+ }), React.createElement(Controller, {
717
+ control: manualScoreEditFormMethods.control,
718
+ name: "manualScore",
719
+ rules: {
720
+ required: true,
721
+ min: 0,
722
+ max: 100
967
723
  },
968
- children: [jsx(Alert, {
969
- role: "warning",
970
- children: intl.formatMessage({
971
- id: 'materialAssignment.modal.edit-grading.alert'
972
- })
973
- }), jsx(Vspace, {
974
- height: 1
975
- }), jsxs(Flex, {
976
- align: "center",
977
- children: [jsx(Input, {
978
- disabled: true,
979
- size: "small",
980
- width: "xsmall",
981
- type: "number",
982
- label: intl.formatMessage({
983
- id: 'materialAssignment.previous-score'
984
- }),
985
- value: (_b = (_a = gradeResult === null || gradeResult === void 0 ? void 0 : gradeResult.manualScore) !== null && _a !== void 0 ? _a : gradeResult === null || gradeResult === void 0 ? void 0 : gradeResult.avgCalcScore) !== null && _b !== void 0 ? _b : 0
986
- }), jsx(Hspace, {
987
- width: 1
988
- }), jsx(Icon, {
989
- icon: eilArrowRightwardsBasic
990
- }), jsx(Hspace, {
991
- width: 1
992
- }), jsx(Controller, {
993
- control: manualScoreEditFormMethods.control,
994
- name: "manualScore",
995
- rules: {
996
- required: true,
997
- min: 0,
998
- max: 100
999
- },
1000
- render: function render(_ref10) {
1001
- var field = _ref10.field,
1002
- fieldState = _ref10.fieldState;
1003
- return jsx(Input, Object.assign({}, field, {
1004
- invalid: fieldState.invalid,
1005
- size: "small",
1006
- width: "xsmall",
1007
- type: "number",
1008
- label: intl.formatMessage({
1009
- id: 'materialAssignment.adjusted-score'
1010
- })
1011
- }));
1012
- }
1013
- }), jsx(Hspace, {
1014
- width: 0.75
1015
- }), jsx(Text, {
1016
- bold: true,
1017
- role: "gray9",
1018
- size: "small",
1019
- children: intl.formatMessage({
1020
- id: 'materialAssignment.dot'
1021
- })
1022
- }), jsx(Text, {
1023
- role: "gray6",
1024
- size: "small",
1025
- children: intl.formatMessage({
1026
- id: 'materialAssignment.table.column.totalPoint'
1027
- }, {
1028
- point: 100
1029
- })
1030
- })]
1031
- })]
1032
- });
724
+ render: ({
725
+ field,
726
+ fieldState
727
+ }) => React.createElement(Input, Object.assign({}, field, {
728
+ invalid: fieldState.invalid,
729
+ size: "small",
730
+ width: "xsmall",
731
+ type: "number",
732
+ label: "\uC870\uC815 \uC810\uC218"
733
+ }))
734
+ }), React.createElement(Hspace, {
735
+ width: 0.75
736
+ }), React.createElement(Text, {
737
+ bold: true,
738
+ role: "gray9",
739
+ size: "small"
740
+ }, "\uC810"), React.createElement(Text, {
741
+ role: "gray6",
742
+ size: "small"
743
+ }, ' / 100점 만점')));
1033
744
  };
1034
- return jsxs(Fragment, {
1035
- children: [jsx(Flex, {
1036
- column: true,
1037
- auto: true,
1038
- padding: "3.625rem",
1039
- width: "100%",
1040
- height: "100%",
1041
- overflow: "hidden",
1042
- align: "center",
1043
- children: jsxs(MaterialAssignmentContainer, {
1044
- title: (_a = materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.title) !== null && _a !== void 0 ? _a : '',
1045
- children: [renderGradeResult(), jsx(Vspace, {
1046
- height: 1.25
1047
- }), renderSubmissionInfo(), jsx(Vspace, {
1048
- height: 1.5
1049
- }), renderGradeList()]
1050
- })
1051
- }), renderGradeEditModal(), renderGradeShowModal(), renderGradeDeleteModal(), renderManualScoreEditModal()]
1052
- });
745
+ return React.createElement(React.Fragment, null, renderHeader(), React.createElement(Flex, {
746
+ column: true,
747
+ auto: true,
748
+ padding: "3.625rem",
749
+ width: "100%",
750
+ height: "100%",
751
+ overflow: "hidden",
752
+ align: "center"
753
+ }, React.createElement(MaterialAssignmentContainer, {
754
+ title: (_a = materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.title) !== null && _a !== void 0 ? _a : ''
755
+ }, renderGradeResult(), React.createElement(Vspace, {
756
+ height: 1.25
757
+ }), renderSubmissionInfo(), React.createElement(Vspace, {
758
+ height: 1.5
759
+ }), renderGradeList())), renderGradeEditModal(), renderGradeShowModal(), renderGradeDeleteModal(), renderManualScoreEditModal());
1053
760
  });
1054
761
 
1055
762
  export { MaterialAssignmentAdminContent as default };