mario-education 2.4.1 → 2.4.2
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 +8 -0
- package/dist/MarioFramework.Education/ClientApp/src/containers/Classes/components/TeacherSelector.d.ts +4 -0
- package/dist/MarioFramework.Education/ClientApp/src/services/csvService.d.ts +1 -0
- package/dist/index.css +135 -135
- package/dist/index.js +153 -15
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +153 -15
- package/dist/index.modern.js.map +1 -1
- package/package.json +91 -91
- package/dist/containers/Assessment/components/AssessmentDetailModal.d.ts +0 -3
- package/dist/containers/Assessment/hooks/useAssessmentDetail.d.ts +0 -17
- package/dist/containers/Assessment/hooks/useAssessmentList.d.ts +0 -9
- package/dist/containers/Assessment/views/AssessmentAssignment.d.ts +0 -3
- package/dist/containers/Assessment/views/AssessmentList.d.ts +0 -3
- package/dist/containers/Badge/components/BadgeDetailModal.d.ts +0 -3
- package/dist/containers/Badge/hooks/useBadgeDetail.d.ts +0 -14
- package/dist/containers/Badge/hooks/useBadgeList.d.ts +0 -9
- package/dist/containers/Badge/views/BadgeList.d.ts +0 -3
- package/dist/containers/Classes/components/ClassDetailModal.d.ts +0 -3
- package/dist/containers/Classes/hooks/useClassDetail.d.ts +0 -12
- package/dist/containers/Classes/hooks/useClassList.d.ts +0 -9
- package/dist/containers/Classes/views/ClassList.d.ts +0 -3
- package/dist/containers/ConferenceRubric/components/CellList.d.ts +0 -10
- package/dist/containers/ConferenceRubric/components/ColumnList.d.ts +0 -11
- package/dist/containers/ConferenceRubric/components/RowList.d.ts +0 -11
- package/dist/containers/ConferenceRubric/configs/conferenceRubricDetailSchema.d.ts +0 -8
- package/dist/containers/ConferenceRubric/hooks/useConferenceRubricDetail.d.ts +0 -48
- package/dist/containers/ConferenceRubric/hooks/useConferenceRubricList.d.ts +0 -10
- package/dist/containers/ConferenceRubric/views/ConferenceRubricDetail.d.ts +0 -3
- package/dist/containers/ConferenceRubric/views/ConferenceRubricList.d.ts +0 -3
- package/dist/containers/Feedback/components/FeedbackDetailModal.d.ts +0 -3
- package/dist/containers/Feedback/hooks/useFeedbackDetail.d.ts +0 -12
- package/dist/containers/Feedback/hooks/useFeedbackList.d.ts +0 -8
- package/dist/containers/Feedback/views/FeedbackList.d.ts +0 -3
- package/dist/containers/GoalExample/components/GoalExampleDetailModal.d.ts +0 -3
- package/dist/containers/GoalExample/hooks/useGoalExampleDetail.d.ts +0 -13
- package/dist/containers/GoalExample/hooks/useGoalExampleList.d.ts +0 -9
- package/dist/containers/GoalExample/views/GoalExampleList.d.ts +0 -3
- package/dist/containers/LearningStrategy/components/StrategyDetailModal.d.ts +0 -3
- package/dist/containers/LearningStrategy/hooks/useLearningStrategyList.d.ts +0 -9
- package/dist/containers/LearningStrategy/hooks/useStrategyDetail.d.ts +0 -13
- package/dist/containers/LearningStrategy/views/LearningStrategyList.d.ts +0 -3
- package/dist/containers/ManageAssistant/views/ManageAssistantList.d.ts +0 -3
- package/dist/containers/QuestionBank/components/AdditionalComponent.d.ts +0 -7
- package/dist/containers/QuestionBank/components/AgGridComponents.d.ts +0 -9
- package/dist/containers/QuestionBank/components/AnswerList.d.ts +0 -8
- package/dist/containers/QuestionBank/components/QuestionPreview.d.ts +0 -3
- package/dist/containers/QuestionBank/components/SliderScale.d.ts +0 -8
- package/dist/containers/QuestionBank/components/StarRating.d.ts +0 -7
- package/dist/containers/QuestionBank/configs/questionDetailSchema.d.ts +0 -21
- package/dist/containers/QuestionBank/configs/validationAnswerId.d.ts +0 -2
- package/dist/containers/QuestionBank/configs/validationChoices.d.ts +0 -2
- package/dist/containers/QuestionBank/hooks/useQuestionAnswerList.d.ts +0 -7
- package/dist/containers/QuestionBank/hooks/useQuestionDetail.d.ts +0 -23
- package/dist/containers/QuestionBank/hooks/useQuestionList.d.ts +0 -12
- package/dist/containers/QuestionBank/views/QuestionBankList.d.ts +0 -3
- package/dist/containers/QuestionBank/views/QuestionDetail.d.ts +0 -3
- package/dist/containers/QuestionCategory/components/QuestionCateModal.d.ts +0 -3
- package/dist/containers/QuestionCategory/hooks/useQuestionCateDetail.d.ts +0 -13
- package/dist/containers/QuestionCategory/hooks/useQuestionCateList.d.ts +0 -9
- package/dist/containers/QuestionCategory/views/QuestionCategogyList.d.ts +0 -3
- package/dist/containers/ReflectionForm/components/QuestionSplitPaneSelector.d.ts +0 -3
- package/dist/containers/ReflectionForm/components/ReflectionDetailModal.d.ts +0 -3
- package/dist/containers/ReflectionForm/hooks/useQuestionCategory.d.ts +0 -13
- package/dist/containers/ReflectionForm/hooks/useReflectionFormDetail.d.ts +0 -16
- package/dist/containers/ReflectionForm/hooks/useReflectionFormList.d.ts +0 -9
- package/dist/containers/ReflectionForm/views/ReflectionFormList.d.ts +0 -3
- package/dist/containers/Setup/views/SetupContainer.d.ts +0 -3
- package/dist/containers/Subject/components/SubjectDetailModal.d.ts +0 -3
- package/dist/containers/Subject/hooks/useSubjectDetail.d.ts +0 -13
- package/dist/containers/Subject/hooks/useSubjectList.d.ts +0 -9
- package/dist/containers/Subject/views/SubjectList.d.ts +0 -3
- package/dist/containers/SuggestionBank/components/SuggestionDetailModal.d.ts +0 -3
- package/dist/containers/SuggestionBank/hooks/useKeywordList.d.ts +0 -10
- package/dist/containers/SuggestionBank/hooks/useSuggestionDetail.d.ts +0 -24
- package/dist/containers/SuggestionBank/hooks/useSuggestionList.d.ts +0 -10
- package/dist/containers/SuggestionBank/views/SuggestionList.d.ts +0 -3
- package/dist/index.d.ts +0 -16
- package/dist/index.test.d.ts +0 -1
- package/dist/services/assessmentService.d.ts +0 -6
- package/dist/services/badgeService.d.ts +0 -6
- package/dist/services/classService.d.ts +0 -6
- package/dist/services/conferenceRubricService.d.ts +0 -7
- package/dist/services/feedbackService.d.ts +0 -6
- package/dist/services/goalExampleService.d.ts +0 -6
- package/dist/services/learningStrategyService.d.ts +0 -6
- package/dist/services/questionCategoryService.d.ts +0 -6
- package/dist/services/questionService.d.ts +0 -6
- package/dist/services/reflectionFormService.d.ts +0 -6
- package/dist/services/studentService.d.ts +0 -2
- package/dist/services/subjectService.d.ts +0 -6
- package/dist/services/suggestionService.d.ts +0 -6
package/dist/MarioFramework.Education/ClientApp/src/containers/CSVImport/hooks/useCSVImport.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { Option } from "../../Classes/components/TeacherSelector";
|
|
2
3
|
declare enum CSVType {
|
|
3
4
|
Students = "students",
|
|
4
5
|
Subjects = "subjects",
|
|
@@ -27,5 +28,12 @@ declare const useCSVImport: () => {
|
|
|
27
28
|
setArrStudent: import("react").Dispatch<any>;
|
|
28
29
|
arrStudent: any;
|
|
29
30
|
isCheckDomainIBS: boolean;
|
|
31
|
+
onChangeTeacher: (teacher: Option) => void;
|
|
32
|
+
uploadByTeacherId: (file: any) => Promise<void>;
|
|
33
|
+
setDataFileImportStudent: (dataFile: any) => void;
|
|
34
|
+
onUpLoadStudentFile: () => void;
|
|
35
|
+
defaultTeacher: number;
|
|
36
|
+
fileName: string;
|
|
37
|
+
onStudentSubmit: () => void;
|
|
30
38
|
};
|
|
31
39
|
export default useCSVImport;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const importCSV: (formData: FormData, subFolder: string) => Promise<import("axios").AxiosResponse<any>>;
|
|
2
2
|
export declare const importStudentCSV: (formData: FormData) => Promise<import("axios").AxiosResponse<any>>;
|
|
3
3
|
export declare const importClassReflectionCSV: (formData: FormData) => Promise<import("axios").AxiosResponse<any>>;
|
|
4
|
+
export declare const importStudentByTeacher: (teacherId: number, formData: FormData) => Promise<import("axios").AxiosResponse<any>>;
|
package/dist/index.css
CHANGED
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
/* add css module styles here (optional) */
|
|
2
|
-
:root {
|
|
3
|
-
--custom-gray: #ccc;
|
|
4
|
-
--custom-blue: #0090e3;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
._3ybTi {
|
|
9
|
-
margin: 2em;
|
|
10
|
-
padding: 0.5em;
|
|
11
|
-
border: 2px solid #000;
|
|
12
|
-
font-size: 2em;
|
|
13
|
-
text-align: center;
|
|
14
|
-
}
|
|
15
|
-
._1H0W8 {
|
|
16
|
-
height: 426px !important;
|
|
17
|
-
}
|
|
18
|
-
tbody._b-AXV {
|
|
19
|
-
height: 300px;
|
|
20
|
-
display: block;
|
|
21
|
-
width: 370px;
|
|
22
|
-
overflow: auto;
|
|
23
|
-
border: 2px solid #ced4da;
|
|
24
|
-
margin-top: 15px;
|
|
25
|
-
}
|
|
26
|
-
tbody._b-AXV::-webkit-scrollbar {
|
|
27
|
-
width: 10px;
|
|
28
|
-
background-color: #ced4da;
|
|
29
|
-
}
|
|
30
|
-
tbody._b-AXV tr td {
|
|
31
|
-
display: block;
|
|
32
|
-
width: 100%;
|
|
33
|
-
border: none;
|
|
34
|
-
}
|
|
35
|
-
tbody._b-AXV tr {
|
|
36
|
-
overflow: hidden;
|
|
37
|
-
text-overflow: ellipsis;
|
|
38
|
-
display: -webkit-box;
|
|
39
|
-
-webkit-line-clamp: 2;
|
|
40
|
-
-webkit-box-orient: vertical;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
._1fgfO {
|
|
44
|
-
width: 40px;
|
|
45
|
-
height: 40px;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
._2YR4l {
|
|
49
|
-
width: 40px;
|
|
50
|
-
height: 20px;
|
|
51
|
-
border-radius: 4px;
|
|
52
|
-
box-shadow: 1px 1px rgba(0, 0, 0, 0.4);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
._114IY {
|
|
56
|
-
max-height: 600px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
._qE7J0 {
|
|
60
|
-
width: 70px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
._2BV3o {
|
|
64
|
-
width: 300px;
|
|
65
|
-
font-size: 1.5rem;
|
|
66
|
-
font-weight: 600;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
._1P4F2 {
|
|
70
|
-
height: 40px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
._1SRmg {
|
|
74
|
-
font-weight: 500;
|
|
75
|
-
}
|
|
76
|
-
._ZDINp img {
|
|
77
|
-
width: 100px;
|
|
78
|
-
height: 100px;
|
|
79
|
-
border-radius: 50%;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
._Kzkzd > i {
|
|
83
|
-
color: #f9e517;
|
|
84
|
-
font-size: 25px;
|
|
85
|
-
margin-right: 10px;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
._Q0sF1 {
|
|
89
|
-
max-height: calc(100vh - 200px);
|
|
90
|
-
overflow-y: auto;
|
|
91
|
-
margin-bottom: 8px;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
._gu_yD {
|
|
95
|
-
font-weight: 550;
|
|
96
|
-
padding: 8px 16px;
|
|
97
|
-
border: 1px solid var(--custom-gray);
|
|
98
|
-
border-radius: 4px;
|
|
99
|
-
margin-bottom: 8px;
|
|
100
|
-
background-color: white;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
._33tYy {
|
|
104
|
-
background-color: var(--custom-blue);
|
|
105
|
-
color: white
|
|
106
|
-
}
|
|
107
|
-
._3DVMZ {
|
|
108
|
-
display: flex;
|
|
109
|
-
flex: 0 0 17%;
|
|
110
|
-
flex-direction: column;
|
|
111
|
-
margin-right: 2rem;
|
|
112
|
-
}
|
|
113
|
-
._3DVMZ > div {
|
|
114
|
-
border: 1px solid #eaeaea;
|
|
115
|
-
}
|
|
116
|
-
h6._3zOGW {
|
|
117
|
-
text-decoration: underline;
|
|
118
|
-
font-size: 13px;
|
|
119
|
-
cursor: pointer;
|
|
120
|
-
}
|
|
121
|
-
._3DQwX {
|
|
122
|
-
padding: 10px 0px 20px;
|
|
123
|
-
border-bottom: 1px solid #cdcdcd;
|
|
124
|
-
}
|
|
1
|
+
/* add css module styles here (optional) */
|
|
2
|
+
:root {
|
|
3
|
+
--custom-gray: #ccc;
|
|
4
|
+
--custom-blue: #0090e3;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
._3ybTi {
|
|
9
|
+
margin: 2em;
|
|
10
|
+
padding: 0.5em;
|
|
11
|
+
border: 2px solid #000;
|
|
12
|
+
font-size: 2em;
|
|
13
|
+
text-align: center;
|
|
14
|
+
}
|
|
15
|
+
._1H0W8 {
|
|
16
|
+
height: 426px !important;
|
|
17
|
+
}
|
|
18
|
+
tbody._b-AXV {
|
|
19
|
+
height: 300px;
|
|
20
|
+
display: block;
|
|
21
|
+
width: 370px;
|
|
22
|
+
overflow: auto;
|
|
23
|
+
border: 2px solid #ced4da;
|
|
24
|
+
margin-top: 15px;
|
|
25
|
+
}
|
|
26
|
+
tbody._b-AXV::-webkit-scrollbar {
|
|
27
|
+
width: 10px;
|
|
28
|
+
background-color: #ced4da;
|
|
29
|
+
}
|
|
30
|
+
tbody._b-AXV tr td {
|
|
31
|
+
display: block;
|
|
32
|
+
width: 100%;
|
|
33
|
+
border: none;
|
|
34
|
+
}
|
|
35
|
+
tbody._b-AXV tr {
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
text-overflow: ellipsis;
|
|
38
|
+
display: -webkit-box;
|
|
39
|
+
-webkit-line-clamp: 2;
|
|
40
|
+
-webkit-box-orient: vertical;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
._1fgfO {
|
|
44
|
+
width: 40px;
|
|
45
|
+
height: 40px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
._2YR4l {
|
|
49
|
+
width: 40px;
|
|
50
|
+
height: 20px;
|
|
51
|
+
border-radius: 4px;
|
|
52
|
+
box-shadow: 1px 1px rgba(0, 0, 0, 0.4);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
._114IY {
|
|
56
|
+
max-height: 600px;
|
|
57
|
+
}
|
|
125
58
|
|
|
126
|
-
.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
59
|
+
._qE7J0 {
|
|
60
|
+
width: 70px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
._2BV3o {
|
|
64
|
+
width: 300px;
|
|
65
|
+
font-size: 1.5rem;
|
|
66
|
+
font-weight: 600;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
._1P4F2 {
|
|
70
|
+
height: 40px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
._1SRmg {
|
|
74
|
+
font-weight: 500;
|
|
75
|
+
}
|
|
76
|
+
._ZDINp img {
|
|
77
|
+
width: 100px;
|
|
78
|
+
height: 100px;
|
|
79
|
+
border-radius: 50%;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
._Kzkzd > i {
|
|
83
|
+
color: #f9e517;
|
|
84
|
+
font-size: 25px;
|
|
85
|
+
margin-right: 10px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
._Q0sF1 {
|
|
89
|
+
max-height: calc(100vh - 200px);
|
|
90
|
+
overflow-y: auto;
|
|
91
|
+
margin-bottom: 8px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
._gu_yD {
|
|
95
|
+
font-weight: 550;
|
|
96
|
+
padding: 8px 16px;
|
|
97
|
+
border: 1px solid var(--custom-gray);
|
|
98
|
+
border-radius: 4px;
|
|
99
|
+
margin-bottom: 8px;
|
|
100
|
+
background-color: white;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
._33tYy {
|
|
104
|
+
background-color: var(--custom-blue);
|
|
105
|
+
color: white
|
|
106
|
+
}
|
|
107
|
+
._3DVMZ {
|
|
108
|
+
display: flex;
|
|
109
|
+
flex: 0 0 17%;
|
|
110
|
+
flex-direction: column;
|
|
111
|
+
margin-right: 2rem;
|
|
112
|
+
}
|
|
113
|
+
._3DVMZ > div {
|
|
114
|
+
border: 1px solid #eaeaea;
|
|
115
|
+
}
|
|
116
|
+
h6._3zOGW {
|
|
117
|
+
text-decoration: underline;
|
|
118
|
+
font-size: 13px;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
}
|
|
121
|
+
._3DQwX {
|
|
122
|
+
padding: 10px 0px 20px;
|
|
123
|
+
border-bottom: 1px solid #cdcdcd;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
._1Jgr2 {
|
|
127
|
+
border: 1px solid grey;
|
|
128
|
+
padding: 16px;
|
|
129
|
+
min-height: 450px;
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
._3Thdy {
|
|
135
|
+
max-width: 200px;
|
|
136
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -5195,7 +5195,8 @@ var style = {
|
|
|
5195
5195
|
color: "#fff",
|
|
5196
5196
|
fontWeight: 500,
|
|
5197
5197
|
fontSize: "0.9em",
|
|
5198
|
-
height: "
|
|
5198
|
+
height: "35px",
|
|
5199
|
+
justifyContent: "center"
|
|
5199
5200
|
};
|
|
5200
5201
|
|
|
5201
5202
|
var UploadCSVButton = function UploadCSVButton(_ref) {
|
|
@@ -5209,7 +5210,7 @@ var UploadCSVButton = function UploadCSVButton(_ref) {
|
|
|
5209
5210
|
htmlFor: htmlFor,
|
|
5210
5211
|
role: "button",
|
|
5211
5212
|
tabIndex: 0,
|
|
5212
|
-
className: "d-flex align-items-center justfy-content-center
|
|
5213
|
+
className: "d-flex align-items-center justfy-content-center\n " + (isClassReflection ? "w-25" : "") + "\n " + (!isDisabled ? "cursor-pointer hover-opacity" : ""),
|
|
5213
5214
|
style: _extends({}, style, {
|
|
5214
5215
|
backgroundColor: backgroundColor,
|
|
5215
5216
|
opacity: !isDisabled ? 1 : 0.5
|
|
@@ -5234,6 +5235,9 @@ var importStudentCSV = function importStudentCSV(formData) {
|
|
|
5234
5235
|
var importClassReflectionCSV = function importClassReflectionCSV(formData) {
|
|
5235
5236
|
return marioCore.apiUpload.post(CSV_FILE_URL + "/importClassReflection", formData);
|
|
5236
5237
|
};
|
|
5238
|
+
var importStudentByTeacher = function importStudentByTeacher(teacherId, formData) {
|
|
5239
|
+
return marioCore.apiUpload.post(CSV_FILE_TEACHER + "/adminImportStudentByTeacherId/" + teacherId, formData);
|
|
5240
|
+
};
|
|
5237
5241
|
|
|
5238
5242
|
var CSVType;
|
|
5239
5243
|
|
|
@@ -5282,8 +5286,21 @@ var useCSVImport = function useCSVImport() {
|
|
|
5282
5286
|
initImportReflection = _useState4[0],
|
|
5283
5287
|
setInitImportReflection = _useState4[1];
|
|
5284
5288
|
|
|
5289
|
+
var _useState5 = React.useState(),
|
|
5290
|
+
studentDataFile = _useState5[0],
|
|
5291
|
+
setStudentDataFile = _useState5[1];
|
|
5292
|
+
|
|
5285
5293
|
var domainName = window.location.hostname;
|
|
5286
5294
|
var isCheckDomainIBS = domainName.includes('isb');
|
|
5295
|
+
|
|
5296
|
+
var _useState6 = React.useState(0),
|
|
5297
|
+
defaultTeacher = _useState6[0],
|
|
5298
|
+
setDefaultTeacher = _useState6[1];
|
|
5299
|
+
|
|
5300
|
+
var _useState7 = React.useState(""),
|
|
5301
|
+
fileName = _useState7[0],
|
|
5302
|
+
setFileName = _useState7[1];
|
|
5303
|
+
|
|
5287
5304
|
React.useEffect(function () {
|
|
5288
5305
|
document.title = title;
|
|
5289
5306
|
}, []);
|
|
@@ -5353,9 +5370,52 @@ var useCSVImport = function useCSVImport() {
|
|
|
5353
5370
|
}
|
|
5354
5371
|
}, [type]);
|
|
5355
5372
|
|
|
5356
|
-
var
|
|
5373
|
+
var uploadByTeacherId = function uploadByTeacherId(file) {
|
|
5357
5374
|
try {
|
|
5358
5375
|
var _temp14 = function _temp14() {
|
|
5376
|
+
dispatch(marioCore.setLoading(false));
|
|
5377
|
+
var input = document.getElementById('teacherSelector');
|
|
5378
|
+
input && (input.value = "");
|
|
5379
|
+
};
|
|
5380
|
+
|
|
5381
|
+
if (!defaultTeacher) {
|
|
5382
|
+
dispatch(marioCore.setAlert({
|
|
5383
|
+
type: "danger",
|
|
5384
|
+
message: "Select teacher before import csv"
|
|
5385
|
+
}));
|
|
5386
|
+
return Promise.resolve();
|
|
5387
|
+
}
|
|
5388
|
+
|
|
5389
|
+
if (!type || !file) return Promise.resolve();
|
|
5390
|
+
dispatch(marioCore.setLoading(true));
|
|
5391
|
+
|
|
5392
|
+
var _temp15 = _catch(function () {
|
|
5393
|
+
var formData = new FormData();
|
|
5394
|
+
formData.append("file", file, file.name);
|
|
5395
|
+
return Promise.resolve(importStudentByTeacher(defaultTeacher, formData)).then(function () {
|
|
5396
|
+
dispatch(marioCore.setAlert({
|
|
5397
|
+
type: "success",
|
|
5398
|
+
message: "Import CSV successfully"
|
|
5399
|
+
}));
|
|
5400
|
+
});
|
|
5401
|
+
}, function (err) {
|
|
5402
|
+
var _err$response2, _err$response2$data;
|
|
5403
|
+
|
|
5404
|
+
dispatch(marioCore.setAlert({
|
|
5405
|
+
type: "danger",
|
|
5406
|
+
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
|
|
5407
|
+
}));
|
|
5408
|
+
});
|
|
5409
|
+
|
|
5410
|
+
return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(_temp14) : _temp14(_temp15));
|
|
5411
|
+
} catch (e) {
|
|
5412
|
+
return Promise.reject(e);
|
|
5413
|
+
}
|
|
5414
|
+
};
|
|
5415
|
+
|
|
5416
|
+
var onConfirm = function onConfirm(values) {
|
|
5417
|
+
try {
|
|
5418
|
+
var _temp18 = function _temp18() {
|
|
5359
5419
|
dispatch(marioCore.setLoading(false));
|
|
5360
5420
|
var input = document.getElementById(id);
|
|
5361
5421
|
input && (input.value = "");
|
|
@@ -5364,7 +5424,7 @@ var useCSVImport = function useCSVImport() {
|
|
|
5364
5424
|
if (!dataFile || !dataFile) return Promise.resolve();
|
|
5365
5425
|
dispatch(marioCore.setLoading(true));
|
|
5366
5426
|
|
|
5367
|
-
var
|
|
5427
|
+
var _temp19 = _catch(function () {
|
|
5368
5428
|
var formData = new FormData();
|
|
5369
5429
|
formData.append("file", dataFile, dataFile.name);
|
|
5370
5430
|
formData.append("teacherName", values.teacherName);
|
|
@@ -5380,20 +5440,52 @@ var useCSVImport = function useCSVImport() {
|
|
|
5380
5440
|
setInitImportReflection(initClassReflect);
|
|
5381
5441
|
});
|
|
5382
5442
|
}, function (err) {
|
|
5383
|
-
var _err$
|
|
5443
|
+
var _err$response3, _err$response3$data;
|
|
5384
5444
|
|
|
5385
5445
|
dispatch(marioCore.setAlert({
|
|
5386
5446
|
type: "danger",
|
|
5387
|
-
message: ((_err$
|
|
5447
|
+
message: ((_err$response3 = err.response) === null || _err$response3 === void 0 ? void 0 : (_err$response3$data = _err$response3.data) === null || _err$response3$data === void 0 ? void 0 : _err$response3$data.title) || err.message
|
|
5388
5448
|
}));
|
|
5389
5449
|
});
|
|
5390
5450
|
|
|
5391
|
-
return Promise.resolve(
|
|
5451
|
+
return Promise.resolve(_temp19 && _temp19.then ? _temp19.then(_temp18) : _temp18(_temp19));
|
|
5392
5452
|
} catch (e) {
|
|
5393
5453
|
return Promise.reject(e);
|
|
5394
5454
|
}
|
|
5395
5455
|
};
|
|
5396
5456
|
|
|
5457
|
+
var onChangeTeacher = function onChangeTeacher(teacher) {
|
|
5458
|
+
setDefaultTeacher(teacher.value);
|
|
5459
|
+
};
|
|
5460
|
+
|
|
5461
|
+
var setDataFileImportStudent = function setDataFileImportStudent(dataFile) {
|
|
5462
|
+
setStudentDataFile(dataFile);
|
|
5463
|
+
setFileName((dataFile === null || dataFile === void 0 ? void 0 : dataFile.name) || "");
|
|
5464
|
+
};
|
|
5465
|
+
|
|
5466
|
+
var onUpLoadStudentFile = function onUpLoadStudentFile() {
|
|
5467
|
+
if (!studentDataFile) {
|
|
5468
|
+
dispatch(marioCore.setAlert({
|
|
5469
|
+
type: "danger",
|
|
5470
|
+
message: "Select CSV to import"
|
|
5471
|
+
}));
|
|
5472
|
+
return;
|
|
5473
|
+
}
|
|
5474
|
+
|
|
5475
|
+
uploadByTeacherId(studentDataFile);
|
|
5476
|
+
};
|
|
5477
|
+
|
|
5478
|
+
var onStudentSubmit = function onStudentSubmit() {
|
|
5479
|
+
dispatch(marioCore.setModal({
|
|
5480
|
+
isOpen: true,
|
|
5481
|
+
type: "warning",
|
|
5482
|
+
message: "Are you sure upload this file?",
|
|
5483
|
+
onConfirm: function onConfirm() {
|
|
5484
|
+
onUpLoadStudentFile();
|
|
5485
|
+
}
|
|
5486
|
+
}));
|
|
5487
|
+
};
|
|
5488
|
+
|
|
5397
5489
|
return {
|
|
5398
5490
|
isLoading: isLoading,
|
|
5399
5491
|
buttons: buttons,
|
|
@@ -5408,7 +5500,14 @@ var useCSVImport = function useCSVImport() {
|
|
|
5408
5500
|
setDataFile: setDataFile,
|
|
5409
5501
|
setArrStudent: setArrStudent,
|
|
5410
5502
|
arrStudent: arrStudent,
|
|
5411
|
-
isCheckDomainIBS: isCheckDomainIBS
|
|
5503
|
+
isCheckDomainIBS: isCheckDomainIBS,
|
|
5504
|
+
onChangeTeacher: onChangeTeacher,
|
|
5505
|
+
uploadByTeacherId: uploadByTeacherId,
|
|
5506
|
+
setDataFileImportStudent: setDataFileImportStudent,
|
|
5507
|
+
onUpLoadStudentFile: onUpLoadStudentFile,
|
|
5508
|
+
defaultTeacher: defaultTeacher,
|
|
5509
|
+
fileName: fileName,
|
|
5510
|
+
onStudentSubmit: onStudentSubmit
|
|
5412
5511
|
};
|
|
5413
5512
|
};
|
|
5414
5513
|
|
|
@@ -5435,10 +5534,15 @@ var CSVImport = function CSVImport() {
|
|
|
5435
5534
|
setArrStudent = _useCSVImport.setArrStudent,
|
|
5436
5535
|
buttons = _useCSVImport.buttons,
|
|
5437
5536
|
upload = _useCSVImport.upload,
|
|
5438
|
-
isCheckDomainIBS = _useCSVImport.isCheckDomainIBS
|
|
5537
|
+
isCheckDomainIBS = _useCSVImport.isCheckDomainIBS,
|
|
5538
|
+
onChangeTeacher = _useCSVImport.onChangeTeacher,
|
|
5539
|
+
setDataFileImportStudent = _useCSVImport.setDataFileImportStudent,
|
|
5540
|
+
defaultTeacher = _useCSVImport.defaultTeacher,
|
|
5541
|
+
fileName = _useCSVImport.fileName,
|
|
5542
|
+
onStudentSubmit = _useCSVImport.onStudentSubmit;
|
|
5439
5543
|
|
|
5440
5544
|
return React__default.createElement("div", {
|
|
5441
|
-
className: "animated fadeIn pt-
|
|
5545
|
+
className: "animated fadeIn pt-5"
|
|
5442
5546
|
}, isCheckDomainIBS ? React__default.createElement(React__default.Fragment, null, React__default.createElement(reactstrap.Input, {
|
|
5443
5547
|
className: "d-none",
|
|
5444
5548
|
type: "file",
|
|
@@ -5531,7 +5635,43 @@ var CSVImport = function CSVImport() {
|
|
|
5531
5635
|
}
|
|
5532
5636
|
});
|
|
5533
5637
|
})))));
|
|
5534
|
-
}))) : React__default.createElement(React__default.Fragment, null, React__default.createElement(reactstrap.
|
|
5638
|
+
}))) : React__default.createElement(React__default.Fragment, null, React__default.createElement(reactstrap.Row, null, React__default.createElement(reactstrap.Col, {
|
|
5639
|
+
md: 3,
|
|
5640
|
+
className: "mb-3"
|
|
5641
|
+
}, React__default.createElement(TeacherSelector, {
|
|
5642
|
+
defaultValue: defaultTeacher,
|
|
5643
|
+
onChange: onChangeTeacher
|
|
5644
|
+
}), React__default.createElement("div", {
|
|
5645
|
+
className: "mt-3"
|
|
5646
|
+
}, fileName ? React__default.createElement("span", {
|
|
5647
|
+
className: "font-italic mb-1 font-lg"
|
|
5648
|
+
}, fileName) : null, React__default.createElement(reactstrap.Input, {
|
|
5649
|
+
className: "d-none",
|
|
5650
|
+
type: "file",
|
|
5651
|
+
id: "teacherSelector",
|
|
5652
|
+
onChange: function onChange(e) {
|
|
5653
|
+
return setDataFileImportStudent(e.target.files[0]);
|
|
5654
|
+
},
|
|
5655
|
+
accept: "text/csv"
|
|
5656
|
+
}), React__default.createElement(UploadCSVButton, {
|
|
5657
|
+
key: "Import student",
|
|
5658
|
+
htmlFor: "teacherSelector",
|
|
5659
|
+
text: "Select CSV",
|
|
5660
|
+
isDisabled: isLoading,
|
|
5661
|
+
backgroundColor: "#e74c3c",
|
|
5662
|
+
onClick: function onClick() {
|
|
5663
|
+
return setType(CSVType.Students);
|
|
5664
|
+
}
|
|
5665
|
+
})), React__default.createElement(reactstrap.Button, {
|
|
5666
|
+
color: "success",
|
|
5667
|
+
onClick: onStudentSubmit,
|
|
5668
|
+
className: "w-100 mt-3"
|
|
5669
|
+
}, "Import")), React__default.createElement(reactstrap.Col, {
|
|
5670
|
+
md: 3
|
|
5671
|
+
}), React__default.createElement(reactstrap.Col, {
|
|
5672
|
+
md: 3,
|
|
5673
|
+
className: "mb-3"
|
|
5674
|
+
}, React__default.createElement(reactstrap.Input, {
|
|
5535
5675
|
className: "d-none",
|
|
5536
5676
|
type: "file",
|
|
5537
5677
|
id: id,
|
|
@@ -5539,9 +5679,7 @@ var CSVImport = function CSVImport() {
|
|
|
5539
5679
|
return upload(e.target.files[0]);
|
|
5540
5680
|
},
|
|
5541
5681
|
accept: "text/csv"
|
|
5542
|
-
}),
|
|
5543
|
-
className: "d-flex align-items-center"
|
|
5544
|
-
}, buttons.map(function (button) {
|
|
5682
|
+
}), buttons.map(function (button) {
|
|
5545
5683
|
return React__default.createElement(UploadCSVButton, {
|
|
5546
5684
|
key: button.text,
|
|
5547
5685
|
htmlFor: id,
|
|
@@ -5552,7 +5690,7 @@ var CSVImport = function CSVImport() {
|
|
|
5552
5690
|
return setType(button.type);
|
|
5553
5691
|
}
|
|
5554
5692
|
});
|
|
5555
|
-
}))));
|
|
5693
|
+
})))));
|
|
5556
5694
|
};
|
|
5557
5695
|
|
|
5558
5696
|
var schema$5 = yup.object({
|