@argusoft/medplat-app-shell 1.0.6 → 1.0.7
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.
- package/package.json +139 -141
- package/src/GlobalErrorBoundary.jsx +31 -0
- package/src/SilentErrorFallback.jsx +68 -0
- package/src/TrackingProviderWrapper.jsx +40 -0
- package/src/_tests_/__mocks__/MockTranslationProvider.jsx +21 -0
- package/src/_tests_/__mocks__/ckeditor.js +45 -0
- package/src/_tests_/__mocks__/fileMock.js +1 -0
- package/src/_tests_/__mocks__/useranalytics.js +5 -0
- package/src/_tests_/views/components/Dashboard/DashboardUI.test.jsx +137 -0
- package/src/_tests_/views/components/Dashboard/DashboardUIMock.js +877 -0
- package/src/_tests_/views/components/ForgotPassword/ForgotPassword.test.jsx +314 -0
- package/src/_tests_/views/components/LocationDirective/LocationDirective.test.jsx.disable +229 -0
- package/src/_tests_/views/components/LocationDirective/mockLocationDirective.js +810 -0
- package/src/_tests_/views/components/LocationType/MockLocationType.js +42259 -0
- package/src/_tests_/views/components/LocationType/addlocationtype.test.jsx.disable +276 -0
- package/src/_tests_/views/components/LocationType/editlocationtype.test.jsx.disable +262 -0
- package/src/_tests_/views/components/LocationType/locationtype.test.jsx.disable +148 -0
- package/src/_tests_/views/components/Profile/UpdateProfileModalData.js +4396 -0
- package/src/_tests_/views/components/Profile/updateprofilemodal.test.jsx +282 -0
- package/src/_tests_/views/components/SideBar/MockSideBar.js +1379 -0
- package/src/_tests_/views/components/SideBar/SideBar.test.jsx +98 -0
- package/src/_tests_/views/components/SystemConfig/ManageSystemConfig/AddManageSystemConfig.test.jsx.disable +164 -0
- package/src/_tests_/views/components/SystemConfig/ManageSystemConfig/UpdateManageSystemConfig.test.jsx.disable +157 -0
- package/src/_tests_/views/components/SystemConfig/MockSystemConfig.js +1280 -0
- package/src/_tests_/views/components/SystemConfig/SystemConfig.test.jsx.disable +165 -0
- package/src/_tests_/views/components/login/Login.test.jsx +276 -0
- package/src/_tests_/views/components/login/MockAuthorise.js +2414 -0
- package/src/_tests_/views/components/login/ServiceResponse.js +595 -0
- package/src/_tests_/views/components/user/MockManageUser.js +7965 -0
- package/src/_tests_/views/components/user/manageuser.test.jsx.disable +989 -0
- package/src/_tests_/views/components/user/mockUsersData.js +582 -0
- package/src/assets/img/OASISLogin.png +0 -0
- package/src/assets/img/bahaarNew.png +0 -0
- package/src/assets/img/dnhdd4K.png +0 -0
- package/src/assets/img/govtofup.png +0 -0
- package/src/assets/img/sewarural4K.png +0 -0
- package/src/assets/img/techo4K.png +0 -0
- package/src/assets/img/up4K.png +0 -0
- package/src/common/HolidayList.jsx +573 -0
- package/src/common/MalaciaousInputUtil.js +23 -0
- package/src/common/SafeHtml.jsx +17 -0
- package/src/common/VersionManager.jsx +109 -0
- package/src/common/constants/PerformanceDashboard.js +514 -0
- package/src/common/constants/app.constant.js +781 -0
- package/src/common/constants/cccVerificationConstants.js +18 -0
- package/src/common/constants/fhsrConstant.js +33 -0
- package/src/common/constants/gvk-verification.constant.js +76 -0
- package/src/common/constants/search.constant.js +23 -0
- package/src/common/constants/teleconsulatationConstant.jsx +1339 -0
- package/src/common/directives/SearchTemplate.jsx +784 -0
- package/src/common/directives/SearchTemplate.scss +14 -0
- package/src/common/dynamicView/DynamicView.jsx +353 -0
- package/src/common/dynamicView/InputFieldComponent.jsx +1501 -0
- package/src/common/dynamicView/InputViewComponent.jsx +298 -0
- package/src/common/dynamicView/InputViewComponent.scss +15 -0
- package/src/common/env.js +5 -0
- package/src/common/filters/locationNameFilter.js +26 -0
- package/src/common/fontAwesomeIcons/FontAwesomeIcons.jsx +27 -0
- package/src/common/fontAwesomeIcons/FontAwesomeIconsNames.js +1968 -0
- package/src/common/fontPreferences/fontSizeProvider.jsx +34 -0
- package/src/common/fontPreferences/fontSizeSelector.jsx +116 -0
- package/src/common/getAssignedFeature/getAssignedFeature.js +32 -0
- package/src/common/interceptors/AxiosInterceptor.js +216 -0
- package/src/common/languageTranslator/TranslationContext.js +5 -0
- package/src/common/languageTranslator/TranslationProvider.jsx +24 -0
- package/src/common/languageTranslator/i18n.js +49 -0
- package/src/common/services/AuthenticateService.js +116 -0
- package/src/common/services/DownloadFile.js +35 -0
- package/src/common/services/ForgotPassword.js +18 -0
- package/src/common/services/FormConfiguratorService.js +195 -0
- package/src/common/services/GlobalApis.js +84 -0
- package/src/common/services/InterceptorNavigationService.js +17 -0
- package/src/common/services/LocationService.js +65 -0
- package/src/common/services/LocationType.js +11 -0
- package/src/common/services/QueryBuilder.js +36 -0
- package/src/common/services/Roles.js +28 -0
- package/src/common/services/SyncWithServer.js +15 -0
- package/src/common/services/SystemConfig.js +15 -0
- package/src/common/services/TranslationService.js +70 -0
- package/src/common/services/TwoFactorService.js +7 -0
- package/src/common/services/Users.js +91 -0
- package/src/common/services/Webtasks.js +27 -0
- package/src/common/services/util/Convert-pad-data-to-API-format.jsx +167 -0
- package/src/common/services/util/Convert-to-UI-format.jsx +82 -0
- package/src/common/services/util/EmptyPrescriptionPadData.jsx +11 -0
- package/src/common/services/util/GeneralUtil.js +456 -0
- package/src/common/services/util/Prescription-pad-util.js +339 -0
- package/src/common/services/util/PrescriptionPadData.js +67 -0
- package/src/common/services/util/PrescriptionpadCommonUtil.js +96 -0
- package/src/common/services/util/ReportFieldUtil.jsx +398 -0
- package/src/common/services/util/WebSocketContext.jsx +261 -0
- package/src/common/syncWithServer/SyncWithServerDialog.jsx +170 -0
- package/src/common/syncWithServer/SyncWithServerDialogSkeleton.jsx +67 -0
- package/src/common/tests/CustomWrapper.jsx +49 -0
- package/src/common/tests/TranslationWrapper.jsx +38 -0
- package/src/common/themeProvider/ColorInputs.jsx +97 -0
- package/src/common/themeProvider/EditableColorInput.jsx +128 -0
- package/src/common/themeProvider/ThemeEditor.jsx +319 -0
- package/src/common/themeProvider/ThemeProvider.jsx +210 -0
- package/src/common/themeProvider/themeConfig.js +558 -0
- package/src/common/toaster/toaster.jsx +30 -0
- package/src/firebaseConfig.js +24 -0
- package/src/global.scss +221 -0
- package/src/hooks/.gitkeep +0 -0
- package/src/hooks/useAESEncryption.js +56 -0
- package/src/hooks/useCaching.js +43 -0
- package/src/hooks/useDebounce.js +34 -0
- package/src/hooks/useDebounceFn.js +50 -0
- package/src/hooks/useDownloadPdf.js +358 -0
- package/src/hooks/useDownloadXlsx.js +55 -0
- package/src/hooks/useListValueFieldValues.js +30 -0
- package/src/hooks/useLocationHierarchies.js +63 -0
- package/src/hooks/useLocationHierarchyTranslate.js +16 -0
- package/src/hooks/useOnline.js +27 -0
- package/src/hooks/usePagination.js +63 -0
- package/src/hooks/useRefreshToken.js +87 -0
- package/src/hooks/useScript.js +25 -0
- package/src/hooks/useStopwatch.js +75 -0
- package/src/hooks/useTrackEvent.js +22 -0
- package/src/hooks/useWebAudioRecorder.js +115 -0
- package/src/layout/LoaderComponet.jsx +22 -0
- package/src/layout/LoaderContext.jsx +29 -0
- package/src/layout/mainLayout/AdaptiveZoom.jsx +27 -0
- package/src/layout/mainLayout/Chatbot.jsx +243 -0
- package/src/layout/mainLayout/Layout.jsx +445 -0
- package/src/layout/mainLayout/Profile/UpdateProfileModal.jsx +684 -0
- package/src/layout/mainLayout/header/LogoutModal.jsx +131 -0
- package/src/layout/mainLayout/header/Navbar.jsx +1677 -0
- package/src/layout/mainLayout/header/Navbar.scss +4 -0
- package/src/layout/mainLayout/header/index.js +0 -0
- package/src/layout/mainLayout/sidebar/SideBar.jsx +1402 -0
- package/src/layout/mainLayout/sidebar/Sidebar.css +159 -0
- package/src/layout/mainLayout/sidebar/index.js +0 -0
- package/src/logo.svg +1 -0
- package/src/reportWebVitals.js +13 -0
- package/src/setupFirebaseMessaging.js +28 -0
- package/src/setupTests.js +8 -0
- package/src/store/actions/AuthenticationActions.js +0 -0
- package/src/store/actions/ReportsActions.js +0 -0
- package/src/store/actions/TranslationAction.js +0 -0
- package/src/store/index.js +8 -0
- package/src/store/reducer.js +46 -0
- package/src/store/reducers/AuthenticationReducer.js +50 -0
- package/src/store/reducers/CalendarEventReducer.js +41 -0
- package/src/store/reducers/ConditionClipboardReducer.js +45 -0
- package/src/store/reducers/FeatureReducer.js +27 -0
- package/src/store/reducers/FormConfiguratorReducer.js +38 -0
- package/src/store/reducers/LoadingReducer.js +20 -0
- package/src/store/reducers/MembersAuthenticationReducer.js +28 -0
- package/src/store/reducers/PrescriptionPadReducer.js +329 -0
- package/src/store/reducers/QuestionaireReducer.js +29 -0
- package/src/store/reducers/ReportsReducer.js +24 -0
- package/src/store/reducers/SkeletonReducer.js +20 -0
- package/src/store/reducers/ThemeReducer.js +106 -0
- package/src/store/reducers/TranslationReducer.js +126 -0
- package/src/store/reducers/dashboardEditorSlice.js +77 -0
- package/src/store/reducers/districtHealthDashboardSlice.js +58 -0
- package/src/store/reducers/immunizationSlice.js +234 -0
- package/src/store/slices/dashboardPagesSlice.js +51 -0
- package/src/utils/.gitkeep +0 -0
- package/src/utils/FormConstants.js +2629 -0
- package/src/utils/GujaratTopoChart.jsx +483 -0
- package/src/utils/UUIDgenerator.js +8 -0
- package/src/utils/appointment-utils/appointment-utils.js +123 -0
- package/src/utils/feature.js +42 -0
- package/src/utils/getThemeColor.js +12 -0
- package/src/utils/localStorageHelper.js +11 -0
- package/src/utils/notifications/enable-push-notifications.js +27 -0
- package/src/utils/resolveAppliedStyle.js +11 -0
- package/src/utils/themeConfigs.js +1483 -0
- package/src/views/custom-components/.gitkeep +0 -0
- package/src/views/custom-components/AgIconButton/RIf.jsx +14 -0
- package/src/views/custom-components/AgIconButton/button.jsx +108 -0
- package/src/views/custom-components/AgIconButton/waterDrop.jsx +95 -0
- package/src/views/custom-components/AgIconButton/waterDrop.scss +37 -0
- package/src/views/custom-components/AlertPlaceholder.jsx +32 -0
- package/src/views/custom-components/AllFaIconsSelector.jsx +56 -0
- package/src/views/custom-components/CkEditor/CkEditor.js +102 -0
- package/src/views/custom-components/CustomAccordion.jsx +72 -0
- package/src/views/custom-components/CustomActionIcons.jsx +118 -0
- package/src/views/custom-components/CustomAutoComplete.jsx +188 -0
- package/src/views/custom-components/CustomCheckBox.jsx +60 -0
- package/src/views/custom-components/CustomConfirmationModal.jsx +118 -0
- package/src/views/custom-components/CustomCountrySelect.jsx +129 -0
- package/src/views/custom-components/CustomDatePicker.jsx +122 -0
- package/src/views/custom-components/CustomDropdown.jsx +191 -0
- package/src/views/custom-components/CustomFileUpload.jsx +387 -0
- package/src/views/custom-components/CustomFullCalendar.jsx +514 -0
- package/src/views/custom-components/CustomInfiniteScroll.jsx +126 -0
- package/src/views/custom-components/CustomRadioComponent.jsx +65 -0
- package/src/views/custom-components/CustomStatsComponent.jsx +114 -0
- package/src/views/custom-components/CustomSvgUpload.jsx +170 -0
- package/src/views/custom-components/CustomSwitch.jsx +37 -0
- package/src/views/custom-components/CustomTabPanel.jsx +19 -0
- package/src/views/custom-components/CustomTextArea.jsx +62 -0
- package/src/views/custom-components/CustomTextArea.scss +27 -0
- package/src/views/custom-components/CustomTextField.jsx +116 -0
- package/src/views/custom-components/CustomToggleSwitch.jsx +138 -0
- package/src/views/custom-components/CustomTooltip.jsx +51 -0
- package/src/views/custom-components/CustomZoomImage.jsx +134 -0
- package/src/views/custom-components/CustomizedTable/CustomizedTableV2.jsx +1407 -0
- package/src/views/custom-components/CustomizedTable/VirtualizeTableBody.jsx +295 -0
- package/src/views/custom-components/CustomizedTable/helper.jsx +159 -0
- package/src/views/custom-components/CustomizedTable.jsx +532 -0
- package/src/views/custom-components/EditInputField.jsx +174 -0
- package/src/views/custom-components/FieldDescription.jsx +22 -0
- package/src/views/custom-components/FileDisplayComponent.jsx +138 -0
- package/src/views/custom-components/FormItem.jsx +53 -0
- package/src/views/custom-components/GenericChart.jsx +80 -0
- package/src/views/custom-components/InfoBadge.jsx +60 -0
- package/src/views/custom-components/PostgresEditor.jsx +801 -0
- package/src/views/custom-components/ResizableEditAutocompleteField.jsx +249 -0
- package/src/views/custom-components/ResizableEditInputField.jsx +215 -0
- package/src/views/custom-components/ResizeableEditSelectField.jsx +197 -0
- package/src/views/custom-components/SideOverlay.jsx +113 -0
- package/src/views/custom-components/SideOverlay.scss +42 -0
- package/src/views/custom-components/calendar.scss +571 -0
- package/src/views/feature-components/.gitkeep +0 -0
- package/src/views/feature-components/Dashboard/DashboardUI.jsx +1043 -0
- package/src/views/feature-components/Dashboard/DhnddModal/AshaDataQualityVerificationModal.jsx +278 -0
- package/src/views/feature-components/Dashboard/PinFeatureModal.jsx +143 -0
- package/src/views/feature-components/Dashboard/QuickLinks.jsx +163 -0
- package/src/views/feature-components/Dashboard/Taskbar.jsx +56 -0
- package/src/views/feature-components/Dashboard/WebtasksFilterForm.jsx +109 -0
- package/src/views/feature-components/Dashboard/WidgetCard.jsx +161 -0
- package/src/views/feature-components/Dashboard/actionModal.jsx +263 -0
- package/src/views/feature-components/Dashboard/ekavachModal/HealthWorkerIncorrectDetailsModal.jsx +332 -0
- package/src/views/feature-components/Dashboard/ekavachModal/MoMaternalDeathVerifcationModal.jsx +275 -0
- package/src/views/feature-components/Dashboard/ekavachModal/MoVerficationForChildScreeningMoadal.jsx +566 -0
- package/src/views/feature-components/FeatureUsageAnalytics/FeatureUsageAnalytics.jsx +989 -0
- package/src/views/feature-components/Features/NewServerManagement.jsx +217 -0
- package/src/views/feature-components/Features/ServerManagement.scss +120 -0
- package/src/views/feature-components/ForgotPassword/ForgotPassword.jsx +226 -0
- package/src/views/feature-components/LocationDirective/LocationDirective.jsx +992 -0
- package/src/views/feature-components/LocationDirective/LocationDirectiveV2.jsx +909 -0
- package/src/views/feature-components/NotFound.jsx +66 -0
- package/src/views/feature-components/Onboarding/Onboarding.jsx +1400 -0
- package/src/views/feature-components/Skeletons.js +115 -0
- package/src/views/feature-components/Unauthorized.jsx +48 -0
- package/src/views/feature-components/VerifyRoute.jsx +88 -0
- package/src/views/feature-components/YearlyRecap/YearlyRecap.jsx +357 -0
- package/src/views/feature-components/YearlyRecap/components/RecapSlide.jsx +183 -0
- package/src/views/feature-components/YearlyRecap/languageTranslator/TranslationContext.js +5 -0
- package/src/views/feature-components/YearlyRecap/languageTranslator/TranslationProvider.jsx +26 -0
- package/src/views/feature-components/YearlyRecap/languageTranslator/i18n.js +46 -0
- package/src/views/feature-components/YearlyRecap/languageTranslator/translations.json +167 -0
- package/src/views/feature-components/YearlyRecap/slides/IntroSlide.jsx +233 -0
- package/src/views/feature-components/YearlyRecap/slides/MaternalHealthSlide.jsx +146 -0
- package/src/views/feature-components/YearlyRecap/slides/MetricSlide.jsx +227 -0
- package/src/views/feature-components/YearlyRecap/slides/OutroSlide.jsx +701 -0
- package/src/views/feature-components/YearlyRecap/slides/ReachSlide.jsx +273 -0
- package/src/views/feature-components/login/Login.jsx +840 -0
- package/src/views/feature-components/login/Login.scss +154 -0
- package/src/views/feature-components/login/LoginConfigurator.jsx +1149 -0
- package/src/views/feature-components/login/TwoFactorSetupModal.jsx +411 -0
- package/src/views/feature-components/login/simplifyMenu.js +45 -0
- package/src/views/feature-components/system-config/ManageSystemConfigs.jsx +284 -0
- package/src/views/feature-components/system-config/SystemConfig.jsx +299 -0
- package/src/views/feature-components/users/ChangePasswordModal.jsx +243 -0
- package/src/views/feature-components/users/PasswordField.jsx +56 -0
- package/dist/index.css +0 -1
- package/dist/index.js +0 -32001
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// Centralized exports for all skeleton components
|
|
2
|
+
|
|
3
|
+
import RolesSkeleton from '@/views/feature-components/Roles/RolesSkeleton.jsx';
|
|
4
|
+
import {
|
|
5
|
+
ReportListSkeleton,
|
|
6
|
+
ManageGroupSkeleton,
|
|
7
|
+
ReportConfigSkeleton,
|
|
8
|
+
} from '@/views/feature-components/reports/ReportsSkeleton';
|
|
9
|
+
import { FeatureMenuSkeleton, ManageFeatureSkeleton } from '@/views/feature-components/Features/FeatureSkeletons';
|
|
10
|
+
import { ManageUserSkeleton, UserListSkeleton } from '@/views/feature-components/users/UserListSkeleton.jsx';
|
|
11
|
+
import {
|
|
12
|
+
LocationTypeSkeleton,
|
|
13
|
+
ManageLocationTypeSkeleton,
|
|
14
|
+
} from '@/views/feature-components/LocationType/LocationTypeSkeleton';
|
|
15
|
+
import {
|
|
16
|
+
LocationListSkeleton,
|
|
17
|
+
LocationConfigSkeleton,
|
|
18
|
+
} from '@/views/feature-components/Locations/LocationListSkeleton';
|
|
19
|
+
import { QueryBuilderSkeleton } from '@/views/feature-components/QueryBuilder/QueryBuilderSkeleton';
|
|
20
|
+
import { NotificationListSkeleton } from '@/views/feature-components/Notification/NotificationsSkeletons';
|
|
21
|
+
import { QueryManagementSkeleton } from '@/views/feature-components/QueryManagement/QueryManagementSkeleton';
|
|
22
|
+
import { ManageTranslationSkeleton } from '@/views/feature-components/ManageTranslation/ManageTranslationSkeleton.jsx';
|
|
23
|
+
import {
|
|
24
|
+
ImmunizationConfigurationsListSkeleton,
|
|
25
|
+
ManageImmunizationSkeleton,
|
|
26
|
+
} from '@/views/feature-components/Immunization/ImmunizationSkeleton';
|
|
27
|
+
import {
|
|
28
|
+
EventConfigurationSkeleton,
|
|
29
|
+
ManageEventConfigurationSkeleton,
|
|
30
|
+
} from '@/views/feature-components/events/EventsSkeleton';
|
|
31
|
+
|
|
32
|
+
import CommandAndControlCenterSkeleton from '@/views/feature-components/CommandAndControlCenter/CommandAndControlCenterSkeleton';
|
|
33
|
+
import {
|
|
34
|
+
ManageTrainingScheduleSkeleton,
|
|
35
|
+
TrainingDashboardDetailsSkeleton,
|
|
36
|
+
TrainingDashboardSkeleton,
|
|
37
|
+
TrainingScheduleListSkeleton,
|
|
38
|
+
} from '@/views/feature-components/TrainingSchedule/TrainingSkeletons';
|
|
39
|
+
import { PlaceOfServiceDeliverySkeleton } from '@/views/feature-components/PlaceOfServiceDelivery/PlaceOfServiceDeliverySkeleton';
|
|
40
|
+
import { TraineeStatusSkeleton } from '@/views/feature-components/TraineeStatus/TraineeStatusSkeleton';
|
|
41
|
+
import { LmsSkeleton } from '@/views/feature-components/Lms-Dashboard/LmsSkeleton';
|
|
42
|
+
import { CourseListSkeleton, ManageCourseSkeleton } from '@/views/feature-components/Course/CourseSkeletons';
|
|
43
|
+
import {
|
|
44
|
+
ManageQuestionConfigurationSkeleton,
|
|
45
|
+
QuestionSetFormSkeleton,
|
|
46
|
+
} from '@/views/feature-components/questionSet/QuestionSetFormSkeleton';
|
|
47
|
+
import {
|
|
48
|
+
ElementConfigurationSkeleton,
|
|
49
|
+
SohChartConfigurationSkeleton,
|
|
50
|
+
SohElementConfigurationSkeleton,
|
|
51
|
+
SohElementModuleConfigurationSkeleton,
|
|
52
|
+
} from '@/views/feature-components/ElementConfiguration/ElementConfigurationSkeletons';
|
|
53
|
+
import { WidgetListSkeleton } from '@/views/feature-components/widget/WidgetListSkeleton';
|
|
54
|
+
import { FaqListSkeleton } from '@/views/feature-components/Faq/FaqSkeletons';
|
|
55
|
+
import GVKAbsentVerificationSkeleton from '@/views/feature-components/CallCenterVerifcation/GVKAbsentVerificationSkeleton.jsx';
|
|
56
|
+
import GVKCbacScreeningVerificationSkeleton from '@/views/feature-components/CallCenterVerifcation/GVKCbacScreeningVerificationSkeleton.jsx';
|
|
57
|
+
import GVKDuplicateMemberVerificationSkeleton from '@/views/feature-components/CallCenterVerifcation/GVKDuplicateMemberVerificationSkeleton.jsx';
|
|
58
|
+
import GVKFamilyEligibleCounselingSkeleton from '@/views/feature-components/CallCenterVerifcation/GVKFamilyEligibleCounselingSkeleton.jsx';
|
|
59
|
+
import GVKMembersMigrationInSkeleton from '@/views/feature-components/CallCenterVerifcation/GVKMembersMigrationInSkeleton.jsx';
|
|
60
|
+
import GVKNcdScreeningVerificationSkeleton from '@/views/feature-components/CallCenterVerifcation/GVKNcdScreeningVerificationSkeleton.jsx';import AvailabilitySkeleton from '@/views/feature-components/TeleCommunication/AvailabilitySkeleton';
|
|
61
|
+
import AllAppointmentViewSkeleton from '@/views/feature-components/TeleCommunication/AllAppointmentViewSkeleton';
|
|
62
|
+
import AppointmentCalendarDetailSkeleton from '@/views/feature-components/TeleCommunication/AppointmentCalendarDetailSkeleton';
|
|
63
|
+
import MyRoomSkeleton from '@/views/feature-components/TeleCommunication/MyRoomSkeleton';
|
|
64
|
+
|
|
65
|
+
// Export all skeletons as named exports
|
|
66
|
+
export {
|
|
67
|
+
RolesSkeleton,
|
|
68
|
+
ReportListSkeleton,
|
|
69
|
+
ManageGroupSkeleton,
|
|
70
|
+
ReportConfigSkeleton,
|
|
71
|
+
FeatureMenuSkeleton,
|
|
72
|
+
ManageFeatureSkeleton,
|
|
73
|
+
ManageUserSkeleton,
|
|
74
|
+
UserListSkeleton,
|
|
75
|
+
LocationTypeSkeleton,
|
|
76
|
+
ManageLocationTypeSkeleton,
|
|
77
|
+
LocationListSkeleton,
|
|
78
|
+
LocationConfigSkeleton,
|
|
79
|
+
QueryBuilderSkeleton,
|
|
80
|
+
NotificationListSkeleton,
|
|
81
|
+
QueryManagementSkeleton,
|
|
82
|
+
ManageTranslationSkeleton,
|
|
83
|
+
ImmunizationConfigurationsListSkeleton,
|
|
84
|
+
ManageImmunizationSkeleton,
|
|
85
|
+
EventConfigurationSkeleton,
|
|
86
|
+
ManageEventConfigurationSkeleton,
|
|
87
|
+
CommandAndControlCenterSkeleton,
|
|
88
|
+
ManageTrainingScheduleSkeleton,
|
|
89
|
+
TrainingDashboardDetailsSkeleton,
|
|
90
|
+
TrainingDashboardSkeleton,
|
|
91
|
+
TrainingScheduleListSkeleton,
|
|
92
|
+
PlaceOfServiceDeliverySkeleton,
|
|
93
|
+
TraineeStatusSkeleton,
|
|
94
|
+
LmsSkeleton,
|
|
95
|
+
CourseListSkeleton,
|
|
96
|
+
ManageCourseSkeleton,
|
|
97
|
+
ManageQuestionConfigurationSkeleton,
|
|
98
|
+
QuestionSetFormSkeleton,
|
|
99
|
+
ElementConfigurationSkeleton,
|
|
100
|
+
SohChartConfigurationSkeleton,
|
|
101
|
+
SohElementConfigurationSkeleton,
|
|
102
|
+
SohElementModuleConfigurationSkeleton,
|
|
103
|
+
WidgetListSkeleton,
|
|
104
|
+
FaqListSkeleton,
|
|
105
|
+
GVKNcdScreeningVerificationSkeleton,
|
|
106
|
+
GVKAbsentVerificationSkeleton,
|
|
107
|
+
GVKCbacScreeningVerificationSkeleton,
|
|
108
|
+
GVKDuplicateMemberVerificationSkeleton,
|
|
109
|
+
GVKMembersMigrationInSkeleton,
|
|
110
|
+
GVKFamilyEligibleCounselingSkeleton,
|
|
111
|
+
AvailabilitySkeleton,
|
|
112
|
+
AllAppointmentViewSkeleton,
|
|
113
|
+
AppointmentCalendarDetailSkeleton,
|
|
114
|
+
MyRoomSkeleton,
|
|
115
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useNavigate } from 'react-router-dom';
|
|
3
|
+
import { Button, Typography, Box, Stack } from '@mui/material';
|
|
4
|
+
import { useTranslateProvider } from '@/common/languageTranslator/TranslationContext';
|
|
5
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
6
|
+
import { faLock } from '@fortawesome/free-solid-svg-icons';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @module Unauthorized
|
|
10
|
+
* @returns {JSX.element}
|
|
11
|
+
*/
|
|
12
|
+
const Unauthorized = () => {
|
|
13
|
+
const navigate = useNavigate();
|
|
14
|
+
const { translate } = useTranslateProvider();
|
|
15
|
+
|
|
16
|
+
const handleBackToHome = () => {
|
|
17
|
+
navigate('/ui/medplat/dashboard/webtasks');
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Box
|
|
22
|
+
display="flex"
|
|
23
|
+
justifyContent="center"
|
|
24
|
+
alignItems="center"
|
|
25
|
+
minHeight="80vh"
|
|
26
|
+
bgcolor="background.default"
|
|
27
|
+
color="text.primary"
|
|
28
|
+
px={2}
|
|
29
|
+
>
|
|
30
|
+
<Stack spacing={3} alignItems="center" textAlign="center" maxWidth={400}>
|
|
31
|
+
<FontAwesomeIcon icon={faLock} className="text-[64px] text-[var(--color-error)]" />
|
|
32
|
+
<Typography variant="h4" fontWeight="bold" className="text-customBlue">
|
|
33
|
+
401 - Unauthorized
|
|
34
|
+
</Typography>
|
|
35
|
+
<Typography variant="body1" color="text.secondary">
|
|
36
|
+
You don’t have permission to access this page. Please log in or go back to the homepage.
|
|
37
|
+
</Typography>
|
|
38
|
+
<Stack direction="row" spacing={2}>
|
|
39
|
+
<Button variant="contained" onClick={handleBackToHome} className="mt-4">
|
|
40
|
+
{translate('Back to Home')}
|
|
41
|
+
</Button>
|
|
42
|
+
</Stack>
|
|
43
|
+
</Stack>
|
|
44
|
+
</Box>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default Unauthorized;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { setHeaderTitle } from '@/store/reducers/AuthenticationReducer';
|
|
2
|
+
import { setPageTitle } from '@/store/reducers/TranslationReducer';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { Suspense, useEffect, useState } from 'react';
|
|
5
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
6
|
+
import { useNavigate } from 'react-router-dom';
|
|
7
|
+
import { redirectionObj } from '@/common/constants/app.constant';
|
|
8
|
+
|
|
9
|
+
import GeneralUtil from '@/common/services/util/GeneralUtil';
|
|
10
|
+
/**
|
|
11
|
+
* A route wrapper component that verifies user permissions before rendering the specified component.
|
|
12
|
+
* It checks if the user has access to the given URL and conditionally renders the passed component.
|
|
13
|
+
*
|
|
14
|
+
* @param {Object} props - The properties object.
|
|
15
|
+
* @param {string} props.url - The URL that requires verification to ensure the user has access.
|
|
16
|
+
* @param {JSX.Element} props.component - The component to render if verification passes.
|
|
17
|
+
*
|
|
18
|
+
* @returns {JSX.Element} The rendered component if verification passes, otherwise null or a redirect.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
export default function VerifyRoute({ url, component: Component, skeleton, pageTitle, headerTitle }) {
|
|
22
|
+
const dispatch = useDispatch();
|
|
23
|
+
const navigate = useNavigate();
|
|
24
|
+
|
|
25
|
+
const { user } = useSelector((state) => state.Authenticate);
|
|
26
|
+
const { linearMenuItems: menuItem } = useSelector((state) => state.Authenticate);
|
|
27
|
+
const [isPathInMenu, setIsPathInMenu] = useState(false);
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (Object.prototype.hasOwnProperty.call(redirectionObj, window.location.origin)) {
|
|
31
|
+
if (!redirectionObj[window.location.origin].some((entry) => url.includes(entry))) {
|
|
32
|
+
GeneralUtil.angularRedirectionRouteMatch(user, navigate);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}, [url, navigate]);
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Effect hook to validate the current URL path against the available menu items.
|
|
39
|
+
* @function useEffect
|
|
40
|
+
* @param {string} url - The current URL path to be validated.
|
|
41
|
+
* @param {Object} menuItem - An object containing valid menu items where keys represent valid paths.
|
|
42
|
+
* @param {function} navigate - A navigation function used to redirect the user in case of an invalid path.
|
|
43
|
+
* @returns {void} This function does not return anything, it performs navigation or sets a state.
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (menuItem && url !== 'home') {
|
|
48
|
+
const normalizedStates = [url.replace(/^medplat\//, 'techo/').replace(/\//g, '.'), url.replace(/\//g, '.')];
|
|
49
|
+
|
|
50
|
+
const isPathValid = Object.keys(menuItem).some((item) => normalizedStates.some((state) => item.includes(state)));
|
|
51
|
+
if (!isPathValid) {
|
|
52
|
+
if (url === 'medplat/dashboard/webtasks') {
|
|
53
|
+
navigate('/ui/');
|
|
54
|
+
} else {
|
|
55
|
+
navigate('/ui/unauthorized');
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
if (pageTitle && pageTitle?.length > 0) {
|
|
59
|
+
dispatch(setPageTitle(pageTitle));
|
|
60
|
+
}
|
|
61
|
+
dispatch(setHeaderTitle(headerTitle ? headerTitle : 'Form'));
|
|
62
|
+
setIsPathInMenu(true);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}, [url, menuItem, navigate]);
|
|
66
|
+
|
|
67
|
+
// Only render when permission is confirmed or exception route
|
|
68
|
+
if (!(isPathInMenu || url === 'medplat/form')) return null;
|
|
69
|
+
|
|
70
|
+
// Lazy component (e.g., React.lazy(() => import(...)))
|
|
71
|
+
const isLazy = typeof Component === 'object' && Component?.$$typeof?.toString() === 'Symbol(react.lazy)';
|
|
72
|
+
|
|
73
|
+
return isLazy ? (
|
|
74
|
+
<Suspense fallback={skeleton || null}>
|
|
75
|
+
<Component />
|
|
76
|
+
</Suspense>
|
|
77
|
+
) : (
|
|
78
|
+
menuItem && Component
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
VerifyRoute.propTypes = {
|
|
83
|
+
url: PropTypes.string.isRequired,
|
|
84
|
+
component: PropTypes.any,
|
|
85
|
+
skeleton: PropTypes.any,
|
|
86
|
+
pageTitle: PropTypes.any,
|
|
87
|
+
headerTitle: PropTypes.any,
|
|
88
|
+
};
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import React, { useRef, useState, useEffect } from 'react';
|
|
2
|
+
import { Box } from '@mui/material';
|
|
3
|
+
import { useParams } from 'react-router-dom';
|
|
4
|
+
import { I18nextProvider } from 'react-i18next';
|
|
5
|
+
import IntroSlide from './slides/IntroSlide';
|
|
6
|
+
import ReachSlide from './slides/ReachSlide';
|
|
7
|
+
import MaternalHealthSlide from './slides/MaternalHealthSlide';
|
|
8
|
+
import MetricSlide from './slides/MetricSlide';
|
|
9
|
+
import OutroSlide from './slides/OutroSlide';
|
|
10
|
+
|
|
11
|
+
import { getRecapDetails, createOrUpdateRecapAnalytics } from '@/common/services/GlobalApis';
|
|
12
|
+
|
|
13
|
+
import { useSelector } from 'react-redux';
|
|
14
|
+
import { initializeI18n } from './languageTranslator/i18n';
|
|
15
|
+
import TranslationProvider from './languageTranslator/TranslationProvider';
|
|
16
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
17
|
+
import APP_CONFIG from '@/common/constants/app.constant';
|
|
18
|
+
import GeneralUtil from '@/common/services/util/GeneralUtil';
|
|
19
|
+
|
|
20
|
+
/* ---------- STATIC METRIC CONFIG ---------- */
|
|
21
|
+
|
|
22
|
+
const METRICS_CONFIG = [
|
|
23
|
+
{
|
|
24
|
+
key: 'anc',
|
|
25
|
+
title: 'Antenatal Care',
|
|
26
|
+
label: 'ANC Visits Completed',
|
|
27
|
+
color: '#E91E63',
|
|
28
|
+
animation: 'pulse',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: 'immunisation',
|
|
32
|
+
title: 'Immunisation Services',
|
|
33
|
+
label: 'Vaccinations Provided',
|
|
34
|
+
color: '#4CAF50',
|
|
35
|
+
animation: 'pulse',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
key: 'pnc',
|
|
39
|
+
title: 'Postnatal Care',
|
|
40
|
+
label: 'Postnatal Home Visits Completed',
|
|
41
|
+
color: '#2196F3',
|
|
42
|
+
animation: 'pulse',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: 'child',
|
|
46
|
+
title: 'Child Health',
|
|
47
|
+
label: 'Child Service Provided',
|
|
48
|
+
color: '#8BC34A',
|
|
49
|
+
animation: 'pulse',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: 'npcb',
|
|
53
|
+
title: 'NPCB',
|
|
54
|
+
label: 'NPCB Screenings Done',
|
|
55
|
+
color: '#E67E22',
|
|
56
|
+
animation: 'pulse',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
key: 'cbac',
|
|
60
|
+
title: 'CBAC',
|
|
61
|
+
label: 'CBAC Forms Filled',
|
|
62
|
+
color: '#9C27B0',
|
|
63
|
+
animation: 'pulse',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
key: 'ncd',
|
|
67
|
+
title: 'NCD',
|
|
68
|
+
label: 'NCD Screenings Done',
|
|
69
|
+
color: '#009688',
|
|
70
|
+
animation: 'pulse',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: 'abha',
|
|
74
|
+
title: 'ABHA',
|
|
75
|
+
label: 'ABHA Incentives Given',
|
|
76
|
+
color: '#3F51B5',
|
|
77
|
+
animation: 'pulse',
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
/* ---------- FIELD MAP ---------- */
|
|
82
|
+
|
|
83
|
+
const METRIC_FIELD_MAP = {
|
|
84
|
+
anc: {
|
|
85
|
+
count: 'ancServicesProvided',
|
|
86
|
+
percentile: 'ancServicesTopPct',
|
|
87
|
+
},
|
|
88
|
+
immunisation: {
|
|
89
|
+
count: 'immunisationServicesProvided',
|
|
90
|
+
percentile: 'immunisationServicesTopPct',
|
|
91
|
+
},
|
|
92
|
+
pnc: {
|
|
93
|
+
count: 'pncServicesProvided',
|
|
94
|
+
percentile: 'pncServicesTopPct',
|
|
95
|
+
},
|
|
96
|
+
child: {
|
|
97
|
+
count: 'csProvided',
|
|
98
|
+
percentile: 'csServicesTopPct',
|
|
99
|
+
},
|
|
100
|
+
npcb: {
|
|
101
|
+
count: 'npcbServicesProvided',
|
|
102
|
+
percentile: 'npcbServicesTopPct',
|
|
103
|
+
},
|
|
104
|
+
cbac: {
|
|
105
|
+
count: 'cbacServicesProvided',
|
|
106
|
+
percentile: 'cbacServicesTopPct',
|
|
107
|
+
},
|
|
108
|
+
ncd: {
|
|
109
|
+
count: 'ncdServicesProvided',
|
|
110
|
+
percentile: 'ncdServicesTopPct',
|
|
111
|
+
},
|
|
112
|
+
abha: {
|
|
113
|
+
count: 'abhaServicesProvided',
|
|
114
|
+
percentile: 'abhaServicesTopPct',
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const YearlyRecap = () => {
|
|
119
|
+
const { userId } = useParams();
|
|
120
|
+
const containerRef = useRef(null);
|
|
121
|
+
const translations = useSelector((state) => state.Translation);
|
|
122
|
+
const [i18nInstance, setI18nInstance] = useState(null);
|
|
123
|
+
const [currentSlide, setCurrentSlide] = useState(0);
|
|
124
|
+
const [summaryDetails, setSummaryDetails] = useState(null);
|
|
125
|
+
const [sessionId] = useState(() => {
|
|
126
|
+
const sid = sessionStorage.getItem('recap_session_id') || uuidv4();
|
|
127
|
+
sessionStorage.setItem('recap_session_id', sid);
|
|
128
|
+
return sid;
|
|
129
|
+
});
|
|
130
|
+
const trackEvent = (type, lang) => {
|
|
131
|
+
if (type === 'START') {
|
|
132
|
+
const payload = {
|
|
133
|
+
path: window.location.pathname,
|
|
134
|
+
userId: Number(userId),
|
|
135
|
+
sessionId: sessionId,
|
|
136
|
+
userAgent: navigator.userAgent,
|
|
137
|
+
preferredLanguage: lang || 'en',
|
|
138
|
+
startTime: new Date().toISOString(),
|
|
139
|
+
};
|
|
140
|
+
createOrUpdateRecapAnalytics(payload).catch((err) => console.error('Failed to track start:', err));
|
|
141
|
+
} else {
|
|
142
|
+
const payload = {
|
|
143
|
+
sessionId: sessionId,
|
|
144
|
+
endTime: new Date().toISOString(),
|
|
145
|
+
};
|
|
146
|
+
const url = `${APP_CONFIG.apiPath}/recap/createOrUpdateRecapAnalytics`;
|
|
147
|
+
|
|
148
|
+
// navigator.sendBeacon doesn't support headers (Authorization)
|
|
149
|
+
// fetch with keepalive: true is the modern replacement
|
|
150
|
+
const tokenString = localStorage.getItem('token');
|
|
151
|
+
const token = tokenString ? JSON.parse(tokenString) : null;
|
|
152
|
+
|
|
153
|
+
fetch(url, {
|
|
154
|
+
method: 'POST',
|
|
155
|
+
headers: {
|
|
156
|
+
'Content-Type': 'application/json',
|
|
157
|
+
Authorization: token ? `Bearer ${token.access_token}` : '',
|
|
158
|
+
},
|
|
159
|
+
body: JSON.stringify(payload),
|
|
160
|
+
keepalive: true,
|
|
161
|
+
}).catch((err) => console.error('Failed to track end:', err));
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
/* ---------- DATA FETCH ---------- */
|
|
166
|
+
|
|
167
|
+
const getSummaryDetails = async () => {
|
|
168
|
+
try {
|
|
169
|
+
const res = await getRecapDetails(Number(userId));
|
|
170
|
+
const data = res.data;
|
|
171
|
+
|
|
172
|
+
// Filter metrics based on env
|
|
173
|
+
let allowedMetrics = ['anc', 'immunisation', 'pnc', 'child'];
|
|
174
|
+
if (GeneralUtil.isEkavach) {
|
|
175
|
+
allowedMetrics = [...allowedMetrics, 'cbac', 'ncd', 'abha'];
|
|
176
|
+
} else if (GeneralUtil.isTecho) {
|
|
177
|
+
allowedMetrics = [...allowedMetrics, 'npcb'];
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// enrich metrics
|
|
181
|
+
data.metrics = allowedMetrics
|
|
182
|
+
.map((key) => {
|
|
183
|
+
const fields = METRIC_FIELD_MAP[key];
|
|
184
|
+
const meta = METRICS_CONFIG.find((m) => m.key === key);
|
|
185
|
+
|
|
186
|
+
if (!fields || !meta) return null;
|
|
187
|
+
|
|
188
|
+
return {
|
|
189
|
+
key,
|
|
190
|
+
title: meta.title,
|
|
191
|
+
label: meta.label,
|
|
192
|
+
color: meta.color,
|
|
193
|
+
animation: meta.animation,
|
|
194
|
+
count: Number(data[fields.count]) || 0,
|
|
195
|
+
percentile: data[fields.percentile] !== null ? Number(data[fields.percentile]) : null,
|
|
196
|
+
};
|
|
197
|
+
})
|
|
198
|
+
.filter(Boolean);
|
|
199
|
+
|
|
200
|
+
setSummaryDetails(data);
|
|
201
|
+
trackEvent('START', data.preferedLanguage);
|
|
202
|
+
} catch {
|
|
203
|
+
setSummaryDetails(null);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
useEffect(() => {
|
|
208
|
+
getSummaryDetails();
|
|
209
|
+
|
|
210
|
+
let trackedEnd = false;
|
|
211
|
+
const handleEnd = () => {
|
|
212
|
+
if (!trackedEnd) {
|
|
213
|
+
trackEvent('END');
|
|
214
|
+
trackedEnd = true;
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
const handleVisibilityChange = () => {
|
|
219
|
+
if (document.visibilityState === 'hidden') {
|
|
220
|
+
handleEnd();
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
window.addEventListener('visibilitychange', handleVisibilityChange);
|
|
225
|
+
window.addEventListener('pagehide', handleEnd);
|
|
226
|
+
|
|
227
|
+
return () => {
|
|
228
|
+
handleEnd();
|
|
229
|
+
window.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
230
|
+
window.removeEventListener('pagehide', handleEnd);
|
|
231
|
+
};
|
|
232
|
+
}, [userId]);
|
|
233
|
+
|
|
234
|
+
useEffect(() => {
|
|
235
|
+
if (translations && summaryDetails) {
|
|
236
|
+
let preferredLanguage;
|
|
237
|
+
|
|
238
|
+
if (GeneralUtil.isEkavach) {
|
|
239
|
+
preferredLanguage = summaryDetails.preferedLanguage?.toLowerCase() === 'gu' ? 'hi' : 'en';
|
|
240
|
+
} else {
|
|
241
|
+
preferredLanguage = summaryDetails.preferedLanguage?.toLowerCase() || translations.translationLanguage || 'en';
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const i18n = initializeI18n(translations?.translations, preferredLanguage);
|
|
245
|
+
setI18nInstance(i18n);
|
|
246
|
+
}
|
|
247
|
+
}, [translations, summaryDetails]);
|
|
248
|
+
|
|
249
|
+
if (!i18nInstance) {
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/* ---------- FILTERED METRICS ---------- */
|
|
254
|
+
|
|
255
|
+
if (!summaryDetails) {
|
|
256
|
+
return <Box sx={{ height: '100vh', width: '100vw', bgcolor: '#fff' }} />;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const visibleMetrics = summaryDetails.metrics.filter((m) => Number(m.count) > 0);
|
|
260
|
+
|
|
261
|
+
// Intro + Reach + Maternal + Metrics + Outro
|
|
262
|
+
const totalSlides = 3 + visibleMetrics.length + 1;
|
|
263
|
+
|
|
264
|
+
/* ---------- SCROLL HELPERS ---------- */
|
|
265
|
+
|
|
266
|
+
const scrollToSlide = (index) => {
|
|
267
|
+
if (!containerRef.current) return;
|
|
268
|
+
|
|
269
|
+
const width = containerRef.current.clientWidth;
|
|
270
|
+
containerRef.current.scrollTo({
|
|
271
|
+
left: width * index,
|
|
272
|
+
behavior: 'smooth',
|
|
273
|
+
});
|
|
274
|
+
setCurrentSlide(index);
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
const handleNext = () => {
|
|
278
|
+
if (currentSlide < totalSlides - 1) {
|
|
279
|
+
scrollToSlide(currentSlide + 1);
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
const handlePrev = () => {
|
|
284
|
+
if (currentSlide > 0) {
|
|
285
|
+
scrollToSlide(currentSlide - 1);
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
return (
|
|
290
|
+
<I18nextProvider i18n={i18nInstance}>
|
|
291
|
+
<TranslationProvider>
|
|
292
|
+
<Box
|
|
293
|
+
ref={containerRef}
|
|
294
|
+
sx={{
|
|
295
|
+
width: '100vw',
|
|
296
|
+
height: '100vh',
|
|
297
|
+
display: 'flex',
|
|
298
|
+
overflowX: 'auto',
|
|
299
|
+
overflowY: 'hidden',
|
|
300
|
+
scrollSnapType: 'x mandatory',
|
|
301
|
+
bgcolor: '#fff',
|
|
302
|
+
'&::-webkit-scrollbar': { display: 'none' },
|
|
303
|
+
}}
|
|
304
|
+
onScroll={(e) => {
|
|
305
|
+
const index = Math.round(e.target.scrollLeft / window.innerWidth);
|
|
306
|
+
if (index !== currentSlide) setCurrentSlide(index);
|
|
307
|
+
}}
|
|
308
|
+
>
|
|
309
|
+
{/* Intro */}
|
|
310
|
+
<Box sx={{ minWidth: '100vw', scrollSnapAlign: 'start' }}>
|
|
311
|
+
<IntroSlide data={summaryDetails} onNext={handleNext} showPrev={false} isActive={currentSlide === 0} />
|
|
312
|
+
</Box>
|
|
313
|
+
|
|
314
|
+
{/* Reach */}
|
|
315
|
+
<Box sx={{ minWidth: '100vw', scrollSnapAlign: 'start' }}>
|
|
316
|
+
<ReachSlide data={summaryDetails} onNext={handleNext} onPrev={handlePrev} isActive={currentSlide === 1} />
|
|
317
|
+
</Box>
|
|
318
|
+
|
|
319
|
+
{/* Maternal */}
|
|
320
|
+
<Box sx={{ minWidth: '100vw', scrollSnapAlign: 'start' }}>
|
|
321
|
+
<MaternalHealthSlide
|
|
322
|
+
data={summaryDetails}
|
|
323
|
+
onNext={handleNext}
|
|
324
|
+
onPrev={handlePrev}
|
|
325
|
+
isActive={currentSlide === 2}
|
|
326
|
+
/>
|
|
327
|
+
</Box>
|
|
328
|
+
|
|
329
|
+
{/* Metrics */}
|
|
330
|
+
{visibleMetrics.map((metric, index) => (
|
|
331
|
+
<Box key={metric.key} sx={{ minWidth: '100vw', scrollSnapAlign: 'start' }}>
|
|
332
|
+
<MetricSlide
|
|
333
|
+
title={metric.title}
|
|
334
|
+
count={metric.count}
|
|
335
|
+
label={metric.label}
|
|
336
|
+
percentile={metric.percentile}
|
|
337
|
+
color={metric.color}
|
|
338
|
+
animation={metric.animation}
|
|
339
|
+
onNext={handleNext}
|
|
340
|
+
onPrev={handlePrev}
|
|
341
|
+
isActive={currentSlide === 3 + index}
|
|
342
|
+
iconKey={metric.key}
|
|
343
|
+
/>
|
|
344
|
+
</Box>
|
|
345
|
+
))}
|
|
346
|
+
|
|
347
|
+
{/* Outro */}
|
|
348
|
+
<Box sx={{ minWidth: '100vw', scrollSnapAlign: 'start' }}>
|
|
349
|
+
<OutroSlide data={summaryDetails} onPrev={handlePrev} isActive={currentSlide === totalSlides - 1} />
|
|
350
|
+
</Box>
|
|
351
|
+
</Box>
|
|
352
|
+
</TranslationProvider>
|
|
353
|
+
</I18nextProvider>
|
|
354
|
+
);
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
export default YearlyRecap;
|