mario-core 2.9.405-feedback → 2.9.407-feedback
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/index.js +40 -83
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +40 -83
- package/dist/index.modern.js.map +1 -1
- package/dist/services/csvService.d.ts +1 -0
- package/dist/services/weeklyQuestService.d.ts +1 -0
- package/dist/types/WeeklyQuest.d.ts +37 -0
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -49583,8 +49583,8 @@ var importClassReflectionCSV$1 = function importClassReflectionCSV(formData) {
|
|
|
49583
49583
|
var importStudentByTeacher$1 = function importStudentByTeacher(teacherId, formData) {
|
|
49584
49584
|
return apiUpload.post(CSV_FILE_TEACHER$1 + "/adminImportStudentByTeacherId/" + teacherId, formData);
|
|
49585
49585
|
};
|
|
49586
|
-
var
|
|
49587
|
-
return
|
|
49586
|
+
var importChunkFileUsers = function importChunkFileUsers(data) {
|
|
49587
|
+
return api.post(CSV_FILE_TEACHER$1 + "/adminImportChunkUser", data);
|
|
49588
49588
|
};
|
|
49589
49589
|
var downloadTemplateFileUser$1 = function downloadTemplateFileUser() {
|
|
49590
49590
|
return api.get(CSV_FILE_TEACHER$1 + "/download-template-file-user");
|
|
@@ -49607,11 +49607,6 @@ var isbButtons = [{
|
|
|
49607
49607
|
backgroundColor: "#0abde3",
|
|
49608
49608
|
type: CSVType$1.AllUser
|
|
49609
49609
|
}];
|
|
49610
|
-
var othersButtons = [{
|
|
49611
|
-
text: "import_class_reflection",
|
|
49612
|
-
backgroundColor: "#e74c3c",
|
|
49613
|
-
type: CSVType$1.ClassReflection
|
|
49614
|
-
}];
|
|
49615
49610
|
var title$5 = "CSV Import";
|
|
49616
49611
|
var id$1 = "csvupload";
|
|
49617
49612
|
var initClassReflect$1 = {
|
|
@@ -49647,8 +49642,7 @@ var useCSVImportTab = function useCSVImportTab() {
|
|
|
49647
49642
|
studentDataFile = _useState5[0],
|
|
49648
49643
|
setStudentDataFile = _useState5[1];
|
|
49649
49644
|
|
|
49650
|
-
var
|
|
49651
|
-
var isCheckDomainIBS = domainName.includes('isb') || domainName.includes('stage');
|
|
49645
|
+
var isCheckDomainIBS = true;
|
|
49652
49646
|
|
|
49653
49647
|
var _useState6 = useState(0),
|
|
49654
49648
|
defaultTeacher = _useState6[0],
|
|
@@ -49661,7 +49655,7 @@ var useCSVImportTab = function useCSVImportTab() {
|
|
|
49661
49655
|
useEffect(function () {
|
|
49662
49656
|
document.title = title$5;
|
|
49663
49657
|
}, []);
|
|
49664
|
-
var buttons =
|
|
49658
|
+
var buttons = isbButtons ;
|
|
49665
49659
|
|
|
49666
49660
|
var downloadTemplateUser = function downloadTemplateUser() {
|
|
49667
49661
|
try {
|
|
@@ -49751,25 +49745,48 @@ var useCSVImportTab = function useCSVImportTab() {
|
|
|
49751
49745
|
});
|
|
49752
49746
|
var header = parsedData.meta.fields;
|
|
49753
49747
|
var dataRows = parsedData.data;
|
|
49754
|
-
var chunkSize =
|
|
49748
|
+
var chunkSize = 10;
|
|
49755
49749
|
var chunks = [];
|
|
49756
49750
|
|
|
49757
49751
|
for (var _i = 0; _i < dataRows.length; _i += chunkSize) {
|
|
49758
49752
|
var chunkData = dataRows.slice(_i, _i + chunkSize);
|
|
49759
|
-
var
|
|
49760
|
-
|
|
49761
|
-
|
|
49753
|
+
var valuesOnly = chunkData.map(function (row) {
|
|
49754
|
+
return Object.values(row).map(function (v) {
|
|
49755
|
+
return (v != null ? v : "").toString().trim();
|
|
49756
|
+
});
|
|
49762
49757
|
});
|
|
49763
|
-
|
|
49758
|
+
console.log({
|
|
49759
|
+
valuesOnly: valuesOnly
|
|
49760
|
+
});
|
|
49761
|
+
console.log({
|
|
49762
|
+
chunkData: chunkData
|
|
49763
|
+
});
|
|
49764
|
+
|
|
49765
|
+
if (header) {
|
|
49766
|
+
valuesOnly.unshift(header);
|
|
49767
|
+
}
|
|
49768
|
+
|
|
49769
|
+
console.log({
|
|
49770
|
+
valuesOnly: valuesOnly
|
|
49771
|
+
});
|
|
49772
|
+
chunks.push(valuesOnly);
|
|
49764
49773
|
}
|
|
49765
49774
|
|
|
49775
|
+
console.log({
|
|
49776
|
+
chunks: chunks
|
|
49777
|
+
});
|
|
49778
|
+
console.log({
|
|
49779
|
+
header: header
|
|
49780
|
+
});
|
|
49781
|
+
|
|
49766
49782
|
var _temp5 = _forTo(chunks, function (i) {
|
|
49767
|
-
|
|
49768
|
-
|
|
49783
|
+
return Promise.resolve(importChunkFileUsers({
|
|
49784
|
+
chunks: chunks[i]
|
|
49785
|
+
})).then(function () {
|
|
49786
|
+
return Promise.resolve(new Promise(function (res) {
|
|
49787
|
+
return setTimeout(res, 500);
|
|
49788
|
+
})).then(function () {});
|
|
49769
49789
|
});
|
|
49770
|
-
var formData = new FormData();
|
|
49771
|
-
formData.append("file", blob, "students_chunk" + (i + 1) + ".csv");
|
|
49772
|
-
return Promise.resolve(importUsersCSV$1(formData)).then(function () {});
|
|
49773
49790
|
});
|
|
49774
49791
|
|
|
49775
49792
|
if (_temp5 && _temp5.then) return _temp5.then(function () {});
|
|
@@ -49797,6 +49814,7 @@ var useCSVImportTab = function useCSVImportTab() {
|
|
|
49797
49814
|
}, function (err) {
|
|
49798
49815
|
var _err$response, _err$response$data;
|
|
49799
49816
|
|
|
49817
|
+
console.error("❌ Upload failed", err);
|
|
49800
49818
|
dispatch(setAlert({
|
|
49801
49819
|
type: "danger",
|
|
49802
49820
|
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
|
|
@@ -49974,7 +49992,6 @@ var CSVImport = function CSVImport() {
|
|
|
49974
49992
|
setArrStudent = _useCSVImportTab.setArrStudent,
|
|
49975
49993
|
buttons = _useCSVImportTab.buttons,
|
|
49976
49994
|
upload = _useCSVImportTab.upload,
|
|
49977
|
-
isCheckDomainIBS = _useCSVImportTab.isCheckDomainIBS,
|
|
49978
49995
|
downloadTemplateUser = _useCSVImportTab.downloadTemplateUser;
|
|
49979
49996
|
|
|
49980
49997
|
var _useTranslation = useTranslation(),
|
|
@@ -49982,7 +49999,7 @@ var CSVImport = function CSVImport() {
|
|
|
49982
49999
|
|
|
49983
50000
|
return React.createElement("div", {
|
|
49984
50001
|
className: "animated fadeIn pt-3"
|
|
49985
|
-
},
|
|
50002
|
+
}, React.createElement(React.Fragment, null, React.createElement(Input, {
|
|
49986
50003
|
className: "d-none",
|
|
49987
50004
|
type: "file",
|
|
49988
50005
|
id: "import-user",
|
|
@@ -50090,67 +50107,7 @@ var CSVImport = function CSVImport() {
|
|
|
50090
50107
|
}
|
|
50091
50108
|
});
|
|
50092
50109
|
})))));
|
|
50093
|
-
})))
|
|
50094
|
-
md: 12,
|
|
50095
|
-
className: "mt-2 mb-2 text-left"
|
|
50096
|
-
}, React.createElement(Button, {
|
|
50097
|
-
role: "button",
|
|
50098
|
-
color: "primary",
|
|
50099
|
-
onClick: function onClick() {
|
|
50100
|
-
return downloadTemplateUser();
|
|
50101
|
-
}
|
|
50102
|
-
}, React.createElement("p", {
|
|
50103
|
-
className: "d-flex align-items-center mb-0"
|
|
50104
|
-
}, t("download_template"), " ", React.createElement(AiOutlineDownload, {
|
|
50105
|
-
size: 20,
|
|
50106
|
-
className: "ml-2"
|
|
50107
|
-
})))), React.createElement(Col, {
|
|
50108
|
-
md: 6,
|
|
50109
|
-
className: "mb-3"
|
|
50110
|
-
}, React.createElement(Input, {
|
|
50111
|
-
id: "import-user",
|
|
50112
|
-
className: "d-none",
|
|
50113
|
-
type: "file",
|
|
50114
|
-
onChange: function onChange(e) {
|
|
50115
|
-
return upload(e.target.files[0]);
|
|
50116
|
-
},
|
|
50117
|
-
accept: "text/csv"
|
|
50118
|
-
}), React.createElement(RequiredLabel$1, {
|
|
50119
|
-
text: t("import_users")
|
|
50120
|
-
}), React.createElement(UploadCSVButton, {
|
|
50121
|
-
key: "import-users",
|
|
50122
|
-
htmlFor: 'import-user',
|
|
50123
|
-
text: t("import_users"),
|
|
50124
|
-
isDisabled: isLoading,
|
|
50125
|
-
backgroundColor: "#0abde3",
|
|
50126
|
-
onClick: function onClick() {
|
|
50127
|
-
setType(CSVType.AllUser);
|
|
50128
|
-
}
|
|
50129
|
-
})), React.createElement(Col, {
|
|
50130
|
-
md: 6,
|
|
50131
|
-
className: "mb-3"
|
|
50132
|
-
}, React.createElement(Input, {
|
|
50133
|
-
className: "d-none",
|
|
50134
|
-
type: "file",
|
|
50135
|
-
id: id,
|
|
50136
|
-
onChange: function onChange(e) {
|
|
50137
|
-
return upload(e.target.files[0]);
|
|
50138
|
-
},
|
|
50139
|
-
accept: "text/csv"
|
|
50140
|
-
}), buttons.map(function (button) {
|
|
50141
|
-
return React.createElement(React.Fragment, null, React.createElement(RequiredLabel$1, {
|
|
50142
|
-
text: t(button.text)
|
|
50143
|
-
}), React.createElement(UploadCSVButton, {
|
|
50144
|
-
key: button.text,
|
|
50145
|
-
htmlFor: id,
|
|
50146
|
-
text: t(button.text),
|
|
50147
|
-
isDisabled: isLoading,
|
|
50148
|
-
backgroundColor: button.backgroundColor,
|
|
50149
|
-
onClick: function onClick() {
|
|
50150
|
-
return setType(button.type);
|
|
50151
|
-
}
|
|
50152
|
-
}));
|
|
50153
|
-
})))));
|
|
50110
|
+
}))) );
|
|
50154
50111
|
};
|
|
50155
50112
|
|
|
50156
50113
|
var tabs = [{
|