mario-teacher-student-client 2.1.88-admin → 2.1.89-admin

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.
@@ -1,9 +1,15 @@
1
1
  import { FILTER_SESSION } from "../constants/types";
2
+ interface STUDENT_INFO {
3
+ fullName: string;
4
+ email: string;
5
+ }
2
6
  declare const useClassReflectionList: () => {
3
7
  changeFilters: (updatedFilters: any) => void;
4
8
  filters: FILTER_SESSION;
5
9
  getDataClassReflections: (filters: any, studentId: any) => Promise<void>;
6
10
  classReflectionData: any;
7
11
  classFontSize: string;
12
+ getStudentInfo: (studentId: number) => Promise<void>;
13
+ studentInfo: STUDENT_INFO | undefined;
8
14
  };
9
15
  export default useClassReflectionList;
package/dist/index.js CHANGED
@@ -4046,6 +4046,9 @@ var getAllDesginations = function getAllDesginations() {
4046
4046
  var downloadTemplateFile = function downloadTemplateFile() {
4047
4047
  return marioCore.api.get(TEACHER_URL$1 + "/download-template-file");
4048
4048
  };
4049
+ var getStudentName = function getStudentName(studentId) {
4050
+ return marioCore.api.get(STUDENT_URL + "/info/" + studentId);
4051
+ };
4049
4052
 
4050
4053
  var useChangeRoteQuestion = function useChangeRoteQuestion() {
4051
4054
  var dispatch = reactRedux.useDispatch();
@@ -12227,7 +12230,6 @@ var ConductIndex = function ConductIndex() {
12227
12230
  listQuestionStudents = _useConductOne.listQuestionStudents,
12228
12231
  listQuestionTeachers = _useConductOne.listQuestionTeachers,
12229
12232
  listLearningStrategory = _useConductOne.listLearningStrategory,
12230
- listLearningStrategoryCategory = _useConductOne.listLearningStrategoryCategory,
12231
12233
  updateQuestionAnswer = _useConductOne.updateQuestionAnswer,
12232
12234
  isUnlocked = _useConductOne.isUnlocked,
12233
12235
  setIsUnclocked = _useConductOne.setIsUnclocked,
@@ -12249,7 +12251,6 @@ var ConductIndex = function ConductIndex() {
12249
12251
  isUserChangeSession = _useConductOne.isUserChangeSession,
12250
12252
  numberOfEdit = _useConductOne.numberOfEdit,
12251
12253
  learningSupportCategoryId = _useConductOne.learningSupportCategoryId,
12252
- setLearningSupportCategoryId = _useConductOne.setLearningSupportCategoryId,
12253
12254
  isConversation = _useConductOne.isConversation,
12254
12255
  setConversation = _useConductOne.setConversation,
12255
12256
  onChangeConversationSession = _useConductOne.onChangeConversationSession,
@@ -12293,11 +12294,6 @@ var ConductIndex = function ConductIndex() {
12293
12294
  updateQuestionAnswer(questionId, value);
12294
12295
  };
12295
12296
 
12296
- var onChangeSessionCategory = function onChangeSessionCategory(event) {
12297
- var value = event.target.value;
12298
- setLearningSupportCategoryId(parseInt(value));
12299
- };
12300
-
12301
12297
  var onChangeAfterSession = function onChangeAfterSession(checkedAfter) {
12302
12298
  setIsUnclocked(checkedAfter);
12303
12299
  onChangeToogleAfterSession();
@@ -12380,19 +12376,6 @@ var ConductIndex = function ConductIndex() {
12380
12376
  setOpenScaffolding(false);
12381
12377
  };
12382
12378
 
12383
- var compare = function compare(a, b) {
12384
- if (a.name < b.name) {
12385
- return -1;
12386
- }
12387
-
12388
- if (a.name > b.name) {
12389
- return 1;
12390
- }
12391
-
12392
- return 0;
12393
- };
12394
-
12395
- var listSorted = !!listLearningStrategoryCategory && listLearningStrategoryCategory.sort(compare);
12396
12379
  return React__default.createElement("div", {
12397
12380
  className: styles$4["page-conduct"] + " " + styles$4[classFontSize]
12398
12381
  }, React__default.createElement(HeaderComponent, {
@@ -12451,67 +12434,7 @@ var ConductIndex = function ConductIndex() {
12451
12434
  return onChangeQuestionAnswer(questionSummarize[0].id, event.target.value);
12452
12435
  },
12453
12436
  value: (_questionSummarize$4 = questionSummarize[0]) === null || _questionSummarize$4 === void 0 ? void 0 : _questionSummarize$4.answer
12454
- })))), isConversation && React__default.createElement("div", {
12455
- className: styles$4["block-question"]
12456
- }, React__default.createElement("div", {
12457
- className: styles$4["title-strategories"]
12458
- }, React__default.createElement("div", {
12459
- className: styles$4["strategories-title"]
12460
- }, React__default.createElement("h2", {
12461
- className: styles$4["font-title"]
12462
- }, "Session Type"))), React__default.createElement("div", {
12463
- className: styles$4["block-session-type"]
12464
- }, React__default.createElement("div", {
12465
- className: styles$4["session-text"]
12466
- }, React__default.createElement("h2", null, "What is this session type?")), React__default.createElement("div", {
12467
- className: styles$4["session-select"]
12468
- }, React__default.createElement(core.FormControl, {
12469
- variant: "outlined",
12470
- style: {
12471
- minWidth: 300
12472
- }
12473
- }, React__default.createElement(core.InputLabel, {
12474
- htmlFor: "outlined-age-native-simple"
12475
- }, "Session type"), isUserChangeSession ? React__default.createElement(core.Select, {
12476
- "native": true,
12477
- value: learningSupportCategoryId,
12478
- onChange: function onChange(event) {
12479
- return onChangeSessionCategory(event);
12480
- },
12481
- label: "Session type",
12482
- inputProps: {
12483
- name: "age",
12484
- id: "outlined-age-native-simple"
12485
- },
12486
- style: {
12487
- borderRadius: "12px",
12488
- overflow: "hidden"
12489
- }
12490
- }, React__default.createElement("option", {
12491
- "aria-label": "None",
12492
- value: ""
12493
- }), listSorted === null || listSorted === void 0 ? void 0 : listSorted.map(function (item) {
12494
- return React__default.createElement("option", {
12495
- value: item.id,
12496
- style: {
12497
- color: "black"
12498
- },
12499
- key: item.id
12500
- }, item.name);
12501
- })) : React__default.createElement(core.Select, {
12502
- "native": true,
12503
- value: setLearningSupportCategoryId,
12504
- label: "Session type",
12505
- inputProps: {
12506
- name: "age",
12507
- id: "outlined-age-native-simple"
12508
- },
12509
- style: {
12510
- borderRadius: "12px",
12511
- overflow: "hidden"
12512
- },
12513
- disabled: true
12514
- }))))), isTeacher && isConversation && React__default.createElement("div", {
12437
+ })))), isTeacher && isConversation && React__default.createElement("div", {
12515
12438
  className: styles$4["block-question"]
12516
12439
  }, React__default.createElement("div", {
12517
12440
  className: styles$4["title-strategories"]
@@ -17337,7 +17260,8 @@ var StudentTabs = function StudentTabs(props) {
17337
17260
  var history = reactRouterDom.useHistory();
17338
17261
  var location = reactRouterDom.useLocation();
17339
17262
  var pathname = location.pathname;
17340
- var tabs = props.tabs;
17263
+ var tabs = props.tabs,
17264
+ studentInfo = props.studentInfo;
17341
17265
 
17342
17266
  var toggle = function toggle(path) {
17343
17267
  history.push(path);
@@ -17347,10 +17271,6 @@ var StudentTabs = function StudentTabs(props) {
17347
17271
  defaultFont = _useFontStyles.defaultFont;
17348
17272
 
17349
17273
  var studentId = location.pathname.replace(/[^0-9]/g, "");
17350
-
17351
- var _useStudentInfo = useStudentInfo(parseInt(studentId)),
17352
- studentInfo = _useStudentInfo.studentInfo;
17353
-
17354
17274
  var user = reactRedux.useSelector(function (state) {
17355
17275
  var _state$common;
17356
17276
 
@@ -17468,7 +17388,7 @@ var StudentTabs = function StudentTabs(props) {
17468
17388
  onClick: function onClick() {
17469
17389
  return goBack();
17470
17390
  }
17471
- }), " ", studentInfo && studentInfo.name ? studentInfo.name : "")), React__default.createElement(core.Grid, {
17391
+ }), " ", !!studentInfo && !!(studentInfo !== null && studentInfo !== void 0 && studentInfo.fullName) ? studentInfo === null || studentInfo === void 0 ? void 0 : studentInfo.fullName : "")), React__default.createElement(core.Grid, {
17472
17392
  item: true,
17473
17393
  xs: 12,
17474
17394
  style: {
@@ -30937,6 +30857,10 @@ var useClassReflectionList = function useClassReflectionList() {
30937
30857
  classReflectionData = _useState[0],
30938
30858
  setClassReflectionData = _useState[1];
30939
30859
 
30860
+ var _useState2 = React.useState(),
30861
+ studentInfo = _useState2[0],
30862
+ setStudentInfo = _useState2[1];
30863
+
30940
30864
  var defaultFont = reactRedux.useSelector(function (state) {
30941
30865
  var _state$common;
30942
30866
 
@@ -30954,15 +30878,15 @@ var useClassReflectionList = function useClassReflectionList() {
30954
30878
  return '';
30955
30879
  }, [defaultFont]);
30956
30880
 
30957
- var _useState2 = React.useState({
30881
+ var _useState3 = React.useState({
30958
30882
  currentPage: 1,
30959
30883
  pageSize: 10,
30960
30884
  searchString: "",
30961
30885
  sortBy: "classType",
30962
30886
  sortOrder: "DESC"
30963
30887
  }),
30964
- filters = _useState2[0],
30965
- setFilters = _useState2[1];
30888
+ filters = _useState3[0],
30889
+ setFilters = _useState3[1];
30966
30890
 
30967
30891
  var changeFilters = function changeFilters(updatedFilters) {
30968
30892
  return setFilters(_extends({}, filters, updatedFilters));
@@ -30994,12 +30918,42 @@ var useClassReflectionList = function useClassReflectionList() {
30994
30918
  return Promise.reject(e);
30995
30919
  }
30996
30920
  }, [filters]);
30921
+
30922
+ var getStudentInfo = function getStudentInfo(studentId) {
30923
+ try {
30924
+ var _temp7 = function _temp7() {
30925
+ dispatch(marioCore.setLoading(false));
30926
+ };
30927
+
30928
+ dispatch(marioCore.setLoading(true));
30929
+
30930
+ var _temp8 = _catch(function () {
30931
+ return Promise.resolve(getStudentName(studentId)).then(function (res) {
30932
+ setStudentInfo(res.data);
30933
+ });
30934
+ }, function (err) {
30935
+ var _err$response, _err$response$data;
30936
+
30937
+ dispatch(marioCore.setAlert({
30938
+ type: "danger",
30939
+ 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
30940
+ }));
30941
+ });
30942
+
30943
+ return Promise.resolve(_temp8 && _temp8.then ? _temp8.then(_temp7) : _temp7(_temp8));
30944
+ } catch (e) {
30945
+ return Promise.reject(e);
30946
+ }
30947
+ };
30948
+
30997
30949
  return {
30998
30950
  changeFilters: changeFilters,
30999
30951
  filters: filters,
31000
30952
  getDataClassReflections: getDataClassReflections,
31001
30953
  classReflectionData: classReflectionData,
31002
- classFontSize: classFontSize
30954
+ classFontSize: classFontSize,
30955
+ getStudentInfo: getStudentInfo,
30956
+ studentInfo: studentInfo
31003
30957
  };
31004
30958
  };
31005
30959
 
@@ -34414,7 +34368,7 @@ var remove = function remove(studentId, friendId) {
34414
34368
  var getTotalFriends = function getTotalFriends(studentId) {
34415
34369
  return marioCore.api.get(CIRCLE_FRIEND_URL + "/friendCircleAllStudent/" + studentId);
34416
34370
  };
34417
- var getStudentName = function getStudentName(studentId) {
34371
+ var getStudentName$1 = function getStudentName(studentId) {
34418
34372
  return marioCore.api.get(CIRCLE_FRIEND_URL + "/" + studentId + "/name");
34419
34373
  };
34420
34374
 
@@ -34616,7 +34570,7 @@ var update$1 = function update(studentId, activityId, data) {
34616
34570
  var remove$1 = function remove(studentId, activityId) {
34617
34571
  return marioCore.api["delete"](ACTIVITY_CIRCLE + "/" + studentId + "/studentActivities/" + activityId);
34618
34572
  };
34619
- var getStudentName$1 = function getStudentName(studentId) {
34573
+ var getStudentName$2 = function getStudentName(studentId) {
34620
34574
  return marioCore.api.get(ACTIVITY_CIRCLE + "/" + studentId + "/name");
34621
34575
  };
34622
34576
 
@@ -35542,6 +35496,11 @@ var tabConversation = {
35542
35496
  };
35543
35497
 
35544
35498
  var StudentDetail = function StudentDetail() {
35499
+ var _useClassReflectionLi = useClassReflectionList(),
35500
+ getStudentInfo = _useClassReflectionLi.getStudentInfo,
35501
+ studentInfo = _useClassReflectionLi.studentInfo;
35502
+
35503
+ var studentId = location.pathname.replace(/[^0-9]/g, "");
35545
35504
  var isEnableIEP = reactRedux.useSelector(function (state) {
35546
35505
  var _state$common;
35547
35506
 
@@ -35562,8 +35521,12 @@ var StudentDetail = function StudentDetail() {
35562
35521
  tabLists = [].concat(tabLists, [tabConversation]);
35563
35522
  }
35564
35523
 
35524
+ React.useEffect(function () {
35525
+ getStudentInfo === null || getStudentInfo === void 0 ? void 0 : getStudentInfo(parseInt(studentId));
35526
+ }, []);
35565
35527
  return React__default.createElement(Box, null, React__default.createElement(StudentTabs, {
35566
- tabs: tabLists
35528
+ tabs: tabLists,
35529
+ studentInfo: studentInfo
35567
35530
  }));
35568
35531
  };
35569
35532
 
@@ -50293,7 +50256,7 @@ var useListFriend = function useListFriend() {
50293
50256
  dispatch(marioCore.setLoading(true));
50294
50257
 
50295
50258
  var _temp4 = _catch(function () {
50296
- return Promise.resolve(getStudentName(parseInt(studentId))).then(function (res) {
50259
+ return Promise.resolve(getStudentName$1(parseInt(studentId))).then(function (res) {
50297
50260
  setNameStudent(res.data);
50298
50261
  });
50299
50262
  }, function (err) {
@@ -51631,7 +51594,7 @@ var useListActivity = function useListActivity() {
51631
51594
  dispatch(marioCore.setLoading(true));
51632
51595
 
51633
51596
  var _temp8 = _catch(function () {
51634
- return Promise.resolve(getStudentName$1(parseInt(studentId))).then(function (res) {
51597
+ return Promise.resolve(getStudentName$2(parseInt(studentId))).then(function (res) {
51635
51598
  setNameStudent(res.data);
51636
51599
  });
51637
51600
  }, function (err) {