mario-education 2.4.200-level → 2.4.201-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.
@@ -6,7 +6,8 @@ declare enum CSVType {
6
6
  Grades = "grades",
7
7
  Attendances = "attendances",
8
8
  ClassReflection = "classReflection",
9
- Others = "others"
9
+ Others = "others",
10
+ AllUser = "allUser"
10
11
  }
11
12
  interface CSVImportButton {
12
13
  text: string;
@@ -35,6 +36,6 @@ declare const useCSVImport: () => {
35
36
  defaultTeacher: number;
36
37
  fileName: string;
37
38
  onStudentSubmit: () => void;
38
- downloadTemplateStudentISB: () => Promise<void>;
39
+ downloadTemplateUser: () => Promise<void>;
39
40
  };
40
41
  export default useCSVImport;
@@ -3,3 +3,5 @@ export declare const importCSV: (formData: FormData, subFolder: string) => Promi
3
3
  export declare const importStudentCSV: (formData: FormData) => Promise<import("axios").AxiosResponse<any>>;
4
4
  export declare const importClassReflectionCSV: (formData: FormData) => Promise<import("axios").AxiosResponse<any>>;
5
5
  export declare const importStudentByTeacher: (teacherId: number, formData: FormData) => Promise<import("axios").AxiosResponse<any>>;
6
+ export declare const importUsersCSV: (formData: FormData) => Promise<import("axios").AxiosResponse<any>>;
7
+ export declare const downloadTemplateFileUser: () => Promise<import("axios").AxiosResponse<any>>;
package/dist/index.js CHANGED
@@ -5635,21 +5635,21 @@ var UploadCSVButton = function UploadCSVButton(_ref) {
5635
5635
 
5636
5636
  var CSV_FILE_URL = marioCore.BASE_URL + "/api/ImportCsv/csv";
5637
5637
  var CSV_FILE_TEACHER = marioCore.BASE_URL + "/api/Teacher";
5638
- var downloadTemplateFile = function downloadTemplateFile() {
5639
- return marioCore.api.get(CSV_FILE_TEACHER + "/download-template-file-isb");
5640
- };
5641
5638
  var importCSV = function importCSV(formData, subFolder) {
5642
5639
  return marioCore.apiUpload.post(CSV_FILE_URL + "/" + subFolder, formData);
5643
5640
  };
5644
- var importStudentCSV = function importStudentCSV(formData) {
5645
- return marioCore.apiUpload.post(CSV_FILE_TEACHER + "/adminImportStudent", formData);
5646
- };
5647
5641
  var importClassReflectionCSV = function importClassReflectionCSV(formData) {
5648
5642
  return marioCore.apiUpload.post(CSV_FILE_URL + "/importClassReflection", formData);
5649
5643
  };
5650
5644
  var importStudentByTeacher = function importStudentByTeacher(teacherId, formData) {
5651
5645
  return marioCore.apiUpload.post(CSV_FILE_TEACHER + "/adminImportStudentByTeacherId/" + teacherId, formData);
5652
5646
  };
5647
+ var importUsersCSV = function importUsersCSV(formData) {
5648
+ return marioCore.apiUpload.post(CSV_FILE_TEACHER + "/adminImport", formData);
5649
+ };
5650
+ var downloadTemplateFileUser = function downloadTemplateFileUser() {
5651
+ return marioCore.api.get(CSV_FILE_TEACHER + "/download-template-file-user");
5652
+ };
5653
5653
 
5654
5654
  var CSVType;
5655
5655
 
@@ -5660,12 +5660,13 @@ var CSVType;
5660
5660
  CSVType["Attendances"] = "attendances";
5661
5661
  CSVType["ClassReflection"] = "classReflection";
5662
5662
  CSVType["Others"] = "others";
5663
+ CSVType["AllUser"] = "allUser";
5663
5664
  })(CSVType || (CSVType = {}));
5664
5665
 
5665
5666
  var isbButtons = [{
5666
- text: "Import students",
5667
+ text: "Import users",
5667
5668
  backgroundColor: "#0abde3",
5668
- type: CSVType.Students
5669
+ type: CSVType.AllUser
5669
5670
  }];
