mario-education 2.2.5 → 2.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { api, BASE_URL, setAlert, CustomSelector, LinkEditButton, DeleteButtonIcon, EmptyDataAlert, CommonModal, RequiredLabel, ErrorHandler, useFilters, setLoading, setClassList, setModal, QuitPrompt, AddButton, CustomPagination, setConferenceRubricList, SearchBoxContainer, getTextFromHTML, generateRandomString, QuestionCategorySelector, DetailActionButtons, SuggestionCategorySelector, CreatableSelector, setSuggestionList, setStrategyList, UploadFileButton, systemStudentBadge, setBadgeList, getFileUrl, setGoalExampleList, setSubjectList, setLearningSupportCategoryList, apiUpload, utcToLocalTime, DATE_FORMAT, setSemesterList, setBandScoreList, EditButtonIcon, setSchoolBlankDayList, SearchBox, CustomTab, SkillList, QUESTION_TYPES, EMOTIONS, QUESTION_TYPES_OPTIONS, setQuestionList, setQuestionByCategory, setSelectQuestion, setResetQuestionList, setMoveItemQuestion, setEditItemQuesion, DEFAULT_FILTER, setReflectionList, setReflectionResultList, DATE_RESULT, StarRatingSelector, editorConfig, TINY_MCE_API_KEY, QuestionTypeSelector, setAssessmentList, FULL_DATE_RESULT, setFeedbackList, setTutorialScreenList, setQuestionCateList, setAssignmentList, setSessionTemplateList, setSessionTemplateGeneralClassList, setCustomAlertList, systemCertificateUpload, setCertificateList, Loading as Loading$1, LICENSE_AGGRID } from 'mario-core';
1
+ import { api, BASE_URL, setAlert, CustomSelector, LinkEditButton, DeleteButtonIcon, EmptyDataAlert, CommonModal, RequiredLabel, ErrorHandler, useFilters, setLoading, setClassList, setModal, QuitPrompt, AddButton, CustomPagination, setConferenceRubricList, SearchBoxContainer, getTextFromHTML, generateRandomString, QuestionCategorySelector, DetailActionButtons, SuggestionCategorySelector, CreatableSelector, setSuggestionList, setStrategyList, UploadFileButton, systemStudentBadge, setBadgeList, getFileUrl, setGoalExampleList, setSubjectList, setLearningSupportCategoryList, apiUpload, utcToLocalTime, DATE_FORMAT, setSemesterList, setBandScoreList, EditButtonIcon, setSchoolBlankDayList, SearchBox, CustomTab, SkillList, QUESTION_TYPES, EMOTIONS, QUESTION_TYPES_OPTIONS, setQuestionList, setQuestionByCategory, setSelectQuestion, setResetQuestionList, setMoveItemQuestion, setEditItemQuesion, DEFAULT_FILTER, setReflectionList, setReflectionResultList, DATE_RESULT, StarRatingSelector, editorConfig, TINY_MCE_API_KEY, QuestionTypeSelector, setAssessmentList, FULL_DATE_RESULT, setFeedbackList, setTutorialScreenList, setQuestionCateList, setAssignmentList, setSessionTemplateList, setSessionTemplateGeneralClassList, setCustomAlertList, systemCertificateUpload, setCertificateList, LICENSE_AGGRID } from 'mario-core';
2
2
  import { LicenseManager } from '@ag-grid-enterprise/core';
3
3
  import React, { useState, useRef, useCallback, useEffect, forwardRef, useMemo, Fragment, memo } from 'react';
4
4
  import { useDispatch, useSelector } from 'react-redux';
