mario-education 2.4.7-beta → 2.4.8-beta

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.
@@ -3,3 +3,4 @@ export declare const remove: (id: string, userChangeId?: string | undefined) =>
3
3
  export declare const getTeacher: () => Promise<import("axios").AxiosResponse<any>>;
4
4
  export declare const getStudentAll: (filter: any) => Promise<import("axios").AxiosResponse<any>>;
5
5
  export declare const changeTeacherOfStudent: (id: number, teacherUserId: any) => Promise<import("axios").AxiosResponse<any>>;
6
+ export declare const getTeachersByStudentId: (studentId: number) => Promise<import("axios").AxiosResponse<any>>;
@@ -2,4 +2,5 @@ import { TypeStudentAssistantData } from "../containers/SwitchAssistant/utils/ty
2
2
  import { IStudentWidthAssistant } from "../utils/serviceType.interface";
3
3
  export declare const getStudentAssistant: (data: IStudentWidthAssistant) => Promise<import("axios").AxiosResponse<TypeStudentAssistantData>>;
4
4
  export declare const getAssistant: () => Promise<import("axios").AxiosResponse<any>>;
5
+ export declare const getAssistantByStudentId: (studentId: number) => Promise<import("axios").AxiosResponse<any>>;
5
6
  export declare const changeAssistantOfStudent: (id: number, assistantUserId: string) => Promise<import("axios").AxiosResponse<any>>;
package/dist/index.css CHANGED
@@ -273,6 +273,19 @@ h6._3zOGW {
273
273
  margin: 0 auto;
274
274
  }
275
275
 
276
+ ._2PMoX {
277
+ height: auto;
278
+ width: 100%;
279
+ }
280
+
281
+ @media (min-width: 1024px) {
282
+ ._3pkbc {
283
+ max-width: 60%;
284
+ }
285
+ ._16MpB {
286
+ max-width: 70%;
287
+ }
288
+ }
276
289
  ._2Q9xO{
277
290
  border-radius: 50%;
278
291
  display: flex;
package/dist/index.js CHANGED
@@ -7645,32 +7645,35 @@ var SchoolBlankDayList = function SchoolBlankDayList() {
7645
7645
  }))));
7646
7646
  };
7647
7647
 