5670
5671
  var othersButtons = [{
5671
5672
  text: "Import class reflections",
@@ -5723,7 +5724,7 @@ var useCSVImport = function useCSVImport() {
5723
5724
  }, []);
5724
5725
  var buttons = isCheckDomainIBS ? isbButtons : othersButtons;
5725
5726
 
5726
- var downloadTemplateStudentISB = function downloadTemplateStudentISB() {
5727
+ var downloadTemplateUser = function downloadTemplateUser() {
5727
5728
  try {
5728
5729
  var _temp3 = function _temp3() {
5729
5730
  dispatch(marioCore.setLoading(false));
@@ -5732,7 +5733,7 @@ var useCSVImport = function useCSVImport() {
5732
5733
  dispatch(marioCore.setLoading(true));
5733
5734
 
5734
5735
  var _temp4 = _catch(function () {
5735
- return Promise.resolve(downloadTemplateFile()).then(function (res) {
5736
+ return Promise.resolve(downloadTemplateFileUser()).then(function (res) {
5736
5737
  var data = new Blob([res.data.content], {
5737
5738
  type: 'text/csv'
5738
5739
  });
@@ -5786,8 +5787,8 @@ var useCSVImport = function useCSVImport() {
5786
5787
  formData.append("file", file, file.name);
5787
5788
 
5788
5789
  var _temp7 = function () {
5789
- if (type == CSVType.Students) {
5790
- return Promise.resolve(importStudentCSV(formData)).then(function () {});
5790
+ if (type == CSVType.AllUser) {
5791
+ return Promise.resolve(importUsersCSV(formData)).then(function () {});
5791
5792
  } else {
5792
5793
  var _temp13 = function () {
5793
5794
  if (isCheckDomainIBS) {
@@ -5961,7 +5962,7 @@ var useCSVImport = function useCSVImport() {
5961
5962
  defaultTeacher: defaultTeacher,
5962
5963
  fileName: fileName,
5963
5964
  onStudentSubmit: onStudentSubmit,
5964
- downloadTemplateStudentISB: downloadTemplateStudentISB
5965
+ downloadTemplateUser: downloadTemplateUser
5965
5966
  };
5966
5967
  };
5967
5968
 
@@ -5989,7 +5990,7 @@ var CSVImport = function CSVImport() {
5989
5990
  buttons = _useCSVImport.buttons,
5990
5991
  upload = _useCSVImport.upload,
5991
5992
  isCheckDomainIBS = _useCSVImport.isCheckDomainIBS,
5992
- downloadTemplateStudentISB = _useCSVImport.downloadTemplateStudentISB;
5993
+ downloadTemplateUser = _useCSVImport.downloadTemplateUser;
5993
5994
 
5994
5995
  var _useTranslation = marioCore.useTranslation(),
5995
5996
  t = _useTranslation.t;
@@ -5999,7 +6000,7 @@ var CSVImport = function CSVImport() {
5999
6000
  }, isCheckDomainIBS ? React__default.createElement(React__default.Fragment, null, React__default.createElement(reactstrap.Input, {
6000
6001
  className: "d-none",
6001
6002
  type: "file",
6002
- id: "import-student",
6003
+ id: "import-user",
6003
6004
  onChange: function onChange(e) {
6004
6005
  return upload(e.target.files[0]);
6005
6006
  },
@@ -6080,7 +6081,7 @@ var CSVImport = function CSVImport() {
6080
6081
  role: "button",
6081
6082
  color: "primary",
6082
6083
  onClick: function onClick() {
6083
- return downloadTemplateStudentISB();
6084
+ return downloadTemplateUser();
6084
6085
  }
6085
6086
  }, React__default.createElement("p", {
6086
6087
  className: "d-flex align-items-center mb-0"
@@ -6091,11 +6092,11 @@ var CSVImport = function CSVImport() {
6091
6092
  md: 12,
6092
6093
  className: "mb-2"
6093
6094
  }, React__default.createElement(marioCore.RequiredLabel, {
6094
- text: "Import student"
6095
+ text: "Import users"
6095
6096
  }), buttons.map(function (button) {
6096
6097
  return React__default.createElement(UploadCSVButton, {
6097
6098
  key: button.text,
6098
- htmlFor: 'import-student',
6099
+ htmlFor: 'import-user',
6099
6100
  text: button.text,
6100
6101
  isDisabled: isLoading,
6101
6102
  backgroundColor: button.backgroundColor,
@@ -6111,7 +6112,7 @@ var CSVImport = function CSVImport() {
6111
6112
  role: "button",
6112
6113
  color: "primary",
6113
6114
  onClick: function onClick() {
6114
- return downloadTemplateStudentISB();
6115
+ return downloadTemplateUser();
6115
6116
  }
6116
6117
  }, React__default.createElement("p", {
6117
6118
  className: "d-flex align-items-center mb-0"
@@ -6122,7 +6123,7 @@ var CSVImport = function CSVImport() {
6122
6123
  md: 6,
6123
6124
  className: "mb-2"
6124
6125
  }, React__default.createElement(reactstrap.Input, {
6125
- id: "import-student",
6126
+ id: "import-user",
6126
6127
  className: "d-none",
6127
6128
  type: "file",
6128
6129
  onChange: function onChange(e) {
@@ -6130,15 +6131,15 @@ var CSVImport = function CSVImport() {
6130
6131
  },
6131
6132
  accept: "text/csv"
6132
6133
  }), React__default.createElement(marioCore.RequiredLabel, {
6133
- text: "Import student"
6134
+ text: "Import users"
6134
6135
  }), React__default.createElement(UploadCSVButton, {
6135
- key: "import-students",
6136
- htmlFor: 'import-student',
6137
- text: "Import students",
6136
+ key: "import-users",
6137
+ htmlFor: 'import-user',
6138
+ text: "Import users",
6138
6139
  isDisabled: isLoading,
6139
6140
  backgroundColor: "#0abde3",
6140
6141
  onClick: function onClick() {
6141
- setType(CSVType.Students);
6142
+ setType(CSVType.AllUser);
6142
6143
  }
6143
6144
  })), React__default.createElement(reactstrap.Col, {
6144
6145
  md: 6,