@elice/material-assignment 1.251120.1 → 1.260128.0-rc.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 (37) hide show
  1. package/cjs/_virtual/_rollupPluginBabelHelpers.js +157 -350
  2. package/cjs/components/index.js +2 -2
  3. package/cjs/components/material-assignment/MaterialAssignment.d.ts +1 -1
  4. package/cjs/components/material-assignment/MaterialAssignment.js +8 -8
  5. package/cjs/components/material-assignment/MaterialAssignmentContent.js +33 -33
  6. package/cjs/components/material-assignment/MaterialAssignmentUploadModal.js +26 -27
  7. package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.d.ts +2 -3
  8. package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.js +4 -4
  9. package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.styled.d.ts +22 -8
  10. package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.styled.js +20 -20
  11. package/cjs/components/material-assignment-admin/MaterialAssignmentAdminContent.js +94 -96
  12. package/cjs/components/material-assignment-admin/MaterialAssignmentAdminContentTa.js +34 -35
  13. package/cjs/components/shared/MaterialAssignmentContainer.d.ts +1 -1
  14. package/cjs/components/shared/MaterialAssignmentContainer.js +19 -11
  15. package/cjs/index.js +2 -2
  16. package/cjs/node_modules/@elice/mui-system/es/tokens/colors/green.js +31 -0
  17. package/cjs/node_modules/@elice/mui-system/es/tokens/colors/orange.js +31 -0
  18. package/cjs/node_modules/@elice/utils/es/texts/validateUrl.js +18 -0
  19. package/es/_virtual/_rollupPluginBabelHelpers.js +156 -350
  20. package/es/components/index.js +1 -1
  21. package/es/components/material-assignment/MaterialAssignment.d.ts +1 -1
  22. package/es/components/material-assignment/MaterialAssignment.js +7 -7
  23. package/es/components/material-assignment/MaterialAssignmentContent.js +32 -32
  24. package/es/components/material-assignment/MaterialAssignmentUploadModal.js +25 -26
  25. package/es/components/material-assignment-admin/MaterialAssignmentAdmin.d.ts +2 -3
  26. package/es/components/material-assignment-admin/MaterialAssignmentAdmin.js +4 -4
  27. package/es/components/material-assignment-admin/MaterialAssignmentAdmin.styled.d.ts +22 -8
  28. package/es/components/material-assignment-admin/MaterialAssignmentAdmin.styled.js +19 -19
  29. package/es/components/material-assignment-admin/MaterialAssignmentAdminContent.js +95 -97
  30. package/es/components/material-assignment-admin/MaterialAssignmentAdminContentTa.js +35 -36
  31. package/es/components/shared/MaterialAssignmentContainer.d.ts +1 -1
  32. package/es/components/shared/MaterialAssignmentContainer.js +18 -10
  33. package/es/index.js +1 -1
  34. package/es/node_modules/@elice/mui-system/es/tokens/colors/green.js +29 -0
  35. package/es/node_modules/@elice/mui-system/es/tokens/colors/orange.js +29 -0
  36. package/es/node_modules/@elice/utils/es/texts/validateUrl.js +16 -0
  37. package/package.json +12 -11
