mario-teacher-student-client 1.2.4 → 1.2.5

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,8 +1,7 @@
1
- import { FILTER_SESSION } from "../constants/types";
2
1
  declare const useSessionCompleted: () => {
3
2
  sessionDataHistory: any;
4
- changeFilters: (updatedFilters: any) => void;
5
- filters: FILTER_SESSION;
3
+ changeFilters: (updatedFilters: any) => any;
4
+ filters: any;
6
5
  selectFavourite: (itemID: string) => Promise<void>;
7
6
  };
8
7
  export default useSessionCompleted;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { FILTER_SESSION } from "../constants/types";
3
2
  declare const useUpComing: () => {
4
3
  studentData: any;
5
4
  setStudentData: import("react").Dispatch<any>;
@@ -8,9 +7,9 @@ declare const useUpComing: () => {
8
7
  studentNoteData: any;
9
8
  privateNoteData: any;
10
9
  bookSession: (data: any) => Promise<void>;
11
- setFilters: import("react").Dispatch<import("react").SetStateAction<FILTER_SESSION>>;
12
- changeFilters: (updatedFilters: any) => void;
13
- filters: FILTER_SESSION;
10
+ setFilters: any;
11
+ changeFilters: (updatedFilters: any) => any;
12
+ filters: any;
14
13
  changRouteQuestion: (studentId: number) => Promise<void>;
15
14
  getAllNoteSession: (sessionId: any) => Promise<void>;
16
15
  createSessionSingleNote: (note: any, sessionResultId: any, sessionId: any) => Promise<void>;
package/dist/index.css CHANGED
@@ -2260,7 +2260,7 @@ h4._pDCgR {
2260
2260
  color: #fff;
2261
2261
  text-transform: uppercase; }
2262
2262
  ._23ZHZ thead tr th:not(:last-child) {
2263
- border-right: 1px solid #E2E8F0; }
2263
+ border-right: 1px solid #e2e8f0; }
2264
2264
  ._23ZHZ ._3DiW6 > div {
2265
2265
  display: inline-block; }
2266
2266
 
@@ -2340,3 +2340,10 @@ h2._1KpSK {
2340
2340
  margin-right: 8px;
2341
2341
  width: 15px;
2342
2342
  height: 15px; }
2343
+
2344
+ ._2_UXR img,
2345
+ ._1fQy_ img,
2346
+ ._q3ph4 img {
2347
+ width: 50px;
2348
+ height: 50px;
2349
+ border-radius: 50%; }
package/dist/index.js CHANGED
@@ -1135,36 +1135,54 @@ var useUpComing = function useUpComing() {
1135
1135
  studentData = _useState2[0],
1136
1136
  setStudentData = _useState2[1];
1137
1137
 
1138
- var _useState3 = React.useState({
1139
- startDate: Date.now(),
1140
- endDate: moment().add(7, "days").valueOf(),
1141
- currentPage: 1,
1142
- pageSize: 20,
1143
- searchString: "",
1144
- sortBy: "StartTime",
1145
- sortOrder: "DESC"
1146
- }),
1147
- filters = _useState3[0],
1148
- setFilters = _useState3[1];
1149
-
1150
1138
  var currentUser = reactRedux.useSelector(function (state) {
1151
1139
  var _state$common;
1152
1140
 
1153
1141
  return (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
1154
1142
  });
1155
1143
  var isTeacher = currentUser.roles.includes("Teacher");
1144
+ var filters = null;
1145
+ var setFilters = null;
1146
+
1147
+ if (!isTeacher) {
1148
+ var _useState3 = React.useState({
1149
+ startDate: undefined,
1150
+ endDate: undefined,
1151
+ currentPage: 1,
1152
+ pageSize: 20,
1153
+ searchString: "",
1154
+ sortBy: "StartTime",
1155
+ sortOrder: "DESC"
1156
+ });
1156
1157
 
1157
- var _useState4 = React.useState(),
1158
- teacherNoteData = _useState4[0],
1159
- setTeacherNoteData = _useState4[1];
1158
+ filters = _useState3[0];
1159
+ setFilters = _useState3[1];
1160
+ } else {
1161
+ var _useState4 = React.useState({
1162
+ startDate: Date.now(),
1163
+ endDate: moment().add(7, "days").valueOf(),
1164
+ currentPage: 1,
1165
+ pageSize: 20,
1166
+ searchString: "",
1167
+ sortBy: "StartTime",
1168
+ sortOrder: "DESC"
1169
+ });
1170
+
1171
+ filters = _useState4[0];
1172
+ setFilters = _useState4[1];
1173
+ }
1160
1174
 
1161
1175
  var _useState5 = React.useState(),
1162
- studentNoteData = _useState5[0],
1163
- setStudentNoteData = _useState5[1];
1176
+ teacherNoteData = _useState5[0],
1177
+ setTeacherNoteData = _useState5[1];
1164
1178
 
1165
1179
  var _useState6 = React.useState(),
1166
- privateNoteData = _useState6[0],
1167
- setPrivateNoteData = _useState6[1];
1180
+ studentNoteData = _useState6[0],
1181
+ setStudentNoteData = _useState6[1];
1182
+
1183
+ var _useState7 = React.useState(),
1184
+ privateNoteData = _useState7[0],
1185
+ setPrivateNoteData = _useState7[1];
1168
1186
 
1169
1187
  var changeFilters = function changeFilters(updatedFilters) {
1170
1188
  return setFilters(_extends({}, filters, updatedFilters));
@@ -1464,9 +1482,9 @@ var useUpComing = function useUpComing() {
1464
1482
  }
1465
1483
  };
1466
1484
 
1467
- var _useState7 = React.useState(),
1468
- nextSession = _useState7[0],
1469
- setNextSession = _useState7[1];
1485
+ var _useState8 = React.useState(),
1486
+ nextSession = _useState8[0],
1487
+ setNextSession = _useState8[1];
1470
1488
 
1471
1489
  var nextTimeMeeting = function nextTimeMeeting() {
1472
1490
  try {
@@ -1997,13 +2015,6 @@ var UpComing = function UpComing() {
1997
2015
 
1998
2016
  React.useEffect(function () {
1999
2017
  document.title = "My 1-To-1";
2000
-
2001
- if (!isTeacher) {
2002
- changeFilters({
2003
- startDate: undefined,
2004
- endDate: undefined
2005
- });
2006
- }
2007
2018
  }, [isTeacher]);
2008
2019
  var open = React.useCallback(function (row) {
2009
2020
  var resultId = isTeacher ? row.teacherResultId : row.studentResultId;
@@ -2338,18 +2349,44 @@ var useSessionCompleted = function useSessionCompleted() {
2338
2349
  sessionDataHistory = _useState[0],
2339
2350
  setSessionDataHistory = _useState[1];
2340
2351
 
2341
- var _useState2 = React.useState({
2342
- startDate: moment().subtract(30, 'days').valueOf(),
2343
- endDate: Date.now(),
2344
- currentPage: 1,
2345
- pageSize: 20,
2346
- searchString: "",
2347
- sortBy: 'StartTime',
2348
- sortOrder: 'DESC',
2349
- onlyShowFavourite: false
2350
- }),
2351
- filters = _useState2[0],
2352
- setFilters = _useState2[1];
2352
+ var roles = reactRedux.useSelector(function (state) {
2353
+ var _state$common, _state$common$user;
2354
+
2355
+ return (_state$common = state.common) === null || _state$common === void 0 ? void 0 : (_state$common$user = _state$common.user) === null || _state$common$user === void 0 ? void 0 : _state$common$user.roles;
2356
+ });
2357
+ var isTeacher = roles.includes("Teacher");
2358
+ var filters = null;
2359
+ var setFilters = null;
2360
+
2361
+ if (!isTeacher) {
2362
+ var _useState2 = React.useState({
2363
+ startDate: undefined,
2364
+ endDate: undefined,
2365
+ currentPage: 1,
2366
+ pageSize: 20,
2367
+ searchString: "",
2368
+ sortBy: 'StartTime',
2369
+ sortOrder: 'DESC',
2370
+ onlyShowFavourite: false
2371
+ });
2372
+
2373
+ filters = _useState2[0];
2374
+ setFilters = _useState2[1];
2375
+ } else {
2376
+ var _useState3 = React.useState({
2377
+ startDate: moment().subtract(30, 'days').valueOf(),
2378
+ endDate: Date.now(),
2379
+ currentPage: 1,
2380
+ pageSize: 20,
2381
+ searchString: "",
2382
+ sortBy: 'StartTime',
2383
+ sortOrder: 'DESC',
2384
+ onlyShowFavourite: false
2385
+ });
2386
+
2387
+ filters = _useState3[0];
2388
+ setFilters = _useState3[1];
2389
+ }
2353
2390
 
2354
2391
  var changeFilters = function changeFilters(updatedFilters) {
2355
2392
  return setFilters(_extends({}, filters, updatedFilters));
@@ -2378,13 +2415,6 @@ var useSessionCompleted = function useSessionCompleted() {
2378
2415
  }
2379
2416
  };
2380
2417
 
2381
- var roles = reactRedux.useSelector(function (state) {
2382
- var _state$common, _state$common$user;
2383
-
2384
- return (_state$common = state.common) === null || _state$common === void 0 ? void 0 : (_state$common$user = _state$common.user) === null || _state$common$user === void 0 ? void 0 : _state$common$user.roles;
2385
- });
2386
- var isTeacher = roles.includes("Teacher");
2387
-
2388
2418
  var selectFavourite = function selectFavourite(itemID) {
2389
2419
  try {
2390
2420
  var _temp4 = _catch(function () {
@@ -8644,7 +8674,7 @@ var InformationUser = function InformationUser(_ref) {
8644
8674
  }, React__default.createElement("div", {
8645
8675
  className: styles$2["infor-image"]
8646
8676
  }, React__default.createElement("img", {
8647
- src: informationUser !== null && informationUser !== void 0 && informationUser.avatarImage ? marioCore.getFileUrl(informationUser === null || informationUser === void 0 ? void 0 : informationUser.avatarImage) : "/images/image-default.png",
8677
+ src: !!(informationUser !== null && informationUser !== void 0 && informationUser.avatarImage) ? informationUser === null || informationUser === void 0 ? void 0 : informationUser.avatarImage : "/images/image-default.png",
8648
8678
  alt: ""
8649
8679
  })), React__default.createElement("div", {
8650
8680
  className: styles$2["infor-text"]
@@ -11248,7 +11278,7 @@ var Table = function Table(props) {
11248
11278
  Table.propTypes = propTypes$1;
11249
11279
  Table.defaultProps = defaultProps;
11250
11280
 
11251
- var styles$3 = {"block-question":"_12tWP","box-last":"_1WNMT","top-session":"_3BU0L","table-rubrics":"_23ZHZ","conference-td":"_3DiW6","result-page":"_1QPtC","title-strategories":"_2CRbt","strategories-image":"_EqDo0","block-conference":"_5sdsU","question-block":"_2jjjz","img-session":"_1N_R5","switch-session":"_2w7-X","body-session":"_Avpph","font-title":"_1KpSK","modal-finished":"_342x6","title-modal":"_1GUG4","body-modal":"_YnLTE","tite-body":"_22zyk","btn-cancel":"_1o-mw","btn-submit":"_18HUG"};
11281
+ var styles$3 = {"block-question":"_12tWP","box-last":"_1WNMT","top-session":"_3BU0L","table-rubrics":"_23ZHZ","conference-td":"_3DiW6","result-page":"_1QPtC","title-strategories":"_2CRbt","strategories-image":"_EqDo0","block-conference":"_5sdsU","question-block":"_2jjjz","img-session":"_1N_R5","switch-session":"_2w7-X","body-session":"_Avpph","font-title":"_1KpSK","modal-finished":"_342x6","title-modal":"_1GUG4","body-modal":"_YnLTE","tite-body":"_22zyk","btn-cancel":"_1o-mw","btn-submit":"_18HUG","teacher":"_2_UXR","agreement":"_1fQy_","student":"_q3ph4"};
11252
11282
 
11253
11283
  var RubricTable = function RubricTable(_ref) {
11254
11284
  var _rubric$rows;
@@ -11359,7 +11389,7 @@ var RubricTable = function RubricTable(_ref) {
11359
11389
  scope: "row",
11360
11390
  className: "align-middle"
11361
11391
  }, row === null || row === void 0 ? void 0 : row.text), rubric === null || rubric === void 0 ? void 0 : (_rubric$columns = rubric.columns) === null || _rubric$columns === void 0 ? void 0 : _rubric$columns.map(function (column, index) {
11362
- var _choiceTeacherItem, _choiceStudentItem, _choiceTeacherItem2, _choiceStudentItem2;
11392
+ var _choiceTeacherItem, _choiceStudentItem, _choiceTeacherItem2, _choiceStudentItem2, _choiceTeacherItem3, _choiceStudentItem3;
11363
11393
 
11364
11394
  return React__default.createElement("td", {
11365
11395
  className: "text-center align-middle " + styles$3["conference-td"],
@@ -11368,13 +11398,20 @@ var RubricTable = function RubricTable(_ref) {
11368
11398
  onClick: function onClick() {
11369
11399
  choiceAnswerRubric(rubric === null || rubric === void 0 ? void 0 : rubric.id, row === null || row === void 0 ? void 0 : row.id, column.order, false);
11370
11400
  }
11371
- }, React__default.createElement("div", {
11401
+ }, ((_choiceTeacherItem = choiceTeacherItem(row.id)) === null || _choiceTeacherItem === void 0 ? void 0 : _choiceTeacherItem.choice) != "Default" || ((_choiceStudentItem = choiceStudentItem(row.id)) === null || _choiceStudentItem === void 0 ? void 0 : _choiceStudentItem.choice) != "Default" ? React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
11372
11402
  className: "" + styles$3["teacher"]
11373
- }, ((_choiceTeacherItem = choiceTeacherItem(row.id)) === null || _choiceTeacherItem === void 0 ? void 0 : _choiceTeacherItem.choice) === colIndex[index] && React__default.createElement(Teacher, null)), React__default.createElement("div", {
11403
+ }, ((_choiceTeacherItem2 = choiceTeacherItem(row.id)) === null || _choiceTeacherItem2 === void 0 ? void 0 : _choiceTeacherItem2.choice) === colIndex[index] && React__default.createElement(Teacher, null)), React__default.createElement("div", {
11374
11404
  className: "" + styles$3["agreement"]
11375
- }, ((_choiceStudentItem = choiceStudentItem(row.id)) === null || _choiceStudentItem === void 0 ? void 0 : _choiceStudentItem.choice) === colIndex[index] && ((_choiceTeacherItem2 = choiceTeacherItem(row.id)) === null || _choiceTeacherItem2 === void 0 ? void 0 : _choiceTeacherItem2.choice) === colIndex[index] && React__default.createElement(Agreement, null)), React__default.createElement("div", {
11405
+ }, ((_choiceStudentItem2 = choiceStudentItem(row.id)) === null || _choiceStudentItem2 === void 0 ? void 0 : _choiceStudentItem2.choice) === colIndex[index] && ((_choiceTeacherItem3 = choiceTeacherItem(row.id)) === null || _choiceTeacherItem3 === void 0 ? void 0 : _choiceTeacherItem3.choice) === colIndex[index] && React__default.createElement(Agreement, null)), React__default.createElement("div", {
11376
11406
  className: "" + styles$3["student"]
11377
- }, ((_choiceStudentItem2 = choiceStudentItem(row.id)) === null || _choiceStudentItem2 === void 0 ? void 0 : _choiceStudentItem2.choice) === colIndex[index] && React__default.createElement(Student, null)));
11407
+ }, ((_choiceStudentItem3 = choiceStudentItem(row.id)) === null || _choiceStudentItem3 === void 0 ? void 0 : _choiceStudentItem3.choice) === colIndex[index] && React__default.createElement(Student, null))) : React__default.createElement("div", {
11408
+ className: "" + styles$3["row-default"],
11409
+ style: {
11410
+ textAlign: "center"
11411
+ }
11412
+ }, React__default.createElement("img", {
11413
+ src: "/images/default-conference.png"
11414
+ })));
11378
11415
  }));
11379
11416
  })));
11380
11417
  };