mario-teacher-student-client 1.9.8 → 2.0.1

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.
@@ -17,5 +17,6 @@ declare const useUpComing: () => {
17
17
  nextSession: any;
18
18
  nextTimeMeeting: () => Promise<void>;
19
19
  getStudentSelector: () => Promise<void>;
20
+ studentNameReq: string | null;
20
21
  };
21
22
  export default useUpComing;
@@ -20,5 +20,6 @@ declare const useUpComing: () => {
20
20
  getAllNoteConference: (sessionId: any) => Promise<void>;
21
21
  updateConferenceRubricPrivateNote: (privateNote: any, conferenceId: any) => Promise<void>;
22
22
  deleteNoteConference: (noteId: any, sessionId: any) => Promise<void>;
23
+ studentNameReq: string | null;
23
24
  };
24
25
  export default useUpComing;
package/dist/index.js CHANGED
@@ -28,6 +28,8 @@ var Tabs = _interopDefault(require('@material-ui/core/Tabs'));
28
28
  var Tab = _interopDefault(require('@material-ui/core/Tab'));
29
29
  var Box = _interopDefault(require('@material-ui/core/Box'));
30
30
  var AddBoxIcon = _interopDefault(require('@material-ui/icons/AddBox'));
31
+ var _ = require('lodash');
32
+ var ___default = _interopDefault(_);
31
33
  var Autocomplete = _interopDefault(require('@material-ui/lab/Autocomplete'));
32
34
  var SearchIcon = _interopDefault(require('@material-ui/icons/Search'));
33
35
  var ArrowDropDownIcon = _interopDefault(require('@material-ui/icons/ArrowDropDown'));
@@ -45,7 +47,6 @@ var TableRow = _interopDefault(require('@material-ui/core/TableRow'));
45
47
  var FilterListIcon = _interopDefault(require('@material-ui/icons/FilterList'));
46
48
  var StarBorderIcon = _interopDefault(require('@material-ui/icons/StarBorder'));
47
49
  var StarIcon = _interopDefault(require('@material-ui/icons/Star'));
48
- var _ = _interopDefault(require('lodash'));
49
50
  var styled = _interopDefault(require('@emotion/styled'));
50
51
  var TimelineIcon = _interopDefault(require('@material-ui/icons/Timeline'));
51
52
  var CloseIcon = _interopDefault(require('@material-ui/icons/Close'));
@@ -1376,6 +1377,10 @@ var useUpComing = function useUpComing() {
1376
1377
  return (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
1377
1378
  });
1378
1379
  var isTeacher = currentUser.roles.includes("Teacher");
1380
+ var search = location.search;
1381
+ var params = new URLSearchParams(search);
1382
+ var studentNameReq = params.get('studentNameReq');
1383
+ var startDateReq = params.get('startDateReq');
1379
1384
  var filters = null;
1380
1385
  var setFilters = null;
1381
1386
 
@@ -1394,11 +1399,11 @@ var useUpComing = function useUpComing() {
1394
1399
  setFilters = _useState3[1];
1395
1400
  } else {
1396
1401
  var _useState4 = React.useState({
1397
- startDate: Date.now(),
1398
- endDate: moment().add(7, "days").valueOf(),
1402
+ startDate: startDateReq != null ? _.parseInt(startDateReq) : Date.now(),
1403
+ endDate: startDateReq != null ? _.parseInt(startDateReq) : moment().add(7, "days").valueOf(),
1399
1404
  currentPage: 1,
1400
1405
  pageSize: 10,
1401
- searchString: "",
1406
+ searchString: studentNameReq != null ? studentNameReq : "",
1402
1407
  sortBy: "StartTime",
1403
1408
  sortOrder: "ASC"
1404
1409
  });
@@ -1792,7 +1797,8 @@ var useUpComing = function useUpComing() {
1792
1797
  createConferenceSingleNote: createConferenceSingleNote,
1793
1798
  getAllNoteConference: getAllNoteConference,
1794
1799
  updateConferenceRubricPrivateNote: updateConferenceRubricPrivateNote,
1795
- deleteNoteConference: deleteNoteConference
1800
+ deleteNoteConference: deleteNoteConference,
1801
+ studentNameReq: studentNameReq
1796
1802
  };
1797
1803
  };