@@ -1,4 +1,4 @@
1
- import { slicedToArray as _slicedToArray, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
+ import { slicedToArray as _slicedToArray, asyncToGenerator as _asyncToGenerator, regenerator as _regenerator } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
3
  import React, { forwardRef } from 'react';
4
4
  import { useForm, Controller } from 'react-hook-form';
@@ -54,46 +54,46 @@ var MaterialAssignmentAdminContent = forwardRef(function (_ref, ref) {
54
54
  showManualScoreEditModal = _React$useState8[0],
55
55
  setShowManualScoreEditModal = _React$useState8[1];
56
56
  var _React$useState9 = React.useState(null),
57
- _React$useState10 = _slicedToArray(_React$useState9, 2),
58
- selectedGradeForShow = _React$useState10[0],
59
- setSelectedGradeForShow = _React$useState10[1];
57
+ _React$useState0 = _slicedToArray(_React$useState9, 2),
58
+ selectedGradeForShow = _React$useState0[0],
59
+ setSelectedGradeForShow = _React$useState0[1];
60
+ var _React$useState1 = React.useState(null),
61
+ _React$useState10 = _slicedToArray(_React$useState1, 2),
62
+ selectedGradeForDelete = _React$useState10[0],
63
+ setSelectedGradeForDelete = _React$useState10[1];
64
+ // State related with api
60
65
  var _React$useState11 = React.useState(null),
61
66
  _React$useState12 = _slicedToArray(_React$useState11, 2),
62
- selectedGradeForDelete = _React$useState12[0],
63
- setSelectedGradeForDelete = _React$useState12[1];
64
- // State related with api
67
+ user = _React$useState12[0],
68
+ setUser = _React$useState12[1];
65
69
  var _React$useState13 = React.useState(null),
66
70
  _React$useState14 = _slicedToArray(_React$useState13, 2),
67
- user = _React$useState14[0],
68
- setUser = _React$useState14[1];
71
+ materialAssignment = _React$useState14[0],
72
+ setMaterialAssignment = _React$useState14[1];
69
73
  var _React$useState15 = React.useState(null),
70
74
  _React$useState16 = _slicedToArray(_React$useState15, 2),
71
- materialAssignment = _React$useState16[0],
72
- setMaterialAssignment = _React$useState16[1];
75
+ userSubmission = _React$useState16[0],
76
+ setUserSubmission = _React$useState16[1];
73
77
  var _React$useState17 = React.useState(null),
74
78
  _React$useState18 = _slicedToArray(_React$useState17, 2),
75
- userSubmission = _React$useState18[0],
76
- setUserSubmission = _React$useState18[1];
79
+ myGrade = _React$useState18[0],
80
+ setMyGrade = _React$useState18[1];
77
81
  var _React$useState19 = React.useState(null),
78
82
  _React$useState20 = _slicedToArray(_React$useState19, 2),
79
- myGrade = _React$useState20[0],
80
- setMyGrade = _React$useState20[1];
81
- var _React$useState21 = React.useState(null),
83
+ gradeResult = _React$useState20[0],
84
+ setGradeResult = _React$useState20[1];
85
+ var _React$useState21 = React.useState([]),
82
86
  _React$useState22 = _slicedToArray(_React$useState21, 2),
83
- gradeResult = _React$useState22[0],
84
- setGradeResult = _React$useState22[1];
85
- var _React$useState23 = React.useState([]),
87
+ gradeList = _React$useState22[0],
88
+ setGradeList = _React$useState22[1];
89
+ var _React$useState23 = React.useState(0),
86
90
  _React$useState24 = _slicedToArray(_React$useState23, 2),
87
- gradeList = _React$useState24[0],
88
- setGradeList = _React$useState24[1];
89
- var _React$useState25 = React.useState(0),
91
+ gradeListCount = _React$useState24[0],
92
+ setGradeListCount = _React$useState24[1];
93
+ var _React$useState25 = React.useState(1),
90
94
  _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];
95
+ gradeListPage = _React$useState26[0],
96
+ setGradeListPage = _React$useState26[1];
97
97
  var gradeListOffset = (gradeListPage - 1) * FETCH_GRADE_LIST_COUNT;
98
98
  var isAssignmentClosed = dayjs().isAfter(dayjs(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.closeDatetime));
99
99
  var isScoreFinalized = Boolean(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.scoreFinalizedDatetime);
@@ -127,7 +127,7 @@ var MaterialAssignmentAdminContent = forwardRef(function (_ref, ref) {
127
127
  }).then(function (submission) {
128
128
  setUserSubmission(submission !== null && submission !== void 0 ? submission : null);
129
129
  setSubmissionListGetStatus('resolved');
130
- }).catch(function (err) {
130
+ })["catch"](function (err) {
131
131
  console.error(err);
132
132
  setSubmissionListGetStatus('rejected');
133
133
  });
@@ -138,7 +138,7 @@ var MaterialAssignmentAdminContent = forwardRef(function (_ref, ref) {
138
138
  userId: userId
139
139
  }).then(function (res) {
140
140
  return res.materialAssignmentGradeResult;
141
- }).then(setGradeResult).catch(function () {
141
+ }).then(setGradeResult)["catch"](function () {
142
142
  setGradeResult(null);
143
143
  });
144
144
  }, [materialAssignmentId, userId]);