@@ -5410,7 +5410,7 @@ var SemesterDetailModal = function SemesterDetailModal(props, ref) {
5410
5410
  })), React.createElement(Col, {
5411
5411
  md: 6
5412
5412
  }, React.createElement(DatePicker, {
5413
- value: utcToLocalTime(values.startTime, "MMM dd, yyyy"),
5413
+ value: utcToLocalTime(values.startTime, "Do MMMM YYYY"),
5414
5414
  todayButton: "Today",
5415
5415
  peekNextMonth: true,
5416
5416
  showMonthDropdown: true,
@@ -5441,7 +5441,7 @@ var SemesterDetailModal = function SemesterDetailModal(props, ref) {
5441
5441
  })), React.createElement(Col, {
5442
5442
  md: 6
5443
5443
  }, React.createElement(DatePicker, {
5444
- value: utcToLocalTime(values.endTime, "MMM dd, yyyy"),
5444
+ value: utcToLocalTime(values.endTime, "Do MMMM YYYY"),
5445
5445
  todayButton: "Today",
5446
5446
  peekNextMonth: true,
5447
5447
  showMonthDropdown: true,
@@ -6057,9 +6057,9 @@ var SemesterList = function SemesterList() {
6057
6057
  }
6058
6058
  })), React.createElement("td", {
6059
6059
  className: "align-middle"
6060
- }, utcToLocalTime(record.startTime, "MMM dd, yyyy")), React.createElement("td", {
6060
+ }, utcToLocalTime(record.startTime, "Do MMMM YYYY")), React.createElement("td", {
6061
6061
  className: "align-middle"
6062
- }, utcToLocalTime(record.endTime, "MMM dd, yyyy")), React.createElement("td", {
6062
+ }, utcToLocalTime(record.endTime, "Do MMMM YYYY")), React.createElement("td", {
6063
6063
  className: "text-center align-middle"
6064
6064
  }, React.createElement(DeleteButtonIcon, {
6065
6065
  onClick: function onClick() {
@@ -7241,9 +7241,9 @@ var SchoolBlankDayList = function SchoolBlankDayList() {
7241
7241
  }
7242
7242
  })), React.createElement("td", {
7243
7243
  className: "align-middle"
7244
- }, utcToLocalTime(record.startTime, DATE_FORMAT)), React.createElement("td", {
7244
+ }, utcToLocalTime(record.startTime, "Do MMMM YYYY")), React.createElement("td", {
7245
7245
  className: "align-middle"
7246
- }, utcToLocalTime(record.endTime, DATE_FORMAT)), React.createElement("td", {
7246
+ }, utcToLocalTime(record.endTime, "Do MMMM YYYY")), React.createElement("td", {
7247
7247
  className: "text-center align-middle"
7248
7248
  }, React.createElement(DeleteButtonIcon, {
7249
7249
  onClick: function onClick() {
@@ -17265,107 +17265,6 @@ var DashboardCard = function DashboardCard(_ref) {
17265
17265
  }, children));
17266
17266
  };
17267
17267
 
17268
- var colors = ["#1C77AC", "#00979B", "#8B0000", "#87E0E0", "#2EB82E"];
17269
- var levels = [{
17270
- name: "No progress",
17271
- field: "noProgress"
17272
- }, {
17273
- name: "Slight",
17274
- field: "slight"
17275
- }, {
17276
- name: "Moderate",
17277
- field: "moderate"
17278
- }, {
17279
- name: "Significant",
17280
- field: "significant"
17281
- }, {
17282
- name: "Achieved",
17283
- field: "achieved"
17284
- }];
17285
-
17286
- var GoalProgressReport = function GoalProgressReport(_ref) {
17287
- var data = _ref.data;
17288
- var series = useMemo(function () {
17289
- if (!data) return [];
17290
-
17291
- try {
17292
- return levels.map(function (level) {
17293
- return {
17294
- name: level.name,
17295
- data: data.map(function (item) {
17296
- return item[level.field];
17297
- })
17298
- };
17299
- });
17300
- } catch (_unused) {
17301
- return [];
17302
- }
17303
- }, [data]);
17304
- var categories = useMemo(function () {
17305
- if (!data) return [];
17306
-
17307
- try {
17308
- return data.map(function (item) {
17309
- return item.createdAt;
17310
- });
17311
- } catch (_unused2) {
17312
- return [];
17313
- }
17314
- }, [data]);
17315
- if (!data) return React.createElement(Loading$1, null);
17316
- var options = {
17317
- chart: {
17318
- type: "bar",
17319
- height: 350,
17320
- stacked: true,
17321
- stackType: "100%",
17322
- toolbar: {
17323
- show: false
17324
- }
17325
- },
17326
- plotOptions: {
17327
- bar: {
17328
- horizontal: false,
17329
- columnWidth: "80%"
17330
- }
17331
- },
17332
- colors: colors,
17333
- responsive: [{
17334
- breakpoint: 480,
17335
- options: {
17336
- legend: {
17337
- position: "bottom",
17338
- offsetX: -10,
17339
- offsetY: 0
17340
- }
17341
- }
17342
- }],
17343
- xaxis: {
17344
- categories: categories
17345
- },
17346
- fill: {
17347
- opacity: 1
17348
- },
17349
- legend: {
17350
- position: "right",
17351
- offsetX: 0,
17352
- offsetY: 50,
17353
- onItemClick: {
17354
- toggleDataSeries: false
17355
- },
17356
- onItemHover: {
17357
- highlightDataSeries: false
17358
- }
17359
- }
17360
- };
17361
- return React.createElement("div", null, React.createElement(ReactApexChart, {
17362
- options: options,
17363
- series: series,
17364
- type: "bar",
17365
- height: 350
17366
- }));
17367
- };
17368
-
17369
17268
  var Loading = function Loading() {
17370
17269
  return React.createElement("div", {
17371
17270
  className: "d-flex align-items-center justify-content-center"
@@ -17387,14 +17286,14 @@ var Loading = function Loading() {
17387
17286
  }, "Loading...")));
17388
17287
  };
17389
17288
 
17390
- var colors$1 = ["rgba(129, 236, 236, 0.8)", "rgba(116, 185, 255, 0.8)", "rgba(250, 177, 160, 0.8)", "rgba(255, 234, 167, 0.8)", "rgba(178, 190, 195, 0.8)", "rgba(85, 239, 196, 0.8)", "rgba(120, 111, 166, 0.8)", "rgba(243, 166, 131, 0.8)"];
17289
+ var colors = ["rgba(129, 236, 236, 0.8)", "rgba(116, 185, 255, 0.8)", "rgba(250, 177, 160, 0.8)", "rgba(255, 234, 167, 0.8)", "rgba(178, 190, 195, 0.8)", "rgba(85, 239, 196, 0.8)", "rgba(120, 111, 166, 0.8)", "rgba(243, 166, 131, 0.8)"];
17391
17290
 
17392
17291
  var getColors = function getColors(length) {
17393
- if (colors$1.length >= length) return colors$1;
17394
- var newColors = [].concat(colors$1);
17292
+ if (colors.length >= length) return colors;
17293
+ var newColors = [].concat(colors);
17395
17294
 
17396
17295
  while (newColors.length < length) {
17397
- newColors = [].concat(newColors, colors$1);
17296
+ newColors = [].concat(newColors, colors);
17398
17297
  }
17399
17298
 
17400
17299
  return newColors;
@@ -17485,7 +17384,7 @@ var HighImpact = function HighImpact(_ref) {
17485
17384
  })));