7648
- var USER_DELETED_URL = marioCore.BASE_URL + "/api/User";
7648
+ var USER_URL$1 = marioCore.BASE_URL + "/api/User";
7649
7649
  var get$d = function get(filter) {
7650
- return marioCore.api.get(USER_DELETED_URL + "/all/deleted", {
7650
+ return marioCore.api.get(USER_URL$1 + "/all/deleted", {
7651
7651
  params: filter
7652
7652
  });
7653
7653
  };
7654
7654
  var remove$c = function remove(id, userChangeId) {
7655
- return marioCore.api["delete"](USER_DELETED_URL + "/hardDelete/" + id, {
7655
+ return marioCore.api["delete"](USER_URL$1 + "/hardDelete/" + id, {
7656
7656
  params: {
7657
7657
  userChangeId: userChangeId
7658
7658
  }
7659
7659
  });
7660
7660
  };
7661
7661
  var getTeacher = function getTeacher() {
7662
- return marioCore.api.get(USER_DELETED_URL + "/all/teacher");
7662
+ return marioCore.api.get(USER_URL$1 + "/all/teacher");
7663
7663
  };
7664
7664
  var getStudentAll = function getStudentAll(filter) {
7665
- return marioCore.api.get(USER_DELETED_URL + "/studentUser/all", {
7665
+ return marioCore.api.get(USER_URL$1 + "/studentUser/all", {
7666
7666
  params: filter
7667
7667
  });
7668
7668
  };
7669
7669
  var changeTeacherOfStudent = function changeTeacherOfStudent(id, teacherUserId) {
7670
- return marioCore.api.put(USER_DELETED_URL + "/change-teacher/" + id, {
7670
+ return marioCore.api.put(USER_URL$1 + "/change-teacher/" + id, {
7671
7671
  teacherUserId: teacherUserId
7672
7672
  });
7673
7673
  };
7674
+ var getTeachersByStudentId = function getTeachersByStudentId(studentId) {
7675
+ return marioCore.api.get(USER_URL$1 + "/teachers/" + studentId);
7676
+ };
7674
7677
 
7675
7678
  var useUserDeletedModal = function useUserDeletedModal() {
7676
7679
  var dispatch = reactRedux.useDispatch();
@@ -8145,15 +8148,12 @@ var useSwitchTeacher = function useSwitchTeacher() {
8145
8148
  React.useEffect(function () {
8146
8149
  document.title = TITLE$c;
8147
8150
  }, []);
8148
- React.useEffect(function () {
8149
- getAllTeacher();
8150
- }, [modal]);
8151
8151
 
8152
- var getAllTeacher = function getAllTeacher() {
8152
+ var getTeachersOfStudent = function getTeachersOfStudent(studentId) {
8153
8153
  try {
8154
8154
  var _temp6 = _catch(function () {
8155
- return Promise.resolve(getTeacher()).then(function (res) {
8156
- setTeacherList(res.data);
8155
+ return Promise.resolve(getTeachersByStudentId(studentId)).then(function (res) {
8156
+ res && setTeacherList(res.data);
8157
8157
  });
8158
8158
  }, function (err) {
8159
8159
  var _err$response2, _err$response2$data;
@@ -8220,6 +8220,9 @@ var useSwitchTeacher = function useSwitchTeacher() {
8220
8220
  React.useEffect(function () {
8221
8221
  getData();
8222
8222
  }, [filters]);
8223
+ React.useEffect(function () {
8224
+ userChoiced.id && getTeachersOfStudent(parseInt(userChoiced.id));
8225
+ }, [userChoiced.id]);
8223
8226
  return {
8224
8227
  userList: userList,
8225
8228
  totalItems: totalItems,
@@ -8391,17 +8394,17 @@ var SwitchTeacherList = function SwitchTeacherList() {
8391
8394
  }));
8392
8395
  };
8393
8396
 
8394
- var USER_URL$1 = marioCore.BASE_URL + "/api/User";
8397
+ var USER_URL$2 = marioCore.BASE_URL + "/api/User";
8395
8398
  var getStudentAssistant = function getStudentAssistant(data) {
8396
- return marioCore.api.get(USER_URL$1 + "/studentAssistant/", {
8399
+ return marioCore.api.get(USER_URL$2 + "/studentAssistant/", {
8397
8400
  params: data
8398
8401
  });
8399
8402
  };
8400
- var getAssistant = function getAssistant() {
8401
- return marioCore.api.get(USER_URL$1 + "/assistants");
8403
+ var getAssistantByStudentId = function getAssistantByStudentId(studentId) {
8404
+ return marioCore.api.get(USER_URL$2 + "/assistants/" + studentId);
8402
8405
  };
8403
8406
  var changeAssistantOfStudent = function changeAssistantOfStudent(id, assistantUserId) {
8404
- return marioCore.api.put(USER_URL$1 + "/change-assistant/" + id, {
8407
+ return marioCore.api.put(USER_URL$2 + "/change-assistant/" + id, {
8405
8408
  assistantUserId: assistantUserId
8406
8409
  });
8407
8410
  };
@@ -8477,11 +8480,11 @@ var useSwitchAssistant = function useSwitchAssistant() {
8477
8480
  }
8478
8481
  }, [dispatch, filters]);
8479
8482
 
8480
- var getAllAssistant = function getAllAssistant() {
8483
+ var getAssistants = function getAssistants(studentId) {
8481
8484
  try {
8482
8485
  var _temp6 = _catch(function () {
8483
- return Promise.resolve(getAssistant()).then(function (res) {
8484
- setAssistantList(res.data);
8486
+ return Promise.resolve(getAssistantByStudentId(studentId)).then(function (res) {
8487
+ res && setAssistantList(res.data);
8485
8488
  });
8486
8489
  }, function (err) {
8487
8490
  var _err$response2, _err$response2$data;
@@ -8573,8 +8576,8 @@ var useSwitchAssistant = function useSwitchAssistant() {
8573
8576
  document.title = TITLE$d;
8574
8577
  }, []);
8575
8578
  React.useEffect(function () {
8576
- getAllAssistant();
8577
- }, [modal]);
8579
+ userChoiced.id && getAssistants(userChoiced.id);
8580
+ }, [userChoiced.id]);
8578
8581
  React.useEffect(function () {
8579
8582
  getStudentAssistantData();
8580
8583
  }, [filters]);
@@ -8738,10 +8741,10 @@ var SwitchAssistantList = function SwitchAssistantList() {
8738
8741
  }));
8739
8742
  };
8740
8743
 
8741
- var USER_URL$2 = marioCore.BASE_URL + "/api/user";
8744
+ var USER_URL$3 = marioCore.BASE_URL + "/api/user";
8742
8745
  var ACCOUNT_URL = marioCore.BASE_URL + "/api/account";
8743
8746
  var getUserList = function getUserList(filter) {
8744
- return marioCore.api.get("" + USER_URL$2, {
8747
+ return marioCore.api.get("" + USER_URL$3, {
8745
8748
  params: filter
8746
8749
  });
8747
8750
  };
@@ -18510,8 +18513,8 @@ var useDashboard = function useDashboard() {
18510
18513
  var now = new Date();
18511
18514
 
18512
18515
  var _useState = React.useState({
18513
- startDate: new Date(now.getFullYear(), now.getMonth(), 1).getTime(),
18514
- endDate: new Date(now.getFullYear(), now.getMonth() + 1, 0).getTime(),
18516
+ startDate: new Date(now.getFullYear(), now.getMonth() - 6, 2).getTime(),
18517
+ endDate: new Date(now.getFullYear(), now.getMonth() + 1, 1).getTime(),
18515
18518
  studentIds: [],
18516
18519
  gender: [LegalGenderType.Male, LegalGenderType.Female]
18517
18520
  }),
@@ -18700,7 +18703,7 @@ var useDashboard = function useDashboard() {
18700
18703
  };
18701
18704
  };
18702
18705
 
18703
- var styles$1 = {"dashboard-card":"_1Jgr2","quantity-table":"_3Thdy","size-icon":"_1WLBo","block-dashboard":"_10Pgm","size-arrow":"_3jPb_","color-down":"_1c43y","color-up":"_F1afY","box-filter":"_1kqUQ","title-card":"_10hbz","value-card":"_2rmw_","deviant-card":"_1tdQu","filter-card":"_2BvFN","box-skill-item":"_2TBTW","numerical-order":"_3XXJp","backoround-top-skill":"_LCuWQ","color-filter":"_3x9D7","btn-filter":"_2In63","block-collapse":"_1Vhg_","form-date-picker":"_6yLxd","bock-filter-left":"_h74SO","bock-filter-right":"_3e2pi","form-filter-gender":"_31VDE","form-filter-grade":"_1Pm1w","title-card-box":"_3hSow","box-item":"_1yuC9"};
18706
+ var styles$1 = {"dashboard-card":"_1Jgr2","quantity-table":"_3Thdy","size-icon":"_1WLBo","block-dashboard":"_10Pgm","size-arrow":"_3jPb_","color-down":"_1c43y","color-up":"_F1afY","box-filter":"_1kqUQ","title-card":"_10hbz","value-card":"_2rmw_","deviant-card":"_1tdQu","filter-card":"_2BvFN","box-skill-item":"_2TBTW","numerical-order":"_3XXJp","backoround-top-skill":"_LCuWQ","color-filter":"_3x9D7","btn-filter":"_2In63","block-collapse":"_1Vhg_","form-date-picker":"_6yLxd","bock-filter-left":"_h74SO","bock-filter-right":"_3e2pi","form-filter-gender":"_31VDE","form-filter-grade":"_1Pm1w","title-card-box":"_3hSow","box-item":"_1yuC9","image-no-data":"_2PMoX","image-custom":"_3pkbc","image-special-need":"_16MpB"};
18704
18707
 
18705
18708
  var DashboardCard = function DashboardCard(_ref) {
18706
18709
  var label = _ref.label,
@@ -18718,6 +18721,9 @@ var DashboardCard = function DashboardCard(_ref) {
18718
18721
 
18719
18722
  var ReadinessToLearn = function ReadinessToLearn(_ref) {
18720
18723
  var data = _ref.data;
18724
+ var series = (data === null || data === void 0 ? void 0 : data.map(function (i) {
18725
+ return i.percentQuestion.toFixed(2);
18726
+ })) || [];
18721
18727
  var categories = React.useMemo(function () {
18722
18728
  if (!data) return [];
18723
18729
 
@@ -18740,18 +18746,6 @@ var ReadinessToLearn = function ReadinessToLearn(_ref) {
18740
18746
  show: false
18741
18747
  }
18742
18748
  },
18743
- noData: {
18744
- text: "NO DATA",
18745
- align: "center",
18746
- verticalAlign: "middle",
18747
- offsetX: 0,
18748
- offsetY: 0,
18749
- style: {
18750
- color: undefined,
18751
- fontSize: "14px",
18752
- fontFamily: undefined
18753
- }
18754
- },
18755
18749
  plotOptions: {
18756
18750
  bar: {
18757
18751
  horizontal: false,
@@ -18763,7 +18757,7 @@ var ReadinessToLearn = function ReadinessToLearn(_ref) {
18763
18757
  lineCap: "round"
18764
18758
  },
18765
18759
  labels: (data === null || data === void 0 ? void 0 : data.map(function (i) {
18766
- return i.questionText.replaceAll('<p>', '').replaceAll('</p>', '').trim();
18760
+ return i.questionText.replaceAll("<p>", "").replaceAll("</p>", "").trim();
18767
18761
  })) || [],
18768
18762
  xaxis: {
18769
18763
  categories: categories
@@ -18794,13 +18788,16 @@ var ReadinessToLearn = function ReadinessToLearn(_ref) {
18794
18788
  }
18795
18789
  }
18796
18790
  };
18797
- return React__default.createElement("div", null, React__default.createElement(ReactApexChart, {
18791
+ return React__default.createElement("div", {
18792
+ className: "d-flex justify-content-center"
18793
+ }, series.length > 0 ? React__default.createElement(ReactApexChart, {
18798
18794
  options: options,
18799
- series: (data === null || data === void 0 ? void 0 : data.map(function (i) {
18800
- return i.percentQuestion.toFixed(2);
18801
- })) || [],
18795
+ series: series,
18802
18796
  type: "radialBar",
18803
18797
  height: 350
18798
+ }) : React__default.createElement("img", {
18799
+ className: styles$1["image-no-data"] + " " + styles$1["image-custom"],
18800
+ src: "images/readiness-chart.png"
18804
18801
  }));
18805
18802
  };
18806
18803
 
@@ -18828,10 +18825,19 @@ var Loading = function Loading() {
18828
18825
  var colors = ["#40D2CC", "#1D74C5", "#78B6E2", "#FFC783", "#0D9994"];
18829
18826
 
18830
18827
  var TopLearningStrategy = function TopLearningStrategy(_ref) {
18831
- var _data$learningStrateg, _data$learningStrateg2;
18828
+ var _data$learningStrateg;
18832
18829
 
18833
18830
  var data = _ref.data;
18834
18831
  if (!data) return React__default.createElement(Loading, null);
18832
+
18833
+ var _useState = React.useState(true),
18834
+ isNoData = _useState[0],
18835
+ setIsNoData = _useState[1];
18836
+
18837
+ var _useState2 = React.useState([]),
18838
+ series = _useState2[0],
18839
+ setSeries = _useState2[1];
18840
+
18835
18841
  var options = {
18836
18842
  chart: {
18837
18843
  width: 350,
@@ -18858,17 +18864,28 @@ var TopLearningStrategy = function TopLearningStrategy(_ref) {
18858
18864
  position: "bottom"
18859
18865
  }
18860
18866
  };
18867
+ React.useEffect(function () {
18868
+ var _data$learningStrateg2;
18869
+
18870
+ var result = [];
18871
+ data === null || data === void 0 ? void 0 : (_data$learningStrateg2 = data.learningStrategies) === null || _data$learningStrateg2 === void 0 ? void 0 : _data$learningStrateg2.map(function (i) {
18872
+ result.push(i.usageCount);
18873
+ if (i.usageCount > 0) setIsNoData(false);
18874
+ });
18875
+ setSeries(result);
18876
+ }, [data]);
18861
18877
  return React__default.createElement("div", {
18862
18878
  className: "d-flex h-100 justify-content-center"
18863
18879
  }, React__default.createElement("div", {
18864
18880
  className: "d-flex align-items-end justify-content-center"
18865
- }, React__default.createElement(ReactApexChart, {
18881
+ }, !isNoData ? React__default.createElement(ReactApexChart, {
18866
18882
  options: options,
18867
- series: (data === null || data === void 0 ? void 0 : (_data$learningStrateg2 = data.learningStrategies) === null || _data$learningStrateg2 === void 0 ? void 0 : _data$learningStrateg2.map(function (i) {
18868
- return i.usageCount;
18869
- })) || [],
18883
+ series: series,
18870
18884
  type: "pie",
18871
18885
  height: 350
18886
+ }) : React__default.createElement("img", {
18887
+ className: styles$1["image-no-data"] + " " + styles$1["image-custom"],
18888
+ src: "images/chart-top-learning.png"
18872
18889
  })));
18873
18890
  };
18874
18891
 
@@ -18895,7 +18912,15 @@ var CustomBarChart = function CustomBarChart(_ref) {
18895
18912
  var data = _ref.data,
18896
18913
  question = _ref.question,
18897
18914
  chartName = _ref.chartName;
18898
- var chatMonth = [];
18915
+
18916
+ var _useState = React.useState([]),
18917
+ chatMonth = _useState[0],
18918
+ setChartMonth = _useState[1];
18919
+
18920
+ var _useState2 = React.useState(true),
18921
+ isNoData = _useState2[0],
18922
+ setIsNoData = _useState2[1];
18923
+
18899
18924
  var optionsOne = {
18900
18925
  chart: {
18901
18926
  type: "line",
@@ -18924,21 +18949,24 @@ var CustomBarChart = function CustomBarChart(_ref) {
18924
18949
  markers: {
18925
18950
  size: 5
18926
18951
  },
18927
- colors: ["#082FA2", "#1A55AE", "#3C65E0", "#6D88E8", "#1E80B9", "#1C77AC", "#4992BD", "#77ADCD", "#3DCBCB", "#1DBAB4", "#61CBCB"],
18952
+ colors: ["#40D2CC", "#78B6E2", "#40D2CC", "#6D88E8", "#1E80B9", "#1C77AC", "#4992BD", "#77ADCD", "#3DCBCB", "#1DBAB4", "#61CBCB"],
18928
18953
  xaxis: {
18929
18954
  categories: chatMonth
18930
18955
  },
18931
18956
  yaxis: {
18957
+ min: 0,
18958
+ max: 100,
18959
+ tickAmount: 5,
18932
18960
  labels: {
18933
- offsetX: 10,
18961
+ offsetX: -20,
18934
18962
  show: true
18935
18963
  }
18936
18964
  }
18937
18965
  };
18938
18966
 
18939
- var _useState = React.useState([]),
18940
- series = _useState[0],
18941
- setSeries = _useState[1];
18967
+ var _useState3 = React.useState([]),
18968
+ series = _useState3[0],
18969
+ setSeries = _useState3[1];
18942
18970
 
18943
18971
  var getData = function getData() {
18944
18972
  try {
@@ -18950,10 +18978,11 @@ var CustomBarChart = function CustomBarChart(_ref) {
18950
18978
  data: []
18951
18979
  };
18952
18980
  })) || [];
18981
+ var listMonth = chatMonth;
18953
18982
  data === null || data === void 0 ? void 0 : (_data$overviewQuestio = data.overviewQuestionChoice) === null || _data$overviewQuestio === void 0 ? void 0 : _data$overviewQuestio.map(function (element) {
18954
18983
  var _element$resultQuesti;
18955
18984
 
18956
- chatMonth.push(element.month);
18985
+ listMonth.push(element.month);
18957
18986
  (_element$resultQuesti = element.resultQuestion) === null || _element$resultQuesti === void 0 ? void 0 : _element$resultQuesti.map(function (value) {
18958
18987
  if (value.questionText == "" || !value.questionText || !question) {
18959
18988
  if (!!question) {
@@ -18968,6 +18997,7 @@ var CustomBarChart = function CustomBarChart(_ref) {
18968
18997
 
18969
18998
  var result = (_value$avgOfStudentCh = value.avgOfStudentChoice) === null || _value$avgOfStudentCh === void 0 ? void 0 : _value$avgOfStudentCh.toFixed(2);
18970
18999
  currentData.push(result);
19000
+ setIsNoData(false);
18971
19001
  }
18972
19002
  }
18973
19003
  } else {
@@ -18978,12 +19008,14 @@ var CustomBarChart = function CustomBarChart(_ref) {
18978
19008
  currentData.map(function (r, index) {
18979
19009
  var _value$questionText;
18980
19010
 
18981
- var isCheckContain = (_value$questionText = value.questionText) === null || _value$questionText === void 0 ? void 0 : _value$questionText.includes(r.name);
19011
+ var isCheckContain = (_value$questionText = value.questionText) === null || _value$questionText === void 0 ? void 0 : _value$questionText.toLocaleLowerCase().includes(r.name.toLocaleLowerCase());
18982
19012
  if (isCheckContain) currentData[index].data.push(_result);
19013
+ setIsNoData(false);
18983
19014
  });
18984
19015
  }
18985
19016
  });
18986
19017
  });
19018
+ setChartMonth(listMonth);
18987
19019
  setSeries(!!question ? currentData : [{
18988
19020
  name: chartName || "",
18989
19021
  data: currentData
@@ -18997,17 +19029,29 @@ var CustomBarChart = function CustomBarChart(_ref) {
18997
19029
  React.useEffect(function () {
18998
19030
  getData();
18999
19031
  }, [data]);
19000
- return React__default.createElement("div", null, React__default.createElement(ReactApexChart, {
19032
+ return React__default.createElement("div", null, !isNoData ? React__default.createElement(ReactApexChart, {
19001
19033
  options: optionsOne,
19002
19034
  series: series,
19003
19035
  type: "line",
19004
19036
  width: "100%",
19005
19037
  height: 350
19038
+ }) : React__default.createElement("img", {
19039
+ className: "" + styles$1["image-no-data"],
19040
+ src: "images/line-chart-nodata.png"
19006
19041
  }));
19007
19042
  };
19008
19043
 
19009
19044
  var StudentByGrade = function StudentByGrade(_ref) {
19010
19045
  var data = _ref.data;
19046
+
19047
+ var _useState = React.useState(true),
19048
+ isNoData = _useState[0],
19049
+ setIsNoData = _useState[1];
19050
+
19051
+ var _useState2 = React.useState([]),
19052
+ series = _useState2[0],
19053
+ setSeries = _useState2[1];
19054
+
19011
19055
  var options = {
19012
19056
  chart: {
19013
19057
  height: 350,
@@ -19017,17 +19061,31 @@ var StudentByGrade = function StudentByGrade(_ref) {
19017
19061
  },
19018
19062
  plotOptions: {
19019
19063
  bar: {
19020
- borderRadius: 4,
19021
- horizontal: true
19064
+ borderRadius: 2,
19065
+ horizontal: true,
19066
+ dataLabels: {
19067
+ position: "right"
19068
+ }
19022
19069
  }
19023
19070
  },
19024
19071
  dataLabels: {
19025
- enabled: false
19072
+ enabled: false,
19073
+ style: {
19074
+ fontSize: "12px",
19075
+ colors: ["#1D74C5", "#78B6E2", "#78B6E2", "#A4D1F0", "#4B92CE"]
19076
+ }
19026
19077
  },
19027
19078
  grid: {
19028
19079
  show: false
19029
19080
  },
19030
- colors: ["#1D74C5", "#2eb85c", "#78B6E2", "#A4D1F0", "#4B92CE"],
19081
+ tooltip: {
19082
+ x: {
19083
+ formatter: function formatter(val) {
19084
+ return val;
19085
+ }
19086
+ }
19087
+ },
19088
+ colors: ["#1D74C5", "#78B6E2", "#78B6E2", "#A4D1F0", "#4B92CE"],
19031
19089
  xaxis: {
19032
19090
  labels: {
19033
19091
  show: false
@@ -19038,19 +19096,35 @@ var StudentByGrade = function StudentByGrade(_ref) {
19038
19096
  axisTicks: {
19039
19097
  show: false
19040
19098
  }
19099
+ },
19100
+ yaxis: {
19101
+ axisBorder: {
19102
+ show: false
19103
+ },
19104
+ axisTicks: {
19105
+ show: false
19106
+ }
19041
19107
  }
19042
19108
  };
19043
- var series = [{
19044
- data: (data === null || data === void 0 ? void 0 : data.map(function (i) {
19045
- return i.quantity;
19046
- })) || []
19047
- }];
19048
- return React__default.createElement("div", null, React__default.createElement(ReactApexChart, {
19109
+ React.useEffect(function () {
19110
+ var result = [];
19111
+ data === null || data === void 0 ? void 0 : data.map(function (i) {
19112
+ result.push(i.quantity);
19113
+ if (i.quantity > 0) setIsNoData(false);
19114
+ });
19115
+ setSeries([{
19116
+ data: result
19117
+ }]);
19118
+ }, [data]);
19119
+ return React__default.createElement("div", null, !isNoData ? React__default.createElement(ReactApexChart, {
19049
19120
  options: options,
19050
19121
  series: series,
19051
19122
  type: "bar",
19052
19123
  width: "100%",
19053
19124
  height: 350
19125
+ }) : React__default.createElement("img", {
19126
+ className: "" + styles$1["image-no-data"],
19127
+ src: "images/grade.png"
19054
19128
  }));
19055
19129
  };
19056
19130
 
@@ -19058,27 +19132,61 @@ var StudentByGender = function StudentByGender(_ref) {
19058
19132
  var data = _ref.data;
19059
19133
  var series = !!data ? [data.male, data.female] : [];
19060
19134
  var options = {
19061
- labels: ["Female", "Male"],
19135
+ labels: ["Male", "Female"],
19062
19136
  colors: ["#A4D1F0", "#40D2CC"],
19137
+ customScale: 0.8,
19063
19138
  legend: {
19064
19139
  show: false
19140
+ },
19141
+ dataLabels: {
19142
+ formatter: function formatter(_val, opts) {
19143
+ return opts.w.config.series[opts.seriesIndex];
19144
+ },
19145
+ style: {
19146
+ fontSize: "32px",
19147
+ fontWeight: 'bold',
19148
+ colors: ["#1D74C5", "#0D9994"]
19149
+ }
19150
+ },
19151
+ fill: {
19152
+ colors: ["#D6ECFB", "#CEF7F5"]
19153
+ },
19154
+ stroke: {
19155
+ colors: ["#A4D1F0", "#80E7E2"],
19156
+ width: 3
19065
19157
  }
19066
19158
  };
19067
19159
  return React__default.createElement("div", {
19068
19160
  className: "d-flex h-100 justify-content-center"
19069
19161
  }, React__default.createElement("div", {
19070
19162
  className: "d-flex align-items-end justify-content-center"
19071
- }, React__default.createElement(ReactApexChart, {
19163
+ }, !!(data !== null && data !== void 0 && data.male) && !!(data !== null && data !== void 0 && data.female) ? React__default.createElement(ReactApexChart, {
19072
19164
  options: options,
19073
19165
  series: series,
19074
19166
  type: "pie",
19075
- height: 350,
19167
+ height: 300,
19076
19168
  width: "100%"
19169
+ }) : React__default.createElement("img", {
19170
+ src: "images/no-data-haft-pie.png",
19171
+ style: {
19172
+ height: "300px",
19173
+ margin: "0 auto",
19174
+ display: "block"
19175
+ }
19077
19176
  })));
19078
19177
  };
19079
19178
 
19080
19179
  var StudentWithSpecialNeeds = function StudentWithSpecialNeeds(_ref) {
19081
19180
  var data = _ref.data;
19181
+
19182
+ var _useState = React.useState(true),
19183
+ isNoData = _useState[0],
19184
+ setIsNoData = _useState[1];
19185
+
19186
+ var _useState2 = React.useState([]),
19187
+ series = _useState2[0],
19188
+ setSeries = _useState2[1];
19189
+
19082
19190
  var options = {
19083
19191
  colors: ["#CEF7F5", "#0D9994", "#1CB7B1", "#40D2CC", "#80E7E2"],
19084
19192
  legend: {
@@ -19095,14 +19203,25 @@ var StudentWithSpecialNeeds = function StudentWithSpecialNeeds(_ref) {
19095
19203
  }
19096
19204
  }
19097
19205
  };
19098
- return React__default.createElement("div", null, React__default.createElement(ReactApexChart, {
19206
+ React.useEffect(function () {
19207
+ var result = [];
19208
+ data === null || data === void 0 ? void 0 : data.map(function (i) {
19209
+ result.push(i.numberSpecial);
19210
+ if (i.numberSpecial > 0) setIsNoData(false);
19211
+ });
19212
+ setSeries(result);
19213
+ }, [data]);
19214
+ return React__default.createElement("div", {
19215
+ className: "d-flex justify-content-center"
19216
+ }, !isNoData ? React__default.createElement(ReactApexChart, {
19099
19217
  options: options,
19100
- series: (data === null || data === void 0 ? void 0 : data.map(function (i) {
19101
- return i.numberSpecial;
19102
- })) || [],
19218
+ series: series,
19103
19219
  type: "donut",
19104
19220
  width: "100%",
19105
19221
  height: 350
19222
+ }) : React__default.createElement("img", {
19223
+ className: styles$1["image-no-data"] + " " + styles$1["image-special-need"],
19224
+ src: "images/donut-data.png"
19106
19225
  }));
19107
19226
  };
19108
19227
 
@@ -19140,12 +19259,15 @@ var StudentByAge = function StudentByAge(_ref) {
19140
19259
  var series = [{
19141
19260
  data: !!data ? [data === null || data === void 0 ? void 0 : data.threeToFive, data === null || data === void 0 ? void 0 : data.sixToEight, data === null || data === void 0 ? void 0 : data.nineToTwelve, data === null || data === void 0 ? void 0 : data.thirteenToFifteen, data === null || data === void 0 ? void 0 : data.sixteenToEighteen] : []
19142
19261
  }];
19143
- return React__default.createElement("div", null, React__default.createElement(ReactApexChart, {
19262
+ return React__default.createElement("div", null, series[0].data !== [0, 0, 0, 0, 0] ? React__default.createElement(ReactApexChart, {
19144
19263
  options: options,
19145
19264
  series: series,
19146
19265
  type: "bar",
19147
19266
  width: "100%",
19148
19267
  height: 350
19268
+ }) : React__default.createElement("img", {
19269
+ className: "" + styles$1["image-no-data"],
19270
+ src: "images/student-by-age.png"
19149
19271
  }));
19150
19272
  };
19151
19273
 
@@ -19409,7 +19531,7 @@ var Dashboard = function Dashboard() {
19409
19531
  var user = reactRedux.useSelector(function (state) {
19410
19532
  return state.common.user;
19411
19533
  });
19412
- var questionOneToOne = ["Well-being", "Growth", "Relations", "Productivity", "Academic", "Self-Efficacy", "Happiness", "Energy", "Focus", "Mood", "Learning progress"];
19534
+ var questionOneToOne = ["Well-being", "Growth", "Relations", "Productivity", "Academic", "Self-Efficacy", "Happiness", "Energy", "Focus"];
19413
19535
  var questionClassReflection = ["Focus", "Energy", "Happiness", "Stress", "Productivity"];
19414
19536
  var questionConferences = ["Organization", "Self-Awareness", "Self-Directed Learning", "Self-Management", "Self-Management", "Self-Advocacy"];
19415
19537
  var cards = [{
@@ -19542,7 +19664,9 @@ var Dashboard = function Dashboard() {
19542
19664
  };
19543
19665
 
19544
19666
  var handleFormatDate = function handleFormatDate(date) {
19545
- var dateTime = new Date(date).toISOString().slice(0, 10);
19667
+ var _Date, _Date$toISOString;
19668
+
19669
+ var dateTime = !!date ? (_Date = new Date(date)) === null || _Date === void 0 ? void 0 : (_Date$toISOString = _Date.toISOString()) === null || _Date$toISOString === void 0 ? void 0 : _Date$toISOString.slice(0, 10) : "";
19546
19670
  return dateTime;
19547
19671
  };
19548
19672