@@ -187,15 +187,15 @@ var MaterialAssignmentAdminContent = forwardRef(function (_ref, ref) {
187
187
  comment: (_b = myGrade === null || myGrade === void 0 ? void 0 : myGrade.comment) !== null && _b !== void 0 ? _b : ''
188
188
  });
189
189
  };
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) {
190
+ var handleGradeEditSubmit = gradeEditFormMethods.handleSubmit(/*#__PURE__*/function () {
191
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref3) {
192
+ var score, comment, _t;
193
+ return _regenerator().w(function (_context) {
194
+ while (1) switch (_context.p = _context.n) {
195
195
  case 0:
196
196
  score = _ref3.score, comment = _ref3.comment;
197
- _context.prev = 1;
198
- _context.next = 4;
197
+ _context.p = 1;
198
+ _context.n = 2;
199
199
  return postOrgMaterialAssignmentGradeEdit({
200
200
  materialAssignmentGradeId: myGrade === null || myGrade === void 0 ? void 0 : myGrade.id,
201
201
  materialAssignmentId: materialAssignmentId,
@@ -203,7 +203,7 @@ var MaterialAssignmentAdminContent = forwardRef(function (_ref, ref) {
203
203
  score: score,
204
204
  comment: comment
205
205
  });
206
- case 4:
206
+ case 2:
207
207
  fetchMyGrade();
208
208
  fetchGradeResult();
209
209
  fetchGradeList();
@@ -213,47 +213,47 @@ var MaterialAssignmentAdminContent = forwardRef(function (_ref, ref) {
213
213
  Notification.success(intl.formatMessage({
214
214
  id: 'materialAssignment.notify.success'
215
215
  }));
216
- _context.next = 15;
216
+ _context.n = 4;
217
217
  break;
218
- case 11:
219
- _context.prev = 11;
220
- _context.t0 = _context["catch"](1);
221
- console.error(_context.t0);
218
+ case 3:
219
+ _context.p = 3;
220
+ _t = _context.v;
221
+ console.error(_t);
222
222
  Notification.error(intl.formatMessage({
223
223
  id: 'materialAssignment.notify.error'
224
224
  }));
225
- case 15:
226
- _context.prev = 15;
225
+ case 4:
226
+ _context.p = 4;
227
227
  setShowGradeEditModal(false);
228
- return _context.finish(15);
229
- case 18:
230
- case "end":
231
- return _context.stop();
228
+ return _context.f(4);
229
+ case 5:
230
+ return _context.a(2);
232
231
  }
233
- }, _callee, null, [[1, 11, 15, 18]]);
232
+ }, _callee, null, [[1, 3, 4, 5]]);
234
233
  }));
235
234
  return function (_x) {
236
235
  return _ref4.apply(this, arguments);
237
236
  };
238
237
  }());
239
238
  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) {
239
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
240
+ var _t2;
241
+ return _regenerator().w(function (_context2) {
242
+ while (1) switch (_context2.p = _context2.n) {
243
243
  case 0:
244
244
  if (selectedGradeForDelete) {
245
- _context2.next = 2;
245
+ _context2.n = 1;
246
246
  break;
247
247
  }
248
- return _context2.abrupt("return");
249
- case 2:
250
- _context2.prev = 2;
248
+ return _context2.a(2);
249
+ case 1:
250
+ _context2.p = 1;
251
251
  setGradeDeleteStatus('pending');
252
- _context2.next = 6;
252
+ _context2.n = 2;
253
253
  return postOrgMaterialAssignmentGradeDelete({
254
254
  materialAssignmentGradeId: selectedGradeForDelete.id
255
255
  });
256
- case 6:
256
+ case 2:
257
257
  // If delete my grade, re-fetch my grade data.
258
258
  if (adminUserId === selectedGradeForDelete.gradeUser.id) {
259
259
  fetchMyGrade();
@@ -267,45 +267,44 @@ var MaterialAssignmentAdminContent = forwardRef(function (_ref, ref) {
267
267
  Notification.success(intl.formatMessage({
268
268
  id: 'materialAssignment.notify.success'
269
269
  }));
270
- _context2.next = 19;
270
+ _context2.n = 4;
271
271
  break;
272
- case 14:
273
- _context2.prev = 14;
274
- _context2.t0 = _context2["catch"](2);
275
- console.error(_context2.t0);
272
+ case 3:
273
+ _context2.p = 3;
274
+ _t2 = _context2.v;
275
+ console.error(_t2);
276
276
  setGradeDeleteStatus('rejected');
277
277
  Notification.error(intl.formatMessage({
278
278
  id: 'materialAssignment.notify.error'
279
279
  }));
280
- case 19:
281
- _context2.prev = 19;
280
+ case 4:
281
+ _context2.p = 4;
282
282
  setSelectedGradeForDelete(null);
283
- return _context2.finish(19);
284
- case 22:
285
- case "end":
286
- return _context2.stop();
283
+ return _context2.f(4);
284
+ case 5:
285
+ return _context2.a(2);
287
286
  }
288
- }, _callee2, null, [[2, 14, 19, 22]]);
287
+ }, _callee2, null, [[1, 3, 4, 5]]);
289
288
  }));
