mario-education 2.4.185-level → 2.4.186-level

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.
Files changed (33) hide show
  1. package/dist/MarioFramework.Education/ClientApp/src/containers/Dashboard/components/OverallDonutChart.d.ts +1 -0
  2. package/dist/MarioFramework.Education/ClientApp/src/containers/Dashboard/configs/types.d.ts +11 -0
  3. package/dist/MarioFramework.Education/ClientApp/src/containers/Dashboard/configs/utils.d.ts +2 -1
  4. package/dist/MarioFramework.Education/ClientApp/src/containers/OneRoster/components/ImportOneRoster.d.ts +6 -0
  5. package/dist/MarioFramework.Education/ClientApp/src/containers/OneRoster/components/RosterConfigForm.d.ts +8 -0
  6. package/dist/MarioFramework.Education/ClientApp/src/containers/OneRoster/components/Rostering.d.ts +6 -0
  7. package/dist/MarioFramework.Education/ClientApp/src/containers/OneRoster/hooks/useImportOneRoster.d.ts +26 -0
  8. package/dist/MarioFramework.Education/ClientApp/src/containers/OneRoster/hooks/useRostering.d.ts +23 -0
  9. package/dist/MarioFramework.Education/ClientApp/src/containers/OneRoster/hooks/userRosterConfigForm.d.ts +7 -0
  10. package/dist/MarioFramework.Education/ClientApp/src/containers/OneRoster/utils/constants.d.ts +2 -0
  11. package/dist/MarioFramework.Education/ClientApp/src/containers/OneRoster/utils/types.d.ts +4 -0
  12. package/dist/MarioFramework.Education/ClientApp/src/containers/OneRoster/views/OneRoster.d.ts +3 -0
  13. package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/configs/constants.d.ts +6 -1
  14. package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/configs/overviewFn.d.ts +1 -1
  15. package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/configs/types.d.ts +1 -0
  16. package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/hooks/useChartDatas.d.ts +9 -6
  17. package/dist/MarioFramework.Education/ClientApp/src/containers/SurveyDashboard/hooks/useDashboard.d.ts +9 -8
  18. package/dist/MarioFramework.Education/ClientApp/src/services/dashboardService.d.ts +1 -0
  19. package/dist/MarioFramework.Education/ClientApp/src/services/oneRosterService.d.ts +4 -0
  20. package/dist/MarioFramework.Education/ClientApp/src/services/roster.d.ts +4 -0
  21. package/dist/MarioFramework.Education/ClientApp/src/utils/constants.d.ts +2 -1
  22. package/dist/MarioFramework.Education/ClientApp/src/utils/type.d.ts +6 -0
  23. package/dist/index.css +2191 -2187
  24. package/dist/index.js +337 -938
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.modern.js +337 -938
  27. package/dist/index.modern.js.map +1 -1
  28. package/package.json +98 -98
  29. package/dist/MarioFramework.Education/ClientApp/src/containers/Dashboard/components/ReadinessToLearn.d.ts +0 -7
  30. package/dist/MarioFramework.Education/ClientApp/src/containers/SwitchCounselor/hooks/useSwitchAssistant.d.ts +0 -18
  31. package/dist/MarioFramework.Education/ClientApp/src/containers/SwitchSecondaryTeacher/components/SwitchCounselorModal.d.ts +0 -4
  32. package/dist/MarioFramework.Education/ClientApp/src/containers/SwitchSecondaryTeacher/hooks/useSwitchCounselor.d.ts +0 -18
  33. /package/dist/MarioFramework.Education/ClientApp/src/utils/{servicetype.interface.d.ts → serviceType.interface.d.ts} +0 -0
package/dist/index.js CHANGED
@@ -1244,6 +1244,7 @@ var FILTER_NAME;
1244
1244
  FILTER_NAME["EndDate"] = "end_date";
1245
1245
  FILTER_NAME["FavoriteSurvey"] = "favorite_survey";
1246
1246
  FILTER_NAME["AcademicYear"] = "academic_year";
1247
+ FILTER_NAME["ShowBy"] = "show_by";
1247
1248
  })(FILTER_NAME || (FILTER_NAME = {}));
1248
1249
 
1249
1250
  var header$1 = "Conference rubric";
@@ -22525,6 +22526,13 @@ var FILTER_YEAR;
22525
22526
  FILTER_YEAR[FILTER_YEAR["LAST_DAY"] = 4] = "LAST_DAY";
22526
22527
  })(FILTER_YEAR || (FILTER_YEAR = {}));
22527
22528
 
22529
+ var FILTER_SHOW_BY;
22530
+
22531
+ (function (FILTER_SHOW_BY) {
22532
+ FILTER_SHOW_BY["MONTH"] = "Month";
22533
+ FILTER_SHOW_BY["WEEK"] = "Week";
22534
+ })(FILTER_SHOW_BY || (FILTER_SHOW_BY = {}));
22535
+
22528
22536
  var TYPECHART;
22529
22537
 
22530
22538
  (function (TYPECHART) {
@@ -28972,7 +28980,7 @@ var optionLineChart = function optionLineChart(months, activeData, colors, dayOf
28972
28980
  }
28973
28981
  };
28974
28982
  };
