mario-education 2.3.0 → 2.3.4
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/services/csvService.d.ts +2 -0
- package/dist/index.js +237 -76
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +237 -76
- package/dist/index.modern.js.map +1 -1
- package/package.json +91 -91
package/dist/MarioFramework.Education/ClientApp/src/containers/CSVImport/hooks/useCSVImport.d.ts
CHANGED
|
@@ -18,5 +18,13 @@ declare const useCSVImport: () => {
|
|
|
18
18
|
id: string;
|
|
19
19
|
setType: import("react").Dispatch<import("react").SetStateAction<CSVType | null>>;
|
|
20
20
|
upload: (file: any) => Promise<void>;
|
|
21
|
+
initImportReflection: any;
|
|
22
|
+
setInitImportReflection: import("react").Dispatch<any>;
|
|
23
|
+
onConfirm: (values: any) => Promise<void>;
|
|
24
|
+
CSVType: typeof CSVType;
|
|
25
|
+
dataFile: any;
|
|
26
|
+
setDataFile: import("react").Dispatch<any>;
|
|
27
|
+
setArrStudent: import("react").Dispatch<any>;
|
|
28
|
+
arrStudent: any;
|
|
21
29
|
};
|
|
22
30
|
export default useCSVImport;
|
|
@@ -1 +1,3 @@
|
|
|
1
1
|
export declare const importCSV: (formData: FormData, subFolder: string) => Promise<import("axios").AxiosResponse<any>>;
|
|
2
|
+
export declare const importStudentCSV: (formData: FormData) => Promise<import("axios").AxiosResponse<any>>;
|
|
3
|
+
export declare const importClassReflectionCSV: (formData: FormData) => Promise<import("axios").AxiosResponse<any>>;
|
package/dist/index.js
CHANGED
|
@@ -153,9 +153,6 @@ var StudentSelector = function StudentSelector(_ref) {
|
|
|
153
153
|
id: student.id
|
|
154
154
|
};
|
|
155
155
|
});
|
|
156
|
-
console.log("teacher assignment");
|
|
157
|
-
console.log(options);
|
|
158
|
-
console.log(value);
|
|
159
156
|
return React__default.createElement(marioCore.CustomSelector, {
|
|
160
157
|
options: options,
|
|
161
158
|
inputValue: searchString,
|
|
@@ -5178,7 +5175,6 @@ var LearningSupportCategoryList = function LearningSupportCategoryList() {
|
|
|
5178
5175
|
|
|
5179
5176
|
var style = {
|
|
5180
5177
|
padding: "4px 8px",
|
|
5181
|
-
marginRight: 16,
|
|
5182
5178
|
marginBottom: 0,
|
|
5183
5179
|
borderRadius: "2px",
|
|
5184
5180
|
color: "#fff",
|
|
@@ -5192,12 +5188,13 @@ var UploadCSVButton = function UploadCSVButton(_ref) {
|
|
|
5192
5188
|
isDisabled = _ref.isDisabled,
|
|
5193
5189
|
text = _ref.text,
|
|
5194
5190
|
backgroundColor = _ref.backgroundColor,
|
|
5195
|
-
_onClick = _ref.onClick
|
|
5191
|
+
_onClick = _ref.onClick,
|
|
5192
|
+
isClassReflection = _ref.isClassReflection;
|
|
5196
5193
|
return React__default.createElement(reactstrap.Label, {
|
|
5197
5194
|
htmlFor: htmlFor,
|
|
5198
5195
|
role: "button",
|
|
5199
5196
|
tabIndex: 0,
|
|
5200
|
-
className: "d-flex align-items-center justfy-content-center " + (!isDisabled ? "cursor-pointer hover-opacity" : ""),
|
|
5197
|
+
className: "d-flex align-items-center justfy-content-center \n " + (isClassReflection ? "w-25" : "") + "\n " + (!isDisabled ? "cursor-pointer hover-opacity" : ""),
|
|
5201
5198
|
style: _extends({}, style, {
|
|
5202
5199
|
backgroundColor: backgroundColor,
|
|
5203
5200
|
opacity: !isDisabled ? 1 : 0.5
|
|
@@ -5212,8 +5209,12 @@ var UploadCSVButton = function UploadCSVButton(_ref) {
|
|
|
5212
5209
|
};
|
|
5213
5210
|
|
|
5214
5211
|
var CSV_FILE_URL = marioCore.BASE_URL + "/api/ImportCsv/csv";
|
|
5215
|
-
var
|
|
5216
|
-
|
|
5212
|
+
var CSV_FILE_TEACHER = marioCore.BASE_URL + "/api/Teacher";
|
|
5213
|
+
var importStudentCSV = function importStudentCSV(formData) {
|
|
5214
|
+
return marioCore.apiUpload.post(CSV_FILE_TEACHER + "/adminImportStudent", formData);
|
|
5215
|
+
};
|
|
5216
|
+
var importClassReflectionCSV = function importClassReflectionCSV(formData) {
|
|
5217
|
+
return marioCore.apiUpload.post(CSV_FILE_URL + "/importClassReflection", formData);
|
|
5217
5218
|
};
|
|
5218
5219
|
|
|
5219
5220
|
var CSVType;
|
|
@@ -5228,28 +5229,18 @@ var CSVType;
|
|
|
5228
5229
|
})(CSVType || (CSVType = {}));
|
|
5229
5230
|
|
|
5230
5231
|
var buttons = [{
|
|
5231
|
-
text: "Import
|
|
5232
|
-
backgroundColor: "#
|
|
5233
|
-
type: CSVType.
|
|
5234
|
-
}, {
|
|
5235
|
-
text: "Import grades",
|
|
5236
|
-
backgroundColor: "#54a0ff",
|
|
5237
|
-
type: CSVType.Grades
|
|
5238
|
-
}, {
|
|
5239
|
-
text: "Import attendances",
|
|
5240
|
-
backgroundColor: "#feca57",
|
|
5241
|
-
type: CSVType.Attendances
|
|
5242
|
-
}, {
|
|
5243
|
-
text: "Import class reflections",
|
|
5244
|
-
backgroundColor: "#e74c3c",
|
|
5245
|
-
type: CSVType.ClassReflection
|
|
5246
|
-
}, {
|
|
5247
|
-
text: "Import others",
|
|
5248
|
-
backgroundColor: "#8395a7",
|
|
5249
|
-
type: CSVType.Others
|
|
5232
|
+
text: "Import students",
|
|
5233
|
+
backgroundColor: "#0abde3",
|
|
5234
|
+
type: CSVType.Students
|
|
5250
5235
|
}];
|
|
5251
5236
|
var title = "CSV Import";
|
|
5252
5237
|
var id = "csvupload";
|
|
5238
|
+
var initClassReflect = {
|
|
5239
|
+
teacherName: '',
|
|
5240
|
+
teacherEmail: '',
|
|
5241
|
+
studentIds: [],
|
|
5242
|
+
file: ''
|
|
5243
|
+
};
|
|
5253
5244
|
|
|
5254
5245
|
var useCSVImport = function useCSVImport() {
|
|
5255
5246
|
var dispatch = reactRedux.useDispatch();
|
|
@@ -5261,58 +5252,157 @@ var useCSVImport = function useCSVImport() {
|
|
|
5261
5252
|
type = _useState[0],
|
|
5262
5253
|
setType = _useState[1];
|
|
5263
5254
|
|
|
5255
|
+
var _useState2 = React.useState(),
|
|
5256
|
+
dataFile = _useState2[0],
|
|
5257
|
+
setDataFile = _useState2[1];
|
|
5258
|
+
|
|
5259
|
+
var _useState3 = React.useState([]),
|
|
5260
|
+
arrStudent = _useState3[0],
|
|
5261
|
+
setArrStudent = _useState3[1];
|
|
5262
|
+
|
|
5263
|
+
var _useState4 = React.useState(initClassReflect),
|
|
5264
|
+
initImportReflection = _useState4[0],
|
|
5265
|
+
setInitImportReflection = _useState4[1];
|
|
5266
|
+
|
|
5264
5267
|
React.useEffect(function () {
|
|
5265
5268
|
document.title = title;
|
|
5266
5269
|
}, []);
|
|
5267
5270
|
var upload = React.useCallback(function (file) {
|
|
5268
5271
|
try {
|
|
5269
|
-
var
|
|
5272
|
+
var _temp7 = function _temp7() {
|
|
5270
5273
|
dispatch(marioCore.setLoading(false));
|
|
5271
|
-
var input = document.getElementById(
|
|
5274
|
+
var input = document.getElementById('import-student');
|
|
5275
|
+
var importClass = document.getElementById('import-classReflection');
|
|
5272
5276
|
input && (input.value = "");
|
|
5277
|
+
importClass && (importClass.value = "");
|
|
5273
5278
|
};
|
|
5274
5279
|
|
|
5275
5280
|
if (!type || !file) return Promise.resolve();
|
|
5276
5281
|
dispatch(marioCore.setLoading(true));
|
|
5277
5282
|
|
|
5278
|
-
var
|
|
5283
|
+
var _temp8 = _catch(function () {
|
|
5284
|
+
function _temp4() {
|
|
5285
|
+
function _temp2() {
|
|
5286
|
+
dispatch(marioCore.setAlert({
|
|
5287
|
+
type: "success",
|
|
5288
|
+
message: "Import CSV successfully"
|
|
5289
|
+
}));
|
|
5290
|
+
}
|
|
5291
|
+
|
|
5292
|
+
var _temp = function () {
|
|
5293
|
+
if (type == CSVType.ClassReflection) {
|
|
5294
|
+
return Promise.resolve(importClassReflectionCSV(formData)).then(function () {});
|
|
5295
|
+
}
|
|
5296
|
+
}();
|
|
5297
|
+
|
|
5298
|
+
return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
|
|
5299
|
+
}
|
|
5300
|
+
|
|
5279
5301
|
var formData = new FormData();
|
|
5280
5302
|
formData.append("file", file, file.name);
|
|
5281
|
-
|
|
5303
|
+
|
|
5304
|
+
var _temp3 = function () {
|
|
5305
|
+
if (type == CSVType.Students) {
|
|
5306
|
+
return Promise.resolve(importStudentCSV(formData)).then(function () {});
|
|
5307
|
+
}
|
|
5308
|
+
}();
|
|
5309
|
+
|
|
5310
|
+
return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
|
|
5311
|
+
}, function (err) {
|
|
5312
|
+
var _err$response, _err$response$data;
|
|
5313
|
+
|
|
5314
|
+
dispatch(marioCore.setAlert({
|
|
5315
|
+
type: "danger",
|
|
5316
|
+
message: ((_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : _err$response$data.title) || err.message
|
|
5317
|
+
}));
|
|
5318
|
+
});
|
|
5319
|
+
|
|
5320
|
+
return Promise.resolve(_temp8 && _temp8.then ? _temp8.then(_temp7) : _temp7(_temp8));
|
|
5321
|
+
} catch (e) {
|
|
5322
|
+
return Promise.reject(e);
|
|
5323
|
+
}
|
|
5324
|
+
}, [type]);
|
|
5325
|
+
|
|
5326
|
+
var onConfirm = function onConfirm(values) {
|
|
5327
|
+
try {
|
|
5328
|
+
var _temp11 = function _temp11() {
|
|
5329
|
+
dispatch(marioCore.setLoading(false));
|
|
5330
|
+
var input = document.getElementById(id);
|
|
5331
|
+
input && (input.value = "");
|
|
5332
|
+
};
|
|
5333
|
+
|
|
5334
|
+
if (!dataFile || !dataFile) return Promise.resolve();
|
|
5335
|
+
dispatch(marioCore.setLoading(true));
|
|
5336
|
+
|
|
5337
|
+
var _temp12 = _catch(function () {
|
|
5338
|
+
var formData = new FormData();
|
|
5339
|
+
formData.append("file", dataFile, dataFile.name);
|
|
5340
|
+
formData.append("teacherName", values.teacherName);
|
|
5341
|
+
formData.append("teacherEmail", values.teacherEmail);
|
|
5342
|
+
values.studentIds.forEach(function (item) {
|
|
5343
|
+
formData.append("studentIds", item);
|
|
5344
|
+
});
|
|
5345
|
+
return Promise.resolve(importClassReflectionCSV(formData)).then(function () {
|
|
5282
5346
|
dispatch(marioCore.setAlert({
|
|
5283
5347
|
type: "success",
|
|
5284
5348
|
message: "Import CSV successfully"
|
|
5285
5349
|
}));
|
|
5350
|
+
setInitImportReflection(initClassReflect);
|
|
5286
5351
|
});
|
|
5287
5352
|
}, function (err) {
|
|
5288
|
-
var _err$
|
|
5353
|
+
var _err$response2, _err$response2$data;
|
|
5289
5354
|
|
|
5290
5355
|
dispatch(marioCore.setAlert({
|
|
5291
5356
|
type: "danger",
|
|
5292
|
-
message: ((_err$
|
|
5357
|
+
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
|
|
5293
5358
|
}));
|
|
5294
5359
|
});
|
|
5295
5360
|
|
|
5296
|
-
return Promise.resolve(
|
|
5361
|
+
return Promise.resolve(_temp12 && _temp12.then ? _temp12.then(_temp11) : _temp11(_temp12));
|
|
5297
5362
|
} catch (e) {
|
|
5298
5363
|
return Promise.reject(e);
|
|
5299
5364
|
}
|
|
5300
|
-
}
|
|
5365
|
+
};
|
|
5366
|
+
|
|
5301
5367
|
return {
|
|
5302
5368
|
isLoading: isLoading,
|
|
5303
5369
|
buttons: buttons,
|
|
5304
5370
|
id: id,
|
|
5305
5371
|
setType: setType,
|
|
5306
|
-
upload: upload
|
|
5372
|
+
upload: upload,
|
|
5373
|
+
initImportReflection: initImportReflection,
|
|
5374
|
+
setInitImportReflection: setInitImportReflection,
|
|
5375
|
+
onConfirm: onConfirm,
|
|
5376
|
+
CSVType: CSVType,
|
|
5377
|
+
dataFile: dataFile,
|
|
5378
|
+
setDataFile: setDataFile,
|
|
5379
|
+
setArrStudent: setArrStudent,
|
|
5380
|
+
arrStudent: arrStudent
|
|
5307
5381
|
};
|
|
5308
5382
|
};
|
|
5309
5383
|
|
|
5384
|
+
var _yup$string, _yup$string2, _yup$string3;
|
|
5385
|
+
var schema$4 = yup.object({
|
|
5386
|
+
teacherName: (_yup$string = yup.string()) === null || _yup$string === void 0 ? void 0 : _yup$string.trim().required(),
|
|
5387
|
+
teacherEmail: (_yup$string2 = yup.string()) === null || _yup$string2 === void 0 ? void 0 : _yup$string2.trim().email('Invalid email').required(),
|
|
5388
|
+
studentIds: yup.array().required().test("test students", "Please choose student", function () {
|
|
5389
|
+
return !!this.parent.studentIds && !!this.parent.studentIds.length;
|
|
5390
|
+
}),
|
|
5391
|
+
file: (_yup$string3 = yup.string()) === null || _yup$string3 === void 0 ? void 0 : _yup$string3.trim().required()
|
|
5392
|
+
});
|
|
5393
|
+
|
|
5310
5394
|
var CSVImport = function CSVImport() {
|
|
5311
5395
|
var _useCSVImport = useCSVImport(),
|
|
5396
|
+
initImportReflection = _useCSVImport.initImportReflection,
|
|
5397
|
+
onConfirm = _useCSVImport.onConfirm,
|
|
5312
5398
|
isLoading = _useCSVImport.isLoading,
|
|
5313
|
-
buttons = _useCSVImport.buttons,
|
|
5314
|
-
id = _useCSVImport.id,
|
|
5315
5399
|
setType = _useCSVImport.setType,
|
|
5400
|
+
id = _useCSVImport.id,
|
|
5401
|
+
CSVType = _useCSVImport.CSVType,
|
|
5402
|
+
dataFile = _useCSVImport.dataFile,
|
|
5403
|
+
setDataFile = _useCSVImport.setDataFile,
|
|
5404
|
+
setArrStudent = _useCSVImport.setArrStudent,
|
|
5405
|
+
buttons = _useCSVImport.buttons,
|
|
5316
5406
|
upload = _useCSVImport.upload;
|
|
5317
5407
|
|
|
5318
5408
|
return React__default.createElement("div", {
|
|
@@ -5320,28 +5410,99 @@ var CSVImport = function CSVImport() {
|
|
|
5320
5410
|
}, React__default.createElement(reactstrap.Input, {
|
|
5321
5411
|
className: "d-none",
|
|
5322
5412
|
type: "file",
|
|
5323
|
-
id:
|
|
5413
|
+
id: "import-student",
|
|
5414
|
+
onChange: function onChange(e) {
|
|
5415
|
+
return upload(e.target.files[0]);
|
|
5416
|
+
},
|
|
5417
|
+
accept: "text/csv"
|
|
5418
|
+
}), React__default.createElement(reactstrap.Input, {
|
|
5419
|
+
className: "d-none",
|
|
5420
|
+
type: "file",
|
|
5421
|
+
id: "import-classReflection",
|
|
5324
5422
|
onChange: function onChange(e) {
|
|
5325
5423
|
return upload(e.target.files[0]);
|
|
5326
5424
|
},
|
|
5327
5425
|
accept: "text/csv"
|
|
5328
5426
|
}), React__default.createElement("div", {
|
|
5329
|
-
className: "
|
|
5330
|
-
},
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5427
|
+
className: "class-reflection"
|
|
5428
|
+
}, React__default.createElement(formik.Formik, {
|
|
5429
|
+
initialValues: initImportReflection,
|
|
5430
|
+
enableReinitialize: true,
|
|
5431
|
+
validationSchema: schema$4,
|
|
5432
|
+
onSubmit: function onSubmit(values, actions) {
|
|
5433
|
+
onConfirm(values);
|
|
5434
|
+
setDataFile('');
|
|
5435
|
+
setArrStudent([]);
|
|
5436
|
+
actions.resetForm();
|
|
5437
|
+
}
|
|
5438
|
+
}, function (formProps) {
|
|
5439
|
+
var touched = formProps.touched,
|
|
5440
|
+
errors = formProps.errors;
|
|
5441
|
+
return React__default.createElement(reactstrap.Row, {
|
|
5442
|
+
className: "mb-2"
|
|
5443
|
+
}, React__default.createElement(reactstrap.Input, {
|
|
5444
|
+
className: "d-none",
|
|
5445
|
+
type: "file",
|
|
5446
|
+
id: id,
|
|
5447
|
+
onChange: function onChange(e) {
|
|
5448
|
+
setDataFile(e.target.files[0]);
|
|
5449
|
+
formProps.setFieldValue('file', 'imported');
|
|
5450
|
+
var input = document.getElementById(id);
|
|
5451
|
+
input && (input.value = "");
|
|
5452
|
+
},
|
|
5453
|
+
accept: "text/csv"
|
|
5454
|
+
}), React__default.createElement(reactstrap.Col, {
|
|
5455
|
+
md: 6,
|
|
5456
|
+
className: "mb-2"
|
|
5457
|
+
}, React__default.createElement(reactstrap.Row, null, React__default.createElement(reactstrap.Col, {
|
|
5458
|
+
md: 12,
|
|
5459
|
+
className: "mb-2"
|
|
5460
|
+
}, React__default.createElement(marioCore.RequiredLabel, {
|
|
5461
|
+
text: "Import Class Reflection"
|
|
5462
|
+
}), React__default.createElement(UploadCSVButton, {
|
|
5463
|
+
key: "Import class reflections",
|
|
5464
|
+
htmlFor: "import-classReflection",
|
|
5465
|
+
text: "Import Class Reflection",
|
|
5335
5466
|
isDisabled: isLoading,
|
|
5336
|
-
backgroundColor:
|
|
5467
|
+
backgroundColor: "#e74c3c",
|
|
5337
5468
|
onClick: function onClick() {
|
|
5338
|
-
|
|
5469
|
+
setType(CSVType.ClassReflection);
|
|
5339
5470
|
}
|
|
5340
|
-
})
|
|
5471
|
+
}), !!dataFile && React__default.createElement("p", {
|
|
5472
|
+
style: {
|
|
5473
|
+
color: '#007bff',
|
|
5474
|
+
fontStyle: 'italic',
|
|
5475
|
+
marginTop: '5px'
|
|
5476
|
+
}
|
|
5477
|
+
}, dataFile.name)), !dataFile && React__default.createElement(reactstrap.Col, {
|
|
5478
|
+
md: 12,
|
|
5479
|
+
className: "mb-2"
|
|
5480
|
+
}, touched.file && errors.file && React__default.createElement(marioCore.ErrorHandler, {
|
|
5481
|
+
text: errors.file
|
|
5482
|
+
})))), React__default.createElement(reactstrap.Col, {
|
|
5483
|
+
md: 6,
|
|
5484
|
+
className: "mb-2"
|
|
5485
|
+
}, React__default.createElement(reactstrap.Row, null, React__default.createElement(reactstrap.Col, {
|
|
5486
|
+
md: 12,
|
|
5487
|
+
className: "mb-2"
|
|
5488
|
+
}, React__default.createElement(marioCore.RequiredLabel, {
|
|
5489
|
+
text: "Import student"
|
|
5490
|
+
}), buttons.map(function (button) {
|
|
5491
|
+
return React__default.createElement(UploadCSVButton, {
|
|
5492
|
+
key: button.text,
|
|
5493
|
+
htmlFor: 'import-student',
|
|
5494
|
+
text: button.text,
|
|
5495
|
+
isDisabled: isLoading,
|
|
5496
|
+
backgroundColor: button.backgroundColor,
|
|
5497
|
+
onClick: function onClick() {
|
|
5498
|
+
return setType(button.type);
|
|
5499
|
+
}
|
|
5500
|
+
});
|
|
5501
|
+
})))));
|
|
5341
5502
|
})));
|
|
5342
5503
|
};
|
|
5343
5504
|
|
|
5344
|
-
var schema$
|
|
5505
|
+
var schema$5 = yup.object({
|
|
5345
5506
|
name: yup.string().required("Name is required"),
|
|
5346
5507
|
startTime: yup.string().required("Start time is required"),
|
|
5347
5508
|
endTime: yup.string().required("End time is required")
|
|
@@ -5360,7 +5521,7 @@ var SemesterDetailModal = function SemesterDetailModal(props, ref) {
|
|
|
5360
5521
|
return React__default.createElement(formik.Formik, {
|
|
5361
5522
|
initialValues: semesterDetail,
|
|
5362
5523
|
enableReinitialize: true,
|
|
5363
|
-
validationSchema: schema$
|
|
5524
|
+
validationSchema: schema$5,
|
|
5364
5525
|
onSubmit: function onSubmit(values, actions) {
|
|
5365
5526
|
onConfirm(values);
|
|
5366
5527
|
actions.resetForm();
|
|
@@ -5471,7 +5632,7 @@ var SemesterDetailModal = function SemesterDetailModal(props, ref) {
|
|
|
5471
5632
|
|
|
5472
5633
|
var SemesterDetailModal$1 = React.forwardRef(SemesterDetailModal);
|
|
5473
5634
|
|
|
5474
|
-
var schema$
|
|
5635
|
+
var schema$6 = yup.object({
|
|
5475
5636
|
value: yup.number().required("Breaking month is required")
|
|
5476
5637
|
});
|
|
5477
5638
|
var options = [{
|
|
@@ -5524,7 +5685,7 @@ var BreakingMonthModal = function BreakingMonthModal(props, ref) {
|
|
|
5524
5685
|
return React__default.createElement(formik.Formik, {
|
|
5525
5686
|
initialValues: breakingMonthDetail,
|
|
5526
5687
|
enableReinitialize: true,
|
|
5527
|
-
validationSchema: schema$
|
|
5688
|
+
validationSchema: schema$6,
|
|
5528
5689
|
onSubmit: function onSubmit(values, actions) {
|
|
5529
5690
|
onConfirm(values);
|
|
5530
5691
|
actions.resetForm();
|
|
@@ -6102,7 +6263,7 @@ var SemesterList = function SemesterList() {
|
|
|
6102
6263
|
}, "Change breaking month"))))));
|
|
6103
6264
|
};
|
|
6104
6265
|
|
|
6105
|
-
var schema$
|
|
6266
|
+
var schema$7 = yup.object({
|
|
6106
6267
|
label: yup.string().required("Label is required"),
|
|
6107
6268
|
value: yup.number().required("Value is required")
|
|
6108
6269
|
});
|
|
@@ -6120,7 +6281,7 @@ var BandScoreDetailModal = function BandScoreDetailModal(props, ref) {
|
|
|
6120
6281
|
return React__default.createElement(formik.Formik, {
|
|
6121
6282
|
initialValues: bandScoreDetail,
|
|
6122
6283
|
enableReinitialize: true,
|
|
6123
|
-
validationSchema: schema$
|
|
6284
|
+
validationSchema: schema$7,
|
|
6124
6285
|
onSubmit: function onSubmit(values, actions) {
|
|
6125
6286
|
onConfirm(values);
|
|
6126
6287
|
actions.resetForm();
|
|
@@ -6789,7 +6950,7 @@ var CurrentLicense = function CurrentLicense() {
|
|
|
6789
6950
|
}))));
|
|
6790
6951
|
};
|
|
6791
6952
|
|
|
6792
|
-
var schema$
|
|
6953
|
+
var schema$8 = yup.object({
|
|
6793
6954
|
name: yup.string().required("Name is required"),
|
|
6794
6955
|
startTime: yup.string().required("Start time is required"),
|
|
6795
6956
|
endTime: yup.string().required("End time is required")
|
|
@@ -6808,7 +6969,7 @@ var SchoolBlankDayDetailModal = function SchoolBlankDayDetailModal(props, ref) {
|
|
|
6808
6969
|
return React__default.createElement(formik.Formik, {
|
|
6809
6970
|
initialValues: schoolBlankDayDetail,
|
|
6810
6971
|
enableReinitialize: true,
|
|
6811
|
-
validationSchema: schema$
|
|
6972
|
+
validationSchema: schema$8,
|
|
6812
6973
|
onSubmit: function onSubmit(values, actions) {
|
|
6813
6974
|
onConfirm(values);
|
|
6814
6975
|
actions.resetForm();
|
|
@@ -8338,7 +8499,7 @@ var QuestionSplitPaneSelector = function QuestionSplitPaneSelector(props) {
|
|
|
8338
8499
|
}, " ", "v", " ")) : "");
|
|
8339
8500
|
};
|
|
8340
8501
|
|
|
8341
|
-
var schema$
|
|
8502
|
+
var schema$9 = yup.object({
|
|
8342
8503
|
name: yup.string().required("Name is required")
|
|
8343
8504
|
});
|
|
8344
8505
|
|
|
@@ -8364,7 +8525,7 @@ var ReflectionDetailModal = function ReflectionDetailModal(props, ref) {
|
|
|
8364
8525
|
return React__default.createElement(formik.Formik, {
|
|
8365
8526
|
initialValues: reflectionformDetail,
|
|
8366
8527
|
enableReinitialize: true,
|
|
8367
|
-
validationSchema: schema$
|
|
8528
|
+
validationSchema: schema$9,
|
|
8368
8529
|
onSubmit: function onSubmit(values, actions) {
|
|
8369
8530
|
values.questionIds = arrId;
|
|
8370
8531
|
onConfirm(values);
|
|
@@ -9745,7 +9906,7 @@ var AdditionalComponent = function AdditionalComponent(_ref) {
|
|
|
9745
9906
|
return null;
|
|
9746
9907
|
};
|
|
9747
9908
|
|
|
9748
|
-
var schema$
|
|
9909
|
+
var schema$a = yup.object({
|
|
9749
9910
|
text: yup.string().required("Question text is required"),
|
|
9750
9911
|
type: yup.string().required("Question type is required"),
|
|
9751
9912
|
categoryId: yup.number().test("test category id", "Category is required", function (value) {
|
|
@@ -9998,7 +10159,7 @@ var QuestionDetail = function QuestionDetail() {
|
|
|
9998
10159
|
return React__default.createElement(formik.Formik, {
|
|
9999
10160
|
initialValues: questionDetail,
|
|
10000
10161
|
enableReinitialize: true,
|
|
10001
|
-
validationSchema: schema$
|
|
10162
|
+
validationSchema: schema$a,
|
|
10002
10163
|
onSubmit: function onSubmit(values) {
|
|
10003
10164
|
if (values.type == marioCore.QUESTION_TYPES.EMOTIONAL && !!values.answers) {
|
|
10004
10165
|
for (var index in values.answers) {
|
|
@@ -10264,7 +10425,7 @@ var QuestionSplitPaneSelector$1 = function QuestionSplitPaneSelector(props) {
|
|
|
10264
10425
|
}, " ", "v", " ")) : "");
|
|
10265
10426
|
};
|
|
10266
10427
|
|
|
10267
|
-
var schema$
|
|
10428
|
+
var schema$b = yup.object({
|
|
10268
10429
|
name: yup.string().required("Name is required")
|
|
10269
10430
|
});
|
|
10270
10431
|
|
|
@@ -10290,7 +10451,7 @@ var AssessmentDetailModal = function AssessmentDetailModal(props, ref) {
|
|
|
10290
10451
|
return React__default.createElement(formik.Formik, {
|
|
10291
10452
|
initialValues: assessmentDetail,
|
|
10292
10453
|
enableReinitialize: true,
|
|
10293
|
-
validationSchema: schema$
|
|
10454
|
+
validationSchema: schema$b,
|
|
10294
10455
|
onSubmit: function onSubmit(values, actions) {
|
|
10295
10456
|
values.questionIds = arrId;
|
|
10296
10457
|
onConfirm(values);
|
|
@@ -11232,7 +11393,7 @@ var FeedbackList = function FeedbackList() {
|
|
|
11232
11393
|
}))));
|
|
11233
11394
|
};
|
|
11234
11395
|
|
|
11235
|
-
var schema$
|
|
11396
|
+
var schema$c = yup.object({
|
|
11236
11397
|
name: yup.string().required("Name is required")
|
|
11237
11398
|
});
|
|
11238
11399
|
|
|
@@ -11252,7 +11413,7 @@ var TutorialScreenDetailModal = function TutorialScreenDetailModal(props, ref) {
|
|
|
11252
11413
|
typeRole: typeRole
|
|
11253
11414
|
}),
|
|
11254
11415
|
enableReinitialize: true,
|
|
11255
|
-
validationSchema: schema$
|
|
11416
|
+
validationSchema: schema$c,
|
|
11256
11417
|
onSubmit: function onSubmit(values, actions) {
|
|
11257
11418
|
onConfirm(values);
|
|
11258
11419
|
actions.resetForm();
|
|
@@ -11732,7 +11893,7 @@ var TutorialScreenContainer = function TutorialScreenContainer() {
|
|
|
11732
11893
|
});
|
|
11733
11894
|
};
|
|
11734
11895
|
|
|
11735
|
-
var schema$
|
|
11896
|
+
var schema$d = yup.object({
|
|
11736
11897
|
name: yup.string().required("Name is required")
|
|
11737
11898
|
});
|
|
11738
11899
|
|
|
@@ -11749,7 +11910,7 @@ var QuestionCateModal = function QuestionCateModal(props, ref) {
|
|
|
11749
11910
|
return React__default.createElement(formik.Formik, {
|
|
11750
11911
|
initialValues: questionCateDetail,
|
|
11751
11912
|
enableReinitialize: true,
|
|
11752
|
-
validationSchema: schema$
|
|
11913
|
+
validationSchema: schema$d,
|
|
11753
11914
|
onSubmit: function onSubmit(values, actions) {
|
|
11754
11915
|
onConfirm(values);
|
|
11755
11916
|
actions.resetForm();
|
|
@@ -12336,7 +12497,7 @@ var SemesterSelector = function SemesterSelector(_ref) {
|
|
|
12336
12497
|
}));
|
|
12337
12498
|
};
|
|
12338
12499
|
|
|
12339
|
-
var schema$
|
|
12500
|
+
var schema$e = yup.object({
|
|
12340
12501
|
beginDate: yup.string().required("Begin date is required"),
|
|
12341
12502
|
endDate: yup.string().required("End date is required"),
|
|
12342
12503
|
timeSemester: yup.string().required("Time Semester is required"),
|
|
@@ -12372,7 +12533,7 @@ var AssignmentDetailModal = function AssignmentDetailModal(props, ref) {
|
|
|
12372
12533
|
return React__default.createElement(formik.Formik, {
|
|
12373
12534
|
initialValues: assignmentDetail,
|
|
12374
12535
|
enableReinitialize: true,
|
|
12375
|
-
validationSchema: schema$
|
|
12536
|
+
validationSchema: schema$e,
|
|
12376
12537
|
onSubmit: function onSubmit(values, actions) {
|
|
12377
12538
|
onConfirm(values);
|
|
12378
12539
|
actions.resetForm();
|
|
@@ -14060,7 +14221,7 @@ var SkillSelector$1 = function SkillSelector(_ref) {
|
|
|
14060
14221
|
});
|
|
14061
14222
|
};
|
|
14062
14223
|
|
|
14063
|
-
var schema$
|
|
14224
|
+
var schema$f = yup.object({
|
|
14064
14225
|
name: yup.string().required("Name is required"),
|
|
14065
14226
|
isConference: yup.boolean().required("Is conference is required"),
|
|
14066
14227
|
conferenceRubricId: yup.number().nullable().test("Test conference rubric id", "Conference rubric is required", function () {
|
|
@@ -14448,7 +14609,7 @@ var SessionTemplateDetail = function SessionTemplateDetail() {
|
|
|
14448
14609
|
return React__default.createElement(formik.Formik, {
|
|
14449
14610
|
initialValues: sessionTemplateDetail,
|
|
14450
14611
|
enableReinitialize: true,
|
|
14451
|
-
validationSchema: schema$
|
|
14612
|
+
validationSchema: schema$f,
|
|
14452
14613
|
onSubmit: function onSubmit(values) {
|
|
14453
14614
|
confirmData(values);
|
|
14454
14615
|
setEdited(false);
|
|
@@ -15001,7 +15162,7 @@ var useSessionTemplateGeneralClassDetail = function useSessionTemplateGeneralCla
|
|
|
15001
15162
|
};
|
|
15002
15163
|
|
|
15003
15164
|
var LINK_TO_DEFAULT_QUESTION_GENERAL_CLASS = "/admin/question/default-question-general-list";
|
|
15004
|
-
var schema$
|
|
15165
|
+
var schema$g = yup.object({
|
|
15005
15166
|
name: yup.string().trim().required("Name is required"),
|
|
15006
15167
|
subjectId: yup.number().required("Subject is required").test("Test subject", "Subject is required", function (value) {
|
|
15007
15168
|
return value > 0;
|
|
@@ -15085,7 +15246,7 @@ var SessionTemplateGeneralClassDetail = function SessionTemplateGeneralClassDeta
|
|
|
15085
15246
|
return React__default.createElement(formik.Formik, {
|
|
15086
15247
|
initialValues: sessionTemplateGeneralClassDetail,
|
|
15087
15248
|
enableReinitialize: true,
|
|
15088
|
-
validationSchema: schema$
|
|
15249
|
+
validationSchema: schema$g,
|
|
15089
15250
|
onSubmit: function onSubmit(values) {
|
|
15090
15251
|
confirmData(values);
|
|
15091
15252
|
setEdited(false);
|
|
@@ -15292,7 +15453,7 @@ var SessionTemplateGeneralClassDetail = function SessionTemplateGeneralClassDeta
|
|
|
15292
15453
|
});
|
|
15293
15454
|
};
|
|
15294
15455
|
|
|
15295
|
-
var schema$
|
|
15456
|
+
var schema$h = yup.object({
|
|
15296
15457
|
learningSupportCategoryId: yup.number().test("testLearningSupportCategoryId", "Invalid category", function (number) {
|
|
15297
15458
|
return !!number && number >= 1;
|
|
15298
15459
|
}),
|
|
@@ -15322,7 +15483,7 @@ var CustomAlertDetailModal = function CustomAlertDetailModal(props, ref) {
|
|
|
15322
15483
|
return React__default.createElement(formik.Formik, {
|
|
15323
15484
|
initialValues: customAlertDetail,
|
|
15324
15485
|
enableReinitialize: true,
|
|
15325
|
-
validationSchema: schema$
|
|
15486
|
+
validationSchema: schema$h,
|
|
15326
15487
|
onSubmit: function onSubmit(values, actions) {
|
|
15327
15488
|
onConfirm(values);
|
|
15328
15489
|
actions.resetForm();
|
|
@@ -15896,7 +16057,7 @@ var CustomAlertList = function CustomAlertList() {
|
|
|
15896
16057
|
|
|
15897
16058
|
var certificate = {"certificate-item":"_3DVMZ","add-breakpoint":"_3zOGW","box-item":"_3DQwX"};
|
|
15898
16059
|
|
|
15899
|
-
var schema$
|
|
16060
|
+
var schema$i = yup.object({
|
|
15900
16061
|
name: yup.string().required("Name is required"),
|
|
15901
16062
|
certificateItems: yup.array().test("Text label required", "Text is required", function (value) {
|
|
15902
16063
|
return value === null || value === void 0 ? void 0 : value.every(function (item) {
|
|
@@ -15921,7 +16082,7 @@ var CertificateDetailModal = function CertificateDetailModal(props, ref) {
|
|
|
15921
16082
|
return React__default.createElement(formik.Formik, {
|
|
15922
16083
|
initialValues: certificateDetail,
|
|
15923
16084
|
enableReinitialize: true,
|
|
15924
|
-
validationSchema: schema$
|
|
16085
|
+
validationSchema: schema$i,
|
|
15925
16086
|
onSubmit: function onSubmit(values, actions) {
|
|
15926
16087
|
var _values$certificateIt;
|
|
15927
16088
|
|