mario-education 2.2.8 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MarioFramework.Education/ClientApp/src/containers/CSVImport/hooks/useCSVImport.d.ts +8 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/Dashboard/configs/types.d.ts +3 -0
- package/dist/MarioFramework.Education/ClientApp/src/services/csvService.d.ts +2 -0
- package/dist/index.js +270 -203
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +270 -203
- package/dist/index.modern.js.map +1 -1
- package/package.json +91 -91
package/dist/index.modern.js
CHANGED
|
@@ -150,9 +150,6 @@ var StudentSelector = function StudentSelector(_ref) {
|
|
|
150
150
|
id: student.id
|
|
151
151
|
};
|
|
152
152
|
});
|
|
153
|
-
console.log("teacher assignment");
|
|
154
|
-
console.log(options);
|
|
155
|
-
console.log(value);
|
|
156
153
|
return React.createElement(CustomSelector, {
|
|
157
154
|
options: options,
|
|
158
155
|
inputValue: searchString,
|
|
@@ -5175,7 +5172,6 @@ var LearningSupportCategoryList = function LearningSupportCategoryList() {
|
|
|
5175
5172
|
|
|
5176
5173
|
var style = {
|
|
5177
5174
|
padding: "4px 8px",
|
|
5178
|
-
marginRight: 16,
|
|
5179
5175
|
marginBottom: 0,
|
|
5180
5176
|
borderRadius: "2px",
|
|
5181
5177
|
color: "#fff",
|
|
@@ -5209,8 +5205,12 @@ var UploadCSVButton = function UploadCSVButton(_ref) {
|
|
|
5209
5205
|
};
|
|
5210
5206
|
|
|
5211
5207
|
var CSV_FILE_URL = BASE_URL + "/api/ImportCsv/csv";
|
|
5212
|
-
var
|
|
5213
|
-
|
|
5208
|
+
var CSV_FILE_TEACHER = BASE_URL + "/api/Teacher";
|
|
5209
|
+
var importStudentCSV = function importStudentCSV(formData) {
|
|
5210
|
+
return apiUpload.post(CSV_FILE_TEACHER + "/adminImportStudent", formData);
|
|
5211
|
+
};
|
|
5212
|
+
var importClassReflectionCSV = function importClassReflectionCSV(formData) {
|
|
5213
|
+
return apiUpload.post(CSV_FILE_URL + "/importClassReflection", formData);
|
|
5214
5214
|
};
|
|
5215
5215
|
|
|
5216
5216
|
var CSVType;
|
|
@@ -5225,28 +5225,18 @@ var CSVType;
|
|
|
5225
5225
|
})(CSVType || (CSVType = {}));
|
|
5226
5226
|
|
|
5227
5227
|
var buttons = [{
|
|
5228
|
-
text: "Import
|
|
5229
|
-
backgroundColor: "#
|
|
5230
|
-
type: CSVType.
|
|
5231
|
-
}, {
|
|
5232
|
-
text: "Import grades",
|
|
5233
|
-
backgroundColor: "#54a0ff",
|
|
5234
|
-
type: CSVType.Grades
|
|
5235
|
-
}, {
|
|
5236
|
-
text: "Import attendances",
|
|
5237
|
-
backgroundColor: "#feca57",
|
|
5238
|
-
type: CSVType.Attendances
|
|
5239
|
-
}, {
|
|
5240
|
-
text: "Import class reflections",
|
|
5241
|
-
backgroundColor: "#e74c3c",
|
|
5242
|
-
type: CSVType.ClassReflection
|
|
5243
|
-
}, {
|
|
5244
|
-
text: "Import others",
|
|
5245
|
-
backgroundColor: "#8395a7",
|
|
5246
|
-
type: CSVType.Others
|
|
5228
|
+
text: "Import students",
|
|
5229
|
+
backgroundColor: "#0abde3",
|
|
5230
|
+
type: CSVType.Students
|
|
5247
5231
|
}];
|
|
5248
5232
|
var title = "CSV Import";
|
|
5249
5233
|
var id = "csvupload";
|
|
5234
|
+
var initClassReflect = {
|
|
5235
|
+
teacherName: '',
|
|
5236
|
+
teacherEmail: '',
|
|
5237
|
+
studentIds: [],
|
|
5238
|
+
file: ''
|
|
5239
|
+
};
|
|
5250
5240
|
|
|
5251
5241
|
var useCSVImport = function useCSVImport() {
|
|
5252
5242
|
var dispatch = useDispatch();
|
|
@@ -5258,6 +5248,18 @@ var useCSVImport = function useCSVImport() {
|
|
|
5258
5248
|
type = _useState[0],
|
|
5259
5249
|
setType = _useState[1];
|
|
5260
5250
|
|
|
5251
|
+
var _useState2 = useState(),
|
|
5252
|
+
dataFile = _useState2[0],
|
|
5253
|
+
setDataFile = _useState2[1];
|
|
5254
|
+
|
|
5255
|
+
var _useState3 = useState([]),
|
|
5256
|
+
arrStudent = _useState3[0],
|
|
5257
|
+
setArrStudent = _useState3[1];
|
|
5258
|
+
|
|
5259
|
+
var _useState4 = useState(initClassReflect),
|
|
5260
|
+
initImportReflection = _useState4[0],
|
|
5261
|
+
setInitImportReflection = _useState4[1];
|
|
5262
|
+
|
|
5261
5263
|
useEffect(function () {
|
|
5262
5264
|
document.title = title;
|
|
5263
5265
|
}, []);
|
|
@@ -5265,7 +5267,7 @@ var useCSVImport = function useCSVImport() {
|
|
|
5265
5267
|
try {
|
|
5266
5268
|
var _temp3 = function _temp3() {
|
|
5267
5269
|
dispatch(setLoading(false));
|
|
5268
|
-
var input = document.getElementById(
|
|
5270
|
+
var input = document.getElementById('import-student');
|
|
5269
5271
|
input && (input.value = "");
|
|
5270
5272
|
};
|
|
5271
5273
|
|
|
@@ -5275,7 +5277,7 @@ var useCSVImport = function useCSVImport() {
|
|
|
5275
5277
|
var _temp4 = _catch(function () {
|
|
5276
5278
|
var formData = new FormData();
|
|
5277
5279
|
formData.append("file", file, file.name);
|
|
5278
|
-
return Promise.resolve(
|
|
5280
|
+
return Promise.resolve(importStudentCSV(formData)).then(function () {
|
|
5279
5281
|
dispatch(setAlert({
|
|
5280
5282
|
type: "success",
|
|
5281
5283
|
message: "Import CSV successfully"
|
|
@@ -5295,21 +5297,87 @@ var useCSVImport = function useCSVImport() {
|
|
|
5295
5297
|
return Promise.reject(e);
|
|
5296
5298
|
}
|
|
5297
5299
|
}, [type]);
|
|
5300
|
+
|
|
5301
|
+
var onConfirm = function onConfirm(values) {
|
|
5302
|
+
try {
|
|
5303
|
+
var _temp7 = function _temp7() {
|
|
5304
|
+
dispatch(setLoading(false));
|
|
5305
|
+
var input = document.getElementById(id);
|
|
5306
|
+
input && (input.value = "");
|
|
5307
|
+
};
|
|
5308
|
+
|
|
5309
|
+
if (!dataFile || !dataFile) return Promise.resolve();
|
|
5310
|
+
dispatch(setLoading(true));
|
|
5311
|
+
|
|
5312
|
+
var _temp8 = _catch(function () {
|
|
5313
|
+
var formData = new FormData();
|
|
5314
|
+
formData.append("file", dataFile, dataFile.name);
|
|
5315
|
+
formData.append("teacherName", values.teacherName);
|
|
5316
|
+
formData.append("teacherEmail", values.teacherEmail);
|
|
5317
|
+
values.studentIds.forEach(function (item) {
|
|
5318
|
+
formData.append("studentIds", item);
|
|
5319
|
+
});
|
|
5320
|
+
return Promise.resolve(importClassReflectionCSV(formData)).then(function () {
|
|
5321
|
+
dispatch(setAlert({
|
|
5322
|
+
type: "success",
|
|
5323
|
+
message: "Import CSV successfully"
|
|
5324
|
+
}));
|
|
5325
|
+
setInitImportReflection(initClassReflect);
|
|
5326
|
+
});
|
|
5327
|
+
}, function (err) {
|
|
5328
|
+
var _err$response2, _err$response2$data;
|
|
5329
|
+
|
|
5330
|
+
dispatch(setAlert({
|
|
5331
|
+
type: "danger",
|
|
5332
|
+
message: ((_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : (_err$response2$data = _err$response2.data) === null || _err$response2$data === void 0 ? void 0 : _err$response2$data.title) || err.message
|
|
5333
|
+
}));
|
|
5334
|
+
});
|
|
5335
|
+
|
|
5336
|
+
return Promise.resolve(_temp8 && _temp8.then ? _temp8.then(_temp7) : _temp7(_temp8));
|
|
5337
|
+
} catch (e) {
|
|
5338
|
+
return Promise.reject(e);
|
|
5339
|
+
}
|
|
5340
|
+
};
|
|
5341
|
+
|
|
5298
5342
|
return {
|
|
5299
5343
|
isLoading: isLoading,
|
|
5300
5344
|
buttons: buttons,
|
|
5301
5345
|
id: id,
|
|
5302
5346
|
setType: setType,
|
|
5303
|
-
upload: upload
|
|
5347
|
+
upload: upload,
|
|
5348
|
+
initImportReflection: initImportReflection,
|
|
5349
|
+
setInitImportReflection: setInitImportReflection,
|
|
5350
|
+
onConfirm: onConfirm,
|
|
5351
|
+
CSVType: CSVType,
|
|
5352
|
+
dataFile: dataFile,
|
|
5353
|
+
setDataFile: setDataFile,
|
|
5354
|
+
setArrStudent: setArrStudent,
|
|
5355
|
+
arrStudent: arrStudent
|
|
5304
5356
|
};
|
|
5305
5357
|
};
|
|
5306
5358
|
|
|
5359
|
+
var schema$4 = object({
|
|
5360
|
+
teacherName: string().required(),
|
|
5361
|
+
teacherEmail: string().email('Invalid email').required(),
|
|
5362
|
+
studentIds: array().required().test("test students", "Please choose student", function () {
|
|
5363
|
+
return !!this.parent.studentIds && !!this.parent.studentIds.length;
|
|
5364
|
+
}),
|
|
5365
|
+
file: string().required()
|
|
5366
|
+
});
|
|
5367
|
+
|
|
5307
5368
|
var CSVImport = function CSVImport() {
|
|
5308
5369
|
var _useCSVImport = useCSVImport(),
|
|
5370
|
+
initImportReflection = _useCSVImport.initImportReflection,
|
|
5371
|
+
onConfirm = _useCSVImport.onConfirm,
|
|
5309
5372
|
isLoading = _useCSVImport.isLoading,
|
|
5310
|
-
buttons = _useCSVImport.buttons,
|
|
5311
|
-
id = _useCSVImport.id,
|
|
5312
5373
|
setType = _useCSVImport.setType,
|
|
5374
|
+
id = _useCSVImport.id,
|
|
5375
|
+
CSVType = _useCSVImport.CSVType,
|
|
5376
|
+
dataFile = _useCSVImport.dataFile,
|
|
5377
|
+
setDataFile = _useCSVImport.setDataFile,
|
|
5378
|
+
setArrStudent = _useCSVImport.setArrStudent,
|
|
5379
|
+
arrStudent = _useCSVImport.arrStudent,
|
|
5380
|
+
buttons = _useCSVImport.buttons,
|
|
5313
5381
|
upload = _useCSVImport.upload;
|
|
5314
5382
|
|
|
5315
5383
|
return React.createElement("div", {
|
|
@@ -5317,28 +5385,146 @@ var CSVImport = function CSVImport() {
|
|
|
5317
5385
|
}, React.createElement(Input, {
|
|
5318
5386
|
className: "d-none",
|
|
5319
5387
|
type: "file",
|
|
5320
|
-
id:
|
|
5388
|
+
id: "import-student",
|
|
5321
5389
|
onChange: function onChange(e) {
|
|
5322
5390
|
return upload(e.target.files[0]);
|
|
5323
5391
|
},
|
|
5324
5392
|
accept: "text/csv"
|
|
5325
5393
|
}), React.createElement("div", {
|
|
5326
|
-
className: "
|
|
5327
|
-
},
|
|
5328
|
-
|
|
5329
|
-
|
|
5394
|
+
className: "class-reflection"
|
|
5395
|
+
}, React.createElement(Formik, {
|
|
5396
|
+
initialValues: initImportReflection,
|
|
5397
|
+
enableReinitialize: true,
|
|
5398
|
+
validationSchema: schema$4,
|
|
5399
|
+
onSubmit: function onSubmit(values, actions) {
|
|
5400
|
+
onConfirm(values);
|
|
5401
|
+
setDataFile('');
|
|
5402
|
+
setArrStudent([]);
|
|
5403
|
+
actions.resetForm();
|
|
5404
|
+
}
|
|
5405
|
+
}, function (formProps) {
|
|
5406
|
+
var values = formProps.values,
|
|
5407
|
+
touched = formProps.touched,
|
|
5408
|
+
errors = formProps.errors,
|
|
5409
|
+
handleSubmit = formProps.handleSubmit,
|
|
5410
|
+
handleChange = formProps.handleChange;
|
|
5411
|
+
return React.createElement(Row, {
|
|
5412
|
+
className: "mb-2"
|
|
5413
|
+
}, React.createElement(Input, {
|
|
5414
|
+
className: "d-none",
|
|
5415
|
+
type: "file",
|
|
5416
|
+
id: id,
|
|
5417
|
+
onChange: function onChange(e) {
|
|
5418
|
+
setDataFile(e.target.files[0]);
|
|
5419
|
+
formProps.setFieldValue('file', 'imported');
|
|
5420
|
+
var input = document.getElementById(id);
|
|
5421
|
+
input && (input.value = "");
|
|
5422
|
+
},
|
|
5423
|
+
accept: "text/csv"
|
|
5424
|
+
}), React.createElement(Col, {
|
|
5425
|
+
md: 6,
|
|
5426
|
+
className: "mb-2"
|
|
5427
|
+
}, React.createElement(Row, null, React.createElement(Col, {
|
|
5428
|
+
md: 12,
|
|
5429
|
+
className: "mb-2"
|
|
5430
|
+
}, React.createElement(RequiredLabel, {
|
|
5431
|
+
text: "Class Teacher Name"
|
|
5432
|
+
}), React.createElement(Input, {
|
|
5433
|
+
name: "teacherName",
|
|
5434
|
+
value: values.teacherName,
|
|
5435
|
+
type: "text",
|
|
5436
|
+
onChange: function onChange(e) {
|
|
5437
|
+
handleChange(e);
|
|
5438
|
+
}
|
|
5439
|
+
}), touched.teacherName && errors.teacherName && React.createElement(ErrorHandler, {
|
|
5440
|
+
text: errors.teacherName
|
|
5441
|
+
})), React.createElement(Col, {
|
|
5442
|
+
md: 12,
|
|
5443
|
+
className: "mb-2"
|
|
5444
|
+
}, React.createElement(RequiredLabel, {
|
|
5445
|
+
text: "Class Teacher Email"
|
|
5446
|
+
}), React.createElement(Input, {
|
|
5447
|
+
name: "teacherEmail",
|
|
5448
|
+
value: values.teacherEmail,
|
|
5449
|
+
type: "text",
|
|
5450
|
+
onChange: function onChange(e) {
|
|
5451
|
+
handleChange(e);
|
|
5452
|
+
}
|
|
5453
|
+
}), touched.teacherEmail && errors.teacherEmail && React.createElement(ErrorHandler, {
|
|
5454
|
+
text: errors.teacherEmail
|
|
5455
|
+
})), React.createElement(Col, {
|
|
5456
|
+
md: 12,
|
|
5457
|
+
className: "mb-2"
|
|
5458
|
+
}, React.createElement(Label, null, "Students"), React.createElement(StudentSelector, {
|
|
5459
|
+
onChange: function onChange(e) {
|
|
5460
|
+
setArrStudent(e);
|
|
5461
|
+
formProps.setFieldValue("studentIds", e.map(function (i) {
|
|
5462
|
+
return i.value;
|
|
5463
|
+
}) || []);
|
|
5464
|
+
},
|
|
5465
|
+
value: arrStudent
|
|
5466
|
+
})), React.createElement(Col, {
|
|
5467
|
+
md: 12,
|
|
5468
|
+
className: "mb-2"
|
|
5469
|
+
}, touched.studentIds && errors.studentIds && React.createElement(ErrorHandler, {
|
|
5470
|
+
text: errors.studentIds
|
|
5471
|
+
})), React.createElement(Col, {
|
|
5472
|
+
md: 12,
|
|
5473
|
+
className: "mb-2"
|
|
5474
|
+
}, React.createElement(RequiredLabel, {
|
|
5475
|
+
text: "Upload File Class Reflection"
|
|
5476
|
+
}), React.createElement(UploadCSVButton, {
|
|
5477
|
+
key: "Import class reflections",
|
|
5330
5478
|
htmlFor: id,
|
|
5331
|
-
text:
|
|
5479
|
+
text: "Import class reflections",
|
|
5332
5480
|
isDisabled: isLoading,
|
|
5333
|
-
backgroundColor:
|
|
5481
|
+
backgroundColor: "#e74c3c",
|
|
5334
5482
|
onClick: function onClick() {
|
|
5335
|
-
|
|
5483
|
+
setType(CSVType.ClassReflection);
|
|
5336
5484
|
}
|
|
5337
|
-
})
|
|
5485
|
+
}), !!dataFile && React.createElement("p", {
|
|
5486
|
+
style: {
|
|
5487
|
+
color: '#007bff',
|
|
5488
|
+
fontStyle: 'italic',
|
|
5489
|
+
marginTop: '5px'
|
|
5490
|
+
}
|
|
5491
|
+
}, dataFile.name)), !dataFile && React.createElement(Col, {
|
|
5492
|
+
md: 12,
|
|
5493
|
+
className: "mb-2"
|
|
5494
|
+
}, touched.file && errors.file && React.createElement(ErrorHandler, {
|
|
5495
|
+
text: errors.file
|
|
5496
|
+
})), React.createElement(Col, {
|
|
5497
|
+
md: 12
|
|
5498
|
+
}, React.createElement(Button, {
|
|
5499
|
+
color: "primary",
|
|
5500
|
+
className: "float-right",
|
|
5501
|
+
onClick: function onClick() {
|
|
5502
|
+
return handleSubmit();
|
|
5503
|
+
}
|
|
5504
|
+
}, "Import"), ' '))), React.createElement(Col, {
|
|
5505
|
+
md: 6,
|
|
5506
|
+
className: "mb-2"
|
|
5507
|
+
}, React.createElement(Row, null, React.createElement(Col, {
|
|
5508
|
+
md: 12,
|
|
5509
|
+
className: "mb-2"
|
|
5510
|
+
}, React.createElement(RequiredLabel, {
|
|
5511
|
+
text: "Import student"
|
|
5512
|
+
}), buttons.map(function (button) {
|
|
5513
|
+
return React.createElement(UploadCSVButton, {
|
|
5514
|
+
key: button.text,
|
|
5515
|
+
htmlFor: 'import-student',
|
|
5516
|
+
text: button.text,
|
|
5517
|
+
isDisabled: isLoading,
|
|
5518
|
+
backgroundColor: button.backgroundColor,
|
|
5519
|
+
onClick: function onClick() {
|
|
5520
|
+
return setType(button.type);
|
|
5521
|
+
}
|
|
5522
|
+
});
|
|
5523
|
+
})))));
|
|
5338
5524
|
})));
|
|
5339
5525
|
};
|
|
5340
5526
|
|
|
5341
|
-
var schema$
|
|
5527
|
+
var schema$5 = object({
|
|
5342
5528
|
name: string().required("Name is required"),
|
|
5343
5529
|
startTime: string().required("Start time is required"),
|
|
5344
5530
|
endTime: string().required("End time is required")
|
|
@@ -5357,7 +5543,7 @@ var SemesterDetailModal = function SemesterDetailModal(props, ref) {
|
|
|
5357
5543
|
return React.createElement(Formik, {
|
|
5358
5544
|
initialValues: semesterDetail,
|
|
5359
5545
|
enableReinitialize: true,
|
|
5360
|
-
validationSchema: schema$
|
|
5546
|
+
validationSchema: schema$5,
|
|
5361
5547
|
onSubmit: function onSubmit(values, actions) {
|
|
5362
5548
|
onConfirm(values);
|
|
5363
5549
|
actions.resetForm();
|
|
@@ -5410,7 +5596,7 @@ var SemesterDetailModal = function SemesterDetailModal(props, ref) {
|
|
|
5410
5596
|
})), React.createElement(Col, {
|
|
5411
5597
|
md: 6
|
|
5412
5598
|
}, React.createElement(DatePicker, {
|
|
5413
|
-
value: utcToLocalTime(values.startTime, "
|
|
5599
|
+
value: !!values.startTime ? utcToLocalTime(values.startTime, "Do MMMM YYYY") : "",
|
|
5414
5600
|
todayButton: "Today",
|
|
5415
5601
|
peekNextMonth: true,
|
|
5416
5602
|
showMonthDropdown: true,
|
|
@@ -5441,7 +5627,7 @@ var SemesterDetailModal = function SemesterDetailModal(props, ref) {
|
|
|
5441
5627
|
})), React.createElement(Col, {
|
|
5442
5628
|
md: 6
|
|
5443
5629
|
}, React.createElement(DatePicker, {
|
|
5444
|
-
value: utcToLocalTime(values.endTime, "
|
|
5630
|
+
value: !!values.endTime ? utcToLocalTime(values.endTime, "Do MMMM YYYY") : "",
|
|
5445
5631
|
todayButton: "Today",
|
|
5446
5632
|
peekNextMonth: true,
|
|
5447
5633
|
showMonthDropdown: true,
|
|
@@ -5468,7 +5654,7 @@ var SemesterDetailModal = function SemesterDetailModal(props, ref) {
|
|
|
5468
5654
|
|
|
5469
5655
|
var SemesterDetailModal$1 = forwardRef(SemesterDetailModal);
|
|
5470
5656
|
|
|
5471
|
-
var schema$
|
|
5657
|
+
var schema$6 = object({
|
|
5472
5658
|
value: number().required("Breaking month is required")
|
|
5473
5659
|
});
|
|
5474
5660
|
var options = [{
|
|
@@ -5521,7 +5707,7 @@ var BreakingMonthModal = function BreakingMonthModal(props, ref) {
|
|
|
5521
5707
|
return React.createElement(Formik, {
|
|
5522
5708
|
initialValues: breakingMonthDetail,
|
|
5523
5709
|
enableReinitialize: true,
|
|
5524
|
-
validationSchema: schema$
|
|
5710
|
+
validationSchema: schema$6,
|
|
5525
5711
|
onSubmit: function onSubmit(values, actions) {
|
|
5526
5712
|
onConfirm(values);
|
|
5527
5713
|
actions.resetForm();
|
|
@@ -6057,9 +6243,9 @@ var SemesterList = function SemesterList() {
|
|
|
6057
6243
|
}
|
|
6058
6244
|
})), React.createElement("td", {
|
|
6059
6245
|
className: "align-middle"
|
|
6060
|
-
}, utcToLocalTime(record.startTime, "
|
|
6246
|
+
}, utcToLocalTime(record.startTime, "Do MMMM YYYY")), React.createElement("td", {
|
|
6061
6247
|
className: "align-middle"
|
|
6062
|
-
}, utcToLocalTime(record.endTime, "
|
|
6248
|
+
}, utcToLocalTime(record.endTime, "Do MMMM YYYY")), React.createElement("td", {
|
|
6063
6249
|
className: "text-center align-middle"
|
|
6064
6250
|
}, React.createElement(DeleteButtonIcon, {
|
|
6065
6251
|
onClick: function onClick() {
|
|
@@ -6099,7 +6285,7 @@ var SemesterList = function SemesterList() {
|
|
|
6099
6285
|
}, "Change breaking month"))))));
|
|
6100
6286
|
};
|
|
6101
6287
|
|
|
6102
|
-
var schema$
|
|
6288
|
+
var schema$7 = object({
|
|
6103
6289
|
label: string().required("Label is required"),
|
|
6104
6290
|
value: number().required("Value is required")
|
|
6105
6291
|
});
|
|
@@ -6117,7 +6303,7 @@ var BandScoreDetailModal = function BandScoreDetailModal(props, ref) {
|
|
|
6117
6303
|
return React.createElement(Formik, {
|
|
6118
6304
|
initialValues: bandScoreDetail,
|
|
6119
6305
|
enableReinitialize: true,
|
|
6120
|
-
validationSchema: schema$
|
|
6306
|
+
validationSchema: schema$7,
|
|
6121
6307
|
onSubmit: function onSubmit(values, actions) {
|
|
6122
6308
|
onConfirm(values);
|
|
6123
6309
|
actions.resetForm();
|
|
@@ -6786,7 +6972,7 @@ var CurrentLicense = function CurrentLicense() {
|
|
|
6786
6972
|
}))));
|
|
6787
6973
|
};
|
|
6788
6974
|
|
|
6789
|
-
var schema$
|
|
6975
|
+
var schema$8 = object({
|
|
6790
6976
|
name: string().required("Name is required"),
|
|
6791
6977
|
startTime: string().required("Start time is required"),
|
|
6792
6978
|
endTime: string().required("End time is required")
|
|
@@ -6805,7 +6991,7 @@ var SchoolBlankDayDetailModal = function SchoolBlankDayDetailModal(props, ref) {
|
|
|
6805
6991
|
return React.createElement(Formik, {
|
|
6806
6992
|
initialValues: schoolBlankDayDetail,
|
|
6807
6993
|
enableReinitialize: true,
|
|
6808
|
-
validationSchema: schema$
|
|
6994
|
+
validationSchema: schema$8,
|
|
6809
6995
|
onSubmit: function onSubmit(values, actions) {
|
|
6810
6996
|
onConfirm(values);
|
|
6811
6997
|
actions.resetForm();
|
|
@@ -7241,9 +7427,9 @@ var SchoolBlankDayList = function SchoolBlankDayList() {
|
|
|
7241
7427
|
}
|
|
7242
7428
|
})), React.createElement("td", {
|
|
7243
7429
|
className: "align-middle"
|
|
7244
|
-
}, utcToLocalTime(record.startTime,
|
|
7430
|
+
}, utcToLocalTime(record.startTime, "Do MMMM YYYY")), React.createElement("td", {
|
|
7245
7431
|
className: "align-middle"
|
|
7246
|
-
}, utcToLocalTime(record.endTime,
|
|
7432
|
+
}, utcToLocalTime(record.endTime, "Do MMMM YYYY")), React.createElement("td", {
|
|
7247
7433
|
className: "text-center align-middle"
|
|
7248
7434
|
}, React.createElement(DeleteButtonIcon, {
|
|
7249
7435
|
onClick: function onClick() {
|
|
@@ -8335,7 +8521,7 @@ var QuestionSplitPaneSelector = function QuestionSplitPaneSelector(props) {
|
|
|
8335
8521
|
}, " ", "v", " ")) : "");
|
|
8336
8522
|
};
|
|
8337
8523
|
|
|
8338
|
-
var schema$
|
|
8524
|
+
var schema$9 = object({
|
|
8339
8525
|
name: string().required("Name is required")
|
|
8340
8526
|
});
|
|
8341
8527
|
|
|
@@ -8361,7 +8547,7 @@ var ReflectionDetailModal = function ReflectionDetailModal(props, ref) {
|
|
|
8361
8547
|
return React.createElement(Formik, {
|
|
8362
8548
|
initialValues: reflectionformDetail,
|
|
8363
8549
|
enableReinitialize: true,
|
|
8364
|
-
validationSchema: schema$
|
|
8550
|
+
validationSchema: schema$9,
|
|
8365
8551
|
onSubmit: function onSubmit(values, actions) {
|
|
8366
8552
|
values.questionIds = arrId;
|
|
8367
8553
|
onConfirm(values);
|
|
@@ -9742,7 +9928,7 @@ var AdditionalComponent = function AdditionalComponent(_ref) {
|
|
|
9742
9928
|
return null;
|
|
9743
9929
|
};
|
|
9744
9930
|
|
|
9745
|
-
var schema$
|
|
9931
|
+
var schema$a = object({
|
|
9746
9932
|
text: string().required("Question text is required"),
|
|
9747
9933
|
type: string().required("Question type is required"),
|
|
9748
9934
|
categoryId: number().test("test category id", "Category is required", function (value) {
|
|
@@ -9995,7 +10181,7 @@ var QuestionDetail = function QuestionDetail() {
|
|
|
9995
10181
|
return React.createElement(Formik, {
|
|
9996
10182
|
initialValues: questionDetail,
|
|
9997
10183
|
enableReinitialize: true,
|
|
9998
|
-
validationSchema: schema$
|
|
10184
|
+
validationSchema: schema$a,
|
|
9999
10185
|
onSubmit: function onSubmit(values) {
|
|
10000
10186
|
if (values.type == QUESTION_TYPES.EMOTIONAL && !!values.answers) {
|
|
10001
10187
|
for (var index in values.answers) {
|
|
@@ -10261,7 +10447,7 @@ var QuestionSplitPaneSelector$1 = function QuestionSplitPaneSelector(props) {
|
|
|
10261
10447
|
}, " ", "v", " ")) : "");
|
|
10262
10448
|
};
|
|
10263
10449
|
|
|
10264
|
-
var schema$
|
|
10450
|
+
var schema$b = object({
|
|
10265
10451
|
name: string().required("Name is required")
|
|
10266
10452
|
});
|
|
10267
10453
|
|
|
@@ -10287,7 +10473,7 @@ var AssessmentDetailModal = function AssessmentDetailModal(props, ref) {
|
|
|
10287
10473
|
return React.createElement(Formik, {
|
|
10288
10474
|
initialValues: assessmentDetail,
|
|
10289
10475
|
enableReinitialize: true,
|
|
10290
|
-
validationSchema: schema$
|
|
10476
|
+
validationSchema: schema$b,
|
|
10291
10477
|
onSubmit: function onSubmit(values, actions) {
|
|
10292
10478
|
values.questionIds = arrId;
|
|
10293
10479
|
onConfirm(values);
|
|
@@ -11229,7 +11415,7 @@ var FeedbackList = function FeedbackList() {
|
|
|
11229
11415
|
}))));
|
|
11230
11416
|
};
|
|
11231
11417
|
|
|
11232
|
-
var schema$
|
|
11418
|
+
var schema$c = object({
|
|
11233
11419
|
name: string().required("Name is required")
|
|
11234
11420
|
});
|
|
11235
11421
|
|
|
@@ -11249,7 +11435,7 @@ var TutorialScreenDetailModal = function TutorialScreenDetailModal(props, ref) {
|
|
|
11249
11435
|
typeRole: typeRole
|
|
11250
11436
|
}),
|
|
11251
11437
|
enableReinitialize: true,
|
|
11252
|
-
validationSchema: schema$
|
|
11438
|
+
validationSchema: schema$c,
|
|
11253
11439
|
onSubmit: function onSubmit(values, actions) {
|
|
11254
11440
|
onConfirm(values);
|
|
11255
11441
|
actions.resetForm();
|
|
@@ -11729,110 +11915,7 @@ var TutorialScreenContainer = function TutorialScreenContainer() {
|
|
|
11729
11915
|
});
|
|
11730
11916
|
};
|
|
11731
11917
|
|
|
11732
|
-
var
|
|
11733
|
-
var isDefaultQuestion = _ref.isDefaultQuestion,
|
|
11734
|
-
isDefaultQuestionGeneral = _ref.isDefaultQuestionGeneral;
|
|
11735
|
-
|
|
11736
|
-
var _useQuestionList = useQuestionList(isDefaultQuestion, isDefaultQuestionGeneral),
|
|
11737
|
-
totalItems = _useQuestionList.totalItems,
|
|
11738
|
-
gridOptions = _useQuestionList.gridOptions,
|
|
11739
|
-
setRef = _useQuestionList.setRef,
|
|
11740
|
-
goToDetail = _useQuestionList.goToDetail,
|
|
11741
|
-
filters = _useQuestionList.filters,
|
|
11742
|
-
changeFilters = _useQuestionList.changeFilters,
|
|
11743
|
-
updateOrderQuestions = _useQuestionList.updateOrderQuestions;
|
|
11744
|
-
|
|
11745
|
-
var onRowDragEnd = function onRowDragEnd(e) {
|
|
11746
|
-
var dataAfterDrag = e.node.parent.childrenAfterFilter.map(function (item, index) {
|
|
11747
|
-
return {
|
|
11748
|
-
id: item.data.id,
|
|
11749
|
-
orderDrag: ++index
|
|
11750
|
-
};
|
|
11751
|
-
});
|
|
11752
|
-
updateOrderQuestions(dataAfterDrag, isDefaultQuestionGeneral);
|
|
11753
|
-
};
|
|
11754
|
-
|
|
11755
|
-
return React.createElement("div", {
|
|
11756
|
-
className: "animated fadeIn"
|
|
11757
|
-
}, React.createElement(Row, {
|
|
11758
|
-
className: "my-2"
|
|
11759
|
-
}, React.createElement(Col, {
|
|
11760
|
-
md: 8
|
|
11761
|
-
}, React.createElement(SearchBoxContainer, {
|
|
11762
|
-
text: "Create question",
|
|
11763
|
-
onClick: function onClick() {
|
|
11764
|
-
return goToDetail();
|
|
11765
|
-
},
|
|
11766
|
-
initValue: filters.searchString,
|
|
11767
|
-
onSearch: function onSearch(searchString) {
|
|
11768
|
-
return changeFilters({
|
|
11769
|
-
searchString: searchString
|
|
11770
|
-
});
|
|
11771
|
-
},
|
|
11772
|
-
placeholder: "Type something to Search question"
|
|
11773
|
-
})), isDefaultQuestion && React.createElement(Col, {
|
|
11774
|
-
md: 2
|
|
11775
|
-
}, React.createElement(DefaultQuestionStudentTeacherFilter, {
|
|
11776
|
-
isDefaultQuestionTeacher: filters.isDefaultQuestionTeacher,
|
|
11777
|
-
onChange: function onChange(e) {
|
|
11778
|
-
return changeFilters({
|
|
11779
|
-
isDefaultQuestionTeacher: e ? e.value : null
|
|
11780
|
-
});
|
|
11781
|
-
}
|
|
11782
|
-
})), isDefaultQuestionGeneral && React.createElement(Col, {
|
|
11783
|
-
md: 2
|
|
11784
|
-
}, React.createElement(DefaultQuestionStudentTeacherFilter, {
|
|
11785
|
-
isDefaultQuestionTeacher: filters.isDefaultQuestionGeneralClassTeacher,
|
|
11786
|
-
onChange: function onChange(e) {
|
|
11787
|
-
return changeFilters({
|
|
11788
|
-
isDefaultQuestionGeneralClassTeacher: e ? e.value : null
|
|
11789
|
-
});
|
|
11790
|
-
},
|
|
11791
|
-
isDefaultGeneralClass: true
|
|
11792
|
-
})), React.createElement(Col, {
|
|
11793
|
-
md: isDefaultQuestion || isDefaultQuestionGeneral ? 2 : 4,
|
|
11794
|
-
className: "d-flex align-items-center justify-content-end"
|
|
11795
|
-
}, "Total of questions: ", totalItems)), React.createElement(Row, {
|
|
11796
|
-
className: "mb-2"
|
|
11797
|
-
}, React.createElement(Col, {
|
|
11798
|
-
md: 12,
|
|
11799
|
-
className: "mb-2"
|
|
11800
|
-
}, React.createElement("div", {
|
|
11801
|
-
className: "ag-theme-balham w-100"
|
|
11802
|
-
}, React.createElement(AgGridReact, {
|
|
11803
|
-
domLayout: "autoHeight",
|
|
11804
|
-
gridOptions: gridOptions,
|
|
11805
|
-
masterDetail: true,
|
|
11806
|
-
onGridReady: function onGridReady(params) {
|
|
11807
|
-
setRef(params.api);
|
|
11808
|
-
},
|
|
11809
|
-
rowDragManaged: true,
|
|
11810
|
-
animateRows: true,
|
|
11811
|
-
modules: [MasterDetailModule, ClientSideRowModelModule],
|
|
11812
|
-
onRowDragEnd: onRowDragEnd
|
|
11813
|
-
}))), React.createElement(Col, {
|
|
11814
|
-
md: 12
|
|
11815
|
-
}, React.createElement(CustomPagination, {
|
|
11816
|
-
filters: filters,
|
|
11817
|
-
totalRecordCount: totalItems,
|
|
11818
|
-
changePageSize: function changePageSize(pageSize) {
|
|
11819
|
-
return changeFilters({
|
|
11820
|
-
pageSize: pageSize
|
|
11821
|
-
});
|
|
11822
|
-
},
|
|
11823
|
-
changePage: function changePage(currentPage) {
|
|
11824
|
-
return changeFilters({
|
|
11825
|
-
currentPage: currentPage
|
|
11826
|
-
});
|
|
11827
|
-
}
|
|
11828
|
-
}))));
|
|
11829
|
-
};
|
|
11830
|
-
|
|
11831
|
-
QuestionBankList$1.defaultProps = {
|
|
11832
|
-
isDefaultQuestion: false
|
|
11833
|
-
};
|
|
11834
|
-
|
|
11835
|
-
var schema$c = object({
|
|
11918
|
+
var schema$d = object({
|
|
11836
11919
|
name: string().required("Name is required")
|
|
11837
11920
|
});
|
|
11838
11921
|
|
|
@@ -11849,7 +11932,7 @@ var QuestionCateModal = function QuestionCateModal(props, ref) {
|
|
|
11849
11932
|
return React.createElement(Formik, {
|
|
11850
11933
|
initialValues: questionCateDetail,
|
|
11851
11934
|
enableReinitialize: true,
|
|
11852
|
-
validationSchema: schema$
|
|
11935
|
+
validationSchema: schema$d,
|
|
11853
11936
|
onSubmit: function onSubmit(values, actions) {
|
|
11854
11937
|
onConfirm(values);
|
|
11855
11938
|
actions.resetForm();
|
|
@@ -12260,25 +12343,7 @@ var QuestionCateList = function QuestionCateList() {
|
|
|
12260
12343
|
var tabs$3 = [{
|
|
12261
12344
|
path: "/admin/question/question-list",
|
|
12262
12345
|
title: "Question list",
|
|
12263
|
-
component: QuestionBankList
|
|
12264
|
-
}, {
|
|
12265
|
-
path: "/admin/question/default-question-list",
|
|
12266
|
-
title: "Default question list",
|
|
12267
|
-
component: function component() {
|
|
12268
|
-
return React.createElement(QuestionBankList$1, {
|
|
12269
|
-
isDefaultQuestion: true,
|
|
12270
|
-
isDefaultQuestionGeneral: false
|
|
12271
|
-
});
|
|
12272
|
-
}
|
|
12273
|
-
}, {
|
|
12274
|
-
path: "/admin/question/default-question-general-list",
|
|
12275
|
-
title: "Default question general class list",
|
|
12276
|
-
component: function component() {
|
|
12277
|
-
return React.createElement(QuestionBankList$1, {
|
|
12278
|
-
isDefaultQuestion: false,
|
|
12279
|
-
isDefaultQuestionGeneral: true
|
|
12280
|
-
});
|
|
12281
|
-
}
|
|
12346
|
+
component: QuestionBankList
|
|
12282
12347
|
}, {
|
|
12283
12348
|
path: "/admin/question/question-category",
|
|
12284
12349
|
title: "Question category",
|
|
@@ -12454,7 +12519,7 @@ var SemesterSelector = function SemesterSelector(_ref) {
|
|
|
12454
12519
|
}));
|
|
12455
12520
|
};
|
|
12456
12521
|
|
|
12457
|
-
var schema$
|
|
12522
|
+
var schema$e = object({
|
|
12458
12523
|
beginDate: string().required("Begin date is required"),
|
|
12459
12524
|
endDate: string().required("End date is required"),
|
|
12460
12525
|
timeSemester: string().required("Time Semester is required"),
|
|
@@ -12490,7 +12555,7 @@ var AssignmentDetailModal = function AssignmentDetailModal(props, ref) {
|
|
|
12490
12555
|
return React.createElement(Formik, {
|
|
12491
12556
|
initialValues: assignmentDetail,
|
|
12492
12557
|
enableReinitialize: true,
|
|
12493
|
-
validationSchema: schema$
|
|
12558
|
+
validationSchema: schema$e,
|
|
12494
12559
|
onSubmit: function onSubmit(values, actions) {
|
|
12495
12560
|
onConfirm(values);
|
|
12496
12561
|
actions.resetForm();
|
|
@@ -14178,7 +14243,7 @@ var SkillSelector$1 = function SkillSelector(_ref) {
|
|
|
14178
14243
|
});
|
|
14179
14244
|
};
|
|
14180
14245
|
|
|
14181
|
-
var schema$
|
|
14246
|
+
var schema$f = object({
|
|
14182
14247
|
name: string().required("Name is required"),
|
|
14183
14248
|
isConference: boolean().required("Is conference is required"),
|
|
14184
14249
|
conferenceRubricId: number().nullable().test("Test conference rubric id", "Conference rubric is required", function () {
|
|
@@ -14566,7 +14631,7 @@ var SessionTemplateDetail = function SessionTemplateDetail() {
|
|
|
14566
14631
|
return React.createElement(Formik, {
|
|
14567
14632
|
initialValues: sessionTemplateDetail,
|
|
14568
14633
|
enableReinitialize: true,
|
|
14569
|
-
validationSchema: schema$
|
|
14634
|
+
validationSchema: schema$f,
|
|
14570
14635
|
onSubmit: function onSubmit(values) {
|
|
14571
14636
|
confirmData(values);
|
|
14572
14637
|
setEdited(false);
|
|
@@ -15119,7 +15184,7 @@ var useSessionTemplateGeneralClassDetail = function useSessionTemplateGeneralCla
|
|
|
15119
15184
|
};
|
|
15120
15185
|
|
|
15121
15186
|
var LINK_TO_DEFAULT_QUESTION_GENERAL_CLASS = "/admin/question/default-question-general-list";
|
|
15122
|
-
var schema$
|
|
15187
|
+
var schema$g = object({
|
|
15123
15188
|
name: string().trim().required("Name is required"),
|
|
15124
15189
|
subjectId: number().required("Subject is required").test("Test subject", "Subject is required", function (value) {
|
|
15125
15190
|
return value > 0;
|
|
@@ -15203,7 +15268,7 @@ var SessionTemplateGeneralClassDetail = function SessionTemplateGeneralClassDeta
|
|
|
15203
15268
|
return React.createElement(Formik, {
|
|
15204
15269
|
initialValues: sessionTemplateGeneralClassDetail,
|
|
15205
15270
|
enableReinitialize: true,
|
|
15206
|
-
validationSchema: schema$
|
|
15271
|
+
validationSchema: schema$g,
|
|
15207
15272
|
onSubmit: function onSubmit(values) {
|
|
15208
15273
|
confirmData(values);
|
|
15209
15274
|
setEdited(false);
|
|
@@ -15410,7 +15475,7 @@ var SessionTemplateGeneralClassDetail = function SessionTemplateGeneralClassDeta
|
|
|
15410
15475
|
});
|
|
15411
15476
|
};
|
|
15412
15477
|
|
|
15413
|
-
var schema$
|
|
15478
|
+
var schema$h = object({
|
|
15414
15479
|
learningSupportCategoryId: number().test("testLearningSupportCategoryId", "Invalid category", function (number) {
|
|
15415
15480
|
return !!number && number >= 1;
|
|
15416
15481
|
}),
|
|
@@ -15440,7 +15505,7 @@ var CustomAlertDetailModal = function CustomAlertDetailModal(props, ref) {
|
|
|
15440
15505
|
return React.createElement(Formik, {
|
|
15441
15506
|
initialValues: customAlertDetail,
|
|
15442
15507
|
enableReinitialize: true,
|
|
15443
|
-
validationSchema: schema$
|
|
15508
|
+
validationSchema: schema$h,
|
|
15444
15509
|
onSubmit: function onSubmit(values, actions) {
|
|
15445
15510
|
onConfirm(values);
|
|
15446
15511
|
actions.resetForm();
|
|
@@ -16014,7 +16079,7 @@ var CustomAlertList = function CustomAlertList() {
|
|
|
16014
16079
|
|
|
16015
16080
|
var certificate = {"certificate-item":"_3DVMZ","add-breakpoint":"_3zOGW","box-item":"_3DQwX"};
|
|
16016
16081
|
|
|
16017
|
-
var schema$
|
|
16082
|
+
var schema$i = object({
|
|
16018
16083
|
name: string().required("Name is required"),
|
|
16019
16084
|
certificateItems: array().test("Text label required", "Text is required", function (value) {
|
|
16020
16085
|
return value === null || value === void 0 ? void 0 : value.every(function (item) {
|
|
@@ -16039,7 +16104,7 @@ var CertificateDetailModal = function CertificateDetailModal(props, ref) {
|
|
|
16039
16104
|
return React.createElement(Formik, {
|
|
16040
16105
|
initialValues: certificateDetail,
|
|
16041
16106
|
enableReinitialize: true,
|
|
16042
|
-
validationSchema: schema$
|
|
16107
|
+
validationSchema: schema$i,
|
|
16043
16108
|
onSubmit: function onSubmit(values, actions) {
|
|
16044
16109
|
var _values$certificateIt;
|
|
16045
16110
|
|
|
@@ -17328,6 +17393,7 @@ var HighImpact = function HighImpact(_ref) {
|
|
|
17328
17393
|
}, [data]);
|
|
17329
17394
|
if (!data) return React.createElement(Loading, null);
|
|
17330
17395
|
var series = [{
|
|
17396
|
+
name: "",
|
|
17331
17397
|
data: ratings
|
|
17332
17398
|
}];
|
|
17333
17399
|
var options = {
|
|
@@ -17521,7 +17587,10 @@ var Quantity = function Quantity(_ref) {
|
|
|
17521
17587
|
if (!data) return React.createElement(Loading, null);
|
|
17522
17588
|
var teacherPercentage = data.teacherPercentage,
|
|
17523
17589
|
studentPercentage = data.studentPercentage,
|
|
17524
|
-
assistantPercentage = data.assistantPercentage
|
|
17590
|
+
assistantPercentage = data.assistantPercentage,
|
|
17591
|
+
numberOfTeachers = data.numberOfTeachers,
|
|
17592
|
+
numberOfStudents = data.numberOfStudents,
|
|
17593
|
+
numberOfAssistants = data.numberOfAssistants;
|
|
17525
17594
|
var series = [teacherPercentage, studentPercentage, assistantPercentage].map(function (number) {
|
|
17526
17595
|
return Number(number.toFixed(2));
|
|
17527
17596
|
});
|
|
@@ -17547,15 +17616,15 @@ var Quantity = function Quantity(_ref) {
|
|
|
17547
17616
|
var details = [{
|
|
17548
17617
|
label: "Teachers",
|
|
17549
17618
|
color: colors$3[0],
|
|
17550
|
-
value:
|
|
17619
|
+
value: numberOfTeachers
|
|
17551
17620
|
}, {
|
|
17552
17621
|
label: "Students",
|
|
17553
17622
|
color: colors$3[1],
|
|
17554
|
-
value:
|
|
17623
|
+
value: numberOfStudents
|
|
17555
17624
|
}, {
|
|
17556
17625
|
label: "Assistants",
|
|
17557
17626
|
color: colors$3[2],
|
|
17558
|
-
value:
|
|
17627
|
+
value: numberOfAssistants
|
|
17559
17628
|
}];
|
|
17560
17629
|
return React.createElement("div", {
|
|
17561
17630
|
className: "d-flex h-100"
|
|
@@ -17569,8 +17638,6 @@ var Quantity = function Quantity(_ref) {
|
|
|
17569
17638
|
bordered: true,
|
|
17570
17639
|
size: "sm"
|
|
17571
17640
|
}, React.createElement("tbody", null, details.map(function (item) {
|
|
17572
|
-
var _item$value;
|
|
17573
|
-
|
|
17574
17641
|
return React.createElement("tr", {
|
|
17575
17642
|
key: item.label
|
|
17576
17643
|
}, React.createElement("td", null, item.label), React.createElement("td", {
|
|
@@ -17580,8 +17647,8 @@ var Quantity = function Quantity(_ref) {
|
|
|
17580
17647
|
style: {
|
|
17581
17648
|
backgroundColor: item.color
|
|
17582
17649
|
}
|
|
17583
|
-
})), React.createElement("td", null,
|
|
17584
|
-
}))))), React.createElement("div", {
|
|
17650
|
+
})), React.createElement("td", null, item.value));
|
|
17651
|
+
}))), React.createElement("p", null, "The number of user for each role"))), React.createElement("div", {
|
|
17585
17652
|
className: "d-flex align-items-end"
|
|
17586
17653
|
}, React.createElement(ReactApexChart, {
|
|
17587
17654
|
options: options,
|