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