mario-education 2.2.9 → 2.3.3
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/components/UploadCSVButton.d.ts +1 -0
- 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 -201
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +270 -201
- 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",
|
|
@@ -5189,12 +5185,13 @@ var UploadCSVButton = function UploadCSVButton(_ref) {
|
|
|
5189
5185
|
isDisabled = _ref.isDisabled,
|
|
5190
5186
|
text = _ref.text,
|
|
5191
5187
|
backgroundColor = _ref.backgroundColor,
|
|
5192
|
-
_onClick = _ref.onClick
|
|
5188
|
+
_onClick = _ref.onClick,
|
|
5189
|
+
isClassReflection = _ref.isClassReflection;
|
|
5193
5190
|
return React.createElement(Label, {
|
|
5194
5191
|
htmlFor: htmlFor,
|
|
5195
5192
|
role: "button",
|
|
5196
5193
|
tabIndex: 0,
|
|
5197
|
-
className: "d-flex align-items-center justfy-content-center " + (!isDisabled ? "cursor-pointer hover-opacity" : ""),
|
|
5194
|
+
className: "d-flex align-items-center justfy-content-center \n " + (isClassReflection ? "w-25" : "") + "\n " + (!isDisabled ? "cursor-pointer hover-opacity" : ""),
|
|
5198
5195
|
style: _extends({}, style, {
|
|
5199
5196
|
backgroundColor: backgroundColor,
|
|
5200
5197
|
opacity: !isDisabled ? 1 : 0.5
|
|
@@ -5209,8 +5206,12 @@ var UploadCSVButton = function UploadCSVButton(_ref) {
|
|
|
5209
5206
|
};
|
|
5210
5207
|
|
|
5211
5208
|
var CSV_FILE_URL = BASE_URL + "/api/ImportCsv/csv";
|
|
5212
|
-
var
|
|
5213
|
-
|
|
5209
|
+
var CSV_FILE_TEACHER = BASE_URL + "/api/Teacher";
|
|
5210
|
+
var importStudentCSV = function importStudentCSV(formData) {
|
|
5211
|
+
return apiUpload.post(CSV_FILE_TEACHER + "/adminImportStudent", formData);
|
|
5212
|
+
};
|
|
5213
|
+
var importClassReflectionCSV = function importClassReflectionCSV(formData) {
|
|
5214
|
+
return apiUpload.post(CSV_FILE_URL + "/importClassReflection", formData);
|
|
5214
5215
|
};
|
|
5215
5216
|
|
|
5216
5217
|
var CSVType;
|
|
@@ -5225,28 +5226,18 @@ var CSVType;
|
|
|
5225
5226
|
})(CSVType || (CSVType = {}));
|
|
5226
5227
|
|
|
5227
5228
|
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
|
|
5229
|
+
text: "Import students",
|
|
5230
|
+
backgroundColor: "#0abde3",
|
|
5231
|
+
type: CSVType.Students
|
|
5247
5232
|
}];
|
|
5248
5233
|
var title = "CSV Import";
|
|
5249
5234
|
var id = "csvupload";
|
|
5235
|
+
var initClassReflect = {
|
|
5236
|
+
teacherName: '',
|
|
5237
|
+
teacherEmail: '',
|
|
5238
|
+
studentIds: [],
|
|
5239
|
+
file: ''
|
|
5240
|
+
};
|
|
5250
5241
|
|
|
5251
5242
|
var useCSVImport = function useCSVImport() {
|
|
5252
5243
|
var dispatch = useDispatch();
|
|
@@ -5258,6 +5249,18 @@ var useCSVImport = function useCSVImport() {
|
|
|
5258
5249
|
type = _useState[0],
|
|
5259
5250
|
setType = _useState[1];
|
|
5260
5251
|
|
|
5252
|
+
var _useState2 = useState(),
|
|
5253
|
+
dataFile = _useState2[0],
|
|
5254
|
+
setDataFile = _useState2[1];
|
|
5255
|
+
|
|
5256
|
+
var _useState3 = useState([]),
|
|
5257
|
+
arrStudent = _useState3[0],
|
|
5258
|
+
setArrStudent = _useState3[1];
|
|
5259
|
+
|
|
5260
|
+
var _useState4 = useState(initClassReflect),
|
|
5261
|
+
initImportReflection = _useState4[0],
|
|
5262
|
+
setInitImportReflection = _useState4[1];
|
|
5263
|
+
|
|
5261
5264
|
useEffect(function () {
|
|
5262
5265
|
document.title = title;
|
|
5263
5266
|
}, []);
|
|
@@ -5265,7 +5268,7 @@ var useCSVImport = function useCSVImport() {
|
|
|
5265
5268
|
try {
|
|
5266
5269
|
var _temp3 = function _temp3() {
|
|
5267
5270
|
dispatch(setLoading(false));
|
|
5268
|
-
var input = document.getElementById(
|
|
5271
|
+
var input = document.getElementById('import-student');
|
|
5269
5272
|
input && (input.value = "");
|
|
5270
5273
|
};
|
|
5271
5274
|
|
|
@@ -5275,7 +5278,7 @@ var useCSVImport = function useCSVImport() {
|
|
|
5275
5278
|
var _temp4 = _catch(function () {
|
|
5276
5279
|
var formData = new FormData();
|
|
5277
5280
|
formData.append("file", file, file.name);
|
|
5278
|
-
return Promise.resolve(
|
|
5281
|
+
return Promise.resolve(importStudentCSV(formData)).then(function () {
|
|
5279
5282
|
dispatch(setAlert({
|
|
5280
5283
|
type: "success",
|
|
5281
5284
|
message: "Import CSV successfully"
|
|
@@ -5295,21 +5298,87 @@ var useCSVImport = function useCSVImport() {
|
|
|
5295
5298
|
return Promise.reject(e);
|
|
5296
5299
|
}
|
|
5297
5300
|
}, [type]);
|
|
5301
|
+
|
|
5302
|
+
var onConfirm = function onConfirm(values) {
|
|
5303
|
+
try {
|
|
5304
|
+
var _temp7 = function _temp7() {
|
|
5305
|
+
dispatch(setLoading(false));
|
|
5306
|
+
var input = document.getElementById(id);
|
|
5307
|
+
input && (input.value = "");
|
|
5308
|
+
};
|
|
5309
|
+
|
|
5310
|
+
if (!dataFile || !dataFile) return Promise.resolve();
|
|
5311
|
+
dispatch(setLoading(true));
|
|
5312
|
+
|
|
5313
|
+
var _temp8 = _catch(function () {
|
|
5314
|
+
var formData = new FormData();
|
|
5315
|
+
formData.append("file", dataFile, dataFile.name);
|
|
5316
|
+
formData.append("teacherName", values.teacherName);
|
|
5317
|
+
formData.append("teacherEmail", values.teacherEmail);
|
|
5318
|
+
values.studentIds.forEach(function (item) {
|
|
5319
|
+
formData.append("studentIds", item);
|
|
5320
|
+
});
|
|
5321
|
+
return Promise.resolve(importClassReflectionCSV(formData)).then(function () {
|
|
5322
|
+
dispatch(setAlert({
|
|
5323
|
+
type: "success",
|
|
5324
|
+
message: "Import CSV successfully"
|
|
5325
|
+
}));
|
|
5326
|
+
setInitImportReflection(initClassReflect);
|
|
5327
|
+
});
|
|
5328
|
+
}, function (err) {
|
|
5329
|
+
var _err$response2, _err$response2$data;
|
|
5330
|
+
|
|
5331
|
+
dispatch(setAlert({
|
|
5332
|
+
type: "danger",
|
|
5333
|
+
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
|
|
5334
|
+
}));
|
|
5335
|
+
});
|
|
5336
|
+
|
|
5337
|
+
return Promise.resolve(_temp8 && _temp8.then ? _temp8.then(_temp7) : _temp7(_temp8));
|
|
5338
|
+
} catch (e) {
|
|
5339
|
+
return Promise.reject(e);
|
|
5340
|
+
}
|
|
5341
|
+
};
|
|
5342
|
+
|
|
5298
5343
|
return {
|
|
5299
5344
|
isLoading: isLoading,
|
|
5300
5345
|
buttons: buttons,
|
|
5301
5346
|
id: id,
|
|
5302
5347
|
setType: setType,
|
|
5303
|
-
upload: upload
|
|
5348
|
+
upload: upload,
|
|
5349
|
+
initImportReflection: initImportReflection,
|
|
5350
|
+
setInitImportReflection: setInitImportReflection,
|
|
5351
|
+
onConfirm: onConfirm,
|
|
5352
|
+
CSVType: CSVType,
|
|
5353
|
+
dataFile: dataFile,
|
|
5354
|
+
setDataFile: setDataFile,
|
|
5355
|
+
setArrStudent: setArrStudent,
|
|
5356
|
+
arrStudent: arrStudent
|
|
5304
5357
|
};
|
|
5305
5358
|
};
|
|
5306
5359
|
|
|
5360
|
+
var schema$4 = object({
|
|
5361
|
+
teacherName: string().required(),
|
|
5362
|
+
teacherEmail: string().email('Invalid email').required(),
|
|
5363
|
+
studentIds: array().required().test("test students", "Please choose student", function () {
|
|
5364
|
+
return !!this.parent.studentIds && !!this.parent.studentIds.length;
|
|
5365
|
+
}),
|
|
5366
|
+
file: string().required()
|
|
5367
|
+
});
|
|
5368
|
+
|
|
5307
5369
|
var CSVImport = function CSVImport() {
|
|
5308
5370
|
var _useCSVImport = useCSVImport(),
|
|
5371
|
+
initImportReflection = _useCSVImport.initImportReflection,
|
|
5372
|
+
onConfirm = _useCSVImport.onConfirm,
|
|
5309
5373
|
isLoading = _useCSVImport.isLoading,
|
|
5310
|
-
buttons = _useCSVImport.buttons,
|
|
5311
|
-
id = _useCSVImport.id,
|
|
5312
5374
|
setType = _useCSVImport.setType,
|
|
5375
|
+
id = _useCSVImport.id,
|
|
5376
|
+
CSVType = _useCSVImport.CSVType,
|
|
5377
|
+
dataFile = _useCSVImport.dataFile,
|
|
5378
|
+
setDataFile = _useCSVImport.setDataFile,
|
|
5379
|
+
setArrStudent = _useCSVImport.setArrStudent,
|
|
5380
|
+
arrStudent = _useCSVImport.arrStudent,
|
|
5381
|
+
buttons = _useCSVImport.buttons,
|
|
5313
5382
|
upload = _useCSVImport.upload;
|
|
5314
5383
|
|
|
5315
5384
|
return React.createElement("div", {
|
|
@@ -5317,28 +5386,147 @@ var CSVImport = function CSVImport() {
|
|
|
5317
5386
|
}, React.createElement(Input, {
|
|
5318
5387
|
className: "d-none",
|
|
5319
5388
|
type: "file",
|
|
5320
|
-
id:
|
|
5389
|
+
id: "import-student",
|
|
5321
5390
|
onChange: function onChange(e) {
|
|
5322
5391
|
return upload(e.target.files[0]);
|
|
5323
5392
|
},
|
|
5324
5393
|
accept: "text/csv"
|
|
5325
5394
|
}), React.createElement("div", {
|
|
5326
|
-
className: "
|
|
5327
|
-
},
|
|
5328
|
-
|
|
5329
|
-
|
|
5395
|
+
className: "class-reflection"
|
|
5396
|
+
}, React.createElement(Formik, {
|
|
5397
|
+
initialValues: initImportReflection,
|
|
5398
|
+
enableReinitialize: true,
|
|
5399
|
+
validationSchema: schema$4,
|
|
5400
|
+
onSubmit: function onSubmit(values, actions) {
|
|
5401
|
+
onConfirm(values);
|
|
5402
|
+
setDataFile('');
|
|
5403
|
+
setArrStudent([]);
|
|
5404
|
+
actions.resetForm();
|
|
5405
|
+
}
|
|
5406
|
+
}, function (formProps) {
|
|
5407
|
+
var values = formProps.values,
|
|
5408
|
+
touched = formProps.touched,
|
|
5409
|
+
errors = formProps.errors,
|
|
5410
|
+
handleSubmit = formProps.handleSubmit,
|
|
5411
|
+
handleChange = formProps.handleChange;
|
|
5412
|
+
return React.createElement(Row, {
|
|
5413
|
+
className: "mb-2"
|
|
5414
|
+
}, React.createElement(Input, {
|
|
5415
|
+
className: "d-none",
|
|
5416
|
+
type: "file",
|
|
5417
|
+
id: id,
|
|
5418
|
+
onChange: function onChange(e) {
|
|
5419
|
+
setDataFile(e.target.files[0]);
|
|
5420
|
+
formProps.setFieldValue('file', 'imported');
|
|
5421
|
+
var input = document.getElementById(id);
|
|
5422
|
+
input && (input.value = "");
|
|
5423
|
+
},
|
|
5424
|
+
accept: "text/csv"
|
|
5425
|
+
}), React.createElement(Col, {
|
|
5426
|
+
md: 6,
|
|
5427
|
+
className: "mb-2"
|
|
5428
|
+
}, React.createElement(Row, null, React.createElement(Col, {
|
|
5429
|
+
md: 12,
|
|
5430
|
+
className: "mb-2"
|
|
5431
|
+
}, React.createElement(RequiredLabel, {
|
|
5432
|
+
text: "Class Teacher Name"
|
|
5433
|
+
}), React.createElement(Input, {
|
|
5434
|
+
name: "teacherName",
|
|
5435
|
+
value: values.teacherName,
|
|
5436
|
+
type: "text",
|
|
5437
|
+
onChange: function onChange(e) {
|
|
5438
|
+
handleChange(e);
|
|
5439
|
+
}
|
|
5440
|
+
}), touched.teacherName && errors.teacherName && React.createElement(ErrorHandler, {
|
|
5441
|
+
text: errors.teacherName
|
|
5442
|
+
})), React.createElement(Col, {
|
|
5443
|
+
md: 12,
|
|
5444
|
+
className: "mb-2"
|
|
5445
|
+
}, React.createElement(RequiredLabel, {
|
|
5446
|
+
text: "Class Teacher Email"
|
|
5447
|
+
}), React.createElement(Input, {
|
|
5448
|
+
name: "teacherEmail",
|
|
5449
|
+
value: values.teacherEmail,
|
|
5450
|
+
type: "text",
|
|
5451
|
+
onChange: function onChange(e) {
|
|
5452
|
+
handleChange(e);
|
|
5453
|
+
}
|
|
5454
|
+
}), touched.teacherEmail && errors.teacherEmail && React.createElement(ErrorHandler, {
|
|
5455
|
+
text: errors.teacherEmail
|
|
5456
|
+
})), React.createElement(Col, {
|
|
5457
|
+
md: 12,
|
|
5458
|
+
className: "mb-2"
|
|
5459
|
+
}, React.createElement(Label, null, "Students"), React.createElement(StudentSelector, {
|
|
5460
|
+
onChange: function onChange(e) {
|
|
5461
|
+
setArrStudent(e);
|
|
5462
|
+
formProps.setFieldValue("studentIds", e.map(function (i) {
|
|
5463
|
+
return i.value;
|
|
5464
|
+
}) || []);
|
|
5465
|
+
},
|
|
5466
|
+
value: arrStudent
|
|
5467
|
+
})), React.createElement(Col, {
|
|
5468
|
+
md: 12,
|
|
5469
|
+
className: "mb-2"
|
|
5470
|
+
}, touched.studentIds && errors.studentIds && React.createElement(ErrorHandler, {
|
|
5471
|
+
text: errors.studentIds
|
|
5472
|
+
})), React.createElement(Col, {
|
|
5473
|
+
md: 12,
|
|
5474
|
+
className: "mb-2"
|
|
5475
|
+
}, React.createElement(RequiredLabel, {
|
|
5476
|
+
text: "Upload File Class Reflection"
|
|
5477
|
+
}), React.createElement(UploadCSVButton, {
|
|
5478
|
+
key: "Import class reflections",
|
|
5479
|
+
isClassReflection: true,
|
|
5330
5480
|
htmlFor: id,
|
|
5331
|
-
text:
|
|
5481
|
+
text: "Upload File",
|
|
5332
5482
|
isDisabled: isLoading,
|
|
5333
|
-
backgroundColor:
|
|
5483
|
+
backgroundColor: "#e74c3c",
|
|
5334
5484
|
onClick: function onClick() {
|
|
5335
|
-
|
|
5485
|
+
setType(CSVType.ClassReflection);
|
|
5336
5486
|
}
|
|
5337
|
-
})
|
|
5487
|
+
}), !!dataFile && React.createElement("p", {
|
|
5488
|
+
style: {
|
|
5489
|
+
color: '#007bff',
|
|
5490
|
+
fontStyle: 'italic',
|
|
5491
|
+
marginTop: '5px'
|
|
5492
|
+
}
|
|
5493
|
+
}, dataFile.name)), !dataFile && React.createElement(Col, {
|
|
5494
|
+
md: 12,
|
|
5495
|
+
className: "mb-2"
|
|
5496
|
+
}, touched.file && errors.file && React.createElement(ErrorHandler, {
|
|
5497
|
+
text: errors.file
|
|
5498
|
+
})), React.createElement(Col, {
|
|
5499
|
+
md: 12
|
|
5500
|
+
}, React.createElement(Button, {
|
|
5501
|
+
color: "primary",
|
|
5502
|
+
className: "float-right",
|
|
5503
|
+
onClick: function onClick() {
|
|
5504
|
+
return handleSubmit();
|
|
5505
|
+
}
|
|
5506
|
+
}, "Import"), ' '))), React.createElement(Col, {
|
|
5507
|
+
md: 6,
|
|
5508
|
+
className: "mb-2"
|
|
5509
|
+
}, React.createElement(Row, null, React.createElement(Col, {
|
|
5510
|
+
md: 12,
|
|
5511
|
+
className: "mb-2"
|
|
5512
|
+
}, React.createElement(RequiredLabel, {
|
|
5513
|
+
text: "Import student"
|
|
5514
|
+
}), buttons.map(function (button) {
|
|
5515
|
+
return React.createElement(UploadCSVButton, {
|
|
5516
|
+
key: button.text,
|
|
5517
|
+
htmlFor: 'import-student',
|
|
5518
|
+
text: button.text,
|
|
5519
|
+
isDisabled: isLoading,
|
|
5520
|
+
backgroundColor: button.backgroundColor,
|
|
5521
|
+
onClick: function onClick() {
|
|
5522
|
+
return setType(button.type);
|
|
5523
|
+
}
|
|
5524
|
+
});
|
|
5525
|
+
})))));
|
|
5338
5526
|
})));
|
|
5339
5527
|
};
|
|
5340
5528
|
|
|
5341
|
-
var schema$
|
|
5529
|
+
var schema$5 = object({
|
|
5342
5530
|
name: string().required("Name is required"),
|
|
5343
5531
|
startTime: string().required("Start time is required"),
|
|
5344
5532
|
endTime: string().required("End time is required")
|
|
@@ -5357,7 +5545,7 @@ var SemesterDetailModal = function SemesterDetailModal(props, ref) {
|
|
|
5357
5545
|
return React.createElement(Formik, {
|
|
5358
5546
|
initialValues: semesterDetail,
|
|
5359
5547
|
enableReinitialize: true,
|
|
5360
|
-
validationSchema: schema$
|
|
5548
|
+
validationSchema: schema$5,
|
|
5361
5549
|
onSubmit: function onSubmit(values, actions) {
|
|
5362
5550
|
onConfirm(values);
|
|
5363
5551
|
actions.resetForm();
|
|
@@ -5410,7 +5598,7 @@ var SemesterDetailModal = function SemesterDetailModal(props, ref) {
|
|
|
5410
5598
|
})), React.createElement(Col, {
|
|
5411
5599
|
md: 6
|
|
5412
5600
|
}, React.createElement(DatePicker, {
|
|
5413
|
-
value: utcToLocalTime(values.startTime, "Do MMMM YYYY"),
|
|
5601
|
+
value: !!values.startTime ? utcToLocalTime(values.startTime, "Do MMMM YYYY") : "",
|
|
5414
5602
|
todayButton: "Today",
|
|
5415
5603
|
peekNextMonth: true,
|
|
5416
5604
|
showMonthDropdown: true,
|
|
@@ -5441,7 +5629,7 @@ var SemesterDetailModal = function SemesterDetailModal(props, ref) {
|
|
|
5441
5629
|
})), React.createElement(Col, {
|
|
5442
5630
|
md: 6
|
|
5443
5631
|
}, React.createElement(DatePicker, {
|
|
5444
|
-
value: utcToLocalTime(values.endTime, "Do MMMM YYYY"),
|
|
5632
|
+
value: !!values.endTime ? utcToLocalTime(values.endTime, "Do MMMM YYYY") : "",
|
|
5445
5633
|
todayButton: "Today",
|
|
5446
5634
|
peekNextMonth: true,
|
|
5447
5635
|
showMonthDropdown: true,
|
|
@@ -5468,7 +5656,7 @@ var SemesterDetailModal = function SemesterDetailModal(props, ref) {
|
|
|
5468
5656
|
|
|
5469
5657
|
var SemesterDetailModal$1 = forwardRef(SemesterDetailModal);
|
|
5470
5658
|
|
|
5471
|
-
var schema$
|
|
5659
|
+
var schema$6 = object({
|
|
5472
5660
|
value: number().required("Breaking month is required")
|
|
5473
5661
|
});
|
|
5474
5662
|
var options = [{
|
|
@@ -5521,7 +5709,7 @@ var BreakingMonthModal = function BreakingMonthModal(props, ref) {
|
|
|
5521
5709
|
return React.createElement(Formik, {
|
|
5522
5710
|
initialValues: breakingMonthDetail,
|
|
5523
5711
|
enableReinitialize: true,
|
|
5524
|
-
validationSchema: schema$
|
|
5712
|
+
validationSchema: schema$6,
|
|
5525
5713
|
onSubmit: function onSubmit(values, actions) {
|
|
5526
5714
|
onConfirm(values);
|
|
5527
5715
|
actions.resetForm();
|
|
@@ -6099,7 +6287,7 @@ var SemesterList = function SemesterList() {
|
|
|
6099
6287
|
}, "Change breaking month"))))));
|
|
6100
6288
|
};
|
|
6101
6289
|
|
|
6102
|
-
var schema$
|
|
6290
|
+
var schema$7 = object({
|
|
6103
6291
|
label: string().required("Label is required"),
|
|
6104
6292
|
value: number().required("Value is required")
|
|
6105
6293
|
});
|
|
@@ -6117,7 +6305,7 @@ var BandScoreDetailModal = function BandScoreDetailModal(props, ref) {
|
|
|
6117
6305
|
return React.createElement(Formik, {
|
|
6118
6306
|
initialValues: bandScoreDetail,
|
|
6119
6307
|
enableReinitialize: true,
|
|
6120
|
-
validationSchema: schema$
|
|
6308
|
+
validationSchema: schema$7,
|
|
6121
6309
|
onSubmit: function onSubmit(values, actions) {
|
|
6122
6310
|
onConfirm(values);
|
|
6123
6311
|
actions.resetForm();
|
|
@@ -6786,7 +6974,7 @@ var CurrentLicense = function CurrentLicense() {
|
|
|
6786
6974
|
}))));
|
|
6787
6975
|
};
|
|
6788
6976
|
|
|
6789
|
-
var schema$
|
|
6977
|
+
var schema$8 = object({
|
|
6790
6978
|
name: string().required("Name is required"),
|
|
6791
6979
|
startTime: string().required("Start time is required"),
|
|
6792
6980
|
endTime: string().required("End time is required")
|
|
@@ -6805,7 +6993,7 @@ var SchoolBlankDayDetailModal = function SchoolBlankDayDetailModal(props, ref) {
|
|
|
6805
6993
|
return React.createElement(Formik, {
|
|
6806
6994
|
initialValues: schoolBlankDayDetail,
|
|
6807
6995
|
enableReinitialize: true,
|
|
6808
|
-
validationSchema: schema$
|
|
6996
|
+
validationSchema: schema$8,
|
|
6809
6997
|
onSubmit: function onSubmit(values, actions) {
|
|
6810
6998
|
onConfirm(values);
|
|
6811
6999
|
actions.resetForm();
|
|
@@ -8335,7 +8523,7 @@ var QuestionSplitPaneSelector = function QuestionSplitPaneSelector(props) {
|
|
|
8335
8523
|
}, " ", "v", " ")) : "");
|
|
8336
8524
|
};
|
|
8337
8525
|
|
|
8338
|
-
var schema$
|
|
8526
|
+
var schema$9 = object({
|
|
8339
8527
|
name: string().required("Name is required")
|
|
8340
8528
|
});
|
|
8341
8529
|
|
|
@@ -8361,7 +8549,7 @@ var ReflectionDetailModal = function ReflectionDetailModal(props, ref) {
|
|
|
8361
8549
|
return React.createElement(Formik, {
|
|
8362
8550
|
initialValues: reflectionformDetail,
|
|
8363
8551
|
enableReinitialize: true,
|
|
8364
|
-
validationSchema: schema$
|
|
8552
|
+
validationSchema: schema$9,
|
|
8365
8553
|
onSubmit: function onSubmit(values, actions) {
|
|
8366
8554
|
values.questionIds = arrId;
|
|
8367
8555
|
onConfirm(values);
|
|
@@ -9742,7 +9930,7 @@ var AdditionalComponent = function AdditionalComponent(_ref) {
|
|
|
9742
9930
|
return null;
|
|
9743
9931
|
};
|
|
9744
9932
|
|
|
9745
|
-
var schema$
|
|
9933
|
+
var schema$a = object({
|
|
9746
9934
|
text: string().required("Question text is required"),
|
|
9747
9935
|
type: string().required("Question type is required"),
|
|
9748
9936
|
categoryId: number().test("test category id", "Category is required", function (value) {
|
|
@@ -9995,7 +10183,7 @@ var QuestionDetail = function QuestionDetail() {
|
|
|
9995
10183
|
return React.createElement(Formik, {
|
|
9996
10184
|
initialValues: questionDetail,
|
|
9997
10185
|
enableReinitialize: true,
|
|
9998
|
-
validationSchema: schema$
|
|
10186
|
+
validationSchema: schema$a,
|
|
9999
10187
|
onSubmit: function onSubmit(values) {
|
|
10000
10188
|
if (values.type == QUESTION_TYPES.EMOTIONAL && !!values.answers) {
|
|
10001
10189
|
for (var index in values.answers) {
|
|
@@ -10261,7 +10449,7 @@ var QuestionSplitPaneSelector$1 = function QuestionSplitPaneSelector(props) {
|
|
|
10261
10449
|
}, " ", "v", " ")) : "");
|
|
10262
10450
|
};
|
|
10263
10451
|
|
|
10264
|
-
var schema$
|
|
10452
|
+
var schema$b = object({
|
|
10265
10453
|
name: string().required("Name is required")
|
|
10266
10454
|
});
|
|
10267
10455
|
|
|
@@ -10287,7 +10475,7 @@ var AssessmentDetailModal = function AssessmentDetailModal(props, ref) {
|
|
|
10287
10475
|
return React.createElement(Formik, {
|
|
10288
10476
|
initialValues: assessmentDetail,
|
|
10289
10477
|
enableReinitialize: true,
|
|
10290
|
-
validationSchema: schema$
|
|
10478
|
+
validationSchema: schema$b,
|
|
10291
10479
|
onSubmit: function onSubmit(values, actions) {
|
|
10292
10480
|
values.questionIds = arrId;
|
|
10293
10481
|
onConfirm(values);
|
|
@@ -11229,7 +11417,7 @@ var FeedbackList = function FeedbackList() {
|
|
|
11229
11417
|
}))));
|
|
11230
11418
|
};
|
|
11231
11419
|
|
|
11232
|
-
var schema$
|
|
11420
|
+
var schema$c = object({
|
|
11233
11421
|
name: string().required("Name is required")
|
|
11234
11422
|
});
|
|
11235
11423
|
|
|
@@ -11249,7 +11437,7 @@ var TutorialScreenDetailModal = function TutorialScreenDetailModal(props, ref) {
|
|
|
11249
11437
|
typeRole: typeRole
|
|
11250
11438
|
}),
|
|
11251
11439
|
enableReinitialize: true,
|
|
11252
|
-
validationSchema: schema$
|
|
11440
|
+
validationSchema: schema$c,
|
|
11253
11441
|
onSubmit: function onSubmit(values, actions) {
|
|
11254
11442
|
onConfirm(values);
|
|
11255
11443
|
actions.resetForm();
|
|
@@ -11729,110 +11917,7 @@ var TutorialScreenContainer = function TutorialScreenContainer() {
|
|
|
11729
11917
|
});
|
|
11730
11918
|
};
|
|
11731
11919
|
|
|
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({
|
|
11920
|
+
var schema$d = object({
|
|
11836
11921
|
name: string().required("Name is required")
|
|
11837
11922
|
});
|
|
11838
11923
|
|
|
@@ -11849,7 +11934,7 @@ var QuestionCateModal = function QuestionCateModal(props, ref) {
|
|
|
11849
11934
|
return React.createElement(Formik, {
|
|
11850
11935
|
initialValues: questionCateDetail,
|
|
11851
11936
|
enableReinitialize: true,
|
|
11852
|
-
validationSchema: schema$
|
|
11937
|
+
validationSchema: schema$d,
|
|
11853
11938
|
onSubmit: function onSubmit(values, actions) {
|
|
11854
11939
|
onConfirm(values);
|
|
11855
11940
|
actions.resetForm();
|
|
@@ -12260,25 +12345,7 @@ var QuestionCateList = function QuestionCateList() {
|
|
|
12260
12345
|
var tabs$3 = [{
|
|
12261
12346
|
path: "/admin/question/question-list",
|
|
12262
12347
|
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
|
-
}
|
|
12348
|
+
component: QuestionBankList
|
|
12282
12349
|
}, {
|
|
12283
12350
|
path: "/admin/question/question-category",
|
|
12284
12351
|
title: "Question category",
|
|
@@ -12454,7 +12521,7 @@ var SemesterSelector = function SemesterSelector(_ref) {
|
|
|
12454
12521
|
}));
|
|
12455
12522
|
};
|
|
12456
12523
|
|
|
12457
|
-
var schema$
|
|
12524
|
+
var schema$e = object({
|
|
12458
12525
|
beginDate: string().required("Begin date is required"),
|
|
12459
12526
|
endDate: string().required("End date is required"),
|
|
12460
12527
|
timeSemester: string().required("Time Semester is required"),
|
|
@@ -12490,7 +12557,7 @@ var AssignmentDetailModal = function AssignmentDetailModal(props, ref) {
|
|
|
12490
12557
|
return React.createElement(Formik, {
|
|
12491
12558
|
initialValues: assignmentDetail,
|
|
12492
12559
|
enableReinitialize: true,
|
|
12493
|
-
validationSchema: schema$
|
|
12560
|
+
validationSchema: schema$e,
|
|
12494
12561
|
onSubmit: function onSubmit(values, actions) {
|
|
12495
12562
|
onConfirm(values);
|
|
12496
12563
|
actions.resetForm();
|
|
@@ -14178,7 +14245,7 @@ var SkillSelector$1 = function SkillSelector(_ref) {
|
|
|
14178
14245
|
});
|
|
14179
14246
|
};
|
|
14180
14247
|
|
|
14181
|
-
var schema$
|
|
14248
|
+
var schema$f = object({
|
|
14182
14249
|
name: string().required("Name is required"),
|
|
14183
14250
|
isConference: boolean().required("Is conference is required"),
|
|
14184
14251
|
conferenceRubricId: number().nullable().test("Test conference rubric id", "Conference rubric is required", function () {
|
|
@@ -14566,7 +14633,7 @@ var SessionTemplateDetail = function SessionTemplateDetail() {
|
|
|
14566
14633
|
return React.createElement(Formik, {
|
|
14567
14634
|
initialValues: sessionTemplateDetail,
|
|
14568
14635
|
enableReinitialize: true,
|
|
14569
|
-
validationSchema: schema$
|
|
14636
|
+
validationSchema: schema$f,
|
|
14570
14637
|
onSubmit: function onSubmit(values) {
|
|
14571
14638
|
confirmData(values);
|
|
14572
14639
|
setEdited(false);
|
|
@@ -15119,7 +15186,7 @@ var useSessionTemplateGeneralClassDetail = function useSessionTemplateGeneralCla
|
|
|
15119
15186
|
};
|
|
15120
15187
|
|
|
15121
15188
|
var LINK_TO_DEFAULT_QUESTION_GENERAL_CLASS = "/admin/question/default-question-general-list";
|
|
15122
|
-
var schema$
|
|
15189
|
+
var schema$g = object({
|
|
15123
15190
|
name: string().trim().required("Name is required"),
|
|
15124
15191
|
subjectId: number().required("Subject is required").test("Test subject", "Subject is required", function (value) {
|
|
15125
15192
|
return value > 0;
|
|
@@ -15203,7 +15270,7 @@ var SessionTemplateGeneralClassDetail = function SessionTemplateGeneralClassDeta
|
|
|
15203
15270
|
return React.createElement(Formik, {
|
|
15204
15271
|
initialValues: sessionTemplateGeneralClassDetail,
|
|
15205
15272
|
enableReinitialize: true,
|
|
15206
|
-
validationSchema: schema$
|
|
15273
|
+
validationSchema: schema$g,
|
|
15207
15274
|
onSubmit: function onSubmit(values) {
|
|
15208
15275
|
confirmData(values);
|
|
15209
15276
|
setEdited(false);
|
|
@@ -15410,7 +15477,7 @@ var SessionTemplateGeneralClassDetail = function SessionTemplateGeneralClassDeta
|
|
|
15410
15477
|
});
|
|
15411
15478
|
};
|
|
15412
15479
|
|
|
15413
|
-
var schema$
|
|
15480
|
+
var schema$h = object({
|
|
15414
15481
|
learningSupportCategoryId: number().test("testLearningSupportCategoryId", "Invalid category", function (number) {
|
|
15415
15482
|
return !!number && number >= 1;
|
|
15416
15483
|
}),
|
|
@@ -15440,7 +15507,7 @@ var CustomAlertDetailModal = function CustomAlertDetailModal(props, ref) {
|
|
|
15440
15507
|
return React.createElement(Formik, {
|
|
15441
15508
|
initialValues: customAlertDetail,
|
|
15442
15509
|
enableReinitialize: true,
|
|
15443
|
-
validationSchema: schema$
|
|
15510
|
+
validationSchema: schema$h,
|
|
15444
15511
|
onSubmit: function onSubmit(values, actions) {
|
|
15445
15512
|
onConfirm(values);
|
|
15446
15513
|
actions.resetForm();
|
|
@@ -16014,7 +16081,7 @@ var CustomAlertList = function CustomAlertList() {
|
|
|
16014
16081
|
|
|
16015
16082
|
var certificate = {"certificate-item":"_3DVMZ","add-breakpoint":"_3zOGW","box-item":"_3DQwX"};
|
|
16016
16083
|
|
|
16017
|
-
var schema$
|
|
16084
|
+
var schema$i = object({
|
|
16018
16085
|
name: string().required("Name is required"),
|
|
16019
16086
|
certificateItems: array().test("Text label required", "Text is required", function (value) {
|
|
16020
16087
|
return value === null || value === void 0 ? void 0 : value.every(function (item) {
|
|
@@ -16039,7 +16106,7 @@ var CertificateDetailModal = function CertificateDetailModal(props, ref) {
|
|
|
16039
16106
|
return React.createElement(Formik, {
|
|
16040
16107
|
initialValues: certificateDetail,
|
|
16041
16108
|
enableReinitialize: true,
|
|
16042
|
-
validationSchema: schema$
|
|
16109
|
+
validationSchema: schema$i,
|
|
16043
16110
|
onSubmit: function onSubmit(values, actions) {
|
|
16044
16111
|
var _values$certificateIt;
|
|
16045
16112
|
|
|
@@ -17328,6 +17395,7 @@ var HighImpact = function HighImpact(_ref) {
|
|
|
17328
17395
|
}, [data]);
|
|
17329
17396
|
if (!data) return React.createElement(Loading, null);
|
|
17330
17397
|
var series = [{
|
|
17398
|
+
name: "",
|
|
17331
17399
|
data: ratings
|
|
17332
17400
|
}];
|
|
17333
17401
|
var options = {
|
|
@@ -17521,7 +17589,10 @@ var Quantity = function Quantity(_ref) {
|
|
|
17521
17589
|
if (!data) return React.createElement(Loading, null);
|
|
17522
17590
|
var teacherPercentage = data.teacherPercentage,
|
|
17523
17591
|
studentPercentage = data.studentPercentage,
|
|
17524
|
-
assistantPercentage = data.assistantPercentage
|
|
17592
|
+
assistantPercentage = data.assistantPercentage,
|
|
17593
|
+
numberOfTeachers = data.numberOfTeachers,
|
|
17594
|
+
numberOfStudents = data.numberOfStudents,
|
|
17595
|
+
numberOfAssistants = data.numberOfAssistants;
|
|
17525
17596
|
var series = [teacherPercentage, studentPercentage, assistantPercentage].map(function (number) {
|
|
17526
17597
|
return Number(number.toFixed(2));
|
|
17527
17598
|
});
|
|
@@ -17547,15 +17618,15 @@ var Quantity = function Quantity(_ref) {
|
|
|
17547
17618
|
var details = [{
|
|
17548
17619
|
label: "Teachers",
|
|
17549
17620
|
color: colors$3[0],
|
|
17550
|
-
value:
|
|
17621
|
+
value: numberOfTeachers
|
|
17551
17622
|
}, {
|
|
17552
17623
|
label: "Students",
|
|
17553
17624
|
color: colors$3[1],
|
|
17554
|
-
value:
|
|
17625
|
+
value: numberOfStudents
|
|
17555
17626
|
}, {
|
|
17556
17627
|
label: "Assistants",
|
|
17557
17628
|
color: colors$3[2],
|
|
17558
|
-
value:
|
|
17629
|
+
value: numberOfAssistants
|
|
17559
17630
|
}];
|
|
17560
17631
|
return React.createElement("div", {
|
|
17561
17632
|
className: "d-flex h-100"
|
|
@@ -17569,8 +17640,6 @@ var Quantity = function Quantity(_ref) {
|
|
|
17569
17640
|
bordered: true,
|
|
17570
17641
|
size: "sm"
|
|
17571
17642
|
}, React.createElement("tbody", null, details.map(function (item) {
|
|
17572
|
-
var _item$value;
|
|
17573
|
-
|
|
17574
17643
|
return React.createElement("tr", {
|
|
17575
17644
|
key: item.label
|
|
17576
17645
|
}, React.createElement("td", null, item.label), React.createElement("td", {
|
|
@@ -17580,8 +17649,8 @@ var Quantity = function Quantity(_ref) {
|
|
|
17580
17649
|
style: {
|
|
17581
17650
|
backgroundColor: item.color
|
|
17582
17651
|
}
|
|
17583
|
-
})), React.createElement("td", null,
|
|
17584
|
-
}))))), React.createElement("div", {
|
|
17652
|
+
})), React.createElement("td", null, item.value));
|
|
17653
|
+
}))), React.createElement("p", null, "The number of user for each role"))), React.createElement("div", {
|
|
17585
17654
|
className: "d-flex align-items-end"
|
|
17586
17655
|
}, React.createElement(ReactApexChart, {
|
|
17587
17656
|
options: options,
|