mario-education 2.4.200-level → 2.4.202-level
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 +3 -2
- package/dist/MarioFramework.Education/ClientApp/src/services/csvService.d.ts +2 -0
- package/dist/index.js +26 -25
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +26 -25
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -5633,21 +5633,21 @@ var UploadCSVButton = function UploadCSVButton(_ref) {
|
|
|
5633
5633
|
|
|
5634
5634
|
var CSV_FILE_URL = BASE_URL + "/api/ImportCsv/csv";
|
|
5635
5635
|
var CSV_FILE_TEACHER = BASE_URL + "/api/Teacher";
|
|
5636
|
-
var downloadTemplateFile = function downloadTemplateFile() {
|
|
5637
|
-
return api.get(CSV_FILE_TEACHER + "/download-template-file-isb");
|
|
5638
|
-
};
|
|
5639
5636
|
var importCSV = function importCSV(formData, subFolder) {
|
|
5640
5637
|
return apiUpload.post(CSV_FILE_URL + "/" + subFolder, formData);
|
|
5641
5638
|
};
|
|
5642
|
-
var importStudentCSV = function importStudentCSV(formData) {
|
|
5643
|
-
return apiUpload.post(CSV_FILE_TEACHER + "/adminImportStudent", formData);
|
|
5644
|
-
};
|
|
5645
5639
|
var importClassReflectionCSV = function importClassReflectionCSV(formData) {
|
|
5646
5640
|
return apiUpload.post(CSV_FILE_URL + "/importClassReflection", formData);
|
|
5647
5641
|
};
|
|
5648
5642
|
var importStudentByTeacher = function importStudentByTeacher(teacherId, formData) {
|
|
5649
5643
|
return apiUpload.post(CSV_FILE_TEACHER + "/adminImportStudentByTeacherId/" + teacherId, formData);
|
|
5650
5644
|
};
|
|
5645
|
+
var importUsersCSV = function importUsersCSV(formData) {
|
|
5646
|
+
return apiUpload.post(CSV_FILE_TEACHER + "/adminImport", formData);
|
|
5647
|
+
};
|
|
5648
|
+
var downloadTemplateFileUser = function downloadTemplateFileUser() {
|
|
5649
|
+
return api.get(CSV_FILE_TEACHER + "/download-template-file-user");
|
|
5650
|
+
};
|
|
5651
5651
|
|
|
5652
5652
|
var CSVType;
|
|
5653
5653
|
|
|
@@ -5658,12 +5658,13 @@ var CSVType;
|
|
|
5658
5658
|
CSVType["Attendances"] = "attendances";
|
|
5659
5659
|
CSVType["ClassReflection"] = "classReflection";
|
|
5660
5660
|
CSVType["Others"] = "others";
|
|
5661
|
+
CSVType["AllUser"] = "allUser";
|
|
5661
5662
|
})(CSVType || (CSVType = {}));
|
|
5662
5663
|
|
|
5663
5664
|
var isbButtons = [{
|
|
5664
|
-
text: "Import
|
|
5665
|
+
text: "Import users",
|
|
5665
5666
|
backgroundColor: "#0abde3",
|
|
5666
|
-
type: CSVType.
|
|
5667
|
+
type: CSVType.AllUser
|
|
5667
5668
|
}];
|
|
5668
5669
|
var othersButtons = [{
|
|
5669
5670
|
text: "Import class reflections",
|
|
@@ -5721,7 +5722,7 @@ var useCSVImport = function useCSVImport() {
|
|
|
5721
5722
|
}, []);
|
|
5722
5723
|
var buttons = isCheckDomainIBS ? isbButtons : othersButtons;
|
|
5723
5724
|
|
|
5724
|
-
var
|
|
5725
|
+
var downloadTemplateUser = function downloadTemplateUser() {
|
|
5725
5726
|
try {
|
|
5726
5727
|
var _temp3 = function _temp3() {
|
|
5727
5728
|
dispatch(setLoading(false));
|
|
@@ -5730,7 +5731,7 @@ var useCSVImport = function useCSVImport() {
|
|
|
5730
5731
|
dispatch(setLoading(true));
|
|
5731
5732
|
|
|
5732
5733
|
var _temp4 = _catch(function () {
|
|
5733
|
-
return Promise.resolve(
|
|
5734
|
+
return Promise.resolve(downloadTemplateFileUser()).then(function (res) {
|
|
5734
5735
|
var data = new Blob([res.data.content], {
|
|
5735
5736
|
type: 'text/csv'
|
|
5736
5737
|
});
|
|
@@ -5784,8 +5785,8 @@ var useCSVImport = function useCSVImport() {
|
|
|
5784
5785
|
formData.append("file", file, file.name);
|
|
5785
5786
|
|
|
5786
5787
|
var _temp7 = function () {
|
|
5787
|
-
if (type == CSVType.
|
|
5788
|
-
return Promise.resolve(
|
|
5788
|
+
if (type == CSVType.AllUser) {
|
|
5789
|
+
return Promise.resolve(importUsersCSV(formData)).then(function () {});
|
|
5789
5790
|
} else {
|
|
5790
5791
|
var _temp13 = function () {
|
|
5791
5792
|
if (isCheckDomainIBS) {
|
|
@@ -5959,7 +5960,7 @@ var useCSVImport = function useCSVImport() {
|
|
|
5959
5960
|
defaultTeacher: defaultTeacher,
|
|
5960
5961
|
fileName: fileName,
|
|
5961
5962
|
onStudentSubmit: onStudentSubmit,
|
|
5962
|
-
|
|
5963
|
+
downloadTemplateUser: downloadTemplateUser
|
|
5963
5964
|
};
|
|
5964
5965
|
};
|
|
5965
5966
|
|
|
@@ -5987,7 +5988,7 @@ var CSVImport = function CSVImport() {
|
|
|
5987
5988
|
buttons = _useCSVImport.buttons,
|
|
5988
5989
|
upload = _useCSVImport.upload,
|
|
5989
5990
|
isCheckDomainIBS = _useCSVImport.isCheckDomainIBS,
|
|
5990
|
-
|
|
5991
|
+
downloadTemplateUser = _useCSVImport.downloadTemplateUser;
|
|
5991
5992
|
|
|
5992
5993
|
var _useTranslation = useTranslation(),
|
|
5993
5994
|
t = _useTranslation.t;
|
|
@@ -5997,7 +5998,7 @@ var CSVImport = function CSVImport() {
|
|
|
5997
5998
|
}, isCheckDomainIBS ? React__default.createElement(React__default.Fragment, null, React__default.createElement(Input$1, {
|
|
5998
5999
|
className: "d-none",
|
|
5999
6000
|
type: "file",
|
|
6000
|
-
id: "import-
|
|
6001
|
+
id: "import-user",
|
|
6001
6002
|
onChange: function onChange(e) {
|
|
6002
6003
|
return upload(e.target.files[0]);
|
|
6003
6004
|
},
|
|
@@ -6078,7 +6079,7 @@ var CSVImport = function CSVImport() {
|
|
|
6078
6079
|
role: "button",
|
|
6079
6080
|
color: "primary",
|
|
6080
6081
|
onClick: function onClick() {
|
|
6081
|
-
return
|
|
6082
|
+
return downloadTemplateUser();
|
|
6082
6083
|
}
|
|
6083
6084
|
}, React__default.createElement("p", {
|
|
6084
6085
|
className: "d-flex align-items-center mb-0"
|
|
@@ -6089,11 +6090,11 @@ var CSVImport = function CSVImport() {
|
|
|
6089
6090
|
md: 12,
|
|
6090
6091
|
className: "mb-2"
|
|
6091
6092
|
}, React__default.createElement(RequiredLabel, {
|
|
6092
|
-
text: "Import
|
|
6093
|
+
text: "Import users"
|
|
6093
6094
|
}), buttons.map(function (button) {
|
|
6094
6095
|
return React__default.createElement(UploadCSVButton, {
|
|
6095
6096
|
key: button.text,
|
|
6096
|
-
htmlFor: 'import-
|
|
6097
|
+
htmlFor: 'import-user',
|
|
6097
6098
|
text: button.text,
|
|
6098
6099
|
isDisabled: isLoading,
|
|
6099
6100
|
backgroundColor: button.backgroundColor,
|
|
@@ -6109,7 +6110,7 @@ var CSVImport = function CSVImport() {
|
|
|
6109
6110
|
role: "button",
|
|
6110
6111
|
color: "primary",
|
|
6111
6112
|
onClick: function onClick() {
|
|
6112
|
-
return
|
|
6113
|
+
return downloadTemplateUser();
|
|
6113
6114
|
}
|
|
6114
6115
|
}, React__default.createElement("p", {
|
|
6115
6116
|
className: "d-flex align-items-center mb-0"
|
|
@@ -6120,7 +6121,7 @@ var CSVImport = function CSVImport() {
|
|
|
6120
6121
|
md: 6,
|
|
6121
6122
|
className: "mb-2"
|
|
6122
6123
|
}, React__default.createElement(Input$1, {
|
|
6123
|
-
id: "import-
|
|
6124
|
+
id: "import-user",
|
|
6124
6125
|
className: "d-none",
|
|
6125
6126
|
type: "file",
|
|
6126
6127
|
onChange: function onChange(e) {
|
|
@@ -6128,15 +6129,15 @@ var CSVImport = function CSVImport() {
|
|
|
6128
6129
|
},
|
|
6129
6130
|
accept: "text/csv"
|
|
6130
6131
|
}), React__default.createElement(RequiredLabel, {
|
|
6131
|
-
text: "Import
|
|
6132
|
+
text: "Import users"
|
|
6132
6133
|
}), React__default.createElement(UploadCSVButton, {
|
|
6133
|
-
key: "import-
|
|
6134
|
-
htmlFor: 'import-
|
|
6135
|
-
text: "Import
|
|
6134
|
+
key: "import-users",
|
|
6135
|
+
htmlFor: 'import-user',
|
|
6136
|
+
text: "Import users",
|
|
6136
6137
|
isDisabled: isLoading,
|
|
6137
6138
|
backgroundColor: "#0abde3",
|
|
6138
6139
|
onClick: function onClick() {
|
|
6139
|
-
setType(CSVType.
|
|
6140
|
+
setType(CSVType.AllUser);
|
|
6140
6141
|
}
|
|
6141
6142
|
})), React__default.createElement(Col, {
|
|
6142
6143
|
md: 6,
|