1798
1804
 
@@ -2206,7 +2212,8 @@ var UpComing = function UpComing() {
2206
2212
  filters = _useUpComing.filters,
2207
2213
  changeFilters = _useUpComing.changeFilters,
2208
2214
  nextSession = _useUpComing.nextSession,
2209
- changRouteQuestion = _useUpComing.changRouteQuestion;
2215
+ changRouteQuestion = _useUpComing.changRouteQuestion,
2216
+ studentNameReq = _useUpComing.studentNameReq;
2210
2217
 
2211
2218
  var handleSort = function handleSort(e) {
2212
2219
  if (e === "StartTime") {
@@ -2387,7 +2394,8 @@ var UpComing = function UpComing() {
2387
2394
  "aria-label": "search"
2388
2395
  },
2389
2396
  onChange: handleChangeInputSearch,
2390
- ref: inputSearch
2397
+ ref: inputSearch,
2398
+ defaultValue: studentNameReq != null ? studentNameReq : ""
2391
2399
  }))), isTeacher && screenWidth <= 600 && React__default.createElement(core.Grid, {
2392
2400
  item: true,
2393
2401
  className: "" + stylesOto["gr-action"]
@@ -2404,7 +2412,8 @@ var UpComing = function UpComing() {
2404
2412
  "aria-label": "search"
2405
2413
  },
2406
2414
  onChange: handleChangeInputSearch,
2407
- ref: inputSearch
2415
+ ref: inputSearch,
2416
+ defaultValue: studentNameReq != null ? studentNameReq : ""
2408
2417
  })), React__default.createElement("div", {
2409
2418
  className: stylesOto["gr-date-time-mobile"] + " icon-custom"
2410
2419
  }, React__default.createElement(EventIcon, {
@@ -2778,7 +2787,7 @@ var useSessionCompleted = function useSessionCompleted() {
2778
2787
  var _temp10 = _catch(function () {
2779
2788
  return Promise.resolve(updateItemFavourite(itemID)).then(function (res) {
2780
2789
  if (!!res) {
2781
- var clonedData = _.cloneDeep(sessionDataHistory);
2790
+ var clonedData = ___default.cloneDeep(sessionDataHistory);
2782
2791
 
2783
2792
  clonedData.items.map(function (row) {
2784
2793
  if (row.id == itemID && isTeacher) {
@@ -3666,12 +3675,17 @@ var useUpComing$1 = function useUpComing() {
3666
3675
  studentData = _useState2[0],
3667
3676
  setStudentData = _useState2[1];
3668
3677
 
3678
+ var search = location.search;
3679
+ var params = new URLSearchParams(search);
3680
+ var studentNameReq = params.get('studentNameReq');
3681
+ var startDateReq = params.get('startDateReq');
3682
+
3669
3683
  var _useState3 = React.useState({
3670
- startDate: Date.now(),
3671
- endDate: moment().add(7, "days").valueOf(),
3684
+ startDate: startDateReq != null ? parseInt(startDateReq) : Date.now(),
3685
+ endDate: startDateReq != null ? parseInt(startDateReq) : moment().add(7, "days").valueOf(),
3672
3686
  currentPage: 1,
3673
3687
  pageSize: 10,
3674
- searchString: "",
3688
+ searchString: studentNameReq != null ? studentNameReq : "",
3675
3689
  sortBy: "StartTime",
3676
3690
  sortOrder: "DESC"
3677
3691
  }),
@@ -3941,7 +3955,8 @@ var useUpComing$1 = function useUpComing() {
3941
3955
  updatePrivateNote: updatePrivateNote,
3942
3956
  nextSession: nextSession,
3943
3957
  nextTimeMeeting: nextTimeMeeting,
3944
- getStudentSelector: getStudentSelector
3958
+ getStudentSelector: getStudentSelector,
3959
+ studentNameReq: studentNameReq
3945
3960
  };
3946
3961
  };
3947
3962
 
@@ -4154,7 +4169,8 @@ var UpComing$1 = function UpComing() {
4154
4169
  changeFilters = _useUpComing.changeFilters,
4155
4170
  nextSession = _useUpComing.nextSession,
4156
4171
  nextTimeMeeting = _useUpComing.nextTimeMeeting,
4157
- changRouteQuestion = _useUpComing.changRouteQuestion;
4172
+ changRouteQuestion = _useUpComing.changRouteQuestion,
4173
+ studentNameReq = _useUpComing.studentNameReq;
4158
4174
 
4159
4175
  var renderUrlImage = function renderUrlImage(row) {
4160
4176
  var url = isTeacher ? row.studentAvatar : row.teacherAvatar;
@@ -4330,7 +4346,8 @@ var UpComing$1 = function UpComing() {
4330
4346
  "aria-label": "search"
4331
4347
  },
4332
4348
  onChange: handleChangeInputSearch,
4333
- ref: inputSearch
4349
+ ref: inputSearch,
4350
+ defaultValue: studentNameReq != null ? studentNameReq : ""
4334
4351
  }))), isTeacher && screenWidth <= 600 && React__default.createElement(core.Grid, {
4335
4352
  item: true,
4336
4353
  className: "" + styles$1["gr-action"]
@@ -4344,7 +4361,8 @@ var UpComing$1 = function UpComing() {
4344
4361
  placeholder: "Search Student",
4345
4362
  className: "" + styles$1["inputInput"],
4346
4363
  onChange: handleChangeInputSearch,
4347
- ref: inputSearch
4364
+ ref: inputSearch,
4365
+ defaultValue: studentNameReq != null ? studentNameReq : ""
4348
4366
  })), React__default.createElement("div", {
4349
4367
  className: "" + styles$1["gr-date-time-mobile"]
4350
4368
  }, React__default.createElement(EventIcon, {
@@ -4665,7 +4683,7 @@ var useSessionCompleted$1 = function useSessionCompleted() {
4665
4683
  var _temp8 = _catch(function () {
4666
4684
  return Promise.resolve(updateItemFavourite(itemID)).then(function (res) {
4667
4685
  if (!!res) {
4668
- var clonedData = _.cloneDeep(sessionDataHistory);
4686
+ var clonedData = ___default.cloneDeep(sessionDataHistory);
4669
4687
 
4670
4688
  clonedData.items.map(function (row) {
4671
4689
  if (row.id == itemID && isTeacher) {
@@ -6225,6 +6243,10 @@ var useConductOne = function useConductOne() {
6225
6243
  getAnswerStudent(parseInt(sessionId), data.userId);
6226
6244
  });
6227
6245
  channel.bind("TOGGLE_LOCK_STATUS", function (data) {
6246
+ if (data.isCheckResultDone && !!data.sessionResultId && isStudent) {
6247
+ history.push("/start-question/" + sessionId + "/" + data.sessionResultId);
6248
+ }
6249
+
6228
6250
  setIsUnclocked(data.IsUnlocked);
6229
6251
  });
6230
6252
  }
@@ -8632,7 +8654,7 @@ var BookSession = function BookSession() {
8632
8654
  type: "success",
8633
8655
  message: "Book session successfully"
8634
8656
  }));
8635
- history.push("/my-one-to-one/up-coming");
8657
+ history.push("/my-one-to-one/up-coming?startDateReq=" + time + "&studentNameReq=" + studentFullName);
8636
8658
  });
8637
8659
  }, function (err) {
8638
8660
  var _err$response, _err$response$data;
@@ -16908,6 +16930,10 @@ var useConferenceRubric = function useConferenceRubric() {
16908
16930
  });
16909
16931
  channel.bind("TOGGLE_LOCK_STATUS", function (data) {
16910
16932
  if (isStudent) {
16933
+ if (data.isCheckResultDone) {
16934
+ history.push("/start-conference/" + studentId + "/" + conferenceId + "/conferenceRubric");
16935
+ }
16936
+
16911
16937
  setIsUnclocked(data.IsUnlocked);
16912
16938
  }
16913
16939
  });
@@ -18174,7 +18200,7 @@ var BookSessionConferences = function BookSessionConferences() {
18174
18200
  type: "success",
18175
18201
  message: "Book conferences successfully"
18176
18202
  }));
18177
- history.push("/my-conferences/up-coming");
18203
+ history.push("/my-conferences/up-coming?startDateReq=" + time + "&studentNameReq=" + studentFullName);
18178
18204
  });
18179
18205
  }, function (err) {
18180
18206
  dispatch(marioCore.setAlert({