@argusoft/medplat-app-shell 1.0.5 → 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,445 @@
|
|
|
1
|
+
import React, { Suspense, useEffect, useState } from 'react';
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
|
+
import Navbar from '@/layout/mainLayout/header/Navbar';
|
|
4
|
+
import SideBar from '@/layout/mainLayout/sidebar/SideBar';
|
|
5
|
+
import { Outlet, useLocation } from 'react-router';
|
|
6
|
+
import Grid from '@mui/material/Grid2';
|
|
7
|
+
import { ButtonBase, IconButton } from '@mui/material';
|
|
8
|
+
import { useTheme } from '@mui/material/styles';
|
|
9
|
+
import GeneralUtil from '@/common/services/util/GeneralUtil';
|
|
10
|
+
import medplatLogo from '@/assets/img/medplat-highres.png';
|
|
11
|
+
import bankverification from '@/assets/img/nhm-logo.png';
|
|
12
|
+
import GovOfGujarat from '@/assets/img/govtofgujarat.png';
|
|
13
|
+
import useAdaptiveZoom from './AdaptiveZoom';
|
|
14
|
+
import { execute } from '@/common/services/GlobalApis';
|
|
15
|
+
|
|
16
|
+
import SewaRural from '@/assets/img/sewa-rural.png';
|
|
17
|
+
import Chatbot from '@/layout/mainLayout/Chatbot';
|
|
18
|
+
import { CustomTooltip } from '@/views/custom-components/CustomTooltip';
|
|
19
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
20
|
+
import { faGlobe, faUniversalAccess } from '@fortawesome/free-solid-svg-icons';
|
|
21
|
+
import ChangePasswordModal from '@/views/feature-components/users/ChangePasswordModal';
|
|
22
|
+
|
|
23
|
+
const getModifiedMenuItems = (menuJson) => {
|
|
24
|
+
let newMenuItems = [];
|
|
25
|
+
if (menuJson) {
|
|
26
|
+
Object.keys(menuJson).forEach((menu) => {
|
|
27
|
+
newMenuItems.push({
|
|
28
|
+
name: menu,
|
|
29
|
+
subGroups: menuJson[menu],
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return newMenuItems;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const Layout = () => {
|
|
37
|
+
const { user } = useSelector((state) => state.Authenticate);
|
|
38
|
+
const menuList = getModifiedMenuItems(user?.features);
|
|
39
|
+
const [orientation, setOrientation] = useState(localStorage.getItem('sideBarOrientation') || 'vertical');
|
|
40
|
+
const [showSideBar, setShowSideBar] = useState(JSON.parse(localStorage.getItem('displaySideBar')) || true);
|
|
41
|
+
const [showForcePasswordChange, setShowForcePasswordChange] = useState(false);
|
|
42
|
+
const location = useLocation();
|
|
43
|
+
const [bhashiniEnabled, setBhashiniEnabled] = useState(false);
|
|
44
|
+
const [chatbotEnabled, setChatbotEnabled] = useState(false);
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (user && !user?.firstTimePasswordChanged && location.pathname === '/ui/medplat/dashboard/webtasks') {
|
|
48
|
+
setShowForcePasswordChange(true);
|
|
49
|
+
}
|
|
50
|
+
}, [user, location.pathname]);
|
|
51
|
+
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (orientation === 'horizontal') {
|
|
54
|
+
setShowSideBar(true);
|
|
55
|
+
localStorage.setItem('displaySideBar', JSON.stringify(true));
|
|
56
|
+
}
|
|
57
|
+
}, [orientation]);
|
|
58
|
+
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (GeneralUtil.isTecho) {
|
|
61
|
+
const checkFlags = async () => {
|
|
62
|
+
try {
|
|
63
|
+
const dto = {
|
|
64
|
+
code: 'RETRIEVE_SYSTEM_CONFIGURATION_BY_KEYS',
|
|
65
|
+
parameters: {
|
|
66
|
+
keys: ['BHASHINI_TRANSLATION_ENABLE', 'CHATBOT_ENABLE'],
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
const res = await execute(dto);
|
|
70
|
+
const results = res?.data?.result || [];
|
|
71
|
+
const bhashiniConfig = results.find((item) => item.key === 'BHASHINI_TRANSLATION_ENABLE');
|
|
72
|
+
const chatbotConfig = results.find((item) => item.key === 'CHATBOT_ENABLE');
|
|
73
|
+
setBhashiniEnabled(bhashiniConfig?.value === 'true');
|
|
74
|
+
setChatbotEnabled(chatbotConfig?.value === 'true');
|
|
75
|
+
} catch (e) {
|
|
76
|
+
console.error('Failed to fetch system configurations:', e);
|
|
77
|
+
setBhashiniEnabled(false);
|
|
78
|
+
setChatbotEnabled(false);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
checkFlags();
|
|
82
|
+
}
|
|
83
|
+
}, []);
|
|
84
|
+
|
|
85
|
+
const theme = useTheme();
|
|
86
|
+
const showFooter = GeneralUtil.isTecho || GeneralUtil.isEkavach || GeneralUtil.isSewaRural;
|
|
87
|
+
const showDrawerLauncher = orientation === 'vertical';
|
|
88
|
+
const toggleSidebarVisibility = () =>
|
|
89
|
+
setShowSideBar((cur) => {
|
|
90
|
+
const newState = !cur;
|
|
91
|
+
localStorage.setItem('displaySideBar', JSON.stringify(newState));
|
|
92
|
+
return newState;
|
|
93
|
+
});
|
|
94
|
+
const zoom = useAdaptiveZoom();
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<Grid
|
|
98
|
+
sx={{
|
|
99
|
+
height: '100vh',
|
|
100
|
+
overflow: 'hidden',
|
|
101
|
+
background:
|
|
102
|
+
theme.palette.mode === 'dark'
|
|
103
|
+
? theme.palette.background.default
|
|
104
|
+
: 'linear-gradient(180deg, #edf4fb 0%, #f7fbff 38%, #eff5fb 100%)',
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
<Navbar
|
|
108
|
+
user={user}
|
|
109
|
+
orientation={orientation}
|
|
110
|
+
showSideBar={showSideBar}
|
|
111
|
+
setShowSideBar={setShowSideBar}
|
|
112
|
+
setOrientation={setOrientation}
|
|
113
|
+
/>
|
|
114
|
+
<Grid className="flex flex-1 overflow-hidden" sx={{ height: 'calc(100vh - 72px)' }}>
|
|
115
|
+
<SideBar
|
|
116
|
+
orientation={orientation}
|
|
117
|
+
subGroups={menuList}
|
|
118
|
+
sideBarOrientation={orientation}
|
|
119
|
+
isVisible={showSideBar}
|
|
120
|
+
onToggle={toggleSidebarVisibility}
|
|
121
|
+
datatestid="main-sidebar"
|
|
122
|
+
bhashiniEnabled={bhashiniEnabled}
|
|
123
|
+
/>
|
|
124
|
+
{showSideBar && orientation === 'vertical' && (
|
|
125
|
+
<ButtonBase
|
|
126
|
+
onClick={toggleSidebarVisibility}
|
|
127
|
+
data-testid="layout-sidebar-collapse-toggle"
|
|
128
|
+
sx={{
|
|
129
|
+
position: 'fixed',
|
|
130
|
+
left: '96px',
|
|
131
|
+
top: '50%',
|
|
132
|
+
transform: 'translateY(-50%)',
|
|
133
|
+
zIndex: 1150,
|
|
134
|
+
width: 15,
|
|
135
|
+
height: 72,
|
|
136
|
+
borderRadius: '0 12px 12px 0',
|
|
137
|
+
border: `1px solid ${theme.palette.custom?.shellBorder}`,
|
|
138
|
+
borderLeft: 'none',
|
|
139
|
+
background: theme.palette.custom?.sidebarBg,
|
|
140
|
+
color: theme.palette.custom?.sidebarIcon,
|
|
141
|
+
boxShadow:
|
|
142
|
+
theme.palette.mode === 'dark'
|
|
143
|
+
? '0 10px 20px rgba(2, 8, 23, 0.16)'
|
|
144
|
+
: '0 10px 20px rgba(15, 23, 42, 0.12)',
|
|
145
|
+
backdropFilter: 'blur(14px)',
|
|
146
|
+
overflow: 'visible',
|
|
147
|
+
'&::after': {
|
|
148
|
+
content: '""',
|
|
149
|
+
position: 'absolute',
|
|
150
|
+
top: '50%',
|
|
151
|
+
right: '-5px',
|
|
152
|
+
transform: 'translateY(-50%)',
|
|
153
|
+
width: 10,
|
|
154
|
+
height: 28,
|
|
155
|
+
borderRadius: '0 10px 10px 0',
|
|
156
|
+
border: `1px solid ${theme.palette.custom?.shellBorder}`,
|
|
157
|
+
borderLeft: 'none',
|
|
158
|
+
background: theme.palette.custom?.sidebarBg,
|
|
159
|
+
transition: 'transform 0.2s ease, box-shadow 0.2s ease',
|
|
160
|
+
},
|
|
161
|
+
'&::before': {
|
|
162
|
+
content: '""',
|
|
163
|
+
position: 'absolute',
|
|
164
|
+
inset: '-5px -8px',
|
|
165
|
+
borderRadius: '0 16px 16px 0',
|
|
166
|
+
background:
|
|
167
|
+
theme.palette.mode === 'dark'
|
|
168
|
+
? 'radial-gradient(circle at 60% 50%, rgba(125, 211, 252, 0.14), transparent 68%)'
|
|
169
|
+
: 'radial-gradient(circle at 60% 50%, rgba(77, 168, 218, 0.12), transparent 68%)',
|
|
170
|
+
opacity: 0,
|
|
171
|
+
transform: 'scale(0.96)',
|
|
172
|
+
transition: 'opacity 0.2s ease, transform 0.2s ease',
|
|
173
|
+
pointerEvents: 'none',
|
|
174
|
+
},
|
|
175
|
+
'&:hover': {
|
|
176
|
+
transform: 'translateY(-50%) translateX(1px)',
|
|
177
|
+
boxShadow:
|
|
178
|
+
theme.palette.mode === 'dark'
|
|
179
|
+
? '0 14px 24px rgba(2, 8, 23, 0.18)'
|
|
180
|
+
: '0 14px 24px rgba(15, 23, 42, 0.14)',
|
|
181
|
+
},
|
|
182
|
+
'&:hover::after': {
|
|
183
|
+
transform: 'translateY(-50%) translateX(1px)',
|
|
184
|
+
},
|
|
185
|
+
'&:hover::before': {
|
|
186
|
+
opacity: 1,
|
|
187
|
+
transform: 'scale(1)',
|
|
188
|
+
},
|
|
189
|
+
transition: 'transform 0.2s ease, box-shadow 0.2s ease',
|
|
190
|
+
}}
|
|
191
|
+
/>
|
|
192
|
+
)}
|
|
193
|
+
{showDrawerLauncher && (
|
|
194
|
+
<ButtonBase
|
|
195
|
+
onClick={toggleSidebarVisibility}
|
|
196
|
+
data-testid="layout-sidebar-toggle"
|
|
197
|
+
sx={{
|
|
198
|
+
position: 'fixed',
|
|
199
|
+
left: '0',
|
|
200
|
+
top: '50%',
|
|
201
|
+
transform: 'translateY(-50%)',
|
|
202
|
+
zIndex: 1150,
|
|
203
|
+
width: 15,
|
|
204
|
+
height: 72,
|
|
205
|
+
borderRadius: '0 12px 12px 0',
|
|
206
|
+
border: `1px solid ${theme.palette.custom?.shellBorder}`,
|
|
207
|
+
borderLeft: 'none',
|
|
208
|
+
background: theme.palette.custom?.sidebarBg,
|
|
209
|
+
color: theme.palette.custom?.sidebarIcon,
|
|
210
|
+
boxShadow:
|
|
211
|
+
theme.palette.mode === 'dark'
|
|
212
|
+
? '0 10px 20px rgba(2, 8, 23, 0.16)'
|
|
213
|
+
: '0 10px 20px rgba(15, 23, 42, 0.12)',
|
|
214
|
+
backdropFilter: 'blur(14px)',
|
|
215
|
+
overflow: 'visible',
|
|
216
|
+
'&::after': {
|
|
217
|
+
content: '""',
|
|
218
|
+
position: 'absolute',
|
|
219
|
+
top: '50%',
|
|
220
|
+
right: '-5px',
|
|
221
|
+
transform: 'translateY(-50%)',
|
|
222
|
+
width: 10,
|
|
223
|
+
height: 28,
|
|
224
|
+
borderRadius: '0 10px 10px 0',
|
|
225
|
+
border: `1px solid ${theme.palette.custom?.shellBorder}`,
|
|
226
|
+
borderLeft: 'none',
|
|
227
|
+
background: theme.palette.custom?.sidebarBg,
|
|
228
|
+
transition: 'transform 0.2s ease, box-shadow 0.2s ease',
|
|
229
|
+
},
|
|
230
|
+
'&::before': {
|
|
231
|
+
content: '""',
|
|
232
|
+
position: 'absolute',
|
|
233
|
+
inset: '-5px -8px',
|
|
234
|
+
borderRadius: '0 16px 16px 0',
|
|
235
|
+
background:
|
|
236
|
+
theme.palette.mode === 'dark'
|
|
237
|
+
? 'radial-gradient(circle at 60% 50%, rgba(125, 211, 252, 0.14), transparent 68%)'
|
|
238
|
+
: 'radial-gradient(circle at 60% 50%, rgba(77, 168, 218, 0.12), transparent 68%)',
|
|
239
|
+
opacity: 0,
|
|
240
|
+
transform: 'scale(0.96)',
|
|
241
|
+
transition: 'opacity 0.2s ease, transform 0.2s ease',
|
|
242
|
+
pointerEvents: 'none',
|
|
243
|
+
},
|
|
244
|
+
'&:hover': {
|
|
245
|
+
transform: 'translateY(-50%) translateX(1px)',
|
|
246
|
+
boxShadow:
|
|
247
|
+
theme.palette.mode === 'dark'
|
|
248
|
+
? '0 14px 24px rgba(2, 8, 23, 0.18)'
|
|
249
|
+
: '0 14px 24px rgba(15, 23, 42, 0.14)',
|
|
250
|
+
},
|
|
251
|
+
'&:hover::after': {
|
|
252
|
+
transform: 'translateY(-50%) translateX(1px)',
|
|
253
|
+
},
|
|
254
|
+
'&:hover::before': {
|
|
255
|
+
opacity: 1,
|
|
256
|
+
transform: 'scale(1)',
|
|
257
|
+
},
|
|
258
|
+
transition: 'transform 0.2s ease, box-shadow 0.2s ease',
|
|
259
|
+
}}
|
|
260
|
+
/>
|
|
261
|
+
)}
|
|
262
|
+
<Grid
|
|
263
|
+
className={`${showFooter ? 'flex flex-col h-full w-full overflow-hidden' : 'flex-1'} transition-all duration-300 ease-in-out`}
|
|
264
|
+
sx={{
|
|
265
|
+
height: '100%',
|
|
266
|
+
marginTop: orientation === 'horizontal' && showSideBar ? { xs: '54px', md: '58px' } : 0,
|
|
267
|
+
paddingTop: orientation === 'horizontal' ? { xs: 0.5, md: 1 } : 0,
|
|
268
|
+
paddingBottom: showFooter ? 0 : { xs: 2, md: 3 },
|
|
269
|
+
paddingRight: 0,
|
|
270
|
+
paddingLeft:
|
|
271
|
+
orientation === 'vertical'
|
|
272
|
+
? {
|
|
273
|
+
xs: showSideBar ? '96px' : '0px',
|
|
274
|
+
md: showSideBar ? '96px' : '0px',
|
|
275
|
+
}
|
|
276
|
+
: 0,
|
|
277
|
+
}}
|
|
278
|
+
>
|
|
279
|
+
{!showFooter && (
|
|
280
|
+
<div
|
|
281
|
+
className="px-4 h-full overflow-y-auto"
|
|
282
|
+
style={{
|
|
283
|
+
zoom: zoom,
|
|
284
|
+
}}
|
|
285
|
+
>
|
|
286
|
+
<Suspense>
|
|
287
|
+
<Outlet />
|
|
288
|
+
</Suspense>
|
|
289
|
+
</div>
|
|
290
|
+
)}
|
|
291
|
+
{showFooter && (
|
|
292
|
+
<>
|
|
293
|
+
<div
|
|
294
|
+
className="px-4 flex-1 min-h-0 overflow-y-auto"
|
|
295
|
+
style={{
|
|
296
|
+
zoom: zoom,
|
|
297
|
+
}}
|
|
298
|
+
>
|
|
299
|
+
<Suspense>
|
|
300
|
+
<Outlet />
|
|
301
|
+
</Suspense>
|
|
302
|
+
</div>
|
|
303
|
+
|
|
304
|
+
<footer
|
|
305
|
+
className="text-gray-500 text-[10px] mt-auto"
|
|
306
|
+
style={{
|
|
307
|
+
padding: '8px 18px 0px 18px',
|
|
308
|
+
borderTop:
|
|
309
|
+
theme.palette.mode === 'dark'
|
|
310
|
+
? '1px solid rgba(255, 255, 255, 0.08)'
|
|
311
|
+
: '1px solid rgba(148, 163, 184, 0.18)',
|
|
312
|
+
background: theme.palette.mode === 'dark' ? theme.palette.background.paper : 'rgba(255,255,255,0.9)',
|
|
313
|
+
}}
|
|
314
|
+
>
|
|
315
|
+
<div className="flex items-center justify-between px-1 py-1">
|
|
316
|
+
{/* Left Side: 3 Images */}
|
|
317
|
+
<div className="flex items-center gap-4">
|
|
318
|
+
<ul className="flex items-center justify-between gap-3 list-none p-0 m-0">
|
|
319
|
+
{!GeneralUtil.isSewaRural && (
|
|
320
|
+
<li>
|
|
321
|
+
<a href="https://gujhealth.gujarat.gov.in/" target="_blank" border="0" rel="noreferrer">
|
|
322
|
+
<img src={GovOfGujarat} alt="Government of Gujarat" height="40" className="h-8 w-auto" />
|
|
323
|
+
</a>
|
|
324
|
+
</li>
|
|
325
|
+
)}
|
|
326
|
+
{!GeneralUtil.isSewaRural && (
|
|
327
|
+
<li>
|
|
328
|
+
<a href="http://nhm.gov.in" target="_blank" border="0" rel="noreferrer">
|
|
329
|
+
<img
|
|
330
|
+
src={bankverification}
|
|
331
|
+
alt="National Health Mission"
|
|
332
|
+
height="40"
|
|
333
|
+
className="h-8 w-auto"
|
|
334
|
+
/>
|
|
335
|
+
</a>
|
|
336
|
+
</li>
|
|
337
|
+
)}
|
|
338
|
+
{
|
|
339
|
+
<li>
|
|
340
|
+
<a href="http://www.sewarural.org/" target="_blank" border="0" rel="noreferrer">
|
|
341
|
+
<img src={SewaRural} alt="SEWA Rural" height="40" className="h-8 w-auto" />
|
|
342
|
+
</a>
|
|
343
|
+
</li>
|
|
344
|
+
}
|
|
345
|
+
{/* {GeneralUtil.isTecho && (
|
|
346
|
+
<li className="ml-2 pl-2 border-l border-gray-300 dark:border-gray-700">
|
|
347
|
+
<div className="flex items-center gap-2">
|
|
348
|
+
<div className="h-8 w-16 bg-gray-200 dark:bg-gray-800 rounded flex items-center justify-center text-[7px] font-bold text-gray-400 border border-dashed border-gray-400">
|
|
349
|
+
GIGW LOGO
|
|
350
|
+
</div>
|
|
351
|
+
</div>
|
|
352
|
+
</li>
|
|
353
|
+
)} */}
|
|
354
|
+
</ul>
|
|
355
|
+
</div>
|
|
356
|
+
{GeneralUtil.isTecho && (
|
|
357
|
+
<div className="flex flex-col items-center gap-1 flex-1">
|
|
358
|
+
<div className="flex flex-col md:flex-row justify-center items-center gap-x-6 opacity-80 pt-1"></div>
|
|
359
|
+
<p className="font-medium text-gray-600 dark:text-gray-400 m-0 leading-relaxed opacity-80">
|
|
360
|
+
© 2026 Government of Gujarat. All rights reserved.
|
|
361
|
+
</p>
|
|
362
|
+
</div>
|
|
363
|
+
)}
|
|
364
|
+
{/* Right Side: 1 Image and Icons */}
|
|
365
|
+
<div className="flex items-center gap-4">
|
|
366
|
+
{GeneralUtil.isTecho && (
|
|
367
|
+
<div className="flex items-center border-r border-gray-300 dark:border-gray-700 pr-3">
|
|
368
|
+
<CustomTooltip
|
|
369
|
+
title={
|
|
370
|
+
<p className="m-0 leading-relaxed font-medium ">
|
|
371
|
+
Best viewed in the latest versions of Google Chrome, Mozilla Firefox, and Microsoft Edge
|
|
372
|
+
with a screen resolution of 1280 × 720 or higher.
|
|
373
|
+
</p>
|
|
374
|
+
}
|
|
375
|
+
>
|
|
376
|
+
<IconButton
|
|
377
|
+
size="small"
|
|
378
|
+
sx={{
|
|
379
|
+
color: 'inherit',
|
|
380
|
+
opacity: 0.7,
|
|
381
|
+
p: 0.5,
|
|
382
|
+
transition: 'all 0.3s cubic-bezier(0.4, 0, 0.2, 1)',
|
|
383
|
+
'&:hover': {
|
|
384
|
+
opacity: 1,
|
|
385
|
+
transform: 'scale(1.2) translateY(-2px)',
|
|
386
|
+
color: theme.palette.primary.main,
|
|
387
|
+
filter: 'drop-shadow(0 0 8px rgba(0,0,0,0.1))',
|
|
388
|
+
},
|
|
389
|
+
}}
|
|
390
|
+
>
|
|
391
|
+
<FontAwesomeIcon icon={faGlobe} style={{ fontSize: 20 }} />
|
|
392
|
+
</IconButton>
|
|
393
|
+
</CustomTooltip>
|
|
394
|
+
<CustomTooltip
|
|
395
|
+
title={
|
|
396
|
+
<p className="m-0 leading-relaxed font-medium ">
|
|
397
|
+
This website is designed in accordance with W3C Web Content Accessibility Guidelines
|
|
398
|
+
(WCAG) 2.1.
|
|
399
|
+
</p>
|
|
400
|
+
}
|
|
401
|
+
>
|
|
402
|
+
<IconButton
|
|
403
|
+
size="small"
|
|
404
|
+
sx={{
|
|
405
|
+
color: 'inherit',
|
|
406
|
+
opacity: 0.7,
|
|
407
|
+
p: 0.5,
|
|
408
|
+
transition: 'all 0.3s cubic-bezier(0.4, 0, 0.2, 1)',
|
|
409
|
+
'&:hover': {
|
|
410
|
+
opacity: 1,
|
|
411
|
+
transform: 'scale(1.2) translateY(-2px)',
|
|
412
|
+
color: theme.palette.secondary.main,
|
|
413
|
+
filter: 'drop-shadow(0 0 8px rgba(0,0,0,0.1))',
|
|
414
|
+
},
|
|
415
|
+
}}
|
|
416
|
+
>
|
|
417
|
+
<FontAwesomeIcon icon={faUniversalAccess} style={{ fontSize: 20 }} />
|
|
418
|
+
</IconButton>
|
|
419
|
+
</CustomTooltip>
|
|
420
|
+
</div>
|
|
421
|
+
)}
|
|
422
|
+
<a href=" http://www.argusoft.com/" target="_blank" border="0" rel="noreferrer">
|
|
423
|
+
<img src={medplatLogo} alt="Argusoft Medplat" height="40" className="h-10 w-auto" />
|
|
424
|
+
</a>
|
|
425
|
+
</div>
|
|
426
|
+
</div>
|
|
427
|
+
</footer>
|
|
428
|
+
</>
|
|
429
|
+
)}
|
|
430
|
+
</Grid>
|
|
431
|
+
</Grid>
|
|
432
|
+
{GeneralUtil.isTecho && chatbotEnabled && <Chatbot />}
|
|
433
|
+
{showForcePasswordChange && (
|
|
434
|
+
<ChangePasswordModal
|
|
435
|
+
open={showForcePasswordChange}
|
|
436
|
+
onClose={() => setShowForcePasswordChange(false)}
|
|
437
|
+
userId={user?.id}
|
|
438
|
+
isFirstTime={!user?.firstTimePasswordChanged}
|
|
439
|
+
/>
|
|
440
|
+
)}
|
|
441
|
+
</Grid>
|
|
442
|
+
);
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
export default Layout;
|