17486
17385
  };
17487
17386
 
17488
- var colors$2 = ["#1abc9c", "#c0392b"];
17387
+ var colors$1 = ["#1abc9c", "#c0392b"];
17489
17388
 
17490
17389
  var LoginCouting = function LoginCouting(_ref) {
17491
17390
  var data = _ref.data;
@@ -17502,11 +17401,11 @@ var LoginCouting = function LoginCouting(_ref) {
17502
17401
  var series = [{
17503
17402
  name: "Teacher",
17504
17403
  data: teacherCount,
17505
- color: colors$2[0]
17404
+ color: colors$1[0]
17506
17405
  }, {
17507
17406
  name: "Student",
17508
17407
  data: studentCount,
17509
- color: colors$2[1]
17408
+ color: colors$1[1]
17510
17409
  }];
17511
17410
  var options = {
17512
17411
  chart: {
@@ -17523,7 +17422,7 @@ var LoginCouting = function LoginCouting(_ref) {
17523
17422
  markers: {
17524
17423
  size: 4,
17525
17424
  colors: ["#fff"],
17526
- strokeColors: colors$2,
17425
+ strokeColors: colors$1,
17527
17426
  strokeWidth: 2,
17528
17427
  strokeOpacity: 0.9,
17529
17428
  strokeDashArray: 0,
@@ -17555,17 +17454,12 @@ var LoginCouting = function LoginCouting(_ref) {
17555
17454
  }));
17556
17455
  };
17557
17456
 
17558
- var colors$3 = ["#00cec9", "#00b894"];
17457
+ var colors$2 = ["#00cec9", "#00b894"];
17559
17458
 
17560
17459
  var PerceivedImpact = function PerceivedImpact(_ref) {
17561
17460
  var data = _ref.data;
17562
17461
  if (!data) return React.createElement(Loading, null);
17563
17462
  var series = [{
17564
- name: "Teacher",
17565
- data: data.map(function (item) {
17566
- return item.teacherRating;
17567
- })
17568
- }, {
17569
17463
  name: "Student",
17570
17464
  data: data.map(function (item) {
17571
17465
  return item.studentRating;
@@ -17582,7 +17476,7 @@ var PerceivedImpact = function PerceivedImpact(_ref) {
17582
17476
  show: false
17583
17477
  }
17584
17478
  },
17585
- colors: colors$3,
17479
+ colors: colors$2,
17586
17480
  plotOptions: {
17587
17481
  bar: {
17588
17482
  horizontal: false,
@@ -17620,7 +17514,7 @@ var PerceivedImpact = function PerceivedImpact(_ref) {
17620
17514
  }));
17621
17515
  };
17622
17516
 
17623
- var colors$4 = ["#00b894", "#00cec9", "#0984e3"];
17517
+ var colors$3 = ["#00b894", "#00cec9", "#0984e3"];
17624
17518
 
17625
17519
  var Quantity = function Quantity(_ref) {
17626
17520
  var data = _ref.data;
@@ -17637,7 +17531,7 @@ var Quantity = function Quantity(_ref) {
17637
17531
  type: "pie"
17638
17532
  },
17639
17533
  labels: ["Teachers", "Students", "Assistants"],
17640
- colors: colors$4,
17534
+ colors: colors$3,
17641
17535
  legend: {
17642
17536
  show: false
17643
17537
  },
@@ -17652,15 +17546,15 @@ var Quantity = function Quantity(_ref) {
17652
17546
  };
17653
17547
  var details = [{
17654
17548
  label: "Teachers",
17655
- color: colors$4[0],
17549
+ color: colors$3[0],
17656
17550
  value: teacherPercentage
17657
17551
  }, {
17658
17552
  label: "Students",
17659
- color: colors$4[1],
17553
+ color: colors$3[1],
17660
17554
  value: studentPercentage
17661
17555
  }, {
17662
17556
  label: "Assistants",
17663
- color: colors$4[2],
17557
+ color: colors$3[2],
17664
17558
  value: assistantPercentage
17665
17559
  }];
17666
17560
  return React.createElement("div", {
@@ -17697,117 +17591,14 @@ var Quantity = function Quantity(_ref) {
17697
17591
  })));
17698
17592
  };
17699
17593
 
17700
- var colors$5 = ["#f0932b", "#22a6b3", "#6ab04c"];
17701
- var categories = ["Before intervention", "During intervention", "After intervention"];
17702
-
17703
- var findGradeLabel = function findGradeLabel(value, bandScores) {
17704
- var sortedBandScores = bandScores === null || bandScores === void 0 ? void 0 : bandScores.sort(function (item1, item2) {
17705
- return item1.value - item2.value;
17706
- });
17707
-
17708
- if ((sortedBandScores === null || sortedBandScores === void 0 ? void 0 : sortedBandScores.length) > 0) {
17709
- for (var i = 0; i < sortedBandScores.length; i++) {
17710
- var _sortedBandScores$i, _sortedBandScores;
17711
-
17712
- if (((_sortedBandScores$i = sortedBandScores[i]) === null || _sortedBandScores$i === void 0 ? void 0 : _sortedBandScores$i.value) <= value && value <= ((_sortedBandScores = sortedBandScores[i + 1]) === null || _sortedBandScores === void 0 ? void 0 : _sortedBandScores.value)) {
17713
- var _sortedBandScores$i2, _sortedBandScores2, _sortedBandScores3;
17714
-
17715
- if (value - ((_sortedBandScores$i2 = sortedBandScores[i]) === null || _sortedBandScores$i2 === void 0 ? void 0 : _sortedBandScores$i2.value) <= ((_sortedBandScores2 = sortedBandScores[i + 1]) === null || _sortedBandScores2 === void 0 ? void 0 : _sortedBandScores2.value) - value) {
17716
- var _sortedBandScores$i3;
17717
-
17718
- return (_sortedBandScores$i3 = sortedBandScores[i]) === null || _sortedBandScores$i3 === void 0 ? void 0 : _sortedBandScores$i3.label;
17719
- }
17720
-
17721
- return (_sortedBandScores3 = sortedBandScores[i + 1]) === null || _sortedBandScores3 === void 0 ? void 0 : _sortedBandScores3.label;
17722
- }
17723
- }
17724
- }
17725
-
17726
- return "";
17727
- };
17728
-
17729
- var Grade = function Grade(_ref) {
17730
- var data = _ref.data;
17731
- if (!data) return React.createElement(Loading, null);
17732
- var series = [{
17733
- data: [data.beforeIntervention, data.duringIntervention, data.afterIntervention]
17734
- }];
17735
- var options = {
17736
- chart: {
17737
- height: 350,
17738
- type: "bar",
17739
- toolbar: {
17740
- show: false
17741
- }
17742
- },
17743
- colors: colors$5,
17744
- plotOptions: {
17745
- bar: {
17746
- columnWidth: "45%",
17747
- distributed: true
17748
- }
17749
- },
17750
- dataLabels: {
17751
- enabled: false
17752
- },
17753
- legend: {
17754
- show: false
17755
- },
17756
- xaxis: {
17757
- categories: categories
17758
- },
17759
- yaxis: {
17760
- max: Math.max.apply(Math, data.bandScores.map(function (item) {
17761
- return item.value;
17762
- })),
17763
- min: Math.min.apply(Math, data.bandScores.map(function (item) {
17764
- return item.value;
17765
- })),
17766
- labels: {
17767
- formatter: function formatter(val) {
17768
- return findGradeLabel(val, data.bandScores);
17769
- }
17770
- }
17771
- }
17772
- };
17773
- return React.createElement("div", null, React.createElement(ReactApexChart, {
17774
- options: options,
17775
- series: series,
17776
- type: "bar",
17777
- height: 350
17778
- }));
17779
- };
17780
-
17781
17594
  var Dashboard = function Dashboard() {
17782
17595
  var _useDashboard = useDashboard(),
17783
17596
  loginCounting = _useDashboard.loginCounting,
17784
17597
  quantity = _useDashboard.quantity,
17785
- goalProgress = _useDashboard.goalProgress,
17786
17598
  highImpact = _useDashboard.highImpact,
17787
- perceivedImpact = _useDashboard.perceivedImpact,
17788
- grade = _useDashboard.grade;
17599
+ perceivedImpact = _useDashboard.perceivedImpact;
17789
17600
 
17790
17601
  var cards = [{
17791
- label: "Students & teachers login per day",
17792
- children: React.createElement(LoginCouting, {
17793
- data: loginCounting
17794
- })
17795
- }, {
17796
- label: "Number of students, teachers, assistants",
17797
- children: React.createElement(Quantity, {
17798
- data: quantity
17799
- })
17800
- }, {
17801
- label: "Goal progress",
17802
- children: React.createElement(GoalProgressReport, {
17803
- data: goalProgress
17804
- })
17805
- }, {
17806
- label: "Grades",
17807
- children: React.createElement(Grade, {
17808
- data: grade
17809
- })
17810
- }, {
17811
17602
  label: "High-impact learning strategies of current school year",
17812
17603
  children: React.createElement(HighImpact, {
17813
17604
  data: highImpact
@@ -17817,6 +17608,16 @@ var Dashboard = function Dashboard() {
17817
17608
  children: React.createElement(PerceivedImpact, {
17818
17609
  data: perceivedImpact
17819
17610
  })
17611
+ }, {
17612
+ label: "Students & teachers logins per day",
17613
+ children: React.createElement(LoginCouting, {
17614
+ data: loginCounting
17615
+ })
17616
+ }, {
17617
+ label: "Number of students, teachers, assistants",
17618
+ children: React.createElement(Quantity, {
17619
+ data: quantity
17620
+ })
17820
17621
  }];
17821
17622
  return React.createElement("div", null, React.createElement("h4", {
17822
17623
  className: "mb-5"