mario-teacher-student-client 2.0.3 → 2.0.6

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.
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const _default: React.MemoExoticComponent<(props: any) => JSX.Element>;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const _default: React.MemoExoticComponent<(props: any) => JSX.Element>;
3
+ export default _default;
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
2
- declare const DialogNodes: (props: any) => JSX.Element;
3
- export default DialogNodes;
1
+ import React from "react";
2
+ declare const _default: React.MemoExoticComponent<(props: any) => JSX.Element>;
3
+ export default _default;
package/dist/index.js CHANGED
@@ -153,7 +153,7 @@ var getUnreadNotification = function getUnreadNotification() {
153
153
 
154
154
  var NOTIFICATION_CHANNEL = "NOTIFICATION_CHANNEL";
155
155
  var NEW_NOTIFICATION = "NEW_NOTIFICATION";
156
- var drawerWidth = 240;
156
+ var drawerWidth = 280;
157
157
  var headerHeightDesktop = 64;
158
158
  var headerHeightMobile = 55;
159
159
  var headerHeightScroll = 0;
@@ -5301,7 +5301,10 @@ var HeaderComponent = function HeaderComponent(_ref) {
5301
5301
  }, React__default.createElement(BiArrowBack, {
5302
5302
  className: styles["header-icon"]
5303
5303
  }), " ", text)), isShowButtonPageHeader && screenWidth > 600 && React__default.createElement("div", {
5304
- className: "styles[\"header-right\"]"
5304
+ className: "styles[\"header-right\"]",
5305
+ style: {
5306
+ marginRight: "50px"
5307
+ }
5305
5308
  }, React__default.createElement(core.Button, {
5306
5309
  variant: "contained",
5307
5310
  className: isShowButtonBackGround ? styles["btn-conduct-session"] : styles["btn-conduct-session-disabled"],
@@ -7042,6 +7045,7 @@ var CustomTabNote = function CustomTabNote(props) {
7042
7045
  return (_user$roles = user.roles) === null || _user$roles === void 0 ? void 0 : _user$roles.includes("Teacher");
7043
7046
  }, [user]);
7044
7047
  var indexTab = 0;
7048
+ var privateInit = "";
7045
7049
 
7046
7050
  if (localStorage.getItem('activeTab') != null) {
7047
7051
  var activeTab = JSON.parse(localStorage.getItem('activeTab') || '{}');
@@ -7051,6 +7055,7 @@ var CustomTabNote = function CustomTabNote(props) {
7051
7055
 
7052
7056
  if (objectTab != null) {
7053
7057
  indexTab = objectTab.activeTab;
7058
+ privateInit = objectTab.content;
7054
7059
  }
7055
7060
  }
7056
7061
 
@@ -7058,7 +7063,7 @@ var CustomTabNote = function CustomTabNote(props) {
7058
7063
  value = _useState[0],
7059
7064
  setValue = _useState[1];
7060
7065
 
7061
- var _useState2 = React.useState(),
7066
+ var _useState2 = React.useState(privateInit),
7062
7067
  dataPrivate = _useState2[0],
7063
7068
  setDataPrivate = _useState2[1];
7064
7069
 
@@ -7074,9 +7079,6 @@ var CustomTabNote = function CustomTabNote(props) {
7074
7079
  widthItem = _useState5[0],
7075
7080
  setWidthItem = _useState5[1];
7076
7081
 
7077
- console.log({
7078
- value: value
7079
- });
7080
7082
  React.useEffect(function () {
7081
7083
  setDataPrivate(props.privateNoteData);
7082
7084
  }, [props.privateNoteData]);
@@ -7093,11 +7095,13 @@ var CustomTabNote = function CustomTabNote(props) {
7093
7095
  var objectTab = [{
7094
7096
  isTeacher: true,
7095
7097
  sessionId: props.sessionId,
7096
- activeTab: 0
7098
+ activeTab: 0,
7099
+ content: ""
7097
7100
  }, {
7098
7101
  isTeacher: false,
7099
7102
  sessionId: props.sessionId,
7100
- activeTab: 0
7103
+ activeTab: 0,
7104
+ content: ""
7101
7105
  }];
7102
7106
  var index = objectTab.findIndex(function (t) {
7103
7107
  return t.isTeacher == isTeacher;
@@ -7142,6 +7146,20 @@ var CustomTabNote = function CustomTabNote(props) {
7142
7146
  clearTimeout(inputSearch.current);
7143
7147
  }
7144
7148
 
7149
+ if (localStorage.getItem('activeTab') != null) {
7150
+ var _activeTab = JSON.parse(localStorage.getItem('activeTab') || '{}');
7151
+
7152
+ var indexTab = _activeTab === null || _activeTab === void 0 ? void 0 : _activeTab.findIndex(function (item) {
7153
+ return item.sessionId == props.sessionId && item.isTeacher == isTeacher;
7154
+ });
7155
+
7156
+ if (indexTab != -1) {
7157
+ _activeTab[indexTab].content = inputValue;
7158
+ }
7159
+
7160
+ localStorage.setItem('activeTab', JSON.stringify(_activeTab));
7161
+ }
7162
+
7145
7163
  inputSearch.current = setTimeout(function () {
7146
7164
  handleUpdatePrivateNote(inputValue);
7147
7165
  }, 500);
@@ -7927,17 +7945,9 @@ var DialogNodes = function DialogNodes(props) {
7927
7945
  deleteNoteConference = _useNoteSession.deleteNoteConference,
7928
7946
  updateConferenceRubricPrivateNote = _useNoteSession.updateConferenceRubricPrivateNote;
7929
7947
 
7930
- var _React$useState = React__default.useState(),
7931
- inputValue = _React$useState[0],
7932
- setInputValue = _React$useState[1];
7933
-
7934
- var _React$useState2 = React__default.useState(),
7935
- recordValue = _React$useState2[0],
7936
- setRecordValue = _React$useState2[1];
7937
-
7938
- var _React$useState3 = React__default.useState(false),
7939
- isShowQuestionList = _React$useState3[0],
7940
- setIsShowQuestionList = _React$useState3[1];
7948
+ var _React$useState = React__default.useState(false),
7949
+ isShowQuestionList = _React$useState[0],
7950
+ setIsShowQuestionList = _React$useState[1];
7941
7951
 
7942
7952
  var user = reactRedux.useSelector(function (state) {
7943
7953
  return state.common.user;
@@ -7948,6 +7958,7 @@ var DialogNodes = function DialogNodes(props) {
7948
7958
  return (_user$roles = user.roles) === null || _user$roles === void 0 ? void 0 : _user$roles.includes("Teacher");
7949
7959
  }, [user]);
7950
7960
  var indexTab = 0;
7961
+ var inputInitValue = "";
7951
7962
 
7952
7963
  if (localStorage.getItem('activeTab') != null) {
7953
7964
  var activeTab = JSON.parse(localStorage.getItem('activeTab') || '{}');
@@ -7957,14 +7968,58 @@ var DialogNodes = function DialogNodes(props) {
7957
7968
 
7958
7969
  if (objectTab != null) {
7959
7970
  indexTab = objectTab.activeTab;
7971
+ inputInitValue = objectTab.content;
7960
7972
  }
7961
7973
  }
7962
7974
 
7975
+ var _React$useState2 = React__default.useState(inputInitValue),
7976
+ inputValue = _React$useState2[0],
7977
+ setInputValue = _React$useState2[1];
7978
+
7979
+ var _React$useState3 = React__default.useState(),
7980
+ recordValue = _React$useState3[0],
7981
+ setRecordValue = _React$useState3[1];
7982
+
7963
7983
  var _React$useState4 = React__default.useState(indexTab),
7964
7984
  tabProp = _React$useState4[0],
7965
7985
  setTabProp = _React$useState4[1];
7966
7986
 
7967
7987
  var handleChange = function handleChange(event) {
7988
+ if (localStorage.getItem('activeTab') != null) {
7989
+ var _activeTab = JSON.parse(localStorage.getItem('activeTab') || '{}');
7990
+
7991
+ var indexTab = _activeTab === null || _activeTab === void 0 ? void 0 : _activeTab.findIndex(function (item) {
7992
+ return item.sessionId == props.sessionId && item.isTeacher == isTeacher;
7993
+ });
7994
+
7995
+ if (indexTab != -1) {
7996
+ _activeTab[indexTab].content = event.target.value;
7997
+ }
7998
+
7999
+ localStorage.setItem('activeTab', JSON.stringify(_activeTab));
8000
+ } else {
8001
+ var objectTab = [{
8002
+ isTeacher: true,
8003
+ sessionId: props.sessionId,
8004
+ activeTab: 0,
8005
+ content: ""
8006
+ }, {
8007
+ isTeacher: false,
8008
+ sessionId: props.sessionId,
8009
+ activeTab: 0,
8010
+ content: ""
8011
+ }];
8012
+ var index = objectTab.findIndex(function (t) {
8013
+ return t.isTeacher == isTeacher;
8014
+ });
8015
+
8016
+ if (index != -1) {
8017
+ objectTab[index].content = event.target.value;
8018
+ }
8019
+
8020
+ localStorage.setItem('activeTab', JSON.stringify(objectTab));
8021
+ }
8022
+
7968
8023
  setInputValue(event.target.value);
7969
8024
  };
7970
8025
 
@@ -7972,6 +8027,20 @@ var DialogNodes = function DialogNodes(props) {
7972
8027
  props.handleClose();
7973
8028
  };
7974
8029
 
8030
+ React.useEffect(function () {
8031
+ if (localStorage.getItem('activeTab') != null) {
8032
+ var _activeTab2 = JSON.parse(localStorage.getItem('activeTab') || '{}');
8033
+
8034
+ var objectTab = _activeTab2 === null || _activeTab2 === void 0 ? void 0 : _activeTab2.find(function (item) {
8035
+ return item.sessionId == props.sessionId && item.isTeacher == isTeacher;
8036
+ });
8037
+
8038
+ if (objectTab != null) {
8039
+ setInputValue(objectTab.content);
8040
+ }
8041
+ }
8042
+ }, [tabProp]);
8043
+
7975
8044
  var handleCreateNote = function handleCreateNote() {
7976
8045
  try {
7977
8046
  return Promise.resolve(_catch(function () {
@@ -7982,7 +8051,21 @@ var DialogNodes = function DialogNodes(props) {
7982
8051
  Text: inputValue
7983
8052
  }, props.sessionResultId, props.sessionId)).then(function (_createConferenceSing) {
7984
8053
  _createConferenceSing;
7985
- return Promise.resolve(setInputValue("")).then(function () {});
8054
+ return Promise.resolve(setInputValue("")).then(function () {
8055
+ if (localStorage.getItem('activeTab') != null) {
8056
+ var _activeTab3 = JSON.parse(localStorage.getItem('activeTab') || '{}');
8057
+
8058
+ var indexTab = _activeTab3 === null || _activeTab3 === void 0 ? void 0 : _activeTab3.findIndex(function (item) {
8059
+ return item.sessionId == props.sessionId && item.isTeacher == isTeacher;
8060
+ });
8061
+
8062
+ if (indexTab != -1) {
8063
+ _activeTab3[indexTab].content = "";
8064
+ }
8065
+
8066
+ localStorage.setItem('activeTab', JSON.stringify(_activeTab3));
8067
+ }
8068
+ });
7986
8069
  });
7987
8070
  }, function (err) {
7988
8071
  dispatch(marioCore.setAlert({
@@ -8077,6 +8160,7 @@ var DialogNodes = function DialogNodes(props) {
8077
8160
  className: "" + stylesOto["footer-note-form"],
8078
8161
  value: inputValue,
8079
8162
  onChange: handleChange,
8163
+ maxRows: 6,
8080
8164
  style: {
8081
8165
  border: "none"
8082
8166
  },
@@ -8116,6 +8200,55 @@ var DialogNodes = function DialogNodes(props) {
8116
8200
  }))))));
8117
8201
  };
8118
8202
 
8203
+ function areEqual(prevProps, nextProps) {
8204
+ if (prevProps.checkOpenModal == nextProps.checkOpenModal) return false;
8205
+ return true;
8206
+ }
8207
+
8208
+ var DialogNodes$1 = React__default.memo(DialogNodes, areEqual);
8209
+
8210
+ var SimpleDialog$2 = function SimpleDialog(props) {
8211
+ var onClose = props.onClose,
8212
+ selectedValue = props.selectedValue,
8213
+ open = props.open,
8214
+ checkOpenModal = props.checkOpenModal,
8215
+ listLearningStrategoryCategory = props.listLearningStrategoryCategory,
8216
+ currentSessionTypeId = props.currentSessionTypeId;
8217
+
8218
+ var handleClose = function handleClose() {
8219
+ if (localStorage.getItem("activeTab") != null) {
8220
+ localStorage.removeItem("activeTab");
8221
+ }
8222
+
8223
+ onClose(selectedValue);
8224
+ };
8225
+
8226
+ return React__default.createElement(core.Dialog, {
8227
+ onClose: handleClose,
8228
+ open: open,
8229
+ fullWidth: true,
8230
+ maxWidth: "sm",
8231
+ style: {
8232
+ maxHeight: "90%",
8233
+ marginTop: "80px"
8234
+ }
8235
+ }, React__default.createElement(DialogNodes$1, {
8236
+ handleClose: handleClose,
8237
+ sessionId: props.sessionId,
8238
+ sessionResultId: props.sessionResultId,
8239
+ checkOpenModal: checkOpenModal,
8240
+ listLearningStrategoryCategory: listLearningStrategoryCategory,
8241
+ currentSessionTypeId: currentSessionTypeId
8242
+ }));
8243
+ };
8244
+
8245
+ function areEqual$1(prevProps, nextProps) {
8246
+ if (prevProps.checkOpenModal == nextProps.checkOpenModal) return false;
8247
+ return true;
8248
+ }
8249
+
8250
+ var SimpleDialog$3 = React__default.memo(SimpleDialog$2, areEqual$1);
8251
+
8119
8252
  function NodeDraggable(props) {
8120
8253
  var _useState = React.useState({
8121
8254
  xAxis: 0,
@@ -8192,41 +8325,6 @@ var ConductIndex = function ConductIndex() {
8192
8325
  setOpen(false);
8193
8326
  };
8194
8327
 
8195
- var SimpleDialog = function SimpleDialog(props) {
8196
- var onClose = props.onClose,
8197
- selectedValue = props.selectedValue,
8198
- open = props.open,
8199
- checkOpenModal = props.checkOpenModal,
8200
- listLearningStrategoryCategory = props.listLearningStrategoryCategory,
8201
- currentSessionTypeId = props.currentSessionTypeId;
8202
-
8203
- var handleClose = function handleClose() {
8204
- if (localStorage.getItem("activeTab") != null) {
8205
- localStorage.removeItem("activeTab");
8206
- }
8207
-
8208
- onClose(selectedValue);
8209
- };
8210
-
8211
- return React__default.createElement(core.Dialog, {
8212
- onClose: handleClose,
8213
- open: open,
8214
- fullWidth: true,
8215
- maxWidth: "sm",
8216
- style: {
8217
- maxHeight: "90%",
8218
- marginTop: "80px"
8219
- }
8220
- }, React__default.createElement(DialogNodes, {
8221
- handleClose: handleClose,
8222
- sessionId: sessionId,
8223
- sessionResultId: sessionResultId,
8224
- checkOpenModal: checkOpenModal,
8225
- listLearningStrategoryCategory: listLearningStrategoryCategory,
8226
- currentSessionTypeId: currentSessionTypeId
8227
- }));
8228
- };
8229
-
8230
8328
  var history = reactRouterDom.useHistory();
8231
8329
  var questionRatings = listQuestionStudents.filter(function (item) {
8232
8330
  return item.type == QuestionType.Rating && !!item.isBeforeSession;
@@ -8482,13 +8580,15 @@ var ConductIndex = function ConductIndex() {
8482
8580
  }
8483
8581
  }, React__default.createElement(NodeDraggable, {
8484
8582
  handleClickOpen: handleClickOpen
8485
- })), React__default.createElement(SimpleDialog, {
8583
+ })), React__default.createElement(SimpleDialog$3, {
8486
8584
  selectedValue: "",
8487
8585
  open: open,
8488
8586
  onClose: handleClose,
8489
8587
  checkOpenModal: checkOpenModal,
8490
8588
  listLearningStrategoryCategory: listLearningStrategoryCategory,
8491
- currentSessionTypeId: sessionTypeCategoryId
8589
+ currentSessionTypeId: sessionTypeCategoryId,
8590
+ sessionId: sessionId,
8591
+ sessionResultId: sessionResultId
8492
8592
  }), React__default.createElement(core.Dialog, {
8493
8593
  open: openModalSession,
8494
8594
  onClose: handleModalSessionClose,
@@ -17275,6 +17375,44 @@ var useConferenceRubric = function useConferenceRubric() {
17275
17375
  };
17276
17376
  };
17277
17377
 
17378
+ var SimpleDialog$4 = function SimpleDialog(props) {
17379
+ var onClose = props.onClose,
17380
+ selectedValue = props.selectedValue,
17381
+ open = props.open,
17382
+ checkOpenModal = props.checkOpenModal,
17383
+ conferenceId = props.conferenceId,
17384
+ isTeacher = props.isTeacher,
17385
+ conferenceResult = props.conferenceResult;
17386
+
17387
+ var handleClose = function handleClose() {
17388
+ if (localStorage.getItem("activeTab") != null) {
17389
+ localStorage.removeItem("activeTab");
17390
+ }
17391
+
17392
+ onClose(selectedValue);
17393
+ };
17394
+
17395
+ return React__default.createElement(core.Dialog, {
17396
+ onClose: handleClose,
17397
+ open: open,
17398
+ fullWidth: true,
17399
+ maxWidth: "sm"
17400
+ }, React__default.createElement(DialogNodes$1, {
17401
+ handleClose: handleClose,
17402
+ sessionId: conferenceId,
17403
+ sessionResultId: isTeacher ? conferenceResult.teacherResultId : conferenceResult.studentResultId,
17404
+ checkOpenModal: checkOpenModal,
17405
+ isPageConference: true
17406
+ }));
17407
+ };
17408
+
17409
+ function areEqual$2(prevProps, nextProps) {
17410
+ if (prevProps.checkOpenModal == nextProps.checkOpenModal) return false;
17411
+ return true;
17412
+ }
17413
+
17414
+ var SimpleDialog$5 = React__default.memo(SimpleDialog$4, areEqual$2);
17415
+
17278
17416
  var QuestionType$1;
17279
17417
 
17280
17418
  (function (QuestionType) {
@@ -17432,38 +17570,6 @@ var ConferenceRubric = function ConferenceRubric() {
17432
17570
  document.title = "Start conference";
17433
17571
  !!foundId && getPartnerProfileSelector(foundId);
17434
17572
  }, [foundId]);
17435
-
17436
- var SimpleDialog = function SimpleDialog(props) {
17437
- var onClose = props.onClose,
17438
- selectedValue = props.selectedValue,
17439
- open = props.open,
17440
- checkOpenModal = props.checkOpenModal,
17441
- conferenceId = props.conferenceId,
17442
- isTeacher = props.isTeacher,
17443
- conferenceResult = props.conferenceResult;
17444
-
17445
- var handleClose = function handleClose() {
17446
- if (localStorage.getItem("activeTab") != null) {
17447
- localStorage.removeItem("activeTab");
17448
- }
17449
-
17450
- onClose(selectedValue);
17451
- };
17452
-
17453
- return React__default.createElement(core.Dialog, {
17454
- onClose: handleClose,
17455
- open: open,
17456
- fullWidth: true,
17457
- maxWidth: "sm"
17458
- }, React__default.createElement(DialogNodes, {
17459
- handleClose: handleClose,
17460
- sessionId: conferenceId,
17461
- sessionResultId: isTeacher ? conferenceResult.teacherResultId : conferenceResult.studentResultId,
17462
- checkOpenModal: checkOpenModal,
17463
- isPageConference: true
17464
- }));
17465
- };
17466
-
17467
17573
  return React__default.createElement("div", {
17468
17574
  className: styles$7["block-conference"]
17469
17575
  }, React__default.createElement(HeaderComponent, {
@@ -17586,7 +17692,7 @@ var ConferenceRubric = function ConferenceRubric() {
17586
17692
  }
17587
17693
  }, React__default.createElement(NodeDraggable, {
17588
17694
  handleClickOpen: handleClickOpen
17589
- })), React__default.createElement(ScrollToTopBtn, null), React__default.createElement(SimpleDialog, {
17695
+ })), React__default.createElement(ScrollToTopBtn, null), React__default.createElement(SimpleDialog$5, {
17590
17696
  selectedValue: "",
17591
17697
  open: open,
17592
17698
  onClose: handleClose,
@@ -21824,6 +21930,10 @@ function NotificationsPage() {
21824
21930
  var updateSetting = React.useCallback(function () {
21825
21931
  return updateSettingPage(dataSetting);
21826
21932
  }, [dataSetting]);
21933
+ var roles = reactRedux.useSelector(function (state) {
21934
+ return state.common.user;
21935
+ }).roles;
21936
+ console.log(roles.includes('Teacher'));
21827
21937
  return React__default.createElement("div", {
21828
21938
  id: "setting-page",
21829
21939
  className: classes.paddindNotificationsPage
@@ -21865,7 +21975,7 @@ function NotificationsPage() {
21865
21975
  }
21866
21976
  }, React__default.createElement("p", {
21867
21977
  className: classes.textNotifications
21868
- }, "Send notification when a student quick start a session/conference"), React__default.createElement(core.Switch, {
21978
+ }, "Send notification when a ", roles.includes('Teacher') ? "student" : "teacher", " quick start a session/conference"), React__default.createElement(core.Switch, {
21869
21979
  color: "primary",
21870
21980
  name: "IsReceiveNotificationBookedSession",
21871
21981
  onChange: onChangeDataSettingPage,
@@ -21881,7 +21991,7 @@ function NotificationsPage() {
21881
21991
  }
21882
21992
  }, React__default.createElement("p", {
21883
21993
  className: classes.textNotifications
21884
- }, "Send notification when a student books a session/conference"), React__default.createElement(core.Switch, {
21994
+ }, "Send notification when a ", roles.includes('Teacher') ? "student" : "teacher", " books a session/conference"), React__default.createElement(core.Switch, {
21885
21995
  color: "primary",
21886
21996
  name: "IsReceiveNotificationPrebookedSession",
21887
21997
  onChange: onChangeDataSettingPage,