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