mario-education 2.3.2 → 2.4.0
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 +1 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/LearningStrategy/hooks/useStrategyDetail.d.ts +1 -0
- package/dist/containers/Assessment/components/AssessmentDetailModal.d.ts +3 -0
- package/dist/containers/Assessment/hooks/useAssessmentDetail.d.ts +17 -0
- package/dist/containers/Assessment/hooks/useAssessmentList.d.ts +9 -0
- package/dist/containers/Assessment/views/AssessmentAssignment.d.ts +3 -0
- package/dist/containers/Assessment/views/AssessmentList.d.ts +3 -0
- package/dist/containers/Badge/components/BadgeDetailModal.d.ts +3 -0
- package/dist/containers/Badge/hooks/useBadgeDetail.d.ts +14 -0
- package/dist/containers/Badge/hooks/useBadgeList.d.ts +9 -0
- package/dist/containers/Badge/views/BadgeList.d.ts +3 -0
- package/dist/containers/Classes/components/ClassDetailModal.d.ts +3 -0
- package/dist/containers/Classes/hooks/useClassDetail.d.ts +12 -0
- package/dist/containers/Classes/hooks/useClassList.d.ts +9 -0
- package/dist/containers/Classes/views/ClassList.d.ts +3 -0
- package/dist/containers/ConferenceRubric/components/CellList.d.ts +10 -0
- package/dist/containers/ConferenceRubric/components/ColumnList.d.ts +11 -0
- package/dist/containers/ConferenceRubric/components/RowList.d.ts +11 -0
- package/dist/containers/ConferenceRubric/configs/conferenceRubricDetailSchema.d.ts +8 -0
- package/dist/containers/ConferenceRubric/hooks/useConferenceRubricDetail.d.ts +48 -0
- package/dist/containers/ConferenceRubric/hooks/useConferenceRubricList.d.ts +10 -0
- package/dist/containers/ConferenceRubric/views/ConferenceRubricDetail.d.ts +3 -0
- package/dist/containers/ConferenceRubric/views/ConferenceRubricList.d.ts +3 -0
- package/dist/containers/Feedback/components/FeedbackDetailModal.d.ts +3 -0
- package/dist/containers/Feedback/hooks/useFeedbackDetail.d.ts +12 -0
- package/dist/containers/Feedback/hooks/useFeedbackList.d.ts +8 -0
- package/dist/containers/Feedback/views/FeedbackList.d.ts +3 -0
- package/dist/containers/GoalExample/components/GoalExampleDetailModal.d.ts +3 -0
- package/dist/containers/GoalExample/hooks/useGoalExampleDetail.d.ts +13 -0
- package/dist/containers/GoalExample/hooks/useGoalExampleList.d.ts +9 -0
- package/dist/containers/GoalExample/views/GoalExampleList.d.ts +3 -0
- package/dist/containers/LearningStrategy/components/StrategyDetailModal.d.ts +3 -0
- package/dist/containers/LearningStrategy/hooks/useLearningStrategyList.d.ts +9 -0
- package/dist/containers/LearningStrategy/hooks/useStrategyDetail.d.ts +13 -0
- package/dist/containers/LearningStrategy/views/LearningStrategyList.d.ts +3 -0
- package/dist/containers/ManageAssistant/views/ManageAssistantList.d.ts +3 -0
- package/dist/containers/QuestionBank/components/AdditionalComponent.d.ts +7 -0
- package/dist/containers/QuestionBank/components/AgGridComponents.d.ts +9 -0
- package/dist/containers/QuestionBank/components/AnswerList.d.ts +8 -0
- package/dist/containers/QuestionBank/components/QuestionPreview.d.ts +3 -0
- package/dist/containers/QuestionBank/components/SliderScale.d.ts +8 -0
- package/dist/containers/QuestionBank/components/StarRating.d.ts +7 -0
- package/dist/containers/QuestionBank/configs/questionDetailSchema.d.ts +21 -0
- package/dist/containers/QuestionBank/configs/validationAnswerId.d.ts +2 -0
- package/dist/containers/QuestionBank/configs/validationChoices.d.ts +2 -0
- package/dist/containers/QuestionBank/hooks/useQuestionAnswerList.d.ts +7 -0
- package/dist/containers/QuestionBank/hooks/useQuestionDetail.d.ts +23 -0
- package/dist/containers/QuestionBank/hooks/useQuestionList.d.ts +12 -0
- package/dist/containers/QuestionBank/views/QuestionBankList.d.ts +3 -0
- package/dist/containers/QuestionBank/views/QuestionDetail.d.ts +3 -0
- package/dist/containers/QuestionCategory/components/QuestionCateModal.d.ts +3 -0
- package/dist/containers/QuestionCategory/hooks/useQuestionCateDetail.d.ts +13 -0
- package/dist/containers/QuestionCategory/hooks/useQuestionCateList.d.ts +9 -0
- package/dist/containers/QuestionCategory/views/QuestionCategogyList.d.ts +3 -0
- package/dist/containers/ReflectionForm/components/QuestionSplitPaneSelector.d.ts +3 -0
- package/dist/containers/ReflectionForm/components/ReflectionDetailModal.d.ts +3 -0
- package/dist/containers/ReflectionForm/hooks/useQuestionCategory.d.ts +13 -0
- package/dist/containers/ReflectionForm/hooks/useReflectionFormDetail.d.ts +16 -0
- package/dist/containers/ReflectionForm/hooks/useReflectionFormList.d.ts +9 -0
- package/dist/containers/ReflectionForm/views/ReflectionFormList.d.ts +3 -0
- package/dist/containers/Setup/views/SetupContainer.d.ts +3 -0
- package/dist/containers/Subject/components/SubjectDetailModal.d.ts +3 -0
- package/dist/containers/Subject/hooks/useSubjectDetail.d.ts +13 -0
- package/dist/containers/Subject/hooks/useSubjectList.d.ts +9 -0
- package/dist/containers/Subject/views/SubjectList.d.ts +3 -0
- package/dist/containers/SuggestionBank/components/SuggestionDetailModal.d.ts +3 -0
- package/dist/containers/SuggestionBank/hooks/useKeywordList.d.ts +10 -0
- package/dist/containers/SuggestionBank/hooks/useSuggestionDetail.d.ts +24 -0
- package/dist/containers/SuggestionBank/hooks/useSuggestionList.d.ts +10 -0
- package/dist/containers/SuggestionBank/views/SuggestionList.d.ts +3 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +116 -88
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +116 -88
- package/dist/index.modern.js.map +1 -1
- package/dist/index.test.d.ts +1 -0
- package/dist/services/assessmentService.d.ts +6 -0
- package/dist/services/badgeService.d.ts +6 -0
- package/dist/services/classService.d.ts +6 -0
- package/dist/services/conferenceRubricService.d.ts +7 -0
- package/dist/services/feedbackService.d.ts +6 -0
- package/dist/services/goalExampleService.d.ts +6 -0
- package/dist/services/learningStrategyService.d.ts +6 -0
- package/dist/services/questionCategoryService.d.ts +6 -0
- package/dist/services/questionService.d.ts +6 -0
- package/dist/services/reflectionFormService.d.ts +6 -0
- package/dist/services/studentService.d.ts +2 -0
- package/dist/services/subjectService.d.ts +6 -0
- package/dist/services/suggestionService.d.ts +6 -0
- package/package.json +2 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type SubjectDetail = {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
};
|
|
6
|
+
declare const useSubjectDetail: () => {
|
|
7
|
+
id: number;
|
|
8
|
+
setId: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
9
|
+
subjectDetail: SubjectDetail;
|
|
10
|
+
confirmData: (values: any, cb: any) => Promise<void>;
|
|
11
|
+
initValue: SubjectDetail;
|
|
12
|
+
};
|
|
13
|
+
export default useSubjectDetail;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Filter } from "mario-core";
|
|
2
|
+
declare const useSubjectList: () => {
|
|
3
|
+
subjectList: any;
|
|
4
|
+
filters: Filter;
|
|
5
|
+
changeFilters: (updatedFilters: any) => void;
|
|
6
|
+
getData: () => Promise<void>;
|
|
7
|
+
removeData: (id: number) => void;
|
|
8
|
+
};
|
|
9
|
+
export default useSubjectList;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const useKeywordList: (initKeywords: any) => {
|
|
2
|
+
inputValue: string;
|
|
3
|
+
value: any;
|
|
4
|
+
handleChange: (newValue: any) => void;
|
|
5
|
+
handleInputChange: (newInputValue: string) => void;
|
|
6
|
+
handleKeyDown: (e: any) => void;
|
|
7
|
+
placeholder: string;
|
|
8
|
+
keywords: any;
|
|
9
|
+
};
|
|
10
|
+
export default useKeywordList;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type SuggestionDetail = {
|
|
3
|
+
description: string;
|
|
4
|
+
suggestionKeywords?: any;
|
|
5
|
+
suggestionKeywordsToAdd?: any;
|
|
6
|
+
suggestionKeywordsToDelete?: any;
|
|
7
|
+
categoryId: any;
|
|
8
|
+
};
|
|
9
|
+
declare const useSuggestionDetail: () => {
|
|
10
|
+
id: number;
|
|
11
|
+
setId: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
12
|
+
suggestionDetail: SuggestionDetail;
|
|
13
|
+
changeSuggestionDetail: (dataUpdated: any) => void;
|
|
14
|
+
confirmData: (cb: any) => Promise<void>;
|
|
15
|
+
initValue: SuggestionDetail;
|
|
16
|
+
inputValue: string;
|
|
17
|
+
value: any;
|
|
18
|
+
handleChange: (newValue: any) => void;
|
|
19
|
+
handleInputChange: (newInputValue: string) => void;
|
|
20
|
+
handleKeyDown: (e: any) => void;
|
|
21
|
+
placeholder: string;
|
|
22
|
+
keywords: any;
|
|
23
|
+
};
|
|
24
|
+
export default useSuggestionDetail;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Filter } from "mario-core";
|
|
2
|
+
declare const useSuggestionList: () => {
|
|
3
|
+
suggestionList: any;
|
|
4
|
+
filters: Filter;
|
|
5
|
+
changeFilters: (updatedFilters: any) => void;
|
|
6
|
+
getData: () => Promise<void>;
|
|
7
|
+
removeData: (id: number) => void;
|
|
8
|
+
getKeywords: (keywords: any) => any;
|
|
9
|
+
};
|
|
10
|
+
export default useSuggestionList;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import ClassList from "./containers/Classes/views/ClassList";
|
|
2
|
+
import ConferenceRubricList from "./containers/ConferenceRubric/views/ConferenceRubricList";
|
|
3
|
+
import ConferenceRubricDetail from "./containers/ConferenceRubric/views/ConferenceRubricDetail";
|
|
4
|
+
import SuggestionList from "./containers/SuggestionBank/views/SuggestionList";
|
|
5
|
+
import LearningStrategyList from "./containers/LearningStrategy/views/LearningStrategyList";
|
|
6
|
+
import SetupContainer from "./containers/Setup/views/SetupContainer";
|
|
7
|
+
import QuestionBankList from "./containers/QuestionBank/views/QuestionBankList";
|
|
8
|
+
import ReflectionFormList from "./containers/ReflectionForm/views/ReflectionFormList";
|
|
9
|
+
import QuestionDetail from "./containers/QuestionBank/views/QuestionDetail";
|
|
10
|
+
import SubjectList from "./containers/Subject/views/SubjectList";
|
|
11
|
+
import AssessmentList from "./containers/Assessment/views/AssessmentList";
|
|
12
|
+
import AssessmentAssignment from "./containers/Assessment/views/AssessmentAssignment";
|
|
13
|
+
import BadgeList from "./containers/Badge/views/BadgeList";
|
|
14
|
+
import FeedbackList from "./containers/Feedback/views/FeedbackList";
|
|
15
|
+
import GoalExampleList from "./containers/GoalExample/views/GoalExampleList";
|
|
16
|
+
export { ClassList, ConferenceRubricList, ConferenceRubricDetail, SuggestionList, LearningStrategyList, SetupContainer, QuestionBankList, ReflectionFormList, QuestionDetail, SubjectList, BadgeList, GoalExampleList, FeedbackList, AssessmentList, AssessmentAssignment };
|
package/dist/index.js
CHANGED
|
@@ -2748,8 +2748,9 @@ var StrategyDetailModal = function StrategyDetailModal(props, ref) {
|
|
|
2748
2748
|
}), touched.name && errors.name && React__default.createElement(marioCore.ErrorHandler, {
|
|
2749
2749
|
text: errors.name
|
|
2750
2750
|
})), React__default.createElement(reactstrap.Col, {
|
|
2751
|
-
md: 12
|
|
2752
|
-
|
|
2751
|
+
md: 12,
|
|
2752
|
+
className: "mb-2"
|
|
2753
|
+
}, React__default.createElement(reactstrap.Label, null, "Detail"), React__default.createElement(reactstrap.Input, {
|
|
2753
2754
|
type: "textarea",
|
|
2754
2755
|
rows: 5,
|
|
2755
2756
|
name: "description",
|
|
@@ -2760,6 +2761,19 @@ var StrategyDetailModal = function StrategyDetailModal(props, ref) {
|
|
|
2760
2761
|
setEditedTrue();
|
|
2761
2762
|
},
|
|
2762
2763
|
onBlur: handleBlur("description")
|
|
2764
|
+
})), React__default.createElement(reactstrap.Col, {
|
|
2765
|
+
md: 12
|
|
2766
|
+
}, React__default.createElement(reactstrap.Label, null, "Best fit"), React__default.createElement(reactstrap.Input, {
|
|
2767
|
+
type: "textarea",
|
|
2768
|
+
rows: 5,
|
|
2769
|
+
name: "bestfit",
|
|
2770
|
+
placeholder: "Best fit",
|
|
2771
|
+
value: values.bestfit,
|
|
2772
|
+
onChange: function onChange(e) {
|
|
2773
|
+
handleChange(e);
|
|
2774
|
+
setEditedTrue();
|
|
2775
|
+
},
|
|
2776
|
+
onBlur: handleBlur("bestfit")
|
|
2763
2777
|
}))));
|
|
2764
2778
|
});
|
|
2765
2779
|
};
|
|
@@ -2885,7 +2899,8 @@ var useStrategyList = function useStrategyList() {
|
|
|
2885
2899
|
|
|
2886
2900
|
var initValue$3 = {
|
|
2887
2901
|
name: "",
|
|
2888
|
-
description: ""
|
|
2902
|
+
description: "",
|
|
2903
|
+
bestfit: ""
|
|
2889
2904
|
};
|
|
2890
2905
|
|
|
2891
2906
|
var useStrategyDetail = function useStrategyDetail() {
|
|
@@ -3091,7 +3106,7 @@ var LearningStrategyList = function LearningStrategyList() {
|
|
|
3091
3106
|
className: "align-top"
|
|
3092
3107
|
}, "Strategy name"), React__default.createElement("th", {
|
|
3093
3108
|
className: "align-top"
|
|
3094
|
-
}, "
|
|
3109
|
+
}, "Detail"), React__default.createElement("th", {
|
|
3095
3110
|
className: "text-center"
|
|
3096
3111
|
}, "Action"))), React__default.createElement("tbody", null, strategyList.map(function (record) {
|
|
3097
3112
|
return React__default.createElement("tr", {
|
|
@@ -5188,12 +5203,13 @@ var UploadCSVButton = function UploadCSVButton(_ref) {
|
|
|
5188
5203
|
isDisabled = _ref.isDisabled,
|
|
5189
5204
|
text = _ref.text,
|
|
5190
5205
|
backgroundColor = _ref.backgroundColor,
|
|
5191
|
-
_onClick = _ref.onClick
|
|
5206
|
+
_onClick = _ref.onClick,
|
|
5207
|
+
isClassReflection = _ref.isClassReflection;
|
|
5192
5208
|
return React__default.createElement(reactstrap.Label, {
|
|
5193
5209
|
htmlFor: htmlFor,
|
|
5194
5210
|
role: "button",
|
|
5195
5211
|
tabIndex: 0,
|
|
5196
|
-
className: "d-flex align-items-center justfy-content-center " + (!isDisabled ? "cursor-pointer hover-opacity" : ""),
|
|
5212
|
+
className: "d-flex align-items-center justfy-content-center \n " + (isClassReflection ? "w-25" : "") + "\n " + (!isDisabled ? "cursor-pointer hover-opacity" : ""),
|
|
5197
5213
|
style: _extends({}, style, {
|
|
5198
5214
|
backgroundColor: backgroundColor,
|
|
5199
5215
|
opacity: !isDisabled ? 1 : 0.5
|
|
@@ -5209,6 +5225,9 @@ var UploadCSVButton = function UploadCSVButton(_ref) {
|
|
|
5209
5225
|
|
|
5210
5226
|
var CSV_FILE_URL = marioCore.BASE_URL + "/api/ImportCsv/csv";
|
|
5211
5227
|
var CSV_FILE_TEACHER = marioCore.BASE_URL + "/api/Teacher";
|
|
5228
|
+
var importCSV = function importCSV(formData, subFolder) {
|
|
5229
|
+
return marioCore.apiUpload.post(CSV_FILE_URL + "/" + subFolder, formData);
|
|
5230
|
+
};
|
|
5212
5231
|
var importStudentCSV = function importStudentCSV(formData) {
|
|
5213
5232
|
return marioCore.apiUpload.post(CSV_FILE_TEACHER + "/adminImportStudent", formData);
|
|
5214
5233
|
};
|
|
@@ -5228,9 +5247,9 @@ var CSVType;
|
|
|
5228
5247
|
})(CSVType || (CSVType = {}));
|
|
5229
5248
|
|
|
5230
5249
|
var buttons = [{
|
|
5231
|
-
text: "Import
|
|
5232
|
-
backgroundColor: "#
|
|
5233
|
-
type: CSVType.
|
|
5250
|
+
text: "Import class reflections",
|
|
5251
|
+
backgroundColor: "#e74c3c",
|
|
5252
|
+
type: CSVType.ClassReflection
|
|
5234
5253
|
}];
|
|
5235
5254
|
var title = "CSV Import";
|
|
5236
5255
|
var id = "csvupload";
|
|
@@ -5263,29 +5282,62 @@ var useCSVImport = function useCSVImport() {
|
|
|
5263
5282
|
initImportReflection = _useState4[0],
|
|
5264
5283
|
setInitImportReflection = _useState4[1];
|
|
5265
5284
|
|
|
5285
|
+
var domainName = window.location.hostname;
|
|
5286
|
+
var isCheckDomainIBS = domainName.includes('isb');
|
|
5266
5287
|
React.useEffect(function () {
|
|
5267
5288
|
document.title = title;
|
|
5268
5289
|
}, []);
|
|
5269
5290
|
var upload = React.useCallback(function (file) {
|
|
5270
5291
|
try {
|
|
5271
|
-
var
|
|
5292
|
+
var _temp8 = function _temp8() {
|
|
5272
5293
|
dispatch(marioCore.setLoading(false));
|
|
5294
|
+
var inputId = document.getElementById(id);
|
|
5273
5295
|
var input = document.getElementById('import-student');
|
|
5296
|
+
var importClass = document.getElementById('import-classReflection');
|
|
5297
|
+
inputId && (inputId.value = "");
|
|
5274
5298
|
input && (input.value = "");
|
|
5299
|
+
importClass && (importClass.value = "");
|
|
5275
5300
|
};
|
|
5276
5301
|
|
|
5277
5302
|
if (!type || !file) return Promise.resolve();
|
|
5278
5303
|
dispatch(marioCore.setLoading(true));
|
|
5279
5304
|
|
|
5280
|
-
var
|
|
5281
|
-
|
|
5282
|
-
formData.append("file", file, file.name);
|
|
5283
|
-
return Promise.resolve(importStudentCSV(formData)).then(function () {
|
|
5305
|
+
var _temp9 = _catch(function () {
|
|
5306
|
+
function _temp5() {
|
|
5284
5307
|
dispatch(marioCore.setAlert({
|
|
5285
5308
|
type: "success",
|
|
5286
5309
|
message: "Import CSV successfully"
|
|
5287
5310
|
}));
|
|
5288
|
-
}
|
|
5311
|
+
}
|
|
5312
|
+
|
|
5313
|
+
var formData = new FormData();
|
|
5314
|
+
formData.append("file", file, file.name);
|
|
5315
|
+
|
|
5316
|
+
var _temp4 = function () {
|
|
5317
|
+
if (isCheckDomainIBS) {
|
|
5318
|
+
var _temp10 = function _temp10() {
|
|
5319
|
+
var _temp = function () {
|
|
5320
|
+
if (type == CSVType.ClassReflection) {
|
|
5321
|
+
return Promise.resolve(importClassReflectionCSV(formData)).then(function () {});
|
|
5322
|
+
}
|
|
5323
|
+
}();
|
|
5324
|
+
|
|
5325
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
5326
|
+
};
|
|
5327
|
+
|
|
5328
|
+
var _temp11 = function () {
|
|
5329
|
+
if (type == CSVType.Students) {
|
|
5330
|
+
return Promise.resolve(importStudentCSV(formData)).then(function () {});
|
|
5331
|
+
}
|
|
5332
|
+
}();
|
|
5333
|
+
|
|
5334
|
+
return _temp11 && _temp11.then ? _temp11.then(_temp10) : _temp10(_temp11);
|
|
5335
|
+
} else {
|
|
5336
|
+
return Promise.resolve(importCSV(formData, type.toString())).then(function () {});
|
|
5337
|
+
}
|
|
5338
|
+
}();
|
|
5339
|
+
|
|
5340
|
+
return _temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4);
|
|
5289
5341
|
}, function (err) {
|
|
5290
5342
|
var _err$response, _err$response$data;
|
|
5291
5343
|
|
|
@@ -5295,7 +5347,7 @@ var useCSVImport = function useCSVImport() {
|
|
|
5295
5347
|
}));
|
|
5296
5348
|
});
|
|
5297
5349
|
|
|
5298
|
-
return Promise.resolve(
|
|
5350
|
+
return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(_temp8) : _temp8(_temp9));
|
|
5299
5351
|
} catch (e) {
|
|
5300
5352
|
return Promise.reject(e);
|
|
5301
5353
|
}
|
|
@@ -5303,7 +5355,7 @@ var useCSVImport = function useCSVImport() {
|
|
|
5303
5355
|
|
|
5304
5356
|
var onConfirm = function onConfirm(values) {
|
|
5305
5357
|
try {
|
|
5306
|
-
var
|
|
5358
|
+
var _temp14 = function _temp14() {
|
|
5307
5359
|
dispatch(marioCore.setLoading(false));
|
|
5308
5360
|
var input = document.getElementById(id);
|
|
5309
5361
|
input && (input.value = "");
|
|
@@ -5312,7 +5364,7 @@ var useCSVImport = function useCSVImport() {
|
|
|
5312
5364
|
if (!dataFile || !dataFile) return Promise.resolve();
|
|
5313
5365
|
dispatch(marioCore.setLoading(true));
|
|
5314
5366
|
|
|
5315
|
-
var
|
|
5367
|
+
var _temp15 = _catch(function () {
|
|
5316
5368
|
var formData = new FormData();
|
|
5317
5369
|
formData.append("file", dataFile, dataFile.name);
|
|
5318
5370
|
formData.append("teacherName", values.teacherName);
|
|
@@ -5336,7 +5388,7 @@ var useCSVImport = function useCSVImport() {
|
|
|
5336
5388
|
}));
|
|
5337
5389
|
});
|
|
5338
5390
|
|
|
5339
|
-
return Promise.resolve(
|
|
5391
|
+
return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(_temp14) : _temp14(_temp15));
|
|
5340
5392
|
} catch (e) {
|
|
5341
5393
|
return Promise.reject(e);
|
|
5342
5394
|
}
|
|
@@ -5355,17 +5407,19 @@ var useCSVImport = function useCSVImport() {
|
|
|
5355
5407
|
dataFile: dataFile,
|
|
5356
5408
|
setDataFile: setDataFile,
|
|
5357
5409
|
setArrStudent: setArrStudent,
|
|
5358
|
-
arrStudent: arrStudent
|
|
5410
|
+
arrStudent: arrStudent,
|
|
5411
|
+
isCheckDomainIBS: isCheckDomainIBS
|
|
5359
5412
|
};
|
|
5360
5413
|
};
|
|
5361
5414
|
|
|
5415
|
+
var _yup$string, _yup$string2, _yup$string3;
|
|
5362
5416
|
var schema$4 = yup.object({
|
|
5363
|
-
teacherName: yup.string().required(),
|
|
5364
|
-
teacherEmail: yup.string().email('Invalid email').required(),
|
|
5417
|
+
teacherName: (_yup$string = yup.string()) === null || _yup$string === void 0 ? void 0 : _yup$string.trim().required(),
|
|
5418
|
+
teacherEmail: (_yup$string2 = yup.string()) === null || _yup$string2 === void 0 ? void 0 : _yup$string2.trim().email('Invalid email').required(),
|
|
5365
5419
|
studentIds: yup.array().required().test("test students", "Please choose student", function () {
|
|
5366
5420
|
return !!this.parent.studentIds && !!this.parent.studentIds.length;
|
|
5367
5421
|
}),
|
|
5368
|
-
file: yup.string().required()
|
|
5422
|
+
file: (_yup$string3 = yup.string()) === null || _yup$string3 === void 0 ? void 0 : _yup$string3.trim().required()
|
|
5369
5423
|
});
|
|
5370
5424
|
|
|
5371
5425
|
var CSVImport = function CSVImport() {
|
|
@@ -5379,13 +5433,13 @@ var CSVImport = function CSVImport() {
|
|
|
5379
5433
|
dataFile = _useCSVImport.dataFile,
|
|
5380
5434
|
setDataFile = _useCSVImport.setDataFile,
|
|
5381
5435
|
setArrStudent = _useCSVImport.setArrStudent,
|
|
5382
|
-
arrStudent = _useCSVImport.arrStudent,
|
|
5383
5436
|
buttons = _useCSVImport.buttons,
|
|
5384
|
-
upload = _useCSVImport.upload
|
|
5437
|
+
upload = _useCSVImport.upload,
|
|
5438
|
+
isCheckDomainIBS = _useCSVImport.isCheckDomainIBS;
|
|
5385
5439
|
|
|
5386
5440
|
return React__default.createElement("div", {
|
|
5387
5441
|
className: "animated fadeIn pt-3"
|
|
5388
|
-
}, React__default.createElement(reactstrap.Input, {
|
|
5442
|
+
}, isCheckDomainIBS ? React__default.createElement(React__default.Fragment, null, React__default.createElement(reactstrap.Input, {
|
|
5389
5443
|
className: "d-none",
|
|
5390
5444
|
type: "file",
|
|
5391
5445
|
id: "import-student",
|
|
@@ -5393,6 +5447,14 @@ var CSVImport = function CSVImport() {
|
|
|
5393
5447
|
return upload(e.target.files[0]);
|
|
5394
5448
|
},
|
|
5395
5449
|
accept: "text/csv"
|
|
5450
|
+
}), React__default.createElement(reactstrap.Input, {
|
|
5451
|
+
className: "d-none",
|
|
5452
|
+
type: "file",
|
|
5453
|
+
id: "import-classReflection",
|
|
5454
|
+
onChange: function onChange(e) {
|
|
5455
|
+
return upload(e.target.files[0]);
|
|
5456
|
+
},
|
|
5457
|
+
accept: "text/csv"
|
|
5396
5458
|
}), React__default.createElement("div", {
|
|
5397
5459
|
className: "class-reflection"
|
|
5398
5460
|
}, React__default.createElement(formik.Formik, {
|
|
@@ -5406,11 +5468,8 @@ var CSVImport = function CSVImport() {
|
|
|
5406
5468
|
actions.resetForm();
|
|
5407
5469
|
}
|
|
5408
5470
|
}, function (formProps) {
|
|
5409
|
-
var
|
|
5410
|
-
|
|
5411
|
-
errors = formProps.errors,
|
|
5412
|
-
handleSubmit = formProps.handleSubmit,
|
|
5413
|
-
handleChange = formProps.handleChange;
|
|
5471
|
+
var touched = formProps.touched,
|
|
5472
|
+
errors = formProps.errors;
|
|
5414
5473
|
return React__default.createElement(reactstrap.Row, {
|
|
5415
5474
|
className: "mb-2"
|
|
5416
5475
|
}, React__default.createElement(reactstrap.Input, {
|
|
@@ -5431,55 +5490,11 @@ var CSVImport = function CSVImport() {
|
|
|
5431
5490
|
md: 12,
|
|
5432
5491
|
className: "mb-2"
|
|
5433
5492
|
}, React__default.createElement(marioCore.RequiredLabel, {
|
|
5434
|
-
text: "Class
|
|
5435
|
-
}), React__default.createElement(reactstrap.Input, {
|
|
5436
|
-
name: "teacherName",
|
|
5437
|
-
value: values.teacherName,
|
|
5438
|
-
type: "text",
|
|
5439
|
-
onChange: function onChange(e) {
|
|
5440
|
-
handleChange(e);
|
|
5441
|
-
}
|
|
5442
|
-
}), touched.teacherName && errors.teacherName && React__default.createElement(marioCore.ErrorHandler, {
|
|
5443
|
-
text: errors.teacherName
|
|
5444
|
-
})), React__default.createElement(reactstrap.Col, {
|
|
5445
|
-
md: 12,
|
|
5446
|
-
className: "mb-2"
|
|
5447
|
-
}, React__default.createElement(marioCore.RequiredLabel, {
|
|
5448
|
-
text: "Class Teacher Email"
|
|
5449
|
-
}), React__default.createElement(reactstrap.Input, {
|
|
5450
|
-
name: "teacherEmail",
|
|
5451
|
-
value: values.teacherEmail,
|
|
5452
|
-
type: "text",
|
|
5453
|
-
onChange: function onChange(e) {
|
|
5454
|
-
handleChange(e);
|
|
5455
|
-
}
|
|
5456
|
-
}), touched.teacherEmail && errors.teacherEmail && React__default.createElement(marioCore.ErrorHandler, {
|
|
5457
|
-
text: errors.teacherEmail
|
|
5458
|
-
})), React__default.createElement(reactstrap.Col, {
|
|
5459
|
-
md: 12,
|
|
5460
|
-
className: "mb-2"
|
|
5461
|
-
}, React__default.createElement(reactstrap.Label, null, "Students"), React__default.createElement(StudentSelector, {
|
|
5462
|
-
onChange: function onChange(e) {
|
|
5463
|
-
setArrStudent(e);
|
|
5464
|
-
formProps.setFieldValue("studentIds", e.map(function (i) {
|
|
5465
|
-
return i.value;
|
|
5466
|
-
}) || []);
|
|
5467
|
-
},
|
|
5468
|
-
value: arrStudent
|
|
5469
|
-
})), React__default.createElement(reactstrap.Col, {
|
|
5470
|
-
md: 12,
|
|
5471
|
-
className: "mb-2"
|
|
5472
|
-
}, touched.studentIds && errors.studentIds && React__default.createElement(marioCore.ErrorHandler, {
|
|
5473
|
-
text: errors.studentIds
|
|
5474
|
-
})), React__default.createElement(reactstrap.Col, {
|
|
5475
|
-
md: 12,
|
|
5476
|
-
className: "mb-2"
|
|
5477
|
-
}, React__default.createElement(marioCore.RequiredLabel, {
|
|
5478
|
-
text: "Upload File Class Reflection"
|
|
5493
|
+
text: "Import Class Reflection"
|
|
5479
5494
|
}), React__default.createElement(UploadCSVButton, {
|
|
5480
5495
|
key: "Import class reflections",
|
|
5481
|
-
htmlFor:
|
|
5482
|
-
text: "Import
|
|
5496
|
+
htmlFor: "import-classReflection",
|
|
5497
|
+
text: "Import Class Reflection",
|
|
5483
5498
|
isDisabled: isLoading,
|
|
5484
5499
|
backgroundColor: "#e74c3c",
|
|
5485
5500
|
onClick: function onClick() {
|
|
@@ -5496,15 +5511,7 @@ var CSVImport = function CSVImport() {
|
|
|
5496
5511
|
className: "mb-2"
|
|
5497
5512
|
}, touched.file && errors.file && React__default.createElement(marioCore.ErrorHandler, {
|
|
5498
5513
|
text: errors.file
|
|
5499
|
-
})), React__default.createElement(reactstrap.Col, {
|
|
5500
|
-
md: 12
|
|
5501
|
-
}, React__default.createElement(reactstrap.Button, {
|
|
5502
|
-
color: "primary",
|
|
5503
|
-
className: "float-right",
|
|
5504
|
-
onClick: function onClick() {
|
|
5505
|
-
return handleSubmit();
|
|
5506
|
-
}
|
|
5507
|
-
}, "Import"), ' '))), React__default.createElement(reactstrap.Col, {
|
|
5514
|
+
})))), React__default.createElement(reactstrap.Col, {
|
|
5508
5515
|
md: 6,
|
|
5509
5516
|
className: "mb-2"
|
|
5510
5517
|
}, React__default.createElement(reactstrap.Row, null, React__default.createElement(reactstrap.Col, {
|
|
@@ -5524,7 +5531,28 @@ var CSVImport = function CSVImport() {
|
|
|
5524
5531
|
}
|
|
5525
5532
|
});
|
|
5526
5533
|
})))));
|
|
5527
|
-
})))
|
|
5534
|
+
}))) : React__default.createElement(React__default.Fragment, null, React__default.createElement(reactstrap.Input, {
|
|
5535
|
+
className: "d-none",
|
|
5536
|
+
type: "file",
|
|
5537
|
+
id: id,
|
|
5538
|
+
onChange: function onChange(e) {
|
|
5539
|
+
return upload(e.target.files[0]);
|
|
5540
|
+
},
|
|
5541
|
+
accept: "text/csv"
|
|
5542
|
+
}), React__default.createElement("div", {
|
|
5543
|
+
className: "d-flex align-items-center"
|
|
5544
|
+
}, buttons.map(function (button) {
|
|
5545
|
+
return React__default.createElement(UploadCSVButton, {
|
|
5546
|
+
key: button.text,
|
|
5547
|
+
htmlFor: id,
|
|
5548
|
+
text: button.text,
|
|
5549
|
+
isDisabled: isLoading,
|
|
5550
|
+
backgroundColor: button.backgroundColor,
|
|
5551
|
+
onClick: function onClick() {
|
|
5552
|
+
return setType(button.type);
|
|
5553
|
+
}
|
|
5554
|
+
});
|
|
5555
|
+
}))));
|
|
5528
5556
|
};
|
|
5529
5557
|
|
|
5530
5558
|
var schema$5 = yup.object({
|