290
289
  return function handleGradeDeleteSubmit() {
291
290
  return _ref5.apply(this, arguments);
292
291
  };
293
292
  }();
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) {
293
+ var handleManualScoreEditSubmit = manualScoreEditFormMethods.handleSubmit(/*#__PURE__*/function () {
294
+ var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref6) {
295
+ var manualScore, _t3;
296
+ return _regenerator().w(function (_context3) {
297
+ while (1) switch (_context3.p = _context3.n) {
299
298
  case 0:
300
299
  manualScore = _ref6.manualScore;
301
- _context3.prev = 1;
302
- _context3.next = 4;
300
+ _context3.p = 1;
301
+ _context3.n = 2;
303
302
  return postOrgMaterialAssignmentGradeResultManualScoreEdit({
304
303
  userId: userId,
305
304
  manualScore: manualScore,
306
305
  materialAssignmentId: materialAssignmentId
307
306
  });
308
- case 4:
307
+ case 2:
309
308
  fetchGradeResult();
310
309
  if (typeof updateMaterialUserBrowserResponse === 'function') {
311
310
  updateMaterialUserBrowserResponse(userId);
@@ -313,24 +312,23 @@ var MaterialAssignmentAdminContent = forwardRef(function (_ref, ref) {
313
312
  Notification.success(intl.formatMessage({
314
313
  id: 'materialAssignment.notify.success'
315
314
  }));
316
- _context3.next = 13;
315
+ _context3.n = 4;
317
316
  break;
318
- case 9:
319
- _context3.prev = 9;
320
- _context3.t0 = _context3["catch"](1);
321
- console.error(_context3.t0);
317
+ case 3:
318
+ _context3.p = 3;
319
+ _t3 = _context3.v;
320
+ console.error(_t3);
322
321
  Notification.error(intl.formatMessage({
323
322
  id: 'materialAssignment.notify.error'
324
323
  }));
325
- case 13:
326
- _context3.prev = 13;
324
+ case 4:
325
+ _context3.p = 4;
327
326
  setShowManualScoreEditModal(false);
328
- return _context3.finish(13);
329
- case 16:
330
- case "end":
331
- return _context3.stop();
327
+ return _context3.f(4);
328
+ case 5:
329
+ return _context3.a(2);
332
330
  }
333
- }, _callee3, null, [[1, 9, 13, 16]]);
331
+ }, _callee3, null, [[1, 3, 4, 5]]);
334
332
  }));
335
333
  return function (_x2) {
336
334
  return _ref7.apply(this, arguments);
@@ -364,8 +362,8 @@ var MaterialAssignmentAdminContent = forwardRef(function (_ref, ref) {
364
362
  children: jsx(StyledMaterialAssignmentAdminManualScoreEditButtonWrapper, {
365
363
  disabled: !isAssignmentClosed || !isUserSubmitted,
366
364
  children: jsx(StyledMaterialAssignmentAdminManualScoreEditButton, {
367
- disabled: !isAssignmentClosed || !isUserSubmitted,
368
365
  underline: true,
366
+ disabled: !isAssignmentClosed || !isUserSubmitted,
369
367
  role: "navy3",
370
368
  size: "tiny",
371
369
  onClick: handleManualScoreEditClick,
@@ -584,7 +582,7 @@ var MaterialAssignmentAdminContent = forwardRef(function (_ref, ref) {
584
582
  disabled: !isAssignmentClosed || !isUserSubmitted,
585
583
  onClick: handleGradeEditClick,
586
584
  children: intl.formatMessage({
587
- id: Boolean(myGrade) ? 'materialAssignment.edit-grading' : 'materialAssignment.start-grading'
585
+ id: myGrade ? 'materialAssignment.edit-grading' : 'materialAssignment.start-grading'
588
586
  })
589
587
  })
590
588
  })
@@ -687,7 +685,7 @@ var MaterialAssignmentAdminContent = forwardRef(function (_ref, ref) {
687
685
  }
688
686
  return jsxs(Modal, {
689
687
  title: intl.formatMessage({
690
- id: Boolean(myGrade) ? 'materialAssignment.edit-grading' : 'materialAssignment.grading-assignments'
688
+ id: myGrade ? 'materialAssignment.edit-grading' : 'materialAssignment.grading-assignments'
691
689
  }),
692
690
  footerButtons: [{
693
691
  label: intl.formatMessage({
@@ -997,9 +995,9 @@ var MaterialAssignmentAdminContent = forwardRef(function (_ref, ref) {
997
995
  min: 0,
998
996
  max: 100
999
997
  },
1000
- render: function render(_ref10) {
1001
- var field = _ref10.field,
1002
- fieldState = _ref10.fieldState;
998
+ render: function render(_ref0) {
999
+ var field = _ref0.field,
1000
+ fieldState = _ref0.fieldState;
1003
1001
  return jsx(Input, Object.assign({}, field, {
1004
1002
  invalid: fieldState.invalid,
1005
1003
  size: "small",
@@ -1,4 +1,4 @@
1
- import { slicedToArray as _slicedToArray, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
+ import { slicedToArray as _slicedToArray, asyncToGenerator as _asyncToGenerator, regenerator as _regenerator } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
3
  import React from 'react';
4
4
  import { useForm, Controller } from 'react-hook-form';
@@ -45,22 +45,22 @@ var MaterialAssignmentAdminContentTa = function MaterialAssignmentAdminContentTa
45
45
  userSubmission = _React$useState8[0],
46
46
  setUserSubmission = _React$useState8[1];
47
47
  var _React$useState9 = React.useState(null),
48
- _React$useState10 = _slicedToArray(_React$useState9, 2),
49
- gradeResult = _React$useState10[0],
50
- setGradeResult = _React$useState10[1];
51
- var _React$useState11 = React.useState(null),
52
- _React$useState12 = _slicedToArray(_React$useState11, 2),
53
- myGrade = _React$useState12[0],
54
- setMyGrade = _React$useState12[1];
48
+ _React$useState0 = _slicedToArray(_React$useState9, 2),
49
+ gradeResult = _React$useState0[0],
50
+ setGradeResult = _React$useState0[1];
51
+ var _React$useState1 = React.useState(null),
52
+ _React$useState10 = _slicedToArray(_React$useState1, 2),
53
+ myGrade = _React$useState10[0],
54
+ setMyGrade = _React$useState10[1];
55
55
  var isAssignmentClosed = dayjs().isAfter(dayjs(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.closeDatetime));
56
56
  var isScoreFinalized = Boolean(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.scoreFinalizedDatetime);
57
57
  var isUserSubmitted = Boolean(userSubmission);
58
58
  // API Status
59
59
  var isReady = useMaterialConfigApiClientUpdate(config.init);
60
- var _React$useState13 = React.useState('idle'),
61
- _React$useState14 = _slicedToArray(_React$useState13, 2),
62
- submissionListGetStatus = _React$useState14[0],
63
- setSubmissionListGetStatus = _React$useState14[1];
60
+ var _React$useState11 = React.useState('idle'),
61
+ _React$useState12 = _slicedToArray(_React$useState11, 2),
62
+ submissionListGetStatus = _React$useState12[0],
63
+ setSubmissionListGetStatus = _React$useState12[1];
64
64
  var fetchUserGet = React.useCallback(function () {
65
65
  void getOrgUserGet({
66
66
  userId: userId
@@ -90,7 +90,7 @@ var MaterialAssignmentAdminContentTa = function MaterialAssignmentAdminContentTa
90
90
  }).then(function (submission) {
91
91
  setUserSubmission(submission !== null && submission !== void 0 ? submission : null);
92
92
  setSubmissionListGetStatus('resolved');
93
- }).catch(function (err) {
93
+ })["catch"](function (err) {
94
94
  console.error(err);
95
95
  setSubmissionListGetStatus('rejected');
96
96
  });
@@ -101,7 +101,7 @@ var MaterialAssignmentAdminContentTa = function MaterialAssignmentAdminContentTa
101
101
  userId: userId
102
102
  }).then(function (res) {
103
103
  return res.materialAssignmentGradeResult;
104
- }).then(setGradeResult).catch(function () {
104
+ }).then(setGradeResult)["catch"](function () {
105
105
  setGradeResult(null);
106
106
  });
107
107
  }, [materialAssignmentId, userId]);
@@ -128,15 +128,15 @@ var MaterialAssignmentAdminContentTa = function MaterialAssignmentAdminContentTa
128
128
  comment: (_b = myGrade === null || myGrade === void 0 ? void 0 : myGrade.comment) !== null && _b !== void 0 ? _b : ''
129
129
  });
130
130
  };
131
- var handleGradeEditSubmit = gradeEditFormMethods.handleSubmit( /*#__PURE__*/function () {
132
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
133
- var score, comment;
134
- return _regeneratorRuntime().wrap(function _callee$(_context) {
135
- while (1) switch (_context.prev = _context.next) {
131
+ var handleGradeEditSubmit = gradeEditFormMethods.handleSubmit(/*#__PURE__*/function () {
132
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref2) {
133
+ var score, comment, _t;
134
+ return _regenerator().w(function (_context) {
135
+ while (1) switch (_context.p = _context.n) {
136
136
  case 0:
137
137
  score = _ref2.score, comment = _ref2.comment;
138
- _context.prev = 1;
139
- _context.next = 4;
138
+ _context.p = 1;
139
+ _context.n = 2;
140
140
  return postOrgMaterialAssignmentGradeEdit({
141
141
  materialAssignmentGradeId: myGrade === null || myGrade === void 0 ? void 0 : myGrade.id,
142
142
  materialAssignmentId: materialAssignmentId,
@@ -144,29 +144,28 @@ var MaterialAssignmentAdminContentTa = function MaterialAssignmentAdminContentTa
144
144
  score: score,
145
145
  comment: comment
146
146
  });
147
- case 4:
147
+ case 2:
148
148
  fetchMyGrade();
149
149
  Notification.success(intl.formatMessage({
150
150
  id: 'materialAssignment.notify.success'
151
151
  }));
152
- _context.next = 12;
152
+ _context.n = 4;
153
153
  break;
154
- case 8:
155
- _context.prev = 8;
156
- _context.t0 = _context["catch"](1);
157
- console.error(_context.t0);
154
+ case 3:
155
+ _context.p = 3;
156
+ _t = _context.v;
157
+ console.error(_t);
158
158
  Notification.error(intl.formatMessage({
159
159
  id: 'materialAssignment.notify.error'
160
160
  }));
161
- case 12:
162
- _context.prev = 12;
161
+ case 4:
162
+ _context.p = 4;
163
163
  setShowGradeEditModal(false);
164
- return _context.finish(12);
165
- case 15:
166
- case "end":
167
- return _context.stop();
164
+ return _context.f(4);
165
+ case 5:
166
+ return _context.a(2);
168
167
  }
169
- }, _callee, null, [[1, 8, 12, 15]]);
168
+ }, _callee, null, [[1, 3, 4, 5]]);
170
169
  }));
171
170
  return function (_x) {
172
171
  return _ref3.apply(this, arguments);
@@ -406,7 +405,7 @@ var MaterialAssignmentAdminContentTa = function MaterialAssignmentAdminContentTa
406
405
  disabled: isGradeEditDisabled,
407
406
  onClick: handleGradeEditClick,
408
407
  children: intl.formatMessage({
409
- id: Boolean(myGrade) ? 'materialAssignment.edit-grading' : 'materialAssignment.start-grading'
408
+ id: myGrade ? 'materialAssignment.edit-grading' : 'materialAssignment.start-grading'
410
409
  })
411
410
  })
412
411
  })
@@ -468,7 +467,7 @@ var MaterialAssignmentAdminContentTa = function MaterialAssignmentAdminContentTa
468
467
  }
469
468
  return jsxs(Modal, {
470
469
  title: intl.formatMessage({
471
- id: Boolean(myGrade) ? 'materialAssignment.edit-grading' : 'materialAssignment.grading-assignments'
470
+ id: myGrade ? 'materialAssignment.edit-grading' : 'materialAssignment.grading-assignments'
472
471
  }),
473
472
  footerButtons: [{
474
473
  label: intl.formatMessage({
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import type React from 'react';
2
2
  interface MaterialAssignmentContainerProps {
3
3
  title: string;
4
4
  }
@@ -1,17 +1,25 @@
1
+ import _styled from '@emotion/styled/base';
1
2
  import { jsxs, jsx } from 'react/jsx-runtime';
2
3
  import { Text } from '@elice/blocks';
3
4
  import { base } from '@elice/design-tokens';
4
- import styled from 'styled-components';
5
5
 
6
- var StyledMaterialAssignmentContainer = styled.div.withConfig({
7
- componentId: "sc-sdhlog-0"
8
- })(["height:100%;width:100%;max-width:55rem;border-radius:0.5rem;overflow:hidden;"]);
9
- var StyledMaterialAssignmentContainerHeader = styled.div.withConfig({
10
- componentId: "sc-sdhlog-1"
11
- })(["padding:1rem 1.5rem;height:3.5rem;display:flex;align-items:center;background-color:", ";"], base.color.navy7);
12
- var StyledMaterialAssignmentContainerContent = styled.div.withConfig({
13
- componentId: "sc-sdhlog-2"
14
- })(["padding:1.5rem;overflow-y:auto;height:calc(100% - 3.5rem);background-color:", ";"], base.color.navy8);
6
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
7
+ var StyledMaterialAssignmentContainer = /*#__PURE__*/_styled("div", {
8
+ target: "e1s3ee2y2"
9
+ })("production" === "production" ? {
10
+ name: "z4e4jo",
11
+ styles: "height:100%;width:100%;max-width:55rem;border-radius:0.5rem;overflow:hidden"
12
+ } : {
13
+ name: "z4e4jo",
14
+ styles: "height:100%;width:100%;max-width:55rem;border-radius:0.5rem;overflow:hidden",
15
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
16
+ });
17
+ var StyledMaterialAssignmentContainerHeader = /*#__PURE__*/_styled("div", {
18
+ target: "e1s3ee2y1"
19
+ })("padding:1rem 1.5rem;height:3.5rem;display:flex;align-items:center;background-color:", base.color.navy7, ";");
20
+ var StyledMaterialAssignmentContainerContent = /*#__PURE__*/_styled("div", {
21
+ target: "e1s3ee2y0"
22
+ })("padding:1.5rem;overflow-y:auto;height:calc(100% - 3.5rem);background-color:", base.color.navy8, ";");
15
23
  var MaterialAssignmentContainer = function MaterialAssignmentContainer(_ref) {
16
24
  var title = _ref.title,
17
25
  children = _ref.children;
package/es/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { default as MaterialAssignmentAdmin } from './components/material-assignment-admin/MaterialAssignmentAdmin.js';
2
1
  export { default as MaterialAssignment } from './components/material-assignment/MaterialAssignment.js';
2
+ export { default as MaterialAssignmentAdmin } from './components/material-assignment-admin/MaterialAssignmentAdmin.js';
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Color "Green" palette for Elice Design System.
3
+ * (https://zeroheight.com/28e7b9d96/p/25a3d8-color/b/281ad3/t/7636cc)
4
+ *
5
+ * - `50`: `#e8f5e9`
6
+ * - `100`: `#c8e6c9`
7
+ * - `200`: `#a5d6a7`
8
+ * - `300`: `#81c784`
9
+ * - `400`: `#66bb6a`
10
+ * - `500`: `#4caf50`
11
+ * - `600`: `#43a047`
12
+ * - `700`: `#388e3c`
13
+ * - `800`: `#2e7d32`
14
+ * - `900`: `#1b5e20`
15
+ */
16
+ var green = Object.freeze({
17
+ 50: '#e8f5e9',
18
+ 100: '#c8e6c9',
19
+ 200: '#a5d6a7',
20
+ 300: '#81c784',
21
+ 400: '#66bb6a',
22
+ 500: '#4caf50',
23
+ 600: '#43a047',
24
+ 700: '#388e3c',
25
+ 800: '#2e7d32',
26
+ 900: '#1b5e20'
27
+ });
28
+
29
+ export { green };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Color "Orange" palette for Elice Design System.
3
+ * (https://zeroheight.com/28e7b9d96/p/25a3d8-color/b/281ad3/t/05a83c)
4
+ *
5
+ * - `50`: `#fff3e0`
6
+ * - `100`: `#ffe0b2`
7
+ * - `200`: `#ffcc80`
8
+ * - `300`: `#ffb74d`
9
+ * - `400`: `#ffa726`
10
+ * - `500`: `#ff9800`
11
+ * - `600`: `#fb8c00`
12
+ * - `700`: `#f57c00`
13
+ * - `800`: `#ef6c00`
14
+ * - `900`: `#e65100`
15
+ */
16
+ var orange = Object.freeze({
17
+ 50: '#fff3e0',
18
+ 100: '#ffe0b2',
19
+ 200: '#ffcc80',
20
+ 300: '#ffb74d',
21
+ 400: '#ffa726',
22
+ 500: '#ff9800',
23
+ 600: '#fb8c00',
24
+ 700: '#f57c00',
25
+ 800: '#ef6c00',
26
+ 900: '#e65100'
27
+ });
28
+
29
+ export { orange };
@@ -0,0 +1,16 @@
1
+ /**
2
+ *
3
+ * Returns result whether url is valid or not
4
+ * api-regex: https://git.elicer.io/elice/backend/elice-api/-/blob/master/api/func/validator.py#L228
5
+ * @param {string} url
6
+ * @returns {boolean}
7
+ */
8
+ function validateUrl(url) {
9
+ if (typeof url !== 'string') {
10
+ return false;
11
+ }
12
+ const urlRegex = new RegExp(/^(?:https?):\/\/(?:[^\s:@/]+(?::[^\s:@/]*)?@)?(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-_]{0,61}[a-zA-Z0-9])?\.)+(?:[a-zA-Z]{2,6}\.?|[a-zA-Z0-9\-_]{2,}\.?)|localhost|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?::\d{2,5})?(?:\/?|[/?]\S+)$/);
13
+ return urlRegex.test(url);
14
+ }
15
+
16
+ export { validateUrl };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-assignment",
3
- "version": "1.251120.1",
3
+ "version": "1.260128.0-rc.0",
4
4
  "description": "User view and editing components of Elice material assignment",
5
5
  "repository": "https://git.elicer.io/elice/frontend/library/elice-material",
6
6
  "license": "UNLICENSED",
@@ -29,12 +29,13 @@
29
29
  "@elice/icons": "^1",
30
30
  "@elice/intl": "^0",
31
31
  "@elice/markdown": "^1",
32
- "@elice/material-shared-types": "*",
33
- "@elice/material-shared-utils": "*",
32
+ "@elice/material-shared-types": "1.260128.0-rc.0",
33
+ "@elice/material-shared-utils": "1.260128.0-rc.0",
34
34
  "@elice/types": "^1",
35
+ "@emotion/react": "^11.10.0",
36
+ "@emotion/styled": "^11.10.0",
35
37
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
36
- "react-use": "^17.0.0",
37
- "styled-components": "^5.2.0"
38
+ "react-use": "^17.0.0"
38
39
  },
39
40
  "dependencies": {
40
41
  "classnames": "^2.2.0",
@@ -50,14 +51,14 @@
50
51
  "@elice/icons-legacy": "npm:@elice/icons@0.230814.0",
51
52
  "@elice/intl": "0.241127.0",
52
53
  "@elice/markdown": "1.241015.0",
53
- "@elice/material-shared-types": "1.251120.1",
54
- "@elice/material-shared-utils": "1.251120.1",
55
- "@elice/types": "^1.250612.0-teamleaderboard.1",
54
+ "@elice/material-shared-types": "1.260128.0-rc.0",
55
+ "@elice/material-shared-utils": "1.260128.0-rc.0",
56
+ "@elice/types": "^1.251229.0",
57
+ "@emotion/react": "^11.10.0",
58
+ "@emotion/styled": "^11.10.0",
56
59
  "@types/classnames": "^2.3.1",
57
60
  "@types/react": "~17.0.9",
58
- "@types/styled-components": "^5.1.21",
59
61
  "react": "^17.0.2",
60
- "react-use": "^17.2.4",
61
- "styled-components": "^5.3.0"
62
+ "react-use": "^17.2.4"
62
63
  }
63
64
  }