28975
- var overallDonutCHartOptions = function overallDonutCHartOptions(labelNames, colors) {
28983
+ var overallDonutCHartOptions = function overallDonutCHartOptions(labelNames, colors, textColors) {
28976
28984
  return {
28977
28985
  legend: {
28978
28986
  show: false,
@@ -29008,7 +29016,7 @@ var overallDonutCHartOptions = function overallDonutCHartOptions(labelNames, col
29008
29016
  dataLabels: {
29009
29017
  enabled: true,
29010
29018
  style: {
29011
- colors: ["#242424", "#242424"],
29019
+ colors: textColors || ["#242424", "#242424"],
29012
29020
  fontSize: "12px",
29013
29021
  fontFamily: "Poppins-Regular !important"
29014
29022
  },
@@ -29094,6 +29102,13 @@ var handleAveraged = function handleAveraged(points) {
29094
29102
  }, 0);
29095
29103
  return total / points.length;
29096
29104
  };
29105
+ var handleGenerateAvgQuestion = function handleGenerateAvgQuestion(data, avgContent) {
29106
+ var _handleAveraged$toFix, _handleAveraged, _data$reduce;
29107
+
29108
+ return !avgContent ? "AVR. " + ((_handleAveraged$toFix = (_handleAveraged = handleAveraged(data)) === null || _handleAveraged === void 0 ? void 0 : _handleAveraged.toFixed(2)) != null ? _handleAveraged$toFix : 0) + "%" : ((_data$reduce = data.reduce(function (accumulator, currentValue) {
29109
+ return accumulator + currentValue;
29110
+ }, 0)) != null ? _data$reduce : 0) + " " + avgContent;
29111
+ };
29097
29112
 
29098
29113
  var REPORT_URL = marioCore.BASE_URL + "/api/report";
29099
29114
  var BAND_SCORE = marioCore.BASE_URL + "/api/bandScore";
@@ -29169,11 +29184,6 @@ var getGrades = function getGrades(studentUserId, academicYearId) {
29169
29184
  var getBandScore = function getBandScore() {
29170
29185
  return marioCore.api.get("" + BAND_SCORE);
29171
29186
  };
29172
- var getTopMostSurveyUsed = function getTopMostSurveyUsed(filter) {
29173
- return marioCore.api.get(REPORT_URL + "/top-most-survey-used", {
29174
- params: filter
29175
- });
29176
- };
29177
29187
  var getAllTotalSurvey = function getAllTotalSurvey(filter) {
29178
29188
  return marioCore.api.get(REPORT_URL + "/dashboard-survey-total", {
29179
29189
  params: filter
@@ -29189,6 +29199,11 @@ var getDashboardTemplateSurvey = function getDashboardTemplateSurvey(filters) {
29189
29199
  params: filters
29190
29200
  });
29191
29201
  };
29202
+ var getDashboardTotalSurvey = function getDashboardTotalSurvey(filters) {
29203
+ return marioCore.api.get(REPORT_URL + "/get-dashboard-total-survey", {
29204
+ params: filters
29205
+ });
29206
+ };
29192
29207
  var getAllAcademicYearApi = function getAllAcademicYearApi(filters) {
29193
29208
  return marioCore.api.get(ACADEMIC_YEAR_URL$1, {
29194
29209
  params: filters
@@ -30152,6 +30167,27 @@ var SelectFilter = function SelectFilter(_ref) {
30152
30167
  }
30153
30168
  };
30154
30169
 
30170
+ var onChangeShowBy = function onChangeShowBy(showBy) {
30171
+ console.log({
30172
+ showBy: showBy
30173
+ });
30174
+ setLabelBox(_extends({}, labelBox, {
30175
+ showBy: showBy
30176
+ }));
30177
+
30178
+ if (!showBy) {
30179
+ !!onChangeFilters && onChangeFilters({
30180
+ showBy: "",
30181
+ optionDate: ""
30182
+ });
30183
+ } else {
30184
+ !!onChangeFilters && onChangeFilters({
30185
+ showBy: showBy.showBy,
30186
+ optionDate: showBy.value
30187
+ });
30188
+ }
30189
+ };
30190
+
30155
30191
  var handleResetCalendar = function handleResetCalendar() {
30156
30192
  setLabelBox(_extends({}, labelBox, {
30157
30193
  calendarTime: undefined
@@ -30163,6 +30199,16 @@ var SelectFilter = function SelectFilter(_ref) {
30163
30199
  });
30164
30200
  };
30165
30201
 
30202
+ var handleResetShowBy = function handleResetShowBy() {
30203
+ setLabelBox(_extends({}, labelBox, {
30204
+ showBy: undefined
30205
+ }));
30206
+ !!onChangeFilters && onChangeFilters({
30207
+ showBy: "",
30208
+ optionDate: ""
30209
+ });
30210
+ };
30211
+
30166
30212
  var onChangeBandScore = function onChangeBandScore(score) {
30167
30213
  setLabelBox(_extends({}, labelBox, {
30168
30214
  bandScore: score.value
@@ -30526,6 +30572,56 @@ var SelectFilter = function SelectFilter(_ref) {
30526
30572
  }))));
30527
30573
  }
30528
30574
 
30575
+ if (name == FILTER_NAME.ShowBy) {
30576
+ var showByOption = option === null || option === void 0 ? void 0 : option.find(function (i) {
30577
+ var _labelBox$showBy;
30578
+
30579
+ return i.label === ((_labelBox$showBy = labelBox.showBy) === null || _labelBox$showBy === void 0 ? void 0 : _labelBox$showBy.label);
30580
+ });
30581
+ return React__default.createElement("div", {
30582
+ key: "" + name,
30583
+ className: styles["block-filter-component"] + " ",
30584
+ ref: ref
30585
+ }, React__default.createElement("button", {
30586
+ onClick: handleToggleCollapse,
30587
+ className: styles["btn-filter"] + " d-flex align-items-center cursor-pointer"
30588
+ }, React__default.createElement("img", {
30589
+ src: "" + icon,
30590
+ alt: name
30591
+ }), React__default.createElement("p", {
30592
+ className: styles["color-filter"] + " my-0 mx-2"
30593
+ }, !labelBox.showBy ? "" + t('Show by') : showByOption === null || showByOption === void 0 ? void 0 : showByOption.label), !!showByOption && !!labelBox.showBy && React__default.createElement(io.IoMdClose, {
30594
+ className: "mx-2",
30595
+ onClick: handleResetShowBy
30596
+ }), !isOpenCollapse ? React__default.createElement(fi.FiChevronDown, null) : React__default.createElement(fi.FiChevronUp, null)), React__default.createElement("div", {
30597
+ className: styles["select-filter-component"] + " " + (!isOpenCollapse && "" + styles["hidden"])
30598
+ }, React__default.createElement(reactstrap.Form, {
30599
+ className: styles["box-select"] + " " + styles["box-select-format"]
30600
+ }, option === null || option === void 0 ? void 0 : option.map(function (e) {
30601
+ var _labelBox$showBy2;
30602
+
30603
+ return React__default.createElement(reactstrap.FormGroup, {
30604
+ check: true,
30605
+ className: "my-2 px-3",
30606
+ key: "" + e.label
30607
+ }, React__default.createElement(reactstrap.Input, {
30608
+ id: e.label,
30609
+ name: "calendar",
30610
+ value: [e.label],
30611
+ type: "radio",
30612
+ className: "" + styles["radio-btn"],
30613
+ checked: ((_labelBox$showBy2 = labelBox.showBy) === null || _labelBox$showBy2 === void 0 ? void 0 : _labelBox$showBy2.label) === e.label,
30614
+ onChange: function onChange() {
30615
+ return onChangeShowBy(e);
30616
+ }
30617
+ }), React__default.createElement(reactstrap.Label, {
30618
+ check: true,
30619
+ "for": e.label,
30620
+ className: "" + styles["box-select-label"]
30621
+ }, React__default.createElement("p", null, e.label)));
30622
+ }))));
30623
+ }
30624
+
30529
30625
  if (name == FILTER_NAME.FavoriteSurvey) {
30530
30626
  var _option$find5;
30531
30627
 
@@ -30675,9 +30771,10 @@ var OverallDonutChart = function OverallDonutChart(_ref) {
30675
30771
  _ref$width = _ref.width,
30676
30772
  width = _ref$width === void 0 ? "100%" : _ref$width,
30677
30773
  _ref$height = _ref.height,
30678
- height = _ref$height === void 0 ? 250 : _ref$height;
30774
+ height = _ref$height === void 0 ? 250 : _ref$height,
30775
+ textColors = _ref.textColors;
30679
30776
  return React__default.createElement(Chart, {
30680
- options: overallDonutCHartOptions(label, colors),
30777
+ options: overallDonutCHartOptions(label, colors, textColors),
30681
30778
  series: series,
30682
30779
  type: "donut",
30683
30780
  width: width,
@@ -30701,7 +30798,9 @@ var GenerateChartData = function GenerateChartData(_ref) {
30701
30798
  timeOfDay = _ref.timeOfDay,
30702
30799
  isPrint = _ref.isPrint,
30703
30800
  width = _ref.width,
30704
- height = _ref.height;
30801
+ height = _ref.height,
30802
+ avgContent = _ref.avgContent,
30803
+ textColors = _ref.textColors;
30705
30804
  var avgs = [];
30706
30805
 
30707
30806
  var _loop = function _loop(i) {
@@ -30752,7 +30851,7 @@ var GenerateChartData = function GenerateChartData(_ref) {
30752
30851
  })), React__default.createElement("div", {
30753
30852
  className: styles$1["listItem"] + " " + (!onActiveColumn && styles$1["ml-10"])
30754
30853
  }, series.map(function (item, index) {
30755
- var _handleAveraged$toFix, _handleAveraged, _Math$abs, _Math$abs2;
30854
+ var _handleGenerateAvgQue, _Math$abs, _Math$abs2;
30756
30855
 
30757
30856
  var isStressQuestion = item.name.toLocaleLowerCase().includes("stress");
30758
30857
  var classArrowUp = !isStressQuestion ? "arrow-up" : "arrow-down";
@@ -30782,7 +30881,7 @@ var GenerateChartData = function GenerateChartData(_ref) {
30782
30881
  className: "" + styles$1["label-chart"]
30783
30882
  }, item.name)), React__default.createElement("p", {
30784
30883
  className: "" + styles$1["avr-question"]
30785
- }, "AVR. " + ((_handleAveraged$toFix = (_handleAveraged = handleAveraged(item.data)) === null || _handleAveraged === void 0 ? void 0 : _handleAveraged.toFixed(2)) != null ? _handleAveraged$toFix : 0) + "%"), React__default.createElement("div", {
30884
+ }, "" + ((_handleGenerateAvgQue = handleGenerateAvgQuestion(item.data, avgContent)) != null ? _handleGenerateAvgQue : 0)), React__default.createElement("div", {
30786
30885
  hidden: avgs.length == 0 || !timeOfDay,
30787
30886
  className: "" + styles$1["volatility"]
30788
30887
  }, avgs[index] < 0 ? React__default.createElement("div", {
@@ -30835,7 +30934,8 @@ var GenerateChartData = function GenerateChartData(_ref) {
30835
30934
  colors: colors,
30836
30935
  label: label,
30837
30936
  width: width,
30838
- height: height
30937
+ height: height,
30938
+ textColors: textColors
30839
30939
  })));
30840
30940
  };
30841
30941
 
@@ -34146,7 +34246,7 @@ var AdminTraining = function AdminTraining() {
34146
34246
  })));
34147
34247
  };
34148
34248
 
34149
- var styles$2 = {"dashboard-card":"_3U9cF","quantity-table":"_3lYP4","label-chart":"_EIKHR","size-icon":"_3waCS","block-dashboard":"_2n_zv","size-arrow":"_36sKX","color-down":"_1TjNf","color-up":"_i4rwq","box-filter":"_BlYR7","title-card":"_3fBK1","value-card":"_2w6yc","deviant-card":"_1aq6C","filter-card":"_2lX51","box-skill-item":"_jGO7A","numerical-order":"_2dXys","backoround-top-skill":"_3-8WB","color-filter":"_5QHKk","btn-filter":"_2UyJG","block-collapse":"_1SL-6","form-date-picker":"_pKQ8e","bock-filter-left":"_2eZGm","bock-filter-right":"_dz04Q","form-filter-right":"_OhjkA","form-filter-left":"_-q4tF","bock-filter-wrap":"_nukn6","title-card-box":"_2ysrj","box-item":"_37HdU","image-no-data":"_-jYtE","image-grade":"_2FOHk","chart-data":"_38Xgv","apexcharts-datalabels":"_3m9ET","apexcharts-pie-label":"_3QJAM","image-custom":"_11W3J","image-special-need":"_2-frJ","title-dashboard":"_1_YyD","box-chart":"_xbK6p","block-filter-right":"_11sYZ","shadow-lg":"_rFfwe","chart-header-wrapper":"_zLI7s","devide-component":"_OoZLR","header-chart":"_3mzht","header-left":"_2gXQT","icon-chart":"_3XABq","header-right":"_1FHsv","header-title":"_2JBD5","button-export":"_2OEd7","button-content":"_2nyRe","button-icon":"_31EdD","icon-config":"_TmymT","cursor-pointer":"_3X_ow","btn-show-chart":"_1qdL4","checkbox-chart":"_PghQI","column-chart-percent":"_12jqi","chart-background":"_2rwg5","custom-marker":"_3iwnG","mark-custom":"_rKYWD","item-legend":"_n_lnI","label-legend-custom":"_3hlTa","mark-legend":"_1LGIl","percent":"_1mr1m","listItem":"_E_ciE","item":"_27ojF","student-by-age":"_2KJYt","total-student":"_hEgnv","pie-chart":"_34-k0","options-gender":"_119UL","legend":"_tlvnI","text-lengend":"_2Ehxf","student-by-grade":"_L1RnZ","bubble-chart-custom":"_18zab","x-axis-custom-wrap":"_1NRsG","axis-content":"_1jDpB","legend-wrap":"_93MRp","list-percent":"_3ipHU","percent-item":"_35mGN","chart-custom":"_1769M","chart-buddle":"_ton1p","title-grade":"_2LTMk","title-modal":"_3f2-D","header-desc-modal":"_19k86","form-checkbox":"_2ZpLB","checkbox-content":"_jLDZ4","btn-export":"_2sMK7","title-chart":"_1E7vX","image-logo":"_3Xggx","chart-to-canvas":"_3zQW_","box-chart-title":"_2HMn5","chart-view-dashboard":"_1qtzK","chart-left":"_g4q-z","chart-right":"_9ibzA","block-header-chart":"_1s7DG","item-checkbox":"_5wSJP","check-box":"_1h1ro","legend-pie-custom":"_2MTrM","legend-item":"_2kriq","color-box":"_jOIdn","filter-mobile-block":"_1bZCU","filter-wrapper-mobile":"_FjhpG","gap-8px":"_4SQcs"};
34249
+ var styles$2 = {"dashboard-card":"_3U9cF","quantity-table":"_3lYP4","label-chart":"_EIKHR","size-icon":"_3waCS","survey-dashboard-chart":"_Dr0mP","survey-donut-chart":"_2aFDQ","size-arrow":"_36sKX","color-down":"_1TjNf","color-up":"_i4rwq","box-filter":"_BlYR7","title-card":"_3fBK1","value-card":"_2w6yc","deviant-card":"_1aq6C","filter-card":"_2lX51","box-skill-item":"_jGO7A","numerical-order":"_2dXys","backoround-top-skill":"_3-8WB","color-filter":"_5QHKk","btn-filter":"_2UyJG","block-collapse":"_1SL-6","form-date-picker":"_pKQ8e","bock-filter-left":"_2eZGm","bock-filter-right":"_dz04Q","form-filter-right":"_OhjkA","form-filter-left":"_-q4tF","bock-filter-wrap":"_nukn6","title-card-box":"_2ysrj","box-item":"_37HdU","image-no-data":"_-jYtE","image-grade":"_2FOHk","chart-data":"_38Xgv","apexcharts-datalabels":"_3m9ET","apexcharts-pie-label":"_3QJAM","image-custom":"_11W3J","image-special-need":"_2-frJ","title-dashboard":"_1_YyD","box-chart":"_xbK6p","block-filter-right":"_11sYZ","shadow-lg":"_rFfwe","chart-header-wrapper":"_zLI7s","devide-component":"_OoZLR","header-chart":"_3mzht","header-left":"_2gXQT","icon-chart":"_3XABq","header-right":"_1FHsv","header-title":"_2JBD5","button-export":"_2OEd7","button-content":"_2nyRe","button-icon":"_31EdD","icon-config":"_TmymT","cursor-pointer":"_3X_ow","btn-show-chart":"_1qdL4","checkbox-chart":"_PghQI","column-chart-percent":"_12jqi","chart-background":"_2rwg5","custom-marker":"_3iwnG","mark-custom":"_rKYWD","item-legend":"_n_lnI","label-legend-custom":"_3hlTa","mark-legend":"_1LGIl","percent":"_1mr1m","listItem":"_E_ciE","item":"_27ojF","student-by-age":"_2KJYt","total-student":"_hEgnv","pie-chart":"_34-k0","options-gender":"_119UL","legend":"_tlvnI","text-lengend":"_2Ehxf","student-by-grade":"_L1RnZ","bubble-chart-custom":"_18zab","x-axis-custom-wrap":"_1NRsG","axis-content":"_1jDpB","legend-wrap":"_93MRp","list-percent":"_3ipHU","percent-item":"_35mGN","chart-custom":"_1769M","chart-buddle":"_ton1p","title-grade":"_2LTMk","title-modal":"_3f2-D","header-desc-modal":"_19k86","form-checkbox":"_2ZpLB","checkbox-content":"_jLDZ4","btn-export":"_2sMK7","title-chart":"_1E7vX","image-logo":"_3Xggx","chart-to-canvas":"_3zQW_","box-chart-title":"_2HMn5","chart-view-dashboard":"_1qtzK","chart-left":"_g4q-z","chart-right":"_9ibzA","block-header-chart":"_1s7DG","item-checkbox":"_5wSJP","check-box":"_1h1ro","legend-pie-custom":"_2MTrM","legend-item":"_2kriq","color-box":"_jOIdn","filter-mobile-block":"_1bZCU","block-dashboard":"_2n_zv","filter-wrapper-mobile":"_FjhpG","gap-8px":"_4SQcs"};
34150
34250
 
34151
34251
  var LegalGenderType$1;
34152
34252
 
@@ -34183,22 +34283,11 @@ var TYPECHART$1;
34183
34283
  TYPECHART[TYPECHART["BOTH"] = 3] = "BOTH";
34184
34284
  })(TYPECHART$1 || (TYPECHART$1 = {}));
34185
34285
 
34186
- var COLOR_CHART_AND_PERCENTS = ["#73C8E5", "#97AFB9", "#FFB04F", "#FF7670", "#00B8B2", "#00B8FF", "#C6A762", "#C94645", "#006E60", "#336DDA", "#994700"];
34187
-
34188
- var COLOR_CHART_AND_PIE = ["#5A7F05", "#C94645", "#FFB04F"];
34189
- var COLOR_LABEL_PIE = ["#006E60", "#FF7670", "#994700"];
34190
34286
  var GRAGE_DEFAULT$1 = ["K", "G", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
34191
- var LABEL_NAME_PIE_CHART = ["Green", "Red", "Yellow"];
34192
34287
  var INITIAl_STUDENT_DASHBOARD$1 = {
34193
34288
  responseRate: 0,
34194
34289
  totalSurvey: 0
34195
34290
  };
34196
- var INIT_TOP_MOST_SURVEY_USED = {
34197
- nameSurvey: "",
34198
- sendDateSurvey: new Date(),
34199
- percentSurvey: 0
34200
- };
34201
- var COLOR_CHART_AND_PERCENTS$1 = ["#73C8E5", "#97AFB9", "#FFB04F", "#FF7670", "#00B8B2", "#00B8FF", "#C6A762", "#C94645", "#006E60", "#336DDA", "#994700"];
34202
34291
  var DEFAULT_START_DATE$1 = moment().subtract(2, 'months').startOf("day").valueOf();
34203
34292
  var DEFAULT_END_DATE$1 = moment().endOf("day").valueOf();
34204
34293
  var CALENDAR_OPTIONS$1 = [{
@@ -34214,7 +34303,13 @@ var CALENDAR_OPTIONS$1 = [{
34214
34303
  startDate: moment().startOf("month").valueOf(),
34215
34304
  endDate: moment().endOf("month").valueOf()
34216
34305
  }];
34217
- var COLOR_NAME = ["Green", "Red", "Yellow"];
34306
+ var SHOW_BY_OPTIONS = [{
34307
+ label: "Weeks",
34308
+ showBy: "Week"
34309
+ }, {
34310
+ label: "Months",
34311
+ showBy: "Month"
34312
+ }];
34218
34313
  var TYPECHART$2;
34219
34314
 
34220
34315
  (function (TYPECHART) {
@@ -34222,10 +34317,9 @@ var TYPECHART$2;
34222
34317
  TYPECHART[TYPECHART["BAR"] = 1] = "BAR";
34223
34318
  TYPECHART[TYPECHART["LINE"] = 2] = "LINE";
34224
34319
  TYPECHART[TYPECHART["BOTH"] = 3] = "BOTH";
34320
+ TYPECHART[TYPECHART["DONUT"] = 4] = "DONUT";
34225
34321
  })(TYPECHART$2 || (TYPECHART$2 = {}));
34226
34322
 
34227
- var topMostSurveyNameUsed = "top_5_most_survey_used";
34228
-
34229
34323
  var TotalCard$1 = function TotalCard(_ref) {
34230
34324
  var icon = _ref.icon,
34231
34325
  title = _ref.title,
@@ -34256,103 +34350,6 @@ var gradeOptions$1 = function gradeOptions(grades, studentUserId) {
34256
34350
  };
34257
34351
  });
34258
34352
  };
34259
- var topMostSurveyChartOptions = function topMostSurveyChartOptions(labelNames, percentSurvey, isDonutChart) {
34260
- return {
34261
- legend: {
34262
- show: false,
34263
- fontFamily: 'Poppins-Regular !important'
34264
- },
34265
- chart: {
34266
- type: "bar",
34267
- toolbar: {
34268
- show: false
34269
- }
34270
- },
34271
- noData: {
34272
- text: "No data",
34273
- align: 'center',
34274
- verticalAlign: 'middle'
34275
- },
34276
- grid: {
34277
- strokeDashArray: 5,
34278
- borderColor: "#D3D3D3"
34279
- },
34280
- plotOptions: {
34281
- bar: {
34282
- horizontal: true,
34283
- distributed: true,
34284
- borderRadius: 5
34285
- }
34286
- },
34287
- stroke: {
34288
- show: false,
34289
- width: 1,
34290
- colors: ["#fff"]
34291
- },
34292
- colors: ["#316CD9", "#5a89e1", "#83a7e8", "#adc4f0", "#eaf0fb"],
34293
- xaxis: {
34294
- categories: labelNames,
34295
- labels: {
34296
- show: true,
34297
- style: {
34298
- colors: ["#808080"],
34299
- fontSize: "14px",
34300
- fontFamily: 'Poppins-Regular !important',
34301
- fontWeight: 400,
34302
- cssClass: "apexcharts-yaxis-label"
34303
- }
34304
- }
34305
- },
34306
- labels: labelNames,
34307
- tooltip: {
34308
- x: {
34309
- formatter: function formatter(value) {
34310
- return value.toString();
34311
- }
34312
- },
34313
- y: {
34314
- formatter: function formatter(value) {
34315
- return value.toFixed(2).toString();
34316
- }
34317
- }
34318
- },
34319
- yaxis: {
34320
- min: 0,
34321
- max: 100,
34322
- labels: {
34323
- show: true,
34324
- align: "left",
34325
- minWidth: 0,
34326
- style: {
34327
- fontSize: "14px",
34328
- fontFamily: 'Poppins-Regular !important',
34329
- fontWeight: 400,
34330
- cssClass: "apexcharts-yaxis-label"
34331
- },
34332
- offsetX: 0,
34333
- offsetY: 0,
34334
- rotate: 0
34335
- }
34336
- },
34337
- dataLabels: {
34338
- enabled: true,
34339
- formatter: function formatter(val, opts) {
34340
- if (!val) {
34341
- return "";
34342
- }
34343
-
34344
- if (!isDonutChart) {
34345
- return typeof val === "number" ? val.toFixed(2) + "%" : "" + val;
34346
- } else {
34347
- return percentSurvey[opts.seriesIndex];
34348
- }
34349
- },
34350
- style: {
34351
- colors: ["#FFFFFF", "#FFFFFF", "#FFFFFF", "#FFFFFF", "#242424"]
34352
- }
34353
- }
34354
- };
34355
- };
34356
34353
  var getLastQuarterRange$1 = function getLastQuarterRange() {
34357
34354
  var lastQuarter = moment().utc().quarter() - 1;
34358
34355
  var start = lastQuarter ? moment().utc().quarter(lastQuarter).startOf("quarter").valueOf() : moment().add(-1, "years").utc().quarter(4).startOf("quarter").valueOf();
@@ -34389,14 +34386,6 @@ var filterYearData$1 = [{
34389
34386
  endDate: moment().utc().add(-1, "days").endOf("day").valueOf()
34390
34387
  }];
34391
34388
 
34392
- var handleViewSeriesActive = function handleViewSeriesActive(active) {
34393
- var _active$filter;
34394
-
34395
- var item = ((_active$filter = active.filter(function (r) {
34396
- return r == true;
34397
- })) === null || _active$filter === void 0 ? void 0 : _active$filter.length) || 0;
34398
- return Array.from(Array(item).keys());
34399
- };
34400
34389
  var convertDataToDataChart$1 = function convertDataToDataChart(data) {
34401
34390
  if (data.length > 0) {
34402
34391
  return data.reduce(function (acc, cur) {
@@ -34410,32 +34399,19 @@ var convertDataToDataChart$1 = function convertDataToDataChart(data) {
34410
34399
 
34411
34400
  return [];
34412
34401
  };
34413
- var convertToSeriesTemplate = function convertToSeriesTemplate(data) {
34402
+ var convertToSeriesTemplate = function convertToSeriesTemplate(data, exact) {
34414
34403
  return convertDataToDataChart$1(data).map(function (dataName) {
34415
34404
  return {
34416
34405
  name: dataName,
34417
34406
  data: data.map(function (i) {
34418
34407
  var questionItem = i.surveyTemplate.find(function (question) {
34419
- return question.templateName.includes(dataName);
34408
+ return exact ? question.templateName == dataName : question.templateName.includes(dataName);
34420
34409
  });
34421
34410
  return !!questionItem ? questionItem.avgTemplateSurvey : 0;
34422
34411
  })
34423
34412
  };
34424
34413
  });
34425
34414
  };
34426
- var mergeBarChartAndArea = function mergeBarChartAndArea(series) {
34427
- var barChartSeries = series.map(function (i) {
34428
- return _extends({}, i, {
34429
- type: "bar"
34430
- });
34431
- });
34432
- var areaChartSeries = series.map(function (i) {
34433
- return _extends({}, i, {
34434
- type: "area"
34435
- });
34436
- });
34437
- return [].concat(barChartSeries, areaChartSeries);
34438
- };
34439
34415
  var convertToAvg = function convertToAvg(dataCharts, data, months) {
34440
34416
  var result = dataCharts.map(function (dataName) {
34441
34417
  return Number(data.map(function (i) {
@@ -34456,7 +34432,7 @@ var useDashboard$1 = function useDashboard() {
34456
34432
  var dispatch = reactRedux.useDispatch();
34457
34433
 
34458
34434
  var _useState = React.useState({
34459
- calendar: "",
34435
+ showBy: "",
34460
34436
  studentIds: [],
34461
34437
  studentId: undefined,
34462
34438
  teacherId: undefined,
@@ -34474,53 +34450,65 @@ var useDashboard$1 = function useDashboard() {
34474
34450
  listSurveyTotal = _useState2[0],
34475
34451
  setListSurveyTotal = _useState2[1];
34476
34452
 
34477
- var _useState3 = React.useState([INIT_TOP_MOST_SURVEY_USED]),
34478
- topMostSurveyUsed = _useState3[0],
34479
- setTopMostSurveyUsed = _useState3[1];
34453
+ var _useState3 = React.useState([true]),
34454
+ activeColumnResult = _useState3[0],
34455
+ setActiveColumnResult = _useState3[1];
34480
34456
 
34481
34457
  var _useState4 = React.useState([]),
34482
- templateSurveyDashboard = _useState4[0],
34483
- setTemplateSurveyDashboard = _useState4[1];
34458
+ avgResult = _useState4[0],
34459
+ setAvgResult = _useState4[1];
34484
34460
 
34485
- var _useState5 = React.useState([true]),
34486
- activeColumnResult = _useState5[0],
34487
- setActiveColumnResult = _useState5[1];
34461
+ var _useState5 = React.useState([]),
34462
+ avgTotal = _useState5[0],
34463
+ setAvgTotal = _useState5[1];
34488
34464
 
34489
34465
  var _useState6 = React.useState([]),
34490
- avgResult = _useState6[0],
34491
- setAvgResult = _useState6[1];
34466
+ seriesResult = _useState6[0],
34467
+ setSeriesResult = _useState6[1];
34492
34468
 
34493
34469
  var _useState7 = React.useState([]),
34494
- seriseResult = _useState7[0],
34495
- setSeriesResult = _useState7[1];
34470
+ monthsSeriesResult = _useState7[0],
34471
+ setMonthsSeriesResult = _useState7[1];
34496
34472
 
34497
- var _useState8 = React.useState([TYPECHART$2.BAR]),
34498
- typeChartList = _useState8[0],
34499
- setTypeChartList = _useState8[1];
34473
+ var _useState8 = React.useState([]),
34474
+ seriesTotal = _useState8[0],
34475
+ setSeriesTotal = _useState8[1];
34500
34476
 
34501
- var _useState9 = React.useState(),
34502
- surveyFlagData = _useState9[0],
34503
- setSurveyFlagData = _useState9[1];
34477
+ var _useState9 = React.useState([]),
34478
+ monthsSeriesTotal = _useState9[0],
34479
+ setMonthsSeriesTotal = _useState9[1];
34504
34480
 
34505
34481
  var _useState10 = React.useState([]),
34506
- studentByGrade = _useState10[0],
34507
- setStudentByGrade = _useState10[1];
34482
+ surveyFlagData = _useState10[0],
34483
+ setSurveyFlagData = _useState10[1];
34484
+
34485
+ var _useState11 = React.useState([]),
34486
+ studentByGrade = _useState11[0],
34487
+ setStudentByGrade = _useState11[1];
34508
34488
 
34509
34489
  var user = reactRedux.useSelector(function (state) {
34510
34490
  return state.common.user;
34511
34491
  });
34512
34492
 
34513
- var _useState11 = React.useState(undefined),
34514
- studentDefault = _useState11[0],
34515
- setStudentDefault = _useState11[1];
34493
+ var _useState12 = React.useState(undefined),
34494
+ studentDefault = _useState12[0],
34495
+ setStudentDefault = _useState12[1];
34496
+
34497
+ var _useState13 = React.useState(""),
34498
+ genderOfStudent = _useState13[0],
34499
+ setGenderOfStudent = _useState13[1];
34500
+
34501
+ var _useState14 = React.useState(false),
34502
+ isShowFilterMobile = _useState14[0],
34503
+ setIsShowFilterMobile = _useState14[1];
34516
34504
 
34517
- var _useState12 = React.useState(""),
34518
- genderOfStudent = _useState12[0],
34519
- setGenderOfStudent = _useState12[1];
34505
+ var _useState15 = React.useState([]),
34506
+ dayOfWeekTotal = _useState15[0],
34507
+ setDayOfWeekTotal = _useState15[1];
34520
34508
 
34521
- var _useState13 = React.useState(false),
34522
- isShowFilterMobile = _useState13[0],
34523
- setIsShowFilterMobile = _useState13[1];
34509
+ var _useState16 = React.useState([]),
34510
+ dayOfWeekResult = _useState16[0],
34511
+ setDayOfWeekResult = _useState16[1];
34524
34512
 
34525
34513
  var handleChangeFilters = function handleChangeFilters(event) {
34526
34514
  var _extends2;
@@ -34629,7 +34617,7 @@ var useDashboard$1 = function useDashboard() {
34629
34617
  try {
34630
34618
  document.title = TITLE$B;
34631
34619
  dispatch(marioCore.setLoading(true));
34632
- return Promise.resolve(Promise.any([callApi(getAllTotalSurvey, setListSurveyTotal, []), callApi(getStudentByGrade, setStudentByGrade, []), callApi(getTopMostSurveyUsed, setTopMostSurveyUsed, []), callApi(getDashboardFlagSurvey, setSurveyFlagData, [])])).then(function () {
34620
+ return Promise.resolve(Promise.any([callApi(getAllTotalSurvey, setListSurveyTotal, []), callApi(getStudentByGrade, setStudentByGrade, [])])).then(function () {
34633
34621
  dispatch(marioCore.setLoading(false));
34634
34622
  });
34635
34623
  } catch (e) {
@@ -34638,8 +34626,6 @@ var useDashboard$1 = function useDashboard() {
34638
34626
  }, [filter]);
34639
34627
 
34640
34628
  var handleActiveColumnOneToOne = function handleActiveColumnOneToOne(index) {
34641
- var _convertToSeriesTempl;
34642
-
34643
34629
  var newActiveColumn = [].concat(activeColumnResult);
34644
34630
 
34645
34631
  if (newActiveColumn.filter(function (r) {
@@ -34654,25 +34640,8 @@ var useDashboard$1 = function useDashboard() {
34654
34640
 
34655
34641
  newActiveColumn[index] = !newActiveColumn[index];
34656
34642
  setActiveColumnResult(newActiveColumn);
34657
- setSeriesResult((_convertToSeriesTempl = convertToSeriesTemplate(templateSurveyDashboard)) === null || _convertToSeriesTempl === void 0 ? void 0 : _convertToSeriesTempl.filter(function (_, idx) {
34658
- return newActiveColumn[idx];
34659
- }));
34660
34643
  };
34661
34644
 
34662
- var onChangeChart = React.useCallback(function (type) {
34663
- var indexType = typeChartList.findIndex(function (r) {
34664
- return r === type;
34665
- });
34666
- var newListTypeChart = typeChartList || [];
34667
-
34668
- if (indexType >= 0) {
34669
- newListTypeChart.length > 1 && newListTypeChart.splice(indexType, 1);
34670
- } else {
34671
- newListTypeChart.push(type);
34672
- }
34673
-
34674
- setTypeChartList([].concat(newListTypeChart));
34675
- }, [typeChartList]);
34676
34645
  var getDashBoardTemplate = React.useCallback(function () {
34677
34646
  try {
34678
34647
  var _temp9 = function _temp9() {
@@ -34686,22 +34655,14 @@ var useDashboard$1 = function useDashboard() {
34686
34655
  if (!!res) {
34687
34656
  var dataConvert = convertToSeriesTemplate(res.data);
34688
34657
  var dataChart = convertDataToDataChart$1(res.data);
34689
- var avg = convertToAvg(dataChart, res.data, res.data.map(function (r) {
34658
+ var months = res.data.map(function (r) {
34690
34659
  return r.month || "";
34691
- }));
34660
+ });
34661
+ var avg = convertToAvg(dataChart, res.data, months);
34662
+ setDayOfWeekResult(months);
34692
34663
  setAvgResult(avg);
34693
- setTemplateSurveyDashboard(res.data);
34694
- setSeriesResult(dataConvert.filter(function (_, idx) {
34695
- return activeColumnResult[idx];
34696
- }));
34697
-
34698
- if (activeColumnResult.filter(function (r) {
34699
- return r == true;
34700
- }).length == 0 || activeColumnResult.length != activeColumnResult.length) {
34701
- setActiveColumnResult([true].concat(dataConvert.map(function (_i) {
34702
- return false;
34703
- }).splice(0, dataConvert.length - 1)));
34704
- }
34664
+ setSeriesResult(dataConvert);
34665
+ setMonthsSeriesResult(months);
34705
34666
  }
34706
34667
  });
34707
34668
  }, function (err) {
@@ -34718,10 +34679,88 @@ var useDashboard$1 = function useDashboard() {
34718
34679
  return Promise.reject(e);
34719
34680
  }
34720
34681
  }, [filter, activeColumnResult]);
34682
+ var getDashboardTotal = React.useCallback(function () {
34683
+ try {
34684
+ var _temp13 = function _temp13() {
34685
+ dispatch(marioCore.setLoading(false));
34686
+ };
34687
+
34688
+ dispatch(marioCore.setLoading(true));
34689
+
34690
+ var _temp14 = _catch(function () {
34691
+ return Promise.resolve(getDashboardTotalSurvey(filter)).then(function (res) {
34692
+ if (!!res) {
34693
+ var dataConvert = convertToSeriesTemplate(res.data, true);
34694
+ var dataChart = convertDataToDataChart$1(res.data);
34695
+ var months = res.data.map(function (r) {
34696
+ return r.month || "";
34697
+ });
34698
+ var avg = convertToAvg(dataChart, res.data, months);
34699
+ setDayOfWeekTotal(months);
34700
+ setAvgTotal(avg);
34701
+ setSeriesTotal(dataConvert);
34702
+ setMonthsSeriesTotal(months);
34703
+ }
34704
+ });
34705
+ }, function (err) {
34706
+ var _err$response4, _err$response4$data;
34707
+
34708
+ dispatch(marioCore.setAlert({
34709
+ type: "danger",
34710
+ message: ((_err$response4 = err.response) === null || _err$response4 === void 0 ? void 0 : (_err$response4$data = _err$response4.data) === null || _err$response4$data === void 0 ? void 0 : _err$response4$data.title) || err.message
34711
+ }));
34712
+ });
34713
+
34714
+ return Promise.resolve(_temp14 && _temp14.then ? _temp14.then(_temp13) : _temp13(_temp14));
34715
+ } catch (e) {
34716
+ return Promise.reject(e);
34717
+ }
34718
+ }, [JSON.stringify(filter)]);
34719
+ var getDashboardFlags = React.useCallback(function () {
34720
+ try {
34721
+ var _temp17 = function _temp17() {
34722
+ dispatch(marioCore.setLoading(false));
34723
+ };
34724
+
34725
+ dispatch(marioCore.setLoading(true));
34726
+
34727
+ var _temp18 = _catch(function () {
34728
+ return Promise.resolve(getDashboardFlagSurvey(filter)).then(function (res) {
34729
+ var data = res.data;
34730
+
34731
+ if (!!data) {
34732
+ setSurveyFlagData([{
34733
+ name: "Red",
34734
+ data: [data.numberSurveyRed || 0]
34735
+ }, {
34736
+ name: "Yellow",
34737
+ data: [data.numberSurveyYellow || 0]
34738
+ }, {
34739
+ name: "Green",
34740
+ data: [data.numberSurveyBlue || 0]
34741
+ }]);
34742
+ }
34743
+ });
34744
+ }, function (err) {
34745
+ var _err$response5, _err$response5$data;
34746
+
34747
+ dispatch(marioCore.setAlert({
34748
+ type: "danger",
34749
+ message: ((_err$response5 = err.response) === null || _err$response5 === void 0 ? void 0 : (_err$response5$data = _err$response5.data) === null || _err$response5$data === void 0 ? void 0 : _err$response5$data.title) || err.message
34750
+ }));
34751
+ });
34752
+
34753
+ return Promise.resolve(_temp18 && _temp18.then ? _temp18.then(_temp17) : _temp17(_temp18));
34754
+ } catch (e) {
34755
+ return Promise.reject(e);
34756
+ }
34757
+ }, [JSON.stringify(filter)]);
34721
34758
  React.useEffect(function () {
34722
34759
  getData();
34723
34760
  getDashBoardTemplate();
34724
- }, [filter]);
34761
+ getDashboardTotal();
34762
+ getDashboardFlags();
34763
+ }, [JSON.stringify(filter)]);
34725
34764
  React.useEffect(function () {
34726
34765
  !!filter.studentUserId && callApiByStudentUserId(getGrades, handleSaveGradeFilter, filter.studentUserId, []);
34727
34766
  }, [filter.studentUserId]);
@@ -34739,23 +34778,24 @@ var useDashboard$1 = function useDashboard() {
34739
34778
  handleFilterStudent: handleFilterStudent,
34740
34779
  handleFilterTeacher: handleFilterTeacher,
34741
34780
  onChangeFilters: onChangeFilters,
34742
- topMostSurveyUsed: topMostSurveyUsed,
34743
34781
  surveyFlagData: surveyFlagData,
34744
- templateSurveyDashboard: templateSurveyDashboard,
34745
34782
  avgResult: avgResult,
34746
- seriseResult: seriseResult,
34783
+ seriesResult: seriesResult,
34747
34784
  activeColumnResult: activeColumnResult,
34785
+ avgTotal: avgTotal,
34786
+ seriesTotal: seriesTotal,
34748
34787
  handleActiveColumnOneToOne: handleActiveColumnOneToOne,
34749
- typeChartList: typeChartList,
34750
- onChangeChart: onChangeChart,
34751
34788
  isShowFilterMobile: isShowFilterMobile,
34752
- setIsShowFilterMobile: setIsShowFilterMobile
34789
+ setIsShowFilterMobile: setIsShowFilterMobile,
34790
+ dayOfWeekTotal: dayOfWeekTotal,
34791
+ dayOfWeekResult: dayOfWeekResult,
34792
+ monthsSeriesResult: monthsSeriesResult,
34793
+ monthsSeriesTotal: monthsSeriesTotal
34753
34794
  };
34754
34795
  };
34755
34796
 
34756
34797
  var useChartDatas$1 = function useChartDatas() {
34757
34798
  var _useDashboard = useDashboard$1(),
34758
- topMostSurveyUsed = _useDashboard.topMostSurveyUsed,
34759
34799
  handleChangeFilters = _useDashboard.handleChangeFilters,
34760
34800
  user = _useDashboard.user,
34761
34801
  studentDefault = _useDashboard.studentDefault,
@@ -34764,15 +34804,19 @@ var useChartDatas$1 = function useChartDatas() {
34764
34804
  listSurveyTotal = _useDashboard.listSurveyTotal,
34765
34805
  onChangeFilters = _useDashboard.onChangeFilters,
34766
34806
  surveyFlagData = _useDashboard.surveyFlagData,
34767
- templateSurveyDashboard = _useDashboard.templateSurveyDashboard,
34768
34807
  avgResult = _useDashboard.avgResult,
34769
- seriseResult = _useDashboard.seriseResult,
34770
34808
  activeColumnResult = _useDashboard.activeColumnResult,
34771
34809
  handleActiveColumnOneToOne = _useDashboard.handleActiveColumnOneToOne,
34772
- typeChartList = _useDashboard.typeChartList,
34773
- onChangeChart = _useDashboard.onChangeChart,
34774
34810
  isShowFilterMobile = _useDashboard.isShowFilterMobile,
34775
- setIsShowFilterMobile = _useDashboard.setIsShowFilterMobile;
34811
+ setIsShowFilterMobile = _useDashboard.setIsShowFilterMobile,
34812
+ dayOfWeekTotal = _useDashboard.dayOfWeekTotal,
34813
+ avgTotal = _useDashboard.avgTotal,
34814
+ dayOfWeekResult = _useDashboard.dayOfWeekResult,
34815
+ genderOfStudent = _useDashboard.genderOfStudent,
34816
+ seriesTotal = _useDashboard.seriesTotal,
34817
+ seriesResult = _useDashboard.seriesResult,
34818
+ monthsSeriesResult = _useDashboard.monthsSeriesResult,
34819
+ monthsSeriesTotal = _useDashboard.monthsSeriesTotal;
34776
34820
 
34777
34821
  var _useState = React.useState([]),
34778
34822
  selectedToPrint = _useState[0],
@@ -34790,7 +34834,11 @@ var useChartDatas$1 = function useChartDatas() {
34790
34834
  grade: -1,
34791
34835
  bandScore: -1,
34792
34836
  favoriteSurvey: -1,
34793
- academicYearId: -1
34837
+ academicYearId: -1,
34838
+ showBy: {
34839
+ value: FILTER_SHOW_BY.WEEK,
34840
+ label: "Weeks"
34841
+ }
34794
34842
  }),
34795
34843
  labelBox = _useState2[0],
34796
34844
  setLabelBox = _useState2[1];
@@ -34838,10 +34886,10 @@ var useChartDatas$1 = function useChartDatas() {
34838
34886
  };
34839
34887
 
34840
34888
  var LIST_FILTERS_LEFT = [{
34841
- name: FILTER_NAME.Calendar,
34889
+ name: FILTER_NAME.ShowBy,
34842
34890
  icon: "/images/calendar.svg",
34843
34891
  handleChangeFilters: handleChangeFilters,
34844
- option: CALENDAR_OPTIONS$1,
34892
+ option: SHOW_BY_OPTIONS,
34845
34893
  labelBox: labelBox,
34846
34894
  setLabelBox: setLabelBox
34847
34895
  }, {
@@ -34915,678 +34963,22 @@ var useChartDatas$1 = function useChartDatas() {
34915
34963
  checkSelectedItem: checkSelectedItem,
34916
34964
  selectedToPrint: selectedToPrint,
34917
34965
  setSelectedToPrint: setSelectedToPrint,
34918
- topMostSurveyUsed: topMostSurveyUsed,
34919
34966
  surveyFlagData: surveyFlagData,
34920
- templateSurveyDashboard: templateSurveyDashboard,
34921
34967
  avgResult: avgResult,
34922
- seriseResult: seriseResult,
34923
34968
  activeColumnResult: activeColumnResult,
34924
34969
  handleActiveColumnOneToOne: handleActiveColumnOneToOne,
34925
- typeChartList: typeChartList,
34926
- onChangeChart: onChangeChart,
34927
34970
  isShowFilterMobile: isShowFilterMobile,
34928
- setIsShowFilterMobile: setIsShowFilterMobile
34929
- };
34930
- };
34931
-
34932
- var Loading$1 = function Loading() {
34933
- return React__default.createElement("div", {
34934
- className: "d-flex align-items-center justify-content-center"
34935
- }, React__default.createElement("div", {
34936
- className: "spinner-grow",
34937
- role: "status"
34938
- }, React__default.createElement("span", {
34939
- className: "sr-only"
34940
- }, "Loading...")), React__default.createElement("div", {
34941
- className: "spinner-grow mx-2",
34942
- role: "status"
34943
- }, React__default.createElement("span", {
34944
- className: "sr-only"
34945
- }, "Loading...")), React__default.createElement("div", {
34946
- className: "spinner-grow",
34947
- role: "status"
34948
- }, React__default.createElement("span", {
34949
- className: "sr-only"
34950
- }, "Loading...")));
34951
- };
34952
-
34953
- var TopMostSurveyUsed = function TopMostSurveyUsed(_ref) {
34954
- var data = _ref.data;
34955
- if (!data) return React__default.createElement(Loading$1, null);
34956
-
34957
- var _useTranslation = marioCore.useTranslation(),
34958
- t = _useTranslation.t;
34959
-
34960
- var labelNames = data === null || data === void 0 ? void 0 : data.map(function (i) {
34961
- return i.nameSurvey;
34962
- });
34963
- var labelTimes = data === null || data === void 0 ? void 0 : data.map(function (i) {
34964
- return marioCore.utcToLocalTime(i.sendDateSurvey.toString(), "Do MMMM yyyy - hh:mm A");
34965
- });
34966
- console.log({
34967
- labelTimes: labelTimes
34968
- });
34969
- var percentSurvey = data === null || data === void 0 ? void 0 : data.map(function (i) {
34970
- return i.percentSurvey;
34971
- });
34972
- var seriesLearningStrategy = [{
34973
- name: "Perceived Usefulness",
34974
- data: percentSurvey
34975
- }];
34976
- return React__default.createElement("div", {
34977
- className: "h-100 w-100 " + styles$2["chart-background"] + " pl-4"
34978
- }, React__default.createElement("div", {
34979
- className: "" + styles$2["block-header-chart"]
34980
- }, React__default.createElement("div", {
34981
- className: "" + styles$2["block-header-name"]
34982
- }, React__default.createElement("p", {
34983
- className: "" + styles$2["title-chart"]
34984
- }, t(topMostSurveyNameUsed)))), seriesLearningStrategy.some(function (i) {
34985
- return i.data;
34986
- }) ? React__default.createElement("div", null, React__default.createElement(Chart, {
34987
- options: topMostSurveyChartOptions(labelNames, percentSurvey),
34988
- series: seriesLearningStrategy,
34989
- type: "bar",
34990
- width: "100%",
34991
- height: 450
34992
- })) : React__default.createElement("img", {
34993
- className: styles$2["image-no-data"] + " " + styles$2["image-custom"],
34994
- src: "images/chart-top-learning.png"
34995
- }));
34996
- };
34997
-
34998
- var propsAreEqual$2 = function propsAreEqual(preProps, nextProps) {
34999
- return JSON.stringify(preProps) === JSON.stringify(nextProps);
35000
- };
35001
-
35002
- var TopMostSurveyUsed$1 = React__default.memo(TopMostSurveyUsed, propsAreEqual$2);
35003
-
35004
- var maxSeries = function maxSeries(series) {
35005
- var max = 0;
35006
-
35007
- for (var i = 0; i < series.length; i++) {
35008
- max = Math.max.apply(Math, series[i].data.concat([max]));
35009
- }
35010
-
35011
- return max;
35012
- };
35013
- var optionColumnChartAndPercents$1 = function optionColumnChartAndPercents(months, activeData, isRidgeCharts, isShowChartLabel, percentData, series) {
35014
- return {
35015
- chart: {
35016
- height: 350,
35017
- stacked: false,
35018
- toolbar: {
35019
- show: false,
35020
- "export": {
35021
- png: {
35022
- filename: "test"
35023
- }
35024
- }
35025
- }
35026
- },
35027
- plotOptions: {
35028
- bar: {
35029
- borderRadius: 5
35030
- }
35031
- },
35032
- dataLabels: {
35033
- enabled: false
35034
- },
35035
- fill: {
35036
- opacity: isRidgeCharts ? 0.2 : 1
35037
- },
35038
- colors: COLOR_CHART_AND_PERCENTS$1.filter(function (_, index) {
35039
- return activeData[index];
35040
- }),
35041
- stroke: {
35042
- curve: "smooth",
35043
- show: true,
35044
- colors: isRidgeCharts ? COLOR_CHART_AND_PERCENTS$1.filter(function (_, index) {
35045
- return activeData[index];
35046
- }) : ["#fff"],
35047
- width: 3,
35048
- dashArray: 0
35049
- },
35050
- xaxis: {
35051
- categories: months,
35052
- labels: {
35053
- show: months.length > 0 ? true : false,
35054
- style: {
35055
- colors: ["#808080"],
35056
- fontSize: "16px",
35057
- fontFamily: "Roboto",
35058
- fontWeight: 400,
35059
- cssClass: "apexcharts-yaxis-label"
35060
- }
35061
- },
35062
- axisTicks: {
35063
- show: months.length > 0 ? true : false
35064
- }
35065
- },
35066
- yaxis: {
35067
- tickAmount: 2,
35068
- min: 0,
35069
- max: percentData ? 100 : maxSeries(series || []),
35070
- labels: {
35071
- show: true,
35072
- align: "right",
35073
- minWidth: 0,
35074
- maxWidth: 160,
35075
- style: {
35076
- colors: ["#808080"],
35077
- fontSize: "16px",
35078
- fontFamily: "Roboto",
35079
- fontWeight: 400,
35080
- cssClass: "apexcharts-yaxis-label"
35081
- },
35082
- formatter: function formatter(value) {
35083
- return "" + (!percentData ? value : value + "%");
35084
- },
35085
- offsetX: 0,
35086
- offsetY: 0,
35087
- rotate: 0
35088
- },
35089
- decimalsInFloat: 0
35090
- },
35091
- tooltip: {
35092
- shared: false,
35093
- y: {
35094
- formatter: function formatter(value) {
35095
- return "" + (!percentData ? value : value.toFixed(2) + "%");
35096
- }
35097
- },
35098
- onDatasetHover: {
35099
- highlightDataSeries: true
35100
- }
35101
- },
35102
- legend: {
35103
- show: isShowChartLabel
35104
- }
35105
- };
35106
- };
35107
- var optionBarChartAndArea = function optionBarChartAndArea(months, activeData, newseries) {
35108
- return {
35109
- chart: {
35110
- height: 350,
35111
- stacked: false,
35112
- toolbar: {
35113
- show: false
35114
- }
35115
- },
35116
- plotOptions: {
35117
- bar: {
35118
- columnWidth: "50%",
35119
- borderRadius: 5
35120
- }
35121
- },
35122
- dataLabels: {
35123
- enabled: false
35124
- },
35125
- fill: {
35126
- opacity: newseries === null || newseries === void 0 ? void 0 : newseries.map(function (item) {
35127
- if ((item === null || item === void 0 ? void 0 : item.type) == "area") {
35128
- return 0.2;
35129
- }
35130
-
35131
- return 0.6;
35132
- })
35133
- },
35134
- colors: COLOR_CHART_AND_PERCENTS$1.filter(function (_, index) {
35135
- return activeData[index];
35136
- }),
35137
- stroke: {
35138
- curve: "smooth",
35139
- show: true,
35140
- colors: COLOR_CHART_AND_PERCENTS$1.filter(function (_, index) {
35141
- return activeData[index];
35142
- }),
35143
- width: newseries === null || newseries === void 0 ? void 0 : newseries.map(function (item) {
35144
- if ((item === null || item === void 0 ? void 0 : item.type) == "area") {
35145
- return 2;
35146
- }
35147
-
35148
- return 0;
35149
- }),
35150
- dashArray: 0
35151
- },
35152
- xaxis: {
35153
- categories: months,
35154
- labels: {
35155
- show: true,
35156
- style: {
35157
- colors: ["#808080"],
35158
- fontSize: "16px",
35159
- fontFamily: "Roboto",
35160
- fontWeight: 400,
35161
- cssClass: "apexcharts-yaxis-label"
35162
- }
35163
- }
35164
- },
35165
- yaxis: {
35166
- tickAmount: 2,
35167
- min: 0,
35168
- max: 100,
35169
- labels: {
35170
- show: true,
35171
- align: "right",
35172
- minWidth: 0,
35173
- maxWidth: 160,
35174
- style: {
35175
- colors: ["#808080"],
35176
- fontSize: "16px",
35177
- fontFamily: "Roboto",
35178
- fontWeight: 400,
35179
- cssClass: "apexcharts-yaxis-label"
35180
- },
35181
- formatter: function formatter(value) {
35182
- return value + "%";
35183
- },
35184
- offsetX: 0,
35185
- offsetY: 0,
35186
- rotate: 0
35187
- },
35188
- decimalsInFloat: 0
35189
- },
35190
- tooltip: {
35191
- shared: false,
35192
- enabledOnSeries: handleViewSeriesActive(activeData),
35193
- y: {
35194
- formatter: function formatter(value) {
35195
- return value.toFixed(2) + "%";
35196
- }
35197
- },
35198
- onDatasetHover: {
35199
- highlightDataSeries: true
35200
- }
35201
- },
35202
- legend: {
35203
- show: false
35204
- }
34971
+ setIsShowFilterMobile: setIsShowFilterMobile,
34972
+ dayOfWeekTotal: dayOfWeekTotal,
34973
+ avgTotal: avgTotal,
34974
+ dayOfWeekResult: dayOfWeekResult,
34975
+ genderOfStudent: genderOfStudent,
34976
+ seriesTotal: seriesTotal,
34977
+ seriesResult: seriesResult,
34978
+ monthsSeriesResult: monthsSeriesResult,
34979
+ monthsSeriesTotal: monthsSeriesTotal
35205
34980
  };
35206
34981
  };
35207
- var pieChartOptions = {
35208
- labels: LABEL_NAME_PIE_CHART,
35209
- colors: COLOR_LABEL_PIE,
35210
- legend: {
35211
- show: false
35212
- },
35213
- chart: {
35214
- height: "100%"
35215
- },
35216
- plotOptions: {
35217
- pie: {
35218
- donut: {
35219
- size: "15%"
35220
- }
35221
- }
35222
- },
35223
- dataLabels: {
35224
- enabled: false
35225
- },
35226
- fill: {
35227
- colors: COLOR_CHART_AND_PIE
35228
- },
35229
- stroke: {
35230
- colors: COLOR_CHART_AND_PIE,
35231
- width: 1
35232
- },
35233
- states: {
35234
- normal: {
35235
- filter: {
35236
- type: "none",
35237
- value: 0
35238
- }
35239
- },
35240
- hover: {
35241
- filter: {
35242
- type: "none",
35243
- value: 0
35244
- }
35245
- },
35246
- active: {
35247
- filter: {
35248
- type: "none",
35249
- value: 0
35250
- }
35251
- }
35252
- }
35253
- };
35254
-
35255
- var useContainerDimensions = function useContainerDimensions(myRef) {
35256
- var _myRef$current;
35257
-
35258
- var _useState = React.useState({
35259
- width: 0,
35260
- height: 0
35261
- }),
35262
- dimensions = _useState[0],
35263
- setDimensions = _useState[1];
35264
-
35265
- React.useEffect(function () {
35266
- var getDimensions = function getDimensions() {
35267
- return {
35268
- width: myRef.current.offsetWidth,
35269
- height: myRef.current.offsetHeight
35270
- };
35271
- };
35272
-
35273
- var handleResize = function handleResize() {
35274
- setDimensions(getDimensions());
35275
- };
35276
-
35277
- if (myRef.current) {
35278
- setDimensions(getDimensions());
35279
- }
35280
-
35281
- window.addEventListener("resize", handleResize);
35282
- return function () {
35283
- window.removeEventListener("resize", handleResize);
35284
- };
35285
- }, [myRef === null || myRef === void 0 ? void 0 : (_myRef$current = myRef.current) === null || _myRef$current === void 0 ? void 0 : _myRef$current.offsetWidth]);
35286
- return dimensions;
35287
- };
35288
-
35289
- var PieChart = function PieChart(_ref) {
35290
- var data = _ref.data,
35291
- name = _ref.name;
35292
- var ref = React.useRef(null);
35293
-
35294
- var _useContainerDimensio = useContainerDimensions(ref),
35295
- width = _useContainerDimensio.width;
35296
-
35297
- var screenWidth = window.innerWidth;
35298
- if (!data) return React__default.createElement("div", {
35299
- className: "flex justify-content-center align-items-center",
35300
- style: {
35301
- height: 450
35302
- }
35303
- }, React__default.createElement("div", null, "No Data"));
35304
- var series = [data.numberSurveyBlue, data.numberSurveyRed, data.numberSurveyYellow];
35305
- return React__default.createElement("div", {
35306
- className: styles$2["pie-chart"],
35307
- ref: ref
35308
- }, React__default.createElement("div", {
35309
- className: styles$2["box-chart-title"]
35310
- }, React__default.createElement("p", {
35311
- className: styles$2["title-chart"] + " pl-4 pl-md-0"
35312
- }, name)), React__default.createElement("div", {
35313
- className: styles$2["box-chart"] + " " + (width == 0 && styles$2["h-75"])
35314
- }, React__default.createElement(Chart, {
35315
- options: pieChartOptions,
35316
- series: series,
35317
- type: "donut",
35318
- width: (screenWidth < 768 ? width * 0.7 : screenWidth > 2100 ? "370px" : width) || "100%",
35319
- height: (screenWidth < 768 ? width * 0.7 : screenWidth > 2100 ? "370px" : width) || "100%"
35320
- }), React__default.createElement("div", {
35321
- className: "" + styles$2["legend-pie-custom"]
35322
- }, COLOR_NAME.map(function (color, index) {
35323
- return React__default.createElement("div", {
35324
- className: "" + styles$2["legend-item"]
35325
- }, React__default.createElement("div", {
35326
- className: "" + styles$2["color-box"],
35327
- style: {
35328
- backgroundColor: COLOR_CHART_AND_PIE[index]
35329
- }
35330
- }), React__default.createElement("div", {
35331
- className: "" + styles$2["text"]
35332
- }, color));
35333
- }))));
35334
- };
35335
-
35336
- var BarChart$1 = function BarChart(_ref) {
35337
- var series = _ref.series,
35338
- months = _ref.months,
35339
- activeColumn = _ref.activeColumn,
35340
- isShowChartLabel = _ref.isShowChartLabel,
35341
- percentData = _ref.percentData;
35342
- return React__default.createElement(Chart, {
35343
- options: optionColumnChartAndPercents$1(months, activeColumn, false, isShowChartLabel, percentData, series),
35344
- type: "bar",
35345
- series: series,
35346
- width: "100%",
35347
- height: 450
35348
- });
35349
- };
35350
-
35351
- var CheckboxCustom$1 = function CheckboxCustom(_ref) {
35352
- var _ref$background = _ref.background,
35353
- background = _ref$background === void 0 ? "#2B4DC0" : _ref$background,
35354
- _ref$width = _ref.width,
35355
- width = _ref$width === void 0 ? 16 : _ref$width,
35356
- _ref$height = _ref.height,
35357
- height = _ref$height === void 0 ? 16 : _ref$height,
35358
- _ref$isActive = _ref.isActive,
35359
- isActive = _ref$isActive === void 0 ? false : _ref$isActive,
35360
- _ref$className = _ref.className,
35361
- className = _ref$className === void 0 ? "" : _ref$className,
35362
- onClick = _ref.onClick;
35363
- return React__default.createElement("div", {
35364
- className: className,
35365
- onClick: onClick,
35366
- style: {
35367
- cursor: "pointer"
35368
- }
35369
- }, isActive ? React__default.createElement("svg", {
35370
- xmlns: "http://www.w3.org/2000/svg",
35371
- width: width,
35372
- height: height,
35373
- viewBox: "0 0 24 24",
35374
- fill: "none"
35375
- }, React__default.createElement("rect", {
35376
- x: "2.5",
35377
- y: "2.5",
35378
- width: "19",
35379
- height: "19",
35380
- rx: "1.5",
35381
- fill: background,
35382
- stroke: background
35383
- }), React__default.createElement("path", {
35384
- d: "M7.3335 12.6667L10.0002 15.3334L16.6668 8.66669",
35385
- stroke: "white",
35386
- "stroke-width": "2",
35387
- "stroke-linecap": "round",
35388
- "stroke-linejoin": "round"
35389
- })) : React__default.createElement("div", {
35390
- style: {
35391
- width: width,
35392
- height: height,
35393
- background: "#FCFCFC",
35394
- border: "1px solid #CCCCCC",
35395
- borderRadius: 2,
35396
- cursor: "pointer",
35397
- marginTop: 3
35398
- }
35399
- }));
35400
- };
35401
-
35402
- var ChoiceChartType = function ChoiceChartType(_ref) {
35403
- var onChangeChart = _ref.onChangeChart,
35404
- _ref$typeChart = _ref.typeChart,
35405
- typeChart = _ref$typeChart === void 0 ? [TYPECHART$2.BAR] : _ref$typeChart,
35406
- options = _ref.options;
35407
- return React__default.createElement("div", {
35408
- className: "d-flex align-items-center d-inline-block"
35409
- }, React__default.createElement("div", {
35410
- className: "d-flex align-items-center px-2 " + styles$2["checkbox-chart"]
35411
- }, React__default.createElement("div", {
35412
- className: "pr-4 d-flex align-items-center",
35413
- onClick: function onClick() {
35414
- return onChangeChart === null || onChangeChart === void 0 ? void 0 : onChangeChart(options[0].value);
35415
- },
35416
- style: {
35417
- cursor: "pointer"
35418
- }
35419
- }, React__default.createElement(CheckboxCustom$1, {
35420
- width: 16,
35421
- height: 16,
35422
- isActive: typeChart.includes(TYPECHART$2.BOTH),
35423
- className: "pr-2 d-flex align-items-center"
35424
- }), React__default.createElement("label", {
35425
- className: "" + styles$2["label-chart"],
35426
- style: {
35427
- color: "#252733",
35428
- marginBottom: 0,
35429
- cursor: "pointer"
35430
- }
35431
- }, "Ridge charts"))), React__default.createElement("div", {
35432
- className: "d-inline-block " + styles$2["checkbox-chart"]
35433
- }, React__default.createElement("div", {
35434
- className: "pr-4 d-flex align-items-center",
35435
- onClick: function onClick() {
35436
- return onChangeChart === null || onChangeChart === void 0 ? void 0 : onChangeChart(options[1].value);
35437
- },
35438
- style: {
35439
- cursor: "pointer"
35440
- }
35441
- }, React__default.createElement(CheckboxCustom$1, {
35442
- width: 16,
35443
- height: 16,
35444
- isActive: typeChart.includes(TYPECHART$2.LINE) || typeChart.includes(TYPECHART$2.BAR),
35445
- className: "pr-2 d-flex align-items-center"
35446
- }), React__default.createElement("label", {
35447
- className: "" + styles$2["label-chart"],
35448
- style: {
35449
- color: "#252733",
35450
- marginBottom: 0,
35451
- cursor: "pointer"
35452
- }
35453
- }, options[1].value === TYPECHART$2.BAR ? "Bar charts" : "Line charts"))));
35454
- };
35455
-
35456
- var AreaChart$1 = function AreaChart(_ref) {
35457
- var series = _ref.series,
35458
- months = _ref.months,
35459
- activeColumn = _ref.activeColumn,
35460
- percentData = _ref.percentData;
35461
- return React__default.createElement(Chart, {
35462
- options: optionColumnChartAndPercents$1(months, activeColumn, true, false, percentData),
35463
- type: "area",
35464
- series: series,
35465
- width: "100%",
35466
- height: 450
35467
- });
35468
- };
35469
-
35470
- var BarAndAreaChart = function BarAndAreaChart(_ref) {
35471
- var series = _ref.series,
35472
- months = _ref.months,
35473
- activeColumn = _ref.activeColumn;
35474
- var newseries = mergeBarChartAndArea(series);
35475
- return React__default.createElement(Chart, {
35476
- options: optionBarChartAndArea(months, activeColumn, newseries),
35477
- series: newseries,
35478
- width: "100%",
35479
- height: 450
35480
- });
35481
- };
35482
-
35483
- var ChartViewDashboard = function ChartViewDashboard(_ref) {
35484
- var data = _ref.data,
35485
- typeChart = _ref.typeChart,
35486
- onActiveColumn = _ref.onActiveColumn,
35487
- activeColumn = _ref.activeColumn,
35488
- series = _ref.series,
35489
- avg = _ref.avg,
35490
- months = _ref.months,
35491
- onChangeChart = _ref.onChangeChart,
35492
- optionType = _ref.optionType,
35493
- name = _ref.name,
35494
- _ref$isShowChartLabel = _ref.isShowChartLabel,
35495
- isShowChartLabel = _ref$isShowChartLabel === void 0 ? false : _ref$isShowChartLabel,
35496
- _ref$percentData = _ref.percentData,
35497
- percentData = _ref$percentData === void 0 ? true : _ref$percentData,
35498
- classFontSize = _ref.classFontSize;
35499
-
35500
- var _useTranslation = marioCore.useTranslation(),
35501
- t = _useTranslation.t;
35502
-
35503
- if (!data) return React__default.createElement("div", {
35504
- className: "flex justify-content-center align-items-center",
35505
- style: {
35506
- height: 450
35507
- }
35508
- }, React__default.createElement("p", null, t("no_data")));
35509
- return React__default.createElement("div", {
35510
- key: name,
35511
- className: " " + styles$2["size-100"] + " " + styles$2[classFontSize != null ? classFontSize : '']
35512
- }, React__default.createElement("div", {
35513
- className: "" + styles$2["block-header-chart"]
35514
- }, React__default.createElement("p", {
35515
- className: "" + styles$2["title-chart"]
35516
- }, t(name)), !!onChangeChart && !!optionType && React__default.createElement(ChoiceChartType, {
35517
- onChangeChart: onChangeChart,
35518
- options: optionType,
35519
- typeChart: typeChart
35520
- })), React__default.createElement("div", {
35521
- className: "" + styles$2["column-chart-percent"]
35522
- }, !!onActiveColumn && React__default.createElement("div", {
35523
- className: "" + styles$2["listItem"]
35524
- }, data.map(function (month, index) {
35525
- return React__default.createElement("div", {
35526
- className: "" + styles$2["item-checkbox"],
35527
- key: index
35528
- }, React__default.createElement(CheckboxCustom$1, {
35529
- background: COLOR_CHART_AND_PERCENTS[index],
35530
- width: 16,
35531
- height: 16,
35532
- isActive: activeColumn[index],
35533
- className: "" + styles$2["check-box"],
35534
- onClick: function onClick() {
35535
- return onActiveColumn === null || onActiveColumn === void 0 ? void 0 : onActiveColumn(index);
35536
- }
35537
- }), React__default.createElement("label", {
35538
- className: "" + styles$2["label-chart"],
35539
- style: {
35540
- color: !activeColumn[index] ? "#CCCCCC" : "#4D4D4D",
35541
- marginBottom: 0,
35542
- cursor: "pointer"
35543
- },
35544
- onClick: function onClick() {
35545
- return onActiveColumn === null || onActiveColumn === void 0 ? void 0 : onActiveColumn(index);
35546
- }
35547
- }, month));
35548
- })), React__default.createElement("div", {
35549
- className: "w-100",
35550
- style: {
35551
- height: 450
35552
- }
35553
- }, typeChart.includes(TYPECHART$1.BOTH) && typeChart.length == 1 && React__default.createElement(AreaChart$1, {
35554
- months: months,
35555
- activeColumn: activeColumn,
35556
- series: series,
35557
- percentData: percentData
35558
- }), typeChart.includes(TYPECHART$1.BAR) && typeChart.length == 1 && React__default.createElement(BarChart$1, {
35559
- months: months,
35560
- activeColumn: activeColumn,
35561
- series: series,
35562
- isShowChartLabel: isShowChartLabel,
35563
- percentData: percentData
35564
- }), typeChart.includes(TYPECHART$1.BOTH) && typeChart.includes(TYPECHART$1.BAR) && React__default.createElement(BarAndAreaChart, {
35565
- months: months,
35566
- activeColumn: activeColumn,
35567
- series: series
35568
- })), !!avg && React__default.createElement("div", {
35569
- className: "" + styles$2["listItem"]
35570
- }, data.map(function (month, index) {
35571
- return avg[index] > 0 && React__default.createElement("div", {
35572
- className: "" + styles$2["item-legend"],
35573
- key: index
35574
- }, React__default.createElement("div", {
35575
- className: "" + styles$2["item"]
35576
- }, React__default.createElement("div", {
35577
- className: "" + styles$2["mark-custom"],
35578
- style: {
35579
- backgroundColor: COLOR_CHART_AND_PERCENTS[index]
35580
- }
35581
- }), React__default.createElement("label", {
35582
- className: "" + styles$2["label-legend-custom"]
35583
- }, month)), React__default.createElement("div", {
35584
- className: "" + styles$2["percent"]
35585
- }, React__default.createElement("label", {
35586
- className: "" + styles$2["m-0"]
35587
- }, avg[index].toFixed(2))));
35588
- }))));
35589
- };
35590
34982
 
35591
34983
  var SurveyDashboard = function SurveyDashboard() {
35592
34984
  var _useTranslation = marioCore.useTranslation(),
@@ -35598,24 +34990,25 @@ var SurveyDashboard = function SurveyDashboard() {
35598
34990
  LIST_FILTERS_RIGHT = _useChartDatas.LIST_FILTERS_RIGHT,
35599
34991
  totalCardData = _useChartDatas.totalCardData,
35600
34992
  onChangeFilters = _useChartDatas.onChangeFilters,
35601
- topMostSurveyUsed = _useChartDatas.topMostSurveyUsed,
35602
34993
  surveyFlagData = _useChartDatas.surveyFlagData,
35603
- templateSurveyDashboard = _useChartDatas.templateSurveyDashboard,
35604
- avgResult = _useChartDatas.avgResult,
35605
- seriseResult = _useChartDatas.seriseResult,
35606
34994
  activeColumnResult = _useChartDatas.activeColumnResult,
35607
34995
  handleActiveColumnOneToOne = _useChartDatas.handleActiveColumnOneToOne,
35608
- typeChartList = _useChartDatas.typeChartList,
35609
- onChangeChart = _useChartDatas.onChangeChart,
35610
34996
  isShowFilterMobile = _useChartDatas.isShowFilterMobile,
35611
- setIsShowFilterMobile = _useChartDatas.setIsShowFilterMobile;
34997
+ setIsShowFilterMobile = _useChartDatas.setIsShowFilterMobile,
34998
+ dayOfWeekTotal = _useChartDatas.dayOfWeekTotal,
34999
+ dayOfWeekResult = _useChartDatas.dayOfWeekResult,
35000
+ seriesTotal = _useChartDatas.seriesTotal,
35001
+ seriesResult = _useChartDatas.seriesResult,
35002
+ monthsSeriesResult = _useChartDatas.monthsSeriesResult,
35003
+ monthsSeriesTotal = _useChartDatas.monthsSeriesTotal;
35612
35004
 
35613
- console.log({
35614
- LIST_FILTERS_RIGHT: LIST_FILTERS_RIGHT
35615
- });
35616
35005
  return React__default.createElement("div", {
35617
35006
  className: styles$2["block-dashboard"] + " mb-5"
35618
- }, React__default.createElement("div", {
35007
+ }, React__default.createElement("style", {
35008
+ dangerouslySetInnerHTML: {
35009
+ __html: [".survey-donut-chart .apexcharts-tooltip{", "color: #FFFFFF!important;", "}"].join('')
35010
+ }
35011
+ }), React__default.createElement("div", {
35619
35012
  className: "d-flex align-items-center justify-content-between"
35620
35013
  }, React__default.createElement("div", {
35621
35014
  className: "d-flex align-items-center mx-3"
@@ -35714,46 +35107,52 @@ var SurveyDashboard = function SurveyDashboard() {
35714
35107
  filter: item.filter
35715
35108
  });
35716
35109
  })), React__default.createElement("div", {
35717
- className: "shadow-lg mb-3 " + styles$2["chart-header-wrapper"]
35110
+ className: "shadow-lg mb-3 py-3 " + styles$2["chart-header-wrapper"] + " " + styles$2["survey-dashboard-chart"] + " survey-dashboard-chart"
35718
35111
  }, React__default.createElement(reactstrap.Row, null, React__default.createElement(reactstrap.Col, {
35112
+ xs: 12,
35113
+ sm: 12,
35719
35114
  md: 7
35720
- }, React__default.createElement(TopMostSurveyUsed$1, {
35721
- data: topMostSurveyUsed
35115
+ }, React__default.createElement(GenerateChartData, {
35116
+ avgContent: "SURVEYS",
35117
+ colors: ["#C44140", "#0F9655"],
35118
+ name: "Total Survey",
35119
+ typeChart: TYPECHART$2.AREA,
35120
+ activeColumn: [true, true],
35121
+ series: seriesTotal,
35122
+ months: monthsSeriesTotal,
35123
+ dayOfWeek: dayOfWeekTotal,
35124
+ avgQuestionLastMonth: []
35125
+ })), React__default.createElement(reactstrap.Col, {
35126
+ xs: 12,
35127
+ sm: 12,
35128
+ md: 5,
35129
+ className: "survey-donut-chart " + styles$2["survey-donut-chart"]
35130
+ }, React__default.createElement(GenerateChartData, {
35131
+ avgContent: "FLAGS",
35132
+ colors: ["#C44140", "#FFB04F", "#0F9655"],
35133
+ textColors: ["#FFFFFF", "#FFFFFF", "#FFFFFF"],
35134
+ name: "Flags",
35135
+ typeChart: TYPECHART$2.DONUT,
35136
+ months: [],
35137
+ activeColumn: [true, true, true],
35138
+ avgQuestionLastMonth: [],
35139
+ series: surveyFlagData,
35140
+ width: 250,
35141
+ height: 250,
35142
+ dayOfWeek: []
35722
35143
  })), React__default.createElement(reactstrap.Col, {
35723
- md: 5
35724
- }, React__default.createElement(reactstrap.Row, null, React__default.createElement(reactstrap.Col, {
35725
- md: 9,
35726
- lg: 7,
35727
- style: {
35728
- margin: "0 auto"
35729
- }
35730
- }, React__default.createElement(PieChart, {
35731
- data: surveyFlagData,
35732
- name: "Flag"
35733
- })))))), React__default.createElement(reactstrap.Row, {
35734
- className: styles$2["chart-view-dashboard"] + " mt-4"
35735
- }, React__default.createElement(reactstrap.Col, {
35736
35144
  md: 12
35737
- }, React__default.createElement(ChartViewDashboard, {
35738
- name: "survey_result",
35739
- data: convertDataToDataChart$1(templateSurveyDashboard),
35740
- months: templateSurveyDashboard.map(function (r) {
35741
- return r.month || "";
35742
- }),
35743
- series: seriseResult,
35145
+ }, React__default.createElement(GenerateChartData, {
35146
+ colors: ["#73C8E5", "#F9F871", "#D7B0DE", "#E56362", "#169490", "#D3D3D3", "#316CD9"],
35147
+ name: "Survey Results",
35148
+ typeChart: TYPECHART$2.AREA,
35744
35149
  activeColumn: activeColumnResult,
35150
+ series: seriesResult,
35151
+ months: monthsSeriesResult,
35152
+ dayOfWeek: dayOfWeekResult,
35745
35153
  onActiveColumn: handleActiveColumnOneToOne,
35746
- typeChart: typeChartList,
35747
- onChangeChart: onChangeChart,
35748
- avg: avgResult,
35749
- optionType: [{
35750
- label: "Ridge charts",
35751
- value: TYPECHART$2.BOTH
35752
- }, {
35753
- label: "Bar charts",
35754
- value: TYPECHART$2.BAR
35755
- }]
35756
- }))));
35154
+ avgQuestionLastMonth: []
35155
+ })))));
35757
35156
  };
35758
35157
 
35759
35158
  var USER_URL$4 = marioCore.BASE_URL + "/api/User";