From eff67dbe84625bef65d3337647f1c03ba8a6a849 Mon Sep 17 00:00:00 2001 From: Shailesh Pandey <110380977+shailesh-egov@users.noreply.github.com> Date: Tue, 17 Sep 2024 14:26:50 +0530 Subject: [PATCH 01/12] Added frontend basic code --- frontend/micro-ui/.gitignore | 32 + frontend/micro-ui/CODEOWNERS | 1 + frontend/micro-ui/Jenkinsfile | 3 + frontend/micro-ui/README.md | 140 ++ frontend/micro-ui/package.json | 4 + frontend/micro-ui/web/.babelrc | 4 + frontend/micro-ui/web/.env.sample | 3 + frontend/micro-ui/web/docker/Dockerfile | 25 + frontend/micro-ui/web/docker/nginx.conf | 12 + frontend/micro-ui/web/envs.js | 0 frontend/micro-ui/web/install-deps.sh | 14 + .../web/micro-ui-internals/.gitignore | 143 ++ .../web/micro-ui-internals/.prettierignore | 23 + .../web/micro-ui-internals/.prettierrc.json | 3 + .../micro-ui/web/micro-ui-internals/README.md | 100 + .../micro-ui/web/micro-ui-internals/clean.sh | 28 + .../web/micro-ui-internals/example/.env-selco | 7 + .../micro-ui-internals/example/package.json | 35 + .../example/public/index.html | 27 + .../example/src/UICustomizations.js | 651 ++++++ .../micro-ui-internals/example/src/index.js | 93 + .../example/src/setupProxy.js | 96 + .../web/micro-ui-internals/package.json | 63 + .../packages/config/index.js | 3 + .../packages/config/package.json | 6 + .../packages/css/CHANGELOG.md | 132 ++ .../micro-ui-internals/packages/css/README.md | 58 + .../packages/css/gulpfile.js | 71 + .../packages/css/img/browser-icon.png | Bin 0 -> 1121 bytes .../packages/css/img/m_seva_white_logo.png | Bin 0 -> 10689 bytes .../packages/css/img/mseva-demo.png | Bin 0 -> 2460 bytes .../packages/css/package.json | 65 + .../packages/css/postcss.config.js | 55 + .../css/src/components/CardBasedOptions.scss | 46 + .../css/src/components/CitizenHomeCard.scss | 56 + .../css/src/components/EllipsisMenu.scss | 17 + .../css/src/components/EventCalendarView.scss | 10 + .../packages/css/src/components/FAQ.scss | 64 + .../css/src/components/OnGroundEventCard.scss | 72 + .../css/src/components/PageBasedInput.scss | 29 + .../css/src/components/PopupHeadingLabel.scss | 15 + .../src/components/PropertySearchForm.scss | 58 + .../css/src/components/SearchForm.scss | 56 + .../src/components/SearchOnRadioButton.scss | 10 + .../src/components/StandaloneSearchBar.scss | 10 + .../packages/css/src/components/TimeLine.scss | 68 + .../css/src/components/WhatsNewCard.scss | 13 + .../css/src/components/actionLink.scss | 3 + .../css/src/components/actionbar.scss | 97 + .../css/src/components/bannercomponents.scss | 136 ++ .../packages/css/src/components/body.scss | 144 ++ .../packages/css/src/components/buttons.scss | 101 + .../packages/css/src/components/card.scss | 391 ++++ .../src/components/cardHeaderWithOptions.scss | 14 + .../css/src/components/changeLanguage.scss | 3 + .../packages/css/src/components/charts.scss | 186 ++ .../packages/css/src/components/checkbox.scss | 53 + .../css/src/components/checkpoint.scss | 63 + .../css/src/components/citizenInfoLabel.scss | 14 + .../css/src/components/custombtn.scss | 11 + .../css/src/components/datatable.scss | 134 ++ .../packages/css/src/components/datewrap.scss | 21 + .../css/src/components/detailscard.scss | 6 + .../css/src/components/detailscontainer.scss | 13 + .../packages/css/src/components/filters.scss | 98 + .../packages/css/src/components/grey.scss | 3 + .../css/src/components/hoc/InboxComposer.scss | 115 + .../css/src/components/hoc/index.scss | 1 + .../css/src/components/howItWorks.scss | 71 + .../css/src/components/imageviewer.scss | 33 + .../src/components/inboxv2/InboxLinks.scss | 59 + .../src/components/inboxv2/horizontalNav.scss | 224 ++ .../src/components/inboxv2/inboxSearch.scss | 116 + .../inboxv2/inboxSearchComposer.scss | 142 ++ .../css/src/components/inboxv2/index.scss | 5 + .../inboxv2/searchComponentTable.scss | 44 + .../css/src/components/info-banner.scss | 35 + .../packages/css/src/components/inputotp.scss | 15 + .../packages/css/src/components/keynote.scss | 27 + .../css/src/components/languageSelector.scss | 23 + .../packages/css/src/components/loader.scss | 96 + .../css/src/components/loaderWithGap.scss | 45 + .../packages/css/src/components/map.scss | 30 + .../packages/css/src/components/menu.scss | 0 .../css/src/components/metricsTable.scss | 28 + .../css/src/components/multiLink.scss | 88 + .../src/components/multiSelectDropdown.scss | 78 + .../packages/css/src/components/navbar.scss | 318 +++ .../css/src/components/plusMinus.scss | 15 + .../packages/css/src/components/popup.scss | 16 + .../packages/css/src/components/radiobtn.scss | 46 + .../css/src/components/ratingstar.scss | 33 + .../css/src/components/roundedLabel.scss | 10 + .../css/src/components/searchAction.scss | 20 + .../css/src/components/sectionalDropdown.scss | 43 + .../css/src/components/selectdropdown.scss | 175 ++ .../packages/css/src/components/sidebar.scss | 141 ++ .../src/components/staticDynamicMessages.scss | 107 + .../css/src/components/staticSideBar.scss | 27 + .../css/src/components/statushighlight.scss | 17 + .../css/src/components/submiterrors.scss | 11 + .../packages/css/src/components/summary.scss | 29 + .../packages/css/src/components/table.scss | 201 ++ .../packages/css/src/components/tag.scss | 27 + .../css/src/components/telephone.scss | 17 + .../css/src/components/textfields.scss | 96 + .../packages/css/src/components/toast.scss | 31 + .../css/src/components/toggleSwitch.scss | 41 + .../packages/css/src/components/topbar.scss | 153 ++ .../css/src/components/uploadcomponents.scss | 100 + .../src/digitv2/components/ErrorMessage.scss | 6 + .../digitv2/components/FormComposerV2.scss | 126 ++ .../src/digitv2/components/actionLinkV2.scss | 7 + .../src/digitv2/components/actionbarV2.scss | 110 + .../digitv2/components/appContainerV2.scss | 55 + .../src/digitv2/components/backButtonV2.scss | 26 + .../css/src/digitv2/components/bannerV2.scss | 120 + .../digitv2/components/bodyContainerV2.scss | 39 + .../src/digitv2/components/breadCrumbV2.scss | 31 + .../src/digitv2/components/breakLineV2.scss | 6 + .../css/src/digitv2/components/cardV2.scss | 385 ++++ .../src/digitv2/components/checkboxV2.scss | 61 + .../src/digitv2/components/checkpointV2.scss | 71 + .../components/collapseAndExpandGroups.scss | 60 + .../src/digitv2/components/dateWrapV2.scss | 12 + .../digitv2/components/displayPhotosV2.scss | 33 + .../css/src/digitv2/components/headerV2.scss | 6 + .../src/digitv2/components/infoBannerV2.scss | 37 + .../css/src/digitv2/components/keynoteV2.scss | 35 + .../css/src/digitv2/components/loaderV2.scss | 81 + .../digitv2/components/mobileNumberV2.scss | 33 + .../components/multiSelectDropdownV2.scss | 92 + .../digitv2/components/noresultsfoundV2.scss | 11 + .../src/digitv2/components/otpInputV2.scss | 15 + .../css/src/digitv2/components/popUpV2.scss | 24 + .../src/digitv2/components/radiobtnV2.scss | 51 + .../css/src/digitv2/components/ratingV2.scss | 33 + .../digitv2/components/selectdropdownV2.scss | 180 ++ .../css/src/digitv2/components/tagV2.scss | 28 + .../src/digitv2/components/telephoneV2.scss | 18 + .../src/digitv2/components/textInputV2.scss | 123 + .../src/digitv2/components/textareaV2.scss | 11 + .../src/digitv2/components/uploadFileV2.scss | 146 ++ .../packages/css/src/digitv2/index.scss | 167 ++ .../css/src/digitv2/pages/employee/index.scss | 1 + .../src/digitv2/pages/employee/workbench.scss | 1050 +++++++++ .../packages/css/src/digitv2/typography.scss | 241 ++ .../packages/css/src/index.scss | 847 +++++++ .../CitizenEngagementNotificationWrapper.scss | 8 + .../css/src/pages/citizen/DocumentList.scss | 305 +++ .../css/src/pages/citizen/Events.scss | 47 + .../src/pages/citizen/HomePageWrapper.scss | 158 ++ .../css/src/pages/citizen/SurveyList.scss | 22 + .../src/pages/citizen/citizenDocument.scss | 22 + .../css/src/pages/citizen/container.scss | 19 + .../pages/citizen/payment/payment-type.scss | 3 + .../pages/citizen/updatePropertyNumber.scss | 46 + .../css/src/pages/employee/EmployeeLogin.scss | 7 + .../css/src/pages/employee/cardfix.scss | 13 + .../css/src/pages/employee/container.scss | 72 + .../packages/css/src/pages/employee/dss.scss | 266 +++ .../css/src/pages/employee/form-fields.scss | 13 + .../css/src/pages/employee/iframe.scss | 66 + .../css/src/pages/employee/inbox.scss | 593 +++++ .../css/src/pages/employee/index.scss | 578 +++++ .../css/src/pages/employee/login.scss | 327 +++ .../src/pages/employee/oldMobileInbox.scss | 5 + .../css/src/pages/employee/popupmodule.scss | 34 + .../css/src/pages/employee/response.scss | 3 + .../css/src/pages/employee/scroll-table.scss | 119 + .../css/src/pages/employee/surveys.scss | 273 +++ .../css/src/pages/employee/tooltip.scss | 36 + .../css/src/pages/employee/updateNumber.scss | 13 + .../packages/css/src/pages/program.scss | 46 + .../packages/css/svg/arrowdown.svg | 1 + .../packages/css/svg/arrowleft.svg | 1 + .../packages/css/svg/calendar.svg | 1 + .../packages/css/svg/camera.svg | 4 + .../packages/css/svg/check.svg | 4 + .../packages/css/svg/close.svg | 4 + .../packages/css/svg/error.svg | 4 + .../packages/css/svg/error2.svg | 5 + .../packages/css/svg/searchicon.svg | 4 + .../packages/css/svg/starempty.svg | 4 + .../packages/css/svg/starfilled.svg | 5 + .../packages/css/svg/success.svg | 4 + .../packages/css/tailwind.config.js | 231 ++ .../packages/libraries/CHANGELOG.md | 19 + .../packages/libraries/README.md | 74 + .../packages/libraries/package.json | 50 + .../libraries/src/config/configUtils.js | 46 + .../packages/libraries/src/config/index.js | 31 + .../libraries/src/config/mergeConfig.js | 157 ++ .../packages/libraries/src/contexts/index.js | 6 + .../libraries/src/enums/ConfigActionTypes.js | 5 + .../libraries/src/enums/FormFields.js | 5 + .../packages/libraries/src/enums/Pages.js | 7 + .../packages/libraries/src/enums/index.js | 7 + .../src/hooks/dss/useDSSDashboard.js | 8 + .../src/hooks/dss/useDashboardConfig.js | 8 + .../libraries/src/hooks/dss/useGetChart.js | 56 + .../dss/useGetCustomFilterRequestValues.js | 8 + .../src/hooks/dss/useGetCustomFilterValues.js | 8 + .../libraries/src/hooks/dss/useMDMS.js | 20 + .../src/hooks/engagement/useCreate.js | 8 + .../src/hooks/engagement/useDelete.js | 8 + .../libraries/src/hooks/engagement/useMdms.js | 19 + .../src/hooks/engagement/useSearch.js | 8 + .../src/hooks/engagement/useUpdate.js | 8 + .../libraries/src/hooks/events/index.js | 185 ++ .../src/hooks/events/useCreateEvent.js | 7 + .../src/hooks/events/useEventDetails.js | 44 + .../src/hooks/events/useEventInbox.js | 23 + .../src/hooks/events/useUpdateEvent.js | 7 + .../libraries/src/hooks/hrms/useHRMSCount.js | 8 + .../libraries/src/hooks/hrms/useHRMSGender.js | 18 + .../src/hooks/hrms/useHRMSGenderMDMS.js | 18 + .../libraries/src/hooks/hrms/useHRMSMDMS.js | 25 + .../libraries/src/hooks/hrms/useHRMSUpdate.js | 8 + .../libraries/src/hooks/hrms/useHRMScreate.js | 8 + .../libraries/src/hooks/hrms/useHRMSsearch.js | 8 + .../packages/libraries/src/hooks/index.js | 216 ++ .../packages/libraries/src/hooks/payment.js | 160 ++ .../src/hooks/pgr/useComplaintDetails.js | 76 + .../src/hooks/pgr/useComplaintList.js | 12 + .../src/hooks/pgr/useComplaintStatus.js | 31 + .../hooks/pgr/useComplaintStatusWithCount.js | 27 + .../src/hooks/pgr/useComplaintSubType.js | 18 + .../src/hooks/pgr/useComplaintTable.js | 23 + .../src/hooks/pgr/useComplaintTypes.js | 20 + .../src/hooks/pgr/useEmployeeFilter.js | 35 + .../libraries/src/hooks/pgr/useInboxData.js | 61 + .../libraries/src/hooks/pgr/useLocalities.js | 34 + .../libraries/src/hooks/pgr/useServiceDefs.js | 23 + .../libraries/src/hooks/pgr/useTenants.js | 9 + .../libraries/src/hooks/revalidateQuery.js | 6 + .../packages/libraries/src/hooks/store.js | 19 + .../libraries/src/hooks/surveys/useCreate.js | 8 + .../libraries/src/hooks/surveys/useDelete.js | 8 + .../libraries/src/hooks/surveys/useSearch.js | 8 + .../src/hooks/surveys/useShowResults.js | 8 + .../src/hooks/surveys/useSubmitResponse.js | 8 + .../src/hooks/surveys/useSurveyInbox.js | 33 + .../libraries/src/hooks/surveys/useUpdate.js | 8 + .../libraries/src/hooks/useAccessControl.js | 13 + .../src/hooks/useApplicationForBillSearch.js | 37 + .../libraries/src/hooks/useClickOutside.js | 23 + .../libraries/src/hooks/useCustomAPIHook.js | 55 + .../src/hooks/useCustomAPIMutationHook.js | 68 + .../libraries/src/hooks/useCustomMDMS.js | 63 + .../libraries/src/hooks/useDocumentSearch.js | 47 + .../libraries/src/hooks/useDynamicData.js | 17 + .../libraries/src/hooks/useEmployeeSearch.js | 10 + .../libraries/src/hooks/useGenderMDMS.js | 18 + .../libraries/src/hooks/useGetDSSAboutJSON.js | 7 + .../libraries/src/hooks/useGetDSSFAQsJSON.js | 7 + .../libraries/src/hooks/useGetFAQsJSON.js | 7 + .../libraries/src/hooks/useHowItWorksJSON.js | 7 + .../packages/libraries/src/hooks/useInbox.js | 11 + .../src/hooks/useInboxGeneral/filterFn.js | 108 + .../src/hooks/useInboxGeneral/newFilterFn.js | 52 + .../src/hooks/useInboxGeneral/searchFields.js | 67 + .../hooks/useInboxGeneral/useInboxGeneral.js | 148 ++ .../src/hooks/useInboxGeneral/useNewInbox.js | 76 + .../libraries/src/hooks/useLocalities.js | 17 + .../libraries/src/hooks/useLocation.js | 15 + .../packages/libraries/src/hooks/useMDMS.js | 44 + .../libraries/src/hooks/useModuleTenants.js | 39 + .../libraries/src/hooks/usePrivacyContext.js | 18 + .../libraries/src/hooks/useQueryParams.js | 11 + .../src/hooks/useRouteSubscription.js | 17 + .../libraries/src/hooks/useSessionStorage.js | 30 + .../libraries/src/hooks/useStaticData.js | 7 + .../libraries/src/hooks/useStatusGeneral.js | 42 + .../packages/libraries/src/hooks/useStore.js | 11 + .../libraries/src/hooks/useTenants.js | 13 + .../libraries/src/hooks/useUpdateCustom.js | 17 + .../src/hooks/useWorkflowDetailsV2.js | 19 + .../libraries/src/hooks/userSearch.js | 8 + .../packages/libraries/src/hooks/workflow.js | 19 + .../packages/libraries/src/index.js | 91 + .../src/services/atoms/ApiCacheService.js | 75 + .../libraries/src/services/atoms/Download.js | 208 ++ .../src/services/atoms/JsDictionary.js | 24 + .../src/services/atoms/UploadServices.js | 51 + .../src/services/atoms/Utils/Date.js | 39 + .../src/services/atoms/Utils/ParsingUtils.js | 53 + .../src/services/atoms/Utils/Request.js | 212 ++ .../src/services/atoms/Utils/Storage.js | 55 + .../libraries/src/services/atoms/urls.js | 227 ++ .../libraries/src/services/elements/Access.js | 21 + .../ApplicationUpdateActionsCustom.js | 14 + .../libraries/src/services/elements/Bill.js | 34 + .../src/services/elements/Complaint.js | 87 + .../services/elements/ComponentRegistry.js | 19 + .../src/services/elements/CustomService.js | 18 + .../libraries/src/services/elements/DSS.js | 45 + .../src/services/elements/Engagement.js | 42 + .../libraries/src/services/elements/Events.js | 64 + .../libraries/src/services/elements/HRMS.js | 46 + .../src/services/elements/InboxService.js | 15 + .../src/services/elements/Localities.js | 25 + .../services/elements/Localization/service.js | 93 + .../src/services/elements/Location.js | 30 + .../libraries/src/services/elements/Login.js | 50 + .../libraries/src/services/elements/MDMS.js | 1730 ++++++++++++++ .../libraries/src/services/elements/PGR.js | 61 + .../src/services/elements/Payment.js | 143 ++ .../src/services/elements/Surveys.js | 61 + .../src/services/elements/UrlShortener.js | 15 + .../src/services/elements/User/index.js | 139 ++ .../src/services/elements/WorkFlow.js | 410 ++++ .../packages/libraries/src/services/index.js | 3 + .../molecules/DSS/getDSSDashboardData.js | 11 + .../services/molecules/ServiceDefinitions.js | 57 + .../src/services/molecules/ShareFiles.js | 75 + .../src/services/molecules/Store/service.js | 119 + .../src/services/molecules/StoreData.js | 8 + .../src/services/molecules/Ulb/index.js | 148 ++ .../src/services/molecules/getLocalities.js | 13 + .../packages/libraries/src/subFormRegistry.js | 43 + .../libraries/src/translations/index.js | 61 + .../packages/libraries/src/utils/browser.js | 35 + .../libraries/src/utils/componentRegistry.js | 23 + .../packages/libraries/src/utils/date.js | 56 + .../src/utils/dss/dynamicRequestGenerator.js | 101 + .../packages/libraries/src/utils/dss/index.js | 153 ++ .../packages/libraries/src/utils/fileType.js | 7 + .../packages/libraries/src/utils/fonts.js | 2 + .../packages/libraries/src/utils/fsm/index.js | 94 + .../packages/libraries/src/utils/index.js | 382 ++++ .../packages/libraries/src/utils/locale.js | 110 + .../libraries/src/utils/obps/index.js | 23 + .../packages/libraries/src/utils/pdf.js | 1083 +++++++++ .../src/utils/preProcessMDMSConfig.js | 128 ++ .../utils/preProcessMDMSConfigInboxSearch.js | 110 + .../packages/libraries/src/utils/privacy.js | 107 + .../packages/libraries/src/utils/pt/index.js | 65 + .../packages/modules/core/CHANGELOG.md | 201 ++ .../packages/modules/core/README.md | 101 + .../packages/modules/core/package.json | 37 + .../packages/modules/core/src/App.js | 59 + .../packages/modules/core/src/Module.js | 110 + .../modules/core/src/components/AppModules.js | 59 + .../modules/core/src/components/Background.js | 7 + .../modules/core/src/components/ChangeCity.js | 92 + .../core/src/components/ChangeLanguage.js | 51 + .../src/components/Dialog/LogoutDialog.js | 62 + .../core/src/components/ErrorBoundaries.js | 57 + .../core/src/components/ErrorComponent.js | 46 + .../modules/core/src/components/Header.js | 20 + .../modules/core/src/components/Home.js | 171 ++ .../core/src/components/PrivacyComponent.js | 156 ++ .../Search/MobileSearchApplication.js | 254 +++ .../src/components/Search/SearchFields.js | 27 + .../core/src/components/Search/index.js | 299 +++ .../TopBarSideBar/SideBar/CitizenSideBar.js | 301 +++ .../TopBarSideBar/SideBar/EmployeeSideBar.js | 153 ++ .../TopBarSideBar/SideBar/SideBar.js | 386 ++++ .../SideBar/StaticCitizenSideBar.js | 282 +++ .../TopBarSideBar/SideBar/SubMenu.js | 195 ++ .../components/TopBarSideBar/SideBar/index.js | 30 + .../src/components/TopBarSideBar/TopBar.js | 177 ++ .../src/components/TopBarSideBar/index.js | 81 + .../modules/core/src/components/utils.js | 22 + .../modules/core/src/context/index.js | 3 + .../modules/core/src/hooks/useInterval.js | 20 + .../employee/ChangePassword/changePassword.js | 168 ++ .../pages/employee/ChangePassword/config.js | 28 + .../pages/employee/ChangePassword/index.js | 33 + .../pages/employee/ForgotPassword/config.js | 23 + .../employee/ForgotPassword/forgotPassword.js | 144 ++ .../pages/employee/ForgotPassword/index.js | 33 + .../pages/employee/LanguageSelection/index.js | 64 + .../core/src/pages/employee/Login/config.js | 56 + .../core/src/pages/employee/Login/index.js | 63 + .../core/src/pages/employee/Login/login.js | 173 ++ .../modules/core/src/pages/employee/index.js | 136 ++ .../components/GoogleTranslateComponent.js | 33 + .../configs/IndividualCreateConfig.js | 113 + .../pages/individual/configs/schemeConfigs.js | 4 + .../core/src/pages/individual/index.js | 97 + .../core/src/pages/individual/pages/Enroll.js | 99 + .../src/pages/individual/pages/Program.js | 130 ++ .../src/pages/individual/pages/Programs.js | 75 + .../src/pages/individual/pages/Response.js | 57 + .../src/pages/individual/pages/ValidateOTP.js | 107 + .../core/src/pages/individual/pages/index.js | 71 + .../src/pages/individual/utils/createUtils.js | 55 + .../modules/core/src/redux/reducers/index.js | 8 + .../packages/modules/core/src/redux/store.js | 24 + .../react-components/.storybook/main.js | 4 + .../react-components/.storybook/preview.js | 9 + .../packages/react-components/CHANGELOG.md | 149 ++ .../packages/react-components/README.md | 161 ++ .../react-components/docker/Dockerfile | 21 + .../react-components/docker/nginx.conf | 12 + .../packages/react-components/envs.js | 0 .../packages/react-components/package.json | 89 + .../react-components/public/index.html | 28 + .../react-components/src/atoms/ActionBar.js | 11 + .../react-components/src/atoms/ActionLinks.js | 5 + .../react-components/src/atoms/Amount.js | 12 + .../src/atoms/AppContainer.js | 13 + .../src/atoms/ApplyFilterBar.js | 16 + .../react-components/src/atoms/BackButton.js | 16 + .../react-components/src/atoms/Banner.js | 82 + .../src/atoms/Banner.stories.js | 23 + .../react-components/src/atoms/Body.js | 7 + .../react-components/src/atoms/BreadCrumb.js | 43 + .../react-components/src/atoms/BreakLine.js | 7 + .../react-components/src/atoms/Button.js | 76 + .../src/atoms/ButtonSelector.js | 55 + .../src/atoms/ButtonSelector.stories.js | 24 + .../react-components/src/atoms/Card.js | 24 + .../src/atoms/CardBasedOptions.js | 28 + .../react-components/src/atoms/CardCaption.js | 11 + .../react-components/src/atoms/CardHeader.js | 7 + .../react-components/src/atoms/CardLabel.js | 11 + .../src/atoms/CardLabelDesc.js | 11 + .../src/atoms/CardLabelError.js | 11 + .../src/atoms/CardSectionHeader.js | 11 + .../src/atoms/CardSectionSubText.js | 11 + .../src/atoms/CardSubHeader.js | 16 + .../react-components/src/atoms/CardText.js | 11 + .../src/atoms/CardTextButton.js | 7 + .../react-components/src/atoms/CheckBox.js | 89 + .../src/atoms/CheckBox.stories.js | 16 + .../src/atoms/CitizenConsentForm.js | 71 + .../src/atoms/CitizenHomeCard.js | 26 + .../src/atoms/CitizenInfoLabel.js | 22 + .../react-components/src/atoms/CloseButton.js | 12 + .../src/atoms/CollapseAndExpandGroups.js | 46 + .../src/atoms/ConnectingCheckPoints.js | 59 + .../atoms/ConnectingCheckPoints.stories.js | 19 + .../src/atoms/CustomButton.js | 13 + .../react-components/src/atoms/DatePicker.js | 72 + .../react-components/src/atoms/DateWrap.js | 25 + .../src/atoms/DateWrap.stories.js | 19 + .../src/atoms/DescriptionText.js | 23 + .../src/atoms/DescriptionText.stories.js | 16 + .../src/atoms/DisplayPhotos.js | 43 + .../src/atoms/DisplayPhotos.stories.js | 20 + .../react-components/src/atoms/Dropdown.js | 293 +++ .../src/atoms/Dropdown.stories.js | 18 + .../src/atoms/EllipsisMenu.js | 33 + .../src/atoms/EmployeeAppContainer.js | 7 + .../src/atoms/EmployeeModuleCard.js | 85 + .../src/atoms/ErrorMessage.js | 25 + .../src/atoms/EventCalendarView.js | 14 + .../react-components/src/atoms/GreyOutText.js | 5 + .../react-components/src/atoms/Hamburger.js | 10 + .../react-components/src/atoms/Header.js | 11 + .../react-components/src/atoms/HeaderBar.js | 26 + .../src/atoms/HeaderBar.stories.js | 18 + .../react-components/src/atoms/HomeLink.js | 21 + .../src/atoms/HomeLink.stories.js | 22 + .../src/atoms/HorizontalNav.js | 42 + .../src/atoms/HorizontalNavV2.js | 56 + .../src/atoms/ImageUploadHandler.js | 112 + .../react-components/src/atoms/ImageViewer.js | 24 + .../src/atoms/ImageViewer.stories.js | 21 + .../react-components/src/atoms/InboxLinks.js | 33 + .../src/atoms/InboxSearchLinks.js | 42 + .../react-components/src/atoms/InfoBanner.js | 16 + .../src/atoms/InputTextAmount.js | 408 ++++ .../react-components/src/atoms/KeyNote.js | 38 + .../src/atoms/KeyNote.stories.js | 17 + .../react-components/src/atoms/Label.js | 7 + .../src/atoms/LabelFieldPair.js | 11 + .../react-components/src/atoms/LinkButton.js | 25 + .../src/atoms/LinkButton.stories.js | 16 + .../react-components/src/atoms/LinkLabel.js | 11 + .../react-components/src/atoms/Loader.js | 23 + .../src/atoms/Loader.stories.js | 20 + .../src/atoms/LoaderWithGap.js | 28 + .../src/atoms/LocationSearch.js | 394 ++++ .../react-components/src/atoms/Menu.js | 30 + .../src/atoms/Menu.stories.js | 15 + .../src/atoms/MobileNumber.js | 67 + .../src/atoms/Modals/WorkflowPopup.js | 112 + .../Modals/config/configEstimateModal.js | 400 ++++ .../src/atoms/Modals/index.js | 13 + .../react-components/src/atoms/MultiLink.js | 45 + .../src/atoms/MultiSelectDropdown.js | 141 ++ .../react-components/src/atoms/NavBar.js | 194 ++ .../src/atoms/NoResultsFound.js | 15 + .../react-components/src/atoms/OTPInput.js | 98 + .../src/atoms/OTPInput.stories.js | 16 + .../src/atoms/OpenLinkContainer.js | 29 + .../react-components/src/atoms/Paragraph.js | 11 + .../react-components/src/atoms/PopUp.js | 7 + .../src/atoms/PopupHeadingLabel.js | 20 + .../src/atoms/PrivateRoute.js | 29 + .../src/atoms/RadioButtons.js | 91 + .../src/atoms/RadioButtons.stories.js | 19 + .../react-components/src/atoms/Rating.js | 45 + .../src/atoms/Rating.stories.js | 18 + .../react-components/src/atoms/Reason.js | 29 + .../src/atoms/RemovableTagNew.js | 14 + .../src/atoms/RemoveableTag.js | 13 + .../src/atoms/RoundedLabel.js | 5 + .../react-components/src/atoms/SVG.js | 1561 +++++++++++++ .../src/atoms/SearchComponent.js | 267 +++ .../src/atoms/SearchableDropdown.js | 312 +++ .../src/atoms/SectionalDropdown.js | 90 + .../src/atoms/StandaloneSearchBar.js | 10 + .../react-components/src/atoms/StatusTable.js | 108 + .../react-components/src/atoms/SubMenu.js | 105 + .../react-components/src/atoms/SubmitBar.js | 46 + .../src/atoms/SubmitBar.stories.js | 28 + .../react-components/src/atoms/TLCaption.js | 40 + .../react-components/src/atoms/Table.js | 281 +++ .../react-components/src/atoms/TelePhone.js | 27 + .../src/atoms/TelePhone.stories.js | 16 + .../react-components/src/atoms/TextArea.js | 45 + .../src/atoms/TextArea.stories.js | 18 + .../react-components/src/atoms/TextInput.js | 152 ++ .../src/atoms/TextInput.stories.js | 19 + .../react-components/src/atoms/Toast.js | 64 + .../src/atoms/Toast.stories.js | 16 + .../src/atoms/ToggleSwitch.js | 37 + .../react-components/src/atoms/TopBar.js | 72 + .../src/atoms/TopBar.stories.js | 16 + .../react-components/src/atoms/ULBHomeCard.js | 38 + .../src/atoms/UnMaskComponent.js | 52 + .../react-components/src/atoms/UploadFile.js | 258 +++ .../src/atoms/UploadImages.js | 50 + .../src/atoms/UploadImages.stories.js | 21 + .../src/atoms/ViewDetailsCard.js | 31 + .../react-components/src/atoms/ViewImages.js | 53 + .../react-components/src/atoms/WeekPicker.js | 12 + .../src/atoms/WhatsNewCard.js | 20 + .../src/atoms/WorkflowActions.js | 212 ++ .../src/atoms/WorkflowTimeline.js | 133 ++ .../react-components/src/atoms/XlsPreview.js | 105 + .../src/atoms/amtUtils/index.js | 414 ++++ .../react-components/src/atoms/svgindex.js | 1993 +++++++++++++++++ .../react-components/src/context/index.js | 1 + .../src/hoc/FileUploadModal.js | 78 + .../react-components/src/hoc/FormComposer.js | 646 ++++++ .../src/hoc/FormComposerV2.js | 894 ++++++++ .../InboxComposer/MobileComponentDirectory.js | 59 + .../src/hoc/InboxComposer/index.js | 297 +++ .../src/hoc/InboxSearchComposer.js | 331 +++ .../src/hoc/InboxSearchComposerContext.js | 4 + .../src/hoc/InboxSearchComposerReducer.js | 103 + .../src/hoc/InboxSearchComposerV2.js | 389 ++++ .../hoc/MobileView/MobileSearchComponent.js | 236 ++ .../src/hoc/MobileView/MobileSearchResults.js | 193 ++ .../hoc/MobileView/MobileSearchResultsv1.js | 106 + .../react-components/src/hoc/Modal.js | 63 + .../react-components/src/hoc/RemovableTags.js | 186 ++ .../src/hoc/ResponseComposer.js | 61 + .../react-components/src/hoc/ResultsTable.js | 240 ++ .../src/hoc/SubformComposer.js | 38 + .../react-components/src/hoc/Tutorial/Help.js | 16 + .../src/hoc/Tutorial/Readme.md | 49 + .../src/hoc/Tutorial/TourProvider.js | 22 + .../src/hoc/Tutorial/Tutorial.js | 62 + .../src/hoc/UploadFileComposer.js | 154 ++ .../src/hoc/ViewComposer/Readme.md | 126 ++ .../src/hoc/ViewComposer/index.js | 209 ++ .../src/hoc/ViewComposer/renderUtils.js | 154 ++ .../react-components/src/hoc/formUtils.js | 26 + .../packages/react-components/src/index.js | 601 +++++ .../src/molecules/ApiCheckboxes.js | 46 + .../src/molecules/ApiDropdown.js | 74 + .../src/molecules/CityMohalla.js | 76 + .../src/molecules/CityMohalla.stories.js | 26 + .../src/molecules/CustomDropdown.js | 182 ++ .../src/molecules/DashboardBox.js | 68 + .../src/molecules/DateRange.js | 171 ++ .../src/molecules/DateRangeNew.js | 171 ++ .../src/molecules/DetailsCard.js | 143 ++ .../src/molecules/DetailsCard.stories.js | 16 + .../src/molecules/FilterAction.js | 12 + .../src/molecules/FilterForm.js | 74 + .../src/molecules/FormStep.js | 110 + .../src/molecules/FormStep.stories.js | 18 + .../src/molecules/InputCard.js | 60 + .../src/molecules/InputCard.stories.js | 22 + .../src/molecules/Localities.js | 29 + .../src/molecules/LocationDropdownWrapper.js | 97 + .../src/molecules/LocationSearchCard.js | 107 + .../molecules/LocationSearchCard.stories.js | 20 + .../src/molecules/MultiUploadWrapper.js | 144 ++ .../src/molecules/OnGroundEventCard.js | 28 + .../src/molecules/PageBasedInput.js | 19 + .../src/molecules/PitDimension.js | 52 + .../src/molecules/RadioOrSelect.js | 55 + .../src/molecules/RatingCard.js | 108 + .../src/molecules/RatingCard.stories.js | 37 + .../src/molecules/RenderFormFields.js | 389 ++++ .../src/molecules/SearchAction.js | 10 + .../src/molecules/SearchForm.js | 44 + .../src/molecules/SearchOnRadioButtons.js | 27 + .../src/molecules/SortAction.js | 12 + .../src/molecules/TextInputCard.js | 58 + .../src/molecules/TextInputCard.stories.js | 23 + .../src/molecules/TypeSelectCard.js | 50 + .../src/molecules/TypeSelectCard.stories.js | 22 + .../src/molecules/UploadPitPhoto.js | 146 ++ .../src/molecules/WorkflowModal.js | 52 + .../src/molecules/WorkflowStatusFilter.js | 57 + .../react-components/src/stories/Button.js | 50 + .../src/stories/Button.stories.js | 36 + .../react-components/src/stories/Header.js | 43 + .../src/stories/Header.stories.js | 18 + .../src/stories/Introduction.stories.mdx | 207 ++ .../react-components/src/stories/Page.js | 64 + .../src/stories/Page.stories.js | 21 + .../src/stories/assets/code-brackets.svg | 1 + .../src/stories/assets/colors.svg | 1 + .../src/stories/assets/comments.svg | 1 + .../src/stories/assets/direction.svg | 1 + .../src/stories/assets/flow.svg | 1 + .../src/stories/assets/plugin.svg | 1 + .../src/stories/assets/repo.svg | 1 + .../src/stories/assets/stackalt.svg | 1 + .../react-components/src/stories/button.css | 30 + .../react-components/src/stories/header.css | 26 + .../react-components/src/stories/page.css | 69 + .../web/micro-ui-internals/publish.sh | 55 + .../web/micro-ui-internals/scripts/create.sh | 3 + .../web/micro-ui-internals/scripts/deploy.sh | 8 + .../web/micro-ui-internals/scripts/jenkins.sh | 3 + .../web/micro-ui-internals/scripts/run.sh | 32 + .../micro-ui/web/micro-ui-internals/test.js | 30 + frontend/micro-ui/web/package.json | 85 + frontend/micro-ui/web/public/index.html | 36 + frontend/micro-ui/web/public/robots.txt | 3 + frontend/micro-ui/web/src/App.js | 63 + .../micro-ui/web/src/ComponentRegistry.js | 11 + .../src/Customisations/UICustomizations.js | 651 ++++++ .../micro-ui/web/src/Customisations/index.js | 19 + .../web/src/Customisations/pt/index.js | 13 + .../pt/pageComponents/PTAllotmentDetails.js | 64 + .../pt/pageComponents/PTBusinessDetails.js | 68 + .../pt/pageComponents/PTVasikaDetails.js | 79 + .../pt/pageComponents/PropertyUsageType.js | 134 ++ .../src/Customisations/tl/TLCustomisation.js | 5 + .../web/src/Customisations/tl/index.js | 7 + .../tl/pageComponents/PropertyUsageType.js | 136 ++ frontend/micro-ui/web/src/index.css | 0 frontend/micro-ui/web/src/index.js | 62 + frontend/micro-ui/web/src/setupProxy.js | 30 + frontend/micro-ui/web/webpack.config.js | 50 + 648 files changed, 52177 insertions(+) create mode 100644 frontend/micro-ui/.gitignore create mode 100644 frontend/micro-ui/CODEOWNERS create mode 100644 frontend/micro-ui/Jenkinsfile create mode 100644 frontend/micro-ui/README.md create mode 100644 frontend/micro-ui/package.json create mode 100644 frontend/micro-ui/web/.babelrc create mode 100644 frontend/micro-ui/web/.env.sample create mode 100644 frontend/micro-ui/web/docker/Dockerfile create mode 100644 frontend/micro-ui/web/docker/nginx.conf create mode 100644 frontend/micro-ui/web/envs.js create mode 100644 frontend/micro-ui/web/install-deps.sh create mode 100644 frontend/micro-ui/web/micro-ui-internals/.gitignore create mode 100644 frontend/micro-ui/web/micro-ui-internals/.prettierignore create mode 100644 frontend/micro-ui/web/micro-ui-internals/.prettierrc.json create mode 100644 frontend/micro-ui/web/micro-ui-internals/README.md create mode 100644 frontend/micro-ui/web/micro-ui-internals/clean.sh create mode 100644 frontend/micro-ui/web/micro-ui-internals/example/.env-selco create mode 100644 frontend/micro-ui/web/micro-ui-internals/example/package.json create mode 100644 frontend/micro-ui/web/micro-ui-internals/example/public/index.html create mode 100644 frontend/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/example/src/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/example/src/setupProxy.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/package.json create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/config/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/config/package.json create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/CHANGELOG.md create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/README.md create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/gulpfile.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/img/browser-icon.png create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/img/m_seva_white_logo.png create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/img/mseva-demo.png create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/package.json create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/postcss.config.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/CardBasedOptions.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/CitizenHomeCard.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/EllipsisMenu.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/EventCalendarView.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/FAQ.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/OnGroundEventCard.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/PageBasedInput.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/PopupHeadingLabel.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/PropertySearchForm.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/SearchForm.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/SearchOnRadioButton.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/StandaloneSearchBar.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/TimeLine.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/WhatsNewCard.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/actionLink.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/actionbar.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/bannercomponents.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/body.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/buttons.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/card.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/cardHeaderWithOptions.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/changeLanguage.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/charts.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/checkbox.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/checkpoint.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/citizenInfoLabel.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/custombtn.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/datatable.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/datewrap.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/detailscard.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/detailscontainer.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/filters.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/grey.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/hoc/InboxComposer.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/hoc/index.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/howItWorks.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/imageviewer.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/InboxLinks.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/horizontalNav.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/inboxSearch.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/inboxSearchComposer.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/index.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/searchComponentTable.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/info-banner.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inputotp.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/keynote.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/languageSelector.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/loader.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/loaderWithGap.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/map.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/menu.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/metricsTable.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/multiLink.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/multiSelectDropdown.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/navbar.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/plusMinus.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/popup.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/radiobtn.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/ratingstar.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/roundedLabel.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/searchAction.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/sectionalDropdown.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/selectdropdown.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/sidebar.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/staticDynamicMessages.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/staticSideBar.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/statushighlight.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/submiterrors.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/summary.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/table.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/tag.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/telephone.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/textfields.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/toast.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/toggleSwitch.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/topbar.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/uploadcomponents.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/ErrorMessage.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/FormComposerV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/actionLinkV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/actionbarV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/appContainerV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/backButtonV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/bannerV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/bodyContainerV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/breadCrumbV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/breakLineV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/cardV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/checkboxV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/checkpointV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/collapseAndExpandGroups.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/dateWrapV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/displayPhotosV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/headerV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/infoBannerV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/keynoteV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/loaderV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/mobileNumberV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/multiSelectDropdownV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/noresultsfoundV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/otpInputV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/popUpV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/radiobtnV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/ratingV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/selectdropdownV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/tagV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/telephoneV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/textInputV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/textareaV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/uploadFileV2.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/index.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/pages/employee/index.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/pages/employee/workbench.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/typography.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/index.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/CitizenEngagementNotificationWrapper.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/DocumentList.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/Events.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/HomePageWrapper.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/SurveyList.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/citizenDocument.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/container.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/payment/payment-type.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/updatePropertyNumber.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/EmployeeLogin.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/cardfix.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/container.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/dss.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/form-fields.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/iframe.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/inbox.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/login.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/oldMobileInbox.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/popupmodule.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/response.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/scroll-table.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/surveys.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/tooltip.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/updateNumber.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/program.scss create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/svg/arrowdown.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/svg/arrowleft.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/svg/calendar.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/svg/camera.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/svg/check.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/svg/close.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/svg/error.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/svg/error2.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/svg/searchicon.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/svg/starempty.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/svg/starfilled.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/svg/success.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/css/tailwind.config.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/CHANGELOG.md create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/README.md create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/package.json create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/config/configUtils.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/config/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/config/mergeConfig.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/contexts/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/enums/ConfigActionTypes.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/enums/FormFields.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/enums/Pages.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/enums/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useDSSDashboard.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useDashboardConfig.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetChart.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetCustomFilterRequestValues.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetCustomFilterValues.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useMDMS.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useCreate.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useDelete.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useMdms.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useSearch.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useUpdate.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useCreateEvent.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useEventDetails.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useEventInbox.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useUpdateEvent.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSCount.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSGender.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSGenderMDMS.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSMDMS.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSUpdate.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMScreate.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSsearch.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/payment.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintDetails.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintList.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintStatus.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintStatusWithCount.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintSubType.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintTable.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintTypes.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useEmployeeFilter.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useInboxData.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useLocalities.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useServiceDefs.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useTenants.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/revalidateQuery.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/store.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useCreate.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useDelete.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSearch.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useShowResults.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSubmitResponse.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSurveyInbox.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useUpdate.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useAccessControl.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useApplicationForBillSearch.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useClickOutside.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomAPIHook.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomAPIMutationHook.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomMDMS.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useDocumentSearch.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useDynamicData.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useEmployeeSearch.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGenderMDMS.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetDSSAboutJSON.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetDSSFAQsJSON.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetFAQsJSON.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useHowItWorksJSON.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInbox.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/filterFn.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/newFilterFn.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/searchFields.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/useInboxGeneral.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/useNewInbox.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useLocalities.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useLocation.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useMDMS.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useModuleTenants.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/usePrivacyContext.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useQueryParams.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useRouteSubscription.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useSessionStorage.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStaticData.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStatusGeneral.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStore.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useTenants.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useUpdateCustom.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useWorkflowDetailsV2.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/userSearch.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/workflow.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/ApiCacheService.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Download.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/JsDictionary.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/UploadServices.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Date.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/ParsingUtils.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Request.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Storage.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/urls.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Access.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/ApplicationUpdateActionsCustom.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Bill.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Complaint.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/ComponentRegistry.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/CustomService.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/DSS.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Engagement.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Events.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/HRMS.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/InboxService.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Localities.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Localization/service.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Location.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Login.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMS.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/PGR.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Payment.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Surveys.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/UrlShortener.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/User/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/WorkFlow.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/DSS/getDSSDashboardData.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ServiceDefinitions.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ShareFiles.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/StoreData.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Ulb/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/getLocalities.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/subFormRegistry.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/translations/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/browser.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/componentRegistry.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/date.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/dss/dynamicRequestGenerator.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/dss/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/fileType.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/fonts.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/fsm/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/locale.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/obps/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/pdf.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/preProcessMDMSConfig.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/preProcessMDMSConfigInboxSearch.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/privacy.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/pt/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/CHANGELOG.md create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/README.md create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/package.json create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/App.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/Module.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/AppModules.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Background.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeCity.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeLanguage.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Dialog/LogoutDialog.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ErrorBoundaries.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ErrorComponent.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Header.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Home.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/PrivacyComponent.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Search/MobileSearchApplication.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Search/SearchFields.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Search/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/CitizenSideBar.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/EmployeeSideBar.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/SideBar.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/SubMenu.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/utils.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/context/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/hooks/useInterval.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/config.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/config.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/LanguageSelection/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/config.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/individual/components/GoogleTranslateComponent.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/individual/configs/IndividualCreateConfig.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/individual/configs/schemeConfigs.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/individual/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/individual/pages/Enroll.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/individual/pages/Program.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/individual/pages/Programs.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/individual/pages/Response.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/individual/pages/ValidateOTP.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/individual/pages/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/individual/utils/createUtils.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/redux/reducers/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/redux/store.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/.storybook/main.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/.storybook/preview.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/CHANGELOG.md create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/README.md create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/docker/Dockerfile create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/docker/nginx.conf create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/envs.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/package.json create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/public/index.html create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/ActionBar.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/ActionLinks.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Amount.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/AppContainer.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/ApplyFilterBar.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/BackButton.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Banner.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Banner.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Body.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/BreadCrumb.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/BreakLine.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Button.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/ButtonSelector.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/ButtonSelector.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Card.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CardBasedOptions.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CardCaption.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CardHeader.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CardLabel.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CardLabelDesc.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CardLabelError.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CardSectionHeader.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CardSectionSubText.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CardSubHeader.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CardText.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CardTextButton.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CheckBox.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CheckBox.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CitizenConsentForm.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CitizenHomeCard.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CitizenInfoLabel.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CloseButton.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CollapseAndExpandGroups.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/ConnectingCheckPoints.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/ConnectingCheckPoints.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CustomButton.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/DatePicker.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/DateWrap.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/DateWrap.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/DescriptionText.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/DescriptionText.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/DisplayPhotos.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/DisplayPhotos.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Dropdown.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Dropdown.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/EllipsisMenu.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/EmployeeAppContainer.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/EmployeeModuleCard.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/ErrorMessage.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/EventCalendarView.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/GreyOutText.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Hamburger.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Header.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/HeaderBar.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/HeaderBar.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/HomeLink.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/HomeLink.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/HorizontalNav.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/HorizontalNavV2.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/ImageUploadHandler.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/ImageViewer.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/ImageViewer.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/InboxLinks.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/InboxSearchLinks.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/InfoBanner.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/InputTextAmount.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/KeyNote.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/KeyNote.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Label.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/LabelFieldPair.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/LinkButton.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/LinkButton.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/LinkLabel.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Loader.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Loader.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/LoaderWithGap.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/LocationSearch.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Menu.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Menu.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/MobileNumber.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Modals/WorkflowPopup.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Modals/config/configEstimateModal.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Modals/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/MultiLink.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/MultiSelectDropdown.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/NavBar.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/NoResultsFound.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/OTPInput.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/OTPInput.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/OpenLinkContainer.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Paragraph.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/PopUp.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/PopupHeadingLabel.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/PrivateRoute.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/RadioButtons.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/RadioButtons.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Rating.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Rating.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Reason.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/RemovableTagNew.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/RemoveableTag.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/RoundedLabel.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/SVG.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/SearchComponent.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/SearchableDropdown.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/SectionalDropdown.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/StandaloneSearchBar.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/StatusTable.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/SubMenu.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/SubmitBar.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/SubmitBar.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TLCaption.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Table.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TelePhone.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TelePhone.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextArea.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextArea.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextInput.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextInput.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Toast.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Toast.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/ToggleSwitch.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TopBar.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TopBar.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/ULBHomeCard.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/UnMaskComponent.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/UploadFile.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/UploadImages.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/UploadImages.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/ViewDetailsCard.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/ViewImages.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/WeekPicker.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/WhatsNewCard.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/WorkflowActions.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/WorkflowTimeline.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/XlsPreview.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/amtUtils/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/svgindex.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/context/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/FileUploadModal.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/FormComposer.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/FormComposerV2.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/InboxComposer/MobileComponentDirectory.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/InboxComposer/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/InboxSearchComposer.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/InboxSearchComposerContext.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/InboxSearchComposerReducer.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/InboxSearchComposerV2.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/MobileView/MobileSearchComponent.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/MobileView/MobileSearchResults.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/MobileView/MobileSearchResultsv1.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/Modal.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/RemovableTags.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/ResponseComposer.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/ResultsTable.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/SubformComposer.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/Tutorial/Help.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/Tutorial/Readme.md create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/Tutorial/TourProvider.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/Tutorial/Tutorial.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/UploadFileComposer.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/ViewComposer/Readme.md create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/ViewComposer/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/ViewComposer/renderUtils.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/formUtils.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/index.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/ApiCheckboxes.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/ApiDropdown.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/CityMohalla.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/CityMohalla.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/CustomDropdown.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/DashboardBox.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/DateRange.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/DateRangeNew.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/DetailsCard.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/DetailsCard.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/FilterAction.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/FilterForm.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/FormStep.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/FormStep.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/InputCard.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/InputCard.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/Localities.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/LocationDropdownWrapper.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/LocationSearchCard.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/LocationSearchCard.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/MultiUploadWrapper.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/OnGroundEventCard.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/PageBasedInput.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/PitDimension.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/RadioOrSelect.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/RatingCard.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/RatingCard.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/RenderFormFields.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/SearchAction.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/SearchForm.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/SearchOnRadioButtons.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/SortAction.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/TextInputCard.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/TextInputCard.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/TypeSelectCard.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/TypeSelectCard.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/UploadPitPhoto.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/WorkflowModal.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/WorkflowStatusFilter.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/Button.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/Button.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/Header.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/Header.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/Introduction.stories.mdx create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/Page.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/Page.stories.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/assets/code-brackets.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/assets/colors.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/assets/comments.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/assets/direction.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/assets/flow.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/assets/plugin.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/assets/repo.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/assets/stackalt.svg create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/button.css create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/header.css create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/stories/page.css create mode 100644 frontend/micro-ui/web/micro-ui-internals/publish.sh create mode 100644 frontend/micro-ui/web/micro-ui-internals/scripts/create.sh create mode 100644 frontend/micro-ui/web/micro-ui-internals/scripts/deploy.sh create mode 100644 frontend/micro-ui/web/micro-ui-internals/scripts/jenkins.sh create mode 100644 frontend/micro-ui/web/micro-ui-internals/scripts/run.sh create mode 100644 frontend/micro-ui/web/micro-ui-internals/test.js create mode 100644 frontend/micro-ui/web/package.json create mode 100644 frontend/micro-ui/web/public/index.html create mode 100644 frontend/micro-ui/web/public/robots.txt create mode 100644 frontend/micro-ui/web/src/App.js create mode 100644 frontend/micro-ui/web/src/ComponentRegistry.js create mode 100644 frontend/micro-ui/web/src/Customisations/UICustomizations.js create mode 100644 frontend/micro-ui/web/src/Customisations/index.js create mode 100644 frontend/micro-ui/web/src/Customisations/pt/index.js create mode 100644 frontend/micro-ui/web/src/Customisations/pt/pageComponents/PTAllotmentDetails.js create mode 100644 frontend/micro-ui/web/src/Customisations/pt/pageComponents/PTBusinessDetails.js create mode 100644 frontend/micro-ui/web/src/Customisations/pt/pageComponents/PTVasikaDetails.js create mode 100644 frontend/micro-ui/web/src/Customisations/pt/pageComponents/PropertyUsageType.js create mode 100644 frontend/micro-ui/web/src/Customisations/tl/TLCustomisation.js create mode 100644 frontend/micro-ui/web/src/Customisations/tl/index.js create mode 100644 frontend/micro-ui/web/src/Customisations/tl/pageComponents/PropertyUsageType.js create mode 100644 frontend/micro-ui/web/src/index.css create mode 100644 frontend/micro-ui/web/src/index.js create mode 100644 frontend/micro-ui/web/src/setupProxy.js create mode 100644 frontend/micro-ui/web/webpack.config.js diff --git a/frontend/micro-ui/.gitignore b/frontend/micro-ui/.gitignore new file mode 100644 index 0000000..feb4cac --- /dev/null +++ b/frontend/micro-ui/.gitignore @@ -0,0 +1,32 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +.env +.eslintcache + +# yarn $ +.yarn +yarn.lock +.yarnrc.yml + +# dependencies +node_modules +.yarn +/.pnp +.pnp.js + +# testing +/coverage + +# production +/web/build +dist +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/frontend/micro-ui/CODEOWNERS b/frontend/micro-ui/CODEOWNERS new file mode 100644 index 0000000..ee47f94 --- /dev/null +++ b/frontend/micro-ui/CODEOWNERS @@ -0,0 +1 @@ +* @jagankumar-egov @sathishp-eGov diff --git a/frontend/micro-ui/Jenkinsfile b/frontend/micro-ui/Jenkinsfile new file mode 100644 index 0000000..1206b9c --- /dev/null +++ b/frontend/micro-ui/Jenkinsfile @@ -0,0 +1,3 @@ +library 'ci-libs' + +buildPipeline(configFile: './build/build-config.yml') diff --git a/frontend/micro-ui/README.md b/frontend/micro-ui/README.md new file mode 100644 index 0000000..9420dbb --- /dev/null +++ b/frontend/micro-ui/README.md @@ -0,0 +1,140 @@ + +# workbench ui + +A React App built on top of DIGIT UI Core. + +# DIGIT + +DIGIT eGovernance Platform Services + +DIGIT (Digital Infrastructure for Governance, Impact & Transformation) is India's largest platform for governance services. Visit https://core.digit.org/ for more details. + +DIGIT platform is microservices based API platform enabling quick rebundling of services as per specific needs. This is a repo that lays down the core platform on top of which other mission services depend. + + +# DIGIT UI + + +This repository contains source code for web implementation of the new Digit UI modules with dependencies and libraries. + +Workbench module is used to Manage the master data (MDMS V2 Service) used across the DIGIT Services / Applications + +It is also used to manage the Localisation data present in the system (Localisation service) + + +## Run Locally + +Clone the project + +```bash + git clone https://github.com/egovernments/DIGIT-Frontend.git +``` + +Go to the Sub directory to run UI +```bash + cd into micro-ui/web/micro-ui-internals +``` + +Install dependencies + +```bash + yarn install +``` + +Add .env file +```bash + micro-ui/web/micro-ui-internals/example/.env +``` + +Start the server + +```bash + yarn start +``` + + +## Environment Variables + +To run this project, you will need to add the following environment variables to your .env file + +`REACT_APP_PROXY_API` :: `{{server url}}` + +`REACT_APP_GLOBAL` :: `{{server url}}` + +`REACT_APP_PROXY_ASSETS` :: `{{server url}}` + +`REACT_APP_USER_TYPE` :: `{{EMPLOYEE||CITIZEN}}` + +`SKIP_PREFLIGHT_CHECK` :: `true` + +[sample .env file](https://github.com/egovernments/Digit-Core/blob/workbench/frontend/micro-ui/web/micro-ui-internals/example/.env-unifieddev) + +## Tech Stack + +**Libraries:** + +[React](https://react.dev/) + +[React Hook Form](https://www.react-hook-form.com/) + +[React Query](https://tanstack.com/query/v3/) + +[Tailwind CSS](https://tailwindcss.com/) + +[Webpack](https://webpack.js.org/) + +## License + +[MIT](https://choosealicense.com/licenses/mit/) + + +## Author + +- [@jagankumar-egov](https://www.github.com/jagankumar-egov) + + +## Documentation + +[Documentation](https://https://core.digit.org/guides/developer-guide/ui-developer-guide/digit-ui) + + +## Support + +For support, add the issues in https://github.com/egovernments/DIGIT-core/issues. + + +## Modules + + 1. Core + 2. Workbench + 3. HRMS + 4. Dashboard + 5. Engagement + 6. Payment + +## Starting with Digit-UI App (Impelmentation Teams) - MICRO-UI + + +Go to the Sub directory to run UI + +```bash + cd into micro-ui/web +``` + +```bash + yarn install +``` + +Add .env file +```bash + micro-ui/web/.env +``` + +Start the server + +```bash + yarn start +``` + + +![Logo](https://s3.ap-south-1.amazonaws.com/works-dev-asset/mseva-white-logo.png) diff --git a/frontend/micro-ui/package.json b/frontend/micro-ui/package.json new file mode 100644 index 0000000..19a3c47 --- /dev/null +++ b/frontend/micro-ui/package.json @@ -0,0 +1,4 @@ +{ + "name": "workbench-ui", + "version": "1.0.0" +} \ No newline at end of file diff --git a/frontend/micro-ui/web/.babelrc b/frontend/micro-ui/web/.babelrc new file mode 100644 index 0000000..e9c2800 --- /dev/null +++ b/frontend/micro-ui/web/.babelrc @@ -0,0 +1,4 @@ +{ + "presets": ["@babel/preset-env", "@babel/preset-react"], + "plugins": ["@babel/plugin-proposal-optional-chaining"] +} \ No newline at end of file diff --git a/frontend/micro-ui/web/.env.sample b/frontend/micro-ui/web/.env.sample new file mode 100644 index 0000000..e87c7f5 --- /dev/null +++ b/frontend/micro-ui/web/.env.sample @@ -0,0 +1,3 @@ +SKIP_PREFLIGHT_CHECK=true +REACT_APP_STATE_LEVEL_TENANT_ID=pb +REACT_APP_PROXY_URL=https://works-dev.digit.org diff --git a/frontend/micro-ui/web/docker/Dockerfile b/frontend/micro-ui/web/docker/Dockerfile new file mode 100644 index 0000000..fa06af8 --- /dev/null +++ b/frontend/micro-ui/web/docker/Dockerfile @@ -0,0 +1,25 @@ +# FROM egovio/alpine-node-builder-14:yarn AS build +FROM ghcr.io/egovernments/alpine-node-builder-14:yarn AS build +RUN apk update && apk upgrade +RUN apk add --no-cache git>2.30.0 +ARG WORK_DIR +WORKDIR /app +ENV NODE_OPTIONS "--max-old-space-size=8168" + +COPY ${WORK_DIR} . +RUN ls -lah + +#RUN node web/envs.js +RUN cd web/ \ + && ./install-deps.sh \ + && yarn install \ + && yarn build:webpack + +FROM nginx:mainline-alpine +#FROM ghcr.io/egovernments/nginx:mainline-alpine +ENV WORK_DIR=/var/web/program-ui + +RUN mkdir -p ${WORK_DIR} + +COPY --from=build /app/web/build ${WORK_DIR}/ +COPY --from=build /app/web/docker/nginx.conf /etc/nginx/conf.d/default.conf diff --git a/frontend/micro-ui/web/docker/nginx.conf b/frontend/micro-ui/web/docker/nginx.conf new file mode 100644 index 0000000..9ba6c82 --- /dev/null +++ b/frontend/micro-ui/web/docker/nginx.conf @@ -0,0 +1,12 @@ +server +{ + listen 80; + underscores_in_headers on; + + location /program-ui + { + root /var/web; + index index.html index.htm; + try_files $uri $uri/ /program-ui/index.html; + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/envs.js b/frontend/micro-ui/web/envs.js new file mode 100644 index 0000000..e69de29 diff --git a/frontend/micro-ui/web/install-deps.sh b/frontend/micro-ui/web/install-deps.sh new file mode 100644 index 0000000..efaceae --- /dev/null +++ b/frontend/micro-ui/web/install-deps.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +BRANCH="$(git branch --show-current)" + +echo "Main Branch: $BRANCH" + +INTERNALS="micro-ui-internals" + +cp $INTERNALS/example/src/UICustomizations.js src/Customisations + +cd $INTERNALS && echo "Branch: $(git branch --show-current)" && echo "$(git log -1 --pretty=%B)" && echo "installing packages" + + +# yarn install diff --git a/frontend/micro-ui/web/micro-ui-internals/.gitignore b/frontend/micro-ui/web/micro-ui-internals/.gitignore new file mode 100644 index 0000000..1747c79 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/.gitignore @@ -0,0 +1,143 @@ +# Created by https://www.toptal.com/developers/gitignore/api/node,react +# Edit at https://www.toptal.com/developers/gitignore?templates=node,react + +### eGov ### +packages/css/example/index.css +package-lock.json +locales/ +build/ +packages/**/dist/ + +# yarn # +.yarn +.yarnrc.yml + +### Node ### +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test +.env*.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist +dist-storybook + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +### react ### +.DS_* +**/*.backup.* +**/*.back.* + +node_modules + +*.sublime* + +psd +thumb +sketch + +# vs code +.vscode/ + +# End of https://www.toptal.com/developers/gitignore/api/node,react \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/.prettierignore b/frontend/micro-ui/web/micro-ui-internals/.prettierignore new file mode 100644 index 0000000..d54de01 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/.prettierignore @@ -0,0 +1,23 @@ + +# See https://help.github.com/ignore-files/ for more about ignoring files. +# dependencies +node_modules +# builds +build +dist +.rpt2_cache +# dev +dev.css +index.css +index.compat.css +index.min.css +# misc +.DS_Store +.env +.env.local +.env.development.local +.env.test.local +.env.production.local +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/frontend/micro-ui/web/micro-ui-internals/.prettierrc.json b/frontend/micro-ui/web/micro-ui-internals/.prettierrc.json new file mode 100644 index 0000000..b975008 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "printWidth": 150 +} diff --git a/frontend/micro-ui/web/micro-ui-internals/README.md b/frontend/micro-ui/web/micro-ui-internals/README.md new file mode 100644 index 0000000..f23a1fc --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/README.md @@ -0,0 +1,100 @@ + +# workbench ui + +A React App built on top of DIGIT UI Core. + + +# DIGIT UI + +DIGIT (Digital Infrastructure for Governance, Impact & Transformation) is India's largest platform for governance services. Visit https://www.digit.org for more details. + +This repository contains source code for web implementation of the new Digit UI modules with dependencies and libraries. + +Workbench module is used to Manage the master data (MDMS V2 Service) used across the DIGIT Services / Applications + +It is also used to manage the Localisation data present in the system (Localisation service) + + +## Run Locally + +Clone the project + +```bash + git clone https://github.com/egovernments/Digit-Core.git +``` + +Go to the Sub directory to run UI +```bash + cd into frontend/micro-ui/web/micro-ui-internals +``` + +Install dependencies + +```bash + yarn install +``` + +Add .env file +```bash + frontend/micro-ui/web/micro-ui-internals/example/.env +``` + +Start the server + +```bash + yarn start +``` + + +## Environment Variables + +To run this project, you will need to add the following environment variables to your .env file + +`REACT_APP_PROXY_API` :: `{{server url}}` + +`REACT_APP_GLOBAL` :: `{{server url}}` + +`REACT_APP_PROXY_ASSETS` :: `{{server url}}` + +`REACT_APP_USER_TYPE` :: `{{EMPLOYEE||CITIZEN}}` + +`SKIP_PREFLIGHT_CHECK` :: `true` + +[sample .env file](https://github.com/egovernments/Digit-Core/blob/workbench/frontend/micro-ui/web/micro-ui-internals/example/.env-unifieddev) + +## Tech Stack + +**Libraries:** + +[React](https://react.dev/) + +[React Hook Form](https://www.react-hook-form.com/) + +[React Query](https://tanstack.com/query/v3/) + +[Tailwind CSS](https://tailwindcss.com/) + +[Webpack](https://webpack.js.org/) + +## License + +[MIT](https://choosealicense.com/licenses/mit/) + + +## Author + +- [@jagankumar-egov](https://www.github.com/jagankumar-egov) + + +## Documentation + +[Documentation](https://https://core.digit.org/guides/developer-guide/ui-developer-guide/digit-ui) + + +## Support + +For support, add the issues in https://github.com/egovernments/DIGIT-core/issues. + + +![Logo](https://s3.ap-south-1.amazonaws.com/works-dev-asset/mseva-white-logo.png) + diff --git a/frontend/micro-ui/web/micro-ui-internals/clean.sh b/frontend/micro-ui/web/micro-ui-internals/clean.sh new file mode 100644 index 0000000..2235ef1 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/clean.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +BASEDIR="$( cd "$( dirname "$0" )" && pwd )" + +msg() { + echo -e "\n\n\033[32;32m$1\033[0m" +} + +msg "Cleaning root" +rm -rf node_modules + +msg "Cleaning css" +cd "$BASEDIR/packages/css" && rm -rf node_modules + +msg "Cleaning libraries" +cd "$BASEDIR/packages/libraries" && rm -rf node_modules + +msg "Cleaning react-components" +cd "$BASEDIR/packages/react-components" && rm -rf node_modules + +msg "Cleaning PGR module" +cd "$BASEDIR/packages/modules/pgr" && rm -rf node_modules + +msg "Cleaning FSM module" +cd "$BASEDIR/packages/modules/fsm" && rm -rf node_modules + +msg "Cleaning Core module" +cd "$BASEDIR/packages/modules/core" && rm -rf node_modules diff --git a/frontend/micro-ui/web/micro-ui-internals/example/.env-selco b/frontend/micro-ui/web/micro-ui-internals/example/.env-selco new file mode 100644 index 0000000..57d9bd4 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/example/.env-selco @@ -0,0 +1,7 @@ +SKIP_PREFLIGHT_CHECK=true +REACT_APP_USER_TYPE=EMPLOYEE +REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a +REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c +REACT_APP_PROXY_API=https://unified-dev.digit.org +REACT_APP_PROXY_ASSETS=https://unified-dev.digit.org +REACT_APP_GLOBAL=https://egov-dev-assets.s3.ap-south-1.amazonaws.com/selco/globalConfigProgram.js diff --git a/frontend/micro-ui/web/micro-ui-internals/example/package.json b/frontend/micro-ui/web/micro-ui-internals/example/package.json new file mode 100644 index 0000000..d3e93a1 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/example/package.json @@ -0,0 +1,35 @@ +{ + "name": "@egovernments/digit-ui-example", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "private": true, + "homepage": "digit-ui", + "scripts": { + "start": "react-scripts start" + }, + "devDependencies": { + "@egovernments/digit-ui-libraries": "1.8.2-beta.6", + "@egovernments/digit-ui-module-core": "1.8.2-beta.12", + "@egovernments/digit-ui-components": "0.0.2-beta.38", + "@egovernments/digit-ui-react-components": "1.8.2-beta.12", + "http-proxy-middleware": "^1.0.5", + "react": "17.0.2", + "react-dom": "17.0.2", + "react-i18next": "11.16.2", + "react-router-dom": "5.3.0", + "react-scripts": "^4.0.1" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/example/public/index.html b/frontend/micro-ui/web/micro-ui-internals/example/public/index.html new file mode 100644 index 0000000..90ebf8c --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/example/public/index.html @@ -0,0 +1,27 @@ + + + + + + + + + + DIGIT + + + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js b/frontend/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js new file mode 100644 index 0000000..b78ac0e --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js @@ -0,0 +1,651 @@ +import { Link } from "react-router-dom"; +import _ from "lodash"; +import { useLocation } from "react-router-dom"; +import { useParams } from "react-router-dom"; + +//create functions here based on module name set in mdms(eg->SearchProjectConfig) +//how to call these -> Digit?.Customizations?.[masterName]?.[moduleName] +// these functions will act as middlewares +var Digit = window.Digit || {}; + +const businessServiceMap = { + "muster roll": "MR", +}; + +const inboxModuleNameMap = { + "muster-roll-approval": "muster-roll-service", +}; +// eslint-disable-next-line +export const UICustomizations = { + businessServiceMap, + updatePayload: (applicationDetails, data, action, businessService) => { + if (businessService === businessServiceMap.estimate) { + const workflow = { + comment: data.comments, + documents: data?.documents?.map((document) => { + return { + documentType: action?.action + " DOC", + fileName: document?.[1]?.file?.name, + fileStoreId: document?.[1]?.fileStoreId?.fileStoreId, + documentUid: document?.[1]?.fileStoreId?.fileStoreId, + tenantId: document?.[1]?.fileStoreId?.tenantId, + }; + }), + assignees: data?.assignees?.uuid ? [data?.assignees?.uuid] : null, + action: action.action, + }; + //filtering out the data + Object.keys(workflow).forEach((key, index) => { + if (!workflow[key] || workflow[key]?.length === 0) delete workflow[key]; + }); + + return { + estimate: applicationDetails, + workflow, + }; + } + if (businessService === businessServiceMap.contract) { + const workflow = { + comment: data?.comments, + documents: data?.documents?.map((document) => { + return { + documentType: action?.action + " DOC", + fileName: document?.[1]?.file?.name, + fileStoreId: document?.[1]?.fileStoreId?.fileStoreId, + documentUid: document?.[1]?.fileStoreId?.fileStoreId, + tenantId: document?.[1]?.fileStoreId?.tenantId, + }; + }), + assignees: data?.assignees?.uuid ? [data?.assignees?.uuid] : null, + action: action.action, + }; + //filtering out the data + Object.keys(workflow).forEach((key, index) => { + if (!workflow[key] || workflow[key]?.length === 0) delete workflow[key]; + }); + + return { + contract: applicationDetails, + workflow, + }; + } + if (businessService === businessServiceMap?.["muster roll"]) { + const workflow = { + comment: data?.comments, + documents: data?.documents?.map((document) => { + return { + documentType: action?.action + " DOC", + fileName: document?.[1]?.file?.name, + fileStoreId: document?.[1]?.fileStoreId?.fileStoreId, + documentUid: document?.[1]?.fileStoreId?.fileStoreId, + tenantId: document?.[1]?.fileStoreId?.tenantId, + }; + }), + assignees: data?.assignees?.uuid ? [data?.assignees?.uuid] : null, + action: action.action, + }; + //filtering out the data + Object.keys(workflow).forEach((key, index) => { + if (!workflow[key] || workflow[key]?.length === 0) delete workflow[key]; + }); + + return { + musterRoll: applicationDetails, + workflow, + }; + } + if (businessService === businessServiceMap?.["works.purchase"]) { + const workflow = { + comment: data.comments, + documents: data?.documents?.map((document) => { + return { + documentType: action?.action + " DOC", + fileName: document?.[1]?.file?.name, + fileStoreId: document?.[1]?.fileStoreId?.fileStoreId, + documentUid: document?.[1]?.fileStoreId?.fileStoreId, + tenantId: document?.[1]?.fileStoreId?.tenantId, + }; + }), + assignees: data?.assignees?.uuid ? [data?.assignees?.uuid] : null, + action: action.action, + }; + //filtering out the data + Object.keys(workflow).forEach((key, index) => { + if (!workflow[key] || workflow[key]?.length === 0) delete workflow[key]; + }); + + const additionalFieldsToSet = { + projectId: applicationDetails.additionalDetails.projectId, + invoiceDate: applicationDetails.billDate, + invoiceNumber: applicationDetails.referenceId.split("_")?.[1], + contractNumber: applicationDetails.referenceId.split("_")?.[0], + documents: applicationDetails.additionalDetails.documents, + }; + return { + bill: { ...applicationDetails, ...additionalFieldsToSet }, + workflow, + }; + } + }, + enableModalSubmit: (businessService, action, setModalSubmit, data) => { + if (businessService === businessServiceMap?.["muster roll"] && action.action === "APPROVE") { + setModalSubmit(data?.acceptTerms); + } + }, + enableHrmsSearch: (businessService, action) => { + if (businessService === businessServiceMap.estimate) { + return action.action.includes("TECHNICALSANCTION") || action.action.includes("VERIFYANDFORWARD"); + } + if (businessService === businessServiceMap.contract) { + return action.action.includes("VERIFY_AND_FORWARD"); + } + if (businessService === businessServiceMap?.["muster roll"]) { + return action.action.includes("VERIFY"); + } + if (businessService === businessServiceMap?.["works.purchase"]) { + return action.action.includes("VERIFY_AND_FORWARD"); + } + return false; + }, + getBusinessService: (moduleCode) => { + if (moduleCode?.includes("estimate")) { + return businessServiceMap?.estimate; + } else if (moduleCode?.includes("contract")) { + return businessServiceMap?.contract; + } else if (moduleCode?.includes("muster roll")) { + return businessServiceMap?.["muster roll"]; + } else if (moduleCode?.includes("works.purchase")) { + return businessServiceMap?.["works.purchase"]; + } else if (moduleCode?.includes("works.wages")) { + return businessServiceMap?.["works.wages"]; + } else if (moduleCode?.includes("works.supervision")) { + return businessServiceMap?.["works.supervision"]; + } else { + return businessServiceMap; + } + }, + getInboxModuleName: (moduleCode) => { + if (moduleCode?.includes("estimate")) { + return inboxModuleNameMap?.estimate; + } else if (moduleCode?.includes("contract")) { + return inboxModuleNameMap?.contracts; + } else if (moduleCode?.includes("attendence")) { + return inboxModuleNameMap?.attendencemgmt; + } else { + return inboxModuleNameMap; + } + }, + + AttendanceInboxConfig: { + preProcess: (data) => { + //set tenantId + data.body.inbox.tenantId = Digit.ULBService.getCurrentTenantId(); + data.body.inbox.processSearchCriteria.tenantId = Digit.ULBService.getCurrentTenantId(); + + const musterRollNumber = data?.body?.inbox?.moduleSearchCriteria?.musterRollNumber?.trim(); + if (musterRollNumber) data.body.inbox.moduleSearchCriteria.musterRollNumber = musterRollNumber; + + const attendanceRegisterName = data?.body?.inbox?.moduleSearchCriteria?.attendanceRegisterName?.trim(); + if (attendanceRegisterName) data.body.inbox.moduleSearchCriteria.attendanceRegisterName = attendanceRegisterName; + + // deleting them for now(assignee-> need clarity from pintu,ward-> static for now,not implemented BE side) + const assignee = _.clone(data.body.inbox.moduleSearchCriteria.assignee); + delete data.body.inbox.moduleSearchCriteria.assignee; + if (assignee?.code === "ASSIGNED_TO_ME") { + data.body.inbox.moduleSearchCriteria.assignee = Digit.UserService.getUser().info.uuid; + } + + //cloning locality and workflow states to format them + // let locality = _.clone(data.body.inbox.moduleSearchCriteria.locality ? data.body.inbox.moduleSearchCriteria.locality : []); + + let selectedOrg = _.clone(data.body.inbox.moduleSearchCriteria.orgId ? data.body.inbox.moduleSearchCriteria.orgId : null); + delete data.body.inbox.moduleSearchCriteria.orgId; + if (selectedOrg) { + data.body.inbox.moduleSearchCriteria.orgId = selectedOrg?.[0]?.applicationNumber; + } + + // let selectedWard = _.clone(data.body.inbox.moduleSearchCriteria.ward ? data.body.inbox.moduleSearchCriteria.ward : null); + // delete data.body.inbox.moduleSearchCriteria.ward; + // if(selectedWard) { + // data.body.inbox.moduleSearchCriteria.ward = selectedWard?.[0]?.code; + // } + + let states = _.clone(data.body.inbox.moduleSearchCriteria.state ? data.body.inbox.moduleSearchCriteria.state : []); + let ward = _.clone(data.body.inbox.moduleSearchCriteria.ward ? data.body.inbox.moduleSearchCriteria.ward : []); + // delete data.body.inbox.moduleSearchCriteria.locality; + delete data.body.inbox.moduleSearchCriteria.state; + delete data.body.inbox.moduleSearchCriteria.ward; + + // locality = locality?.map((row) => row?.code); + states = Object.keys(states)?.filter((key) => states[key]); + ward = ward?.map((row) => row?.code); + + // //adding formatted data to these keys + // if (locality.length > 0) data.body.inbox.moduleSearchCriteria.locality = locality; + if (states.length > 0) data.body.inbox.moduleSearchCriteria.status = states; + if (ward.length > 0) data.body.inbox.moduleSearchCriteria.ward = ward; + const projectType = _.clone(data.body.inbox.moduleSearchCriteria.projectType ? data.body.inbox.moduleSearchCriteria.projectType : {}); + if (projectType?.code) data.body.inbox.moduleSearchCriteria.projectType = projectType.code; + + //adding tenantId to moduleSearchCriteria + data.body.inbox.moduleSearchCriteria.tenantId = Digit.ULBService.getCurrentTenantId(); + + //setting limit and offset becoz somehow they are not getting set in muster inbox + data.body.inbox.limit = data.state.tableForm.limit; + data.body.inbox.offset = data.state.tableForm.offset; + delete data.state; + return data; + }, + postProcess: (responseArray, uiConfig) => { + const statusOptions = responseArray?.statusMap + ?.filter((item) => item.applicationstatus) + ?.map((item) => ({ code: item.applicationstatus, i18nKey: `COMMON_MASTERS_${item.applicationstatus}` })); + if (uiConfig?.type === "filter") { + let fieldConfig = uiConfig?.fields?.filter((item) => item.type === "dropdown" && item.populators.name === "musterRollStatus"); + if (fieldConfig.length) { + fieldConfig[0].populators.options = statusOptions; + } + } + }, + additionalCustomizations: (row, key, column, value, t, searchResult) => { + if (key === "ATM_MUSTER_ROLL_ID") { + return ( + + + {String(value ? (column.translate ? t(column.prefix ? `${column.prefix}${value}` : value) : value) : t("ES_COMMON_NA"))} + + + ); + } + if (key === "ATM_ATTENDANCE_WEEK") { + const week = `${Digit.DateUtils.ConvertTimestampToDate(value?.startDate, "dd/MM/yyyy")}-${Digit.DateUtils.ConvertTimestampToDate( + value?.endDate, + "dd/MM/yyyy" + )}`; + return
{week}
; + } + if (key === "ATM_NO_OF_INDIVIDUALS") { + return
{value?.length}
; + } + if (key === "ATM_AMOUNT_IN_RS") { + return {value ? Digit.Utils.dss.formatterWithoutRound(value, "number") : t("ES_COMMON_NA")}; + } + if (key === "ATM_SLA") { + return parseInt(value) > 0 ? ( + {t(value) || ""} + ) : ( + {t(value) || ""} + ); + } + if (key === "COMMON_WORKFLOW_STATES") { + return {t(`WF_MUSTOR_${value}`)}; + } + //added this in case we change the key and not updated here , it'll throw that nothing was returned from cell error if that case is not handled here. To prevent that error putting this default + return {t(`CASE_NOT_HANDLED`)}; + }, + MobileDetailsOnClick: (row, tenantId) => { + let link; + Object.keys(row).map((key) => { + if (key === "ATM_MUSTER_ROLL_ID") + link = `/${window.contextPath}/employee/attendencemgmt/view-attendance?tenantId=${tenantId}&musterRollNumber=${row[key]}`; + }); + return link; + }, + populateReqCriteria: () => { + const tenantId = Digit.ULBService.getCurrentTenantId(); + return { + url: "/org-services/organisation/v1/_search", + params: { limit: 50, offset: 0 }, + body: { + SearchCriteria: { + tenantId: tenantId, + functions: { + type: "CBO", + }, + }, + }, + config: { + enabled: true, + select: (data) => { + return data?.organisations; + }, + }, + }; + }, + }, + SearchWageSeekerConfig: { + customValidationCheck: (data) => { + //checking both to and from date are present + const { createdFrom, createdTo } = data; + if ((createdFrom === "" && createdTo !== "") || (createdFrom !== "" && createdTo === "")) + return { warning: true, label: "ES_COMMON_ENTER_DATE_RANGE" }; + + return false; + }, + preProcess: (data) => { + data.params = { ...data.params, tenantId: Digit.ULBService.getCurrentTenantId() }; + + let requestBody = { ...data.body.Individual }; + const pathConfig = { + name: "name.givenName", + }; + const dateConfig = { + createdFrom: "daystart", + createdTo: "dayend", + }; + const selectConfig = { + wardCode: "wardCode[0].code", + socialCategory: "socialCategory.code", + }; + const textConfig = ["name", "individualId"]; + let Individual = Object.keys(requestBody) + .map((key) => { + if (selectConfig[key]) { + requestBody[key] = _.get(requestBody, selectConfig[key], null); + } else if (typeof requestBody[key] == "object") { + requestBody[key] = requestBody[key]?.code; + } else if (textConfig?.includes(key)) { + requestBody[key] = requestBody[key]?.trim(); + } + return key; + }) + .filter((key) => requestBody[key]) + .reduce((acc, curr) => { + if (pathConfig[curr]) { + _.set(acc, pathConfig[curr], requestBody[curr]); + } else if (dateConfig[curr] && dateConfig[curr]?.includes("day")) { + _.set(acc, curr, Digit.Utils.date.convertDateToEpoch(requestBody[curr], dateConfig[curr])); + } else { + _.set(acc, curr, requestBody[curr]); + } + return acc; + }, {}); + + data.body.Individual = { ...Individual }; + return data; + }, + additionalCustomizations: (row, key, column, value, t, searchResult) => { + //here we can add multiple conditions + //like if a cell is link then we return link + //first we can identify which column it belongs to then we can return relevant result + switch (key) { + case "MASTERS_WAGESEEKER_ID": + return ( + + + {String(value ? (column.translate ? t(column.prefix ? `${column.prefix}${value}` : value) : value) : t("ES_COMMON_NA"))} + + + ); + + case "MASTERS_SOCIAL_CATEGORY": + return value ? {String(t(`MASTERS_${value}`))} : t("ES_COMMON_NA"); + + case "CORE_COMMON_PROFILE_CITY": + return value ? {String(t(Digit.Utils.locale.getCityLocale(value)))} : t("ES_COMMON_NA"); + + case "MASTERS_WARD": + return value ? ( + {String(t(Digit.Utils.locale.getMohallaLocale(value, row?.tenantId)))} + ) : ( + t("ES_COMMON_NA") + ); + + case "MASTERS_LOCALITY": + return value ? ( + {String(t(Digit.Utils.locale.getMohallaLocale(value, row?.tenantId)))} + ) : ( + t("ES_COMMON_NA") + ); + default: + return t("ES_COMMON_NA"); + } + }, + MobileDetailsOnClick: (row, tenantId) => { + let link; + Object.keys(row).map((key) => { + if (key === "MASTERS_WAGESEEKER_ID") + link = `/${window.contextPath}/employee/masters/view-wageseeker?tenantId=${tenantId}&wageseekerId=${row[key]}`; + }); + return link; + }, + additionalValidations: (type, data, keys) => { + if (type === "date") { + return data[keys.start] && data[keys.end] ? () => new Date(data[keys.start]).getTime() <= new Date(data[keys.end]).getTime() : true; + } + }, + }, + SearchDefaultConfig: { + + customValidationCheck: (data) => { + //checking both to and from date are present + const { createdFrom, createdTo } = data; + if ((createdFrom === "" && createdTo !== "") || (createdFrom !== "" && createdTo === "")) + return { warning: true, label: "ES_COMMON_ENTER_DATE_RANGE" }; + + return false; + }, + preProcess: (data) => { + // eslint-disable-next-line + const location = useLocation(); + data.params = { ...data.params }; + // eslint-disable-next-line + const { masterName } = useParams(); + + const searchParams = new URLSearchParams(location.search); + const paths = { + "SearchProjectConfig": { + basePath: "Projects", + pathConfig: { + // id: "id[0]", + tenantId: "tenantId", + }, + dateConfig: { + endDate: "dayend", + startDate: "daystart" + }, + selectConfig: { + }, + textConfig :["id", "tenantId", "name", "projectNumber", "projectSubType" , "projectType"] + }, + "SearchProductConfig": { + basePath: "Product", + pathConfig: { + id: "id[0]", + }, + dateConfig: { + }, + selectConfig: { + }, + textConfig :["id", "manufacturer", "name", "type"] + }, + "SearchHouseholdConfig": { + basePath: "Household", + pathConfig: { + id: "id[0]", + clientReferenceId: "clientReferenceId[0]", + }, + dateConfig: { + }, + selectConfig: { + }, + textConfig :["boundaryCode", "clientReferenceId", "id"] + }, + "SearchProductVariantConfig": { + basePath: "ProductVariant", + pathConfig: { + id: "id[0]", + }, + dateConfig: { + }, + selectConfig: { + }, + textConfig :["productId", "sku", "variation"] + }, + "SearchProjectBeneficiaryConfig": { + basePath: "ProjectBeneficiary", + pathConfig: { + id: "id[0]", + clientReferenceId: "clientReferenceId[0]", + + }, + dateConfig: { + dateOfRegistration: "daystart" + }, + selectConfig: { + }, + textConfig :["beneficiaryId", "projectId"] + }, + "SearchProjectStaffConfig": { + basePath: "ProjectStaff", + pathConfig: { + id: "id[0]", + }, + dateConfig: { + startDate: "daystart", + endDate: "dayend", + }, + selectConfig: { + }, + textConfig :["projectId", "userId"] + }, + "SearchProjectResourceConfig": { + basePath: "ProjectResource", + pathConfig: { + id: "id[0]" + }, + dateConfig: { + }, + selectConfig: { + }, + textConfig : [] + }, + "SearchProjectTaskConfig": { + basePath: "Task", + pathConfig: { + id: "id[0]", + clientReferenceId: "clientReferenceId[0]", + }, + dateConfig: { + plannedEndDate: "dayend", + plannedStartDate: "daystart", + actualEndDate: "dayend", + actualStartDate: "daystart", + }, + selectConfig: { + }, + textConfig :["projectId","localityCode", "projectBeneficiaryId", "status"] + }, + "SearchFacilityConfig": { + basePath: "Facility", + pathConfig: { + id: "id[0]" + }, + dateConfig: { + }, + selectConfig: { + }, + textConfig :["faciltyUsage","localityCode", "storageCapacity","id"] + } + } + + const id = searchParams.get("config")|| masterName; + + if(!paths||!paths?.[id]){ + return data; + } + let requestBody = { ...data.body[paths[id]?.basePath] }; + const pathConfig = paths[id]?.pathConfig; + const dateConfig = paths[id]?.dateConfig; + const selectConfig = paths[id]?.selectConfig; + const textConfig = paths[id]?.textConfig + + if(paths[id].basePath == "Projects"){ + data.state.searchForm={...data.state.searchForm,tenantId:"mz"} + } + let Product = Object.keys(requestBody) + .map((key) => { + if (selectConfig[key]) { + requestBody[key] = _.get(requestBody, selectConfig[key], null); + } else if (typeof requestBody[key] == "object") { + requestBody[key] = requestBody[key]?.code; + } else if (textConfig?.includes(key)) { + requestBody[key] = requestBody[key]?.trim(); + } + return key; + }) + .filter((key) => requestBody[key]) + .reduce((acc, curr) => { + if (pathConfig[curr]) { + _.set(acc, pathConfig[curr], requestBody[curr]); + } else if (dateConfig[curr] && dateConfig[curr]?.includes("day")) { + _.set(acc, curr, Digit.Utils.date.convertDateToEpoch(requestBody[curr], dateConfig[curr])); + } else { + _.set(acc, curr, requestBody[curr]); + } + return acc; + }, {}); + + if(paths[id].basePath == "Projects"){ + + data.body[paths[id].basePath] = [{ ...Product}]; + } + else data.body[paths[id].basePath] = { ...Product}; + return data; + }, + additionalCustomizations: (row, key, column, value, t, searchResult) => { + //here we can add multiple conditions + //like if a cell is link then we return link + //first we can identify which column it belongs to then we can return relevant result + switch (key) { + case "MASTERS_WAGESEEKER_ID": + return ( + + + {String(value ? (column.translate ? t(column.prefix ? `${column.prefix}${value}` : value) : value) : t("ES_COMMON_NA"))} + + + ); + + case "MASTERS_SOCIAL_CATEGORY": + return value ? {String(t(`MASTERS_${value}`))} : t("ES_COMMON_NA"); + + case "CORE_COMMON_PROFILE_CITY": + return value ? {String(t(Digit.Utils.locale.getCityLocale(value)))} : t("ES_COMMON_NA"); + + case "MASTERS_WARD": + return value ? ( + {String(t(Digit.Utils.locale.getMohallaLocale(value, row?.tenantId)))} + ) : ( + t("ES_COMMON_NA") + ); + + case "MASTERS_LOCALITY": + return value ? ( + {String(t(Digit.Utils.locale.getMohallaLocale(value, row?.tenantId)))} + ) : ( + t("ES_COMMON_NA") + ); + default: + return t("ES_COMMON_NA"); + } + }, + MobileDetailsOnClick: (row, tenantId) => { + let link; + Object.keys(row).map((key) => { + if (key === "MASTERS_WAGESEEKER_ID") + link = `/${window.contextPath}/employee/masters/view-wageseeker?tenantId=${tenantId}&wageseekerId=${row[key]}`; + }); + return link; + }, + additionalValidations: (type, data, keys) => { + if (type === "date") { + return data[keys.start] && data[keys.end] ? () => new Date(data[keys.start]).getTime() <= new Date(data[keys.end]).getTime() : true; + } + }, + } +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/example/src/index.js b/frontend/micro-ui/web/micro-ui-internals/example/src/index.js new file mode 100644 index 0000000..b282812 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/example/src/index.js @@ -0,0 +1,93 @@ +import React from "react"; +import ReactDOM from "react-dom"; +// import { PGRReducers } from "@egovernments/digit-ui-module-pgr"; +import { initLibraries } from "@egovernments/digit-ui-libraries"; +// import { paymentConfigs, PaymentLinks, PaymentModule } from "@egovernments/digit-ui-module-common"; +import { DigitUI } from "@egovernments/digit-ui-module-core"; +// import { initDSSComponents } from "@egovernments/digit-ui-module-dss"; +// import { initEngagementComponents } from "@egovernments/digit-ui-module-engagement"; +// import { initHRMSComponents } from "@egovernments/digit-ui-module-hrms"; +// import { initUtilitiesComponents } from "@egovernments/digit-ui-module-utilities"; +// import {initWorkbenchComponents} from "@egovernments/digit-ui-module-workbench"; +// import {initPGRComponents} from "@egovernments/digit-ui-module-pgr"; +// import {initOpenPaymentComponents} from "@egovernments/digit-ui-module-open-payment"; + +import "@egovernments/digit-ui-css/example/index.css"; + +// import { pgrCustomizations,pgrComponents } from "./pgr"; +import { UICustomizations } from "./UICustomizations"; + +var Digit = window.Digit || {}; + +const enabledModules = [ + "DSS", "HRMS", +"Workbench", +// "Engagement", "NDSS","QuickPayLinks", "Payment", + "Utilities","PGR", +//added to check fsm +// "FSM" +"OpenPayment" +]; + +const initTokens = (stateCode) => { + const userType = window.sessionStorage.getItem("userType") || process.env.REACT_APP_USER_TYPE || "CITIZEN"; + const token = window.localStorage.getItem("token") || process.env[`REACT_APP_${userType}_TOKEN`]; + + const citizenInfo = window.localStorage.getItem("Citizen.user-info"); + + const citizenTenantId = window.localStorage.getItem("Citizen.tenant-id") || stateCode; + + const employeeInfo = window.localStorage.getItem("Employee.user-info"); + const employeeTenantId = window.localStorage.getItem("Employee.tenant-id"); + + const userTypeInfo = userType === "CITIZEN" || userType === "QACT" ? "citizen" : "employee"; + window.Digit.SessionStorage.set("user_type", userTypeInfo); + window.Digit.SessionStorage.set("userType", userTypeInfo); + + if (userType !== "CITIZEN") { + window.Digit.SessionStorage.set("User", { access_token: token, info: userType !== "CITIZEN" ? JSON.parse(employeeInfo) : citizenInfo }); + } else { + // if (!window.Digit.SessionStorage.get("User")?.extraRoleInfo) window.Digit.SessionStorage.set("User", { access_token: token, info: citizenInfo }); + } + + window.Digit.SessionStorage.set("Citizen.tenantId", citizenTenantId); + + if (employeeTenantId && employeeTenantId.length) window.Digit.SessionStorage.set("Employee.tenantId", employeeTenantId); +}; + +const initDigitUI = () => { + window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH") || "digit-ui"; + window.Digit.Customizations = { + // PGR: pgrCustomizations, + commonUiConfig: UICustomizations + }; + window?.Digit.ComponentRegistryService.setupRegistry({ + // ...pgrComponents, + // PaymentModule, + // ...paymentConfigs, + // PaymentLinks, + }); + // initCoreComponents(); + // initDSSComponents(); + // initHRMSComponents(); + // initEngagementComponents(); + // initUtilitiesComponents(); + // initWorkbenchComponents(); + // initPGRComponents(); + // initOpenPaymentComponents(); + + const moduleReducers = (initData) => ({ + // pgr: PGRReducers(initData), + }); + + + + const stateCode = window?.globalConfigs?.getConfig("STATE_LEVEL_TENANT_ID") || "pb"; + initTokens(stateCode); + + ReactDOM.render(, document.getElementById("root")); +}; + +initLibraries().then(() => { + initDigitUI(); +}); diff --git a/frontend/micro-ui/web/micro-ui-internals/example/src/setupProxy.js b/frontend/micro-ui/web/micro-ui-internals/example/src/setupProxy.js new file mode 100644 index 0000000..840f7b1 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/example/src/setupProxy.js @@ -0,0 +1,96 @@ +const { createProxyMiddleware } = require("http-proxy-middleware"); + +const createProxy = createProxyMiddleware({ + //target: process.env.REACT_APP_PROXY_API || "https://uat.digit.org", + // target: process.env.REACT_APP_PROXY_API || "https://qa.digit.org", + target: process.env.REACT_APP_PROXY_API || "https://works-dev.digit.org", + changeOrigin: true, + secure: false +}); +const assetsProxy = createProxyMiddleware({ + target: process.env.REACT_APP_PROXY_ASSETS || "https://works-dev.digit.org", + changeOrigin: true, + secure: false +}); +const mdmsProxy = createProxyMiddleware({ + target: process.env.REACT_APP_PROXY_ASSETS || "http://localhost:8080", + changeOrigin: true, + secure: false +}); +module.exports = function (app) { + ["/mdms-v2/v2/_create"].forEach((location) => app.use(location, mdmsProxy)); + [ + "/access/v1/actions/mdms", + "/egov-mdms-service", + "/mdms-v2", + "/egov-idgen", + "/egov-location", + "/localization", + "/egov-workflow-v2", + "/pgr-services", + "/filestore", + "/egov-hrms", + "/user-otp", + "/user", + "/fsm", + "/billing-service", + "/collection-services", + "/pdf-service", + "/pg-service", + "/vehicle", + "/vendor", + "/property-services", + "/fsm-calculator/v1/billingSlab/_search", + "/pt-calculator-v2", + "/dashboard-analytics", + "/echallan-services", + "/egov-searcher/bill-genie/mcollectbills/_get", + "/egov-searcher/bill-genie/billswithaddranduser/_get", + "/egov-searcher/bill-genie/waterbills/_get", + "/egov-searcher/bill-genie/seweragebills/_get", + "/egov-pdf/download/UC/mcollect-challan", + "/egov-hrms/employees/_count", + "/tl-services/v1/_create", + "/tl-services/v1/_search", + "/egov-url-shortening/shortener", + "/inbox/v1/_search", + "/inbox/v2/_search", + "/tl-services", + "/tl-calculator", + "/org-services", + "/edcr", + "/hcm-moz-impl", + "/bpa-services", + "/noc-services", + "/egov-user-event", + "/egov-document-uploader", + "/egov-pdf", + "/egov-survey-services", + "/ws-services", + "/sw-services", + "/ws-calculator", + "/sw-calculator/", + "/audit-service/", + "/egov-searcher", + "/report", + "/inbox/v1/dss/_search", + "/loi-service", + "/project/v1/", + "/estimate-service", + "/loi-service", + "/works-inbox-service/v2/_search", + "/egov-pdf/download/WORKSESTIMATE/estimatepdf", + "/muster-roll", + "/individual", + "/mdms-v2", + "/facility/v1/_search", + "/project/staff/v1/_create", + "/product/v1/_create", + "/boundary-service", + "/project-factory", + "/project-factory/v1/data/_autoGenerateBoundaryCode", + "/billing-service/bill/v2/_fetchbill" + ].forEach((location) => app.use(location, createProxy)); + ["/pb-egov-assets"].forEach((location) => app.use(location, assetsProxy)); + ["/mdms-v2/v2/_create"].forEach((location) => app.use(location, mdmsProxy)); +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/package.json b/frontend/micro-ui/web/micro-ui-internals/package.json new file mode 100644 index 0000000..235ef18 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/package.json @@ -0,0 +1,63 @@ +{ + "name": "egovernments", + "version": "1.0.0", + "main": "index.js", + "workspaces": [ + "packages/libraries", + "example", + "packages/css", + "packages/react-components", + "packages/modules/core" + ], + "author": "JaganKumar ", + "license": "MIT", + "private": true, + "engines": { + "node": ">=14" + }, + "scripts": { + "start": "cross-env SKIP_PREFLIGHT_CHECK=true run-s build start:dev", + "sprint": "SKIP_PREFLIGHT_CHECK=true run-s start:script", + "start:dev": "run-p dev:**", + "start:script": "./scripts/create.sh", + "dev:css": "cd packages/css && yarn start", + "publish:css": "cd packages/css && yarn publish --access public", + "dev:libraries": "cd packages/libraries && yarn start", + "dev:components": "cd packages/react-components && yarn start", + "dev:example": "cd example && yarn start", + "dev:core": "cd packages/modules/core && yarn start", + "build": "run-p build:**", + "build:libraries": "cd packages/libraries && yarn build", + "build:components": "cd packages/react-components && yarn build", + "build:core": "cd packages/modules/core && yarn build", + "deploy:jenkins": "./scripts/jenkins.sh", + "clean": "rm -rf node_modules" + }, + "resolutions": { + "**/@babel/runtime": "7.20.1", + "**/babel-preset-react-app": "10.0.0", + "fast-uri":"2.1.0" + }, + "devDependencies": { + "husky": "7.0.4", + "lint-staged": "12.3.7", + "npm-run-all": "4.1.5", + "prettier": "2.1.2" + }, + "husky": {}, + "lint-staged": { + "*.{js,css,md}": "prettier --write" + }, + "dependencies": { + "lodash": "4.17.21", + "microbundle-crl": "0.13.11", + "@egovernments/digit-ui-components": "0.0.2-beta.38", + "@egovernments/digit-ui-react-components": "1.8.2-beta.12", + "react": "17.0.2", + "react-dom": "17.0.2", + "react-hook-form": "6.15.8", + "react-i18next": "11.16.2", + "react-query": "3.6.1", + "react-router-dom": "5.3.0" + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/config/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/config/index.js new file mode 100644 index 0000000..87090e0 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/config/index.js @@ -0,0 +1,3 @@ +module.exports = { + PORT: "3000", +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/config/package.json b/frontend/micro-ui/web/micro-ui-internals/packages/config/package.json new file mode 100644 index 0000000..bb380df --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/config/package.json @@ -0,0 +1,6 @@ +{ + "name": "@egovernments/digit-ui-config", + "version": "1.0.1", + "main": "index.js", + "license": "MIT" +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/CHANGELOG.md b/frontend/micro-ui/web/micro-ui-internals/packages/css/CHANGELOG.md new file mode 100644 index 0000000..9763e1b --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/CHANGELOG.md @@ -0,0 +1,132 @@ +# Changelog + +## [1.8.2-beta.9] +- Updated LanguageSelection Style. + +## [1.8.2-beta.7] +- Fixed LanguageSelection style. + +## [1.8.2-beta.3] [06-06-2024] +- added audit history styles + +## [1.8.2-beta.2] +- Updated LogoutDialog Popup styles. + +## [1.8.2-beta.1] +- Formatted changelog file. + +## [1.8.1-beta.11] +- Updated styles for language selection dropdown options card. + +## [1.8.1-beta.10] +- Fixed login header alignment. + +## [1.8.1-beta.8] +- Used a new Primary constant color "#c84c0e". + - **Note:** Use this version with component 1.8.1-beta.15 and core 1.8.1-beta.12. + +## [1.8.1-beta.7] +- Added CSS for Loader With Gap. +- Added CSS for viewcomposer header. + +## [1.8.1-beta.5] +- Added CSS for Tab InboxSearchComposer. + +## [1.8.1-beta.2] +- Added CSS for create hierarchy. + +## [1.8.1-beta.1] +- Republished after merging with Master due to version issues. + +## [1.8.0-beta.20] +- Added CSS for info message in localisation screen. + +## [1.8.0-beta.19] +- Improved Bulk Upload and Bulk Upload Toast CSS. + +## [1.8.0-beta.18] +- Added bulk upload CSS. + +## [1.8.0-beta.17] +- Fixed mobile view issue for detail modals. + +## [1.8.0-beta.16] +- Added styles for detail modals. + +## [1.8.0-beta.15] +- Added styles for multi select dropdowns. + +## [1.8.0-beta.14] +- Added tour help styles. + +## [1.8.0-beta.13] +- Fixed the login text styling issue. + +## [1.8.0] +- Workbench v1.0. + +## [1.8.0-beta.1] +- Added styles for login dropdown and homepage dropdowns. + +## [1.8.0-beta] +- Added workbench related CSS and some new Digit v2 constants based on em. + +## [1.7.0] +- Urban 2.9. + +## [1.6.0] +- Urban 2.8. + +## [1.5.41] +- Added styles for login dropdown and homepage dropdowns. + +## [1.5.40] +- Fixed alignment issue in edit and logout. + +## [1.5.39] +- Updated login SCSS and fixed alignment issues. + +## [1.5.37] +- Updated the README content. + +## [1.5.36] +- Enhanced the formcomposer with header attribute. + +## [1.5.35] +- Fixed the card CSS issues. + +## [1.5.34] +- Fixed breadcrumb styling issue. + +## [1.5.33] +- Fixed some card-related CSS issues due to v2 CSS. + +## [1.5.32] +- Added newer CSS DIGITv2 and corrected a few existing issues. + +## [1.5.31] +- Corrected the CSS for inbox composers and default core UI. + +## [1.5.30] +- Updated the CSS for dynamic dropdown filter DSS. + +## [1.5.29] +- Fixed layout issues. + +## [1.5.28] +- Horizontal Bar chart alignment fixes. + +## [1.5.27] +- DSS UI alignment fixes for Horizontal Metric and bar chart. + +## [1.5.26] +- Added new CSS class for DSS enhancements. + +## [1.5.25] +- Added the CSS of inbox search composers. + +## [1.5.24] +- Added the README file. + +## [1.5.23] +- Base version. diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/README.md b/frontend/micro-ui/web/micro-ui-internals/packages/css/README.md new file mode 100644 index 0000000..5efb59f --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/README.md @@ -0,0 +1,58 @@ + + +# digit-ui-css + +## Install + +```bash +npm install --save @egovernments/digit-ui-css +``` + +## Limitation + +```bash +This Package is more specific to DIGIT-UI's can be used across mission's +It is the base css for all Digit UI's +``` + +## Usage + +After adding the dependency make sure you have this dependency in + +```bash +frontend/micro-ui/web/package.json +``` + +```json +"@egovernments/digit-ui-css":"^1.5.0", +``` + +then navigate to App.js + +```bash +frontend/micro-ui/web/public/index.html +``` + +```jsx +/** add this import **/ + + + +``` +## Changelog + +### Summary for Version [1.8.2-beta.1] - 2024-06-05 + +For a detailed changelog, see the [CHANGELOG.md](./CHANGELOG.md) file. + + +## Contributors + +[jagankumar-egov] [nipunarora-eGov] [Tulika-eGov] [Ramkrishna-egov] [nabeelmd-eGov] [anil-egov] [vamshikrishnakole-wtt-egov] + +### Published from DIGIT Frontend +DIGIT Frontend Repo (https://github.com/egovernments/Digit-Frontend/tree/develop) + +## License + +MIT © [jagankumar-egov](https://github.com/jagankumar-egov) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/gulpfile.js b/frontend/micro-ui/web/micro-ui-internals/packages/css/gulpfile.js new file mode 100644 index 0000000..5d1a705 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/gulpfile.js @@ -0,0 +1,71 @@ +const fs = require("fs"); +const { name, version, author, cssConfig } = JSON.parse(fs.readFileSync("package.json")); + +const headerString = ` +@charset "UTF-8"; +/*! + * ${name} - ${version} + * + * Copyright (c) ${new Date().getFullYear()} ${author} + * + */ + `; +const { series, src, dest, watch, task } = require("gulp"); +const header = require("postcss-header"); + +const clean = require("gulp-clean"); +const postcss = require("gulp-postcss"); +const sass = require('gulp-sass'); + +const postcssPresetEnv = require("postcss-preset-env"); +const cleanCSS = require("gulp-clean-css"); +const rename = require("gulp-rename"); +const livereload = require("gulp-livereload"); + +let output = "./example"; +if (process.env.NODE_ENV === "production") { + output = "./dist"; +} + +function cleanStyles() { + return src(`${output}/*.css`, { read: false }).pipe(clean()); +} + +function styles() { + const plugins = [ + require("postcss-import"), + require("tailwindcss"), + postcssPresetEnv({ stage: 2, autoprefixer: { cascade: false }, features: { "custom-properties": true } }), + require("autoprefixer"), + require("cssnano"), + header({ header: headerString }), + ]; + return src("src/index.scss").pipe(postcss(plugins)).pipe(sass()).pipe(dest(output)); +} + +function minify() { + return src(`${output}/index.css`).pipe(cleanCSS()).pipe(rename(`index.min.css`)).pipe(dest(output)); +} + +function stylesLive() { + styles().pipe(livereload({ start: true })); +} + +function livereloadStyles() { + livereload.listen(); + watch("src/**/*.scss", series(stylesLive)); +} + +exports.styles = styles; +exports.default = series(styles); +exports.watch = livereloadStyles; +if (process.env.NODE_ENV === "production") { + exports.build = series(cleanStyles, styles, minify); +} else { + exports.build = series(styles, livereloadStyles); +} + +// gulp.task("watch:styles", function () { +// livereload.listen(); +// gulp.watch("**/*.scss", ["styles"]); +// }); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/img/browser-icon.png b/frontend/micro-ui/web/micro-ui-internals/packages/css/img/browser-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..32e2488b00e5ca9770bb5485b9d7631bf8705538 GIT binary patch literal 1121 zcmV-n1fKheP)Px(8%ab#R9Fe^S6ygSM--kjcbhfl*IjL)4<%UZOHHx{(TFKA)HLKFFVZB`))-Oj zLlIevib_jfR7^<)5u~N1B+w{PNsDPIskpJRG>NX!NY;|l;vZVn_!GtK=I+k%T)T63 z_U_%EhlRdmUe1~GeRIy4duGnPm$CnOfExeNAy086BK9F-9RV)F{M@0nxxANuS9wyO zI9piQV8E+>(&*l!JPV8|Fp5J&HSyQ)BP4H;tC zk!f&)Prhp&bo6d9baj{skhAwxK-Cec9FLzZi?abF<*PhZ2PW#&xuKg0P@U#kL3Iuo z!?CAPqdgU=cqTe+Bq4^G06puAshsdv93~D;Cn5~NoTpl+Vw}MRb#Caf1Q>iy2PI-9 zL`h${w)tU5YVopYTXaxSHr!2BI!!<5ha4B(ywsVqoW>8MM~_ez_T zuI*!k1g<6gjp8uSjW zUpipNuRJzdf;w(OflH|NH-I}%jjS&pwBu%!KxOBpdcp8G-Qz;l3AO0-VOdW#MKJ9}W9Ax4n$ra&neX`&$xmK(L&Qo)#-Z5^}LD~dzbDh7?slRRpj8i}W@UNw* za8BV*)Shq4xhkm}MmT8Ss5V1So4`QR+s`!M%?XYHW@xo{xW#i`Iz7|$<`a!WGaXG! zdxj7qY#nMTr*c)?0)CWKlJUtojwxc{{M`i)XI!dofq n5_%#xXqPAVtUmjl#8vqM!@pNSmMi>A00000NkvXXu0mjf>1i0J literal 0 HcmV?d00001 diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/img/m_seva_white_logo.png b/frontend/micro-ui/web/micro-ui-internals/packages/css/img/m_seva_white_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..394e483de3afdce3e736232712c02e8ce2bf4975 GIT binary patch literal 10689 zcmdsd_g7Qj6KzN+B2^KQE*~iZ(xo>A5ki%Yv`_@3gbtw-6i}2RL3$GiAYEFJ9;HOO zhE8ZolM;$RC?VnTeSgJU@BT3N+_mmncV^DMXV0413C|3*8Lo3&2LJ#JV4Wu>008i6 z3CO=jePzG%q7AQZlmQxGvujsZ#I+Z1ubv@cW>$eFj)4~=s?#bA4*EfQ6io`LMfWv z{{^7R%E~RJC~AG)kS+Xnj0#}X#`=;|Y$g!^xC;P3d2AMvhhKnYy)e(l9PI5`z>J(8 zv(fXj-Fi%`dpq@^!=qPsU8i>{J)JUl{&4u3XR$xhy5VQX8k|&h7ePr2j2EE)1i$<3 zq2^8cw=7B%Bs_09b(m|LTjf^4b=AYD0yiG!_Qk_sn88B8nCeC(Uo5l6wf|2H#8jS! zQ!TW|ZMN@eS%~z6-YW538&6K~d}Q~Q1><|exzpBL%?9s_ZJDNRg{>G=l+IiHznqRJ zX^VFVn7;d85->q7z%Q$-Nhvh=nAtn^zZ_~%kKIjq4V<{i6P`vvIBi?3?H`I1*SF*~`#&s1(^DI8a+4Ybe}0_Yje{uL8{ z&vZ|Yy>gOzTTbp{5}i-ck@ihzXM2zIZZXw=IYG&1Jre$FUtaD~E8p%rl1W5yRZ5zz%VG=7W`9)5z;mVX02aCe6_Ugrxm)fNOq zlUAQ@GZ~I+moqVT_`DeYxYk=JJtXkoXI3Y#>IbF&=wy<+PCCsGt^5ZCF>`%+-*WDV z=HrXi*=eb-OIb@~{!nu4m+CGYpS_`(m4_Dsj?n~D$^qo43m8?{XOIcZbZ{*+9<7Nc zC0zzrAw88-1FjW?D@jvWMGW>sdYY&8YL?vDbknG&x82562#fM9xjl&1T(0d`DQqIt zLyVA9OEb|=)s0OPGjH6uBbPdMlX<3sQIP8$H)e7I>z5>*Pqok>B<(jSIutQFc1Jz- zr@*Wb;QhKPUS^yo=v1eZq`a%~%<28V*D}d%C%qW~S;PrY8G~WFZ}r24u2Tt9(NEqI z;=M!VysgXF#TPfGZlhon1W+Al1Yi zn%&Ygm+06OpF1%=+;-z?-LG_oY#2em{6?H7R?%FCN?BM86;;Lnx185TN=_%YdBXSX zI!6Sn6TIq}BJPAR?0@7b2l-0)s`@4&O~do`uQ~c_jXJnU?URcwNPn1~NjN%un)&?T z{dCK}Hi6^KOA+_?VJQ;i4_$BO9@Uc^zKMqA>scK>%s7t*av4V3Uhv^%6mFfy;^R>2 zp2W>gLy_1o4PGqpJ|Ulw&kiYhocMm-dm(P)ig~C5K@Eu-_v2i~cE{(8;>Q{G>o=wz zpycZ#1$}RPF|Rw!?hVAgSdK)iqMXMau0;wiU58T#7pPg;$ZyENI9=%z`VQq(krlU| zZW-0F&eihnk~7&w9nYJryQ6g8RBTo?NlNXqD4!_BFn|B|&j7HsW|$wcZeIsFO&^J< zser0lnL_4CDMBU&vGyA`%H(jIGhOLTvp$t)WA;MK8dmmQw2z9!1{t}UB%qXIUjK$# z{!Z3jn!B$a&GVGsD3in)QH@fdHiN{Wr=q@ob!pf59!TIQ9~BpfPK8k0ex3~&j%+%; zRN%DTO6VNDr|-^7L)Zzr2|bTP9){&Vx#k!;D+s9FP&NLN*TyEB`2?2BDQn;m`gPhp zwqk&=9n*56lp@Cff@}rd z;Z&#Y@bj`G*zH&;f%*I3KULuUAk&&3(P!NE(YMsSw>%xY&V8vr0X;anzD$S43U5N- zV&VBusQgZNH3|piC_b~D&+c129}6Y1Zr)j_cD@}^nO(=rBf4uXZ6dydRzX7J90suG z#qQdw5pHz>w5IRzN$|`oAFq>v5v|kUSY|=F528P-=l%?3Ot~$pJR3JGIaaYbpz(AH ztd8n)NDGRbQr&IowvPB$Hcij)H%L#LxT1jm3BSW5)-|=Q^8Mpcgu@|YFE=QPdY<7T zdrj{Z8?y415mf=`A~McTJne{hy^e`5@EM90o*Z&YzQWVRQi*dPBjR0U=8}e_w1v2c zxsN;TFOhXI?wUP&(Ra~*gC2jfrsyf@f*k+$A;_gkYORSA8UYGm?1oKfDn65f1}FiX zqAK{YWyy32%)=QX_+oc|bXj$+t{Oy3LcfH7CzbcDDUKVWriM%QBK4~3xYa^e?!}ie z6tung3X=g)-2CVg`e)erHqTPylkXp0h{g{2`oBl1)$VSRMIL+Yfp(a7fIE+J==E2X zz++X?7T1az8;k%MqYFpuwP)XBic#juDZnSz=e)Jkds#t8-`!erF^Dwzv!$Y#Ink;n z0q;yoP1*XuCKaD4DLO{{?q5d(2ciJ-ySj`_EYSz-GswIlg>s`%P89_1IjuR_?LmV| z`C@`@TA3Oa8V{XT zvMh2Ch%@{@l%=d1nI9VR(Gs5hqh`0@Iv&IS|P?QCX5xl3e`1X zp&(HQc?R;u`&_+MWegK#NmKd3|7t?yYcYH0+Wq>Q=d?0zB)m-6*uCh{)c-|AhX3jw zy;H5~67pc}L%7zXm996xe>FTjP8rSnwsG7=Bxk{pWH%x!nocKoTFzl@E0M}q-B)No zVA&SzY&VF1j#fjXlGLe&y6w$w6c1usl&E_vl(z?ZG~!w8InA(Z^%os z{+{cRdwypNx|J@`!ke=M1lL)Ozc29(nocynm1gES79x#&xHc1Yvw{Xwi(L7LL#R#A zS=*3o32Mx~w7#;EykCo0)NODQl<}XZCOfF-#e%v4+4zk#!xXdGSXsb@Ay(qwi}Z)y zzyhr{^d7Aj(*sf2r7faUHsVOp=3b|~ILI65UD>u#Hr^KI6ty{!+c6;y6L0piP5RM? zmq~g4vsvl)d!wi=(LS`jj?wFeIq}DAK=uE&)FYeZ!pLdKAzyu>W>I4Ra%*3v7=^un zd$ZPiuW05Ox)49k&6+_~Bpu$8-)_kefE%M))SIhDx%baM1*d(yOh1ZC^s{s#>S8^# zSYbLI;k+YeF2q?RhNnF(*(CT6p945d!j>jNdgBS2aJ=eX7}1REl<9TP!K=pj9Gq%3 zzcUr!HkZ{|Ib5DZwiDez3m#)pV(#gO+lbmNY!)9JKR#a|Q7gDRg^G3!ZyGrr3Hw3N z#+`PlLy6xQH&8Q#HI%&P$;o){iJw-y%GjP+6lriX@)C}h?is6lelkN2>EHXEp8e0- zOBthvu<%z`G2NwuS}JKd5%1!rab07=qK~lQ zmGa_T?^iWvp6h-UF$&^JOcvje^CHe%ba!5nCZ|%Wjd}yg5f?qYFH`l00=GA~-&ySz z{jo*(o7gPJM95>o&<5HM5!==6n% z$GmZ&QMAE@g^M$;WyZU;sszdMlM+%v!dq(8_RKm(_3wOPn@XsT2n~!7VJTCU-_y-e08c z0Gd8~sie^PyVpdwpP316r1g5~H&V6n<4x-2Q_&We#F7|I3l1F5(?rLGH}A&%@Lub? zsh(#jD9Q-5xU{V@Wum=$zuS|Tf^>^(O#~EX20rP}vU6;IYJJmZJ3FlKW$R-Eej2#+ zLz0k>P%;5v2;OL>ipAD{DF_khdNWCISyaDs5^n>~)N3oxeNDKeTn1TsKORWPvXoTd zAMAfO^Nw|%!t4>0IX+YT(|)w1+mZ*2PTRIiO0&;RSn=(*qHls2G6NN_^XN{U1xI^v z7T{=Nj~{9w`xZa;!N++r1V-To&XMLU_lmxG+QJx1=H92txU{hY6#%@ZPETxkfWhfU zI9G^6ILmT7(!byQf;}V&$!n3=coV0cYN1d$h;7CaBCzjz%?=I0c6PtF_Gr;kmODxB zOxd~SQ_o)>+C{wM__%iM)NFm&drx!atLO<@Deha5T}4WhTySJyR&mx4xG@}M#?1mR z;Gjm;S-)8zsG-xJOItq&SK6oQTiU1X|{F)-4L;;AI9}FSsRW68+^Lm z5TOnNT~%g1*R@M!S}ja0c_Bx8l*?J7_K&{B-2!bJ%i+dcxr7%|r?u5E;6|HvW}fi1 zsJA}P=v5LLlE$rWPQ*I|hVTTq!H_2NTY>Jt{c9DCOH{~!A*QrNQ$f7%LSZ1%mnE!m zX_W$NTLfGtSMyVG0H)j#a zse$##Z2`OK)2ma7tc6`iYsYv8Binfu?6C0<X?P3bhS_F!UA~p4&!~Nj$ZZqPXo{?YWh1;jZ1eoRig9nvzLcdO zL_hXWw3#%lCKu0CI{#=imco?s&7qUx^9AG#6y3r^<;h@+?2^})FG zH1AmGExGL+avp#SwzhHqU4Dh7D#f@J3U*+a+;yQik`&ojo{FkcK{04i+}d0DQ5F38 zc6FT!kV|}161?QIPL<>~vUm5`a<3^DZmAOnk%2sLuRwypla#nTsNu^6uE+fO26GOR z?jYnj6QqeW-k(g2@|6rtz8J|ga~CK*C^)x|x1AFn4YZE;bNkROh~8y)dT_VqKi7Mk z>KuNV6`)H{2d#oW7RMhc)}yeI7FF0|?kwAJ-!!l6Xo+(9>(I$7X^8t+1LNy))QeB3 zb3twl`K8=cRf8(~bGhJ}3ycay_-+b1*JfdW{_dtSS{vRs+ZZYy9+Nr+o9=(@+dgOmT!}7hE-{4S6^hS&zIdK7X_EB8rLYxl}(U zhDK%;=uWjPobB}ZTyp5N-)pc7T@HoJy+@RymQsby*6wACo=Q~K-EKbYT(gRtX~-{r zk`}@k>aiCspqZGiqeM5OhxN;U+x_Y=2IBTsW{8l%{^wz-x)5Mw_p48a-klus!{m0S zNo9GOkjI3`RB^|bQ>Gz%F6Q$4M{@=UH3XkwEz|LV?y?y;U62joErf^uaI~xRnF~uq zj>pIZ^m%@Jh;3L^L`6HbZ}~M@bO>oC+UV$Y&+44}-}7e0p$>9*DWYo>#L*b(UbqUU z%;m)2@Siu5NC0jjceNpP|CiH&(ox>khL;8aU3++d+B@i%qKQMxL-Y2a7ds8H&p{G4 zBsM~GMkYxJs{o30OSW3MFu}S>_qC;}cK)&sQOUa%Q~x(HP(Jx*KzvpcCK=*c(C@f>063C6cc~{ zq;8UP0fB#jdBE2lTlurxoSYwsodL6z^CFwOi3k1!gVTGP#rbha8XfcTa|>tFW%gCo zwwcNrcq24=i4e^Fwp(m6B~vW*=$LCje|Z|sz-kZq*?;{FlIdCGJ$#tiQfHxaz&dM^ z-I3=z@4a6Y)t7>REi>qU6jigN+4_2liD|ZUb1Mz9GU3etjKe{#BG1z>-%5J4@<72s zd{ew7laad1lPKE?oEvS9{tv@F8_Tb%A;M>?)sEq;tGwDy9#nbDp$1L@dH!oyX;SbR z-|MS@5+8&i@3A@2BF)v+IiDZh&A;D^1pbuxN3;8`6x||&iFg|Un}z8O22sPZGl;1t z8Y_SQc*fX-=MBol_{e#D-}u71zeDfmJ;dy6&Qo!E&fqonawSMHc*IA~1G128X%Y$C zr}=lp^j9d-QY#?n{0q0QAG;QwbwZ}j`!>j-?);if#Wwo`#^Qodf%4CfjfebV%h`A` zJ`%+b?U#+r_ITAal*pMj$%j*Rzy9V&Jub1o7y=u3g{{57jUmjAk(jgr(}J@ydMS%i zkDwu;v?z$4b;QD$jwr;u>bx_(X|vfqX`~RJ=V0|~65*fs@<*+4SZHVe<^07TYO~W`MZdiTJ>>4KVmv zrSMu)hrA9}1K0BGDkaj^du$Edp-T8j5zRzhukN>IuIKE?#k(H!`I`qKj+x4^(k@k>p&jF|xTiaCGSO-=5%v$BXT;Y~%f zkh@=kd%iJ_ogoEK&w6}3h@DE=Vq@uAEG|a^258w`5IeP z%xstOS4ag6&u%E#l6jlo(cKdHRGngcTgd<4`&=85g2pkwk6lt@GtPSTMt>&Q*2N>n z4Q8$11V1WI{&wt>yK`ITTyisYN*&aV|F{1djo}#{GpF1QAE(mAs&Z+b>Za0h9Ke0C~N(`#9l6j<&v+(bKcSA8CwTL^?ZkBO6(%XyEcNN%Gw8 z%}Tb(F#J{*nvh%3C4J}yhE(5i7C@=%I`z989y$j~Aolc2C9I&5N{~}D@ z42d+fkf62~>bjg5VNG=&P~LC{$(wRrPi$v#6~ zDsb-i=dNl#_3!9nd!`|H)FQr^4we)$aF*|uNizM7<&n*7g+ssN`l1im}Q&do2j>&v#a&P$zdG6@TBrM>q|drgRUkebQ>T_gyY< z{-{h_z^|(}uOMe}*`3SS>NQytubI{6&8Lc4`0SKd<}nINvEXvcu7MZ2yqi4Xw|hyX zsI)C=2d1k%3y{C`>&uW?fQOF6z0Qym>zd$@7)F#qjRUi7 zV_Z#YjJ5I7@das5v~+yu*WQ@=X+zZRCpL|$+aGoxR2c%Ob1&M6@a|`wF+)QGU(dYW zol5U-Ua#YgPK0_o9A2+i`gQ7N$x_{lh4f(usvOrNXa=8)vb5a=+f^HAX55LAvicuL`%T=XD z!MAF>i_SPsJn6xOMRNnM9^+`_$en}n8gLvx>623;>zdL@^!VvWa`sN1qCKXM(&47^ zRqhPeo*m$we3zdgDN-^jCVCpwhaQq!^i0KTOsh6|&HU#K*?9H`7GLma1ap4ac->Or z--C$KE^va3L+enZB#zI6`FQ3Oqr6Hpwg)joA{|lEiW!%B*je)YoO|SgsT4&Px|Xfu z#n|`bfOpo=On+q81y!`Ht-Qz`jywxuOTL84vP}MvbajPSbT2`D&O3PAwj4^~mB%*< zu{oVncHi__jCD=D>^L>s??&t7)``LGI4?cnsk%#B4hA4mou~q+@ zLHX4e;T8E7oE#xJn7JKYkNa=7Z~2}wZgk(*X2O374i)viy|0SHoG7th)tR%Qq^jFp z1R8V?d;k1G@T6|A>4*_Hh+?jJN4$NI@~Go_9X@{ETx&!L0HCG#pBBK40MR)QmoDw4 zbf9Xt{c^dfRfJcyt`}&1d{dU8!!7gu$&$;l#I@g2JxB&E34odhQ39pzNSsw2+~Cgs z^DuH=7n|OMa+1u>UR8gyIL*JH7eJLMcu0vOn(41pu|k%>|6Mh5j<1N{Pm1D>Tjn9t z9Mi`dXoa4PBy^d*^03WTs>j-m*(zn?cqbE8*AUr(-+(#$;sW3s>u)Ff%c>L=`>9a% zk*;M{&_*0D7YiEg>9d9c^g&NM9MH^ctLbV%GE2*Pi@ihlibScDHdIc z>eBt5Ie1Mdgg%d!Ybr@fK}Dkmkg&|3+~|g8^+gOa@n*SkHJnZt>%?x)Zk{wd$EQy`54Z>^X^0*lZx^1 z7|s|X7_(3Q{xzW+X^d-6%Xk9gJQ;I+Pk6X8)&xo20aJPU%T>E$;*d+x%0db`c-)s_o2xm_e4{}NMagPtbkscIHKJ>L@V%Fho;7>8 zXFOM!h#+8vewZukIYc@`wHB(I+0M)Y|H*A5M}DMqcyWJIGa!~V*?3k?k|FEyahXI~ z>vQZGzT+8|6%|e2A>yp2{DDB#apUwAa;$}=mtcWD)Zs*<1XOM8)on6Z!C_4Ye}5OY zDR|ka58a-B8b<%Y8MsfmtcQZ71s-j6%@D@HLnI$6vRcon>J`iQVci^sfUkQKM=6;c z)30L@-gWe*elmqfOI%lO2c|k6j)#v!3k~OFFKtYWP7@|{U|6G<7mb!e($+!375x74 zf`UvsZJ*OXI!YMA#(?~DJ0^uef-$n8ujNYwL)@#T^CnJFm~P%bC!l2VyV1NqA0GWR z;-=-%h$a>x^`v{x?o`NWl}Jae6w+lf75IEy`oc1-01H2JJEvNm)r4q<(g9-SN{^m zSCu;p@bb|F&t&T?=*`dW+Z4PR4`&f!L;Rg|FFhr`&FNzYR+ZJ{vpJPJFS-+vhc9a? zU&to`T65`x^z{M#Qf<$hJ6Hf$s*QsmueKL`{gNwP`Se-cbhdiSrl+ypykyb?jC0mN zB8B>v!$m?w%g~DKHYfT<6C}2x>MCACS1NqLogb=hGLU9{m`oFZ4>! zT3;mosKl@r@;b=>vbP7(X6^kPO9NJAIv*%SEMgT75GDCR|2wtwwjsd-(6UqST3t8? z^T#!bRAQ&p(`$+!(O@)DS@A7W9pH11b%u82jB1jDvSx6N`(3*d@8++sEUn3FRjyGe z%Y>%?1OcL1(LdvOAB;3}d?u6_^9|Pf|H?X>xd4e5NRP#8Kt3NU#mGINwintA0hi?S z=wp5Oxv3-GMNIx~D-vRG=3g*q(+Scr5)Vd*gOnPu6U7jnumU7z&`wY3y;*cg-Ib%j zWA}S+CNWzlO~m_;;yzE?(Wv>ad}E6i^$B(q+uybq`dR!wrjtLi9S71=x)~w^J>syU zBQd$RL>W%&waEnxm&wX0jNW5y+lmv_seub&PYOx@qZ0#(wjH(m5J+8klvL-_aUl>T z$Nl?u$vO3{)4YKP!ucZ)tBaC>$z|4h)81d{6b!Kxi1ibZgr~yOns8H{a;Ec1n0vQc zv|KBDE!DHVy9Yu5M^5(FDUxcEz|Ck06ab&0-GBB-b5iWl^ zyIjts&lyoI1&$0EE^P%3D(kXlE`=;>wYFuNr&nd`2^DCwA=@_1*WOB{+AamGbwdzQ zR2L=qATZ}r@ZI#Hh4|fIzV@V}Z?INmU7+852Kbx}r~N@L0sq7Unp>6qOlFs|R=~WP z=tN_)g1VYQdrACfR8p+WZ~WjSP_no6k+GVTrYgYRIoryIOFHPvGv@AM<$?Zc3p6^>?& zdyP`qjsDJ>#PQlJKT82+*H5^|3A2GuVp8x;= literal 0 HcmV?d00001 diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/img/mseva-demo.png b/frontend/micro-ui/web/micro-ui-internals/packages/css/img/mseva-demo.png new file mode 100644 index 0000000000000000000000000000000000000000..50a5251726345fd23f691a1cf1cb7feede260e83 GIT binary patch literal 2460 zcmV;N31jw&P)004R>004l5008;`004mK004C`008P>0026e000+ooVrmw00002 zVoOIv0RM-N%)bBt00(qQO+^Rf2?q!t4}vi3O8@`}q)9|URA@u(nQ4$z)fqs~?b!tf zn8|=3D!VH#At-@h)W}vEvl&BynpC1hjj<|0gBvlJpmB>>QNaQ=Mg&32s8wN6mMEg4 zr4p1ywy_WtS)4(by}M6-^qZa@7#ty3`lC-*SHJsh_ucQ^?cIhfS+Zowk|j%)EC-7P z_H51O%OcjA!PlBLoZFhomqjiZqYp{e1p(|#83M2+eEPY*`^7*{x{|{#)`!a0tp5+f zSNPyP%)4FVYHzm?9O~1oU-CD$Y0cwcvD7PDv-#3+ zto5qa`9t%3&7_SaoY9*1zBt%&8`4n{);Qh6Tk|?NzRJYqaxQrQnn zNbb+IC2YrC976zhQcEd?6mk*oaz|^PhXxDz8@-n$N)z91jsW4B{M0D54jaF@vY<-kQt7k;@d0<44FW z<^=r%J4h|@@+S8-ni*pRU0KV28O4e0W>J_2cHyTSOErs`lUiChmKg8^_tOBBQ_gc7 zPkY)^5k)$ip>$ve^TQGVOE`~0-VDprb)CQ<8kiThf&~m`5XDsR3NMCwS|`S*jOJsC zC}Rv`nCb-sLW9t+&<+Z?^y(V71jQGC%Uj@n2S3?GUicnO0e6y>;&K5sPWY zzH^*yeAlgZ0x)Kwe>d*0GxRZgI>62ulJ<52bL{0AmPN9j4%oM++RH&6YtvK~iSzuW z_xSzj`cm)q2N~L8*V~*LH)oXM4gv5|RkwPX9oYwO-7CgTU|W}~b)FH~oZxPCy`{!{ zd@uVy?-g%j#st8k>D+=#vPs37Q0T>5539jERPzp#hV=)X&wczyW1k&CTDnsCpSGI zds(5zebxy+YeL;=?{sa^^5G4t-Us%!LDfax>RglRCcn|_o?A^EIM;;z0Q{yq-Qta2 z?PB%%NIy&c%&A`O{noh4Wv=uF$NGjkF|z66YLia&N*}br5A2;;;o7Ld&s*U8(e<3P zK9#t-s7H>7vVS3f=UAgIOAR(Jx7H@A{kLaFF|JXQPKZjAR2>VRYL&Xm!@&ZVsr8-- zc66NMy~;uW=c)}3B!e%MxM}K8FwZ$wMJa6S+vx#4Q@t^=y;a?8R{*GG&ecd6Gz zHkYc8q`QNKz7sWdrg`b>+3D(2iTfb6I$Gvt^`q2qw1XSe4YrMJhd9?No2YgSfKRH` zUgl7TJH&A&)mdP!3)H0NgWtAZU6x8#6t9OrcD$?9q{GPI3nlJO^#ZWJNvEf!*Qg@^ zoMqCJBIz)7O4??*J8TD*`k|{+YXF$*GAlhg8tI|diQGqfHgRuga3YiFz$WgYIaSmE zP)8N8n>`t&G~q=Tay$bW%(v)9Aw}Ho%V7;i0EJ8;00IFhg%Ecp=MWg_97d7{%nr3+ zj2>LhP`qIoDI^Az(V1sLs^x^ZZ*w|F z<~CY|r(H{TR)lg0PrHV0tPJHeCqV*$I0+z0vY8YxpBTwd&q`J@)s771PxPdO@3AIT z4br$bOh#XLk*##*yBx<5;8RjlL?33;mn3m&s3MPc954osB1r{s7;qFNQR)+{OW#Km zA^J9!Qnqc$p)$j&0w_)=4#Emnq^^vyk&mf1gadiP8sk^=WUEuc9)Pfo>2~KFGJlB@ zBM|>Q#|(B-OP7pX9EohpNL&WTaR+^Po$L9yMSaUiK38!Pu*XM9QQ#{H2x=Lr<>J4(1cQ~>4Fb2{f0YN%Ist}PG=HV zu$ZX;tYJ21@mo9E!7|41PfF7sdv9tRr2!!9;z7!|#Um`S6F1V6so|5BdfZ_&Zt;%K zkTws#_iWHun#ypFrUN%pPl5tsKm+r56?m1`_zwM;Nd@gF0xH=a1*r5nP6SB3Y611U z$8oghVJc}yAqjHW`z~4{K|3Z>M=4!_d5nvujRq&ug9(ga9bGt^*U}#G^lT>$8Ih7C zqgn281~Qtyyia%fGoQ&Vp8!|$CbcA}PR&5+FqvIDNjx1EBuLrNv>dYXza;^HT;Yz6mceYJfGOBluse`nI~VCP)dw?wuNSUJTR9dDWaB-_CD({ zkD{iSk*pn^2y6=##%M#bc{EG8C`=~HfpRcC?ojd7{n>FSNHm`EWjP?s`SSh<%915Z zmMmGaWcix&KR&LSnF>P{KmY&$C3HntbYx+4WjbSWWnpw>05UK#FfA}SEigA!FgQ9h zF*-3dD=;uRFfg5$@-YAa03~!qSaf7zbY(hiZ)9m^c>ppnGB7PLIV~_ZR4_O?Gch_b aH7hVMIxsNo%1Vs@0000", + "engines": { + "node": ">=14" + }, + "cssConfig": { + "prefix": "" + }, + "scripts": { + "start": "gulp build", + "build:prod": "NODE_ENV=production gulp build", + "prepublish": "yarn build:prod", + "deploy": "gulp && cp -R svg example && cp -R img example && gh-pages -d example" + }, + "browserslist": [ + "> 3%", + "last 2 versions" + ], + "style": "./dist/index.css", + "dependencies": { + "node-sass": "4.14.1", + "normalize.css": "8.0.1", + "postcss-scss": "3.0.5", + "tailwindcss": "1.9.6" + }, + "devDependencies": { + "autoprefixer": "10.4.14", + "cssnano": "4.1.11", + "gh-pages": "3.2.3", + "gulp": "4.0.2", + "gulp-clean": "0.4.0", + "gulp-clean-css": "4.3.0", + "gulp-livereload": "4.0.2", + "gulp-postcss": "9.0.1", + "gulp-rename": "2.0.0", + "gulp-sass": "4.1.1", + "postcss": "8.4.26", + "postcss-cli": "8.3.1", + "postcss-header": "2.0.0", + "postcss-import": "12.0.1", + "postcss-prefixer": "2.1.3", + "postcss-preset-env": "6.7.1", + "postcss-scss": "3.0.5", + "sass": "^1.26.11" + }, + "files": [ + "dist/index.min.css", + "dist/index.css", + "svg/**/*.svg", + "img/**/*.png", + "src/**/*.scss", + "src/**/*.css" + ], + "keywords": [ + "digit", + "egov", + "dpg", + "digit-ui", + "css" + ] +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/postcss.config.js b/frontend/micro-ui/web/micro-ui-internals/packages/css/postcss.config.js new file mode 100644 index 0000000..18485de --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/postcss.config.js @@ -0,0 +1,55 @@ +const postcssPresetEnv = require("postcss-preset-env"); + +module.exports = { + parser: require("postcss-scss"), + plugins: [ + require("postcss-import"), + require("postcss-nested").default, + require("tailwindcss"), + require("postcss-preset-env"), + require("autoprefixer"), + // require("cssnano"), + ], +}; + +// const fs = require('fs'); +// const { name, version, author, cssConfig } = JSON.parse(fs.readFileSync('package.json')); + +// const header = ` +// @charset "UTF-8"; +// /*! +// * ${name} - ${version} +// * +// * Copyright (c) ${new Date().getFullYear()} ${author.name} +// */ +// `; + +// module.exports = (ctx) => { +// const prefix = ctx.env === 'compat' ? '' : cssConfig.prefix; +// const devMessage = `🎉🎉🎉🎉 \n${name} ${ctx.env} build was compiled sucessfully! \n`; + + +// return { +// map: ctx.options.map, +// parser: ctx.options.parser, +// plugins: { +// 'postcss-import': { root: ctx.file.dirname }, +// 'postcss-prefixer': { +// prefix, +// ignore: [/\[class\*=.*\]/], +// }, +// 'postcss-preset-env': { +// autoprefixer: { +// cascade: false, +// }, +// features: { +// 'custom-properties': true, +// }, +// }, +// cssnano: ctx.env === 'production' || ctx.env === 'compat' ? {} : false, +// 'postcss-header': { +// header, +// }, +// }, +// }; +// }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/CardBasedOptions.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/CardBasedOptions.scss new file mode 100644 index 0000000..f2607b0 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/CardBasedOptions.scss @@ -0,0 +1,46 @@ +.CardBasedOptions { + box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.16); + @apply bg-white mb-md px-sm py-md mx-sm rounded w-full; + .headContent { + @apply flex justify-between mb-lg; + h2 { + @apply text-heading-s font-bold text-text-primary; + } + p { + @apply text-link text-primary-main font-medium cursor-pointer; + } + } + + .mainContent { + @apply flex justify-evenly; + .CardBasedOptionsMainChildOption { + width: 25%; + @apply text-center; + .ChildOptionImageWrapper { + margin: auto !important; + background: rgba(244, 119, 56, 0.12); + mix-blend-mode: normal; + padding-top: 14px; + @apply h-12 w-12 rounded-full cursor-pointer; + svg { + height: 20px; + width: 20px; + fill: theme(colors.primary.main); + margin: auto; + } + } + .ChildOptionName { + font-size: 12px; + line-height: 14px; + padding-top: 1rem; + } + } + } +} + +@screen dt { + .CardBasedOptions { + width: calc(50% - 16px); + @apply p-md; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/CitizenHomeCard.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/CitizenHomeCard.scss new file mode 100644 index 0000000..45df955 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/CitizenHomeCard.scss @@ -0,0 +1,56 @@ +.CitizenHomeCard { + @apply bg-white mx-md p-md mb-lg; + + .header { + @apply flex font-bold text-heading-l text-text-primary justify-between pb-sm; + + svg { + width: 33px; + height: 33px; + } + } + + .links { + @apply text-heading-s text-primary-main; + + a { + @apply block pb-sm; + } + } +} + +@screen dt { + .citizenAllServiceGrid { + display: flex; + flex-direction: column; + justify-content: center; + flex: 1; + } + + .CitizenHomeCard { + @apply p-lg; + .header { + @apply pb-lg text-heading-l-dt; + svg { + @apply w-12 h-12; + } + } + + .links { + @apply grid grid-cols-4 gap-px; + .linksWrapper { + height: 25px; + margin-bottom: 0.5em; + } + a { + @apply pb-md; + padding-left: 0.2em; + margin-bottom: 16px; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + min-width: 0; + } + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/EllipsisMenu.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/EllipsisMenu.scss new file mode 100644 index 0000000..0eb243a --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/EllipsisMenu.scss @@ -0,0 +1,17 @@ +.ellipsis-menu-wrap{ + @apply relative; + + .menu{ + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); + @apply absolute right-0 bg-white z-30; + .item{ + @apply flex items-center justify-between p-sm; + &:hover{ + @apply bg-grey-mid cursor-pointer; + } + svg { + margin-right: 10px; + } + } + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/EventCalendarView.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/EventCalendarView.scss new file mode 100644 index 0000000..58e6d3f --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/EventCalendarView.scss @@ -0,0 +1,10 @@ +.EventCalendarView{ + .MonthViewInEventCalendar{ + @apply bg-primary-main text-legend text-white font-medium text-center py-sm; + } + + .DateViewInEventCalendar{ + @apply bg-grey-mid text-heading-l font-bold text-primary-main text-center py-md; + } + +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/FAQ.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/FAQ.scss new file mode 100644 index 0000000..48b6568 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/FAQ.scss @@ -0,0 +1,64 @@ +.searchInputFAQs { + @apply mr-lg; + margin-bottom: 10px; + input{ + margin-bottom: 0; + background: border-box; + @apply pr-xl; + } + } + +.faq-page{ + width: 92%; + margin: 16px; +} + +.faqs{ + cursor: pointer; + .faq-question{ + font-weight: 400; + margin: 16px; + background: #fff; + justify-content: space-between; + display: flex; + font-size: 16px; + } + + .faqicon{ + float: right; + } + + .faq-answer{ + background: #fff; + overflow: hidden; + margin: 5px; + @apply text-form-field text-text-secondary mb-sm; + + span { + display: block; + font-size: 14px; + font-weight: 400; + margin: 0px 12px 5px + } + } + .cs-box-border { + height: 1px; + position: relative; + border-bottom: 1px solid lightgray;; + background: lightgray; + margin-left: 16px; + margin-right: 16px; + } +} + +.faq-list{ + background: #fff; + margin: 5px 0; + padding-top: 4px; + padding-bottom: 4px; +} + +.rotate { + transform: rotate(90deg); +} + \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/OnGroundEventCard.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/OnGroundEventCard.scss new file mode 100644 index 0000000..13468a6 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/OnGroundEventCard.scss @@ -0,0 +1,72 @@ +.OnGroundEventCard{ + box-shadow: 0px 1px 2px 0px #00000029; + @apply bg-white mx-sm mb-md p-md cursor-pointer; + + .EventCalendarView{ + width: 100px; + @apply inline-block mr-md; + } + + .EventDetails{ + width: calc( 100% - 116px ); + @apply inline-block align-top; + + h2{ + @apply text-caption-m font-bold mb-md text-text-primary; + } + + .EventLocation{ + @apply flex mb-md; + svg{ + @apply h-4 w-4; + } + p{ + @apply text-body-s text-text-primary ml-sm; + } + } + + .EventTime{ + @apply flex ; + svg{ + @apply h-4 w-4; + } + p{ + @apply text-body-s text-text-primary ml-sm; + } + } + + .EventCategory{ + p{ + @apply text-body-s text-text-primary ; + } + } + + } + + +} + +@screen dt{ + .OnGroundEventCard{ + .EventDetails{ + .EventLocation{ + p{ + @apply text-body-s-dt; + } + } + + .EventTime{ + p{ + @apply text-body-s-dt; + } + } + + .EventCategory{ + p{ + @apply text-body-s-dt; + } + } + + } + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/PageBasedInput.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/PageBasedInput.scss new file mode 100644 index 0000000..b2ba959 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/PageBasedInput.scss @@ -0,0 +1,29 @@ +.PageBasedInputWrapper { + .SubmitBar { + z-index: 60; + @apply p-sm fixed w-full bottom-0 left-0 text-right bg-white; + } + .SubmitBarInCardInDesktopView { + @apply hidden; + } + label { + margin-left: 0 !important; + } +} + +@screen dt { + .PageBasedInputWrapper { + .SubmitBar { + @apply hidden; + } + .SubmitBarInCardInDesktopView { + @apply block; + } + .card { + max-width: 960px; + } + button { + max-width: 240px; + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/PopupHeadingLabel.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/PopupHeadingLabel.scss new file mode 100644 index 0000000..c8e80a5 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/PopupHeadingLabel.scss @@ -0,0 +1,15 @@ +.popupModalHeading{ + @apply flex gap-3 mb-lg; + .headingIconAndLabel{ + @apply flex gap-3 items-center; + svg{ + @apply w-6 h-4; + } + h3{ + @apply text-heading-l font-bold; + } + } + .popupResetFormButton{ + @apply p-sm border border-solid border-text-primary border-opacity-25 self-center; + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/PropertySearchForm.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/PropertySearchForm.scss new file mode 100644 index 0000000..47f1f00 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/PropertySearchForm.scss @@ -0,0 +1,58 @@ +.PropertySearchForm { + .pt-search-action { + @apply w-full; + display: flex; + margin-right: 10px; + justify-content: end; + align-items: center; + .pt-search-action-submit button { + width: 100% !important; + } + .pt-search-action-reset { + text-align: right; + cursor: pointer; + } + } + + .PropertySearchFormSwitcher{ + border-bottom: 1px solid theme(colors.border); + cursor: pointer; + margin-bottom: 20px; + display: flex; + .non-selected { + color: theme(colors.text.secondary); + font-weight: 400; + } + .selected { + color: theme(colors.primary.main); + font-weight: 700; + padding-bottom: 10px; + border-bottom: 2px solid theme(colors.primary.main); + } + span { + margin-right: 20px; + } + } + + + .form-field { + width: 30% !important; + margin-bottom: 20px; + } + @media (min-width: 780px) { + .pt-form-field{ + width: 30% !important; + margin-bottom: 20px; + } + } + @media (max-width: 780px) { + .form-field{ + width: 100% !important; + margin-bottom: 15px; + } + .pt-form-field{ + width: 100% !important; + margin-bottom: 15px; + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/SearchForm.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/SearchForm.scss new file mode 100644 index 0000000..41f3b21 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/SearchForm.scss @@ -0,0 +1,56 @@ +.search-form-wrapper{ + @apply flex flex-wrap justify-between bg-white mb-lg py-lg pl-lg; + .form-field{ + width: calc( 25% - 16px ); + @apply inline-block mr-md align-middle; + } + .SubmitAndClearAllContainer{ + @apply w-full; + .submit{ + right: 36px; + margin-top: 22px; + margin-left: -16px !important; + @apply flex flex-row-reverse items-center w-full align-middle text-center !important; + button{ + margin: 0; + @apply inline-block w-1/4 !important; + } + p{ + @apply cursor-pointer text-link text-focus w-1/4 inline-block ; + } + } + } + .submit{ + right: 36px; + margin-top: 22px; + @apply inline align-middle text-center !important; + button{ + margin: 0; + @apply inline-block w-full !important; + } + p{ + @apply cursor-pointer text-link text-focus w-full inline-block ; + } + } + .pt-property-search{ + justify-content: unset; + } + +} + +@media (min-width: 780px) { + .search-form-wrapper{ + .pt-form-field{ + width: 30% !important; + margin-bottom: 20px; + } + } + } + @media (max-width: 780px) { + .search-form-wrapper{ + .pt-form-field{ + width: 100% !important; + margin-bottom: 15px; + } + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/SearchOnRadioButton.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/SearchOnRadioButton.scss new file mode 100644 index 0000000..1f9e2e5 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/SearchOnRadioButton.scss @@ -0,0 +1,10 @@ +.SearchOnRadioButton{ + svg{ + fill: theme(colors.text.secondary); + width: 24px; + height: 24px; + top: 8px; + right: 8px; + @apply absolute; + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/StandaloneSearchBar.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/StandaloneSearchBar.scss new file mode 100644 index 0000000..69dd018 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/StandaloneSearchBar.scss @@ -0,0 +1,10 @@ +.StandaloneSearchBar{ + @apply bg-white flex rounded-3xl px-md py-sm w-full; + svg{ + fill: theme(colors.text.secondary); + @apply mr-md; + } + input{ + @apply w-full mr-md outline-none; + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/TimeLine.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/TimeLine.scss new file mode 100644 index 0000000..8547f22 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/TimeLine.scss @@ -0,0 +1,68 @@ +.timeline-container { + @apply flex; + margin: 0px 8px 15px; + .timeline-checkpoint { + @apply relative flex-1; + z-index: 1; + } + + .timeline-content { + @apply flex flex-col items-center; + + span { + text-align: center; + color: white; + } + + .secondary-color { + color: theme(colors.text.primary); + padding: 5px; + font-size: small; + } + } + + .line { + @apply absolute; + top: 12px; + left: calc(50% + 8px); + right: calc(-50% + 8px); + border-top: 4px solid theme(colors.border); + z-index: -1; + } + + .circle { + width: 24px; + height: 24px; + background-color: #B1B4B6; + border-radius: 50%; + text-align: center; + } + + .active { + background-color: theme(colors.primary.main); + border-color: theme(colors.primary.main); + } +} + +.TLComments{ + max-width: 360px; + @apply mb-sm p-sm bg-grey-light; + h3{ + @apply font-bold text-caption-m; + } + p{ + @apply text-body-l; + } +} + +@screen dt{ + .TLComments{ + width: 360px; + h3{ + @apply text-caption-m-dt; + } + p{ + @apply text-body-l-dt; + } + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/WhatsNewCard.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/WhatsNewCard.scss new file mode 100644 index 0000000..395b2fc --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/WhatsNewCard.scss @@ -0,0 +1,13 @@ +.WhatsNewCard{ + box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.16); + @apply rounded bg-white border-primary-main border-l-4 border-solid p-sm; + h2{ + @apply text-body-l text-text-primary font-medium mb-xs; + } + p{ + @apply text-form-field text-text-secondary mb-sm; + } + a{ + @apply block text-form-field text-primary-main mb-sm + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/actionLink.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/actionLink.scss new file mode 100644 index 0000000..46a1f44 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/actionLink.scss @@ -0,0 +1,3 @@ +.action-link { + @apply text-primary-main text-text-btn mr-lg !important; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/actionbar.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/actionbar.scss new file mode 100644 index 0000000..18c905c --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/actionbar.scss @@ -0,0 +1,97 @@ +.action-bar-wrap { + box-shadow: rgba(0, 0, 0, 0.16) 0 -2px 8px; + max-width: 480px; + z-index: 100; + + @apply left-0 bottom-0 w-full bg-white py-sm px-sm fixed text-right; + + div { + @apply w-full; + } + .menu-wrap { + @apply absolute bg-white text-left mb-xs z-30 cursor-pointer; + bottom: 45px; + box-shadow: rgba(0, 0, 0, 0.14) 0 8px 10px 1px, rgba(0, 0, 0, 0.12) 0 3px 14px 2px, rgba(0, 0, 0, 0.2) 0 5px 5px -3px; + width: calc(100% - 16px); + right: 8px; + + div { + @apply h-12 pl-sm py-md text-body-l text-text-primary; + + &:hover { + @apply bg-grey-mid w-full; + } + } + } +} + +@screen dt { + .action-bar-wrap { + box-shadow: rgba(0, 0, 0, 0.16) 0 -2px 8px; + left: 0; + max-width: none; + z-index: 999; + + @apply fixed bottom-0 bg-white py-sm pr-lg text-right; + + div { + width: calc(100% - 16px); + } + + .menu-wrap { + bottom: 45px; + top: unset; + box-shadow: rgba(0, 0, 0, 0.14) 0 8px 10px 1px, rgba(0, 0, 0, 0.12) 0 3px 14px 2px, rgba(0, 0, 0, 0.2) 0 5px 5px -3px; + @apply absolute h-auto bg-white text-left mb-xs z-30; + width: 240px; + right: 24px; + + div { + @apply h-12 pl-sm py-md text-body-l text-text-primary; + + &:hover { + @apply bg-grey-mid w-full; + } + } + } + } +} + +.action-bar-wrap-registry { + + div { + @apply w-full; + } + .menu-wrap { + @apply absolute bg-white text-left mb-xs z-30 cursor-pointer; + box-shadow: rgba(0, 0, 0, 0.14) 0 8px 10px 1px, rgba(0, 0, 0, 0.12) 0 3px 14px 2px, rgba(0, 0, 0, 0.2) 0 5px 5px -3px; + width: 160px; + right: 60px; + + div { + @apply h-12 pl-sm py-md text-body-l text-text-primary; + + &:hover { + @apply bg-grey-mid w-full; + } + } + } + + .search-add { + padding: 12px 16px; + color: rgb(244, 119, 56); + display: flex; + cursor: pointer; + } + + .search-add-icon { + background: rgb(244, 119, 56); + border-radius: 50%; + height: 24px; + width: 24px; + display: flex; + justify-content: center; + align-items: center; + margin-left: 10px; + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/bannercomponents.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/bannercomponents.scss new file mode 100644 index 0000000..0433dc0 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/bannercomponents.scss @@ -0,0 +1,136 @@ +.success-wrap, +.emp-success-wrap { + @apply block bg-success w-full text-center text-white pt-md pb-sm mb-md; + + header { + @apply block mb-sm font-rc font-bold text-heading-xl; + } + + div { + img { + padding: 13.67px; + margin-left: auto; + margin-right: auto; + @apply border border-solid border-white rounded-full h-16 w-16 bg-white mb-md; + } + + svg { + padding: 13.67px; + margin-left: auto; + margin-right: auto; + @apply border border-solid border-white rounded-full h-16 w-16 bg-white mb-md; + } + + svg.payment-svg { + border: unset; + background-color: unset; + @apply rounded-full; + } + + h2 { + @apply font-bold text-caption-m mb-sm; + } + + p { + @apply font-bold text-caption-l; + } + } +} + +.error-wrap, +.emp-error-wrap { + @apply block bg-error w-full text-center text-white pt-md pb-sm mb-md; + + header { + @apply block mb-sm font-rc font-bold text-heading-xl; + } + + img { + margin-left: auto; + margin-right: auto; + padding: 13.67px; + @apply border border-solid border-white rounded-full bg-white h-16 w-16 mb-md; + } + + svg { + margin-left: auto; + margin-right: auto; + padding: 13.67px; + @apply border border-solid border-white rounded-full bg-white h-16 w-16 mb-md; + } +} + +@screen dt { + .success-wrap { + header { + @apply text-heading-xl-dt; + } + } + .emp-success-wrap { + width: calc(100%); + header { + @apply text-heading-xl-dt; + } + } + + .error-wrap { + width: 100%; + header { + @apply text-heading-xl-dt; + } + } + + .emp-error-wrap { + width: calc(100%); + header { + @apply text-heading-xl-dt; + } + } +} + +.photos-wrap { + max-width: 640px; + @apply flex pt-md; + + img { + width: calc(33% - 9.333px); + margin-right: 14px; + } + + svg { + width: calc(33% - 9.333px); + margin-right: 14px; + } + + .last { + width: calc(33% - 9.333px); + } +} + +.banner { + @apply flex justify-center items-center; + height: calc(100vh - 80px); + background: linear-gradient(rgba(11, 75, 102, 0.8), rgba(11, 75, 102, 0.8)), var(--banner-url) center center; + + .bannerCard { + min-width: 400px; + } + .bannerLogo { + width: 80px; + height: 40px; + object-fit: contain; + padding-right: 10px; + margin-right: 10px; + border-right: 1px solid theme(colors.text.primary); + } + .bannerHeader { + @apply flex justify-center items-center; + margin-bottom: 24px; + } +} + +.banner-container { + flex-direction: column; + justify-content: center; + align-items: center !important; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/body.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/body.scss new file mode 100644 index 0000000..8965c86 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/body.scss @@ -0,0 +1,144 @@ +body { + @apply bg-grey-bg; +} + +.body-container { + @apply bg-grey-bg h-full min-h-screen overflow-x-hidden; +} + +.navbar { + @apply text-white bg-secondary p-md w-full mb-md; + img { + height: 24px; + } +} +/* .navbar-header{ + @apply text-navbarheader float-left px-sm +} + +.navbar-subheader{ + @apply font-light px-sm border-solid border-l border-white border-opacity-100 +}*/ + +.h1 { + @apply text-heading-l text-text-primary font-bold mb-md ml-md; +} + +.link-label { + @apply block text-link text-primary-main mb-md ml-md cursor-pointer; + + &:hover { + @apply text-primary-main; + } +} + +.back-btn { + width: fit-content; + @apply block border-solid border-b border-text-primary font-rc text-text-primary text-text-btn ml-sm mt-md; + + label { + @apply inline mr-sm align-middle; + } + + p { + @apply inline float-right; + } +} + +.bread-crumb { + font-size: 14px; + color: theme(colors.text.secondary); + display: flex; + margin-bottom: 10px; + list-style: none; + padding: 0; +} +.bread-crumb--item { + margin-left: 5px; + + &:not(:last-child):after { + content: " /"; + } + + button { + outline: none; + } + + .last { + color: theme(colors.text.primary); + } +} + +.back-btn2 { + cursor: pointer; + width: fit-content; + @apply flex border-solid border-b border-text-primary font-rc text-text-primary text-text-btn ml-sm mb-md; + + img { + @apply flex; + } + + svg { + @apply flex; + } + + p { + @apply flex; + } +} + +@screen dt { + .employee-app-container { + @apply w-full; + } + + .app-container { + width: 100%; + form { + .card { + max-width: 960px; + h2 { + text-align: left; + } + .field-container { + max-width: 540px; + } + button { + max-width: 240px; + } + .input-otp-wrap, + .card-text-button { + text-align: left; + } + } + } + } + + .h1 { + margin-left: 0; + @apply text-heading-l-dt; + } + + .link-label { + margin-left: 0; + } + + .back-btn { + margin-left: 0; + } + + .back-btn2 { + margin-left: 0; + } +} + +.body-container::-webkit-scrollbar { + display: none; +} +.audit-card { + width: 80%; + margin-left: -21%; + margin-right: -27%; + max-height: 120px; + margin-top: 90px; +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/buttons.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/buttons.scss new file mode 100644 index 0000000..14312a2 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/buttons.scss @@ -0,0 +1,101 @@ +.selector-button-primary { + @apply h-8 bg-primary-main text-center border-b-2 border-input-border border-solid outline-none px-lg; + + &:focus { + @apply outline-none; + } + + h2 { + @apply font-rc font-medium text-legend text-white; + } +} + +.selector-button-border { + @apply h-8 bg-border text-center border-b-2 border-input-border border-solid outline-none px-lg; + + &:focus { + @apply outline-none; + } + + h2 { + @apply font-rc font-medium text-legend text-text-primary; + } +} + +.input-mirror-selector-button{ + @apply h-16 bg-border text-center border-b-2 border-input-border border-solid outline-none px-lg !important; + + &:focus { + @apply outline-none; + } + + h2 { + @apply font-rc font-medium text-legend text-text-primary; + } +} + +.selector-button-primary-disabled { + @apply h-8 bg-primary-main text-center border-b-2 border-input-border border-solid outline-none px-lg opacity-50; + + &:focus { + @apply outline-none; + } + + h2 { + @apply font-rc font-medium text-legend text-white; + } +} +.submit-bar:focus { + @apply outline-none !important; +} + +.jk-digit-secondary-btn { + width: auto; + height: 40px; + background: theme(colors.white); + border: 1px solid theme(colors.primary.main); + padding: 12px; + color: theme(colors.primary.main); + display: flex; + align-items: center; + font-size: 19px; + cursor: pointer; + svg { + margin: 0 10px; + } +} +.jk-digit-primary-btn { + width: auto; + height: 40px; + background: theme(colors.primary.main); + border: 1px solid theme(colors.primary.main); + padding: 6px; + color: theme(colors.white); + display: flex; + align-items: center; + cursor: pointer; + font-size: 19px; + box-shadow: inset 0 -2px 0 #0b0c0c; + svg { + margin: 0 15px; + } +} + +.jk-digit-disabled-btn { + opacity: 0.5; + font-size: 19px; + cursor: not-allowed; +} + +.jk-header-btn-wrapper { + display: flex; + justify-content: space-between; +} + +/* for mobile view */ +@media (max-width: 780px) { + .jk-header-btn-wrapper { + flex-flow: column; + margin-bottom: 15px; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/card.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/card.scss new file mode 100644 index 0000000..16d6c35 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/card.scss @@ -0,0 +1,391 @@ +.card { + @apply bg-white m-sm px-md pt-md pb-lg shadow-card; + border-radius: 4px; + max-width: 960px; + + .card-header { + @apply text-text-primary text-heading-xl font-bold font-rc align-middle text-left mb-md; + } + + .card-sub-header { + @apply text-text-primary text-caption-xl font-bold align-middle text-left mb-sm; + } + + .card-caption { + @apply text-text-secondary text-caption-xl mb-sm; + } + + .card-text { + @apply text-text-secondary text-body-l align-middle text-left mb-lg; + + span { + @apply text-text-primary; + } + } + + .card-text-primary { + @apply text-text-primary text-body-l; + } + + .card-text-button { + @apply text-primary-main text-text-btn; + } + + .card-label { + @apply text-legend text-text-primary mb-sm; + } + + .card-label-error { + @apply block text-body-s text-error mb-md; + } + + .card-label-desc { + @apply font-bold text-text-secondary text-heading-s mb-md; + } + + .card-link { + @apply block text-center text-link text-primary-main mt-md cursor-pointer; + } +} + +.validation-error { + @apply block text-body-s text-error; +} + +.docsDescription { + color: theme(colors.text.primary) !important; +} + +.field-container { + @apply flex items-center; + /*@apply flex justify-center items-center;*/ +} + +.employeeCard { + @apply bg-white shadow-card p-md mb-xl; + border-radius: 4px; + + .card-header { + @apply text-text-primary text-heading-xl font-bold font-rc align-middle text-left mb-md; + } + + .card-sub-header, + .employee-card-sub-header { + @apply text-text-primary text-caption-xl font-bold align-middle text-left; + } + + .card-section-header { + @apply text-text-primary text-heading-m font-bold; + } + + .card-section-sub-text{ + @apply text-text-primary text-body-s; + } + + .card-caption { + @apply text-text-secondary text-caption-xl mb-sm; + } + + .card-text { + @apply text-text-secondary text-body-l align-middle text-left mb-lg; + + span { + @apply text-text-primary; + } + } + + .card-text-primary { + @apply text-text-primary text-body-l; + } + + .card-text-button { + @apply text-primary-main text-text-btn; + } + + .card-label { + @apply text-legend text-text-primary mb-md; + } + + .card-label-error { + @apply block text-body-s text-error mb-md; + } + + .card-label-desc { + @apply font-bold text-text-secondary text-heading-s mb-md; + } + + .card-link { + @apply block text-center text-link text-link-normal mt-md; + } + + .card-search-heading { + margin-right: 0px !important; + margin-left: 0px !important; + margin-bottom: 0px !important; + padding-bottom: 0px; + padding-left: 25px; + } +} + +.header-wrap { + @apply flex mb-md; + + .header-start { + margin-right: auto; + } + + .header-content { + margin-top: 0.2rem; + } + + .header-end { + margin-left: auto; + } +} + +.card-emp { + @extend .card; + padding-right: 0; + padding-top: 0; + padding-left: 0; + @apply bg-white m-sm; +} + +.submit-bar { + @apply h-10 bg-primary-main text-center w-full outline-none; + box-shadow: inset 0px -2px 0px theme(colors.text.primary); + cursor: pointer; + &:focus { + @apply outline-none; + } + + header { + @apply font-rc font-medium text-legend text-white leading-10; + } +} + +.submit-bar-disabled { + @apply h-10 bg-primary-main text-center w-full outline-none opacity-50; + + &:focus { + @apply outline-none; + } + + header { + @apply font-rc font-medium text-legend text-white leading-10; + } +} + +@screen dt { + .submit-bar, + .submit-bar-disabled { + width: 240px; + } + + .card { + display: flex; + flex-direction: column; + + .card-header { + @apply text-heading-xl-dt; + } + + .card-sub-header { + @apply text-heading-l-dt; + } + + .card-caption { + @apply text-caption-xl-dt; + } + + .card-text, + .card-text-primary { + @apply text-body-l-dt; + } + + .card-link { + @apply text-left; + } + } + + .employeeCard { + /* TODO need to revisit that we need mx-md NABEEL/ANIL + @apply mb-md mx-md !important; + */ + @apply mb-md !important; + &.filter { + margin-left: auto; + margin-right: auto; + } + + .card-header { + @apply text-heading-xl-dt; + } + + .card-sub-header { + @apply text-heading-l-dt; + } + + .employee-card-sub-header { + margin-bottom: 40px; + @apply text-heading-l-dt; + } + + .card-section-header { + margin-bottom: 40px; + @apply text-heading-m-dt; + } + + .card-section-sub-text{ + @apply text-text-primary text-body-s-dt; + } + + .card-search-heading { + margin-right: 0px !important; + margin-left: 0px !important; + margin-bottom: 0px !important; + padding-bottom: 0px; + padding-left: 25px; + } + + .card-caption { + @apply text-caption-xl-dt; + } + + .card-text, + .card-text-primary { + @apply text-body-l-dt; + } + + .card-link { + @apply text-left; + } + + .label-field-pair { + @apply flex items-center; + + h2 { + width: 30%; + } + + .field { + width: 50%; + margin-right: 20%; + .field { + margin-right: unset; + } + } + } + + .field-container { + span { + border: 2px solid black; + background: rgb(247, 247, 247); + width: 40px; + height: 40px; + display: flex; + justify-content: center; + align-items: center; + margin-top: -16px; + border-right: none; + } + } + } + + .header-wrap { + @apply flex mb-md; + + .header-start { + margin-right: auto; + } + + .header-content { + } + + .header-end { + margin-left: auto; + } + } +} + +.card-section-header { + @apply text-text-primary text-heading-m font-bold; +} + +.card-search-heading { + margin-right: 0px !important; + margin-left: 0px !important; + margin-bottom: 0px !important; + padding-bottom: 0px; + padding-left: 25px; +} + +.button-sub-text { + width: 100%; +} + +.home-page-info-banner-wrap { + margin: "0px 16px 24px 16px"; +} + +@media (min-width: 780px) { + .button-sub-text { + width: 240px; + } + .home-page-info-banner-wrap { + max-width: 45%; + min-width: 40%; + margin-left: 0; + margin-right: 24px; + margin-bottom: 24px; + } + .info-banner-wrap-citizen-override { + } + .oc-aknowledgement-screen { + width: auto; + min-width: 240px; + max-width: 100%; + padding: 0px 10px; + } +} + +.card-label-error { + @apply block text-body-s text-error mb-md; +} + +.employeeCard-override { + margin-left: 0px !important; +} + +.BPAemployeeCard { + margin-left: 0px !important; + margin-right: 0px !important; + margin-bottom: 64px !important; +} + +.employee-application-details { + display: flex !important; + justify-content: space-between !important; + max-height: 60px !important; + height: 60px !important; +} +.employee-main-application-details { + padding: 10px !important; +} + +.employee-mulitlink-main-div { + z-index: 10 !important; + max-width: 41% !important; +} + +.employee-download-btn-className { + position: unset !important; + display: flex !important; + justify-content: flex-end !important; +} + +.employee-options-btn-className { + position: unset !important; + margin: 0 !important; + width: 100% !important; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/cardHeaderWithOptions.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/cardHeaderWithOptions.scss new file mode 100644 index 0000000..a19f1dc --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/cardHeaderWithOptions.scss @@ -0,0 +1,14 @@ +.cardHeaderWithOptions{ + @apply flex flex-row justify-between; + .multilinkWrapper{ + @apply relative; + .multilink-labelWrap{ + position: unset; + @apply flex z-10 items-center align-middle text-center m-md; + } + .multilink-optionWrap{ + top: 32px; + right: 0%; + } + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/changeLanguage.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/changeLanguage.scss new file mode 100644 index 0000000..f030a38 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/changeLanguage.scss @@ -0,0 +1,3 @@ +.language-title { + margin-bottom: "5px"; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/charts.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/charts.scss new file mode 100644 index 0000000..e7d3988 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/charts.scss @@ -0,0 +1,186 @@ +.chartHeader { + display: flex; + flex-direction: row; + justify-content: space-between; + + .sideContent { + @apply flex justify-around items-center ; + + } +} + +.searchInput { + @apply mr-lg; + input{ + margin-bottom: 0; + @apply pr-xl; + } +} + +.signature-img{ + top: 8px; + right: 8px; + fill: theme(colors.text.secondary); + @apply absolute; +} + +.column-direction { + flex-direction: column; +} + +.chart-wrapper { + padding: 0 10px; + margin-top: 60px; +} + +.chart-row { + @apply flex justify-between flex-wrap; + .chart-item { + flex-grow: 1; + margin-bottom: 15px; + width: 100%; + + &:last-child { + margin-right: 0px; + } + } +} + +.cursorPointer { + @apply cursor-pointer; +} + +.options { + @apply flex justify-between items-center; + div { + display: none; + } +} + +.options-m { + width: 95%; + margin: 0 auto 15px; + @apply flex justify-between; + + svg { + margin-right: 10px; + } +} + +.options-m { + div { + @apply flex; + } +} +.no-data { + @apply flex justify-center items-center; + height: 90%; + margin-bottom: 40px; + white-space:pre; +} + +@screen dt { + .chart-wrapper { + padding-left: 15px; + margin-top: 10px; + + .chart-item { + margin-right: 25px !important; + margin-bottom: 25px !important; + margin-left: 0 !important; + width: 31%; + } + } + .column-direction { + flex-direction: row; + } + .options-m { + display: none; + } + + .options { + div { + @apply flex cursor-pointer; + } + } +} + +.showMore { + @apply text-right cursor-pointer; + color: theme(colors.primary.main); +} + +@media (max-width: 420px) { + .recharts-default-tooltip { + width: 85%; + ul { + width: 100% !important; + } + ul li { + width: 100%; + display: flex !important; + flex-wrap: wrap; + } + } +} + + +@media print{ + .page-break { + margin-top: 1rem; + display: block; + page-break-before: auto; + } + .chart-wrapper { + @media print{ + .chart-row { + @media print{ + @apply flex justify-between flex-wrap; + .chart-item { + @media print{ + flex-grow: 1; + margin-right: 25px; + margin-bottom: 25px; + width: 31%; + + &:last-child { + margin-right: 0px; + } + .chartHeader { + display: flex; + justify-content: space-between; + + .sideContent { + @apply flex justify-around items-center ; + + .searchInput { + @apply mr-lg; + input{ + margin-bottom: 0; + @apply pr-xl; + } + } + + .signature-img{ + top: 8px; + right: 8px; + fill: theme(colors.text.secondary); + @apply absolute; + } + } + } + } + } + } + } + + .options { + @apply flex justify-end; + } + + .options-m { + display: none; + } + } +} +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/checkbox.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/checkbox.scss new file mode 100644 index 0000000..b805530 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/checkbox.scss @@ -0,0 +1,53 @@ +.checkbox-wrap { + @apply flex mb-md relative items-baseline; + + input { + width: 38px; + height: 38px; + @apply opacity-0 absolute top-0 left-0 z-10; + } + + .input-emp { + @extend input; + width: 24px; + height: 24px; + } + + .custom-checkbox { + width: 38px; + height: 38px; + @apply absolute top-0 left-0 border border-solid border-input-border z-0; + + img { + @apply opacity-0; + } + + svg { + @apply opacity-0; + } + } + + .custom-checkbox-emp { + @extend .custom-checkbox; + width: 24px; + height: 24px; + } + + input:checked ~ .custom-checkbox, + input:hover ~ .custom-checkbox { + @apply border-2 border-primary-main; + } + + input:checked ~ .custom-checkbox img { + @apply opacity-100; + } + + input:checked ~ .custom-checkbox svg { + @apply opacity-100; + } + + .label { + margin-left: 56px; + @apply text-form-field text-text-primary; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/checkpoint.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/checkpoint.scss new file mode 100644 index 0000000..6d0e3fc --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/checkpoint.scss @@ -0,0 +1,63 @@ +.checkpoint-connect-wrap { + padding-bottom: 40px; + @apply relative; +} +.checkpoint-done { + @apply flex; + + h2 { + width: 24px; + height: 24px; + border-radius: 50%; + @apply border-b border-solid border-primary-main bg-primary-main; + } + + header { + @apply text-heading-s ml-md; + + p { + margin-top: 4px; + @apply text-heading-s text-text-secondary; + } + } +} + +.checkpoint { + @apply flex; + + h2 { + width: 24px; + height: 24px; + border-radius: 50%; + --text-opacity: 1; + @apply border-b border-solid border-border bg-border; + } + + header { + @apply text-heading-s ml-md; + + p { + margin-top: 4px; + @apply text-heading-s text-text-secondary; + } + } +} + +.checkpoint-connect { + margin-left: 12px; + margin-top: 22px; + @apply absolute top-0 left-0 h-full border-l border-solid border-border; +} + +.checkpoint-comments-wrap { + max-width: 560px; + @apply bg-grey-mid p-sm mt-sm; + + h4{ + @apply text-text-primary text-heading-s; + } + + p{ + @apply text-text-secondary text-body-s-dt; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/citizenInfoLabel.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/citizenInfoLabel.scss new file mode 100644 index 0000000..bbb1ce4 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/citizenInfoLabel.scss @@ -0,0 +1,14 @@ +.citizen-info-label { + @apply p-sm border-4 border-solid border-link-normal text-heading-m m-sm; + max-width: 960px; + + p { + @apply text-link-normal font-bold mt-xs text-heading-s; + } +} + +@screen dt { + .citizen-info-label { + margin: 0; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/custombtn.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/custombtn.scss new file mode 100644 index 0000000..82b369a --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/custombtn.scss @@ -0,0 +1,11 @@ +.customBtn { + @apply bg-white text-text-primary box-border inline-block outline-none px-sm border border-solid border-primary-main; + margin: 0px 4.65% 0px 0px; + height: 30px; + line-height: 30px; +} + +.customBtn-selected { + @extend .customBtn; + @apply bg-primary-main text-white font-medium; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/datatable.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/datatable.scss new file mode 100644 index 0000000..b2756a6 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/datatable.scss @@ -0,0 +1,134 @@ +.data-table { + @apply text-text-primary; + + .row { + @apply flex border-b border-border pb-sm mb-sm; + + span { + width: 70%; + display: contents; + } + + h2 { + width: 40%; + @apply font-bold text-heading-s; + } + + .value { + width: 50%; + @apply text-heading-s; + word-break: break-all; + } + .caption { + width: 70%; + @apply text-heading-s text-text-secondary; + } + } + + .last { + border: none; + padding: 0; + margin: 0; + } +} + +.employee-data-table { + .row { + @apply flex pb-sm mb-sm; + + span { + width: 70%; + display: contents; + } + + h2 { + width: 30%; + @apply font-bold text-heading-s; + } + + .value { + width: 50%; + @apply text-heading-s; + white-space: break-spaces !important; + word-break: break-all; + } + + .caption { + width: 70%; + @apply text-heading-s text-text-secondary; + } + } + + .last { + border: none; + padding: 0; + margin: 0; + } +} + +.employee-data-table { + .row { + @apply flex pb-sm mb-sm; + + span { + width: 70%; + display: contents; + } + + h2 { + width: 30%; + @apply font-medium text-heading-s; + } + + .value { + white-space: break-spaces !important; + word-break: break-all; + width: 60%; + @apply text-heading-s; + &.status-row-radio { + div { + margin-right: 1rem; + width: 50%; + } + .mg-sm { + width: 30%; + } + } + } + + .caption { + width: 70%; + @apply text-heading-s text-text-secondary; + } + } + + .last { + border: none; + padding: 0; + margin: 0; + } + &.status-radio-table { + margin-top: 1rem; + .row { + span { + width: 24px; + display: block; + float: left; + border-radius: 50%; + } + } + } + + &.view-header { + .row { + display: grid; + grid-template-columns: 1fr 68%; + } + } +} + + +.pt-citizen {.data-table {.row { + justify-content: space-between; + +}}} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/datewrap.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/datewrap.scss new file mode 100644 index 0000000..1f3c889 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/datewrap.scss @@ -0,0 +1,21 @@ +.date-wrap { + @apply flex mb-md; + + img, + svg { + height: 22px; + width: 20px; + } + + p { + @apply text-text-primary text-body-l pl-sm; + } +} + +@screen dt { + .date-wrap { + p { + @apply text-body-l-dt; + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/detailscard.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/detailscard.scss new file mode 100644 index 0000000..cfbc83a --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/detailscard.scss @@ -0,0 +1,6 @@ +.details-card { + @apply bg-white m-sm px-sm pt-sm pb-lg shadow-card; + .card-label { + @apply font-bold text-legend text-text-primary mb-md; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/detailscontainer.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/detailscontainer.scss new file mode 100644 index 0000000..fa3ab70 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/detailscontainer.scss @@ -0,0 +1,13 @@ +.details-container { + @apply flex flex-col m-sm pt-md pb-md pl-sm pr-sm bg-white rounded; + .detail { + @apply grid grid-cols-2 gap-2 items-baseline; + .label { + width: 138px; + @apply font-bold text-heading-s text-text-primary mb-md; + } + .name { + @apply pt-md; + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/filters.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/filters.scss new file mode 100644 index 0000000..dd4b663 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/filters.scss @@ -0,0 +1,98 @@ +.filters-wrapper { + display: none; + padding: 20px 0px 0px; + z-index: 1; + + .filters-input { + flex-basis: 22%; + } + + .filters-input:not(:first-of-type) { + margin-left: 5%; + } + + .switch-wrapper { + display: flex; + justify-content: space-between; + max-width: 200px; + + .radio-switch { + display: none; + + &:checked ~ label { + border-color: theme(colors.primary.main); + color: theme(colors.primary.main); + } + } + + label { + border: 1px solid; + padding: 6px 10px; + display: block; + @apply border border-solid border-input-border; + &:hover{ + @apply border-2 border-solid border-primary-main; + } + } + } +} + +.pickerShadow { + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); +} + +.filter-close { + @apply flex justify-end; +} + +.filter-header { + @apply flex; + + p { + font-weight: bold; + font-size: 24px; + line-height: 1; + margin: 0 12px 20px 8px; + } +} + +.clearText { + display: none; +} + +@screen dt { + .filters-wrapper { + display: flex; + } + + .filter-close, + .filter-header { + display: none; + } + + .clearText { + display: block; + text-align: right; + color: theme(colors.primary.main); + margin-top: 20px; + margin-left: 10px; + } +} + +@media (max-width: 780px) { + .filters-modal { + display: block; + position: fixed; + width: 100%; + height: 100vh; + left: 0; + top: 130px; + padding: 16px; + background-color: #fff; + z-index: 99; + } + + .rdrDefinedRangesWrapper { + display: none; + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/grey.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/grey.scss new file mode 100644 index 0000000..eec759d --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/grey.scss @@ -0,0 +1,3 @@ +.grey { + @apply text-text-secondary; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/hoc/InboxComposer.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/hoc/InboxComposer.scss new file mode 100644 index 0000000..98bacf6 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/hoc/InboxComposer.scss @@ -0,0 +1,115 @@ +.InboxComposerWrapper { + .form-field-flex-one { + .form-field { + @apply flex-1; + } + } +} + +.inboxPopupMobileWrapper { + @apply block p-md w-full overflow-scroll; + .submit { + @apply flex left-0 w-full px-xl items-center flex-row-reverse !important; + } + .form-field { + margin: 0 !important; + @apply w-full; + } + .InboxMobilePopupCloseButtonWrapper { + @apply flex flex-row-reverse; + } +} + +@screen dt { + .InboxComposerWrapper { + grid-template-columns: calc(25% - 32px) 75%; + @apply grid gap-x-8 gap-y-6; + } + + .wns-inbox-composer { + .filter-form { + height: fit-content; + } + + .wns-search-field { + width: 30% !important; + .field-container { + } + } + .form-field { + width: 100% !important; + } + + .SubmitAndClearAllContainer { + width: 100%; + display: flex; + justify-content: end; + align-items: center; + .clear-search { + width: 30%; + display: inline-block; + vertical-align: middle; + text-align: right; + cursor: pointer; + p { + padding: 1rem; + color: rgb(244, 119, 56); + text-align: end; + } + } + .submit { + width: 30% !important; + margin-left: unset !important; + button { + width: 100% !important; + } + } + } + } + + .search-form-wns-inbox { + .clear-search-container { + grid-column: 2/3; + text-align: right; + .clear-search { + width: 100%; + color: rgb(244, 119, 56); + } + } + button { + width: 100%; + } + + .filter-form { + height: fit-content; + } + + .search-complaint-container { + flex-direction: column; + align-items: flex-start; + --bg-opacity: 1; + background-color: #fff; + background-color: rgba(255, 255, 255, var(--bg-opacity)); + padding: 16px; + display: unset; + flex-wrap: unset; + justify-content: unset; + margin-bottom: 0; + .complaint-input-container { + display: grid; + grid-template-columns: 33.33% 33.33% 33.33%; + } + .form-field { + width: 100%; + padding-right: 15px; + .clear-search { + padding-top: 10px; + } + } + } + .submit { + margin-top: 0; + right: 0; + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/hoc/index.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/hoc/index.scss new file mode 100644 index 0000000..d651ce4 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/hoc/index.scss @@ -0,0 +1 @@ +@import "./InboxComposer.scss" \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/howItWorks.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/howItWorks.scss new file mode 100644 index 0000000..c77a82b --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/howItWorks.scss @@ -0,0 +1,71 @@ +.how-it-works-page{ + width: 92%; + margin: 16px; + .how-it-works-page-header{ + margin-bottom: 15px; + } +} + +.video-icon{ + float: left; + background-color: #6F6F6F; + height: 60px; + width: 100px; + cursor: pointer; + margin: 5px; + + .vid-svg{ + padding-left: 35px; + padding-top: 18px; + } +} + +.how-it-works-header-description{ + padding: 5px; + overflow-wrap: break-word; + h2{ + font-size: 16px; + font-weight: 400; + } + p{ + font-size: 12px; + font-weight: 400; + } +} + +.how-it-works-pdf-section{ + display: flex; + justify-content: space-between; + .pdf-icon-header-desc{ + float: left; + .pdf-icon{ + display: inline-block; + } + .pdf-header-desc{ + display: inline-block; + position: absolute; + padding: 5px; + overflow-wrap: break-word; + h2{ + font-size: 16px; + font-weight: 400; + } + p{ + font-size: 12px; + font-weight: 400; + } + } + } + .download-icon{ + float: right; + } +} + +.how-it-works-video-play{ + display: inline-block; + .close-button{ + float: right; + cursor: pointer; + } +} + diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/imageviewer.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/imageviewer.scss new file mode 100644 index 0000000..1f0568f --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/imageviewer.scss @@ -0,0 +1,33 @@ +.image-viewer-wrap { + @apply bg-text-primary p-md top-0 left-0 z-20 fixed w-full h-full; + + svg { + top: 90px; + right: 16px; + @apply absolute h-6 w-6; + } + + img { + margin-top: 40%; + @apply max-w-full h-auto; + } +} + +@screen dt { + .image-viewer-wrap { + @apply flex fixed top-0 left-0 w-full h-full z-20 bg-text-primary p-md; + + svg { + top: 90px; + right: 16px; + @apply absolute h-6 w-6; + } + + img { + width: auto; + height: auto; + max-width: 640px; + margin: auto; + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/InboxLinks.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/InboxLinks.scss new file mode 100644 index 0000000..7549fe0 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/InboxLinks.scss @@ -0,0 +1,59 @@ +@import url("../../digitv2/index.scss"); + +.inbox-search-links-container { + @extend .light-paper-primary; + height: 100%; + width: 100% !important; + display: flex; + flex-direction: column; + padding: 1rem; + .header { + @extend .light-text-color-primary; + display: grid; + grid-template-columns: 20% 1fr; + .logo { + display: flex; + align-items: center; + justify-content: flex-start; + .inbox-search-icon--projects { + fill : #f47738; + height: 2rem; + width: 2rem; + } + } + .text { + @extend .light-text-color-primary; + line-height: 32px; + font-weight: 700; + color : black; + display: flex; + align-items: center; + justify-content: flex-start; + } + + @media (min-width: 1024px) { + .text { + font-size: 24px; + } + } + + @media (max-width: 1024px) { + .text { + font-size: 20px; + } + } + } + .contents { + margin-top: 1rem; + box-sizing: border-box; + display: flex; + flex-direction: column; + .link { + @extend .light-primary; + padding: 8px; + --text-opacity: 1; + color: #f47738; + color: rgba(244, 119, 56, var(--text-opacity)); + } + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/horizontalNav.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/horizontalNav.scss new file mode 100644 index 0000000..13fd228 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/horizontalNav.scss @@ -0,0 +1,224 @@ +@import url("../../digitv2/index.scss"); + +.horizontal-nav { + @extend .light-paper-primary; + @extend .light-text-color-primary; + overflow: auto; + display: flex; + margin-top: 3rem; + + .menu-item { + border: 10px; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + cursor: pointer; + text-decoration: none; + margin: 0px; + padding: 0px; + outline: none; + font-size: 16px; + position: relative; + color: rgb(95, 92, 98); + line-height: 48px; + transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; + min-height: 48px; + white-space: initial; + background: none; + + .icon { + @extend .light-background; + display: block; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + height: 21px !important; + width: 21px !important; + float: left; + margin-top: 12px; + } + + .edit-btn-ico { + height: 17px; + width: 17px; + margin-top: 16px; + } + + .icon+.menu-label { + margin-left: 36px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + + @media (min-width: 780px) { + .sidebar-list { + padding-right: 30px; + padding-left: 30px; + background-color: #EEEEEE; + border: 1px solid #DDDDDD; + border-radius: 8px 8px 0px 0px; + + &.active { + font-weight: 600; + border-bottom: 3px solid theme(colors.primary.main); + + background-color: #FFFFFF; + + .menu-label { + color: theme(colors.primary.main); + } + + .icon { + fill: theme(colors.primary.main); + } + } + + .submenu-container { + cursor: pointer; + display: flex; + flex-direction: column; + + .sidebar-link { + display: flex; + justify-content: space-between; + align-items: center; + padding: 15px!important; + padding-top: 20px!important; + svg { + width: 24px !important; + height: 24px !important; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + } + + .actions { + .tooltip { + margin-left: 16px; + } + } + } + + .actions { + display: flex; + align-items: center; + overflow: hidden !important; + + span { + margin-left: 13px; + line-height: 48px; + white-space: nowrap; + color: #5f5c62; + overflow: hidden; + text-overflow: ellipsis; + } + } + } + .submenu-container:first-child { + margin-top:5px; + .employee-search-input{ + margin-left:16px !important; + } + } + } + .sidebar-list-search-form { + padding-right: 30px; + padding-left: 30px; + + &.active { + font-weight: 600; + border-bottom: 3px solid theme(colors.primary.main); + + background-color: #FFFFFF; + + .menu-label { + color: theme(colors.primary.main); + } + + .icon { + fill: theme(colors.primary.main); + } + } + + .submenu-container { + cursor: pointer; + display: flex; + flex-direction: column; + + .sidebar-link { + display: flex; + justify-content: space-between; + align-items: center; + padding: 15px!important; + padding-top: 20px!important; + svg { + width: 24px !important; + height: 24px !important; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + } + + .actions { + .tooltip { + margin-left: 16px; + } + } + } + + .actions { + display: flex; + align-items: center; + overflow: hidden !important; + + span { + margin-left: 13px; + line-height: 48px; + white-space: nowrap; + color: #5f5c62; + overflow: hidden; + text-overflow: ellipsis; + } + } + } + .submenu-container:first-child { + margin-top:5px; + .employee-search-input{ + margin-left:16px !important; + } + } + } + + + .dropdown-link { + .actions { + display: flex; + padding: 1em; + + svg { + width: 21px; + height: 21px; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + } + + span { + color: #5f5c62; + } + } + } + } +} + + + +.sidebar-link { + display: flex; + justify-content: space-between; + align-items: center; + padding: 15px!important; + padding-top: 20px!important; + svg { + width: 24px !important; + height: 26px !important; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/inboxSearch.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/inboxSearch.scss new file mode 100644 index 0000000..a24f891 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/inboxSearch.scss @@ -0,0 +1,116 @@ +@import url("../../digitv2/index.scss"); + +.search-wrapper { + @extend .light-text-color-primary; + @extend .light-paper-primary; + height: 100%; + width: 100%; + padding: 1rem; + + .popup-label { + display: flex; + font-size: large; + @extend .light-text-color-primary; + .header { + @extend .light-text-color-primary; + width: 100%; + font-weight: normal; + font-size: large; + .icon { + @extend .light-primary; + margin-right: 12px; + margin-top: 5px; + } + } + } + + .filter-header-wrapper { + @extend .light-text-color-primary; + display: grid; + grid-template-columns: 15% 1fr 15%; + height: 3rem; + margin-bottom: 1rem; + .icon-refresh { + display: flex; + align-items: center; + justify-content: center; + border: 1px solid #00000017; + cursor: pointer; + svg { + height: 60%; + width: 40%; + } + } + .label { + @extend .light-text-color-primary; + display: flex; + align-items: center; + justify-content: flex-start; + } + + @media (min-width: 1024px) { + .label { + font-size: 24px; + } + } + + @media (max-width: 1024px) { + .label { + font-size: 16px; + } + } + + .icon-filter { + display: flex; + align-items: center; + justify-content: flex-start; + } + } + + .search-field-wrapper { + display: grid; + row-gap: 0.25rem; + column-gap: 1rem; + &.inbox { + grid-template-columns: repeat(3, 1fr); + &.filter { + display: flex; + flex-direction: column; + } + } + &.search { + grid-template-columns: repeat(4, 1fr); + } + .text-input{ + @extend .light-primary; + } + } + + .search-button-wrapper { + display: flex; + align-items: center; + justify-content: flex-end; + gap: 1rem; + padding-top: 8px; + &.inbox { + grid-column: 2 / span 2; + &.filter { + button { + width: 100%; + } + } + } + &.search { + grid-column: 3 / span 2; + } + } +} + +@screen sm { + .search-wrapper { + .search-field-wrapper { + display: flex; + flex-direction: column; + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/inboxSearchComposer.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/inboxSearchComposer.scss new file mode 100644 index 0000000..7fb3189 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/inboxSearchComposer.scss @@ -0,0 +1,142 @@ +@import url("../../digitv2/index.scss"); + +.inbox-search-wrapper { + /* + TODO NABEEL/ANIL Removed these since it creates issues in search screen + @extend .light-background; + + */ + height: 100%; + .inbox-search-component-wrapper { + /* + TODO NABEEL/ANIL Removed these since it creates issues in search screen + @extend .light-background; + + */ height: 100%; + width: 100%; + .sections-parent { + /* + TODO NABEEL/ANIL Removed these since it creates issues in search screen + @extend .light-background; + + */ height: 100%; + display: grid; + grid-template-columns: 20% 1fr; + gap : 1rem; + &.inbox { + @extend .light-text-color-primary; + .links{ + @extend .light-primary; + @extend .light-paper-primary; + .text{ + @extend .light-text-color-primary; + } + .inbox-links-icon{ + color:#f47738; + fill:#f47738; + path{ + fill:#f47738; + } + } + } + } + &.search { + display: flex; + flex-direction: column; + .section { + &.links { + display: none; + } + &.filter { + display: none; + } + } + .search-wrapper { + @extend .light-paper-primary; + .search-field-wrapper.search.custom-both-clear-search{ + .search-button-wrapper.search { + grid-column: initial; + } + .search-button-wrapper{ + .link-label{ + @extend .light-primary; + white-space:initial; + } + .submit-bar { + @extend .light-primary-button; + width: 60%; + } + } + } + } + } + &.download { + grid-template-columns: 100% + } + .section { + @extend .light-paper-primary; + @extend .light-text-color-primary; + min-height: 10rem; + /* background-color: white; */ + display: flex; + align-items: center; + justify-content: center; + border-radius: 4px; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 16%); + &.search-results { + min-height: 0; + } + &.links { + height: 100%; + color : #f47738; + .inbox-search-links-component { + height: 100% !important; + width: 100%; + } + } + &.filter { + @extend .light-paper-primary; + @extend .light-text-color-primary; + height: fit-content; + } + &.tab{ + display: block; + background-color: #eee; + box-shadow: none; + .search-wrapper{ + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.16); + } + } + } + } + } +} + +@screen sm { + .employee-main-application-details-for-modal { + padding: 0 !important; + } + .inbox-search-wrapper { + .inbox-search-component-wrapper { + .sections-parent { + display: flex; + flex-direction : column; + .section { + &.search-results { + } + &.links { + } + &.filter { + + } + &.as-modal { + position : fixed; + top : 0; + height : 100vh; + width : 100vw; + } + } + } + } + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/index.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/index.scss new file mode 100644 index 0000000..bad2062 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/index.scss @@ -0,0 +1,5 @@ +@import "./horizontalNav.scss"; +@import "./InboxLinks.scss"; +@import "./inboxSearch.scss"; +@import "./searchComponentTable.scss"; +@import "./inboxSearchComposer.scss"; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/searchComponentTable.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/searchComponentTable.scss new file mode 100644 index 0000000..a542d72 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/searchComponentTable.scss @@ -0,0 +1,44 @@ +.search-component-table { + width: 100%; + display: block; + overflow-x: auto; + overflow-y:hidden; + table { + th { + .tooltip { + min-width: 80px; + } + } + tr { + td { + span { + white-space: pre; + min-width: 80px; + .tooltip { + position: relative; + min-width: 80px; + display: inline-block; + margin-left: 16px; + .tooltiptext { + visibility: hidden; + background-color: #555; + color: #fff; + text-align: left; + border-radius: 6px; + padding: 5px; + position: absolute; + z-index: 1; + bottom: 125%; + left: 50%; + margin-left: -60px; + opacity: 0; + transition: opacity 0.3s; + width: 30rem; + } + } + + } + } + } + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/info-banner.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/info-banner.scss new file mode 100644 index 0000000..3ed3b4a --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/info-banner.scss @@ -0,0 +1,35 @@ +.info-banner-wrap { + @apply bg-link-normal bg-opacity-25 m-sm p-md; + max-width: 960px; + + background-color: #C7E0F1; + border-radius: 4px; + svg { + margin-top: 5px; + @apply rounded-full; + } + + div { + @apply flex; + } + + h2 { + @apply text-heading-m text-link-normal mb-md font-bold ml-sm; + } + + p { + @apply text-body-l text-link-normal whitespace-pre-line; + } +} + +@screen dt { + .info-banner-wrap { + h2 { + @apply text-heading-m-dt; + } + + p { + @apply text-body-l-dt; + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inputotp.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inputotp.scss new file mode 100644 index 0000000..6866944 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/inputotp.scss @@ -0,0 +1,15 @@ +.input-otp-wrap { + @apply mb-lg; + + input { + @apply border-2 border-solid border-input-border outline-none h-10 w-10 text-form-field text-text-primary mr-sm mb-sm text-center; + } + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + input[type="number"] { + -moz-appearance: textfield; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/keynote.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/keynote.scss new file mode 100644 index 0000000..df736c0 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/keynote.scss @@ -0,0 +1,27 @@ +.key-note-pair { + @apply mb-md; + + h3 { + margin-bottom: 4px; + @apply font-bold text-text-primary text-heading-s; + } + + p { + @apply text-text-primary text-body-l; + } + + .caption { + @apply text-body-l text-text-secondary; + } +} + +@screen dt { + .key-note-pair { + p { + @apply text-body-l-dt; + } + .caption { + @apply text-body-l-dt text-text-secondary; + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/languageSelector.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/languageSelector.scss new file mode 100644 index 0000000..86da352 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/languageSelector.scss @@ -0,0 +1,23 @@ +.language-selector { + @apply flex flex-wrap; +} + +.language-selector div:not(:first-child) { + margin-left: 10px; +} +.bannerCard .language-button-container button { + width: 6.2rem; + height: 2.5rem; +} +.bannerCard .customBtn { + border-color: theme(colors.text.secondary); +} +.bannerCard .customBtn:focus { + outline: none; +} +.bannerCard .customBtn-selected { + border-color: transparent; +} +.bannerCard .bannerHeader p { + font-size: 19px; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/loader.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/loader.scss new file mode 100644 index 0000000..1784a54 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/loader.scss @@ -0,0 +1,96 @@ +.page-loader, +.module-loader { + text-align: center; +} + +.page-loader { + padding-top: 88px; +} + +.module-loader { + padding: 16px; +} + +@keyframes ldio-pjg92h09b2o { + 0% { + transform: translate(-50%, -50%) rotate(0deg); + } + + 100% { + transform: translate(-50%, -50%) rotate(360deg); + } +} + +.ldio-pjg92h09b2o div { + position: absolute; + width: 52px; + height: 52px; + border: 12px solid theme(colors.secondary); + border-top-color: transparent; + border-radius: 50%; +} + +.ldio-pjg92h09b2o div { + animation: ldio-pjg92h09b2o 1s linear infinite; + top: 50px; + left: 50px; +} + +.loadingio-spinner-rolling-faewnb8ux8 { + width: 48px; + height: 48px; + display: inline-block; + overflow: hidden; + background: none; +} + +.ldio-pjg92h09b2o { + width: 100%; + height: 100%; + position: relative; + transform: translateZ(0) scale(0.48); + backface-visibility: hidden; + transform-origin: 0 0; + /* see note above */ +} + +.ldio-pjg92h09b2o div { + box-sizing: content-box; +} + +/* +.loader { + position: absolute; + left: 50%; + top: 50%; + z-index: 1; + width: 80px; + height: 80px; + margin: -80px 0 0 -40px; + border: 8px solid #f3f3f3; + border-radius: 50%; + border-top-color: #3498db; + -webkit-animation: loader-spin 1s linear infinite; + animation: loader-spin 1s linear infinite; +} + +@-webkit-keyframes loader-spin { + 0% { + -webkit-transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(360deg); + } +} + +@keyframes loader-spin { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +} +*/ diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/loaderWithGap.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/loaderWithGap.scss new file mode 100644 index 0000000..91352b8 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/loaderWithGap.scss @@ -0,0 +1,45 @@ +.loader-with-gap-container { + display: flex; + justify-content: center; + align-items: center; + height: 100%; + width: 100%; + display: flex; + flex-direction: column; + background-color: rgba(0, 0, 0, 0.7); + position: fixed; + top: 0; + left: 0; + z-index: 99999; + + .loader { + border: 0.5rem solid rgb(255, 255, 255); + border-top: 0.5rem solid rgba(80, 76, 76, 0); + border-radius: 50%; + width: 3.125rem; + height: 3.125rem; + animation: spin 2s linear infinite; + } + + .loader-inner { + border: 1px solid rgb(255, 255, 255); + border-radius: 50%; + width: 100%; + height: 100%; + } + + .loader-text { + color: whitesmoke; + padding-top: 1.25rem; + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/map.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/map.scss new file mode 100644 index 0000000..7e0fb58 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/map.scss @@ -0,0 +1,30 @@ +.map-wrap { + @apply pb-lg; +} + +.map { + width: 100%; + height: 384px; + overflow: visible; + position: relative; +} + +.map-search-bar-wrap { + border-radius: 4px; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.5); + margin-bottom: 4px; + display: flex; + width: 100%; +} + +.map-search-bar-icon { + @apply inline h-6 w-6 m-sm; +} + +.map-search-bar { + @apply block outline-none text-form-field text-text-primary h-10 w-full !important; +} + +.map-search-bar:focus { + border: none; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/menu.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/menu.scss new file mode 100644 index 0000000..e69de29 diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/metricsTable.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/metricsTable.scss new file mode 100644 index 0000000..786adc3 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/metricsTable.scss @@ -0,0 +1,28 @@ +.metricsTable { + @apply bg-white px-md pt-md pb-lg shadow-card; + max-width: 440px; + border-radius: 4px; + + .row { + @apply flex justify-between; + height: 80px; + width: 100%; + } + + .lower_red { + @apply inline; + color: rgb(229, 77, 66); + } + + .upper_green { + @apply inline; + color: theme(colors.success); + } +} + +.chart-metric-wrapper{ + display: flex; + flex-wrap: wrap; + margin-top: 15px; + justify-content: space-evenly; +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/multiLink.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/multiLink.scss new file mode 100644 index 0000000..816bfec --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/multiLink.scss @@ -0,0 +1,88 @@ +.multilink-labelWrap{ + top: 73px; + @apply flex items-center align-middle text-center m-md absolute right-0 z-10; +} + +.multilink-link-button{ + margin: 0; + @apply text-heading-s text-primary-light +} + +.multilink-optionWrap{ + right: 0; + top:110px; + width: max-content; + @apply absolute shadow-card bg-white m-md z-10; + + .multilink-option{ + + svg{ + margin-top: auto; + margin-bottom: auto; + @apply mx-sm + } + + &:hover{ + @apply bg-grey-mid cursor-pointer; + } + @apply p-md; + } +} +.overCard{ + top: 23px; +} + +.multilink-block-wrapper{ + @apply relative; + .multilink-labelWrap{ + margin: 0 !important; + top: unset; + @apply relative text-text-primary !important; + svg{ + fill: theme(colors.text.secondary); + } + span{ + @apply text-text-primary !important; + } + } + .multilink-optionWrap{ + top: 8px; + right: -50%; + @apply block !important; + } +} + +@screen dt { + + .multilink-block-wrapper{ + .multilink-optionWrap{ + right: 0 !important; + } + } + + .multilink-labelWrap{ + right: 20%; + top: 80px; + } + + .multilink-optionWrap{ + right: 20%; + top: 110px; + @apply shadow-card rounded-sm; + } +} + +.reports-download-btn{ + justify-content: flex-end; + position: unset; +} + +.reports-options-download{ + position: absolute; + justify-content: flex-end; + float: right; + right:0%; + display: flex; + flex-direction: row; + top:2rem; +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/multiSelectDropdown.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/multiSelectDropdown.scss new file mode 100644 index 0000000..f35e380 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/multiSelectDropdown.scss @@ -0,0 +1,78 @@ +.multi-select-dropdown-wrap{ + @apply relative text-form-field text-text-primary w-full; + max-width: 540px; + .master, .master-active{ + @apply relative border border-solid border-input-border h-10 w-full; + input[type=text]{ + @apply absolute top-0 left-0 p-sm pl-sm min-h-full min-w-full opacity-0; + &:focus{ + @apply outline-none; + } + } + .label{ + @apply flex justify-between p-sm w-full h-full; + svg{ + @apply h-6 w-6; + } + } + + &:hover{ + @apply border-2 border-solid border-primary-main; + } + } + + .master-active{ + @apply border-2 border-primary-main; + input[type=text]{ + @apply opacity-100; + } + .label{ + @apply hidden; + } + } + + .server{ + + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); + top:40px; + + max-height:20vmax; + overflow: scroll; + @apply absolute min-w-full z-20; + div{ + @apply flex w-full bg-white; + justify-content: flex-start; + align-items: center; + &:hover{ + @apply bg-grey-mid; + } + input{ + height: 44px; + @apply absolute min-w-full opacity-0 z-20 cursor-pointer; + } + p{ + padding: 12px; + margin-top: 5px; + margin-bottom: 5px; + @apply text-form-field text-text-primary; + } + .custom-checkbox{ + height: 28px; + width: 28px; + @apply border border-solid border-input-border m-sm; + svg{ + @apply opacity-0 z-10; + } + } + input:checked ~ .custom-checkbox, + input:hover ~ .custom-checkbox { + @apply border-2 border-primary-main; + } + + input:checked ~ .custom-checkbox svg { + @apply opacity-100; + } + + } + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/navbar.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/navbar.scss new file mode 100644 index 0000000..1074ce0 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/navbar.scss @@ -0,0 +1,318 @@ +.navbar { + @apply text-white bg-secondary p-md w-full; + position: fixed; + z-index: 9999; + + img { + display: inline-block; + min-width: 78px; + height: 24px; + } + .nav { + display: flex; + justify-content: space-between; + } + .nav-wrapper { + display: flex; + @media (min-width: 780px) { + .hamburger-span { + display: none; + } + } + } + + h3 { + @apply inline-block border-l border-solid border-white pl-sm ml-sm; + } +} + +.img-circle { + border-radius: 50%; +} + +.profile-section { + height: auto; + display: flex; + flex-direction: column; + align-items: center; + padding-top: 30px; + background-color: theme(colors.white); + + img { + width: 89px; + height: 88px; + margin: 0px auto 16px; + } + + .label-container { + .label-text { + color: #767676; + } + &.name-Profile { + .label-text { + letter-spacing: 0.6px; + font-weight: 700; + font-size: 18px; + color: theme(colors.text.primary); + } + } + } + .profile-divider { + border-top: 1px solid theme(colors.border); + margin-left: 20px; + margin-right: 20px; + width: 90%; + margin-top: 1rem; + } +} + +.drawer-list { + @apply pt-md; + margin-bottom: 2rem; + position: relative; + min-height: 1px; + overflow: auto; + .menu-item { + border: 10px; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + cursor: pointer; + text-decoration: none; + margin: 0px; + padding: 0px; + outline: none; + font-size: 16px; + position: relative; + color: rgb(95, 92, 98); + line-height: 48px; + transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; + min-height: 48px; + white-space: initial; + background: none; + .icon { + display: block; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + height: 21px; + width: 21px; + float: left; + margin-top: 12px; + } + .edit-btn-ico{ + height: 17px; + width: 17px; + margin-top: 16px; + } + .icon + .menu-label { + margin-left: 36px; + text-overflow: ellipsis; + white-space: nowrap; + } + } + .sidebar-list { + padding-right: 16px; + padding-left: 16px; + &.active { + border-left: 5px solid theme(colors.primary.main); + .menu-label { + color: theme(colors.primary.main); + } + .icon { + fill: theme(colors.primary.main); + } + } + + .submenu-container { + cursor: pointer; + display: flex; + flex-direction: column; + + .sidebar-link { + display: flex; + justify-content: space-between; + align-items: center; + svg { + width: 21px; + height: 21px; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + } + } + .actions { + display: flex; + align-items: center; + overflow: hidden !important; + + span { + margin-left: 13px; + line-height: 48px; + white-space: nowrap; + color: #5f5c62; + overflow: hidden; + text-overflow: ellipsis; + } + input { + border: none; + outline: none; + margin-left: 16px; + padding: 0.5em; + color: #5f5c62; + } + } + } + } + + .dropdown-link { + .actions { + display: flex; + padding: 1em; + svg { + width: 21px; + height: 21px; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + } + span { + color: #5f5c62; + } + } + } +} + +.drawer-desktop { + overflow: auto; + .menu-item { + border: 10px; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + cursor: pointer; + text-decoration: none; + margin: 0px; + padding: 0px; + outline: none; + font-size: 16px; + position: relative; + color: rgb(95, 92, 98); + line-height: 48px; + transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; + min-height: 48px; + white-space: initial; + background: none; + .icon { + display: block; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + height: 21px !important; + width: 21px !important; + float: left; + margin-top: 12px; + } + .edit-btn-ico { + height: 17px; + width: 17px; + margin-top: 16px; + } + .icon + .menu-label { + margin-left: 36px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + @media (min-width: 780px) { + .sidebar-list { + padding-right: 16px; + padding-left: 16px; + &.active { + border-left: 5px solid theme(colors.primary.main); + padding-left: 11px; + .menu-label { + color: theme(colors.primary.main); + } + .icon { + fill: theme(colors.primary.main); + } + } + + .submenu-container { + margin-left: 1.5rem; + cursor: pointer; + display: flex; + flex-direction: column; + + .sidebar-link { + display: flex; + justify-content: space-between; + align-items: center; + svg { + width: 21px; + height: 21px; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + } + .actions { + .tooltip { + margin-left: 16px; + } + } + } + .actions { + display: flex; + align-items: center; + overflow: hidden !important; + + span { + margin-left: 13px; + line-height: 48px; + white-space: nowrap; + color: #5f5c62; + overflow: hidden; + text-overflow: ellipsis; + } + } + } + } + + .dropdown-link { + .actions { + display: flex; + padding: 1em; + svg { + width: 21px; + height: 21px; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + } + span { + color: #5f5c62; + } + } + } + } +} + +/* .navbar-header{ + @apply text-navbarheader float-left px-sm +} + +.navbar-subheader{ + @apply font-light px-sm border-solid border-l border-white border-opacity-100 +}*/ + +.side-bar-footer { + width: 200px; + margin-left: 50px; + margin-top: 24px; + margin-bottom: 16px; + position: relative; +} + +.digit-footer { + @apply flex h-4 mb-sm; + img { + @apply mr-sm; + } +} + +.sidebar-list-footer { + position: fixed; + bottom: 0; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/plusMinus.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/plusMinus.scss new file mode 100644 index 0000000..d482a9a --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/plusMinus.scss @@ -0,0 +1,15 @@ +.PlusMinus { + text-align: center; + display: flex; + align-content: center; + justify-content: center; +} +.PlusMinusbutton{ + border: 1px solid theme(colors.border); + background-color: theme(colors.grey.mid); + color: theme(colors.text.secondary); + font-size: 27px; + font-weight: 400; + text-align: center; + width: 40px; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/popup.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/popup.scss new file mode 100644 index 0000000..bf6e6d3 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/popup.scss @@ -0,0 +1,16 @@ +.popup-wrap { + background: rgba(0, 0, 0, 0.7); + @apply flex fixed w-full h-full overflow-auto top-0 left-0 min-h-screen; + z-index: 10000; +} + +@screen dt { + .popup-wrap { + background: rgba(0, 0, 0, 0.7); + @apply min-h-screen; + } +} + +.popup-close-icon{ + @apply flex justify-end; +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/radiobtn.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/radiobtn.scss new file mode 100644 index 0000000..1d6de00 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/radiobtn.scss @@ -0,0 +1,46 @@ +.radio-wrap { + @apply my-sm block leading-10 mb-lg; + max-width: 540px; + + div { + @apply block mb-md; + } + + .radio-btn-wrap { + @apply block float-left relative; + &:hover { + .radio-btn-checkmark { + @apply border-primary-main; + } + } + } + + .radio-btn { + @apply opacity-0 absolute cursor-pointer h-10 w-10; + } + + .radio-btn-checkmark { + @apply h-10 w-10 border border-input-border border-solid rounded-full block; + } + + label { + @apply text-text-primary text-form-field ml-md; + } + + .radio-btn-checkmark:after { + content: ""; + } + + .radio-btn-wrap input:checked ~ .radio-btn-checkmark { + @apply border-2 border-primary-main; + } + + .radio-btn-wrap input:checked ~ .radio-btn-checkmark:after { + @apply block bg-primary-main h-5 w-5 rounded-full absolute top-10 left-10; + } +} +.reverse-radio-selection-wrapper{ + div{ + @apply flex flex-row-reverse place-content-between items-center; ; + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/ratingstar.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/ratingstar.scss new file mode 100644 index 0000000..e3429ab --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/ratingstar.scss @@ -0,0 +1,33 @@ +.rating-star-wrap { + @apply flex w-full mb-lg; + img { + width: 40px; + height: 38px; + display: block; + @apply mr-sm; + } + + svg { + width: 40px; + height: 38px; + display: block; + @apply mr-sm; + } +} + +@screen dt { + .rating-star-wrap { + @apply w-2/5; + } +} + +.rating-with-text { + @apply flex place-items-center w-full; + + svg { + width: 24px; + height: 38px; + display: block; + @apply mr-sm; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/roundedLabel.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/roundedLabel.scss new file mode 100644 index 0000000..ae73426 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/roundedLabel.scss @@ -0,0 +1,10 @@ +.roundedLabel { + width: 24px; + height: 24px; + border-radius: 15px; + position: absolute; + z-index: 100; + bottom: 10px; + right: 70px; + @apply ml-sm bg-error text-center text-white; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/searchAction.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/searchAction.scss new file mode 100644 index 0000000..69d908a --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/searchAction.scss @@ -0,0 +1,20 @@ +.searchBox { + @apply flex m-sm justify-between; + .searchAction { + position: relative; + @apply flex flex-row text-focus; + .searchText { + @apply ml-sm; + } + } +} + +.svgPrimaryH16px{ + svg{ + width: 18px; + @apply h-6; + path{ + fill: theme(colors.primary.main); + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/sectionalDropdown.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/sectionalDropdown.scss new file mode 100644 index 0000000..c62103e --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/sectionalDropdown.scss @@ -0,0 +1,43 @@ +.sect-dropdown-wrap { + @apply mb-lg relative; + + .sect-dropdown-input-wrap { + @apply block w-full h-10 border border-solid border-input-border; + + input[type="text"] { + width: calc(100% - 32px); + @apply h-full outline-none text-text-primary text-form-field pl-sm; + } + p { + padding-top: 9px; + @apply text-form-field text-text-primary float-left ml-sm; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + } + + .sect-dropdown-card { + width: 100% !important; + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); + @apply absolute z-10 mt-xs pb-sm bg-white; + + h1 { + @apply pl-sm pt-md text-text-primary text-form-field; + } + + p { + padding-left: 21px; + @apply w-full pt-sm text-text-secondary text-form-field; + + &:hover { + @apply bg-grey-mid; + } + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/selectdropdown.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/selectdropdown.scss new file mode 100644 index 0000000..57ea39a --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/selectdropdown.scss @@ -0,0 +1,175 @@ +/*.select { + + @apply mb-lg block border-2 border-input-border border-solid outline-none rounded-none w-full h-10 bg-white leading-10; + + option { + @apply h-10 text-form-field text-text-primary align-top text-left; + } + + } + +.select:active { + @apply border-focus border-2; +} + +@screen dt { + .select { + @apply w-2/5; + } +} +*/ +.employee-select-wrap { + @apply mb-lg relative; + max-width: 540px; + + .select { + @apply relative block w-full h-10 border border-solid border-input-border; + &:hover { + @apply border-2 border-solid border-primary-main; + } + input[type="text"] { + width: calc(100% - 32px); + background-color: transparent; + + @apply absolute z-10 w-full h-full outline-none text-text-primary text-form-field pl-sm; + } + + p { + padding-top: 9px; + @apply text-form-field text-text-primary float-left ml-sm; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply absolute right-0 float-right h-6 w-6 mt-sm mr-sm; + } + } + + .select-active { + @apply relative block w-full h-10 border-2 border-solid border-primary-main; + + input[type="text"] { + width: calc(100% - 32px); + background-color: transparent; + + @apply absolute z-10 w-full h-full outline-none text-text-primary text-form-field pl-sm; + } + + p { + @apply text-form-field text-text-primary float-left ml-sm; + } + + p { + padding-top: 9px; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply absolute right-0 float-right h-6 w-6 mt-sm mr-sm; + } + } + + .options-card { + width: 100% !important; + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); + max-height: 400px; + overflow: auto; + @apply absolute z-20 mt-xs bg-white max-w-full; + + p { + padding-top: 14px; + @apply w-full h-12 pl-sm text-text-primary text-form-field; + + &:hover { + @apply bg-grey-mid; + } + } + } +} + +.employee-select-wrap--elipses { + width: 85% !important; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.select-wrap { + @apply mb-lg relative; + max-width: 540px; + + .select { + @apply relative block w-full h-10 border border-solid border-input-border; + + input[type="text"] { + width: calc(100% - 32px); + background-color: transparent; + + @apply absolute z-10 w-full h-full outline-none text-text-primary text-form-field pl-sm; + } + + p { + padding-top: 9px; + @apply text-form-field text-text-primary float-left ml-sm; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply absolute right-0 float-right h-6 w-6 mt-sm mr-sm; + } + } + + .select-active { + @apply relative block w-full h-10 border-2 border-solid border-primary-main; + + input[type="text"] { + width: calc(100% - 32px); + background-color: transparent; + + @apply absolute z-10 w-full h-full outline-none text-text-primary text-form-field pl-sm; + } + + p { + @apply text-form-field text-text-primary float-left ml-sm; + } + + p { + padding-top: 9px; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply absolute right-0 float-right h-6 w-6 mt-sm mr-sm; + } + } + + .options-card { + width: 100% !important; + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); + @apply absolute z-20 mt-xs bg-white; + + p { + padding-top: 14px; + @apply w-full h-12 pl-sm text-text-primary text-form-field; + + &:hover { + @apply bg-grey-mid; + } + } + } +} + +@screen dt { +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/sidebar.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/sidebar.scss new file mode 100644 index 0000000..6a04adf --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/sidebar.scss @@ -0,0 +1,141 @@ +.sidebar-link:hover .arrow { + display: block; +} + +.hidden-arrow { + display: none; +} +.new-dropdown-link{ + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px 15px 15px !important; + color: #fff; + font-size: 1rem; + font-weight: 500; + text-decoration: none; + margin-left: 0px !important; + height: 3rem !important; + margin-left: 1rem; + margin-top: 0.5rem; +} +.selected { + background-color: #e0e0e0; /* Change this to your desired highlight color */ +} + +.selected-item { + background-color: #e0e0e0; /* Set your desired background color for the selected item */ + color: #000; /* Set your desired text color for the selected item */ + /* Add any other styles you want to apply to the selected item */ +} +/* Style the container that acts as the viewport */ +.new-sidebar { + height: 90%; /* Set a fixed height for the viewport */ + overflow: scroll; /* Hide the scrollbar */ + + &::-webkit-scrollbar { + display: none; + } + + &::-webkit-scrollbar { + -ms-overflow-style: none; /* IE and Edge */ + scrollbar-width: none; /* Firefox */ + } +} + +/* Style the content inside the viewport */ +.new-sidebar > div { + height: auto; /* Allow content to expand vertically */ + overflow-y: auto; /* Enable vertical scrolling */ + overflow-x: hidden; + padding-right: 2px; /* Add space for the hidden scrollbar (adjust as needed) */ +} + +/* Style the scrollbar thumb to make it transparent */ +.new-sidebar > div::-webkit-scrollbar-thumb { + background: transparent; +} +.link-icon{ + width: 24px !important; + height: 26px !important; +} +.link-icon svg{ + width: 24px !important; + height: 26px !important; +} + +.employee-search-input{ + width: 150px; + background-color: transparent; + &.nav-bar { + color:#fff; + } + &.nav-bar::placeholder { + color: #fff; + } +} + +.search-icon-wrapper-new { + margin-left: 0.35rem; +} + +.search-icon-wrapper-new svg{ + fill: theme(colors.white) !important; + width: 21px; + height: 21px; +} +.search-icon-wrapper-new svg path { + fill: theme(colors.white) !important; + } + +.submenu-container { + overflow: scroll; + margin-bottom: 1rem; + /* Hide the scrollbar */ + &::-webkit-scrollbar { + display: none; + } + + &.level-2 { + border-left: 1px solid; + margin-left: 2rem; + } + &.level-1 { + margin-left: -1.5rem; + } +} + +.actions { + &.level-0 { + margin-left: 0.4rem; + } + &.selected-action-level-0 { + color: theme(colors.primary.main) !important; + } + &.selected-action-level-1 { + border-left:4px solid theme(colors.primary.main); + margin-left: -0.6rem; + height: 2rem; + color: theme(colors.primary.main) !important; + } + + &.default-0 { + &.active { + + } + } + &.default-1 { + margin-left: -0.6rem; + height: 2rem; + width: 111% !important; + } + + + &.custom { + margin-left: 0.3rem; + } + &:hover { + background-color: #6A8E9D; + opacity: 0.8; + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/staticDynamicMessages.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/staticDynamicMessages.scss new file mode 100644 index 0000000..cbf0b89 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/staticDynamicMessages.scss @@ -0,0 +1,107 @@ +.pay-whatsapp-card{ + display: flex; + justify-content: space-between; + cursor: pointer; +} +.pay-whatsapp-text{ + color: #25D366; + float: left; + font-family: 'Roboto'; + font-size: 16px; + font-weight: 700; +} +.dynamicDataCard{ + background: rgba(244, 119, 56, 0.12); + mix-blend-mode: normal; + height: auto; + max-height: 64px; + border-radius: 4px; + margin-bottom: 16px; +} +.dynamicData{ + padding: 10px 16px 16px 16px; + display: flex; +} +.dynamicData-content{ + font-family: 'Roboto'; + font-size: 14px; + font-weight: 400; + padding-top: 4px; + word-break: break-word; + margin-inline: 20px; +} +.staticDataCard{ + background: rgba(238, 238, 238, 1); + mix-blend-mode: normal; + height: auto; + max-height: 100px; + border-radius: 4px; + margin-bottom: 16px; +} +.staticData{ + display: flex; +} +.timerIcon{ + padding: 16px 0px 16px 16px; +} +.static-data-content{ + display: grid; + margin-inline: 20px; + padding-top: 8px; +} +.rupeeSymbol{ + padding: 16px 0px 16px 16px; +} +.validityIcon{ + padding: 16px 0px 16px 8px; +} +.static-data-content-first{ + font-family: 'Roboto'; + font-size: 14px; + font-weight: 400; +} +.static-data-content-second{ + font-family: 'Roboto'; + font-size: 16px; + font-weight: 700; + word-break: break-word; +} +.staticDataCardLast{ + background: rgba(238, 238, 238, 1); + mix-blend-mode: normal; + height: 56px; + border-radius: 4px; +} +.whatsAppIconG{ + float: right; +} +.static-home-Card{ + display: flex; + justify-content: space-between; +} +.static-home-Card-header{ + font-family: 'Roboto'; + font-size: 16px; + font-weight: 700; + float: left; +} +.helplineIcon{ + float: right; +} +.call-center-card-text{ + display: grid; +} +.call-center-card-content{ + float: left; +} +.serviceCentrIcon{ + float: right; +} +.service-center-details-card{ + display: flex; + overflow-wrap: break-word; +} +.service-center-details-text{ + float: left; + width: 180px; +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/staticSideBar.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/staticSideBar.scss new file mode 100644 index 0000000..b87fa57 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/staticSideBar.scss @@ -0,0 +1,27 @@ +.sidebar-menu { + display: flex; + flex-direction: column; + padding-top: 16px; + padding-left: 16px; + padding-right: 16px; + color: #757575; + + .menu-item { + display: flex; + cursor: pointer; + min-height: 48px; + margin: 0; + padding: 0; + .menu-item-icon { + svg { + color: #757575; + fill: #757575; + width: 21px; + height: 21px; + } + } + .menu-item-text { + margin-left: 1em; + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/statushighlight.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/statushighlight.scss new file mode 100644 index 0000000..ef564ab --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/statushighlight.scss @@ -0,0 +1,17 @@ +.status-highlight { + --bg-opacity: 12% !important; + border-radius: 16px; + @apply h-8 w-20 bg-error mb-sm; + + p { + padding-top: 6px; + @apply block text-center text-caption-m text-error cursor-pointer; + } + + &.success { + @apply bg-success; + p { + @apply text-success; + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/submiterrors.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/submiterrors.scss new file mode 100644 index 0000000..f0f6c92 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/submiterrors.scss @@ -0,0 +1,11 @@ +.error-message-wrap { + @apply w-full mb-sm p-md border-4 border-solid border-error; + + h2 { + @apply font-bold text-caption-m block mb-sm; + } + + p { + @apply font-bold text-caption-m text-error block; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/summary.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/summary.scss new file mode 100644 index 0000000..3c044a0 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/summary.scss @@ -0,0 +1,29 @@ +.summary-wrapper { + @apply flex justify-around; + + .wrapper-child { + @apply flex flex-col justify-center flex-grow; + } + + .blocks { + display: flex; + margin-bottom: 25px; + + p:only-child { + font-weight: bold; + font-size: 24px; + } + + div { + margin-right: 25px; + + p:not(:first-child) { + font-weight: bold; + font-size: 24px; + } + } + } +} +.summary-card-margin{ + margin:0 24px 20px 0px !important; +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/table.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/table.scss new file mode 100644 index 0000000..379af9f --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/table.scss @@ -0,0 +1,201 @@ +.table { + @apply bg-white w-full; + + thead { + th { + padding: 20px 18px; + @apply font-bold align-middle text-left; + &:first-child { + min-width: 256px; + } + &:nth-child(2) { + min-width: 200px; + } + } + } + + + tbody { + border: none; + padding: 0; + margin: 0; + td { + @apply border-t border-border text-left align-middle; + padding: "20px 18px"; + } + } +} + +.pagination { + display: flex; + justify-content: flex-end; + background-color: rgba(255, 255, 255, var(--bg-opacity)); + border-top: 1px solid rgb(214, 213, 212); + padding: 20px 40px 20px 0px; + color: rgb(80, 90, 95); + + svg { + fill: theme(colors.text.secondary); + @apply ml-md; + } +} + +.pagination button:nth-child(1) span::after { + content: "\f105"; +} + +.fullWidth { + width: 100% !important; +} + +.customTable { + width: 100%; + th { + font-weight: bold; + } + + th, + td { + text-align: left; + border-bottom: 1px solid #b1b4b6; + padding: 15px 10px; + } + + tr:nth-child(odd) { + background-color: theme(colors.grey.mid); + } + tr:nth-child(even) { + background-color: #fff; + } + + thead { + tr:first-child { + background-color: unset; + } + } +} + +.table-fixed-first-column { + thead { + th:first-child { + position: sticky; + background: #fff; + left: 0; + border-right: 1px solid #b1b4b6; + border-top-left-radius: 4px; + } + } + tbody { + td:first-child { + position: sticky; + background: #fff; + color: theme(colors.primary.main); + left: 0; + border-right: 1px solid #b1b4b6; + } + } +} + +.table-fixed-last-column { + thead { + th:last-child { + position: sticky; + background: #fff; + right: 0; + left:0; + border-top-left-radius: 4px; + } + } + tbody { + td:last-child { + position: sticky; + background: #fff; + color: theme(colors.primary.main); + left: 0; + right:0; + } + } +} + +.table-fixed-column-common-pay { + thead { + th:first-child { + position: sticky; + background: rgb(238, 238, 238); + left: 0; + border-top-left-radius: 4px; + } + th:last-child { + position: sticky; + background: rgb(238, 238, 238); + right: 0; + border-top-left-radius: 4px; + } + } + tbody { + td:first-child { + position: sticky; + background: rgb(238, 238, 238); + left: 0; + } + td:last-child { + position: sticky; + background: rgb(238, 238, 238); + right: 0; + } + } +} + +.table-fixed-first-second-column { + thead { + th:nth-child(2) { + position: sticky; + left: 0; + background-color: white; + } + } + tbody { + td:nth-child(2) { + position: sticky; + left: 0; + background-color: inherit; + } + } +} +.table-border-style { + border: 1px solid #b1b4b6; + border-radius: 4px; + border-spacing: 0; + border-collapse: separate; +} +.dss-table-wrapper { + width: 100%; + display: block; + overflow-x: auto; + table { + th { + .tooltip { + min-width: 80px; + } + } + tr { + td { + span { + white-space: pre; + min-width: 80px; + } + } + } + } +} + +.reports-table { + margin-top: 2rem; + thead { + th { + &:first-child { + min-width: unset; + } + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/tag.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/tag.scss new file mode 100644 index 0000000..0d0d0e9 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/tag.scss @@ -0,0 +1,27 @@ +.tag-container { + @apply flex flex-wrap mb-md; + .tag { + @apply bg-grey-mid rounded-2xl pt-sm pb-sm flex justify-between items-center; + padding-left: 12px; + padding-right: 12px; + font-size: 14px; + margin-left: 2px; + height: 2rem; + margin-top: 1rem; + .text { + padding-right: 5px; + max-width: calc( 100% - 24px ); + height: 22px; + overflow: hidden; + text-overflow: clip; + } + + &:hover { + @apply cursor-pointer; + + .close { + fill: black; + } + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/telephone.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/telephone.scss new file mode 100644 index 0000000..7b711d2 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/telephone.scss @@ -0,0 +1,17 @@ +.telephone { + @apply flex items-baseline; + img, + svg { + height: 22px; + width: 20px; + @apply text-primary-main ml-sm items-center; + } + + p { + @apply text-text-primary text-body-l pl-sm; + } +} + +.call { + @apply flex text-text-secondary text-body-l; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/textfields.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/textfields.scss new file mode 100644 index 0000000..7151401 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/textfields.scss @@ -0,0 +1,96 @@ +.card-input { + @apply mb-lg pl-sm outline-none mt-sm block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; +} + +.card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; +} + +.employee-card-input { + @apply mb-lg pl-sm outline-none block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; +} +.employee-card-input:disabled { + @apply border-grey-dark text-grey-dark !important; + pointer-events: none !important; +} +.employee-card-input--front { + width: fit-content !important; + display: flex; + align-items: center; + background: theme(colors.grey.mid); + border-right: 0; + padding-right: 5px; +} +.employee-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; +} + +.card-textarea, +.employee-card-textarea { + @apply block outline-none mt-md mb-lg border w-full border-input-border border-solid bg-white h-24 text-form-field text-text-primary p-sm; +} + +.inputWrapper { + display: flex; + justify-content: flex-start; + max-width: 500px; + + div { + max-width: 80px; + } + + span { + margin-top: 16px; + margin-left: 10%; + margin-right: 10%; + } +} + +@screen dt { + .card-input { + width: 480px; + } + + .card-input-emp { + width: 240px; + } + + .card-input-error { + width: 480px; + } + + .employee-card-input { + @apply w-full; + } + + .employee-card-input-error { + @apply w-full; + } + + .card-textarea { + /* //width: 480px; */ + @apply w-full; + max-width:540px; + } + + .employee-card-textarea { + @apply w-full; + } + + .card-input-emp { + width: 240px; + } +} + +.citizen-card-input { + @apply mb-lg pl-sm outline-none block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; +} + +.citizen-card-input--front { + width: fit-content !important; + display: flex; + align-items: center; + background: theme(colors.grey.mid); + border-right: 0; + padding-right: 5px; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/toast.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/toast.scss new file mode 100644 index 0000000..3a442bc --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/toast.scss @@ -0,0 +1,31 @@ +.toast-success { + max-width: 480px; + width: calc(100% - 20px); + bottom: 64px; + left: 0; + margin: 0 10px; + gap: 16px; + border-radius: 4px; + min-height: 48px; + @apply fixed flex bg-success leading-7 z-20 items-center pl-md pr-sm; + + svg { + height: 20px; + width: 20px; + } + + .toast-close-btn { + margin-left: auto; + } + + h2 { + @apply text-body-s-dt text-white; + } +} + +@screen dt { + .toast-success { + width: 100%; + left: calc(50% - 240px); + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/toggleSwitch.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/toggleSwitch.scss new file mode 100644 index 0000000..6c09986 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/toggleSwitch.scss @@ -0,0 +1,41 @@ +.react-switch-checkbox { + height: 0; + width: 0; + visibility: hidden; + } + + .react-switch-label { + display: flex; + align-items: center; + justify-content: space-between; + cursor: pointer; + width: 50px; + height: 20px; + background: white; + border-radius: 100px; + position: relative; + transition: background-color .2s; + border: 1px solid #bbb; + } + + .react-switch-label .react-switch-button { + content: ''; + position: absolute; + top: 2px; + left: 2px; + width: 14px; + height: 14px; + border-radius: 45px; + transition: 0.2s; + background: theme(colors.primary.main); + box-shadow: 0 0 2px 0 rgba(10, 10, 10, 0.29); + } + + .react-switch-checkbox:checked + .react-switch-label .react-switch-button { + left: calc(100% - 2px); + transform: translateX(-100%); + } + + .react-switch-label:active .react-switch-button { + width: 45px; + } \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/topbar.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/topbar.scss new file mode 100644 index 0000000..56bbd84 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/topbar.scss @@ -0,0 +1,153 @@ +.topbar { + position: fixed; + top: 0; + width: 100%; + padding: 10px 24px; + background: white; + box-shadow: rgba(0, 0, 0, 0.24) 0 1px 4px; + z-index: 9999999; + @apply flex items-center; + + img { + display: inline; + + &.city { + margin-right: 8px; + height: 48px; + width: 48px; + } + + &.state { + height: 20px; + max-height: 20px; + width: auto; + } + } + + .ulb { + font-weight: bold; + display: inline-block; + } + + .right { + float: right; + margin-top: 12px; + position: relative; + + svg { + display: inline; + } + + .user-img-txt { + background: theme(colors.primary.main); + padding: 10px 15px; + border-radius: 50%; + color: white; + font-weight: 700; + } + } + + .left { + float: left; + } + + .w-80 { + width: 70%; + } + + .width-20 { + width: 30%; + } + + .margin-top-6 { + margin-top: 6px; + } + + .margin-right-30 { + margin-right: 30px; + } + + .margin-top-10 { + margin-top: 10px; + } + + .icon { + display: block; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + height: 21px; + width: 21px; + } + + .column-gap-15 { + column-gap: 15px; + } + + .column-gap-5 { + column-gap: 5px; + } + + .select-wrap, + .employee-select-wrap { + margin-bottom: 0px; + .profile-dropdown--item { + span { + white-space: pre; + } + } + } +} + +.cp { + cursor: pointer; + .hamburger { + display: none; + } + + @media (max-width: 780px) { + .hamburger { + display: none; + } + } +} + +.citizen { + .right { + margin-top: 5px; + margin-bottom: 5px; + } + + .topbar-select-wrap { + margin-bottom: 0; + } + + .flex-between { + @apply flex items-center justify-between; + } +} + +.profile-dropdown--item { + display: flex; + flex-direction: row; + padding: 10px; + column-gap: 10px; + color: theme(colors.text.secondary); + + &:hover { + background: theme(colors.grey.mid); + } +} + +.flex-right { + @apply flex items-center justify-end; + min-width: 85px; +} +video::-webkit-media-controls-panel { + top: 55%; + position: absolute; + width: 100%; +} + +.topbarOptionsClassName { + right: -3rem !important +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/uploadcomponents.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/uploadcomponents.scss new file mode 100644 index 0000000..349f2f9 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/uploadcomponents.scss @@ -0,0 +1,100 @@ +.upload-wrap { + @apply flex w-full h-40 bg-grey-light relative mb-lg px-sm border border-border border-dashed; + max-width: 540px; + + img { + display: block; + margin-top: 58px; + margin-left: calc(50% - 23px); + height: 42px; + width: 46px; + } + + svg { + display: block; + margin-top: 58px; + margin-left: calc(50% - 23px); + height: 42px; + width: 46px; + } + + input { + @apply absolute w-full h-full opacity-0 top-0; + } +} + +.multi-upload-wrap { + @apply flex mb-lg; + + div { + display: block; + position: relative; + background-color: theme(colors.grey.light); + width: calc((100% - 16px) / 3); + margin-right: 8px; + + .delete { + position: absolute; + height: 24px; + width: 24px; + border-radius: 100%; + top: 2px; + right: 2px; + } + } + + .upload-img-container { + border: 1px dashed theme(colors.border); + margin: 0 !important; + + img { + margin-left: auto; + margin-right: auto; + padding-top: calc(33% - 21px); + } + + svg { + @apply flex; + margin: auto; + } + + svg { + margin-left: auto; + margin-right: auto; + top: calc(50% - 21px); + position: relative; + } + + input { + @apply absolute w-full h-full opacity-0 top-0; + } + } +} + +.upload-file-max-width { + max-width: 540px; +} + +.upload-file { + min-height: 56px; + @apply relative border border-input-border w-full; + + div { + @apply flex flex-row h-full items-center pl-md mt-sm flex-wrap; + + .file-upload-status { + @apply text-body-s-dt ml-sm; + } + } + input { + width: 160px; + @apply absolute top-0 left-0 opacity-0 h-full; + } +} + +@screen dt { + .multi-upload-wrap img { + width: 100%; + height: 158px; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/ErrorMessage.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/ErrorMessage.scss new file mode 100644 index 0000000..07117cc --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/ErrorMessage.scss @@ -0,0 +1,6 @@ +@import url("../index.scss"); + +.digit-error-message { + @extend .alert-error; + @apply block text-body-s mb-md; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/FormComposerV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/FormComposerV2.scss new file mode 100644 index 0000000..c82f866 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/FormComposerV2.scss @@ -0,0 +1,126 @@ +@import url("../index.scss"); + +.field-container { + display: flex; + align-items: center; + max-width: 540px; + @apply flex items-center; + + .component-in-front { + @apply flex justify-center items-center; + @extend .light-background; + @extend .light-input-border; + margin-top: 0; + border: 1px solid; + border-right: none; + padding: 7px; + } +} + +.card-date-input { + @apply absolute top-0 left-0 w-3/4 bg-white pl-sm border border-input-border border-solid border-r-0; + outline: transparent solid 1px; + height: 2.5rem; + @extend .light-input-border; +} +.text-input-width { + max-width: 540px; +} + +.text-input { + @apply relative w-full; + input { + background-color: transparent; + &:hover { + @apply border-2 border-solid border-primary-main; + @extend .light-input-border; + } + } +} +.employee-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; + @extend .alert-error; +} +.card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; + @extend .alert-error; +} + +.employee-card-input { + @apply mb-lg pl-sm outline-none block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; +} + +.employee-card-input { + max-width: 540px; +} + +.employee-card-input:disabled { + @apply border-grey-dark text-grey-dark !important; + pointer-events: none !important; + @extend .light-input-border; + @extend .light-text-color-disabled; +} +.employee-card-input--front { + width: fit-content !important; + display: flex; + align-items: center; + /* background: theme(colors.grey.mid); */ + @extend .light-background; + border-right: 0; + padding-right: 5px; +} +.employee-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; + @extend .alert-error; +} + +.card-textarea, +.employee-card-textarea { + @apply block outline-none mt-md mb-lg border w-full border-input-border border-solid bg-white h-24 text-form-field text-text-primary p-sm; + @extend .light-input-border; +} +.employee-card-textarea { + @apply w-full; + max-width: 540px; +} + +.citizen-card-input { + @apply mb-lg pl-sm outline-none block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; +} +.citizen-card-input--front { + @extend .light-background; + width: fit-content !important; + display: flex; + align-items: center; + /* background: theme(colors.grey.mid); */ + border-right: 0; + padding-right: 5px; +} + +.break-line { + @extend .light-input-border; + @apply border-border my-lg; +} + +.primary-label-btn { + @apply flex; + gap: 10px; + + svg { + fill: theme(colors.primary.main); + } + + @extend .light-primary; + cursor: pointer; + font-weight: 500; + width: fit-content; +} + +.digit-form-composer-header{ + font-size:theme(digitv2.fontSize.heading-l-dt); +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/actionLinkV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/actionLinkV2.scss new file mode 100644 index 0000000..c41b0b2 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/actionLinkV2.scss @@ -0,0 +1,7 @@ +@import url("../index.scss"); + +.digit-action-links { + @extend .light-primary; + @apply text-text-btn mr-lg !important; + cursor: pointer; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/actionbarV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/actionbarV2.scss new file mode 100644 index 0000000..e5a69ac --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/actionbarV2.scss @@ -0,0 +1,110 @@ +@import url("../index.scss"); + +.digit-action-bar-wrap { + @extend .light-text-color-primary; + @extend .light-paper-primary; + box-shadow: rgba(0, 0, 0, 0.16) 0 -2px 8px; + max-width: 100%; + z-index: 100; + + @apply left-0 bottom-0 w-full bg-white py-sm px-sm fixed text-right; + + div { + @apply w-full; + } + + .digit-menu-wrap { + @apply absolute bg-white text-left mb-xs z-30 cursor-pointer; + @extend .light-background; + bottom: 45px; + box-shadow: rgba(0, 0, 0, 0.14) 0 8px 10px 1px, rgba(0, 0, 0, 0.12) 0 3px 14px 2px, rgba(0, 0, 0, 0.2) 0 5px 5px -3px; + width: calc(100% - 16px); + right: 8px; + + div { + @apply h-12 pl-sm py-md text-body-l text-text-primary; + @extend .light-primary; + + &:hover { + @apply bg-grey-mid w-full; + @extend .light-background; + } + } + } +} + +@screen dt { + .digit-action-bar-wrap { + box-shadow: rgba(0, 0, 0, 0.16) 0 -2px 8px; + left: 0; + max-width: none; + z-index: 999; + + @apply fixed bottom-0 bg-white py-sm pr-lg text-right; + /* @extend .light-background; */ + + div { + width: calc(100% - 16px); + } + + .digit-menu-wrap { + bottom: 45px; + top: unset; + box-shadow: rgba(0, 0, 0, 0.14) 0 8px 10px 1px, rgba(0, 0, 0, 0.12) 0 3px 14px 2px, rgba(0, 0, 0, 0.2) 0 5px 5px -3px; + @apply absolute h-auto bg-white text-left mb-xs z-30; + width: 240px; + right: 24px; + + div { + @apply h-12 pl-sm py-md text-body-l text-text-primary; + + &:hover { + @apply bg-grey-mid w-full; + /* @extend .light-background; */ + } + } + } + } +} + +.digit-action-bar-wrap-registry { + div { + @apply w-full; + } + .digit-menu-wrap { + @apply absolute bg-white text-left mb-xs z-30 cursor-pointer; + box-shadow: rgba(0, 0, 0, 0.14) 0 8px 10px 1px, rgba(0, 0, 0, 0.12) 0 3px 14px 2px, rgba(0, 0, 0, 0.2) 0 5px 5px -3px; + width: 160px; + right: 60px; + @extend .light-background; + + div { + @apply h-12 pl-sm py-md text-body-l text-text-primary; + + &:hover { + @apply bg-grey-mid w-full; + @extend .light-background; + } + } + } + + .digit-search-add { + padding: 12px 16px; + @extend .light-primary; + color: rgb(244, 119, 56); + display: flex; + cursor: pointer; + } + + .digit-search-add-icon { + @extend .light-primary-button; + background: rgb(244, 119, 56); + border-radius: 50%; + height: 24px; + width: 24px; + display: flex; + justify-content: center; + align-items: center; + margin-left: 10px; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/appContainerV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/appContainerV2.scss new file mode 100644 index 0000000..fda32e9 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/appContainerV2.scss @@ -0,0 +1,55 @@ +@import url("../index.scss"); + +.app-container { + @extend .light-background; + width: 100%; + form { + .card { + max-width: 960px; + h2 { + @extend .light-text-color-primary; + text-align: left; + } + .field-container { + max-width: 540px; + } + button { + @extend .light-primary-button; + max-width: 240px; + } + .input-otp-wrap, + .card-text-button { + @extend .light-primary-button; + text-align: left; + } + } + } +} + +@screen dt { + .employee-app-container { + @apply w-full; + } + + .app-container { + width: 100%; + form { + .card { + max-width: 960px; + h2 { + text-align: left; + } + .field-container { + max-width: 540px; + } + button { + max-width: 240px; + } + .input-otp-wrap, + .card-text-button { + text-align: left; + } + } + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/backButtonV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/backButtonV2.scss new file mode 100644 index 0000000..68f7cf9 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/backButtonV2.scss @@ -0,0 +1,26 @@ +@import url("../index.scss"); + +.digit-back-button { + @extend .light-text-color-primary; + @extend .light-input-border; + width: fit-content; + @apply flex items-center cursor-pointer border-b font-rc text-text-btn ml-sm mb-md; + + img { + @apply flex; + } + + svg { + @apply flex; + } + + p { + @apply flex; + } +} + +@screen dt { + .digit-back-button { + margin-left: 0; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/bannerV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/bannerV2.scss new file mode 100644 index 0000000..06c1697 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/bannerV2.scss @@ -0,0 +1,120 @@ +@import url("../index.scss"); + +.digit-banner-success-wrap, +.digit-banner-emp-success-wrap { + @apply block bg-success w-full text-center text-white pt-md pb-sm mb-md; + + header { + @apply block mb-sm font-rc font-bold text-heading-xl; + } + + div { + img { + padding: 13.67px; + margin-left: auto; + margin-right: auto; + @apply border border-solid border-white rounded-full h-16 w-16 bg-white mb-md; + } + + svg { + padding: 13.67px; + margin-left: auto; + margin-right: auto; + @apply border border-solid border-white rounded-full h-16 w-16 bg-white mb-md; + } + + svg.payment-svg { + border: unset; + background-color: unset; + @apply rounded-full; + } + + h2 { + @apply font-bold text-caption-m mb-sm; + } + + p { + @apply font-bold text-caption-l; + } + } +} + +.digit-banner-error-wrap, +.digit-banner-emp-error-wrap { + @apply block bg-error w-full text-center text-white pt-md pb-sm mb-md; + + + header { + @apply block mb-sm font-rc font-bold text-heading-xl; + } + + img { + margin-left: auto; + margin-right: auto; + padding: 13.67px; + @apply border border-solid border-white rounded-full bg-white h-16 w-16 mb-md; + } + + svg { + margin-left: auto; + margin-right: auto; + padding: 13.67px; + @apply border border-solid border-white rounded-full bg-white h-16 w-16 mb-md; + } +} + +@screen dt { + .digit-banner-success-wrap { + header { + @apply text-heading-xl-dt; + } + } + .digit-banner-emp-success-wrap { + width: calc(100%); + header { + @apply text-heading-xl-dt; + } + } + + .digit-banner-error-wrap { + width: 100%; + header { + @apply text-heading-xl-dt; + } + } + + .digit-banner-emp-error-wrap { + width: calc(100%); + header { + @apply text-heading-xl-dt; + } + } +} + +.banner { + @apply flex justify-center items-center; + height: calc(100vh - 80px); + background: linear-gradient(rgba(11, 75, 102, 0.8), rgba(11, 75, 102, 0.8)), var(--banner-url) center center; + + .bannerCard { + min-width: 400px; + } + .bannerLogo { + width: 80px; + height: 40px; + object-fit: contain; + padding-right: 10px; + margin-right: 10px; + border-right: 1px solid theme(colors.text.primary); + } + .bannerHeader { + @apply flex justify-center items-center; + margin-bottom: 24px; + } +} + +.banner-container { + flex-direction: column; + justify-content: center; + align-items: center !important; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/bodyContainerV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/bodyContainerV2.scss new file mode 100644 index 0000000..9836a71 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/bodyContainerV2.scss @@ -0,0 +1,39 @@ +@import url("../index.scss"); + +body { + @extend .light-background; +} + +.body-container { + @extend .light-background; + @apply h-full min-h-screen overflow-x-hidden; +} + +.body-container::-webkit-scrollbar { + display: none; +} + +.h1 { + @extend .light-text-color-primary; + @apply text-heading-l font-bold mb-md ml-md; +} + +.link-label { + @extend .light-primary; + @apply block mb-md ml-md cursor-pointer; + + &:hover { + @extend .light-text-color-primary; + } +} + +@screen dt { + .h1 { + margin-left: 0; + @apply text-heading-l-dt; + } + + .link-label { + margin-left: 0; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/breadCrumbV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/breadCrumbV2.scss new file mode 100644 index 0000000..2b13c86 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/breadCrumbV2.scss @@ -0,0 +1,31 @@ +@import url("../index.scss"); + +.digit-bread-crumb { + @extend .light-text-color-secondary; + font-size: 14px; + display: flex; + margin-bottom: 10px; +} +.digit-bread-crumb--item { + margin-left: 5px; + + &:not(:last-child):after { + content: " /"; + } + + button { + outline: none; + } + + .last { + @extend .light-text-color-primary; + } + + span { + cursor: pointer; + } +} +ol, +ul { + list-style: none; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/breakLineV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/breakLineV2.scss new file mode 100644 index 0000000..1b67e4b --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/breakLineV2.scss @@ -0,0 +1,6 @@ +@import url("../index.scss"); + +.digit-break-line { + @apply border-solid border-2; + @extend .light-input-border; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/cardV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/cardV2.scss new file mode 100644 index 0000000..ee75e5a --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/cardV2.scss @@ -0,0 +1,385 @@ +@import url("../index.scss"); + +.digit-card { + @apply bg-white m-sm px-md pt-md pb-lg shadow-card; + @extend .light-paper-primary; + border-radius: 4px; + max-width: 960px; + + .digit-card-header { + @extend .light-primary; + @apply text-heading-xl font-bold font-rc align-middle text-left mb-md; + } + + .digit-card-sub-header { + @extend .light-primary; + @apply text-caption-xl font-bold align-middle text-left mb-sm; + } + + .digit-card-caption { + @extend .light-text-color-secondary; + @apply text-caption-xl mb-sm; + } + + .digit-card-text { + @extend .light-text-color-secondary; + @apply text-body-l align-middle text-left mb-lg; + + span { + @extend .light-text-color-primary; + } + } + + .digit-card-text-primary { + @extend .light-primary; + @apply text-body-l; + } + + .digit-card-text-button { + @extend .light-primary; + @apply text-text-btn; + } + + .digit-card-label { + @extend .light-primary; + @apply text-legend mb-sm; + } + + .digit-card-label-error { + @extend .alert-error; + @apply block text-body-s text-error mb-md; + } + + .digit-card-label-desc { + @extend .light-text-color-secondary; + @apply font-bold text-heading-s mb-md; + } + + .digit-card-link { + @extend .light-primary; + @apply block text-center text-link mt-md cursor-pointer; + } +} + +.digit-validation-error { + @extend .alert-error; + @apply block text-body-s text-error; +} + +.digit-docsDescription { + @extend .light-text-color-primary; +} + +.digit-field-container { + @apply flex items-center; +} + +.digit-employee-card { + @extend .light-paper-primary; + @apply shadow-card p-md mb-xl; + border-radius: 4px; + + .digit-card-header { + @extend .light-primary; + @apply text-heading-xl font-bold font-rc align-middle text-left mb-md; + } + + .digit-card-sub-header, + .digit-employee-card-sub-header { + @extend .light-primary; + @apply text-caption-xl font-bold align-middle text-left; + } + + .digit-card-section-header { + @extend .light-primary; + @apply text-heading-m font-bold; + } + + .digit-card-section-sub-text { + @extend .light-primary; + @apply text-body-s; + } + + .digit-card-caption { + @extend .light-text-color-secondary; + @apply text-caption-xl mb-sm; + } + + .digit-card-text { + @extend .light-text-color-secondary; + @apply text-body-l align-middle text-left mb-lg; + + span { + @extend .light-text-color-primary; + } + } + + .card-text-primary { + @extend .light-primary; + @apply text-body-l; + } + + .card-text-button { + @extend .light-primary; + @apply text-text-btn; + } + + .card-label { + @extend .light-primary; + @apply text-legend mb-md; + } + + .card-label-error { + @extend .alert-error; + @apply block text-body-s text-error mb-md; + } + + .card-label-desc { + @extend .light-text-color-secondary; + @apply font-bold text-heading-s mb-md; + } + + .card-link { + @extend .light-primary; + @apply block text-center text-link text-link-normal mt-md; + } + + .card-search-heading { + margin-right: 0px !important; + margin-left: 0px !important; + margin-bottom: 0px !important; + padding-bottom: 0px; + padding-left: 25px; + } +} + +.header-wrap { + @apply flex mb-md; + + .header-start { + margin-right: auto; + } + + .header-content { + } + + .header-end { + margin-left: auto; + } +} + +.card-emp { + @extend .card; + padding-right: 0; + padding-top: 0; + padding-left: 0; + @apply bg-white m-sm; + @extend .light-background; +} + +.submit-bar { + @extend .light-primary-button; + @apply h-10 text-center w-full outline-none; + box-shadow: inset 0px -2px 0px theme(colors.text.primary); + cursor: pointer; + + &:focus { + @apply outline-none; + } + + header { + @apply font-rc font-medium text-legend text-white leading-10; + } +} + +.submit-bar-disabled { + @apply h-10 bg-primary-main text-center w-full outline-none opacity-50; + + &:focus { + @apply outline-none; + } + + header { + @apply font-rc font-medium text-legend text-white leading-10; + } +} + +@screen dt { + .submit-bar, + .submit-bar-disabled { + width: 240px; + } + + .card { + display: flex; + flex-direction: column; + + .card-header { + @apply text-heading-xl-dt; + } + + .card-sub-header { + @apply text-heading-l-dt; + } + + .card-caption { + @apply text-caption-xl-dt; + } + + .card-text, + .card-text-primary { + @apply text-body-l-dt; + } + + .card-link { + @apply text-left; + } + } + + .digit-employee-card { + @apply mb-md mx-md !important; + + &.digit-filter { + margin-left: auto; + margin-right: auto; + } + + .digit-card-header { + @apply text-heading-xl-dt; + } + + .digit-card-sub-header { + @apply text-heading-l-dt; + } + + .digit-employee-card-sub-header { + margin-bottom: 40px; + @apply text-heading-l-dt; + } + + .digit-card-section-header { + margin-bottom: 40px; + @apply text-heading-m-dt; + } + + .digit-card-section-sub-text { + @apply text-text-primary text-body-s-dt; + } + + .digit-card-search-heading { + margin-right: 0px !important; + margin-left: 0px !important; + margin-bottom: 0px !important; + padding-bottom: 0px; + padding-left: 25px; + } + + .digit-card-caption { + @apply text-caption-xl-dt; + } + + .digit-card-text, + .digit-card-text-primary { + @apply text-body-l-dt; + } + + .digit-card-link { + @apply text-left; + } + + .digit-label-field-pair { + @apply flex items-center; + + h2 { + width: 30%; + } + + .field { + width: 50%; + margin-right: 20%; + .field { + margin-right: unset; + } + } + } + + .digit-field-container { + span { + border: 2px solid black; + background: rgb(247, 247, 247); + width: 40px; + height: 40px; + display: flex; + justify-content: center; + align-items: center; + margin-top: -16px; + border-right: none; + } + } + } + + .digit-header-wrap { + @apply flex mb-md; + + .header-start { + margin-right: auto; + } + + .header-content { + } + + .header-end { + margin-left: auto; + } + } +} + +.digit-card-section-header { + @extend .light-text-color-primary; + @apply text-text-primary text-heading-m font-bold; +} + +.digit-card-search-heading { + margin-right: 0px !important; + margin-left: 0px !important; + margin-bottom: 0px !important; + padding-bottom: 0px; + padding-left: 25px; +} + +.digit-card-label-error { + @extend .alert-error; + @apply block text-body-s text-error mb-md; +} + +.digit-employee-card-override { + margin-left: 0px !important; +} + +.digit-employee-application-details { + display: flex !important; + justify-content: space-between !important; + max-height: 60px !important; + height: 60px !important; +} +.digit-employee-main-application-details { + padding: 10px !important; +} + +.digit-employee-mulitlink-main-div { + @extend .light-primary; + z-index: 10 !important; + max-width: 41% !important; +} + +.digit-employee-download-btn-className { + position: unset !important; + display: flex !important; + justify-content: flex-end !important; +} + +.digit-employee-options-btn-className { + position: unset !important; + margin: 0 !important; + width: 100% !important; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/checkboxV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/checkboxV2.scss new file mode 100644 index 0000000..c19cfe8 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/checkboxV2.scss @@ -0,0 +1,61 @@ +@import url("../index.scss"); + +.digit-checkbox-wrap { + @apply flex mb-md relative items-baseline; + + input { + width: 38px; + height: 38px; + @apply opacity-0 absolute top-0 left-0 z-10; + @extend .light-input-border; + } + + .input-emp { + @extend input; + width: 24px; + height: 24px; + } + + .digit-custom-checkbox { + width: 38px; + height: 38px; + @apply absolute top-0 left-0 border border-solid border-input-border z-0; + @extend .light-input-border; + + img { + @apply opacity-0; + } + + svg { + @apply opacity-0; + } + } + + .digit-custom-checkbox-emp { + @extend .digit-custom-checkbox; + width: 24px; + height: 24px; + } + + input:checked ~ .digit-custom-checkbox, + input:hover ~ .digit-custom-checkbox { + @apply border-2 border-primary-main; + @extend .light-input-border; + } + + input:checked ~ .digit-custom-checkbox img { + @apply opacity-100; + } + + input:checked ~ .digit-custom-checkbox svg { + @apply opacity-100; + width: 35px; + height: 35px; + } + + .label { + margin-left: 56px; + @apply text-form-field text-text-primary; + @extend .light-text-color-primary; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/checkpointV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/checkpointV2.scss new file mode 100644 index 0000000..f751e8a --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/checkpointV2.scss @@ -0,0 +1,71 @@ +@import url("../index.scss"); + +.digit-checkpoint-connect-wrap { + padding-bottom: 40px; + @apply relative; +} +.digit-checkpoint-done { + @apply flex items-center; + + h2 { + z-index: 1; + width: 24px; + height: 24px; + border-radius: 50%; + @apply border-b border-solid border-primary-main bg-primary-main; + } + + header { + @apply text-heading-s ml-md; + + p { + margin-top: 4px; + @extend .light-text-color-secondary; + @apply text-heading-s; + } + } +} + +.digit-checkpoint { + @apply flex items-center; + + h2 { + z-index: 1; + width: 24px; + height: 24px; + border-radius: 50%; + --text-opacity: 1; + @apply border-b border-solid border-border bg-border; + } + + header { + @apply text-heading-s ml-md; + + p { + margin-top: 4px; + @extend .light-text-color-secondary; + @apply text-heading-s; + } + } +} + +.digit-checkpoint-connect { + margin-left: 12px; + margin-top: 22px; + @apply absolute top-0 left-0 h-full border-l border-solid border-border; +} + +.digit-checkpoint-comments-wrap { + max-width: 560px; + @apply bg-grey-mid p-sm mt-sm; + + h4 { + @extend .light-text-color-primary; + @apply text-heading-s; + } + + p { + @extend .light-text-color-secondary; + @apply text-body-s-dt; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/collapseAndExpandGroups.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/collapseAndExpandGroups.scss new file mode 100644 index 0000000..3e0b65a --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/collapseAndExpandGroups.scss @@ -0,0 +1,60 @@ +@import url("../../digitv2/index.scss"); + +.digit-expand-collapse-wrapper { + display: flex; + flex-direction: column; + margin-top: 1rem; +} + +.digit-expand-collapse-header { + background-color: #f2f2f2; + display: grid; + grid-template-columns: 1fr 1fr; + align-items: center; + padding: 12px; + position: relative; + font-weight: bolder; + border: 1px solid #828282; + border-radius: 4px; +} + +.digit-icon-toggle { + position: absolute; + right: 10px; + top: 50%; + transform: translate(0%, -50%); + cursor: pointer; + span{ + display: inline-flex; + align-items: center; + + h5{ + color: theme(colors.primary.main); + display: inline; + } + } +} + +.digit-expand-collapse-header .label { + display: block; + text-align: left; +} + +.digit-expand-collapse-header .value { + display: block; + text-align: right; + margin-right: 2rem; +} + +.digit-toggling-wrapper.digit-collapse { + flex: none; + overflow: hidden; + height: 0; + transition: 0.2s ease-in-out; +} + +.digit-toggling-wrapper { + flex: 1; + transition: 0.2s ease-in-out; + box-sizing: border-box; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/dateWrapV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/dateWrapV2.scss new file mode 100644 index 0000000..3d2dc3d --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/dateWrapV2.scss @@ -0,0 +1,12 @@ +.digit-date-picker { + @apply relative w-full cursor-pointer; + .citizen { + max-width: 540px; + } + .digit-employee-card-input { + @apply mb-lg pl-sm outline-none block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; + width: calc(100%-62px); + padding-right: 9px; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/displayPhotosV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/displayPhotosV2.scss new file mode 100644 index 0000000..77bd2d2 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/displayPhotosV2.scss @@ -0,0 +1,33 @@ +.digit-photos-wrap { + max-width: 640px; + @apply flex pt-md; + + img { + width: calc(33% - 9.333px); + margin-right: 14px; + } + + svg { + width: calc(33% - 9.333px); + margin-right: 14px; + } + + .last { + width: calc(33% - 9.333px); + } +} + +.digit-image-pdf-icon { + @apply flex flex-wrap justify-start content-center; + .digit-url { + min-width: 100px; + margin-right: 10px; + max-width: 100px; + height: auto; + .digit-icon { + background: #f6f6f6; + padding: 8px; + width: 100px; + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/headerV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/headerV2.scss new file mode 100644 index 0000000..9f514c0 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/headerV2.scss @@ -0,0 +1,6 @@ +@import url("../index.scss"); + +.digit-header { + @extend .light-text-color-primary; + @apply text-heading-l font-bold mb-md ml-md; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/infoBannerV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/infoBannerV2.scss new file mode 100644 index 0000000..132ee6c --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/infoBannerV2.scss @@ -0,0 +1,37 @@ +@import url("../index.scss"); + +.digit-info-banner-wrap { + @apply bg-opacity-25 m-sm p-md; + max-width: 960px; + + @extend .alert-info-bg; + border-radius: 4px; + svg { + margin-top: 5px; + @apply rounded-full; + } + + div { + @apply flex items-center; + } + + h2 { + @apply text-heading-m text-link-normal mb-md font-bold ml-sm; + } + + p { + @apply text-body-l text-link-normal whitespace-pre-line; + } +} + +@screen dt { + .digit-info-banner-wrap { + h2 { + @apply text-heading-m-dt; + } + + p { + @apply text-body-l-dt; + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/keynoteV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/keynoteV2.scss new file mode 100644 index 0000000..02fe872 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/keynoteV2.scss @@ -0,0 +1,35 @@ +.digit-key-note-pair { + @apply mb-md; + + h3 { + margin-bottom: 4px; + @apply font-bold text-text-primary text-heading-s; + } + + p { + @apply text-text-primary text-body-l; + } + .digit-key-note-container { + display: inline-flex; + .digit-unmask-container { + display: inline-flex; + width: fit-content; + margin-left: 10px; + margin-top: 5px; + } + } + .digit-caption { + @apply text-body-l text-text-secondary; + } +} + +@screen dt { + .digit-key-note-pair { + p { + @apply text-body-l-dt; + } + .digit-caption { + @apply text-body-l-dt text-text-secondary; + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/loaderV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/loaderV2.scss new file mode 100644 index 0000000..7e435da --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/loaderV2.scss @@ -0,0 +1,81 @@ +@import url("../index.scss"); + +.digit-screen-loader { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + z-index: 9999; + @extend .light-background; + .digit-ldio-pjg92h09b2o div { + position: absolute; + width: 52px; + height: 52px; + border: 12px solid theme(digitv2.lightTheme.primary); + border-top-color: transparent; + border-radius: 50%; + } +} + +.digit-page-loader, +.digit-module-loader { + text-align: center; +} + +.digit-page-loader { + padding-top: 88px; +} + +.digit-module-loader { + padding: 16px; +} + +@keyframes digit-ldio-pjg92h09b2o { + 0% { + transform: translate(-50%, -50%) rotate(0deg); + } + + 100% { + transform: translate(-50%, -50%) rotate(360deg); + } +} + +.digit-ldio-pjg92h09b2o div { + position: absolute; + width: 52px; + height: 52px; + border: 12px solid theme(colors.secondary); + border-top-color: transparent; + border-radius: 50%; +} + +.digit-ldio-pjg92h09b2o div { + animation: digit-ldio-pjg92h09b2o 1s linear infinite; + top: 50px; + left: 50px; +} + +.digit-loadingio-spinner-rolling-faewnb8ux8 { + width: 48px; + height: 48px; + display: inline-block; + overflow: hidden; + background: none; +} + +.digit-ldio-pjg92h09b2o { + width: 100%; + height: 100%; + position: relative; + transform: translateZ(0) scale(0.48); + backface-visibility: hidden; + transform-origin: 0 0; +} + +.digit-ldio-pjg92h09b2o div { + box-sizing: content-box; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/mobileNumberV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/mobileNumberV2.scss new file mode 100644 index 0000000..5c7f608 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/mobileNumberV2.scss @@ -0,0 +1,33 @@ +@import url("../index.scss"); + +.digit-mobile-number-container { + @apply flex items-center; + + .digit-citizen-card-input--front { + @extend .light-background; + width: fit-content !important; + display: flex; + align-items: center; + /* background: theme(colors.grey.mid); */ + border-right: 0; + padding-right: 5px; + } + + .digit-citizen-card-input { + @apply mb-lg pl-sm outline-none block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; + } + + .digit-citizen-card-input--front { + width: fit-content !important; + display: flex; + align-items: center; + background: theme(colors.grey.mid); + border-right: 0; + padding-right: 5px; + } + .digit-employee-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; + @extend .alert-error; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/multiSelectDropdownV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/multiSelectDropdownV2.scss new file mode 100644 index 0000000..0862eeb --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/multiSelectDropdownV2.scss @@ -0,0 +1,92 @@ +@import url("../index.scss"); + +.digit-multi-select-dropdown-wrap { + margin-bottom: 24px; + @apply relative text-form-field text-text-primary w-full; + .digit-master, + .digit-master-active { + @apply relative border border-solid border-input-border h-10 w-full; + input[type="text"] { + @apply absolute top-0 left-0 p-sm pl-sm min-h-full min-w-full opacity-0; + &:focus { + @apply outline-none; + } + } + .digit-label { + @apply flex justify-between p-sm w-full h-full; + svg { + @apply h-6 w-6; + } + } + + &:hover { + @apply border-2 border-solid border-primary-main; + } + } + + .digit-master-active { + @apply border-2 border-primary-main; + input[type="text"] { + @apply opacity-100; + } + .digit-label { + @apply hidden; + } + } + + .digit-server { + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); + top: 40px; + + max-height: 20vmax; + overflow: scroll; + @apply absolute min-w-full z-20; + div { + @apply flex w-full bg-white; + justify-content: flex-start; + align-items: center; + &:hover { + @apply bg-grey-mid; + } + input { + height: 44px; + @apply absolute min-w-full opacity-0 z-20 cursor-pointer; + } + p { + padding: 12px; + margin-top: 5px; + margin-bottom: 5px; + @apply text-form-field text-text-primary; + } + .digit-custom-checkbox { + height: 28px; + width: 28px; + @apply border border-solid border-input-border m-sm; + svg { + @apply opacity-0 z-10; + } + } + input:checked ~ .digit-custom-checkbox, + input:hover ~ .digit-custom-checkbox { + @apply border-2 border-primary-main; + } + + input:checked ~ .digit-custom-checkbox svg { + @apply opacity-100; + } + } + } + .digit-cursorPointer { + @apply cursor-pointer; + } + .digit-master { + .digit-label { + p { + white-space: pre; + margin: auto; + margin-left: 0px; + padding-left: 1%; + } + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/noresultsfoundV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/noresultsfoundV2.scss new file mode 100644 index 0000000..aedadeb --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/noresultsfoundV2.scss @@ -0,0 +1,11 @@ +.digit-no-data-found { + height: 100%; + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + .digit-error-msg { + margin-top: 2rem; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/otpInputV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/otpInputV2.scss new file mode 100644 index 0000000..b16e2c9 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/otpInputV2.scss @@ -0,0 +1,15 @@ +.digit-input-otp-wrap { + @apply mb-lg; + + input { + @apply border-2 border-solid border-input-border outline-none h-10 w-10 text-form-field text-text-primary mr-sm mb-sm text-center; + } + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + input[type="number"] { + -moz-appearance: textfield; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/popUpV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/popUpV2.scss new file mode 100644 index 0000000..c147781 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/popUpV2.scss @@ -0,0 +1,24 @@ +.digit-popup-wrap { + background: rgba(0, 0, 0, 0.7); + @apply flex fixed w-full h-full overflow-auto top-0 left-0 min-h-screen; + z-index: 10000; +} + +@screen dt { + .digit-popup-wrap { + background: rgba(0, 0, 0, 0.7); + @apply min-h-screen; + } +} + +.digit-popup-close-icon { + @apply flex justify-end; +} + +.digit-logout-popup-wrapper{ + width: 31.25rem !important; + + .logout-cancel-button{ + height: 2.5rem; + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/radiobtnV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/radiobtnV2.scss new file mode 100644 index 0000000..638271e --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/radiobtnV2.scss @@ -0,0 +1,51 @@ +@import url("../index.scss"); + +.digit-radio-wrap { + @apply my-sm block leading-10 mb-lg; + + div { + @apply block mb-md; + } + + .digit-radio-btn-wrap { + @apply block float-left relative; + &:hover { + .digit-radio-btn-checkmark { + @apply border-primary-main; + } + } + } + + .digit-radio-btn { + @apply opacity-0 absolute cursor-pointer h-10 w-10; + } + + .digit-radio-btn-checkmark { + @extend .light-input-border; + @apply h-10 w-10 border border-input-border border-solid rounded-full block; + } + + label { + @extend .light-text-color-primary; + @apply text-text-primary text-form-field ml-md; + } + + .digit-radio-btn-checkmark:after { + content: ""; + } + + .digit-radio-btn-wrap input:checked ~ .digit-radio-btn-checkmark { + /* @extend .light-input-border; */ + @apply border-2 border-primary-main; + } + + .digit-radio-btn-wrap input:checked ~ .digit-radio-btn-checkmark:after { + /* @extend .light-background; */ + @apply block bg-primary-main h-5 w-5 rounded-full absolute top-10 left-10; + } +} +.digit-reverse-radio-selection-wrapper { + div { + @apply flex flex-row-reverse place-content-between items-center; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/ratingV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/ratingV2.scss new file mode 100644 index 0000000..98e9e6d --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/ratingV2.scss @@ -0,0 +1,33 @@ +.digit-rating-star-wrap { + @apply flex w-full mb-lg; + img { + width: 40px; + height: 38px; + display: block; + @apply mr-sm; + } + + svg { + width: 40px; + height: 38px; + display: block; + @apply mr-sm; + } +} + +@screen dt { + .digit-rating-star-wrap { + @apply w-2/5; + } +} + +.digit-rating-with-text { + @apply flex place-items-center w-full; + + svg { + width: 24px; + height: 38px; + display: block; + @apply mr-sm; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/selectdropdownV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/selectdropdownV2.scss new file mode 100644 index 0000000..60099b6 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/selectdropdownV2.scss @@ -0,0 +1,180 @@ +.digit-employee-select-wrap { + @apply mb-lg relative; + + .digit-select { + @extend .light-input-border; + @apply relative block w-full h-10 border border-solid border-input-border; + &:hover { + @extend .light-input-border; + @apply border-2 border-solid border-primary-main; + } + input[type="text"] { + width: calc(100% - 32px); + background-color: transparent; + @extend .light-input-border; + @extend .light-text-color-primary; + @apply absolute z-10 w-full h-full outline-none text-text-primary text-form-field pl-sm; + } + + p { + padding-top: 9px; + @extend .light-text-color-primary; + @apply text-form-field text-text-primary float-left ml-sm; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply absolute right-0 float-right h-6 w-6 mt-sm mr-sm; + } + } + + .digit-select-active { + @apply relative block w-full h-10 border-2 border-solid border-primary-main; + @extend .light-input-border; + + input[type="text"] { + width: calc(100% - 32px); + background-color: transparent; + @extend .light-background; + @extend .light-text-color-primary; + + @apply absolute z-10 w-full h-full outline-none text-text-primary text-form-field pl-sm; + } + + p { + @extend .light-text-color-primary; + @apply text-form-field text-text-primary float-left ml-sm; + } + + p { + padding-top: 9px; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply absolute right-0 float-right h-6 w-6 mt-sm mr-sm; + } + } + + .digit-options-card { + width: 100% !important; + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); + max-height: 400px; + overflow: auto; + @apply absolute z-20 mt-xs bg-white max-w-full; + + p { + padding-top: 14px; + @extend .light-text-color-primary; + @apply w-full h-12 pl-sm text-text-primary text-form-field; + + &:hover { + @apply bg-grey-mid; + @extend .light-background; + } + } + } +} + +.digit-employee-select-wrap--elipses { + width: 85% !important; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.digit-select-wrap { + @apply mb-lg relative; + max-width: 540px; + + .digit-select { + @apply relative block w-full h-10 border border-solid border-input-border; + @extend .light-input-border; + + input[type="text"] { + width: calc(100% - 32px); + background-color: transparent; + @extend .light-text-color-primary; + @apply absolute z-10 w-full h-full outline-none text-text-primary text-form-field pl-sm; + } + + p { + padding-top: 9px; + @extend .light-text-color-primary; + @apply text-form-field text-text-primary float-left ml-sm; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply absolute right-0 float-right h-6 w-6 mt-sm mr-sm; + } + } + + .digit-select-active { + @extend .light-input-border; + @apply relative block w-full h-10 border-2 border-solid border-primary-main; + + input[type="text"] { + width: calc(100% - 32px); + background-color: transparent; + @extend .light-text-color-primary; + @apply absolute z-10 w-full h-full outline-none text-text-primary text-form-field pl-sm; + } + + p { + @extend .light-text-color-primary; + @apply text-form-field text-text-primary float-left ml-sm; + } + + p { + padding-top: 9px; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply absolute right-0 float-right h-6 w-6 mt-sm mr-sm; + } + } + + .digit-options-card { + width: 100% !important; + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); + @extend .light-background; + @apply absolute z-20 mt-xs bg-white; + + p { + padding-top: 14px; + @extend .light-text-color-primary; + @apply w-full h-12 pl-sm text-text-primary text-form-field; + + &:hover { + @apply bg-grey-mid; + } + } + } +} + +@screen dt { +} + +.digit-dropdown-employee-select-wrap{ + + &.language-dropdown{ + + .digit-dropdown-options-card{ + min-width: fit-content; + } + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/tagV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/tagV2.scss new file mode 100644 index 0000000..a202bbd --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/tagV2.scss @@ -0,0 +1,28 @@ +.digit-tag-container { + @apply flex flex-wrap mb-md; + + .digit-tag { + @apply bg-grey-mid rounded-2xl pt-sm pb-sm flex justify-between items-center; + padding-left: 12px; + padding-right: 12px; + font-size: 14px; + margin-left: 2px; + height: 2rem; + margin-top: 1rem; + .digit-text { + padding-right: 5px; + max-width: calc(100% - 24px); + height: 22px; + overflow: hidden; + text-overflow: clip; + } + + &:hover { + @apply cursor-pointer; + + .close { + fill: black; + } + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/telephoneV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/telephoneV2.scss new file mode 100644 index 0000000..0953ca8 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/telephoneV2.scss @@ -0,0 +1,18 @@ +.digit-telephone { + @apply flex items-baseline; + img, + svg { + height: 22px; + width: 20px; + @apply text-primary-main ml-sm items-center; + margin-left: 0px; + } + + p { + @apply text-text-primary text-body-l pl-sm; + } +} + +.digit-call { + @apply flex text-text-secondary text-body-l; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/textInputV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/textInputV2.scss new file mode 100644 index 0000000..863500e --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/textInputV2.scss @@ -0,0 +1,123 @@ +@import url("../index.scss"); + +.digit-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; +} +.digit-text-input { + @apply relative w-full; +} + +.digit-text-input-width { + max-width: 540px; +} +.digit-card-input { + @apply mb-lg pl-sm outline-none mt-sm block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; +} + +.digit-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; +} + +.digit-employee-card-input { + @apply mb-lg pl-sm outline-none block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; +} +.digit-employee-card-input:disabled { + @apply border-grey-dark text-grey-dark !important; + pointer-events: none !important; +} +.digit-employee-card-input--front { + width: fit-content !important; + display: flex; + align-items: center; + background: theme(colors.grey.mid); + border-right: 0; + padding-right: 5px; +} +.digit-employee-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; +} + +.digit-card-textarea, +.digit-employee-card-textarea { + @apply block outline-none mt-md mb-lg border w-full border-input-border border-solid bg-white h-24 text-form-field text-text-primary p-sm; +} + +.digit-inputWrapper { + display: flex; + justify-content: flex-start; + max-width: 500px; + + div { + max-width: 80px; + } + + span { + margin-top: 16px; + margin-left: 10%; + margin-right: 10%; + } +} + +@screen dt { + .digit-card-input { + width: 480px; + } + + .digit-card-input-emp { + width: 240px; + } + + .digit-card-input-error { + width: 480px; + } + + .digit-employee-card-input { + @apply w-full; + } + + .digit-employee-card-input-error { + @apply w-full; + } + + .digit-card-textarea { + /* //width: 480px; */ + @apply w-full; + max-width: 540px; + } + + .digit-employee-card-textarea { + @apply w-full; + } + + .card-input-emp { + width: 240px; + } +} + +.digit-citizen-card-input { + @apply mb-lg pl-sm outline-none block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; +} + +.digit-citizen-card-input--front { + width: fit-content !important; + display: flex; + align-items: center; + background: theme(colors.grey.mid); + border-right: 0; + padding-right: 5px; +} + +.digit-employee-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; + @extend .alert-error; +} +.digit-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; + @extend .alert-error; +} +.disabled { + @apply border-grey-dark text-grey-dark !important; + pointer-events: none !important; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/textareaV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/textareaV2.scss new file mode 100644 index 0000000..1be8174 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/textareaV2.scss @@ -0,0 +1,11 @@ +.digit-card-textarea, +.digit-employee-card-textarea { + @apply block outline-none mt-md mb-lg border w-full border-input-border border-solid bg-white h-24 text-form-field text-text-primary p-sm; + @extend .light-input-border; +} +.digit-employee-card-textarea { + @apply w-full; +} +.digit-cell-text { + color: theme(colors.text.secondary); +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/uploadFileV2.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/uploadFileV2.scss new file mode 100644 index 0000000..8ebd723 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/components/uploadFileV2.scss @@ -0,0 +1,146 @@ +.digit-upload-wrap { + @apply flex w-full h-40 bg-grey-light relative mb-lg px-sm border border-border border-dashed; + max-width: 540px; + min-height: 50px; + padding: 0.5rem; + + img { + display: block; + margin-top: 58px; + margin-left: calc(50% - 23px); + height: 42px; + width: 46px; + } + + svg { + display: block; + margin-top: 58px; + margin-left: calc(50% - 23px); + height: 42px; + width: 46px; + } + + input { + @apply absolute w-full h-full opacity-0 top-0; + } + .digit-cell-text { + color: theme(colors.text.secondary); + padding-top: 3px; + } +} + +.digit-multi-upload-wrap { + @apply flex mb-lg; + + div { + display: block; + position: relative; + background-color: theme(colors.grey.light); + width: calc((100% - 16px) / 3); + margin-right: 8px; + + .digit-delete { + position: absolute; + height: 24px; + width: 24px; + border-radius: 100%; + top: 2px; + right: 2px; + } + } + + .digit-upload-img-container { + border: 1px dashed theme(colors.border); + margin: 0 !important; + + img { + margin-left: auto; + margin-right: auto; + padding-top: calc(33% - 21px); + } + + svg { + @apply flex; + margin: auto; + } + + svg { + margin-left: auto; + margin-right: auto; + top: calc(50% - 21px); + position: relative; + } + + input { + @apply absolute w-full h-full opacity-0 top-0; + } + } +} + +.digit-upload-file-max-width { + max-width: 540px; +} + +.digit-upload-file { + min-height: 56px; + @apply relative border border-input-border w-full; + + div { + @apply flex flex-row h-full items-center pl-md mt-sm flex-wrap; + + .file-upload-status { + @apply text-body-s-dt ml-sm; + } + } + input { + width: 160px; + @apply absolute top-0 left-0 opacity-0 h-full; + } +} + +@screen dt { + .digit-multi-upload-wrap img { + width: 100%; + height: 158px; + } +} + +.digit-upload-file-button-wrap { + display: flex; + justify-content: flex-start; + align-items: center; + flex-wrap: wrap; + margin: 0px; + padding: 0px; + button { + height: auto; + min-height: 40px; + width: 43%; + max-height: 40px; + margin: 5px; + padding: 0px; + h2 { + word-break: break-all; + height: auto; + line-height: 16px; + overflow: hidden; + max-height: 34px; + max-width: 100%; + } + } + .digit-tag-container { + margin: 0px; + padding: 0px; + } +} +.digit-input-mirror-selector-button { + @apply h-16 bg-border text-center border-b-2 border-input-border border-solid outline-none px-lg !important; + + &:focus { + @apply outline-none; + } + + h2 { + @apply font-rc font-medium text-legend text-text-primary; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/index.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/index.scss new file mode 100644 index 0000000..01a5b9f --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/index.scss @@ -0,0 +1,167 @@ +@import url("./components/actionbarV2.scss"); +/* + TODO NABEEL/ANIL Removed these since it creates issues in search screen and home screen +@import url("./components/cardV2.scss"); +*/ + +@import url("./components/checkboxV2.scss"); +@import url("./components/FormComposerV2.scss"); +@import url("./components/radiobtnV2.scss"); +@import url("./components/selectdropdownV2.scss"); +@import url("./typography.scss"); +@import url("./components/actionLinkV2.scss"); +@import url("./components/appContainerV2.scss"); +@import url("./components/bodyContainerV2.scss"); +@import url("./components/breadCrumbV2.scss"); +@import url("./components/bannerV2.scss"); +@import url("./components/breakLineV2.scss"); +@import url("./components/loaderV2.scss"); +@import url("./components/headerV2.scss"); +@import url("./components/checkpointV2.scss"); +@import url("./components/backButtonV2.scss"); +@import url("./components/infoBannerV2.scss"); +@import url("./components/displayPhotosV2.scss"); +@import url("./components/collapseAndExpandGroups.scss"); +@import url("./components/dateWrapV2.scss"); +@import url("./components/ErrorMessage.scss"); +@import url("./components/ratingV2.scss"); +@import url("./components/noresultsfoundV2.scss"); +@import url("./components/mobileNumberV2.scss"); +@import url("./components/tagV2.scss"); +@import url("./components/popUpV2.scss"); +@import url("./components/telephoneV2.scss"); +@import url("./components/textareaV2.scss"); +@import url("./components/textInputV2.scss"); +@import url("./components/otpInputV2.scss"); +@import url("./components/multiSelectDropdownV2.scss"); +@import url("./components/uploadFileV2.scss"); + +/* pages */ +@import url("./pages/employee/index.scss"); + +/* important to be remove after fixing the components */ +.light { + &-primary { + color: theme(digitv2.lightTheme.primary) !important; + + &-button { + background-color: theme(digitv2.lightTheme.primary) !important; + } + + &-bg { + background-color: theme(digitv2.lightTheme.primary-bg) !important; + } + } + + &-text-color { + &-primary { + color: theme(digitv2.lightTheme.text-color-primary) !important; + } + + &-secondary { + color: theme(digitv2.lightTheme.text-color-secondary) !important; + } + + &-disabled { + color: theme(digitv2.lightTheme.text-color-disabled) !important; + } + } + + &-background { + background-color: theme(digitv2.lightTheme.background) !important; + } + + &-paper { + &-primary { + background-color: theme(digitv2.lightTheme.paper) !important; + + &-color { + color: theme(digitv2.lightTheme.paper) !important; + } + } + + &-secondary { + background-color: theme(digitv2.lightTheme.paper-secondary) !important; + } + + &-border { + border-radius: 4px; + border-style: solid; + border-width: 1px; + border-color: theme(digitv2.lightTheme.divider); + } + } + + &-divider { + background-color: theme(digitv2.lightTheme.divider) !important; + } + + &-header-sidenav { + color: theme(digitv2.lightTheme.header-sidenav) !important; + } + + &-input-border { + /* TODO Check why important added here @ANIL/NABEEL */ + border-color: theme(digitv2.lightTheme.input-border); + } +} + +.alert { + &-error { + color: theme(digitv2.alert.error) !important; + + &-bg { + background-color: theme(digitv2.alert.error-bg) !important; + } + + &-border { + border-color: theme(digitv2.alert.error) !important; + } + } + + &-success { + color: theme(digitv2.alert.success) !important; + + &-bg { + background-color: theme(digitv2.alert.success-bg) !important; + } + } + + &-info { + color: theme(digitv2.alert.info) !important; + + &-bg { + background-color: theme(digitv2.alert.info-bg) !important; + } + } +} + +.chart { + &-item-1 { + color: theme(digitv2.chart.chart-1) !important; + } + + &-item-1-gradient { + color: theme(digitv2.chart.chart-1-gradient) !important; + } + + &-item-2 { + color: theme(digitv2.chart.chart-2) !important; + } + + &-item-2-gradient { + color: theme(digitv2.chart.chart-2-gradient) !important; + } + + &-item-3 { + color: theme(digitv2.chart.chart-3) !important; + } + + &-item-4 { + color: theme(digitv2.chart.chart-4) !important; + } + + &-item-5 { + color: theme(digitv2.chart.chart-5) !important; + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/pages/employee/index.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/pages/employee/index.scss new file mode 100644 index 0000000..99435b6 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/pages/employee/index.scss @@ -0,0 +1 @@ +@import url("./workbench.scss"); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/pages/employee/workbench.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/pages/employee/workbench.scss new file mode 100644 index 0000000..af97f52 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/pages/employee/workbench.scss @@ -0,0 +1,1050 @@ +@import url("../../index.scss"); + +.bread-crumb.workbench-bredcrumb { + a { + color: theme(digitv2.lightTheme.primary); + } +} + +.workbench { + &.app-container { + margin-top: 0.75rem; + } + + .workbench-create-form { + display: inherit; + padding-top: 1.5rem; + + .digit-form-composer-sub-header { + @extend .typography.text-heading-m; + padding-left: 1rem; + + @media (max-width: theme(digitv2.screens.mobile)) { + padding-left: 0; + } + } + + form { + #label_digit_root { + display: none; + } + + #digit_root { + width: 100%; + + .field-wrapper { + .form-group.field { + display: flex; + padding: 1em 0 0 1em; + + @media (max-width: theme(digitv2.screens.mobile)) { + flex-direction: column; + } + + &.field-error.has-error.has-danger { + .control-label { + @extend .alert-error; + } + + .form-control { + @extend .alert-error-border; + } + + .card-label-error { + display: inline; + position: relative; + margin: 0px; + padding: 0px; + top: -0.7rem; + font-weight: normal; + + } + } + + &.field-boolean.field-error.has-error.has-danger { + + .card-label-error { + position: initial; + display: block; + margin-top: 0.5rem; + + } + } + + .control-label { + max-width: 12.5rem; + margin-right: 2.5rem; + @extend .card-label; + display: inline-flex; + /* align-self: center; */ + line-height: 3rem; + @extend .typography.text-heading-s; + /* web view*/ + @apply w-1/3; + + /* tablet view*/ + + @media (max-width: theme(digitv2.screens.tablet)) { + max-width: 11rem; + margin-right: 1.5rem; + + } + + /* mobile view*/ + + @media (max-width: theme(digitv2.screens.mobile)) { + /*max-width: 10.2rem;*/ + @apply w-full; + + } + + } + + .all-input-field-wrapper { + + @apply w-3/5; + + @media (max-width: theme(digitv2.screens.mobile)) { + @apply w-full; + } + + .form-control { + @extend .light-input-border; + @extend .employee-card-input; + font-style: inherit; + font-family: inherit; + /* web view*/ + max-width: 37.5rem; + min-width: 20.5rem; + margin-bottom: 1rem; + /* tablet view*/ + + @media (max-width: theme(digitv2.screens.tablet)) { + max-width: 27.5rem; + min-width: 12.5rem; + + } + + /* mobile view*/ + + @media (max-width: theme(digitv2.screens.mobile)) { + max-width: 20.5rem; + min-width: 9.5rem; + @apply w-full; + + } + + &.form-select { + padding: 0%; + border: 0px; + + .digit__control { + @apply outline-none; + + .digit__value-container:in-range { + border-color: unset; + box-shadow: none; + box-sizing: unset; + @apply outline-none; + } + } + + .digit__control--is-focused { + border-color: theme(digitv2.lightTheme.primary) !important; + box-shadow: none; + box-sizing: unset; + @apply outline-none; + } + + + .digit__control:hover { + + border-color: unset; + box-shadow: none; + box-sizing: unset; + @apply outline-none; + } + + .digit__control:focus { + border-color: theme(digitv2.lightTheme.primary); + + .digit__value-container:focus { + border-color: theme(digitv2.lightTheme.primary); + + } + } + } + + &.form-select:focus { + @apply outline-none; + border-color: theme(digitv2.lightTheme.primary); + + } + } + + .form-control:read-only { + background-color: theme(digitv2.lightTheme.background); + color: theme(digitv2.lightTheme["text-color-secondary"]); + } + + .form-control:focus { + + @apply outline-none; + border-color: theme(digitv2.lightTheme.primary); + } + + textarea.form-control { + height: 5rem; + } + } + + &.field-string { + align-self: center; + } + + &.field-boolean { + padding-top: 0rem; + padding-bottom: 1rem; + + .custom-checkbox { + display: inline-flex; + align-items: end; + + &.custom-checkbox-disabled { + pointer-events: none; + opacity: 0.6; + } + + .custom-checkbox-label { + @extend .typography.text-body-s; + @apply pl-sm; + } + } + + .checkbox { + width: 28rem; + + label { + float: left; + + /* display: flex; + flex-direction: row-reverse; + */ + span { + width: 17rem; + display: none; + @extend .card-label; + } + + input[type="checkbox"] { + @extend .light-input-border; + @extend .employee-card-input; + height: 1.5rem; + /* @apply ml-sm;*/ + } + + input[type="checkbox"]#digit_root_active { + accent-color: theme(digitv2.lightTheme.primary); + } + + input:checked, + input:hover { + @apply border-2; + @extend .light-input-border; + } + } + } + + .field-radio-group { + display: inline-flex; + height: 2.5rem; + align-items: center; + + .radio { + @apply mr-sm; + } + } + + + + } + + + + &.field-object>.control-label { + margin-left: 0.5rem; + } + + &.field-object { + display: block; + @extend .light-background; + @extend .light-paper-border; + padding: 1rem; + margin: 1rem; + + .digit-expand-collapse-wrapper { + margin-top: 0px; + } + + .digit-icon-toggle { + top: -1.5rem; + right: 1.5em; + } + + .object-wrapper { + .array-remove-button-wrapper { + position: relative; + } + } + + /* have to revisit for objects + [id^="root_"] { + @extend .light-background; + } + */ + } + + &.field-array { + display: block; + @extend .light-paper-secondary; + @extend .light-paper-border; + padding: 2rem; + margin: 1rem; + padding-top: 1rem; + + .array-wrapper .array-item { + &.jk-array-objects>.array-remove-button-wrapper { + display: block; + } + + &.jk-array-objects { + margin-bottom: 2rem; + + .array-children>span .form-group.field.field-object { + padding-bottom: 3rem; + } + + .array-obj { + position: absolute; + bottom: 1.5rem; + left: 2rem; + + >.array-remove-button-wrapper { + position: unset; + } + } + + } + + &.jk-array-of-non-objects>.array-remove-button-wrapper { + display: inline; + left: 38.5rem; + right: unset; + top: 0.7rem; + } + + &.jk-array-of-non-objects .array-children { + span .form-group { + padding-left: 0%; + + .control-label { + display: none; + } + + } + } + + /* it has been removed since we dont need diff color for array items @extend .light-background;*/ + position: relative; + + .field-object { + margin-left: 0; + margin-right: 0; + } + + + .array-remove-button-wrapper { + position: absolute; + right: 1.3em; + top: 1.3em; + background-color: inherit !important; + + .array-remove-button { + cursor: pointer; + background-color: inherit !important; + + @media (max-width: theme(digitv2.screens.mobile)) { + padding: 0px; + } + + h2 { + @media (max-width: theme(digitv2.screens.mobile)) { + display: none; + } + } + + } + } + + span.all-input-field-wrapper { + @apply w-3/5; + + .form-control { + @apply w-full; + } + } + + .control-label { + @apply w-1/3; + + } + } + + + .jk-digit-secondary-btn { + height: 1.7em; + margin-top: 0.5rem; + + @media (max-width: theme(digitv2.screens.mobile)) { + height: auto; + width: 100%; + } + + h2 { + font-size: 1rem; + } + } + + .all-input-field-wrapper { + .card-label-error { + position: unset !important; + } + } + + } + + .digit-expand-collapse-header { + border: 0; + background-color: inherit; + padding: 0; + } + } + } + } + } + + div.action-bar-wrap { + @extend .action-bar-wrap; + + .submit-bar { + @extend .submit-bar; + cursor: pointer; + @apply font-rc font-medium text-legend text-white leading-10; + } + } + .workbench-bulk-upload { + display: flex; + justify-content: space-between; + margin-bottom: 1.5rem; + .workbench-download-template-btn { + margin-right: 1rem; + } + } + } + + .workbench-no-schema-found { + @apply flex justify-items-center flex-col; + align-items: center; + } + + .jk-digit-loader { + position: absolute; + z-index: 10000; + width: 100vw; + background-color: rgba(189, 189, 189, 0.5); + height: 100vh; + left: 0; + top: 0; + + .jk-spinner-wrapper { + width: 100%; + display: flex; + align-items: center; + justify-content: center; + height: 100%; + + .jk-spinner { + border: 0.4em solid #fe7a51; + border-radius: 50%; + border-top: 0.4em solid #ffffff; + width: 4em; + height: 4em; + -webkit-animation: spin 2s linear infinite; + /* Safari */ + animation: spin 1s linear infinite; + } + } + } + + .jk-sm-inbox-loader { + border: 0.2em solid #fe7a51; + border-radius: 50%; + border-top: 0.2em solid #ffffff; + width: 2em; + height: 2em; + -webkit-animation: spin 2s linear infinite; + /* Safari */ + animation: spin 1s linear infinite; + } + + /* Safari */ + @-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(360deg); + } + } + + @keyframes spin { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } + } + + .no-data-found { + height: 100%; + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + .digit-error-msg { + margin-top: 2rem; + } + } + + + .tooltip .tooltiptext { + + top: 2rem; + left: 0; + margin-left: 0rem; + width: fit-content; + height: max-content; + white-space: normal; + + .tooltiptextvalue { + font-size: 14px; + font-weight: 400px; + color: white; + } + } + + .employeeCard.manage-master-wrapper { + width: 100%; + display: flex; + padding-top: 2.1rem; + + @media (max-width: theme(digitv2.screens.mobile)) { + flex-direction: column; + } + + .employee-select-wrap.form-field { + @apply w-1/4; + margin-right: 1rem; + + @media (max-width: theme(digitv2.screens.mobile)) { + @apply w-full; + } + } + } + + .table { + padding-left: 0.8rem; + padding-right: 0.8rem; + + &-row-mdms:hover { + background-color: theme(digitv2.lightTheme.primary-bg); + /* Change this to the desired hover color */ + cursor: pointer; + } + } +} + +.header-btn { + width: 12rem; +} + +.drag-drop-container { + background-color: #FAFAFA; + border: 1.5px dashed #D6D5D4; + border-radius: 5px; + margin: -1rem 1rem 1rem 1rem; + padding: 1rem 1rem 1rem 1rem; + display: flex; + align-items: center; + flex-direction: column; + + .drag-drop-text { + text-decoration: none; + + .browse-text { + text-decoration: none; + color: #F47738; + transition: color 0.3s; + } + + .browse-text:hover { + color: #F47738; + text-decoration: underline; + cursor: pointer; + } + } + +} + +.uploaded-file-container { + background-color: #FAFAFA; + border: 1.5px solid #D6D5D4; + border-radius: 5px; + margin: 0.5rem 1rem 2rem 1rem; + display: flex; + flex-direction: row; + align-items: center; + padding: 0.6rem; + justify-content: space-between; + + .uploaded-file-container-sub { + display: flex; + align-items: center; + + .icon:hover { + cursor: pointer; + } + } +} + +button:hover { + cursor: pointer; +} + +.popup-header-fix { + margin-top: -0.5rem !important; +} + +.option-details { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 999; + border: 1px solid #D6D5D4; + /* Border color and width */ + background-color: #fff; + padding: 2em; + border-radius: 5px; + display: flex; + flex-direction: column; + width: 40%; + min-width: 300px; + + .detail-container { + margin-top: 20px; + overflow-y: auto; + max-height: 50vh; + + .detail-item { + margin: 10px 0; + display: flex; + align-items: center; + + .key { + flex-basis: 30%; + margin-right: 10px; + font-weight: bold; + text-align: start !important; + } + + .value { + flex-basis: 70%; + text-align: start !important; + } + } + + .separator { + margin: 10px 0; + border: none; + border-bottom: 1px solid #ccc; + } + + .view-more { + display: flex; + justify-content: flex-start; + margin-top: 1.5em; + } + + .select { + display: flex; + justify-content: flex-start; + margin-top: 1.5em; + } + } +} + + +.close-button { + align-self: flex-end; + cursor: pointer; + font-weight: bold; + position: absolute; + padding: 7px; + top: 0; + right: 0; + border: 1px solid black; + margin-bottom: 20px; +} + + + +.option-details-dropdown { + position: absolute; + z-index: 999; + border: #D6D5D4 1px solid; + background-color: #fff; + padding: 10px; + border-radius: 5px; + width: 250px; + margin-left: -250px; +} + + +.modal-wrapper { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + background-color: rgba(0, 0, 0, 0.5); + z-index: 9999; + overflow: auto; + /* Enable scrolling if content exceeds the viewport */ +} + +.modal-content { + background-color: #fff; + padding: 20px; + border: 1px solid #ccc; + border-radius: 4px; + max-width: 80%; + /* Adjust the maximum width as needed */ + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); + max-height: 80vh; + /* Limit the maximum height to 80% of the viewport height */ + display: flex; + flex-direction: column; + justify-content: space-between; +} + +.modal-inner { + overflow-y: auto; + /* Enable scrolling within the modal */ +} + +.modal-content .employee-select-wrap .select input { + width: calc(100% - 32px); + background-color: initial; + position: relative !important; + z-index: 10; + width: 100%; + height: 100%; + outline: 2px solid transparent; + outline-offset: 2px; + padding-left: 8px; +} + +.modal-content .employee-select-wrap .select-active { + position: absolute; + display: block; + width: 100%; + height: 2.5rem; + --border-opacity: 1; + border: 1px solid #f47738; + border-color: rgba(244, 119, 56, var(--border-opacity)); +} + +.modal-content .label-field-pair { + display: -ms-flexbox; + display: block !important; + -ms-flex-align: center; + align-items: center; +} + +.modal-content .employee-select-wrap { + margin-bottom: 24px; +} + +.inbox-search-wrapper { + .add-new-container { + width: 100%; + display: flex; + flex-direction: row-reverse; + + .add-new { + position: relative; + color: #F47738; + cursor: pointer; + margin-right: 1em; + font-weight: bolder; + font-size: 23px; + } + } +} + +.multiselect { + display: flex; + align-items: center; + + @media (max-width: 588px) { + .info-icon-container { + position: absolute; + right: 2px; + margin-right: 0px !important; + margin-left: 0px !important; + display: flex; + justify-content: center; + margin-bottom: 0.7em; + } + } + + .info-icon-container { + margin-left: 0.7em; + margin-right: -2em; + display: flex; + justify-content: center; + margin-bottom: 0.7em; + } + + .info-icon-container .info-icon { + cursor: pointer; + } +} + +.link-container { + flex: 1; + display: flex; + align-items: center; + padding: 10px; + background-color: #bdc5d1; + + .view-all-link { + background-color: #bdc5d1; + color: #f47738; + font-size: 16px; + text-decoration: underline; + cursor: pointer; + } +} + +.action-bar { + display: flex; + flex-direction: row; + justify-content: flex-end; + + .action-bar-button { + margin-right: 0.5em; + } +} + +.progressBarContainer { + position: fixed; + bottom: 20px; + right: 20px; + background-color: #fff; + padding: 45px 45px 20px 20px; + border-radius: 8px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); + z-index: 9999; + width: 25vw; + + @media (max-width: 768px) { + width: 70vw; + position: fixed; + bottom: 20px; + right: auto; + left: 50%; + transform: translateX(-50%); + } + + .progressBar { + display: flex; + flex-direction: row; + border-radius: 4px; + overflow: hidden; + border: 1px solid #ccc; + height: 20px; + background-color: #4CAF50; + } + + .progressHeading { + margin: 8px 0; + font-size: 16px; + + .success-container { + display: flex; + flex-direction: row; + background-color: #00703C; + color: #fff; + padding: 5px 10px; + border-radius: 5px; + width: fit-content; + align-items: center; + + .success-count { + background-color: #fff; + color: #00703C; + padding: 3px 5px; + border-radius: 3px; + margin-left: 5px; + } + } + } + + .closeButton { + position: absolute; + top: 10px; + right: 10px; + cursor: pointer; + padding: 2px; + border: 1px solid #ccc; + border-radius: 1px; + } + + .no-uploads { + margin-top: 1em; + } +} + +.results-container-orange { + max-height: 50vh; + overflow: auto; + margin-top: 1em; + border: 1px solid #ccc; + border-radius: 4px; + padding: 1em; + background-color: #ea8a3b !important; + + .no-errors { + background-color: #ea8a3b !important; + } +} + +.results-container { + max-height: 50vh; + overflow: auto; + margin-top: 1em; + border: 1px solid #ccc; + border-radius: 4px; + padding: 1em; + + .results-list-item { + border-bottom: 1px solid #ddd; + padding: 0.5em; + cursor: pointer; + + &:hover { + background-color: #D4351C; + color: white; + /* Yellowish color on hover */ + } + } + + .results-details { + white-space: pre-wrap; + border: 1px solid #ccc; + border-radius: 4px; + padding: 1em; + } +} + +.overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.3); + z-index: 9998; +} +.CloseLevelButton{ + font-size: 1rem; + margin-bottom: 24px; + /* margin-left: 24px; */ + position: relative; + right: auto; + border: none; +} + +.mdms-view-audit{ +visibility: hidden; +} +.audit-history{ +.diff{ + table-layout: fixed; +border-collapse: collapse; +width: 100%; +} +.diff-gutter-col { +width: 7ch; +} +.diff-code-delete { +background-color: #fdeff0; +} +.diff-line { +line-height: 1.5; +font-family: Consolas, Courier, monospace; +} +.diff-gutter-delete { +background-color: #fadde0; +} +.diff-gutter, .diff-gutter>a { +padding: 0 1ch; +text-align: right; +cursor: pointer; +user-select: none; +} +.diff-code { +white-space: pre-wrap; +word-wrap: break-word; +word-break: break-all; +padding: 0; +padding-left: .5em; +} +.diff td { +vertical-align: top; +padding-top: 0; +padding-bottom: 0; +} +.diff-gutter-insert { +background-color: #d6fedb; +} +.diff-gutter, .diff-gutter>a { +padding: 0 1ch; +text-align: right; +cursor: pointer; +user-select: none; +} +.diff-code-insert { +background-color: #eaffee; +} +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/typography.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/typography.scss new file mode 100644 index 0000000..4f428d7 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/digitv2/typography.scss @@ -0,0 +1,241 @@ +@import url("../index.scss"); + +.typography { + &.text-heading-xl { + font-family: theme(digitv2.fontFamily.rc); + font-style: theme(digitv2.fontStyle.normal); + font-weight: theme(digitv2.fontWeight.bold); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + + @media (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.heading-xl.desktop); + } + + @media (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.heading-xl.tablet); + } + + @media (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.heading-xl.mobile); + } + } + + &.text-heading-l { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.normal); + font-weight: theme(digitv2.fontWeight.bold); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.heading-l.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.heading-l.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.heading-l.mobile); + } + } + &.text-heading-m { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.normal); + font-weight: theme(digitv2.fontWeight.bold); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.heading-m.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.heading-m.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.heading-m.desktop); + } + } + &.text-heading-s { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.normal); + font-weight: theme(digitv2.fontWeight.bold); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.heading-s.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.heading-s.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.heading-s.mobile); + } + } + &.text-heading-xs { + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.heading-xs.mobile); + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.normal); + font-weight: theme(digitv2.fontWeight.bold); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + } + } + &.text-caption-l { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.italic); + font-weight: theme(digitv2.fontWeight.medium); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.caption-l.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.caption-l.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.caption-l.mobile); + } + } + + &.text-caption-m { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.italic); + font-weight: theme(digitv2.fontWeight.medium); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.caption-m.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.caption-m.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.caption-m.mobile); + } + } + + &.text-caption-s { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.italic); + font-weight: theme(digitv2.fontWeight.medium); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.caption-s.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.caption-s.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.caption-s.desktop); + } + } + &.text-body-l { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.italic); + font-weight: theme(digitv2.fontWeight.regular); + color: theme(digitv2.lightTheme.text-color-primary); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.body-l.desktop); + line-height: theme(digitv2.lineHeight.line-height-body-l.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.body-l.tablet); + line-height: theme(digitv2.lineHeight.line-height-body-l.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.body-l.mobile); + line-height: theme(digitv2.lineHeight.line-height-body-l.mobile); + } + } + &.text-body-s { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.italic); + font-weight: theme(digitv2.fontWeight.regular); + color: theme(digitv2.lightTheme.text-color-primary); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.body-s.desktop); + line-height: theme(digitv2.lineHeight.line-height-body-s.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.body-s.tablet); + line-height: theme(digitv2.lineHeight.line-height-body-s.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.body-s.mobile); + line-height: theme(digitv2.lineHeight.line-height-body-s.mobile); + } + } + &.text-body-xs { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.italic); + font-weight: theme(digitv2.fontWeight.regular); + color: theme(digitv2.lightTheme.text-color-primary); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.body-xs.desktop); + line-height: theme(digitv2.lineHeight.line-height-body-xs.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.body-xs.tablet); + line-height: theme(digitv2.lineHeight.line-height-body-xs.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.body-xs.mobile); + line-height: theme(digitv2.lineHeight.line-height-body-xs.mobile); + } + } + &.text-label { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.italic); + font-weight: theme(digitv2.fontWeight.regular); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.label.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.label.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.label.mobile); + } + } + &.text-link { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.normal); + font-weight: theme(digitv2.fontWeight.regular); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + text-decoration: theme(digitv2.textDecorationLine.underline); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.link.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.link.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.link.mobile); + } + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/index.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/index.scss new file mode 100644 index 0000000..6b8d082 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/index.scss @@ -0,0 +1,847 @@ +/*@import 'normalize.css';*/ + +/*@import url("https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;500;700&family=Roboto:wght@400;500;700&display=swap");*/ + +@import "tailwindcss/base"; + +@import "tailwindcss/components"; + +@import "tailwindcss/utilities"; + +@import "react-date-range/dist/styles.css"; +@import "react-date-range/dist/theme/default.css"; + +@import "./components/loader.scss"; + +@import "./components/body.scss"; +@import "./components/navbar.scss"; +@import "./components/card.scss"; +@import "./components/buttons.scss"; +@import "./components/radiobtn.scss"; +@import "./components/selectdropdown.scss"; +@import "./components/textfields.scss"; +@import "./components/bannercomponents.scss"; +@import "./components/datewrap.scss"; +@import "./components/datatable.scss"; +@import "./components/checkpoint.scss"; +@import "./components/checkbox.scss"; +@import "./components/inputotp.scss"; +@import "./components/map.scss"; +@import "./pages/employee/tooltip.scss"; +@import "./components/menu.scss"; +@import "./components/submiterrors.scss"; +@import "./components/ratingstar.scss"; +@import "./components/keynote.scss"; +@import "./components/statushighlight.scss"; +@import "./components/imageviewer.scss"; +@import "./components/actionbar.scss"; +@import "./components/table.scss"; +@import "./components/popup.scss"; +@import "./components/uploadcomponents.scss"; +@import "./components/toast.scss"; +@import "./components/detailscontainer.scss"; +@import "./components/telephone.scss"; +@import "./components/grey.scss"; +@import "./components/actionLink.scss"; +@import "./components/sectionalDropdown.scss"; +@import "./components/detailscard.scss"; +@import "./components/searchAction.scss"; +@import "./components/tag.scss"; +@import "./components/topbar.scss"; +@import "./components/languageSelector.scss"; +@import "./components/custombtn.scss"; +@import "./components/citizenInfoLabel.scss"; +@import "./components/roundedLabel.scss"; +@import "./components/changeLanguage.scss"; +@import "./components//metricsTable.scss"; +@import "./components/filters.scss"; +@import "./components//charts.scss"; +@import "./components/summary.scss"; +@import "./components/multiLink.scss"; +@import "./components/info-banner.scss"; +@import "./components/multiSelectDropdown.scss"; +@import "./components/EllipsisMenu.scss"; +@import "./components/CitizenHomeCard.scss"; +@import "./components/PropertySearchForm.scss"; +@import "./components/SearchForm.scss"; +@import "./components/cardHeaderWithOptions.scss"; +@import "./components/TimeLine.scss"; +@import "./components/PageBasedInput.scss"; +@import "./components/StandaloneSearchBar.scss"; +@import "./components/CardBasedOptions.scss"; +@import "./components/WhatsNewCard.scss"; +@import "./components/SearchOnRadioButton.scss"; +@import "./components/EventCalendarView.scss"; +@import "./components/OnGroundEventCard.scss"; +@import "./components/PopupHeadingLabel.scss"; +@import "./components/staticSideBar.scss"; +@import "./components/hoc/index.scss"; +@import "./components/FAQ.scss"; +@import "./components//howItWorks.scss"; +@import "./components/staticDynamicMessages.scss"; +@import "./components/toggleSwitch.scss"; +@import "./components/plusMinus.scss"; + +@import "./pages/employee/index.scss"; +@import "./pages/employee/cardfix.scss"; +@import "./pages/employee/popupmodule.scss"; +@import "./pages/employee/container.scss"; +@import "./pages/employee/inbox.scss"; +@import "./pages/employee/response.scss"; +@import "./pages/employee/form-fields.scss"; +@import "./pages/employee/scroll-table.scss"; +@import "./pages/employee/EmployeeLogin.scss"; +@import "./pages/employee/updateNumber.scss"; +@import "./pages/employee/oldMobileInbox.scss"; +@import "./pages/employee/dss.scss"; +@import "./pages/employee/iframe.scss"; + +@import "./pages/citizen/payment/payment-type.scss"; +@import "./pages/citizen/container.scss"; +@import "./pages/citizen/HomePageWrapper.scss"; +@import "./pages/citizen/CitizenEngagementNotificationWrapper.scss"; +@import "./pages/citizen/Events.scss"; +@import "./pages/citizen/DocumentList.scss"; +@import "./pages/citizen/SurveyList.scss"; +@import "./pages/citizen/updatePropertyNumber.scss"; +@import "./pages/citizen/citizenDocument.scss"; +@import "./pages/employee/surveys.scss"; +@import "./digitv2/index.scss"; +/* @import "./digitv2/typography.scss"; */ +@import "./components/inboxv2/index.scss"; +@import "./components//sidebar.scss"; +@import "./components/loaderWithGap.scss"; +@import "./pages/program.scss"; + +.wbh-header-container { + display: flex !important; + align-items: center; + justify-content: space-between; + margin:1rem 0.5rem -0.5rem 0.3rem; +} + +.wbh-header { + display: flex !important; + align-items: center; + justify-content: space-between; + margin:1rem 0.5rem -0.5rem 0.3rem; + .header-icon-container{ + cursor: pointer; + h4{ + margin:0px !important; + } + color:#f47738; + display: flex !important; + align-items: center; + svg { + margin:0 0 0 0.1rem; + } + } + +} + +.display-none { + display: none; +} + +.p-unset { + padding: unset !important; +} + +h1, h2, h3, h4, h5, h6 { + font-size: inherit; + font-weight: inherit; } + + +.flex-one { + @apply flex-1; +} + +.display-flex-gap-2 { + @apply flex gap-3; +} +.rm-mb { + margin-bottom: unset !important; +} + +.w-fullwidth { + @apply w-full; +} + +.margin-unset { + margin: unset !important; +} + +.text-align-center { + @apply text-center; +} + +.desktop-only { + @apply hidden; +} + +@screen dt { + .desktop-only { + @apply block; + } +} + +.mobile-only { + @apply block; +} + +@screen dt { + .mobile-only { + @apply hidden; + } +} + +.dark { + @apply text-text-primary; +} + +.mrlg { + @apply mr-lg; +} + +.mrsm { + @apply mr-sm; +} + +.mbsm { + @apply mb-sm; +} + +.employeeCard { + /* TODO need to revisit that we need mx-md NABEEL/ANIL + @apply mb-md mx-md !important; + */ + @apply mb-md !important; +} + +.home-link { + margin-left: 16px; + margin-bottom: 16px; + + a { + color: theme(colors.link.normal); + } +} + +.clear-search-label { + color: theme(colors.primary.main); + cursor: pointer; +} + +.search-submit-bar { + margin-top: 32; + margin-left: auto; +} + +.application-details-link-button { + @apply flex justify-between items-center; + + .download-button { + color: theme(colors.primary.main); + margin-left: 8px; + } +} + +.response-download-button { + @apply flex mb-sm; + + .download-button { + color: theme(colors.primary.main); + margin-left: 8px; + } +} + +.check-page-link-button { + color: theme(colors.primary.main) !important; +} + +.pt-application-download-btn { + display: flex; + justify-content: flex-end; + margin: 0px 8px; +} + +.form-pt-dropdown-only { + .options-card { + position: unset; + } +} +.application-table-container { + @apply mt-lg ml-lg flex-1; +} + +.primary-label-btn { + @apply flex; + gap: 10px; + + svg { + fill: theme(colors.primary.main); + } + + color: theme(colors.primary.main); + + cursor: pointer; + font-weight: 500; + width: fit-content; +} + +.primaryColor { + color: theme(colors.text.primary) !important; +} + +input[readonly] { + @apply border-grey-dark !important; + background-color: theme(digitv2.lightTheme.background); + border-color: theme(digitv2.lightTheme.text-color-secondary); + color: theme(digitv2.lightTheme.text-color-secondary); +} + +.hide-input-type-file { + position: absolute; + clip: rect(0, 0, 0, 0); + pointer-events: none !important; +} + +@media (hover: hover) { + .primary-label-btn { + &:hover { + color: #000; + + svg { + fill: #000; + } + } + } +} + +.disabled { + @apply border-grey-dark text-grey-dark !important; + pointer-events: none !important; +} + +.card-date-input { + @apply absolute top-0 left-0 w-3/4 bg-white pl-sm border border-input-border border-solid border-r-0; + outline: transparent solid 1px; + height: 2.5rem; +} + +.h4 { + @apply mb-sm; +} + +.react-time-picker { + width: 194px; + height: 2.5rem; + &__wrapper { + border: 2px solid theme(colors.text.primary); + padding-left: 16px; + } + &__inputGroup__input { + @apply px-sm; + line-height: 2.5rem; + min-width: 16px; + &:focus { + outline: 2px solid black; + } + } +} + +.border-none { + border: none; + justify-content: space-between; +} + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} +input[type="number"] { + -moz-appearance: textfield; +} + + +.static { + @apply flex flex-col; + min-height: 85vh; + + &-wrapper { + flex: 1; + max-height: 75vh; + overflow: scroll; + -ms-overflow-style: none; /* IE and Edge */ + scrollbar-width: none; /* Firefox */ + + &::-webkit-scrollbar { + display: none; + } + } +} + +.bill-summary { + border: #e8e7e6 solid 1px; + @apply bg-grey-light w-full; + + .bill-account-details { + @apply flex mb-md; + padding: 5px; + + .label { + @apply w-1/2 font-bold; + } + + .value { + @apply w-1/2 text-right; + } + } + + .amount-details { + @apply flex mb-md items-center; + padding: 5px; + + .label { + @apply w-1/2 font-bold; + } + + .value { + @apply w-1/2 font-bold text-right; + font-size: 18px; + } + } +} + +.bill-payment-amount { + @apply sticky bottom-0 bg-white; + padding-bottom: 32px; + + .payment-amount-front { + @apply absolute z-10 w-10 flex justify-center items-center; + background-color: #efefef; + padding: 7px 12px; + color: #9a9a9a; + } +} + +.text-indent-xl input { + text-indent: 40px; +} + +.select-payment-type { + @apply flex justify-center font-bold items-center; + padding-top: 10px; + padding-bottom: 25px; + + .value { + font-size: 20px; + } +} + +.cheque-date { + @apply flex items-center mb-lg; + border: 2px solid theme(colors.text.primary); + border-radius: 2px; + + input { + @apply outline-none w-full; + border: 0px; + background: transparent; + text-indent: 5px; + padding: 6px 0px; + } + + button { + @apply outline-none; + border: 0px; + background: transparent; + text-indent: 2px; + } +} + +.w-half { + @apply w-1/2; +} + +.ifsc-field { + @apply flex items-center mb-lg; + border: 2px solid theme(colors.text.primary); + border-radius: 2px; + + input { + @apply outline-none w-full; + border: 0px; + background: transparent; + text-indent: 5px; + padding: 6px 0px; + } + button { + @apply outline-none; + border: 0px; + background: transparent; + text-indent: 2px; + } +} + +.text-input { + @apply relative w-full; + max-width: 540px; + input { + &:hover { + @apply border-2 border-solid border-primary-main; + } + } +} + +.text-input-width { + max-width: 540px; +} + +.text-mobile-input-width { + max-width: 500px; +} + +.custom-time-picker { + @apply w-full; + max-width: 200px; +} + +.sla-cell { + @apply text-text-secondary; +} + +.submit-bar-search { + margin-top: 32px; + margin-left: 16px; + max-width: 256px; +} + +.clear-search-container { + @apply flex justify-between items-center; +} + +.card-label-smaller { + @apply w-1/3; + margin-bottom: revert; +} + +.card-label-APK { + @apply w-1/3; + margin-bottom: revert; + width: 100%; +} + +.underline { + border-color: #e7e6e6; + @apply mb-sm; +} + +.box-shadow-none { + box-shadow: none; +} + +.component-in-front { + @apply flex justify-center items-center; +} + +.subform-composer { + @apply flex; +} + +.inbox-search-container { + .result { + @apply mt-lg; + } +} + +.payment-form-text-input-correction { + width: 100% !important; +} + +.edcr-citizen-inbox { + thead th:first-child { + min-width: 155px; + } +} + +.error-boundary { + width: 100vw; + height: 100vh; + font-size: 16px; + font-family: sans-serif; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + .error-container { + display: flex; + width: 400px; + justify-content: center; + align-items: center; + flex-direction: column; + h1 { + font-size: 32px; + font-weight: bold; + } + button { + height: 40px; + width: 153px; + border-radius: 0px; + padding: 8px 24px; + color: white; + cursor: pointer; + background-color: theme(colors.primary.main); + } + } +} + +.error-boundary summary, +.error-boundary details { + width: 300px; + background-color: rgb(218, 100, 100); + margin: 5px; + border: 2px solid #222; + border-radius: 3px; + padding: 3px; +} + +.full-width-card { + width: 92vw !important; +} +.full-employee-card-link { + width: 100% !important; + margin: 7px 0px; + a { + color: inherit; + text-decoration: inherit; + } +} +.full-employee-card-height { + height: unset !important; +} + +@media (min-width: 640px) { + .full-employee-card-height { + height: 196px !important; + } + .full-employee-card-link { + width: 30% !important; + } + .full-width-card { + @apply w-full !important; + } +} +.applications-list-container { +} +.complaint-summary { + @media (min-width: 780px) { + flex: 1 0 auto; + margin-left: 1rem; + margin-top: 1rem; + } +} + +@media (min-width: 780px) { + .citizen-form-wrapper { + width: calc(100% - 219px); + display: flex; + justify-content: center; + margin-top: 1rem; + padding-left: 16px; + padding-right: 16px; + } +} +@media (min-width: 780px) { + .citizen-card-container { + padding-left: 15px; + padding-right: 15px; + margin-top: 1rem; + } +} + +@media (min-width: 780px) { + .citizen-obps-wrapper, + .selection-card-wrapper, + .pgr-citizen-wrapper, + .pt-citizen, + .bill-citizen, + .bills-citizen-wrapper, + .payer-bills-citizen-wrapper, + .engagement-citizen-wrapper, + .citizen-all-services-wrapper, + .mcollect-citizen, + .ws-citizen-wrapper, + .tl-citizen { + width: calc(100% - 219px); + padding-left: 16px; + padding-right: 16px; + margin-top: 1rem; + } +} +@media only screen and (max-width: 768px) { + /* For mobile phones: */ + .error-boundary { + height: 75vh; + } +} +.employee-app-wrapper { + min-height: calc(100vh - 8em); +} + +.ws-custom-wrapper { + .submit { + display: flex !important; + flex-direction: row-reverse !important; + width: 100% !important; + align-items: center; + button { + width: 240px !important; + } + p { + width: unset; + margin-right: 1rem; + } + } +} + +.plumber-details-new-value-wrapper { + flex: 2 1 auto; +} + +.connection-details-new-value-wrapper { + flex: 1 1 auto; +} + +.connection-details-old-value-wrapper, +.plumber-details-old-value-wrapper { + flex: 1 1 auto; + + .old-value-null-wrapper { + visibility: hidden; + padding-bottom: 8px; + margin-bottom: 8px; + } + .row { + color: #b1b4b6; + font-weight: 700; + font-size: 16px; + } +} + +.plumber-details-new-value-wrapper { + flex: 2 1 auto; +} + +.connection-details-new-value-wrapper { + flex: 1 1 auto; +} + +.connection-details-old-value-wrapper, +.plumber-details-old-value-wrapper { + flex: 1 1 auto; + .old-value-null-wrapper { + visibility: hidden; + padding-bottom: 8px; + margin-bottom: 8px; + } + .row { + color: #b1b4b6; + font-weight: 700; + font-size: 16px; + } +} + +.modal-header-ws { + padding: 1rem; + font-weight: 400; +} +.modal-body-ws { + padding: 1rem; + font-weight: 700; + color: theme(colors.text.primary); + font-size: 24px; + margin-bottom: 1rem; +} +.privacy-icon { + cursor: pointer; +} +.privacy-icon:hover { + path { + fill: rgba(244, 119, 56, 1); + } +} + +.privacy-icon-2 { + cursor: pointer; +} +.privacy-icon-2:hover { + path { + fill: none; + } +} + +.audit-card { + width: 80%; + margin-left: -260px; + margin-right: -27%; + max-height: 120px; + margin-top: 90px; +} +.localisation-info { + max-width: 100%; + .info-banner-wrap { + max-width: 100%; + margin: 0%; + margin-bottom: 1rem; + display: flex; + align-items: center; + line-height: unset; + align-content: baseline; + gap: 0.5rem; + height: 5rem; + } +} + +.info-banner-wrap div{ + align-items: center; +} + +.xls-popup-module { + margin: auto; + width: calc(100% - 5rem); +} +.actionBarClass{ + display: flex; + justify-content: space-between; + flex-direction: row-reverse; +} +.previous-button{ + margin-left: 4rem; +} +.view-composer-header-section{ + display: flex; + justify-content: space-between; + align-items: center; +} + +.app-iframe { + height: unset !important; +} +.app-iframe-wrapper.dss-kibana-iframe-wrapper { + left: unset !important; + top: unset !important; + position: unset !important; +} + +.app-iframe.dss-kibana-iframe { + position: unset !important; +} +.employeeCard.kibana-card.chart-item { + width: 100%; +} + + + diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/CitizenEngagementNotificationWrapper.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/CitizenEngagementNotificationWrapper.scss new file mode 100644 index 0000000..ea048c9 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/CitizenEngagementNotificationWrapper.scss @@ -0,0 +1,8 @@ +.CitizenEngagementNotificationWrapper { + .h1 { + margin: 15px; + } + .WhatsNewCard { + @apply mx-md mb-md; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/DocumentList.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/DocumentList.scss new file mode 100644 index 0000000..e48d487 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/DocumentList.scss @@ -0,0 +1,305 @@ +.wrapper { + margin: 20px auto; +} +.accordion-wrapper { + & + * { + margin-top: 0.5em; + } +} +.accordion-item { + overflow: hidden; + transition: max-height 0.3s cubic-bezier(1, 0, 1, 0); + height: auto; + max-height: 9999px; +} +.accordion-item.collapsed { + max-height: 0; + transition: max-height 0.35s cubic-bezier(0, 1, 0, 1); +} +.accordion-title { + font-weight: 600; + cursor: pointer; + color: #666; + padding: 0.5em 0em; + border-radius: 1.5em; + display: flex; + justify-content: space-between; + align-items: center; + &.open svg { + transform: rotate(-90deg); + } + &:hover, + &.open { + color: black; + } +} +.accordion-content { + padding: 1em 0em; +} +.document_list_searchbar { + border: 1px solid theme(colors.text.secondary) !important; + border-radius: 0px !important; + margin: 20px 0; +} +.notices_circular_searchbox { + margin-top: 50px; +} +.notice_and_circular_main { + @apply flex bg-white my-md px-md pt-md pb-lg shadow-card relative; + border-radius: 4px; +} +.gap-ten { + @apply gap-10; +} +.notice_and_circular_heading_mb { + display: flex; + justify-content: space-between; + padding: 2px; +} +.notice_and_circular_heading_mb header { + font-weight: bold; + font-size: 16px !important; + line-height: 24px; + margin-right: 50px; +} +.notice_and_circular_heading_mb .card-caption { + padding-left: 30px; + font-weight: normal; + font-size: 12px; + line-height: 24px; + color: theme(colors.text.secondary); + padding-right: 5px; + padding-left: 15px; + min-width: 80px; + position: absolute; + right: 20px; +} +.notice_and_circular_text { + padding-bottom: 20px; +} +.notice_and_circular_text p { + font-weight: normal; + font-size: 12px; + line-height: 14px; + color: theme(colors.text.secondary); +} +.notice_and_circular_caption { + margin-top: 10px; + margin-bottom: 10px; +} +.notice_and_circular_caption .card-caption { + font-weight: normal; + font-size: 10px; + line-height: 18px; + color: #A3A3A3; +} +.view_download_main { + display: flex; + flex-wrap: wrap; + gap:8px; + align-items: end; + span { + padding-right: 20px; + & .views { + display: flex; + justify-content: space-between; + align-items: center; + p { + padding-left: 10px; + font-weight: normal; + font-size: 16px; + line-height: 19px; + color: theme(colors.primary.main); + } + } + } + & .download_views_padding{ + padding-top: 8px; + } +} +@screen dt{ + .view_download_main { + span{ + & .views { + display: flex; + justify-content: space-between; + align-items: center; + p { + padding-left: 10px; + font-weight: normal; + font-size: 16px; + line-height: 19px; + color: theme(colors.primary.main); + } + } + } + } + + .notice_and_circular_heading_mb .card-caption { + font-size: 16px; + line-height: 24px; + min-width : 150px; + padding-left: 50px; + } + + .view_download_main span{ + padding-right: 30px; + } + .view_download_main span .views p { + padding-left: 8px; + font-size: 16px; + } + .notice_and_circular_text p { + font-size: 16px !important; + line-height : 24px; + } + .documentDetails_row { + grid-gap: 0 !important; + gap: 0 !important; + } + .notice_and_circular_heading_mb header{ + font-size: 24px !important; + line-height: 28px; + margin-right : 100px; + } + .notice_and_circular_caption .card-caption { + font-size: 14px; + line-height: 21px; + } + +} +.documentDetails { + &_wrapper { + @apply flex flex-col gap-10 items-start; + } + &_row { + @apply flex gap-20; + } + &_title { + @apply w-48 font-bold; + } + &_description { + @apply max-w-lg; + text-overflow: clip; + } + &_pdf { + @apply flex flex-col gap-5; + } + &_subheader { + @apply font-bold; + font-size: large; + } +} + +.documentDetails_pdf { + @apply flex gap-10 cursor-pointer; +} +.grid_section { + @apply grid grid-cols-4 gap-4; + & .document_notification_form_section { + @apply col-span-3; + } +} +.document_notification_first_grid { + @apply grid grid-cols-4 gap-4; + & .form_section, + .document_notification_table_section { + @apply col-span-3; + } +} +.new_document_section_flex { + @apply flex items-center; + & .card-section-header { + @apply pl-lg; + } +} +.new_document_para_color { + @apply text-primary-light; + margin-bottom: 42px; +} +.document_notification_second_grid { + @apply grid grid-cols-3 gap-4; +} +.document_notification_clear_search_btn { + display: flex; + justify-content: flex-end; + align-items: center; + & .document_notification_clear_search_btn_align { + display: flex; + align-items: center; + } +} +.new_document_clear_search_alignment { + @apply mb-md mr-lg; +} +.document_notification_filter_header { + @apply flex justify-between items-center; +} +.document_notification_filter_icon { + @apply flex items-center; + & .card-caption { + @apply ml-lg; + } +} +.document-table-docs-columns { + @apply flex items-center gap-5; +} +.filter_section_main { + padding-bottom: 300px; +} +.new_document_card { + @apply w-full h-56 bg-white p-xl; +} +.filter_table_section_margin { + margin-top: 30px; +} +.filter_card_employee { + @apply w-full h-auto bg-white p-xl; + padding-bottom: 100px; +} +.filter_section_document_categories { + padding-top: 20px; +} +.new_document_card_table { + @apply w-full h-auto bg-white p-xl; +} +.employee_document_inbox_table_main { + .table { + tbody { + tr { + @apply py-md; + } + } + } +} +.confirmation_box { + height: 130px; + display: flex; + align-items: center; + padding-left: 8px; + gap: 10px; + overflow: hidden; + text-overflow: ellipsis; +} + +.Docs_CardWrapper{ + @apply bg-white m-sm px-md pt-md pb-lg shadow-card; + border-radius: 4px; +} + +.mobileInbox_attachments{ + display:flex; + gap:10px; +} + +.documentDetails_row_items { + display:flex; + flex-direction: row; + align-self: flex-start; +} + +@media screen and (max-width : 768px){ + .documentDetails_row_items{ + @apply grid grid-cols-2 gap-4; + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/Events.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/Events.scss new file mode 100644 index 0000000..edf8c33 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/Events.scss @@ -0,0 +1,47 @@ +.OnGroundEventDetailsCard{ + box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.16); + @apply bg-white mx-sm mb-md p-md rounded; +} + +.eventAddressAndDirection{ + @apply text-body-s mb-md; + span{ + @apply flex mb-sm; + svg{ + @apply h-5 w-5; + } + div{ + @apply ml-md; + p{ + @apply mb-sm; + } + .direction{ + @apply text-primary-main cursor-pointer; + } + } + } +} + +.eventTimeRange{ + @apply text-body-s flex; + svg{ + @apply h-5 w-5; + } + p{ + @apply ml-md; + } +} + +.cardCaptionBodyS{ + @apply text-body-s text-text-secondary mb-md; +} + +@screen dt{ + .eventAddressAndDirection{ + @apply text-body-s-dt; + } + + .cardCaptionBodyS{ + @apply text-body-s-dt; + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/HomePageWrapper.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/HomePageWrapper.scss new file mode 100644 index 0000000..de3747c --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/HomePageWrapper.scss @@ -0,0 +1,158 @@ +.HomePageWrapper { + margin-top: -25px; + + .BannerWithSearch { + margin-bottom: 40px; + width: 100%; + @apply relative; + .Search { + width: calc(100% - 32px); + bottom: -18px; + @apply mx-md absolute; + } + img { + height: 33vw; + @apply w-full object-cover; + } + } + + .ServicesSection { + @apply flex flex-wrap; + padding: 40px 15px 0 15px; + } + + @screen dt { + .ServicesSection { + @apply flex flex-wrap; + padding: 40px 15px 0 15px; + width: 100%; + } + } + + .WhatsNewSection { + @apply m-sm; + padding: 0 15px; + .headSection { + @apply flex mb-sm justify-between; + h2 { + @apply text-heading-s font-bold text-text-primary pl-sm; + } + p { + @apply text-link text-primary-main font-medium cursor-pointer; + } + } + @media (min-width: 780px) { + padding: 0 15px; + } + } + + .WhatsAppBanner{ + width: 100%; + padding: 0px 20px 0px 20px; + margin: auto; + cursor: pointer; + img { + width: 100%; + } + } +} + +@media (min-width: 780px) { + .SideBarStatic { + width: 219px; + background: theme(colors.white); + } +} + +@media (max-width: 780px) { + .SideBarStatic { + display: none; + } +} +.HomePageContainer { + @media (min-width: 780px) { + display: flex; + width: calc(100% - 219px); + height: calc(100%-30px); + } +} + +.moduleLinkHomePage { + @media (min-width: 780px) { + width: calc(100% - 219px); + } + margin-top: -25px; + img { + height: 33vw; + filter: grayscale(100%); + @apply w-full object-cover; + } + h1 { + position: absolute; + top: 100px; + left: 21px; + @apply text-heading-xl text-white font-bold; + } + .moduleLinkHomePageBackButton { + border: none; + top: 76px; + svg { + fill: theme(colors.white); + } + @apply absolute text-white text-heading-s ml-md; + } +} + +.moduleLinkHomePageModuleLinks { + @apply mt-md; + .CitizenHomeCard { + .header { + @apply hidden; + } + } +} + +@screen dt { + .HomePageWrapper { + width: 100%; + .BannerWithSearch { + margin-bottom: 56px; + width: 100% !important; + .Search { + width: 100%; + margin: 0; + padding: 0 15px 0 15px; + } + img { + height: 20vw; + } + } + + .WhatsAppBanner { + width: 100%; + img{ + height: 20vw; + width: 100%; + } + } + + } + .moduleLinkHomePage { + img { + min-width: 100vw; + height: 20vw; + } + h1 { + top: calc(10vw + 40px); + left: 15.8rem; + } + .moduleLinkHomePageBackButton { + top: calc(10vw + 16px); + @apply ml-md; + } + } + + .moduleLinkHomePageModuleLinks { + width: 100%; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/SurveyList.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/SurveyList.scss new file mode 100644 index 0000000..21994bb --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/SurveyList.scss @@ -0,0 +1,22 @@ +.surveyListclockDiv{ + @apply flex items-center my-lg; +} +.surveyListclockDiv span{ + @apply pl-md text-text-primary; +} +.surveyListstatus{ + @apply flex items-center justify-between; +} +.surveyLisNotResponded{ + @apply text-error; +} +.surveyLisResponded{ + @apply text-success; +} +.surveyListCardMargin{ + @apply mx-md my-lg ; +} +.centered-message{ + @apply flex items-center pl-md py-lg ; + +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/citizenDocument.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/citizenDocument.scss new file mode 100644 index 0000000..106bde6 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/citizenDocument.scss @@ -0,0 +1,22 @@ +.notice_and_circular_image svg { + width: 80px; + height: 100px; + } + .notice_and_circular_content { + padding-left: 50px; + } + .back-btn2{ + border: none; + } + @media screen and (max-width: 768px) { + .notice_and_circular_image svg { + width: 53px; + height: 66px; + } + .notice_and_circular_content { + padding-left: 40px; + } + .documentContainerPadding{ + padding: 0 10px; + } + } \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/container.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/container.scss new file mode 100644 index 0000000..ad7a47a --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/container.scss @@ -0,0 +1,19 @@ +.citizen-home-footer { + @apply flex w-full h-10 bg-grey-bg pb-md pt-sm justify-center; + img { + @apply ml-sm; + } +} + +.employee .citizen-home-footer { + @apply fixed bottom-0; +} +.fill-path-primary-main { + path { + fill: theme(colors.primary.main); + } +} + +.obps-search { + margin: 8px; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/payment/payment-type.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/payment/payment-type.scss new file mode 100644 index 0000000..2e2698b --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/payment/payment-type.scss @@ -0,0 +1,3 @@ +.payment-amount-info{ + @apply flex justify-between; +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/updatePropertyNumber.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/updatePropertyNumber.scss new file mode 100644 index 0000000..9c866b9 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/citizen/updatePropertyNumber.scss @@ -0,0 +1,46 @@ +.updatenumber-warper-citizen{ + min-height: 95vh; + height: unset; +} +.updatePropertyNumber { + .pt-update-no-popup-wrapper { + @apply m-md; + } + .search-form-wrapper { + display: inherit; + padding: 16px; + .submit-bar { + position: absolute; + bottom: 25px; + width: 90%; + } + .submit-bar-disabled { + position: absolute; + bottom: 25px; + width: 90%; + } + } +} + +@screen dt { + .updatenumber-warper-citizen{ + min-height: 100vh; + height: unset; + } + .updatePropertyNumber { + .h1 { + @apply m-md; + } + .search-form-wrapper { + .submit-bar { + width: 100% !important; + position: unset !important; + } + .submit-bar-disabled { + position: absolute; + bottom: 25px; + width: 90%; + } + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/EmployeeLogin.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/EmployeeLogin.scss new file mode 100644 index 0000000..185bd91 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/EmployeeLogin.scss @@ -0,0 +1,7 @@ +.EmployeeLoginFooter{ + margin: auto; + @apply absolute bottom-10; + img{ + @apply h-4 object-contain; + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/cardfix.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/cardfix.scss new file mode 100644 index 0000000..14a0b34 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/cardfix.scss @@ -0,0 +1,13 @@ +.flex-fit{ + @apply flex w-full border-b border-solid border-border; + padding : 8px 10px; +} +.card-count{ + @apply pr-xl; + div{ + @apply text-link; + span{ + @apply text-link font-bold; + } + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/container.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/container.scss new file mode 100644 index 0000000..ee8cd23 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/container.scss @@ -0,0 +1,72 @@ +.icon-bg-secondary { + @apply flex bg-secondary w-12 h-12; + + svg { + margin: auto; + @apply w-6 h-6; + } +} + +.heading-m { + @apply font-bold text-text-primary text-heading-m ml-md pt-sm; +} +.BPAheading-m { + margin-left: 22px; +} + +.break-line { + @apply border-border my-lg; +} + +.employee-home-footer { + @apply flex h-10 pb-md pt-sm justify-center w-full; + img { + height: 100%; + } +} +.employee-login-home-footer{ + @apply flex fixed bottom-0 h-10 bg-grey-bg pb-md pt-sm justify-center w-full; + img{ + @apply ml-sm + } +} +.fieldInspectionWrapper{ + border: 1px solid theme(colors.border); + padding: 16px; + margin-top: 8px; + background: theme(colors.grey.light); +} + +.fieldInsepctionInsideWrapper { + border: 1px solid theme(colors.border); + padding: 16px; + margin-top: 8px; + background: theme(colors.white); + max-width: 70%; + min-width: 280px; +} + +@screen dt { + .ground-container { + margin-bottom: 56px; + @apply p-md; + } + .heading-m { + @apply text-heading-m-dt; + } + .BPAheading-m { + margin-left: 22px; + } + .break-line { + margin-top: 40px; + margin-bottom: 40px; + } + .employee-home-footer { + } + .moduleCardWrapper { + @apply flex flex-row flex-wrap !important; + } + .gridModuleWrapper { + @apply grid grid-cols-4 gap-4; + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/dss.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/dss.scss new file mode 100644 index 0000000..f211b04 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/dss.scss @@ -0,0 +1,266 @@ +.dss-switch-tabs{/* Card / Primary */ + +/* Light Theme / Paper */ + +background: theme(colors.white); +/* Card-Shadow */ + +box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.16); +border-radius: 4px; +margin-bottom:3%; +margin-right:25px; +} + +.dss-header-label{ + font-weight: 600 !important; + font-size: 22px !important; + white-space: pre-line; +} +.dss-switch-tab-wrapper{ + cursor:pointer; + display: flex; + flex-direction: row; + height: 50px; + align-items: center; +} + +.dss-switch-tab-selected{ + /* Revenue */ + border-bottom: 3px solid theme(colors.primary.main); + font-family: Roboto; + font-style: normal; + font-weight: 500; + font-size: 22px; + color: theme(colors.primary.main); + padding: 7px 24px; + +} +.dss-switch-tab-unselected{ + +font-family: Roboto; +font-style: normal; +font-weight: 500; +font-size: 22px; +color: theme(colors.text.secondary); +padding: 8px 24px; + +} + +.dss-table-subheader{ + position: relative; + top: -7px; + font-size: 13px; + font-weight: 400; + color: rgba(80, 90, 95, 1); +} + +.dss-pie-subheader{ + position: relative; + top: -7px; + font-size: 13px; + font-weight: 400; + color: rgba(80, 90, 95, 1); +} + +.recharts-legend-item{ + margin-bottom: 20px !important; + white-space: pre; +} + +.dss-white-pre{ + white-space: pre; + +} +.dss-white-pre-line{ + white-space: pre-line; + +} +.dss-white-pre-temp{ + white-space: pre-line; + +} + +.multi-select-dropdown-wrap{ + .master{ + .label{ + p{ + white-space:pre; + margin: auto; + margin-left:0px; + padding-left: 1%; + } + } + } +} + +.divToBeHidden{ + display:block; +} + +.divWillGetHidden{ + display:none; +} + +.dss-temp-white-pre{ + white-space: pre; +} + +.dss-input-active-border{ +--border-opacity: 1; +border: 1px solid theme(colors.primary.main) !important; +border-color: rgba(244, 119, 56, var(--border-opacity)); +} + +.dss-card { + display: flex; + flex-wrap: wrap; +} + +.dss-card-parent { + display: flex; + flex-direction: column; + width: 31%; + border-radius: 6px; + padding: 25px; + margin: 15px 11.5px; + box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); + cursor: pointer; +} + +.dss-card-body { + display: flex; + flex-wrap: wrap; + cursor: pointer; +} + +.dss-card-header { + display: flex; + margin-bottom: 30px; + align-items: center; + + p { + font-size: 24px; + font-family: "Roboto", sans-serif; + font-weight: 500; + color: theme(colors.black); + } + + svg { + width: 50px; + height: 50px; + } +} + + +.dss-insight-card { + margin: 10px 0; + + p { + font-family: "Roboto", sans-serif; + } + + .p1 { + font-size: 16px; + color: #585858; + } + + .p3 { + font-size: 16px; + font-weight: 400; + } + + .p2 { + font-size: 24px; + font-weight: 500; + color: theme(colors.black); + } + + .color-green { + color: theme(colors.success); + } + + .color-red { + color: theme(colors.error); + } +} +.w-100 { + width: 100%; +} +.dss-w-100 { + width: 97%; +} + +.h-100{ + width: 100%; + height: 100%; +} + +.dss-h-100{ + width: 97%; + height: 100%; +} + +.tab-rows{ + display: flex; + justify-content:space-between; + height: 30px; + align-items: center; + width: 60%; + margin-left: 13%; +} +.tab-header{ + font-weight: 700; + font-size: 16px; + line-height: 19px; + border-bottom: 1px solid #b1b4b6; + color: #2a3340; +} +.map-status{ + position: relative; + width: 33%; + left: 50%; + bottom: 130px; +} +.map-row{ + display: flex; + align-items: center; + margin-top: 5px; +} +.map-box{ + display: inline-block; + height: 10px; + width: 10px; +} +.map-text{ + margin-left: 5px; + color: #636363; + font-size: 14px; +} + + +@media screen and (max-width: 768px) { + .dss-switch-tabs{/* Card / Primary */ + margin-right:0px; + } + + .dss-card-parent{ + width:100%; + } +} + +.dss-metric-horizontal{ + width: 48%; + max-width: 48%; +} +.dss-primary{ + display: inline; + margin-right: 10px; + path{ + fill:theme(colors.primary.main); + } +} + +.dss-horizontal-v2{ + width: 22.7%; + max-width: 22.7%; +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/form-fields.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/form-fields.scss new file mode 100644 index 0000000..d5eb9b5 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/form-fields.scss @@ -0,0 +1,13 @@ +.form-field{ + @apply w-full +} + +@screen dt { + .form-field{ + @apply w-1/2 + } + + .desktop-w-full{ + @apply w-full !important + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/iframe.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/iframe.scss new file mode 100644 index 0000000..1f3b992 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/iframe.scss @@ -0,0 +1,66 @@ +body { + margin: 0; + padding: 0; + font-family: "Roboto"; + background: #f4f7fb; + } + + + .app-container-iframe { + border-width: 0px; + div[class^="MuiCircularProgress"] { + position: sticky; + top: 90%; + left: 50%; + } + div[role^="progressbar"] { + left: 50%; + position: sticky; + } + } + + @media only screen and (min-width: 953px) { + .app-container-iframe { + border-width: 0px; + position: fixed; + width: 83.5%; + height: calc(100vh - 64px); + } + } + + + @media (max-width: 768px) { + .app-container-iframe { + border-width: 0; + width: 100vw; + height: 100vh; + margin: 32px 0 0 0; + } + } + @media (max-width: 375px) { + .app-container-iframe { + border-width: 0; + width: 100vw; + height: 100vh; + margin: 32px 0 0 0; + } + } + +.app-iframe-wrapper{ + left: 64px; + border-width: 0; + position: fixed; + top: 80px; +} + .app-iframe{ + width: 97%; + height: calc(100vh - 90px); + border-width: 0; + position: fixed; + } + @media (max-width: 768px) { + + .app-iframe-wrapper{ + left: 0px; + } + } \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/inbox.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/inbox.scss new file mode 100644 index 0000000..1d193dc --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/inbox.scss @@ -0,0 +1,593 @@ +.complaint-links-container { + @apply bg-white; + border-radius: 4px; + .header { + @apply flex items-center border-b border-border justify-between; + + .logo { + width: 56px; + height: 56px; + @apply bg-focus; + padding: 12px; + border-radius: 4px; + svg { + @apply w-8 h-8; + } + } + + .text { + @apply pl-md text-heading-m font-bold; + } + } + + .body { + padding: 10px; + @apply flex items-start flex-col; + margin-left: 46px; + + .link { + @apply p-sm text-primary-main items-center; + display: flex !important; + a{ + color: inherit; + text-decoration: inherit + } + } + + .inbox-total { + padding: 4px; + display: table; + @apply whitespace-normal text-center text-white w-8 h-8 bg-primary-main rounded-full ml-xs; + } + } + + .links-wrapper { + @apply pl-md py-sm text-text-btn; + .link { + padding: 0 !important; + padding-bottom: 4px !important; + svg { + @apply ml-sm; + } + } + } +} + +.MobilePopupHeadingWrapper { + @apply flex place-content-between mb-md; + h2 { + @apply text-heading-l font-bold; + } +} + +.filter-button { + @apply text-primary-main; + &:hover { + @apply text-primary-dark cursor-pointer; + } +} + +.employeeCard-info-box { + @apply flex justify-end ml-md; + background-color: theme(colors.grey.light); + div { + margin-right: 32px; + span:nth-child(2) { + @apply font-bold; + color: #4f5a5f; + } + } + .employeeCard-info-data { + display: flex; + flex-direction: column; + } +} + +.filter-form { + .filter-card { + @apply bg-white min-h-full; + padding: 10px; + + .heading { + justify-content: unset; + @apply flex; + + .clearAll { + display: none; + } + } + + .filter-label { + @apply font-bold text-heading-l flex gap-3; + padding-bottom: 6px; + svg { + fill: theme(colors.text.primary); + } + } + .sub-filter-label { + font-weight: 400; + font-size: 16px; + } + } + .filter-form-field { + p { + @apply text-form-field text-text-primary block mb-md; + } + } +} + +.inbox-container { + .filters-container { + .filter { + .filter-card { + @apply bg-white; + padding: 10px; + .filter-card-close-button { + @apply flex flex-row-reverse; + } + .heading { + @apply flex justify-between; + + .clearAll { + display: none; + } + } + + .filter-label { + @apply text-heading-m block flex gap-3 items-center; + padding-bottom: 6px; + svg { + fill: theme(colors.text.primary); + } + } + + .sub-filter-label { + font-weight: 400; + font-size: 16px; + } + } + } + + .search-complaint-container { + @apply items-center bg-white p-md; + + .complaint-input-container { + @apply w-full; + .complaint-input { + @apply flex flex-col; + + .clear-search { + @apply text-focus; + display: none; + &:hover { + color: theme(colors.link.hover); + cursor: pointer; + } + } + } + + .mobile-input { + } + } + } + } + + .status-container { + margin-bottom: 50px; + } +} + +.clear-search, +.clear-search .link-label { + @apply text-focus; + @apply block; + cursor: pointer; + &:hover { + color: #000; + } +} +.button-clear { + @apply text-focus text-body-s-dt; +} + +.inbox-count { + @apply inline ml-sm p-sm bg-primary-main rounded-full text-white text-heading-s align-middle text-center font-regular; +} + +@screen dt { + .complaint-links-container { + @apply bg-white; + + .header { + @apply flex items-center border-b border-border; + + .logo { + @apply bg-focus; + padding: 12px; + border-radius: 4px; + } + + .text { + @apply pl-md text-heading-m-dt font-bold; + } + } + + .body { + padding: 10px; + @apply flex items-start flex-col; + margin-left: 46px; + + .link { + @apply p-sm text-primary-main; + } + } + } + + .inboxLinks { + margin: 0 !important; + padding: 0 !important; + .header { + border: none; + @apply justify-start; + .logo { + @apply bg-white; + svg { + path { + fill: theme(colors.primary.main); + } + } + } + } + .body { + margin-left: 0; + } + } + + .filter-form { + .filter-card { + @apply p-md bg-white; + + .heading { + @apply flex justify-between; + } + + .label { + @apply text-heading-s; + } + } + } + + .inbox-container { + @apply flex; + + .filters-container { + width: 270px; + + .filter { + @apply mt-md; + + .filter-card { + @apply p-md bg-white; + + .heading { + @apply flex justify-between; + } + + .label { + @apply text-heading-s; + } + } + } + .citizen-filter { + margin-top: unset; + } + } + + .search-container { + width: 874px; + + .search-complaint-container { + margin: auto; + @apply flex flex-col items-start mb-md bg-white p-md; + + .complaint-header { + display: flex; + @apply flex justify-between w-full; + margin-bottom: 20px; + } + + .complaint-input-container { + /* display: inline-block !important; */ + display: grid; + grid-template-columns: 33.33% 33.33% 33.33%; + + &.for-pt { + &.for-search { + grid-template-columns: 25% 25% 25% 25%; + + .input-fields:nth-child(3n) { + @apply mr-md !important; + } + + .input-fields:nth-child(4n) { + margin-right: 0 !important; + } + + .search-submit-wrapper { + grid-column: 4/5; + /* margin-top: 56px;*/ + max-width: unset; + margin-left: unset; + } + } + } + + .search-submit-wrapper { + grid-column: 3/4; + margin-left: 50%; + max-width: 50%; + grid-column: 3/4; + @apply flex flex-col justify-center text-center; + + .submit-bar-search { + margin-top: unset; + width: 100%; + margin-bottom: 20px; + margin-left: unset; + max-width: 100%; + width: 100%; + } + } + + .input-fields { + /*width: calc(50% - 16px);*/ + + @apply inline-block mr-md !important; + + .inbox-search-form-error { + padding-top: 0; + margin-top: 0; + @apply absolute; + } + } + + .input-fields:nth-child(3n) { + margin-right: 0 !important; + } + + .complaint-input { + @apply flex flex-col; + + .clear-search { + @apply text-focus; + @apply block; + cursor: pointer; + &:hover { + color: theme(colors.link.hover); + cursor: pointer; + } + } + } + + .mobile-input { + @apply ml-sm; + } + } + + .search-action-wrapper { + width: 33%; + margin-top: 28px; + @apply inline-block align-middle text-center; + button { + margin: 0; + width: 100%; + max-width: 300px !important; + } + } + } + + .search-complaint-container-for-search { + } + } + } +} + +.document-clear-all { + grid-area: 2/2; + display: flex; + justify-content: flex-end; + padding-right: 16px; + align-items: center; +} + +.cell-text { + color: theme(colors.text.secondary); +} + +.sla-cell-error { + color: theme(colors.error); + background-color: rgba(212, 53, 28, 0.12); + padding: 0 24px; + border-radius: 11px; +} + +.sla-cell-success { + color: theme(colors.success); + background-color: rgba(0, 112, 60, 0.12); + padding: 0 24px; + border-radius: 11px; +} + +.complain-no-cell-text { + margin-top: "4px"; + color: "theme(colors.text.secondary)"; +} + +.search-error-label { + @apply font-bold text-legend text-error mb-sm !important; +} + +.inbox-action-container { + display: flex; + justify-content: flex-end; + align-items: flex-start; +} +.complaint-links-container .header .removeHeight { + line-height: 28px; +} + +@screen dt { + .complaint-links-container .header .removeBorderRadiusLogo { + border-radius: 2px !important; + } +} +@screen dt { + .customEmployeeCard { + width: 263px !important; + height: 263px !important; + } +} +.employeeTotalLink { + color: theme(colors.text.secondary); + font-size: 16px; + text-decoration: none; +} + +@screen dt { + .groupBill-custom { + .custom-group-merge-container { + display: flex !important; + justify-content: space-between !important; + .header { + display: flex; + align-items: baseline; + .logo { + margin-right: 1rem; + svg { + path { + fill: theme(colors.primary.main); + } + } + } + .h1 { + font-size: 24px; + line-height: 28px; + font-weight: 400; + color: theme(colors.primary.main); + } + } + } + .inbox-container { + .search-container { + .search-complaint-container { + display: flex; + flex-direction: row; + } + .group-complaint-input-container { + width: 33% !important; + display: flex; + flex-direction: column; + } + } + } + .inbox-action-container { + display: flex; + flex-direction: row-reverse; + .clear-search { + margin-top: 65px; + margin-left: 16px; + padding-top: unset !important; + } + .submit-bar-search { + margin-top: 55px !important; + } + } + } +} + +.plumber-details-new-value-wrapper { + flex: 2 1 auto; +} + +.connection-details-new-value-wrapper { + flex: 1 1 auto; +} + +.connection-details-old-value-wrapper, +.plumber-details-old-value-wrapper { + flex: 1 1 auto; + + .old-value-null-wrapper { + visibility: hidden; + padding-bottom: 8px; + margin-bottom: 8px; + } + .row { + color: #b1b4b6; + font-weight: 700; + font-size: 16px; + } +} + +.search-tabs-container { + display: flex; + justify-content: space-between; + background-color: #eee; + + .search-tab-head { + padding: 10px 35px; + font-weight: 700; + font-size: 1rem; + border: 1px solid #d6d5d4; + border-radius: 0.5rem 0.5rem 0 0; + } + + .search-tab-head-selected { + padding: 10px 35px; + color: rgb(244, 119, 56); + background-color: #fff; + border: 1px solid #f47738; + border-radius: 0.5rem 0.5rem 0 0; + border-bottom: 4px solid rgb(244, 119, 56); + font-weight: 700; + font-size: 1.125rem; + margin-bottom: -1rem; + } + + .search-tab-head-selected:focus { + outline: 0; + } +} + +.card-with-background { + background: rgb(250, 250, 250); + border: 1px solid rgb(214, 213, 212); + + .card-head { + display: flex; + justify-content: space-between; + margin-bottom: 30px; + } + + h2 { + font-size: 16px; + font-weight: 700; + } +} + +.registryTable { + tHead { + tr { + th { + text-align: center; + } + } + } + tBody { + tr { + td { + text-align: center; + } + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss new file mode 100644 index 0000000..6a56562 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss @@ -0,0 +1,578 @@ +@import "./login.scss"; +/* TODO: convert using tailwind */ +.employee { + .breadcrumb { + @apply ml-sm mb-lg; + } + .ground-container { + margin-bottom: 56px; + @apply flex flex-col; + } + .card-home { + font-size: 16px; + padding: 0 0 16px 0; + width: 92vw; + display: inline-block; + margin: 8px auto; + } + .home-action-cards { + height: auto !important; + min-height: 263px; + } + .topbar { + position: fixed; + top: 0; + width: 100%; + padding: 16px 24px; + background: white; + box-shadow: rgba(0, 0, 0, 0.24) 0 1px 4px; + z-index: 9999; + + img { + display: inline; + + &.city { + margin-right: 8px; + height: 48px; + width: 48px; + } + + &.state { + height: 20px; + max-height: 20px; + width: auto; + } + } + + .ulb { + font-weight: bold; + } + + .right { + float: right; + margin-top: 12px; + + .user-img-txt { + background: theme(colors.primary.main); + padding: 10px 15px; + border-radius: 50%; + color: white; + font-weight: 700; + } + } + } + + .main { + padding-top: 88px; + } + + .loginContainer { + padding-top: 88px; + } + + .react-time-picker { + width: 100%; + } + + .react-time-picker__wrapper { + border: 1px solid theme(colors.inputBorder); + } + + .react-time-picker__clock { + display: none; + } + + .react-time-picker__inputGroup__leadingZero { + padding-right: 8px; + display: inline !important; + } + + .react-time-picker__inputGroup__input { + padding: 0; + min-width: none; + outline: none !important; + border: none !important; + } + + .react-time-picker__wrapper { + padding-left: 8px; + } +} + +.citizen { + .main { + padding-top: 82px; + min-height: calc(100vh - 90px); + } +} + +.citizen, +.employee { + .sidebar { + position: fixed; + left: 0; + background: #0B4B66; + height: 100%; + color: theme(colors.white); + margin-top: 83px; + z-index: 999; + transition: 0.3s ease all; + white-space: nowrap; + height: calc(100vh - 36px); + padding-bottom: 5rem; + + .actions { + cursor: pointer; + display: flex; + align-items: center; + .tooltip { + margin-left: 16px; + } + margin-bottom: 0px; + } + + svg { + width: 24px; + height: 24px; + fill: theme(colors.white); + } + a { + display: flex; + } + .sidebar-link { + display: flex; + color: theme(colors.white); + justify-content: space-between; + align-items: center; + padding: 20px; + font-size: 14px; + + &.level-0 { + margin:0 0.3rem 0 0.3rem; + &.select-level{ + border-top: 1px solid; + border-bottom: 1px solid; + } + } + + &.active { + color: theme(colors.primary.main) !important; + + border-right: none; + svg { + fill: theme(colors.primary.main) !important; + } + } + .employee-search-input { + border: none; + outline: none; + background-color: rgba(0, 0, 0, 0); + margin-left: 13px; + } + .custom-link { + .tooltip { + margin-left: 16px; + span { + margin-left: unset !important; + left: unset !important; + } + } + } + + svg { + fill: theme(colors.white) !important; + width: 21px; + height: 21px; + } + + &:hover { + + background-color: #0B4B66; + + cursor: pointer; + + } + .search-icon-wrapper { + border: 2px solid theme(colors.white); + border-radius: 4px; + padding: 5px; + svg { + fill: theme(colors.white) !important; + width: 21px; + height: 21px; + path { + fill: theme(colors.white) !important; + } + } + } + } + .dropdown-link { + height: 40px; + display: flex; + margin-left: 40px; + align-items: center; + text-decoration: none; + color: theme(colors.white); + font-size: 14px; + .actions { + .tooltiptext { + left: unset; + right: 1%; + } + } + svg { + width: 20px; + height: 20px; + fill: theme(colors.white); + } + &:hover { + background-color: #6A8E9D; + opacity: 0.8; + cursor: pointer; + svg { + fill: #fe7a51 !important; + } + } + + + &.active { + border-left: 4px solid theme(colors.primary.main); + &.level-0 { + + } + &.level-1 { + border-left: 8.5px solid theme(colors.primary.main); + } + &.level-2 { + border-left: 4px solid theme(colors.primary.main); + } + + &.level-3{ + + } + color: theme(colors.primary.main) !important; + border-right: none; + svg { + fill: theme(colors.primary.main) !important; + } + } + } + span { + margin-left: 16px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + } + + .wrapperStyles { + margin-top: -5px; + padding-left: 20px; + padding-top: 10px; + + .containerStyles { + border: 1px solid theme(colors.text.secondary); + padding: 16px; + margin-bottom: 20px; + } + + &.leftBorder { + border-left: 2px solid rgba(0, 0, 0, 0.12); + } + } + + .rowContainerStyles { + @apply flex flex-col; + } + + .tableContainerStyles { + border: 1px solid theme(colors.text.secondary); + padding: 16px; + margin-bottom: 20px; + } + + .historyTables { + display: grid; + grid-template-rows: 100px 100px; + grid-template-columns: repeat(5, minmax(100px, 1fr)); + } + + .historyContent { + margin: 0 10px; + position: relative; + padding-bottom: 5px; + } + + .historyCheckpoint { + background-color: #fe7a51; + border-radius: 100%; + width: 18px; + height: 18px; + display: inline-block; + position: relative; + left: -9px; + top: 4px; + + &.zIndex { + z-index: 10; + } + } + + .historyTableDateLabel { + color: rgba(0, 0, 0, 0.87); + font-size: 16px; + font-weight: 700; + line-height: 17px; + text-align: left; + display: inline-block; + padding-top: 5px; + } + + .bottomMargin { + margin-bottom: 0px; + } + + .historyTableDate { + color: rgba(0, 0, 0, 0.87); + font-size: 19px; + font-weight: 400; + line-height: 17px; + text-align: left; + display: inline-block; + padding-top: 10px; + } + + .historyHorizontalBar { + background-color: rgba(0, 0, 0, 0.12); + width: auto; + height: 2px; + margin-left: 16px; + } + + .smallText { + font-weight: 500; + font-size: 14px; + } +} + +.citizen { + .sidebar { + margin-top: 54px; + min-width: 200px; + .actions { + display: flex; + align-items: center; + gap: 10px; + } + } +} + +.link { + @apply text-primary-main cursor-pointer; + + :hover { + @apply text-primary-dark; + } +} + +.RightMostTopBarOptions { + @apply flex; + .EventNotificationWrapper { + @apply relative cursor-pointer ml-md; + span { + top: -10px; + right: -10px; + @apply absolute bg-error h-5 w-5 rounded-full text-center; + p { + line-height: 20px; + } + } + } + .select-wrap { + margin-bottom: unset; + svg { + fill: theme(colors.white); + } + } +} + +@media (min-width: 640px) { + .employee { + .ground-container { + @apply block; + } + .breadcrumb { + @apply mb-lg; + margin-left: 0; + } + .card-home { + width: 270px; + margin-right: 10px; + margin-bottom: 10px; + } + .card-home-hrms { + width: 405px; + padding: 0px; + margin-right: 16px; + margin-bottom: 16px; + } + .main { + display: flex; + flex-direction: column; + padding-top: 80px; + margin-left: 72px; + width: calc(100%-83px); + } + .citizen-home-container { + display: flex; + flex-direction: unset !important; + width: unset !important; + margin-left: unset !important; + padding-top: 58px; + } + } + + .citizen { + .main { + width: 100%; + padding-top: 58px; + height: 100%; + display: flex; + justify-content: center; + } + + .center-container { + } + } +} + +.fullWidth { + width: 100%; +} + +.multi-select-container { + .disposal-text { + @apply font-bold; + } + + .disposal-info { + @apply my-md ml-sm; + } + + .disposal-action-bar { + @apply flex justify-between items-center; + } +} + +@screen dt { + .d-grid { + display: grid; + grid-template-columns: 250px 250px 250px 250px; + column-gap: 10px; + row-gap: 2px; + margin-left: -12px; + } +} + +.m-auto { + margin: auto !important; +} + +.mb-50 { + margin-bottom: 50px; +} +.mb-25 { + margin-bottom: 25px; +} + +.back-wrapper { + display: flex; + justify-content: space-between; + + .top-back-btn { + margin-bottom: 0px; + color: theme(colors.white); + margin-right: 1em; + & svg { + fill: theme(colors.white); + } + } + .hambuger-back-wrapper { + display: flex; + @media (min-width: 780px) { + .hamburger-span { + display: none; + } + } + } +} + +@screen dt { + .back-wrapper { + margin-right: 2rem; + margin-left: 2rem; + } +} + +.user-profile { + @media (min-width: 780px) { + width: calc(100% - 219px); + margin-left: 16px; + margin-right: 16px; + } +} + +.link { + a{ + color: inherit; + text-decoration: inherit + } +} + +.breadcrumb { + a{ + color: inherit; + text-decoration: inherit + } +} + +.sidebar-link.active{ +.custom-link{ + text-decoration: none; + div{ + span{ + color: theme(colors.primary.main) !important; + text-decoration: none; + } + } +} +} +.bread-crumb { + a{ + color: inherit; + text-decoration: inherit + } +} + +.sidebar-link{ + .custom-link{ + text-decoration: none; + div{ + span{ + color: theme(colors.white); + text-decoration: none; + } + } + } + } + .mandatory-span { + margin-left: 0.5rem; + color: red !important; + font-size: 1rem; + font-weight: 700; + } + +/* TODO fix required NABEEL/ANIL for home screen card */ + .customEmployeeCard { + @apply m-sm !important; + } diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/login.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/login.scss new file mode 100644 index 0000000..b1f4079 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/login.scss @@ -0,0 +1,327 @@ +.loginFormStyleEmployee { + .employeeCard { + .submit-bar { + @apply w-full; + } + } +} + +.banner .bannerCard { + min-width: 420px !important; +} + +.employeeForgotPassword .employeeCard .field .field-container .component-in-front { + margin-top: 0; + border: 1px solid; + border-right: none; + padding: 7px; +} + +@screen dt { + .employeeForgotPassword .employeeCard .field .field-container .component-in-front { + padding: 7px; + } + + .loginFormStyleEmployee .employeeCard, + .banner .bannerCard { + min-width: 420px !important; + } + + .employeeForgotPassword .employeeCard, + .employeeChangePassword .employeeCard { + max-width: 420px !important; + min-width: 420px !important; + } +} + +.employeeForgotPassword .employee-card-input { + margin-bottom: 0px; + border-left: none; +} + +.employeeForgotPassword { + .digit-dropdown-select { + margin-bottom: 1.5rem; + } +} + +.employeeForgotPassword .field-container { + margin: 10px 0; +} + +.employeeForgotPassword { + .submit-bar { + @apply w-full; + } +} + +.employeeChangePassword .submit-bar { + width: 100% !important; +} + +.employeeChangePassword .card-text { + text-align: center; +} + +.employeeChangePassword .input-otp-wrap { + text-align: center; +} + +.submit-bar { + .submit-bar { + @apply w-full; + } +} + +.loginFormStyleEmployee .bannerHeader p, +.employeeForgotPassword .bannerHeader p, +.employeeChangePassword .bannerHeader p { + font-size: 19px; +} + +.employeeCard .card-sub-header { + font-size: 24px; +} + +.loginFormStyleEmployee .employeeCard .card-label, +.employeeForgotPassword .employeeCard .card-label { + font-weight: normal; + font-size: 16px; + line-height: 19px; + color: theme(colors.text.primary); + margin-top: 20px; +} + +.banner .bannerHeader { + margin-bottom: 20px; +} + +.employeeCard .card-label { + font-weight: normal; + font-size: 16px; + line-height: 19px; + color: theme(colors.text.primary); +} + +.profile-label-margin { + margin-top: 10px; +} + +.employeeForgotPassword .employeeCard .card-label-desc { + font-weight: normal; + font-size: 16px; + line-height: 24px; + color: theme(colors.text.secondary); + margin-top: 15px; +} + +.employeeChangePassword .employeeCard .card-text { + margin-bottom: 15px; + font-size: 16px; + color: theme(colors.text.secondary); +} + +@media screen and (max-width: 768px) { + .employeeChangePassword .employeeCard .card-text { + margin-top: 7px; + } + + .employeeCard .card-sub-header { + font-size: 18px; + } +} + +.employeeChangePassword .employeeCard .card-text-button { + text-align: center !important; + margin-bottom: 12px !important; +} + +.employeeChangePassword .employeeCard .input-otp-wrap { + margin-bottom: 10px; +} + +.employee .loginContainer { + padding-top: 0px !important; +} + +.banner { + height: calc(100vh) !important; +} + +.employeeChangePassword .employeeCard .field .field-container { + margin-bottom: 24px; +} + +.employeeForgotPassword .employeeCard .employee-card-sub-header, +.employeeChangePassword .employeeCard .employee-card-sub-header, +.loginFormStyleEmployee .employeeCard .employee-card-sub-header { + font-size: 24px !important; + line-height: 28px !important; + margin-bottom: 0px !important; +} + +@media screen and (max-width: 768px) { + .employeeForgotPassword .employeeCard .employee-card-sub-header, + .employeeChangePassword .employeeCard .employee-card-sub-header, + .loginFormStyleEmployee .employeeCard .employee-card-sub-header { + font-size: 18px !important; + line-height: 21px !important; + margin-bottom: 0px !important; + } + + .loginFormStyleEmployee .employeeCard, + .banner .bannerCard { + min-width: 340px !important; + margin: 10px !important; + } + + .employeeForgotPassword .employeeCard, + .employeeChangePassword .employeeCard { + max-width: 360px !important; + min-width: 340px !important; + margin: 10px !important; + } +} + +.employeeChangePassword .employeeCard .card-text { + margin-top: 18px !important; + margin-bottom: 20px !important; +} + +.employeeBackbuttonAlign { + display: none; +} + +.resend-otp { + cursor: pointer; +} + +.employee-select-wrap.login-city-dd { + .options-card { + max-height: 200px; + } +} + +@media screen and (max-width: 768px) { + .employeeBackbuttonAlign { + display: block; + position: absolute; + top: 20px; + left: 20px; + } + + .banner { + align-items: flex-end; + padding-bottom: 40px; + height: 100vh !important; + } + + .topbar { + background: rgba(34, 57, 77, var(--bg-opacity)) !important; + color: white; + } + + .employee .loginContainer { + padding-top: 0px !important; + } + + .removeBottomMargin { + margin-bottom: 0px !important; + } + + .employee-select-wrap.login-city-dd { + .options-card { + max-height: 160px; + } + } +} + +.loginFormStyleEmployee { + .loginCardSubHeaderClassName { + text-align: center !important; + } + + .loginCardClassName { + margin: auto !important; + min-width: 408px !important; + + header.employee-card-sub-header { + text-align: center; + margin-top: 10px; + } + + header.digit-header-content { + &:not(.label) { + text-align: center; + } + } + } + + .buttonClassName { + max-width: 100% !important; + width: 100% !important; + } + + .field .field-container .text-input input { + margin-bottom: 5px !important; + } + + .bannerHeader { + margin-bottom: 0px !important; + } + + .primary-label-btn { + margin: 20px auto 0 auto !important; + } + + .employee-select-wrap .options-card { + max-height: 150px !important; + } +} +.digit-privacy-checkbox { + display: flex; + margin-bottom: -2.5rem; + margin-top: -1.5rem; + gap: 0.12rem; + align-items: center; +} +.privacy-popup-header { + font-weight: 700; +} + +@media (min-width: 47.8rem) { + .privacy-popUpClass { + .digit-popup-footer-buttons { + flex-wrap: nowrap !important; + } + .accept-class { + width: 11.886rem; + } + } +} + +.languageSelection { + width: unset !important; +} +.desc-dot { + height: 8px; + width: 8px; + background-color: black; + border-radius: 50%; + display: inline-block; + margin-right: 0.5rem; +} + +.privacy-table { + font-weight: 700; +} +.policy-subdescription { + margin-left: "1rem"; + margin-top: "0.5rem"; +} +.policy-subdescription-points { + display: "flex"; + align-items: "center"; + margin-bottom: "0.5rem"; + padding-left: "1rem"; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/oldMobileInbox.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/oldMobileInbox.scss new file mode 100644 index 0000000..0c8e781 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/oldMobileInbox.scss @@ -0,0 +1,5 @@ +.linksWrapperForMobileInbox{ + .header{ + justify-content: initial; + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/popupmodule.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/popupmodule.scss new file mode 100644 index 0000000..b8a99b6 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/popupmodule.scss @@ -0,0 +1,34 @@ +.popup-module { + width: 480px; + margin: 0 auto; + @apply bg-white; + + .popup-module-main { + @apply px-lg pb-lg; + } + + .popup-module-action-bar { + gap: 16px; + @apply flex flex-row justify-end; + } +} + +@screen dt { + .popup-module { + width: 480px; + margin: auto; + @apply bg-white; + + .popup-module-main { + @apply px-lg pb-lg; + } + .popup-module-main { + @apply w-full p-sm h-full; + } + + .popup-module-action-bar { + gap: 16px; + @apply flex flex-row justify-end; + } + } +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/response.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/response.scss new file mode 100644 index 0000000..31a3993 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/response.scss @@ -0,0 +1,3 @@ +.secondary-action{ + @apply inline float-right; +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/scroll-table.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/scroll-table.scss new file mode 100644 index 0000000..c6637eb --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/scroll-table.scss @@ -0,0 +1,119 @@ +.scroll-table-wrapper{ + &::-webkit-scrollbar { + display: none; + } + -ms-overflow-style: none; + scrollbar-width: none; + @apply relative overflow-x-scroll overflow-y-visible pb-sm text-center; + + .scroll-table-width-wrapper{ + &::-webkit-scrollbar { + display: none; + } + -ms-overflow-style: none; + scrollbar-width: none; + width: calc(100% - 110px); + margin: auto; + @apply overflow-x-scroll; + table{ + margin: auto; + } + } + + .first-col{ + width:110px; + @apply absolute left-0; + } + + .last-col{ + width:110px; + @apply absolute right-0; + } +} + +@screen dt{ + .scroll-table-wrapper{ + width: 60%; + } +} +.table-switch-card-chip{ + display: flex; + cursor: pointer; + padding-right: 10px; + width: 100%; +} + +.table-search-wrapper{ + display:flex; + width:100%; + align-items:center; +} +.table-switch-card-inactive{ + /* Frame 58 */ + + +/* Auto layout */ + +display: flex; +flex-direction: row; +align-items: flex-start; +padding: 8px; + +position: static; +height: 40px; +left: 84px; +top: 0px; + +/* Light Theme / Paper */ + +background: theme(colors.white); +box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.1); + +/* Inside auto layout */ + +flex: none; +flex-grow: 0; +margin: 0px 0px; +color: #B1B4B6; +} +.table-switch-card-inactive:hover{ + background: #fffffc; + font-size: 17px; + color: theme(colors.text.secondary); +} + +.table-switch-card-active{/* Frame 57 */ + + + /* Auto layout */ + + display: flex; + flex-direction: row; + align-items: flex-start; + padding: 8px; + + position: static; + height: 40px; + left: 0px; + top: 0px; + + /* Light Theme / Paper */ + + background: theme(colors.white); + /* Light Theme / Primary */ + + border: 1px solid theme(colors.primary.main); + box-sizing: border-box; + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.1); + + /* Inside auto layout */ + + flex: none; + flex-grow: 0; + margin: 0px 0px; +} + +.icon-wrapper { + margin-left:1rem; + cursor:pointer +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/surveys.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/surveys.scss new file mode 100644 index 0000000..bcfa2aa --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/surveys.scss @@ -0,0 +1,273 @@ +.surveydetailsform-wrapper { + @apply grid gap-6 py-md; + + label { + @apply font-medium; + } + .surveyformfield { + @apply grid gap-4; + } + + .employee-select-wrap, + .employee-card-input { + margin-bottom: 0; + } +} + +.newSurveyForm_wrapper { + @apply grid p-md bg-grey-light border border-border rounded gap-6 ; + .newSurveyForm_questions { + } + .newSurveyForm_answer { + } + .newSurveyForm_actions { + @apply flex justify-end gap-4 py-md; + .checkbox-wrap .label { + margin-left: 40px; + } + } + .newSurveyForm_seprator { + @apply w-px h-6 border border-border; + } +} + +.surveyformslist_wrapper, +.surveydetailsform-wrapper { + .heading { + @apply text-heading-l font-medium py-md; + } +} + +.surveyformslist_wrapper { + @apply grid gap-6 py-md; +} + +.options_checkboxes { + @apply flex flex-col gap-4; +} + +.optioncheckboxwrapper { + @apply flex; +} + +.simple_editable-input { + outline-width: 0; + border: 0; + border-bottom: 2px solid black; +} + +.simple_readonly-input { + outline-width: 0; + border: 0; + background: transparent; +} + +.pointer { + cursor: pointer; +} + +.disabled-btn { + @apply pointer-events-none cursor-not-allowed; +} + +.optionradiobtnwrapper { + @apply flex gap-2; + + .customradiobutton { + @apply w-6 h-6; + } +} + +.edit-action-btn { + @apply flex justify-end; +} + +.surveyQuestion-wrapper{ + @apply grid gap-6; +} + +.question-title { + font-size: 18px; + line-height: 21px; + color: theme(colors.text.primary); + font-weight: 700; +} + +.responses-container { + display: flex; + flex-direction: column; + align-items: flex-start; + padding: 8px 4px; + background-color: theme(colors.grey.light); + border: 1px solid theme(colors.border); + box-sizing: border-box; + border-radius: 4px; + margin-top: 20px; + margin-bottom: 20px; + position: relative; +} + +.responses-container-date { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + padding: 8px 8px 0px 8px; + position: static; + left: 0px; + top: 41px; + background: theme(colors.grey.light); + border: 1px solid theme(colors.border); + box-sizing: border-box; + border-radius: 4px; + margin-top: 20px; + margin-bottom: 20px; +} + +.responses-container-line { + width: 100%; + margin-bottom: -12px; +} + +.date-time{ + margin-top: 10px; + margin-bottom: 10px; +} + +.response-result { + flex: none; + order: 1; + flex-grow: 0; + margin: 0px 0px -20px; + display: inline-block; +} + +.date-container { + display: flex; +flex-direction: column; +justify-content: center; +align-items: center; +padding: 16px 8px; +background: theme(colors.grey.light); +border: 1px solid theme(colors.border); +box-sizing: border-box; +border-radius: 4px; +@apply gap-y-6; +} + +.date-response { +display: flex; +flex-direction: row; +font-weight: bold; +@apply gap-10 ; +} +.divide { + --tw-divide-x-reverse: 0; +border-right-width: calc(2px * var(--tw-divide-x-reverse)); +border-left-width: calc(2px * calc(1 - var(--tw-divide-x-reverse))); +} + +.circle { + background-color:red; + height:40px; + border-radius:50%; + -moz-border-radius:50%; + -webkit-border-radius:50%; + width:40px; +} + +.align-columns{ + @apply grid gap-4; +} + + +@screen dt { + .surveydetailsform-wrapper { + .surveyformfield { + @apply items-center; + grid-template-columns: 1fr 2fr 1fr; + + .radio-wrap { + @apply flex gap-20; + margin-bottom: 0; + } + .radio-wrap div { + @apply flex items-center; + } + + .radio-btn { + @apply w-6 h-6; + } + + .radio-btn-checkmark { + height: 1.75rem; + width: 1.75rem; + --border-opacity: 1; + border: 1px solid theme(colors.inputBorder); + border-color: rgba(70, 70, 70, var(--border-opacity)); + border-radius: 9999px; + display: block; + } + + .radio-wrap .radio-btn-wrap input:checked ~ .radio-btn-checkmark:after { + display: block; + --bg-opacity: 1; + background-color: theme(colors.primary.main); + background-color: rgba(244, 119, 56, var(--bg-opacity)); + height: 1.25rem; + width: 1.25rem; + border-radius: 9999px; + position: absolute; + top: 4px; + left: 4px; + } + } + } + + .newSurveyForm_wrapper { + @apply grid p-md bg-grey-light border border-border rounded; + grid-template-columns: 33% 1fr; + + .newSurveyForm_quesno { + @apply text-heading-m font-medium; + } + + .newSurveyForm_mainsection { + } + .newSurveyForm_questions { + @apply flex gap-4; + + .text-input { + @apply w-3/4; + } + .employee-select-wrap { + @apply flex-1; + } + } + .newSurveyForm_answer { + } + .newSurveyForm_actions { + @apply flex justify-end gap-2; + .checkbox-wrap { + @apply items-center; + margin-bottom: 0; + } + .checkbox-wrap .label { + margin-left: 40px; + } + } + .newSurveyForm_seprator { + @apply w-px h-6 border border-border; + } + } + + .surveyformslist_wrapper { + @apply w-3/4 grid gap-6 py-md; + } +} + +.unstyled-button { + border: none; + padding: 0; + background: none; +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/tooltip.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/tooltip.scss new file mode 100644 index 0000000..5a4f67c --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/tooltip.scss @@ -0,0 +1,36 @@ +.tooltip { + position: relative; + display: inline-block; + } + + .tooltip .tooltiptext { + visibility: hidden; + background-color: #555; + color: #fff; + text-align: left; + border-radius: 6px; + padding: 5px; + position: absolute; + z-index: 1; + bottom: 125%; + left: 50%; + margin-left: -60px; + opacity: 0; + transition: opacity 0.3s; + } + + .tooltip .tooltiptext::after { + position: absolute; + top: 100%; + left: 50%; + margin-left: -5px; + border-width: 5px; + border-style: solid; + border-color: #555 transparent transparent transparent; + } + + .tooltip:hover .tooltiptext { + visibility: visible; + opacity: 1; + cursor: pointer; + } \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/updateNumber.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/updateNumber.scss new file mode 100644 index 0000000..fbd3294 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/updateNumber.scss @@ -0,0 +1,13 @@ +.updateNumberEmployee{ + width: 100%; + .employee-data-table .row h2{ + font-weight:500; + width: 100%; + } + .submit-bar { + position: relative; + } + .search-form-wrapper { + justify-content: initial; + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/program.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/program.scss new file mode 100644 index 0000000..68efaeb --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/program.scss @@ -0,0 +1,46 @@ +.programs-module { + width: 80% !important; + + .program-card-primary { + display: flex; + align-items: center; + + .program-list { + width: 90%; + } + + .program-apply-wrapper { + display: flex; + justify-content: flex-end; + } + } + + + .enroll { + .digit-card-component { + padding-top: 0px; + padding-bottom: 0px; + gap: 0px; + grid-gap: 0px; + } + .digit-text-block-wrap { + display: flex; + align-items: center; + .digit-text-block-header-content { + display: flex; + align-items: center; + flex-direction: column; + } + } + + .digit-action-bar-wrap { + position: relative !important; + justify-content: flex-end !important; + + .digit-submit-bar { + width: 30% !important; + + } + } + } +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/arrowdown.svg b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/arrowdown.svg new file mode 100644 index 0000000..b7456af --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/arrowdown.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/arrowleft.svg b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/arrowleft.svg new file mode 100644 index 0000000..291db64 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/arrowleft.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/calendar.svg b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/calendar.svg new file mode 100644 index 0000000..db8c32d --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/calendar.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/camera.svg b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/camera.svg new file mode 100644 index 0000000..5f0b529 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/camera.svg @@ -0,0 +1,4 @@ + + + + diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/check.svg b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/check.svg new file mode 100644 index 0000000..88018af --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/check.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/close.svg b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/close.svg new file mode 100644 index 0000000..357ce66 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/close.svg @@ -0,0 +1,4 @@ + + + + diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/error.svg b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/error.svg new file mode 100644 index 0000000..2f3e7d7 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/error.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/error2.svg b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/error2.svg new file mode 100644 index 0000000..008d258 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/error2.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/searchicon.svg b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/searchicon.svg new file mode 100644 index 0000000..bca3b00 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/searchicon.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/starempty.svg b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/starempty.svg new file mode 100644 index 0000000..8d295e7 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/starempty.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/starfilled.svg b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/starfilled.svg new file mode 100644 index 0000000..23481e8 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/starfilled.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/success.svg b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/success.svg new file mode 100644 index 0000000..e846ff6 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/svg/success.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/tailwind.config.js b/frontend/micro-ui/web/micro-ui-internals/packages/css/tailwind.config.js new file mode 100644 index 0000000..1e256ad --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/tailwind.config.js @@ -0,0 +1,231 @@ +module.exports = { + future: { + removeDeprecatedGapUtilities: true, + purgeLayersByDefault: true, + }, + purge: { enabled: true, content: ["./example/index.html"] }, + theme: { + screens: { + dt: "780px", + sm: { max: "425px" }, + }, + colors: { + primary: { + light: "#F18F5E", + main: "#c84c0e", + dark: "#C8602B", + }, + secondary: "#22394D", + text: { + primary: "#0B0C0C", + secondary: "#505A5F", + }, + link: { + normal: "#1D70B8", + hover: "#003078", + }, + border: "#D6D5D4", + inputBorder: "#464646", + "input-border": "#464646", + focus: "#c84c0e", + error: "#D4351C", + success: "#00703C", + black: "#000000", + grey: { + dark: "#9E9E9E", + mid: "#EEEEEE", + light: "#FAFAFA", + bg: "#E3E3E3", + }, + white: "#FFFFFF", + }, + fontFamily: { + sans: ["Roboto", "sans-serif"], + rc: ['"Roboto Condensed"', "sans-serif"], + }, + fontSize: { + "heading-xl-dt": ["48px", "56px"], + "heading-xl": ["32px", "40px"], + "heading-l-dt": ["36px", "40px"], + "heading-l": ["24px", "32px"], + "heading-m-dt": ["24px", "32px"], + "heading-m": ["18px", "28px"], + "heading-s": ["16px", "24px"], + "caption-xl-dt": ["27px", "32px"], + "caption-xl": ["18px", "26px"], + "caption-l-dt": ["24px", "28px"], + "caption-l": ["18px", "21px"], + "caption-m-dt": ["19px", "23px"], + "caption-m": ["16px", "19px"], + "form-field": ["16px", "20px"], + "body-l-dt": ["19px", "28px"], + "body-l": ["16px", "24px"], + "body-s-dt": ["16px", "24px"], + "body-s": ["14px", "16px"], + legend: ["19px", "23px"], + link: ["16px", "24px"], + "text-btn": ["16px", "24px"], + }, + fontWeight: { + regular: 400, + medium: 500, + bold: 700, + }, + padding: { + sm: "8px", + md: "16px", + lg: "24px", + xl: "36px", + }, + margin: { + xs: "4px", + sm: "8px", + md: "16px", + lg: "24px", + xl: "64px", + }, + borderWidth: { + default: "1px", + 0: "0", + 2: "1px", + 4: "4px", + 10: "10px", + }, + boxShadow: { + card: "0 1px 2px 0 rgba(0, 0, 0, 0.16)", + radiobtn: "0 0 0 5px #F47738", + }, + inset: { + 0: 0, + 6: "6px", + 10: "10px", + }, + extend: {}, + digitv2: { + lightTheme: { + primary: "#c84c0e", + "text-color-primary": "#0B0C0C", + "text-color-secondary": "#505A5F", + "text-color-disabled": "#B1B4B6", + background: "#EEEEEE", + paper: "#FFFFFF", + "paper-secondary": "#FAFAFA", + divider: "#D6D5D4", + "header-sidenav": "#0B4B66", + "input-border": "#505A5F", + "primary-bg": "#FEEFE7", + }, + alert: { + error: "#D4351C", + "error-bg": "#EFC7C1", + success: "#00703C", + "success-bg": "#BAD6C9", + info: "#3498DB", + "info-bg": "#C7E0F1", + }, + chart: { + "chart-1": "#048BD0", + "chart-1-gradient": "#048BD0", + "chart-2": "#FBC02D", + "chart-2-gradient": "#FBC02D", + "chart-3": "#8E29BF", + "chart-4": "#EA8A3B", + "chart-5": "#0BABDE", + }, + fontSize: { + "heading-xl": { + mobile: "2rem", + tablet: "2.25rem", + desktop: "2.5rem", + }, + "heading-l": { + mobile: "1.5rem", + tablet: "1.75rem", + desktop: "2rem", + }, + "heading-m": { + mobile: "1.25rem", + tablet: "1.375rem", + desktop: "1.5rem", + }, + "heading-s": { + mobile: "1rem", + tablet: "1rem", + desktop: "1rem", + }, + "heading-xs": { + mobile: "0.75rem", + }, + "caption-l": { + mobile: "1.5rem", + tablet: "1.75rem", + desktop: "1.75rem", + }, + "caption-m": { + mobile: "1.25rem", + tablet: "1.5rem", + desktop: "1.5rem", + }, + "caption-s": { + mobile: "1rem", + tablet: "1.25rem", + desktop: "1.25rem", + }, + "body-l": { + mobile: "1rem", + tablet: "1.25rem", + desktop: "1.25rem", + }, + "body-s": { + mobile: "0.875rem", + tablet: "1rem", + desktop: "1rem", + }, + "body-xs": { + mobile: "0.75rem", + tablet: "0.875rem", + desktop: "0.875rem", + }, + label: { + mobile: "1rem", + tablet: "1rem", + desktop: "1rem", + }, + link: { + mobile: "1rem", + tablet: "1rem", + desktop: "1rem", + }, + }, + fontFamily: { + sans: ["Roboto"], + rc: ['"Roboto Condensed"'], + }, + fontStyle: { + normal: "normal", + italic: "italic", + }, + textDecorationLine: { + underline: "underline", + }, + fontWeight: { + regular: 400, + medium: 500, + bold: 700, + }, + lineHeight: { + "line-height-body-l": { mobile: "1.5rem", tablet: "1.75rem", desktop: "1.75rem" }, + "line-height-body-s": { mobile: "1.0938rem", tablet: "1.5rem", desktop: "1.5rem" }, + "line-height-body-xs": { mobile: "1.125rem", tablet: "1.5rem", desktop: "1.5rem" }, + normal: "normal", + }, + screens: { + mobile: "400px", + tablet: "768px", + desktop: "1024px", + }, + }, + }, + variants: {}, + plugins: [], +}; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/CHANGELOG.md b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/CHANGELOG.md new file mode 100644 index 0000000..ab35490 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/CHANGELOG.md @@ -0,0 +1,19 @@ +# Changelog + +## [1.8.2-beta.1] +- Formatted changelog file. + +## [1.8.1-beta.4] +- Enhanced to load screen even if mdms is failing + +## [1.8.1-beta.3] +- other fixes. + +## [1.8.1-beta.2] +- Enhanced `useCustomMdms` hook to support version 2 of MDMS API calls. + +## [1.8.1-beta.1] +- Added the README file. + +## [1.5.23] +- Base version. diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/README.md b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/README.md new file mode 100644 index 0000000..7db5e59 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/README.md @@ -0,0 +1,74 @@ + + +# digit-ui-svg-components + +## Install + +```bash +npm install --save @egovernments/digit-ui-libraries +``` + +## Limitation + +```bash +This Package is more specific to DIGIT-UI's can be used across mission's +``` + +## Usage + +After adding the dependency make sure you have this dependency in + +```bash +frontend/micro-ui/web/package.json +``` + +```json +"@egovernments/digit-ui-libraries":"1.8.0", +``` + +then navigate to App.js + +```bash + frontend/micro-ui/web/src/App.js +``` + + +## Usage + +```jsx +import React from "react"; +import initLibraries from "@egovernments/digit-ui-libraries"; + +import defaultConfig from "./config"; + +const App = ({ deltaConfig, stateCode, cityCode, moduleCode }) => { + initLibraries(); + + const store = eGov.Services.useStore(defaultConfig, { deltaConfig, stateCode, cityCode, moduleCode }); + + return

Create React Library Example 😄

; +}; + +export default App; +``` + +## Changelog + +### Summary for Version [1.8.2-beta.1] - 2024-06-05 + +For a detailed changelog, see the [CHANGELOG.md](./CHANGELOG.md) file. + + +### Published from DIGIT Frontend +DIGIT Frontend Repo (https://github.com/egovernments/Digit-Frontend/tree/develop) + +### Contributors + +[jagankumar-egov] [nipunarora-eGov] [Tulika-eGov] [Ramkrishna-egov] [nabeelmd-eGov] [anil-egov] [vamshikrishnakole-wtt-egov] + +## License + +MIT © [jagankumar-egov](https://github.com/jagankumar-egov) + + +![Logo](https://s3.ap-south-1.amazonaws.com/works-dev-asset/mseva-white-logo.png) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/package.json b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/package.json new file mode 100644 index 0000000..191bf2e --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/package.json @@ -0,0 +1,50 @@ +{ + "name": "@egovernments/digit-ui-libraries", + "version": "1.8.2-beta.6", + "main": "dist/index.js", + "module": "dist/index.modern.js", + "source": "src/index.js", + "license": "MIT", + "files": [ + "dist" + ], + "scripts": { + "build": "microbundle-crl --compress --no-sourcemap --format cjs", + "start": "microbundle-crl watch --no-compress --format modern,cjs", + "prepublish": "yarn build" + }, + "peerDependencies": { + "react": "17.0.2" + }, + "devDependencies": { + "gh-pages": "2.2.0", + "microbundle-crl": "0.13.11", + "react-dom": "17.0.2", + "react-scripts": "^4.0.1" + }, + "dependencies": { + "axios": "0.21.1", + "babel-preset-react": "6.24.1", + "date-fns": "2.28.0", + "html2canvas": "1.4.1", + "dom-to-image": "2.6.0", + "i18next": "19.9.2", + "i18next-react-postprocessor": "3.0.7", + "pdfmake": "0.1.72", + "react": "17.0.2", + "react-i18next": "11.16.2", + "react-query": "3.6.1", + "react-redux": "7.2.8", + "react-router-dom": "5.3.0", + "redux": "4.1.2", + "xlsx": "0.17.5" + }, + "author": "JaganKumar ", + "keywords": [ + "digit", + "egov", + "dpg", + "digit-ui", + "libraries" + ] +} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/config/configUtils.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/config/configUtils.js new file mode 100644 index 0000000..05df9e7 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/config/configUtils.js @@ -0,0 +1,46 @@ +export const getSectionInfo = (formId, sectionId, defaultConfigCopy) => { + let sectionInfo; + let fieldToUpdate = { field: "", fields: [] }; + for (let section of defaultConfigCopy) { + sectionInfo = section.form.find((formDetail) => { + return formDetail.id === sectionId; + }); + if (sectionInfo) { + if (sectionInfo.fields) { + for (let field of sectionInfo.fields) { + if (field.id === formId) { + fieldToUpdate.field = field; + fieldToUpdate.fields = sectionInfo.fields; + break; + } else { + if (field.fields) { + for (let innerField of field.fields) { + if (innerField.id === formId) { + fieldToUpdate.field = innerField; + fieldToUpdate.fields = field.fields; + break; + } + } + } + } + } + } + } + } + return fieldToUpdate; +}; + +export const ifObjectContainsArray = (object) => { + if (Array.isArray(object)) { + return { hasArray: true, value: object }; + } + for (const property in object) { + if (object.hasOwnProperty(property)) { + const element = object[property]; + if (Array.isArray(element)) { + return { hasArray: true, value: element }; + } + } + } + return { hasArray: false, value: [] }; +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/config/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/config/index.js new file mode 100644 index 0000000..2bc6a46 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/config/index.js @@ -0,0 +1,31 @@ +export const getConfig = (ComponentMap, GetFunction, { config, state, repeatClicked, handlesubmit, register, onSubmit }) => { + if (!config || config.length === 0) return []; + return config.map((item) => { + const { component, name, fields, submit, ...props } = item; + return { + ...props, + // submit: submit ? GetFunction(submit) : undefined, + fields: + fields && fields.length > 0 + ? getConfig(ComponentMap, GetFunction, { + config: fields, + state, + repeatClicked, + handlesubmit, + register, + onSubmit, + }) + : null, + name, + value: state[name], + handlesubmit: component === "form" ? handlesubmit : null, + onSubmit: component === "form" ? onSubmit : null, + repeats: component === "form-section-repeat-group" ? state[name + "-repeats"] || 1 : null, + dorepeat: component === "form-section-repeat-group" ? repeatClicked(name) : null, + ref: component === "input-select" || component === "input-field" || component === "city-mohalla" ? register : null, + register: component === "input-select" || component === "input-field" || component === "city-mohalla" ? register : null, + // onChange: component === 'input-field' ? onChange(name) : null, + component: ComponentMap[component], + }; + }); +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/config/mergeConfig.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/config/mergeConfig.js new file mode 100644 index 0000000..60ecf21 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/config/mergeConfig.js @@ -0,0 +1,157 @@ +// let defaultConfig = require("./default2.json"); +import { ifObjectContainsArray } from "./configUtils"; + +let defaultConfigCopy = {}; +let sectionToBeUpdated = {}; +let currentUpdatableSection = []; +let selectedProperty = ""; + +const MergeConfigObj = (defaultConfig, deltaConfig) => { + defaultConfigCopy = JSON.parse(JSON.stringify(defaultConfig)); + let deltaConfigCopy = JSON.parse(JSON.stringify(deltaConfig)); + processStateConfig(deltaConfigCopy); + return defaultConfigCopy; +}; + +const processStateConfig = (deltaConfig) => { + if (Array.isArray(deltaConfig)) { + deltaConfig.forEach((forms) => { + sectionToBeUpdated = {}; + InitSectionToUpdate(forms); + }); + } +}; + +const InitSectionToUpdate = (forms) => { + if (forms.id && !forms.__property__) { + GetCurrentUpdatableSection(forms.id, defaultConfigCopy); + } + if (forms.__property__ && forms.__action__) { + selectedProperty = forms.__property__; + currentUpdatableSection = currentUpdatableSection.length === 0 ? defaultConfigCopy : currentUpdatableSection; + findSectionById(selectedProperty, currentUpdatableSection); + seachInDefaultConfig(forms.__property__, forms); + } else if (Array.isArray(forms)) { + forms.forEach((form) => { + InitSectionToUpdate(form); + }); + } else if (ifObjectContainsArray(forms).hasArray) { + let array = ifObjectContainsArray(forms).value; + InitSectionToUpdate(array); + } else { + throw new Error("__property__ or __action__ not found"); + } +}; + +const GetCurrentUpdatableSection = (id, defaultConfigCopy) => { + if (Array.isArray(defaultConfigCopy)) { + for (let i = 0; i < defaultConfigCopy.length; i++) { + if (defaultConfigCopy[i].id === id) { + currentUpdatableSection.push(defaultConfigCopy[i]); + } else if (ifObjectContainsArray(defaultConfigCopy[i]).hasArray) { + let array = ifObjectContainsArray(defaultConfigCopy[i]).value; + GetCurrentUpdatableSection(id, array); + } + } + } +}; + +const findSectionById = (id, currentUpdatableSection) => { + if (Array.isArray(currentUpdatableSection)) { + for (let i = 0; i < currentUpdatableSection.length; i++) { + if (currentUpdatableSection[i].id === id) { + sectionToBeUpdated = currentUpdatableSection; + } else if (ifObjectContainsArray(currentUpdatableSection[i]).hasArray) { + let arr = ifObjectContainsArray(currentUpdatableSection[i]).value; + findSectionById(id, arr); + } + } + } + + return sectionToBeUpdated; +}; + +const seachInDefaultConfig = (id, action) => { + if (!Array.isArray(sectionToBeUpdated) && !sectionToBeUpdated.id) { + throw new Error("id not found"); + } + if (sectionToBeUpdated.id === id) { + actionHandler(action, id, sectionToBeUpdated); + } else if (Array.isArray(sectionToBeUpdated)) { + sectionToBeUpdated.forEach((section) => { + if (section.id === id) { + actionHandler(action, id, sectionToBeUpdated); + } + }); + } else if (ifObjectContainsArray(sectionToBeUpdated).hasArray) { + sectionToBeUpdated = ifObjectContainsArray(sectionToBeUpdated).value; + seachInDefaultConfig(id, action); + } +}; + +const actionHandler = (action, id, fieldList) => { + const index = getIndex(id, fieldList); + if (!action) { + return; + } + if (action.__action__ === "UPDATE") { + updateAt(index, action, fieldList); + deleteExtraKeys(action); + } + if (action.__action__ === "DELETE") { + deleteAt(index, fieldList); + deleteExtraKeys(action); + } + if (["INSERT_AFTER", "INSERT_BEFORE"].includes(action.__action__)) { + handleInsertion(index, action, fieldList); + } +}; + +const handleInsertion = (index, action, fields) => { + index = action.__action__ === "INSERT_BEFORE" ? index : index + 1; + insertAt(index, action, fields); + deleteExtraKeys(action); +}; + +const getIndex = (propertyValue, fields) => { + let index = fields.findIndex((option) => option.id === propertyValue); + + return index; +}; + +const insertAt = (index, data, fields) => { + if (!data.id) { + throw new Error("id is required is required to insert a record"); + } + fields.splice(index, 0, data); +}; + +const updateAt = (index, data, fields) => { + if (fields[index].id !== data.id) { + throw new Error(`id ${data.id} not matched`); + } + fields[index] = { ...fields[index], ...data }; +}; + +const deleteAt = (index, fields) => { + fields.splice(index, 1); +}; + +const deleteExtraKeys = (data) => { + delete data.__action__; + delete data.__property__; +}; + +const getMergedConfig = (defaultConfig, deltaConfig) => { + let mergedConfigObj = defaultConfig; + + for (const key in deltaConfig) { + if (deltaConfig.hasOwnProperty(key)) { + const mergedConfig = MergeConfigObj(defaultConfig[key], deltaConfig[key]); + mergedConfigObj[key] = mergedConfig; + } + } + return mergedConfigObj; +}; + +export default getMergedConfig; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/contexts/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/contexts/index.js new file mode 100644 index 0000000..202c8fd --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/contexts/index.js @@ -0,0 +1,6 @@ +import React from "react"; + +const ComponentProvider = React.createContext(); +const PrivacyProvider = React.createContext({}); + +export default { ComponentProvider ,PrivacyProvider}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/enums/ConfigActionTypes.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/enums/ConfigActionTypes.js new file mode 100644 index 0000000..f0d76ea --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/enums/ConfigActionTypes.js @@ -0,0 +1,5 @@ +const ConfigActionTypes = Object.freeze({ + CONFIG_UPDATE: "CONFIG_UPDATE", +}); + +export default ConfigActionTypes; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/enums/FormFields.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/enums/FormFields.js new file mode 100644 index 0000000..83ba271 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/enums/FormFields.js @@ -0,0 +1,5 @@ +const FormFields = Object.freeze({ + INPUT: "input-fields", +}); + +export default FormFields; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/enums/Pages.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/enums/Pages.js new file mode 100644 index 0000000..edba249 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/enums/Pages.js @@ -0,0 +1,7 @@ +const Pages = Object.freeze({ + PGR_LIST: "pgr-list", + PGR_NEW_COMPLAINT: "pgr-new-complaint", + PGR_SEARCH: "pgr-search-complaint", +}); + +export default Pages; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/enums/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/enums/index.js new file mode 100644 index 0000000..8dbb59f --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/enums/index.js @@ -0,0 +1,7 @@ +import Pages from "./Pages"; +import ConfigActionTypes from "./ConfigActionTypes"; +// import FormFields from "./FormFields;" + +const Enums = { Pages, ConfigActionTypes }; + +export default Enums; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useDSSDashboard.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useDSSDashboard.js new file mode 100644 index 0000000..0371e5a --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useDSSDashboard.js @@ -0,0 +1,8 @@ +import { useQueries } from "react-query"; +import { getDSSDashboardData } from "../../services/molecules/DSS/getDSSDashboardData"; + +const useDSSDashboard = (stateCode, mdmsType, moduleCode, config) => { + return useQueries(getDSSDashboardData(stateCode, mdmsType, moduleCode, config)); +}; + +export default useDSSDashboard; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useDashboardConfig.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useDashboardConfig.js new file mode 100644 index 0000000..82ea22c --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useDashboardConfig.js @@ -0,0 +1,8 @@ +import { useQuery } from "react-query"; +import { DSSService } from "../../services/elements/DSS"; + +const useDashoardConfig = (moduleCode) => { + return useQuery(`DSS_DASHBOARD_CONFIG_${moduleCode}`, () => DSSService.getDashboardConfig(moduleCode)); +}; + +export default useDashoardConfig; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetChart.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetChart.js new file mode 100644 index 0000000..20d41f3 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetChart.js @@ -0,0 +1,56 @@ +import { useQuery } from "react-query"; +import { startOfMonth, endOfMonth, getTime } from "date-fns"; +import { DSSService } from "../../services/elements/DSS"; + +const getRequest = (type, code, requestDate, filters, moduleLevel = "", addlFilter) => { + let newFilter = { ...{ ...filters, ...addlFilter } }; + let updatedFilter = Object.keys(newFilter) + .filter((ele) => newFilter[ele].length > 0) + .reduce((acc, curr) => { + acc[curr] = newFilter[curr]; + return acc; + }, {}); + return { + aggregationRequestDto: { + visualizationType: type.toUpperCase(), + visualizationCode: code, + queryType: "", + filters: updatedFilter, + moduleLevel: moduleLevel, + aggregationFactors: null, + requestDate, + }, + }; +}; +const defaultSelect = (data) => { + if (data?.responseData) { + if (data?.responseData?.data) { + data.responseData.data = data?.responseData?.data?.filter((col) => col) || []; + data.responseData.data?.forEach((row) => { + if (row?.plots) { + row.plots = row?.plots.filter((col) => col) || []; + } + }); + } + } + return data; +}; + +const useGetChart = (args) => { + const { key, type, tenantId, requestDate, filters, moduleLevel, addlFilter } = args; + return useQuery( + [args], + () => + DSSService.getCharts({ + ...getRequest(type, key, requestDate, filters, moduleLevel, addlFilter), + headers: { + tenantId, + }, + }), + { + select: defaultSelect, + } + ); +}; + +export default useGetChart; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetCustomFilterRequestValues.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetCustomFilterRequestValues.js new file mode 100644 index 0000000..2154e44 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetCustomFilterRequestValues.js @@ -0,0 +1,8 @@ +import { useQuery } from "react-query"; +import { DSSService } from "../../services/elements/DSS"; + +const useGetCustomFilterRequestValues = (filterConfigs, config={}) => { + return useQuery(`DSS_CUSTOM_FILTER_REQUEST_VAL_${JSON.stringify(filterConfigs)}`, () => DSSService.getCustomFiltersDynamicValues(filterConfigs), config); +}; + +export default useGetCustomFilterRequestValues; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetCustomFilterValues.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetCustomFilterValues.js new file mode 100644 index 0000000..2620c07 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetCustomFilterValues.js @@ -0,0 +1,8 @@ +import { useQuery } from "react-query"; +import { DSSService } from "../../services/elements/DSS"; + +const useGetCustomFilterValues = (filterConfigs, config={}) => { + return useQuery(`DSS_CUSTOM_FILTER_CONFIG_${JSON.stringify(filterConfigs)}`, () => DSSService.getFiltersConfigData(filterConfigs), config); +}; + +export default useGetCustomFilterValues; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useMDMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useMDMS.js new file mode 100644 index 0000000..2b420c2 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useMDMS.js @@ -0,0 +1,20 @@ +import { useQuery } from "react-query"; +import { MdmsService } from "../../services/elements/MDMS"; + +const useDssMDMS = (tenantId, moduleCode, type, config) => { + const useDssDashboard = () => { + return useQuery("DSS_DASHBOARD", () => MdmsService.getDssDashboard(tenantId, moduleCode), config); + }; + const _default = () => { + return useQuery([tenantId, moduleCode, type], () => MdmsService.getMultipleTypes(tenantId, moduleCode, type), config); + }; + + switch (type) { + case "DssDashboard": + return useDssDashboard(); + default: + return _default(); + } +}; + +export default useDssMDMS; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useCreate.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useCreate.js new file mode 100644 index 0000000..998a5f5 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useCreate.js @@ -0,0 +1,8 @@ +import { Engagement } from "../../services/elements/Engagement"; +import { useMutation } from "react-query"; + +const useCreateDocument = (filters, config) => { + return useMutation((filters) => Engagement.create(filters)); +}; + +export default useCreateDocument; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useDelete.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useDelete.js new file mode 100644 index 0000000..31d3d23 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useDelete.js @@ -0,0 +1,8 @@ +import { Engagement } from "../../services/elements/Engagement"; +import { useMutation } from "react-query"; + +const useDelteDocument = (filters, config) => { + return useMutation((filters) => Engagement.delete(filters)); +}; + +export default useDelteDocument; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useMdms.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useMdms.js new file mode 100644 index 0000000..b29de4c --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useMdms.js @@ -0,0 +1,19 @@ +import { MdmsService, getGeneralCriteria } from "../../services/elements/MDMS"; +import { useQuery } from "react-query"; + +export const useEngagementMDMS = (tenantId, moduleCode, type, config = {}, payload = []) => { + const useDocumentCategory = () => { + return useQuery(type, () => MdmsService.getDataByCriteria(tenantId, getGeneralCriteria(tenantId, moduleCode, type), moduleCode), config); + }; + + const _default = () => { + return useQuery([tenantId, moduleCode, type], () => MdmsService.getMultipleTypes(tenantId, moduleCode, type), config); + }; + + switch (type) { + case "DocumentsCategory": + return useDocumentCategory(); + default: + return _default(); + } +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useSearch.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useSearch.js new file mode 100644 index 0000000..730737b --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useSearch.js @@ -0,0 +1,8 @@ +import { Engagement } from "../../services/elements/Engagement"; +import { useMutation, useQuery } from "react-query"; + +const useSearch = (filters, config) => { + return useQuery(["search_engagement", filters?.name, filters?.category, filters?.tenantIds, filters?.postedBy, filters?.offset, filters?.limit ], () => Engagement.search(filters), { ...config }); +}; + +export default useSearch; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useUpdate.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useUpdate.js new file mode 100644 index 0000000..2c08106 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useUpdate.js @@ -0,0 +1,8 @@ +import { Engagement } from "../../services/elements/Engagement"; +import { useMutation } from "react-query"; + +const useUpdateDocument = (filters, config) => { + return useMutation((filters) => Engagement.update(filters)); +}; + +export default useUpdateDocument; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/index.js new file mode 100644 index 0000000..1c0bb57 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/index.js @@ -0,0 +1,185 @@ +import { useQuery, useMutation } from "react-query"; + +const tsToDate = (ts) => { + const plus0 = num => `0${num.toString()}`.slice(-2) + const d = new Date(ts) + const month = d.toLocaleString("default", {month: 'short'}).toUpperCase() + const date = plus0(d.getDate()) + const hour = plus0(d.getHours()) + const minute = plus0(d.getMinutes()) + + return { + month, + date, + hour, + minute + } +} + +const isEqual = (from, to) => from === to ? from : `${from} - ${to}` + +const timeStampBreakdown = (fromTS, toTS) => { + const fromDateTime = tsToDate(fromTS) + const toDateTime = tsToDate(toTS) + return { + onGroundEventMonth: isEqual(fromDateTime.month, toDateTime.month), + onGroundEventDate: isEqual(fromDateTime.date, toDateTime.date), + onGroundEventTimeRange: `${fromDateTime.hour}:${fromDateTime.minute} - ${toDateTime.hour}:${toDateTime.minute}` + } +} + +const fetchImageLinksFromFilestoreIds = async (filesArray, tenantId) => { + const ids = filesArray?.map(file => file.fileStoreId) + const res = await Digit.UploadServices.Filefetch(ids, tenantId); + if (res.data.fileStoreIds && res.data.fileStoreIds.length !== 0) { + return res.data.fileStoreIds.map((o, index) => ({ + actionUrl: o.url.split(",")[0], + code: "VIEW_ATTACHMENT" + })); + } else { + return []; + } + }; + +const getTransformedLocale = label => { + if (typeof label === "number") return label; + label=label?.trim(); + return label && label.toUpperCase().replace(/[.:-\s\/]/g, "_"); +}; +const getTimeFormat = (epochTime) => { + epochTime = new Date(epochTime); + const Period = epochTime.getHours() < 12 ? "AM" : "PM"; + const Format = epochTime.getHours() % 12 > 0 ? epochTime.getHours() % 12 : 12; + return Format.toString() + ":" + epochTime.toString().split(":")[1] + " " + Period; + }; + const getDateFormat = (epochTime) => { + const monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "June", + "July", "Aug", "Sep", "Oct", "Nov", "Dec" + ]; + epochTime = new Date(epochTime); + const day = epochTime.getDate(); + const Month = epochTime.getMonth(); + return day.toString() + " " + monthNames[Month]; + }; + + +const getEventSLA = (item) => { + const days = (Date.now() - item.auditDetails.lastModifiedTime) / (1000 * 60 * 60 * 24); + let time; + let unit; + if (item.eventType === "EVENTSONGROUND") { + const disp = getDateFormat(item.eventDetails.fromDate) + " " + getTimeFormat(item.eventDetails.fromDate) + "-" + getDateFormat(item.eventDetails.toDate) + " " + getTimeFormat(item.eventDetails.toDate); + time=""; + unit=disp; + } else { + if (days >= 60){ + time=[Math.floor(days / 30)]; + unit="EV_SLA_MONTH"; + } + else if (days >= 30){ + time=[Math.floor(days / 30)]; + unit="EV_SLA_MONTH_ONE"; + } + else if (days >= 14){ + time=[Math.floor(days / 7)]; + unit="EV_SLA_WEEK"; + } + else if (days >= 7) { + time=[Math.floor(days / 7)]; + unit="EV_SLA_WEEK_ONE"; + } + else if (days >= 2){ + time=[Math.floor(days)]; + unit="CS_SLA_DAY"; + } + else if (days >= 1){ + time=[Math.floor(days)]; + unit="EV_SLA_DAY_ONE"; + } + else if ((days % 1) * 24 >= 2) { + time=[Math.floor((days % 1) * 24)]; + unit="EV_SLA_TIME"; + } + else if ((days % 1) * 24 >= 1){ + time=[Math.floor((days % 1) * 24)]; + unit="EV_SLA_TIME_ONE"; + } + else if ((days % 1) * 24 * 60 >= 2) { + time=[Math.floor((days % 1) * 24 * 60)]; + unit="EV_SLA_MINUTE"; + } + else if ((days % 1) * 24 * 60 >= 1) { + time=[Math.floor((days % 1) * 24 * 60)]; + unit="EV_SLA_MINUTE_ONE"; + + } + else{ + time=""; + unit="CS_SLA_NOW"; + } + } + + return { + time,unit + }; + }; + + + +const filterAllEvents = async(data, variant) => { + const filteredEvents = data.filter(e => e.status === "ACTIVE") + const events = [] + for(const e of filteredEvents){ + const actionDownloadLinks = e?.eventDetails?.documents?.length > 0 && e?.tenantId ? await fetchImageLinksFromFilestoreIds(e?.eventDetails?.documents, e?.tenantId) : [] + const slaDetails=getEventSLA(e); + events.push({ + ...e, + timePastAfterEventCreation: slaDetails.time, + timeApproxiamationInUnits: slaDetails.unit, + //todo + eventNotificationText: e?.description, + header: e?.eventType === "SYSTEMGENERATED" ? getTransformedLocale(e?.name) : e?.name, + eventType: e?.eventType, + actions: [...(e?.actions?.actionUrls ? e?.actions?.actionUrls : []), ...actionDownloadLinks], + ...variant === "events" || e?.eventType === "EVENTSONGROUND" ? timeStampBreakdown(e?.eventDetails?.fromDate, e?.eventDetails?.toDate) : {}, + }) + } + return events +} + +const variantBasedFilter = async(variant, data) =>{ + switch(variant){ + case "whats-new": + const allWhatsNewEvents = await filterAllEvents(data.events, variant) + return allWhatsNewEvents.filter( i => i?.actions?.length ) + case "events": + return await filterAllEvents(data.events, variant) + default: + return await filterAllEvents(data.events, variant) + } +} + +const getEventsData = async (variant, tenantId) => { + const isLoggedIn = Digit.UserService.getUser() + const data = await Digit.EventsServices.Search({tenantId, auth: !!isLoggedIn, ...variant === "events" ? {filter: {eventTypes: "EVENTSONGROUND"}} : {} }) + const allEventsData = await variantBasedFilter(variant, data) + return allEventsData +} + +const useEvents = ({tenantId, variant, config={}}) => useQuery( + ["EVENTS_SEARCH", tenantId, variant], + () => getEventsData(variant, tenantId), + { + ...config + } ) + +const useClearNotifications = () => useMutation(({tenantId}) => Digit.EventsServices.ClearNotification({tenantId})) + +const useNotificationCount = ({tenantId, config={}}) => useQuery( + ["NOTIFICATION_COUNT", tenantId], + () => Digit.EventsServices.NotificationCount({tenantId}), + { + ...config + }) + +export { useEvents, useClearNotifications, useNotificationCount } \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useCreateEvent.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useCreateEvent.js new file mode 100644 index 0000000..9ba375f --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useCreateEvent.js @@ -0,0 +1,7 @@ +import { useMutation } from "react-query"; + +const useCreateEvent = () => { + return useMutation(eventData => Digit.EventsServices.Create(eventData)) +} + +export default useCreateEvent; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useEventDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useEventDetails.js new file mode 100644 index 0000000..c1043ce --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useEventDetails.js @@ -0,0 +1,44 @@ +import { useQuery } from 'react-query'; +import { format } from "date-fns"; + +const useEventDetails = (tenantId, filters, config = {}) => { + return useQuery( + ['EVENT_DETAILS', tenantId, filters], + () => Digit.EventsServices.EventDetails(tenantId, filters), + { + select: (data) => { + const details = [{ + title:" ", + asSectionHeader: true, + values: [ + { title: "EVENTS_ULB_LABEL", value: data?.tenantId }, + { title: "EVENTS_NAME_LABEL", value: data?.name }, + { title: "EVENTS_CATEGORY_LABEL", value: data?.eventCategory }, + { title: "EVENTS_DESCRIPTION_LABEL", value: data?.description }, + { title: "EVENTS_FROM_DATE_LABEL", value: format(new Date(data?.eventDetails?.fromDate), 'dd/MM/yyyy') }, + { title: "EVENTS_TO_DATE_LABEL", value: format(new Date(data?.eventDetails?.toDate), 'dd/MM/yyyy') }, + { title: "EVENTS_FROM_TIME_LABEL", value: format(new Date(data?.eventDetails?.fromDate), 'hh:mm'), skip: true }, + { title: "EVENTS_TO_TIME_LABEL", value: format(new Date(data?.eventDetails?.toDate), 'hh:mm'), skip: true }, + { title: "EVENTS_ADDRESS_LABEL", value: data?.eventDetails?.address }, + { title: "EVENTS_MAP_LABEL", + map: true, + value: data?.eventDetails?.latitude && data?.eventDetails?.longitude ? + Digit.Utils.getStaticMapUrl(data?.eventDetails?.latitude, data?.eventDetails?.longitude) : + 'N/A' + }, + { title: "EVENTS_ORGANIZER_NAME_LABEL", value: data?.eventDetails?.organizer }, + { title: "EVENTS_ENTRY_FEE_INR_LABEL", value: data?.eventDetails?.fees }, + ] + }] + return { + applicationData: data, + applicationDetails: details, + tenantId: tenantId + } + }, + ...config + } + ) +} + +export default useEventDetails; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useEventInbox.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useEventInbox.js new file mode 100644 index 0000000..826e342 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useEventInbox.js @@ -0,0 +1,23 @@ +import { useQuery } from "react-query" + +const combineResponse = (data, users) => { + data.events = data?.events?.map(event => { + const user = users.find(user => user.uuid === event?.auditDetails?.lastModifiedBy) + return { ...event, user } + }); + return data; +} + + +const useInbox = (tenantId, data, filter = {}, config = {}) => { + return useQuery(["EVENT_INBOX", tenantId, data, filter], async () => { + const eventData = await Digit.EventsServices.Search({ tenantId, data, filter }); + const uuids = [] + eventData?.events?.forEach(event => uuids.push(event?.auditDetails?.lastModifiedBy)); + const usersResponse = await Digit.UserService.userSearch(null, { uuid: uuids }, {}); + return combineResponse(eventData, usersResponse?.user); + }, + config); +} + +export default useInbox; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useUpdateEvent.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useUpdateEvent.js new file mode 100644 index 0000000..77ddb89 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useUpdateEvent.js @@ -0,0 +1,7 @@ +import { useMutation } from "react-query"; + +const useUpdateEvent = () => { + return useMutation(eventData => Digit.EventsServices.Update(eventData)) +} + +export default useUpdateEvent; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSCount.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSCount.js new file mode 100644 index 0000000..50b63da --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSCount.js @@ -0,0 +1,8 @@ +import { useQuery, useQueryClient } from "react-query"; +import HrmsService from "../../services/elements/HRMS"; + +export const useHRMSCount = (tenantId, config = {}) => { + return useQuery(["HRMS_COUNT", tenantId], () => HrmsService.count(tenantId), config); +}; + +export default useHRMSCount; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSGender.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSGender.js new file mode 100644 index 0000000..7d7e97b --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSGender.js @@ -0,0 +1,18 @@ +import { useQuery } from "react-query"; +import { MdmsService } from "../../services/elements/MDMS"; + +const useHRMSGenderMDMS = (tenantId, moduleCode, type, config = {}) => { + const useHRGenders = () => { + return useQuery("HR_GENDER_DETAILS", () => MdmsService.HRGenderType(tenantId, moduleCode ,type), config); + }; + + + switch (type) { + case "GenderType": + return useHRGenders(); + } +}; + + + +export default useHRMSGenderMDMS; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSGenderMDMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSGenderMDMS.js new file mode 100644 index 0000000..7d7e97b --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSGenderMDMS.js @@ -0,0 +1,18 @@ +import { useQuery } from "react-query"; +import { MdmsService } from "../../services/elements/MDMS"; + +const useHRMSGenderMDMS = (tenantId, moduleCode, type, config = {}) => { + const useHRGenders = () => { + return useQuery("HR_GENDER_DETAILS", () => MdmsService.HRGenderType(tenantId, moduleCode ,type), config); + }; + + + switch (type) { + case "GenderType": + return useHRGenders(); + } +}; + + + +export default useHRMSGenderMDMS; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSMDMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSMDMS.js new file mode 100644 index 0000000..6616cbe --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSMDMS.js @@ -0,0 +1,25 @@ +import { MdmsService } from "../../services/elements/MDMS"; +import { useQuery } from "react-query"; + +const useHrmsMDMS = (tenantId, moduleCode, type, config = {}) => { + const useHrmsRolesandDesignations = () => { + return useQuery(["HRMS_EMP_RD", tenantId], () => MdmsService.getHrmsEmployeeRolesandDesignation(tenantId), config); + }; + const useHrmsEmployeeTypes = () => { + return useQuery(["HRMS_EMP_TYPE", tenantId], () => MdmsService.getHrmsEmployeeTypes(tenantId, moduleCode, type), config); + }; + + const useHrmsEmployeeReasons = () => { + return useQuery(["HRMS_EMP_REASON", tenantId], () => MdmsService.getHrmsEmployeeReason(tenantId, moduleCode, type), config); + }; + + switch (type) { + case "HRMSRolesandDesignation": + return useHrmsRolesandDesignations(); + case "EmployeeType": + return useHrmsEmployeeTypes(); + case "DeactivationReason": + return useHrmsEmployeeReasons(); + } +}; +export default useHrmsMDMS; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSUpdate.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSUpdate.js new file mode 100644 index 0000000..5094627 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSUpdate.js @@ -0,0 +1,8 @@ +import { useQuery, useMutation } from "react-query"; +import HrmsService from "../../services/elements/HRMS"; + +export const useHRMSUpdate = (tenantId, config = {}) => { + return useMutation((data) => HrmsService.update(data, tenantId)); +}; + +export default useHRMSUpdate; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMScreate.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMScreate.js new file mode 100644 index 0000000..85d0af9 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMScreate.js @@ -0,0 +1,8 @@ +import { useQuery, useMutation } from "react-query"; +import HrmsService from "../../services/elements/HRMS"; + +export const useHRMSCreate = (tenantId, config = {}) => { + return useMutation((data) => HrmsService.create(data, tenantId)); +}; + +export default useHRMSCreate; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSsearch.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSsearch.js new file mode 100644 index 0000000..77822d3 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSsearch.js @@ -0,0 +1,8 @@ +import { useQuery, useQueryClient } from "react-query"; +import HrmsService from "../../services/elements/HRMS"; + +export const useHRMSSearch = (searchparams, tenantId, filters, isupdated, config = {}) => { + return useQuery(["HRMS_SEARCH", searchparams, tenantId, filters, isupdated], () => HrmsService.search(tenantId, filters, searchparams), config); +}; + +export default useHRMSSearch; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/index.js new file mode 100644 index 0000000..49c902d --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/index.js @@ -0,0 +1,216 @@ +import { useClearNotifications, useEvents, useNotificationCount } from "./events"; +import useCreateEvent from "./events/useCreateEvent"; +import useUpdateEvent from "./events/useUpdateEvent"; +import { + useBulkPdfDetails, useDemandSearch, useFetchBillsForBuissnessService, useFetchCitizenBillsForBuissnessService, useFetchPayment, useGetPaymentRulesForBusinessServices, usePaymentSearch, usePaymentUpdate, useRecieptSearch +} from "./payment"; +import { useInitStore } from "./store"; +import useAccessControl from "./useAccessControl"; +import { useApplicationsForBusinessServiceSearch } from "./useApplicationForBillSearch"; +import useClickOutside from "./useClickOutside"; +import useCustomMDMS from "./useCustomMDMS"; +import useDocumentSearch from "./useDocumentSearch"; +import useDynamicData from "./useDynamicData"; +import useLocation from "./useLocation"; + +import useInboxGeneral from "./useInboxGeneral/useInboxGeneral"; +import useNewInboxGeneral from "./useInboxGeneral/useNewInbox"; +import useBoundaryLocalities from "./useLocalities"; +import useCommonMDMS from "./useMDMS"; +import useWorkflowDetailsV2 from "./useWorkflowDetailsV2"; +import useModuleTenants from "./useModuleTenants"; +import useQueryParams from "./useQueryParams"; +import useRouteSubscription from "./useRouteSubscription"; +import { useUserSearch } from "./userSearch"; +import useSessionStorage from "./useSessionStorage"; +import useApplicationStatusGeneral from "./useStatusGeneral"; +import useStore from "./useStore"; +import { useTenants } from "./useTenants"; +import useWorkflowDetails from "./workflow"; +import useCustomAPIHook from "./useCustomAPIHook"; +import useCustomAPIMutationHook from "./useCustomAPIMutationHook"; +import useUpdateCustom from "./useUpdateCustom"; + + +import useComplaintDetails from "./pgr/useComplaintDetails"; +import { useComplaintsList, useComplaintsListByMobile } from "./pgr/useComplaintList"; +import useComplaintStatus from "./pgr/useComplaintStatus"; +import useComplaintStatusCount from "./pgr/useComplaintStatusWithCount"; +import useComplaintSubType from "./pgr/useComplaintSubType"; +import useComplaintTable from "./pgr/useComplaintTable"; +import useComplaintTypes from "./pgr/useComplaintTypes"; +import useEmployeeFilter from "./pgr/useEmployeeFilter"; +import useInboxData from "./pgr/useInboxData"; +import useLocalities from "./pgr/useLocalities"; +import useServiceDefs from "./pgr/useServiceDefs"; +import usePGRTenants from "./pgr/useTenants"; +import useGenderMDMS from "./useGenderMDMS"; + +import useEmployeeSearch from "./useEmployeeSearch"; + +import useDashboardConfig from "./dss/useDashboardConfig"; +import useDSSDashboard from "./dss/useDSSDashboard"; +import useGetChart from "./dss/useGetChart"; +import useDssMdms from "./dss/useMDMS"; +import useGetCustomFilterValues from "./dss/useGetCustomFilterValues"; +import useGetCustomFilterRequestValues from './dss/useGetCustomFilterRequestValues'; + + +import useHRMSCount from "./hrms/useHRMSCount"; +import useHRMSCreate from "./hrms/useHRMScreate"; +import useHRMSGenderMDMS from "./hrms/useHRMSGender"; +import useHrmsMDMS from "./hrms/useHRMSMDMS"; +import useHRMSSearch from "./hrms/useHRMSsearch"; +import useHRMSUpdate from "./hrms/useHRMSUpdate"; + + + +import useDocCreate from "./engagement/useCreate"; +import useDocDelete from "./engagement/useDelete"; +import { useEngagementMDMS } from "./engagement/useMdms"; +import useDocSearch from "./engagement/useSearch"; +import useDocUpdate from "./engagement/useUpdate"; +import useEventDetails from "./events/useEventDetails"; +import useEventInbox from "./events/useEventInbox"; + +import useSurveyCreate from "./surveys/useCreate"; +import useSurveyDelete from "./surveys/useDelete"; +import useSurveySearch from "./surveys/useSearch"; +import useSurveyShowResults from "./surveys/useShowResults"; +import useSurveySubmitResponse from "./surveys/useSubmitResponse"; +import useSurveyInbox from "./surveys/useSurveyInbox"; +import useSurveyUpdate from "./surveys/useUpdate"; + + + +import useGetDSSAboutJSON from "./useGetDSSAboutJSON"; +import useGetDSSFAQsJSON from "./useGetDSSFAQsJSON"; +import useGetFAQsJSON from "./useGetFAQsJSON"; +import useGetHowItWorksJSON from "./useHowItWorksJSON"; +import { usePrivacyContext } from "./usePrivacyContext"; +import useStaticData from "./useStaticData"; + + + +const pgr = { + useComplaintDetails, + useComplaintsList, + useComplaintsListByMobile, + useComplaintStatus, + useComplaintTable, + useComplaintTypes, + useEmployeeFilter, + useInboxData, + useLocalities, + useServiceDefs, + useTenants: usePGRTenants, + useComplaintSubType, + useComplaintStatusCount, +}; + + +const dss = { + useMDMS: useDssMdms, + useDashboardConfig, + useDSSDashboard, + useGetChart, + useGetCustomFilterValues, + useGetCustomFilterRequestValues +}; + + +const hrms = { + useHRMSSearch, + useHrmsMDMS, + useHRMSCreate, + useHRMSUpdate, + useHRMSCount, + useHRMSGenderMDMS, +}; + + + + +const events = { + useInbox: useEventInbox, + useCreateEvent, + useEventDetails, + useUpdateEvent, +}; + +const engagement = { + useMDMS: useEngagementMDMS, + useDocCreate, + useDocSearch, + useDocDelete, + useDocUpdate, +}; + +const survey = { + useCreate: useSurveyCreate, + useUpdate: useSurveyUpdate, + useDelete: useSurveyDelete, + useSearch: useSurveySearch, + useSubmitResponse: useSurveySubmitResponse, + useShowResults: useSurveyShowResults, + useSurveyInbox, +}; + +const Hooks = { + useSessionStorage, + useQueryParams, + useFetchPayment, + usePaymentUpdate, + useFetchCitizenBillsForBuissnessService, + useFetchBillsForBuissnessService, + useGetPaymentRulesForBusinessServices, + useWorkflowDetails, + useInitStore, + useClickOutside, + useUserSearch, + useApplicationsForBusinessServiceSearch, + useDemandSearch, + useInboxGeneral, + useEmployeeSearch, + useBoundaryLocalities, + useCommonMDMS, + useApplicationStatusGeneral, + useModuleTenants, + useRecieptSearch, + usePaymentSearch, + useNewInboxGeneral, + useEvents, + useClearNotifications, + useNotificationCount, + useStore, + useDocumentSearch, + useTenants, + useAccessControl, + usePrivacyContext, + pgr, + + dss, + + hrms, + + events, + engagement, + survey, + useGenderMDMS, + useRouteSubscription, + useCustomAPIHook, + useCustomAPIMutationHook, + useWorkflowDetailsV2, + useUpdateCustom, + useCustomMDMS, + useGetHowItWorksJSON, + useGetFAQsJSON, + useGetDSSFAQsJSON, + useGetDSSAboutJSON, + useStaticData, + useDynamicData, + useBulkPdfDetails, + useLocation +}; + +export default Hooks; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/payment.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/payment.js new file mode 100644 index 0000000..255ac45 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/payment.js @@ -0,0 +1,160 @@ +import { useQuery, useQueryClient } from "react-query"; +import { PaymentService } from "../services/elements/Payment"; + +export const useFetchCitizenBillsForBuissnessService = ({ businessService, ...filters }, config = {}) => { + const queryClient = useQueryClient(); + const { mobileNumber, tenantId } = Digit.UserService.getUser()?.info || {}; + const params = { mobileNumber, businessService, ...filters }; + if (!params["mobileNumber"]) delete params["mobileNumber"]; + const { isLoading, error, isError, data, status } = useQuery( + ["citizenBillsForBuisnessService", businessService, { ...params }], + () => Digit.PaymentService.fetchBill(tenantId, { ...params }), + { + refetchOnMount: true, + retry: false, + ...config, + } + ); + return { + isLoading, + error, + isError, + data, + status, + revalidate: () => queryClient.invalidateQueries(["citizenBillsForBuisnessService", businessService]), + }; +}; + +export const useFetchBillsForBuissnessService = ({ tenantId, businessService, ...filters }, config = {}) => { + const queryClient = useQueryClient(); + let isPTAccessDone = sessionStorage.getItem("IsPTAccessDone"); + const params = { businessService, ...filters }; + const _tenantId = tenantId || Digit.UserService.getUser()?.info?.tenantId; + const { isLoading, error, isError, data, status } = useQuery( + ["billsForBuisnessService", businessService, { ...filters }, config, isPTAccessDone], + () => Digit.PaymentService.fetchBill(_tenantId, params), + { + retry: (count, err) => { + return false; + }, + ...config, + } + ); + return { + isLoading, + error, + isError, + data, + status, + revalidate: () => queryClient.invalidateQueries(["billsForBuisnessService", businessService]), + }; +}; + +export const useFetchPayment = ({ tenantId, consumerCode, businessService }, config) => { + const queryClient = useQueryClient(); + + const fetchBill = async () => { + /* Currently enabled the logic to get bill no and expiry date for PT Module */ + if (businessService?.includes("PT") || businessService?.includes("SW") || businessService?.includes("WS")) { + const fetchedBill = await Digit.PaymentService.fetchBill(tenantId, { consumerCode, businessService }); + const billdetail = fetchedBill?.Bill?.[0]?.billDetails?.sort((a, b) => b.fromPeriod - a.fromPeriod)?.[0] || {}; + fetchedBill.Bill[0].billDetails = fetchedBill?.Bill[0]?.billDetails?.map((ele) => ({ + ...ele, + currentBillNo: fetchedBill?.Bill?.[0]?.billNumber, + currentExpiryDate: billdetail?.expiryDate, + })); + if (fetchedBill && fetchedBill?.Bill?.[0]?.billDetails?.length > 1) { + fetchedBill?.Bill?.[0]?.billDetails?.map(async (billdet) => { + const searchBill = await Digit.PaymentService.searchBill(tenantId, { + consumerCode, + fromPeriod: billdet?.fromPeriod, + toPeriod: billdet?.toPeriod, + service: businessService, + retrieveOldest: true, + }); + billdet.expiryDate = searchBill?.Bill?.[0]?.billDetails?.[0]?.expiryDate; + billdet.billNumber = searchBill?.Bill?.[0]?.billNumber; + }); + } + return fetchedBill; + } else { + return Digit.PaymentService.fetchBill(tenantId, { consumerCode, businessService }); + } + }; + + const retry = (failureCount, error) => { + if (error?.response?.data?.Errors?.[0]?.code === "EG_BS_BILL_NO_DEMANDS_FOUND") return false; + else return failureCount < 3; + }; + + const queryData = useQuery(["paymentFetchDetails", tenantId, consumerCode, businessService], () => fetchBill(), { retry, ...config }); + + return { + ...queryData, + revalidate: () => queryClient.invalidateQueries(["paymentFetchDetails", tenantId, consumerCode, businessService]), + }; +}; + +export const usePaymentUpdate = ({ egId }, businessService, config) => { + const getPaymentData = async (egId) => { + const transaction = await Digit.PaymentService.updateCitizenReciept(egId); + const payments = await Digit.PaymentService.getReciept(transaction.Transaction[0].tenantId, businessService, { + consumerCodes: transaction.Transaction[0].consumerCode, + }); + return { payments, applicationNo: transaction.Transaction[0].consumerCode, txnStatus: transaction.Transaction[0].txnStatus }; + }; + + return useQuery(["paymentUpdate", egId], () => getPaymentData(egId), config); +}; + +export const useGetPaymentRulesForBusinessServices = (tenantId) => { + return useQuery(["getPaymentRules", tenantId], () => Digit.MDMSService.getPaymentRules(tenantId)); +}; + +export const usePaymentSearch = (tenantId, filters, config = {}) => { + return useQuery(["PAYMENT_SERACH", tenantId], () => Digit.PaymentService.searchBill(tenantId, filters), { + select: (data) => { + return data?.Bill?.[0]?.billDetails?.[0]?.billAccountDetails.filter((e) => { + switch (e.taxHeadCode) { + case "WS_CHARGE": + case "WS_TIME_PENALTY": + case "WS_TIME_INTEREST": + case "SW_TIME_INTEREST": + case "SW_TIME_PENALTY": + case "SW_CHARGE": + case "WS_WATER_CESS": + case "WS_TIME_ADHOC_PENALTY": + case "WS_TIME_ADHOC_REBATE": + case "SW_TIME_ADHOC_PENALTY": + case "SW_TIME_ADHOC_REBATE": + return true; + default: + return false; + } + }); + }, + ...config, + }); +}; + +export const useDemandSearch = ({ consumerCode, businessService, tenantId }, config = {}) => { + if (!tenantId) tenantId = Digit.ULBService.getCurrentTenantId(); + const queryFn = () => Digit.PaymentService.demandSearch(tenantId, consumerCode, businessService); + const queryData = useQuery(["demand_search", { consumerCode, businessService, tenantId }], queryFn, { refetchOnMount: "always", ...config }); + return queryData; +}; + +export const useRecieptSearch = ({ tenantId, businessService, ...params }, config = {}) => { + return useQuery( + ["reciept_search", { tenantId, businessService, params },config], + () => Digit.PaymentService.recieptSearch(tenantId, businessService, params), + { + refetchOnMount: false, + ...config, + } + ); +}; + +export const useBulkPdfDetails = ({ filters }) => { + return useQuery(["BULK_PDF_DETAILS", filters], async () => await PaymentService.getBulkPdfRecordsDetails(filters)); +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintDetails.js new file mode 100644 index 0000000..ee40baa --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintDetails.js @@ -0,0 +1,76 @@ +import { useQuery, useQueryClient } from "react-query"; + +// TODO: move to service +const getThumbnails = async (ids, tenantId) => { + const res = await Digit.UploadServices.Filefetch(ids, tenantId); + if (res.data.fileStoreIds && res.data.fileStoreIds.length !== 0) { + return { thumbs: res.data.fileStoreIds.map((o) => o.url.split(",")[3]), images: res.data.fileStoreIds.map((o) => Digit.Utils.getFileUrl(o.url)) }; + } else { + return null; + } +}; + +const getDetailsRow = ({ id, service, complaintType }) => ({ + CS_COMPLAINT_DETAILS_COMPLAINT_NO: id, + CS_COMPLAINT_DETAILS_APPLICATION_STATUS: `CS_COMMON_${service.applicationStatus}`, + CS_ADDCOMPLAINT_COMPLAINT_TYPE: complaintType === "" ? `SERVICEDEFS.OTHERS` : `SERVICEDEFS.${complaintType}`, + CS_ADDCOMPLAINT_COMPLAINT_SUB_TYPE: `SERVICEDEFS.${service.serviceCode.toUpperCase()}`, + CS_COMPLAINT_ADDTIONAL_DETAILS: service.description, + CS_COMPLAINT_FILED_DATE: Digit.DateUtils.ConvertTimestampToDate(service.auditDetails.createdTime), + ES_CREATECOMPLAINT_ADDRESS: [ + service.address.landmark, + Digit.Utils.locale.getLocalityCode(service.address.locality, service.tenantId), + service.address.city, + service.address.pincode, + ], +}); + +const isEmptyOrNull = (obj) => obj === undefined || obj === null || Object.keys(obj).length === 0; + +const transformDetails = ({ id, service, workflow, thumbnails, complaintType }) => { + const { Customizations, SessionStorage } = window.Digit; + const role = (SessionStorage.get("user_type") || "CITIZEN").toUpperCase(); + const customDetails = Customizations?.PGR?.getComplaintDetailsTableRows + ? Customizations.PGR.getComplaintDetailsTableRows({ id, service, role }) + : {}; + return { + details: !isEmptyOrNull(customDetails) ? customDetails : getDetailsRow({ id, service, complaintType }), + thumbnails: thumbnails?.thumbs, + images: thumbnails?.images, + workflow: workflow, + service, + audit: { + citizen: service.citizen, + details: service.auditDetails, + source: service.source, + rating: service.rating, + serviceCode: service.serviceCode, + }, + service: service, + }; +}; + +const fetchComplaintDetails = async (tenantId, id) => { + var serviceDefs = await Digit.MDMSService.getServiceDefs(tenantId, "PGR"); + const { service, workflow } = (await Digit.PGRService.search(tenantId, { serviceRequestId: id })).ServiceWrappers[0] || {}; + Digit.SessionStorage.set("complaintDetails", { service, workflow }); + if (service && workflow && serviceDefs) { + const complaintType = serviceDefs.filter((def) => def.serviceCode === service.serviceCode)[0].menuPath.toUpperCase(); + const ids = workflow.verificationDocuments + ? workflow.verificationDocuments.filter((doc) => doc.documentType === "PHOTO").map((photo) => photo.fileStoreId || photo.id) + : null; + const thumbnails = ids ? await getThumbnails(ids, service.tenantId) : null; + const details = transformDetails({ id, service, workflow, thumbnails, complaintType }); + return details; + } else { + return {}; + } +}; + +const useComplaintDetails = ({ tenantId, id }) => { + const queryClient = useQueryClient(); + const { isLoading, error, data } = useQuery(["complaintDetails", tenantId, id], () => fetchComplaintDetails(tenantId, id)); + return { isLoading, error, complaintDetails: data, revalidate: () => queryClient.invalidateQueries(["complaintDetails", tenantId, id]) }; +}; + +export default useComplaintDetails; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintList.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintList.js new file mode 100644 index 0000000..33f3a5c --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintList.js @@ -0,0 +1,12 @@ +import { useQuery, useQueryClient } from "react-query"; + +export const useComplaintsList = (tenantId, filters) => { + // TODO: move city to state + const client = useQueryClient(); + const { isLoading, error, data } = useQuery(["complaintsList", filters], () => Digit.PGRService.search(tenantId, filters), {}); + return { isLoading, error, data, revalidate: () => client.invalidateQueries(["complaintsList", filters]) }; +}; + +export const useComplaintsListByMobile = (tenantId, mobileNumber) => { + return useComplaintsList(tenantId, { mobileNumber }); +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintStatus.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintStatus.js new file mode 100644 index 0000000..f75ec84 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintStatus.js @@ -0,0 +1,31 @@ +import React, { useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; + +const useComplaintStatus = () => { + const { t } = useTranslation(); + const [complaintStatus, setComplaintStatus] = useState([]); + const tenantId = Digit.ULBService.getCurrentTenantId(); + + useEffect(() => { + let WorkflowService = null; + // const user = Digit.UserService.getUser(); + // const tenantId = user?.info?.tenantId; + (async () => { + // let stateCode = + // Digit.SessionStorage.get("userType") == "employee" + // ? Digit.SessionStorage.get("Employee.tenantId") + // : Digit.SessionStorage.get("Citizen.tenantId"); + WorkflowService = await Digit.WorkflowService.init(tenantId, "PGR"); + let applicationStatus = WorkflowService.BusinessServices[0].states + .filter((state) => state.applicationStatus) + .map((state) => ({ + name: t(`CS_COMMON_${state.applicationStatus}`), + code: state.applicationStatus, + })); + setComplaintStatus(applicationStatus); + })(); + }, [t, tenantId]); + + return complaintStatus; +}; +export default useComplaintStatus; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintStatusWithCount.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintStatusWithCount.js new file mode 100644 index 0000000..c2337fc --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintStatusWithCount.js @@ -0,0 +1,27 @@ +import { useEffect, useState } from "react"; +import useComplaintStatus from "./useComplaintStatus"; + +const useComplaintStatusCount = (complaints) => { + const [complaintStatusWithCount, setcomplaintStatusWithCount] = useState([]); + let complaintStatus = useComplaintStatus(); + let tenantId = Digit.ULBService.getCurrentTenantId(); + + const getCount = async (value) => { + let response = await Digit.PGRService.count(tenantId, { applicationStatus: value }); + return response?.count || ""; + }; + + useEffect(() => { + let getStatusWithCount = async () => { + let statusWithCount = complaintStatus.map(async (status) => ({ + ...status, + count: await getCount(status.code), + })); + setcomplaintStatusWithCount(await Promise.all(statusWithCount)); + }; + getStatusWithCount(); + }, [complaints, complaintStatus]); + return complaintStatusWithCount; +}; + +export default useComplaintStatusCount; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintSubType.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintSubType.js new file mode 100644 index 0000000..6aa59a0 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintSubType.js @@ -0,0 +1,18 @@ +import React, { useEffect, useState } from "react"; + +const useComplaintSubType = (complaintType, t) => { + const [subTypeMenu, setSubTypeMenu] = useState([]); + + useEffect(() => { + (async () => { + if (complaintType) { + const menu = await Digit.GetServiceDefinitions.getSubMenu(Digit.ULBService.getCurrentTenantId(), complaintType, t); + setSubTypeMenu(menu); + } + })(); + }, [complaintType]); + + return subTypeMenu; +}; + +export default useComplaintSubType; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintTable.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintTable.js new file mode 100644 index 0000000..9716bb3 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintTable.js @@ -0,0 +1,23 @@ +import React, { useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; + +const useComplaintTable = ({ data }) => { + const { t } = useTranslation(); + const [details, setDetails] = useState([]); + + useEffect(() => { + const details = { + CS_COMPLAINT_DETAILS_COMPLAINT_NO: data.serviceRequestId, + CS_COMPLAINT_DETAILS_COMPLAINT_SUBTYPE: t(data.complaintSubType), + CS_COMPLAINT_DETAILS_APPLICATION_STATUS: data.applicationStatus, + CS_COMPLAINT_DETAILS_LOCALITY: t(data.locality), + CS_COMPLAINT_DETAILS_TASK_OWNER: "task owner", + CS_COMPLAINT_SLA_REMAINING: "", + }; + setDetails(details); + }, []); + + return details; +}; + +export default useComplaintTable; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintTypes.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintTypes.js new file mode 100644 index 0000000..6110a95 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintTypes.js @@ -0,0 +1,20 @@ +import React, { useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; + +const useComplaintTypes = ({ stateCode }) => { + const [complaintTypes, setComplaintTypes] = useState(null); + const { t } = useTranslation(); + + useEffect(() => { + (async () => { + const res = await Digit.GetServiceDefinitions.getMenu(stateCode, t); + let menu = res.filter((o) => o.key !== ""); + menu.push({ key: "Others", name: t("SERVICEDEFS.OTHERS") }); + setComplaintTypes(menu); + })(); + }, [t, stateCode]); + + return complaintTypes; +}; + +export default useComplaintTypes; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useEmployeeFilter.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useEmployeeFilter.js new file mode 100644 index 0000000..8249a07 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useEmployeeFilter.js @@ -0,0 +1,35 @@ +import React, { useState, useEffect } from "react"; +import { useTranslation } from "react-i18next"; + +const useEmployeeFilter = (tenantId, roles, complaintDetails) => { + const [employeeDetails, setEmployeeDetails] = useState(null); + const { t } = useTranslation(); + useEffect(() => { + (async () => { + // const _roles = roles.join(","); + const searchResponse = await Digit.PGRService.employeeSearch(tenantId, roles); + + const serviceDefs = await Digit.MDMSService.getServiceDefs(tenantId, "PGR"); + const serviceCode = complaintDetails.service.serviceCode; + const service = serviceDefs?.find((def) => def.serviceCode === serviceCode); + const department = service?.department; + const employees = searchResponse.Employees.filter((employee) => + employee.assignments.map((assignment) => assignment.department).includes(department) + ); + + //emplpoyess data sholld only conatin name uuid dept + setEmployeeDetails([ + { + department: t(`COMMON_MASTERS_DEPARTMENT_${department}`), + employees: employees.map((employee) => { + return { uuid: employee.user.uuid, name: employee.user.name }; + }), + }, + ]); + })(); + }, [tenantId, roles, t, complaintDetails]); + + return employeeDetails; +}; + +export default useEmployeeFilter; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useInboxData.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useInboxData.js new file mode 100644 index 0000000..c07c024 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useInboxData.js @@ -0,0 +1,61 @@ +import { useQuery, useQueryClient } from "react-query"; + +const useInboxData = (searchParams) => { + const client = useQueryClient(); + // const [complaintList, setcomplaintList] = useState([]); + // const user = Digit.UserService.getUser(); + // const tenantId = user?.info?.tenantId; + + + const fetchInboxData = async () => { + const tenantId = Digit.ULBService.getCurrentTenantId(); + let serviceIds = []; + let commonFilters = { start: 1, end: 10 }; + const { limit, offset } = searchParams; + let appFilters = { ...commonFilters, ...searchParams.filters.pgrQuery, ...searchParams.search, limit, offset }; + let wfFilters = { ...commonFilters, ...searchParams.filters.wfQuery }; + let complaintDetailsResponse = null; + let combinedRes = []; + complaintDetailsResponse = await Digit.PGRService.search(tenantId, appFilters); + complaintDetailsResponse.ServiceWrappers.forEach((service) => serviceIds.push(service.service.serviceRequestId)); + const serviceIdParams = serviceIds.join(); + const workflowInstances = await Digit.WorkflowService.getByBusinessId(tenantId, serviceIdParams, wfFilters, false); + if (workflowInstances.ProcessInstances.length) { + combinedRes = combineResponses(complaintDetailsResponse, workflowInstances).map((data) => ({ + ...data, + sla: Math.round(data.sla / (24 * 60 * 60 * 1000)), + })); + } + return combinedRes; + }; + + const result = useQuery(["fetchInboxData", + ...Object.keys(searchParams).map(i => + typeof searchParams[i] === "object" ? Object.keys(searchParams[i]).map(e => searchParams[i][e]) : searchParams[i] + )], + fetchInboxData, + { staleTime: Infinity } + ); + return { ...result, revalidate: () => client.refetchQueries(["fetchInboxData"]) }; +}; + +const mapWfBybusinessId = (wfs) => { + return wfs.reduce((object, item) => { + return { ...object, [item["businessId"]]: item }; + }, {}); +}; + +const combineResponses = (complaintDetailsResponse, workflowInstances) => { + let wfMap = mapWfBybusinessId(workflowInstances.ProcessInstances); + return complaintDetailsResponse.ServiceWrappers.map((complaint) => ({ + serviceRequestId: complaint.service.serviceRequestId, + complaintSubType: complaint.service.serviceCode, + locality: complaint.service.address.locality.code, + status: complaint.service.applicationStatus, + taskOwner: wfMap[complaint.service.serviceRequestId]?.assignes?.[0]?.name || "-", + sla: wfMap[complaint.service.serviceRequestId]?.businesssServiceSla, + tenantId: complaint.service.tenantId, + })); +}; + +export default useInboxData; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useLocalities.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useLocalities.js new file mode 100644 index 0000000..560f082 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useLocalities.js @@ -0,0 +1,34 @@ +import React, { useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; + +const useLocalities = ({ city }) => { + const { t } = useTranslation(); + let locality = []; + const [localityList, setLocalityList] = useState(null); + const [localities, setLocalities] = useState(null); + useEffect(() => { + (async () => { + let tenantId = Digit.ULBService.getCurrentTenantId(); + let response = await Digit.LocationService.getLocalities(tenantId); + let __localityList = []; + if (response && response.TenantBoundary.length > 0) { + __localityList = Digit.LocalityService.get(response.TenantBoundary[0]); + } + setLocalityList(__localityList); + })(); + }, [city]); + + useEffect(() => { + if (localityList) { + const __localities = localityList; + __localities.forEach((element) => { + locality.push({ name: t(element.code), code: element.code }); + }); + setLocalities(locality); + } + }, [localityList]); + + return localities; +}; + +export default useLocalities; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useServiceDefs.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useServiceDefs.js new file mode 100644 index 0000000..ceea643 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useServiceDefs.js @@ -0,0 +1,23 @@ +import { useTranslation } from "react-i18next"; + +const { useState, useEffect } = require("react"); + +const useServiceDefs = (tenantId, moduleCode) => { + const [localMenu, setLocalMenu] = useState([]); + const SessionStorage = Digit.SessionStorage; + let { t } = useTranslation(); + + useEffect(() => { + (async () => { + const serviceDefs = await Digit.MDMSService.getServiceDefs(tenantId, moduleCode); + SessionStorage.set("serviceDefs", serviceDefs); + + const serviceDefsWithKeys = serviceDefs.map((def) => ({ ...def, i18nKey: t("SERVICEDEFS." + def.serviceCode.toUpperCase()) })); + setLocalMenu(serviceDefsWithKeys); + })(); + }, [t, tenantId, moduleCode]); + + return localMenu; +}; + +export default useServiceDefs; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useTenants.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useTenants.js new file mode 100644 index 0000000..0c2f394 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useTenants.js @@ -0,0 +1,9 @@ +import React, { useEffect, useState } from "react"; + +const useTenants = () => { + const tenantInfo = Digit.SessionStorage.get("PGR_TENANTS"); + const [tenants, setTenants] = useState(tenantInfo ? tenantInfo : null); + return tenants; +}; + +export default useTenants; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/revalidateQuery.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/revalidateQuery.js new file mode 100644 index 0000000..3514b67 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/revalidateQuery.js @@ -0,0 +1,6 @@ +import { useQueryClient } from "react-query"; + +export const useRevalidateQuery = async (key) => { + const client = useQueryClient(); + return client.refetchQueries(key); +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/store.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/store.js new file mode 100644 index 0000000..f9550c4 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/store.js @@ -0,0 +1,19 @@ +import { useState, useEffect } from "react"; +import { useQuery } from "react-query"; +// import mergeConfig from "../../config/mergeConfig"; +import { StoreService } from "../services/molecules/Store/service"; + +export const useStore = ({ stateCode, moduleCode, language ,modulePrefix = "rainmaker" }) => { + return useQuery(["store", stateCode, moduleCode, language, modulePrefix], () => StoreService.defaultData(stateCode, moduleCode, language, modulePrefix)); +}; + +export const useInitStore = (stateCode, enabledModules,modulePrefix = "rainmaker" ) => { + const { isLoading, error, isError, data } = useQuery( + ["initStore", stateCode, enabledModules,modulePrefix], + () => StoreService.digitInitData(stateCode, enabledModules ,modulePrefix), + { + staleTime: Infinity, + } + ); + return { isLoading, error, isError, data }; +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useCreate.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useCreate.js new file mode 100644 index 0000000..c645dea --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useCreate.js @@ -0,0 +1,8 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useMutation } from "react-query"; + +const useCreateSurveys = (filters, config) => { + return useMutation((filters) => Surveys.create(filters)); +}; + +export default useCreateSurveys; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useDelete.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useDelete.js new file mode 100644 index 0000000..91c94a0 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useDelete.js @@ -0,0 +1,8 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useMutation } from "react-query"; + +const useDeleteSurveys = (filters, config) => { + return useMutation((filters) => Surveys.delete(filters)); +}; + +export default useDeleteSurveys; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSearch.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSearch.js new file mode 100644 index 0000000..ca2c937 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSearch.js @@ -0,0 +1,8 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useQuery } from "react-query"; + +const useSearch = (filters, config) => { + return useQuery(["search_surveys", filters?.uuid, filters?.title, filters?.tenantIds, filters?.postedBy, filters?.offset, filters?.limit], () => Surveys.search(filters), { ...config }); +}; + +export default useSearch; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useShowResults.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useShowResults.js new file mode 100644 index 0000000..331baa7 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useShowResults.js @@ -0,0 +1,8 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useMutation } from "react-query"; + +const useShowResults = (filters, config) => { + return useMutation((filters) => Surveys.showResults(filters)); +}; + +export default useShowResults; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSubmitResponse.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSubmitResponse.js new file mode 100644 index 0000000..a4351dd --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSubmitResponse.js @@ -0,0 +1,8 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useMutation } from "react-query"; + +const useSubmitResponse = (filters, config) => { + return useMutation((filters) => Surveys.submitResponse(filters)); +}; + +export default useSubmitResponse; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSurveyInbox.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSurveyInbox.js new file mode 100644 index 0000000..16712ef --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSurveyInbox.js @@ -0,0 +1,33 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useMutation, useQuery } from "react-query"; +/* import { isObject, isObjectLike } from "lodash"; */ + +const useSearch = (filters, config) => { + const { filterForm, searchForm, tableForm } = filters + const { status } = filterForm + const { title, tenantIds, postedBy } = searchForm + const { sortBy, limit, offset, sortOrder } = tableForm; + const validTenantId = typeof tenantIds === 'object' ? tenantIds.code : tenantIds; + const validStatus = typeof status === 'object' ? status.code : status; + + const finalFilters = { + tenantIds: validTenantId, + status: validStatus === "ALL" ? "" : validStatus, + title, + postedBy, + limit, + offset + } + + //clearing out empty string params from payload + Object.keys(finalFilters).forEach(key => { + if (finalFilters[key] === '') { + delete finalFilters[key]; + } + }); + + + return useQuery(["search_surveys", title, tenantIds, postedBy, status, offset, limit], () => Surveys.search(finalFilters), { ...config, refetchInterval: 6000 }); +}; + +export default useSearch; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useUpdate.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useUpdate.js new file mode 100644 index 0000000..770a880 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useUpdate.js @@ -0,0 +1,8 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useMutation } from "react-query"; + +const useUpdateSurvey = (filters, config) => { + return useMutation((filters) => Surveys.update(filters)); +}; + +export default useUpdateSurvey; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useAccessControl.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useAccessControl.js new file mode 100644 index 0000000..df03043 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useAccessControl.js @@ -0,0 +1,13 @@ +import { useQuery } from "react-query"; +import AccessControlService from "../services/elements/Access"; +const useAccessControl = (tenantId) => { + const getUserRoles = Digit.SessionStorage.get("User")?.info?.roles; + + const roles = getUserRoles?.map((role) => { + return role.code; + }); + + const response = useQuery(["ACCESS_CONTROL", tenantId], async () => await AccessControlService.getAccessControl(roles),{enabled:roles?true:false}); + return response; +}; +export default useAccessControl; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useApplicationForBillSearch.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useApplicationForBillSearch.js new file mode 100644 index 0000000..158535e --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useApplicationForBillSearch.js @@ -0,0 +1,37 @@ + +import { useQuery } from "react-query"; + + + +const refObj = (tenantId, filters) => { + let consumerCodes = filters?.consumerCodes; + // delete filters.consumerCodes; + + return { + + }; +}; + +export const useApplicationsForBusinessServiceSearch = ({ tenantId, businessService, filters }, config = {}) => { + let _key = businessService?.toLowerCase().split(".")[0]; + if (window.location.href.includes("mcollect")) { + _key = "mcollect"; + } + if (window.location.href.includes("TL")) { + _key = "TL"; + } + if (window.location.href.includes("BPAREG")) { + _key = businessService + } + if (window.location.href.includes("BPA.")) { + _key = "BPA" + } + + /* key from application ie being used as consumer code in bill */ + const { searchFn, key, label } = refObj(tenantId, filters)[_key]; + const applications = useQuery(["applicationsForBillDetails", { tenantId, businessService, filters, searchFn }], searchFn, { + ...config, + }); + + return { ...applications, key, label }; +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useClickOutside.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useClickOutside.js new file mode 100644 index 0000000..dedb9c2 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useClickOutside.js @@ -0,0 +1,23 @@ +import { useEffect } from "react"; + +const useOnClickOutside = (ref, handler, isActive, eventParam = false) => { + useEffect(() => { + if (isActive) { + document.addEventListener("click", handleClickOutSide, eventParam); + } else { + document.removeEventListener("click", handleClickOutSide, eventParam); + } + return () => { + document.removeEventListener("click", handleClickOutSide, eventParam); + }; + }, [isActive]); + + const handleClickOutSide = (event) => { + if (ref.current && ref.current.contains(event.target)) { + return; + } + handler(event); + } +}; + +export default useOnClickOutside; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomAPIHook.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomAPIHook.js new file mode 100644 index 0000000..255dc57 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomAPIHook.js @@ -0,0 +1,55 @@ +import { useQuery, useQueryClient } from "react-query"; +import { CustomService } from "../services/elements/CustomService"; + +/** + * Custom hook which can make api call and format response + * + * @author jagankumar-egov + * + * + * @example + * + const requestCriteria = [ + "/user/_search", // API details + {}, //requestParam + {data : {uuid:[Useruuid]}}, // requestBody + {} , // privacy value + { // other configs + enabled: privacyState, + cacheTime: 100, + select: (data) => { + // format data + return _.get(data, loadData?.jsonPath, value); + }, + }, + ]; + const { isLoading, data, revalidate } = Digit.Hooks.useCustomAPIHook(...requestCriteria); + + * + * @returns {Object} Returns the object which contains data and isLoading flag + */ + + +const useCustomAPIHook = ({ url, params, body, config = {}, plainAccessRequest,changeQueryName="Random",options={} }) => { + const client = useQueryClient(); + const { isLoading, data, isFetching,refetch } = useQuery( + [url,changeQueryName].filter((e) => e), + () => CustomService.getResponse({ url, params, body, plainAccessRequest,...options }), + { + cacheTime:0, + ...config, + } + ); + + return { + isLoading, + isFetching, + data, + refetch, + revalidate: () => { + data && client.invalidateQueries({ queryKey: [url].filter((e) => e) }); + }, + }; +}; + +export default useCustomAPIHook; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomAPIMutationHook.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomAPIMutationHook.js new file mode 100644 index 0000000..6afcfe7 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomAPIMutationHook.js @@ -0,0 +1,68 @@ +import { useQueryClient, useMutation } from "react-query"; +import { CustomService } from "../services/elements/CustomService"; + +/** + * Custom hook which can make api call and format response + * + * @author jagankumar-egov + * + * + * @example + * + const requestCriteria = [ + "/user/_search", // API details + {}, //requestParam + {data : {uuid:[Useruuid]}}, // requestBody + {} , // privacy value + { // other configs + enabled: privacyState, + cacheTime: 100, + select: (data) => { + // format data + return _.get(data, loadData?.jsonPath, value); + }, + }, + ]; + const mutation = Digit.Hooks.useCustomAPIMutationHook(...requestCriteria); + + +while mutating use the following format + +mutation.mutate({ + params: {}, + body: { "payload": { + // custom data + } + }}, + { + onError : ()=> { // custom logic}, + onSuccess : ()=> { // custom logic} + } + ); + + * + * @returns {Object} Returns the object which contains data and isLoading flag + */ + +const useCustomAPIMutationHook = ({ url, params, body, config = {}, plainAccessRequest, changeQueryName = "Random" }) => { + const client = useQueryClient(); + + const { isLoading, data, isFetching, ...rest } = useMutation( + (data) => CustomService.getResponse({ url, params: { ...params, ...data?.params }, body: { ...body, ...data?.body }, plainAccessRequest }), + { + cacheTime: 0, + ...config, + } + ); + return { + ...rest, + isLoading, + isFetching, + data, + revalidate: () => { + data && client.invalidateQueries({ queryKey: [url].filter((e) => e) }); + }, + }; +}; + +export default useCustomAPIMutationHook; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomMDMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomMDMS.js new file mode 100644 index 0000000..875bd68 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomMDMS.js @@ -0,0 +1,63 @@ +import { useQuery } from "react-query"; +import { MdmsService } from "../services/elements/MDMS"; +import useCustomAPIHook from "./useCustomAPIHook"; +import Urls from "../services/atoms/urls"; +import _ from "lodash"; +/** + * Custom hook which can be used to + * make a single hook a module to get multiple masterdetails with/without filter + * + * @author jagankumar-egov + * + * @example + * // returns useQuery object + * Digit.Hooks.useCustomMDMS( + * "stateid", + * "modulename", + * [ + * { name:"masterdetail1",filter:"[?(@.active == true)]"}, + * { name:"masterdetail2" } + * ], + * { // all configs supported by the usequery + * default:(data)=>{ + * format + * return formattedData; + * } + * }) + * + * @returns {Object} Returns the object of the useQuery from react-query. + */ +const useCustomMDMS = (tenantId, moduleName, masterDetails = [], config = {},mdmsv2=false,) => { + if(mdmsv2) { + //here call the mdmsv2 api and return the options array + return useCustomAPIHook({ + url: Urls.MDMS_V2, + params:{}, + changeQueryName:`mdms-v2-dropdowns${mdmsv2?.schemaCode}`, + body:{ + MdmsCriteria:{ + // tenantId, //changing here to send user's tenantId always whether stateId or city + tenantId:Digit.ULBService.getCurrentTenantId(), + moduleDetails: [ + { + "moduleName": moduleName, + "masterDetails": masterDetails, + } + ] + } + }, + config:{ + enabled:mdmsv2 ? true : false , + select: (response) => { + //mdms will be an array of master data + + return response; + } + } + + }); + } + return useQuery([tenantId, moduleName, masterDetails], () => MdmsService.getMultipleTypesWithFilter(tenantId, moduleName, masterDetails), config); +}; + +export default useCustomMDMS; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useDocumentSearch.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useDocumentSearch.js new file mode 100644 index 0000000..e121f15 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useDocumentSearch.js @@ -0,0 +1,47 @@ +import { useQuery, useQueryClient } from "react-query"; +import PropTypes from "prop-types"; + + +const useDocumentSearch = (documents=[], config = {}) => { + const client = useQueryClient(); + const tenant = Digit.ULBService.getStateId(); + const filesArray = documents?.map((value) => value?.fileStoreId); + + const { isLoading, error, data } = useQuery([filesArray.join('')], () => Digit.UploadServices.Filefetch(filesArray, tenant),{enabled:filesArray&&filesArray.length>0, + /* It will return back the same document object with fileUrl link and response */ + select: (data) => { + return documents.map(document=>{ + return { + ...document, + fileURL:data?.data?.[document?.fileStoreId]&&Digit.Utils.getFileUrl(data.data[document?.fileStoreId]), + url:data?.data?.[document?.fileStoreId]&&Digit.Utils.getFileUrl(data.data[document?.fileStoreId]), + fileResponse:data?.data?.[document?.fileStoreId]||"" + } + }) + }, + ...config}); + return { isLoading, error, data: { pdfFiles: data }, revalidate: () => client.invalidateQueries([filesArray.join('')]) }; +}; + +/** + * Used to get the documents file url based on the given documents array + */ +export default useDocumentSearch; + + +useDocumentSearch.propTypes = { + /** + * document array for which we get file urls + */ + documents: PropTypes.array, + /** + * any config to use query + */ + config: PropTypes.object, +}; + +useDocumentSearch.defaultProps = { + documents: [], + config: {} +}; + diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useDynamicData.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useDynamicData.js new file mode 100644 index 0000000..64dc9eb --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useDynamicData.js @@ -0,0 +1,17 @@ +import { useQuery } from "react-query"; +import { endOfToday, start } from "date-fns"; + +import { format, subMonths } from "date-fns"; + +const useDynamicData = ({moduleCode ,tenantId, filters, t }) => { + + + switch(moduleCode){ + + default: + return {isLoading: false, error: false, data: null, isSuccess: false}; + } + + }; + +export default useDynamicData; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useEmployeeSearch.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useEmployeeSearch.js new file mode 100644 index 0000000..93651fc --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useEmployeeSearch.js @@ -0,0 +1,10 @@ +import { useQuery } from "react-query"; + +const useEmployeeSearch = (tenantId, filters, config = {}) => { + if (filters.roles) { + filters.roles = filters.roles.map((role) => role.code).join(","); + } + return useQuery(["EMPLOYEE_SEARCH", filters], () => Digit.UserService.employeeSearch(tenantId, filters), config); +}; + +export default useEmployeeSearch; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGenderMDMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGenderMDMS.js new file mode 100644 index 0000000..6eaa892 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGenderMDMS.js @@ -0,0 +1,18 @@ +import { useQuery } from "react-query"; +import { MdmsService } from "../services/elements/MDMS"; + +const useGenderMDMS = (tenantId, moduleCode, type, config = {}) => { + const useGenderDetails = () => { + return useQuery("GENDER_DETAILS", () => MdmsService.getGenderType(tenantId, moduleCode ,type), config); + }; + + + switch (type) { + case "GenderType": + return useGenderDetails(); + } +}; + + + +export default useGenderMDMS; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetDSSAboutJSON.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetDSSAboutJSON.js new file mode 100644 index 0000000..d9cac81 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetDSSAboutJSON.js @@ -0,0 +1,7 @@ +import { useQuery } from "react-query"; + +const useGetDSSAboutJSON = (tenantId) => { + return useQuery(["About", tenantId], () => Digit.MDMSService.getDSSAboutJSONData(tenantId)); + }; + +export default useGetDSSAboutJSON; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetDSSFAQsJSON.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetDSSFAQsJSON.js new file mode 100644 index 0000000..ae096a5 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetDSSFAQsJSON.js @@ -0,0 +1,7 @@ +import { useQuery } from "react-query"; + +const useGetDSSFAQsJSON = (tenantId) => { + return useQuery(["FAQS", tenantId], () => Digit.MDMSService.getDSSFAQsJSONData(tenantId)); + }; + +export default useGetDSSFAQsJSON; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetFAQsJSON.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetFAQsJSON.js new file mode 100644 index 0000000..7ea9d25 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetFAQsJSON.js @@ -0,0 +1,7 @@ +import { useQuery } from "react-query"; + +const useGetFAQsJSON = (tenantId) => { + return useQuery(["FAQ_S", tenantId], () => Digit.MDMSService.getFAQsJSONData(tenantId)); + }; + +export default useGetFAQsJSON; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useHowItWorksJSON.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useHowItWorksJSON.js new file mode 100644 index 0000000..2f20e69 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useHowItWorksJSON.js @@ -0,0 +1,7 @@ +import { useQuery } from "react-query"; + +const useGetHowItWorksJSON = (tenantId) => { + return useQuery(["HOW_IT_WORKS", tenantId], () => Digit.MDMSService.getHowItWorksJSONData(tenantId)); + }; + +export default useGetHowItWorksJSON; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInbox.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInbox.js new file mode 100644 index 0000000..2f6bed8 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInbox.js @@ -0,0 +1,11 @@ +import React from "react"; +import { useQuery } from "react-query"; +import { InboxGeneral } from "../services/elements/InboxService" + +const useInbox = ({tenantId, filters, config}) => useQuery( + ["INBOX_DATA",tenantId, ...Object.keys(filters)?.map( e => filters?.[e] )], + () => InboxGeneral.Search({inbox: {...filters}}), + { ...config } + ) + +export default useInbox; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/filterFn.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/filterFn.js new file mode 100644 index 0000000..7736e52 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/filterFn.js @@ -0,0 +1,108 @@ +export const filterFunctions = { + PT: (filtersArg) => { + let { uuid } = Digit.UserService.getUser()?.info || {}; + + const searchFilters = {}; + const workflowFilters = {}; + + const { propertyIds, mobileNumber, limit, offset, sortBy, sortOrder, total, applicationStatus, services } = filtersArg || {}; + + if (filtersArg?.acknowledgementIds) { + searchFilters.acknowledgementIds = filtersArg?.acknowledgementIds; + } + if (filtersArg?.propertyIds) { + searchFilters.propertyIds = propertyIds; + } + if (filtersArg?.oldpropertyids) { + searchFilters.oldpropertyids = filtersArg?.oldpropertyids; + } + if (applicationStatus && applicationStatus?.[0]) { + workflowFilters.applicationStatus = applicationStatus.map((status) => status.code).join(","); + } + if (filtersArg?.locality?.length) { + searchFilters.locality = filtersArg?.locality.map((item) => item.code.split("_").pop()).join(","); + } + + if (filtersArg?.locality?.code) { + searchFilters.locality = filtersArg?.locality?.code; + } + + if (filtersArg?.uuid && filtersArg?.uuid.code === "ASSIGNED_TO_ME") { + workflowFilters.assignee = uuid; + } + if (mobileNumber) { + searchFilters.mobileNumber = mobileNumber; + } + if (propertyIds) { + searchFilters.propertyIds = propertyIds; + } + if (sortBy) { + searchFilters.sortBy = sortBy; + } + if (sortOrder) { + searchFilters.sortOrder = sortOrder; + } + if (services) { + workflowFilters.businessServices = services.join(); + } + if (limit) { + searchFilters.limit = limit; + } + if (offset) { + searchFilters.offset = offset; + } + + return { searchFilters, workflowFilters }; + }, + TL: (filtersArg) => { + let { uuid } = Digit.UserService.getUser()?.info || {}; + + const searchFilters = {}; + const workflowFilters = {}; + + const { propertyIds, mobileNumber, limit, offset, sortBy, sortOrder, total, applicationStatus, services } = filtersArg || {}; + + if (filtersArg?.acknowledgementIds) { + searchFilters.acknowledgementIds = filtersArg?.acknowledgementIds; + } + if (filtersArg?.propertyIds) { + searchFilters.propertyIds = propertyIds; + } + if (filtersArg?.oldpropertyids) { + searchFilters.oldpropertyids = filtersArg?.oldpropertyids; + } + if (applicationStatus && applicationStatus?.[0]) { + workflowFilters.applicationStatus = applicationStatus.map((status) => status.code).join(","); + } + if (filtersArg?.locality?.length) { + searchFilters.locality = filtersArg?.locality.map((item) => item.code.split("_").pop()).join(","); + } + + if (filtersArg?.uuid && filtersArg?.uuid.code === "ASSIGNED_TO_ME") { + workflowFilters.assignee = uuid; + } + if (mobileNumber) { + searchFilters.mobileNumber = mobileNumber; + } + if (propertyIds) { + searchFilters.propertyIds = propertyIds; + } + if (sortBy) { + searchFilters.sortBy = sortBy; + } + if (sortOrder) { + searchFilters.sortOrder = sortOrder; + } + if (services) { + workflowFilters.businessServices = services.join(); + } + if (limit) { + searchFilters.limit = limit; + } + if (offset) { + searchFilters.offset = offset; + } + + return { searchFilters, workflowFilters }; + }, +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/newFilterFn.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/newFilterFn.js new file mode 100644 index 0000000..3324276 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/newFilterFn.js @@ -0,0 +1,52 @@ +export const filterFunctions = { + PT: (filtersArg) => { + let { uuid } = Digit.UserService.getUser()?.info || {}; + + const searchFilters = {}; + const workflowFilters = {}; + + const { propertyIds, mobileNumber, limit, offset, sortBy, sortOrder, total, applicationStatus, services } = filtersArg || {}; + + if (filtersArg?.acknowledgementIds) { + searchFilters.applicationNumber = filtersArg?.acknowledgementIds; + } + if (filtersArg?.propertyIds) { + searchFilters.propertyId = propertyIds; + } + if (filtersArg?.oldpropertyids) { + searchFilters.oldpropertyids = filtersArg?.oldpropertyids; + } + if (applicationStatus && applicationStatus?.[0]) { + workflowFilters.status = applicationStatus.map((status) => status.uuid); + if (applicationStatus?.some((e) => e.nonActionableRole)) { + searchFilters.fetchNonActionableRecords = true; + } + } + if (filtersArg?.locality?.length) { + searchFilters.locality = filtersArg?.locality.map((item) => item.code.split("_").pop()); + } + if (filtersArg?.uuid && filtersArg?.uuid.code === "ASSIGNED_TO_ME") { + workflowFilters.assignee = uuid; + } + if (mobileNumber) { + searchFilters.mobileNumber = mobileNumber; + } + if (services) { + workflowFilters.businessService = services; + } + searchFilters["isInboxSearch"] = true; + searchFilters["creationReason"] = ["CREATE", "MUTATION", "UPDATE"]; + workflowFilters["moduleName"] = "PT"; + + // if (limit) { + // searchFilters.limit = limit; + // } + // if (offset) { + // searchFilters.offset = offset; + // } + + // workflowFilters.businessService = "PT.CREATE"; + // searchFilters.mobileNumber = "9898568989"; + return { searchFilters, workflowFilters, limit, offset, sortBy, sortOrder }; + }, +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/searchFields.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/searchFields.js new file mode 100644 index 0000000..05cd3d1 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/searchFields.js @@ -0,0 +1,67 @@ +const inboxSearchFields = { + PT: [ + { + label: "PT_PROPERTY_APPLICATION_NO", + name: "acknowledgementIds", + roles: [], + }, + { + label: "ES_SEARCH_UNIQUE_PROPERTY_ID", + name: "propertyIds", + // minLength: "10", + roles: [], + }, + { + label: "ES_SEARCH_APPLICATION_MOBILE_NO", + name: "mobileNumber", + type: "mobileNumber", + maxLength: 10, + minLength: 0, + roles: [], + pattern: "^$|[6-9][0-9]{9}", + errorMessages: { + pattern: "", + minLength: "", + maxLength: "", + }, + }, + ], +}; + +const searchFieldsForSearch = { + PT: [ + { + label: "ES_INBOX_LOCALITY", + name: "locality", + type: "Locality", + isMendatory: true, + }, + { + label: "ES_INBOX_UNIQUE_PROPERTY_ID", + name: "propertyIds", + roles: [], + }, + { + label: "ES_SEARCH_EXISTING_PROPERTY_ID", + name: "oldpropertyids", + title: "ES_SEARCH_APPLICATION_MOBILE_INVALID", + roles: [], + }, + { + label: "ES_SEARCH_APPLICATION_MOBILE_NO", + name: "mobileNumber", + type: "mobileNumber", + maxLength: 10, + minLength: 0, + roles: [], + pattern: "^$|[6-9][0-9]{9}", + errorMessages: { + pattern: "", + minLength: "", + maxLength: "", + }, + }, + ], +}; + +export const getSearchFields = (isInbox) => (isInbox ? inboxSearchFields : searchFieldsForSearch); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/useInboxGeneral.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/useInboxGeneral.js new file mode 100644 index 0000000..c8c9b04 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/useInboxGeneral.js @@ -0,0 +1,148 @@ +import { useTranslation } from "react-i18next"; +import { useQuery, useQueryClient } from "react-query"; + +import { filterFunctions } from "./filterFn"; +import { getSearchFields } from "./searchFields"; + +const inboxConfig = (tenantId, filters) => ({ + +}); + +const defaultCombineResponse = ({ totalCount, ...d }, wf) => { + return { totalCount, searchData: { ...d }, workflowData: { ...wf } }; +}; + +const defaultRawSearchHandler = ({ totalCount, ...data }, searchKey, businessIdAlias) => { + return { [searchKey]: data[searchKey].map((e) => ({ totalCount, ...e })) }; +}; + +const defaultCatchSearch = (Err) => { + if ( + Err?.response?.data?.Errors?.some( + (e) => + e.code === "EG_PT_INVALID_SEARCH" && + e.message === " Search is not allowed on empty Criteria, Atleast one criteria should be provided with tenantId for EMPLOYEE" + ) + ) + return []; + throw Err; +}; + +/** + * + * @param {*} data + * @param {Array of Objects containing async or pure functions} middlewares + * @returns {object} + */ + +const callMiddlewares = async (data, middlewares) => { + let applyBreak = false; + let itr = -1; + let _break = () => (applyBreak = true); + let _next = async (data) => { + if (!applyBreak && ++itr < middlewares.length) { + let key = Object.keys(middlewares[itr])[0]; + let nextMiddleware = middlewares[itr][key]; + let isAsync = nextMiddleware.constructor.name === "AsyncFunction"; + if (isAsync) return await nextMiddleware(data, _break, _next); + else return nextMiddleware(data, _break, _next); + } else return data; + }; + let ret = await _next(data); + return ret || []; +}; + +const useInboxGeneral = ({ + tenantId, + businessService, + filters, + rawWfHandler = (d) => d, + rawSearchHandler = defaultRawSearchHandler, + combineResponse = defaultCombineResponse, + isInbox = true, + wfConfig = {}, + searchConfig = {}, + middlewaresWf = [], + middlewareSearch = [], + catchSearch = defaultCatchSearch, +}) => { + const client = useQueryClient(); + const { t } = useTranslation(); + + const { services, fetchFilters, searchResponseKey, businessIdAliasForSearch, businessIdsParamForSearch } = inboxConfig()[businessService]; + + let { workflowFilters, searchFilters } = fetchFilters(filters); + + const { data: processInstances, isFetching: wfFetching, isFetched, isSuccess: wfSuccess } = useQuery( + ["WORKFLOW_INBOX", businessService, workflowFilters], + () => + Digit.WorkflowService.getAllApplication(tenantId, { businessServices: services.join(), ...workflowFilters }) + .then(rawWfHandler) + .then((data) => callMiddlewares(data.ProcessInstances, middlewaresWf)), + { + enabled: isInbox, + select: (d) => { + return d; + }, + ...wfConfig, + } + ); + + const applicationNoFromWF = processInstances?.map((e) => e.businessId).join() || ""; + + if (isInbox && applicationNoFromWF && !searchFilters[businessIdAliasForSearch]) + searchFilters = { [businessIdsParamForSearch]: applicationNoFromWF, ...searchFilters }; + + const { _searchFn } = inboxConfig(tenantId, { ...searchFilters })[businessService]; + + /** + * Convert Wf Array to Object + */ + + const processInstanceBuisnessIdMap = processInstances?.reduce((object, item) => { + return { ...object, [item?.["businessId"]]: item }; + }, {}); + + const allowSearch = isInbox ? isFetched && wfSuccess && !!searchFilters[businessIdsParamForSearch] : true; + + const searchResult = useQuery( + ["SEARCH_INBOX", businessService, searchFilters, workflowFilters, isInbox], + () => { + if (allowSearch) + return _searchFn() + .then((d) => rawSearchHandler(d, searchResponseKey, businessIdAliasForSearch)) + .then((data) => callMiddlewares(data[searchResponseKey], middlewareSearch)) + .catch(catchSearch); + }, + { + enabled: allowSearch, + select: (d) => { + return d.map((searchResult) => ({ + totalCount: d.totalCount, + ...combineResponse(searchResult, processInstanceBuisnessIdMap?.[searchResult?.[businessIdAliasForSearch]]), + })); + }, + ...searchConfig, + } + ); + + const revalidate = () => { + client.refetchQueries(["WORKFLOW_INBOX"]); + client.refetchQueries(["SEARCH_INBOX"]); + }; + + client.setQueryData(`FUNCTION_RESET_INBOX_${businessService}`, { revalidate }); + + return { + ...searchResult, + revalidate, + searchResponseKey, + businessIdsParamForSearch, + businessIdAliasForSearch, + + searchFields: getSearchFields(isInbox)[businessService], + wfFetching, + }; +}; + +export default useInboxGeneral; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/useNewInbox.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/useNewInbox.js new file mode 100644 index 0000000..71e31c0 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/useNewInbox.js @@ -0,0 +1,76 @@ +import { useTranslation } from "react-i18next"; +import { useQuery, useQueryClient } from "react-query"; + +import { filterFunctions } from "./newFilterFn"; +import { getSearchFields } from "./searchFields"; +import { InboxGeneral } from "../../services/elements/InboxService"; + +const inboxConfig = (tenantId, filters) => ({ + +}); + +const callMiddlewares = async (data, middlewares) => { + let applyBreak = false; + let itr = -1; + let _break = () => (applyBreak = true); + let _next = async (data) => { + if (!applyBreak && ++itr < middlewares.length) { + let key = Object.keys(middlewares[itr])[0]; + let nextMiddleware = middlewares[itr][key]; + let isAsync = nextMiddleware.constructor.name === "AsyncFunction"; + if (isAsync) return await nextMiddleware(data, _break, _next); + else return nextMiddleware(data, _break, _next); + } else return data; + }; + let ret = await _next(data); + return ret || []; +}; + +const useNewInboxGeneral = ({ tenantId, ModuleCode, filters, middleware = [], config = {} }) => { + const client = useQueryClient(); + const { t } = useTranslation(); + const { fetchFilters, searchResponseKey, businessIdAliasForSearch, businessIdsParamForSearch } = inboxConfig()[ModuleCode]; + let { workflowFilters, searchFilters, limit, offset, sortBy, sortOrder } = fetchFilters(filters); + + const query = useQuery( + ["INBOX", workflowFilters, searchFilters, ModuleCode, limit, offset, sortBy, sortOrder], + () => + InboxGeneral.Search({ + inbox: { tenantId, processSearchCriteria: workflowFilters, moduleSearchCriteria: { ...searchFilters, sortBy, sortOrder }, limit, offset }, + }), + { + select: (data) => { + const { statusMap, totalCount } = data; + // client.setQueryData(`INBOX_STATUS_MAP_${ModuleCode}`, (oldStatusMap) => { + // if (!oldStatusMap) return statusMap; + // else return [...oldStatusMap.filter((e) => statusMap.some((f) => f.stateId === e.stateId))]; + // }); + + client.setQueryData(`INBOX_STATUS_MAP_${ModuleCode}`, statusMap); + + if (data.items.length) { + return data.items?.map((obj) => ({ + searchData: obj.businessObject, + workflowData: obj.ProcessInstance, + statusMap, + totalCount, + })); + } else { + return [{ statusMap, totalCount, dataEmpty: true }]; + } + }, + retry: false, + ...config, + } + ); + + return { + ...query, + searchResponseKey, + businessIdsParamForSearch, + businessIdAliasForSearch, + searchFields: getSearchFields(true)[ModuleCode], + }; +}; + +export default useNewInboxGeneral; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useLocalities.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useLocalities.js new file mode 100644 index 0000000..8c550eb --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useLocalities.js @@ -0,0 +1,17 @@ +import { useQuery } from "react-query"; +import { getLocalities } from "../services/molecules/getLocalities"; +import { LocalityService } from "../services/elements/Localities"; + +const useLocalities = (tenant, boundaryType = "admin", config, t) => { + return useQuery(["BOUNDARY_DATA", tenant, boundaryType], () => getLocalities[boundaryType.toLowerCase()](tenant), { + select: (data) => { + return LocalityService.get(data).map((key) => { + return { ...key, i18nkey: t(key.i18nkey) }; + }); + }, + staleTime: Infinity, + ...config, + }); +}; + +export default useLocalities; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useLocation.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useLocation.js new file mode 100644 index 0000000..0e5cfa3 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useLocation.js @@ -0,0 +1,15 @@ +import { useQuery } from 'react-query'; +import { LocationService } from "../services/elements/Location"; + +const useLocation = (tenantId, locationType, config = {}) => { + switch(locationType) { + case 'Locality': + return useQuery(["LOCALITY_DETAILS", tenantId ], () => LocationService.getLocalities(tenantId), config); + case 'Ward': + return useQuery(["WARD_DETAILS", tenantId ], () => LocationService.getWards(tenantId), config); + default: + break + } +} + +export default useLocation; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useMDMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useMDMS.js new file mode 100644 index 0000000..ec3579d --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useMDMS.js @@ -0,0 +1,44 @@ +import { MdmsService } from "../services/elements/MDMS"; +import { useQuery } from "react-query"; + +const useMDMS = (tenantId, moduleCode, type, config = {}, payload = []) => { + const usePaymentGateway = () => { + return useQuery("PAYMENT_GATEWAY", () => MdmsService.getPaymentGateway(tenantId, moduleCode, type), { + select: (data) => { + return data?.[moduleCode]?.[type].filter((e) => e.active).map(({ gateway }) => gateway); + }, + ...config, + }); + }; + + const useReceiptKey = () => { + return useQuery("RECEIPT_KEY", () => MdmsService.getReceiptKey(tenantId, moduleCode, type), config); + }; + + const useBillsGenieKey = () => { + return useQuery("BILLS_GENIE_KEY", () => MdmsService.getBillsGenieKey(tenantId, moduleCode, type), config); + }; + + const useFSTPPlantInfo = () => { + return useQuery("FSTP_PLANTINFO", () => MdmsService.getFSTPPlantInfo(tenantId, moduleCode, type), config); + }; + + const _default = () => { + return useQuery([tenantId, moduleCode, type], () => MdmsService.getMultipleTypes(tenantId, moduleCode, type), config); + }; + + switch (type) { + case "PaymentGateway": + return usePaymentGateway(); + case "ReceiptKey": + return useReceiptKey(); + case "FSTPPlantInfo": + return useFSTPPlantInfo(); + case "BillsGenieKey": + return useBillsGenieKey(); + default: + return _default(); + } +}; + +export default useMDMS; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useModuleTenants.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useModuleTenants.js new file mode 100644 index 0000000..25e51a9 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useModuleTenants.js @@ -0,0 +1,39 @@ +import React from "react"; +import { useQuery } from "react-query"; +import { useTranslation } from "react-i18next"; + +const useModuleTenants = (module, config = {}) => { + const { t } = useTranslation(); + + return useQuery(["ULB_TENANTS", module], () => Digit.SessionStorage.get("initData"), { + select: (data) => ({ + ddr: data.modules + .find((e) => e.module === module) + .tenants.map((tenant) => ({ + ...tenant, + ulbKey: t(`TENANT_TENANTS_${tenant?.code?.toUpperCase?.()?.replace(".", "_")}`), + ddrKey: t( + `DDR_${data.tenants + .filter((t) => t.code === tenant.code)?.[0] + .city?.districtTenantCode?.toUpperCase?.() + .replace(".", "_")}` + ), + })) + .filter((item, i, arr) => i === arr.findIndex((t) => t.ddrKey === item.ddrKey)), + ulb: data.modules + .find((e) => e.module === module) + .tenants.map((tenant) => ({ + ...tenant, + ulbKey: t(`TENANT_TENANTS_${tenant?.code?.toUpperCase?.()?.replace(".", "_")}`), + ddrKey: t( + `DDR_${data.tenants + .filter((t) => t.code === tenant.code)?.[0] + .city?.districtTenantCode?.toUpperCase?.() + .replace(".", "_")}` + ), + })), + }), + ...config, + }); +}; +export default useModuleTenants; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/usePrivacyContext.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/usePrivacyContext.js new file mode 100644 index 0000000..fea0afd --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/usePrivacyContext.js @@ -0,0 +1,18 @@ +import React, { useContext } from "react"; + +/** + * Custom hook which can gives the privacy functions to access + * + * @author jagankumar-egov + * + * Feature :: Privacy + * + * @example + * const { privacy , updatePrivacy } = Digit.Hooks.usePrivacyContext() + * + * @returns {Object} Returns the object which contains privacy value and updatePrivacy method + */ +export const usePrivacyContext = () => { + const { privacy, updatePrivacy, ...rest } = useContext(Digit.Contexts.PrivacyProvider); + return { privacy, updatePrivacy, ...rest }; +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useQueryParams.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useQueryParams.js new file mode 100644 index 0000000..b4275c4 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useQueryParams.js @@ -0,0 +1,11 @@ +const useQueryParams = () => { + const queryString = window.location.search; + const urlParams = new URLSearchParams(queryString); + const params = {}; + urlParams.forEach((value, key) => { + params[key] = value; + }); + return params; +}; + +export default useQueryParams; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useRouteSubscription.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useRouteSubscription.js new file mode 100644 index 0000000..dd586b5 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useRouteSubscription.js @@ -0,0 +1,17 @@ +import React, { useEffect, useState } from "react"; + +const useRouteSubscription = (pathname) => { + const [classname, setClassname] = useState("citizen"); + useEffect(() => { + const isEmployeeUrl = Digit.Utils.detectDsoRoute(pathname); + if (isEmployeeUrl && classname === "citizen") { + setClassname("employee"); + } else if (!isEmployeeUrl && classname === "employee") { + setClassname("citizen"); + } + }, [pathname]); + + return classname; +}; + +export default useRouteSubscription; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useSessionStorage.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useSessionStorage.js new file mode 100644 index 0000000..b686037 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useSessionStorage.js @@ -0,0 +1,30 @@ +import { useState } from "react"; + +const useSessionStorage = (key, initialValue) => { + const [storedValue, setStoredValue] = useState(() => { + try { + const data = Digit.SessionStorage.get(key); + return data ? data : initialValue; + } catch (err) { + return initialValue; + } + }); + + const setValue = (value) => { + try { + const valueToStore = value instanceof Function ? value(storedValue) : value; + setStoredValue(valueToStore); + Digit.SessionStorage.set(key, valueToStore); + } catch (err) { + } + }; + + const clearValue = () => { + setStoredValue(initialValue); + Digit.SessionStorage.set(key, initialValue); + }; + + return [storedValue, setValue, clearValue]; +}; + +export default useSessionStorage; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStaticData.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStaticData.js new file mode 100644 index 0000000..f777480 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStaticData.js @@ -0,0 +1,7 @@ +import { useQuery } from "react-query"; + +const useStaticData = (tenantId) => { + return useQuery(["MODULE_LEVEL_HOME_PAGE_STATIC_DATA", tenantId], () => Digit.MDMSService.getStaticDataJSON(tenantId)); + }; + +export default useStaticData; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStatusGeneral.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStatusGeneral.js new file mode 100644 index 0000000..aff17dc --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStatusGeneral.js @@ -0,0 +1,42 @@ +import { useQuery } from "react-query"; + +const useApplicationStatusGeneral = ({ businessServices = [], tenantId }, config) => { + tenantId = tenantId || Digit.ULBService.getCurrentTenantId(); + + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo.info.roles.map((roleData) => roleData.code); + + const fetch = async () => + await Digit.WorkflowService.init(tenantId, businessServices.join()).then((res) => { + const { BusinessServices: data } = res; + return data; + }); + + const select = (data) => { + let states = []; + const filteredData = data.filter((e) => businessServices.includes(e.businessService)); + filteredData.forEach((service) => { + states = [...states, ...service.states.map((e) => ({ ...e, stateBusinessService: service.businessService }))]; + }); + + const addRoleToState = (state) => { + const roles = state.actions?.map((act) => act.roles).flat(); + return { ...state, roles }; + }; + + const roleStateMapArray = states?.map(addRoleToState).filter((e) => !!e.state); + + const userRoleStates = roleStateMapArray.filter(({ roles }) => roles?.some((role) => userRoles.includes(role))); + const otherRoleStates = roleStateMapArray + .filter(({ roles }) => !roles?.some((role) => userRoles.includes(role))) + .map((e) => ({ ...e, nonActionableRole: true })); + + return { userRoleStates, otherRoleStates }; + }; + + const queryData = useQuery(["workflow_states", tenantId, ...businessServices], () => fetch(), { select, ...config }); + + return queryData; +}; + +export default useApplicationStatusGeneral; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStore.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStore.js new file mode 100644 index 0000000..27d4ccc --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStore.js @@ -0,0 +1,11 @@ +import { useQuery } from "react-query"; +import StoreData from "../services/molecules/StoreData"; + +const useStore = { + getInitData: () => + useQuery(["STORE_DATA"], () => StoreData.getInitData(), { + staleTime: Infinity, + }), +}; + +export default useStore; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useTenants.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useTenants.js new file mode 100644 index 0000000..c3e8acd --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useTenants.js @@ -0,0 +1,13 @@ +import { useQuery } from "react-query"; + +const alphabeticalSortFunctionForTenantsBasedOnName = (firstEl, secondEl) =>{ + if (firstEl.name.toUpperCase() < secondEl.name.toUpperCase() ) { + return -1 + } + if (firstEl.name.toUpperCase() > secondEl.name.toUpperCase() ) { + return 1 + } + return 0 +} + +export const useTenants = () => useQuery(["ALL_TENANTS"], () => Digit.SessionStorage.get("initData").tenants.sort(alphabeticalSortFunctionForTenantsBasedOnName)) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useUpdateCustom.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useUpdateCustom.js new file mode 100644 index 0000000..83c298b --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useUpdateCustom.js @@ -0,0 +1,17 @@ +import { useMutation } from "react-query"; +import ApplicationUpdateActionsCustom from "../services/elements/ApplicationUpdateActionsCustom"; + +/** + * Custom hook which can make api call to update API of any module + * + * @author nipunarora-eGov + * + * returns data from update api call + */ + + +const useUpdateCustom = ( url ) => { + return useMutation((applicationData) => ApplicationUpdateActionsCustom({url,body:applicationData})); +}; + +export default useUpdateCustom; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useWorkflowDetailsV2.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useWorkflowDetailsV2.js new file mode 100644 index 0000000..d6388d3 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useWorkflowDetailsV2.js @@ -0,0 +1,19 @@ +import { useQuery, useQueryClient } from "react-query"; + +const useWorkflowDetailsV2 = ({ tenantId, id, moduleCode, role = "CITIZEN", serviceData = {}, getStaleData, getTripData = false, config }) => { + const queryClient = useQueryClient(); + + const staleDataConfig = { staleTime: Infinity }; + + const { isLoading, error, isError, data } = useQuery( + ["workFlowDetailsWorks", tenantId, id, moduleCode, role, config], + () => Digit.WorkflowService.getDetailsByIdV2({ tenantId, id, moduleCode, role, getTripData }), + getStaleData ? { ...staleDataConfig, ...config } : config + ); + + if (getStaleData) return { isLoading, error, isError, data }; + + return { isLoading, error, isError, data, revalidate: () => queryClient.invalidateQueries(["workFlowDetailsWorks", tenantId, id, moduleCode, role]) }; +}; + +export default useWorkflowDetailsV2; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/userSearch.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/userSearch.js new file mode 100644 index 0000000..0506a95 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/userSearch.js @@ -0,0 +1,8 @@ +import { useQuery, useQueryClient } from "react-query"; +import { UserService } from "../services/elements/User"; + +export const useUserSearch = (tenantId, data, filters, options = {}) => { + const client = useQueryClient(); + const queryData = useQuery(["USER_SEARCH", filters, data], () => UserService.userSearch(tenantId, data, filters), options); + return { ...queryData, revalidate: () => client.invalidateQueries(["USER_SEARCH", filters, data]) }; +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/workflow.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/workflow.js new file mode 100644 index 0000000..2549ed5 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/workflow.js @@ -0,0 +1,19 @@ +import { useQuery, useQueryClient } from "react-query"; + +const useWorkflowDetails = ({ tenantId, id, moduleCode, role = "CITIZEN", serviceData = {}, getStaleData, getTripData = false,config }) => { + const queryClient = useQueryClient(); + + const staleDataConfig = { staleTime: Infinity }; + + const { isLoading, error, isError, data } = useQuery( + ["workFlowDetails", tenantId, id, moduleCode, role, config], + () => Digit.WorkflowService.getDetailsById({ tenantId, id, moduleCode, role, getTripData }), + getStaleData ? { ...staleDataConfig, ...config } : config + ); + + if (getStaleData) return { isLoading, error, isError, data }; + + return { isLoading, error, isError, data, revalidate: () => queryClient.invalidateQueries(["workFlowDetails", tenantId, id, moduleCode, role]) }; +}; + +export default useWorkflowDetails; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/index.js new file mode 100644 index 0000000..1a1b885 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/index.js @@ -0,0 +1,91 @@ +import i18next from "i18next"; +import Enums from "./enums/index"; +import mergeConfig from "./config/mergeConfig"; +import { useStore } from "./services/index"; +import { initI18n } from "./translations/index"; +import { Request } from "./services/atoms/Utils/Request"; + +import { Storage, PersistantStorage } from "./services/atoms/Utils/Storage"; +import { UploadServices } from "./services/atoms/UploadServices"; +import JsDictionary from "./services/atoms/JsDictionary"; + +import { LocationService } from "./services/elements/Location"; +import { LocalityService } from "./services/elements/Localities"; +import { CustomService } from "./services/elements/CustomService"; +import { LocalizationService } from "./services/elements/Localization/service"; +import { LoginService } from "./services/elements/Login"; +import { PGRService } from "./services/elements/PGR"; +import { PaymentService } from "./services/elements/Payment"; +import * as dateUtils from "./services/atoms/Utils/Date"; +import Download from "./services/atoms/Download"; +import { WorkflowService } from "./services/elements/WorkFlow"; +import { MdmsService } from "./services/elements/MDMS"; +import { Complaint } from "./services/elements/Complaint"; +import { UserService } from "./services/elements/User"; +import HrmsService from "./services/elements/HRMS"; +import { InboxGeneral } from "./services/elements/InboxService"; +import EventsServices from "./services/elements/Events"; + + +import ShareFiles from "./services/molecules/ShareFiles"; +import { GetServiceDefinitions } from "./services/molecules/ServiceDefinitions"; +import { ULBService } from "./services/molecules/Ulb"; +import { ComponentRegistryService } from "./services/elements/ComponentRegistry"; +import StoreData from "./services/molecules/StoreData"; + +import Contexts from "./contexts"; +import Hooks from "./hooks"; +import Utils from "./utils"; +import { subFormRegistry } from "./subFormRegistry"; +import AccessControlService from "./services/elements/Access"; + +const setupLibraries = (Library, props) => { + window.Digit = window.Digit || {}; + window.Digit[Library] = window.Digit[Library] || {}; + window.Digit[Library] = { ...window.Digit[Library], ...props }; +}; + +const initLibraries = () => { + setupLibraries("SessionStorage", Storage); + setupLibraries("PersistantStorage", PersistantStorage); + setupLibraries("UserService", UserService); + setupLibraries("ULBService", ULBService); + + setupLibraries("Config", { mergeConfig }); + setupLibraries("Services", { useStore }); + setupLibraries("Enums", Enums); + setupLibraries("LocationService", LocationService); + setupLibraries("CustomService",CustomService) + setupLibraries("LocalityService", LocalityService); + setupLibraries("LoginService", LoginService); + setupLibraries("LocalizationService", LocalizationService); + setupLibraries("PGRService", PGRService); + setupLibraries("HRMSService", HrmsService); + setupLibraries("PaymentService", PaymentService); + setupLibraries("DateUtils", dateUtils); + setupLibraries("WorkflowService", WorkflowService); + setupLibraries("MDMSService", MdmsService); + setupLibraries("UploadServices", UploadServices); + setupLibraries("JsDictionary", JsDictionary); + setupLibraries("GetServiceDefinitions", GetServiceDefinitions); + setupLibraries("Complaint", Complaint); + setupLibraries("ComponentRegistryService", ComponentRegistryService); + setupLibraries("StoreData", StoreData); + setupLibraries("EventsServices", EventsServices); + + setupLibraries("InboxGeneral", InboxGeneral); + setupLibraries("ShareFiles", ShareFiles); + setupLibraries("Contexts", Contexts); + setupLibraries("Hooks", Hooks); + setupLibraries("Customizations", {}); + setupLibraries("Utils", Utils); + setupLibraries("Download", Download); + + setupLibraries("AccessControlService", AccessControlService); + + return new Promise((resolve) => { + initI18n(resolve); + }); +}; + +export { initLibraries, Enums, Hooks, subFormRegistry ,Request}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/ApiCacheService.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/ApiCacheService.js new file mode 100644 index 0000000..96613e9 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/ApiCacheService.js @@ -0,0 +1,75 @@ +import { PersistantStorage } from "./Utils/Storage"; + +const defaultApiCachingSettings = [ + { + serviceName: "localization", + cacheTimeInSecs: 86400, + }, + { + serviceName: "access/v1/actions", + cacheTimeInSecs: 86400, + }, + { + serviceName: "user/_search", + cacheTimeInSecs: 86400, + }, + { + serviceName: "egov-mdms-service", + cacheTimeInSecs: 3600, + debounceTimeInMS: 100, + moduleSettings: [ + { + moduleName: "FSM", + cacheTimeInSecs: 7200, + }, + ], + }, + { + serviceName: "mdms-v2", + cacheTimeInSecs: 3600, + debounceTimeInMS: 100, + moduleSettings: [ + { + moduleName: "FSM", + cacheTimeInSecs: 7200, + }, + ], + }, +]; + +const storageKey = "cachingService"; +const getCachedSetting = () => { + if (Digit.ApiCacheSetting) { + return Digit.ApiCacheSetting; + } + const setting = PersistantStorage.get(storageKey) || defaultApiCachingSettings; + Digit.ApiCacheSetting = setting; + return setting; +}; +const getSetting = (serviceName, moduleName) => { + const setting = getCachedSetting(); + const serviceSetting = setting.find((item) => item.serviceName === serviceName); + const responseSetting = { + cacheTimeInSecs: serviceSetting.cacheTimeInSecs, + debounceTimeInMS: serviceSetting.debounceTimeInMS || 100, + }; + if (!moduleName) { + return responseSetting; + } + const moduleSettings = serviceSetting?.moduleSettings?.find((item) => item.moduleName === moduleName); + if (!moduleSettings) { + return responseSetting; + } + return { + cacheTimeInSecs: moduleSettings.cacheTimeInSecs || responseSetting.cacheTimeInSecs, + debounceTimeInMS: moduleSettings.debounceTimeInMS || responseSetting.debounceTimeInMS, + }; +}; +export const ApiCacheService = { + saveSetting: (setting) => { + PersistantStorage.set(storageKey, setting || defaultApiCachingSettings); + }, + getSettingByServiceUrl: (serviceUrl, moduleName) => { + return getSetting(serviceUrl.split("/")[1], moduleName); + }, +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Download.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Download.js new file mode 100644 index 0000000..9e044c4 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Download.js @@ -0,0 +1,208 @@ +import ReactDOM from "react-dom"; +import html2canvas from "html2canvas"; +import XLSX from "xlsx"; +import domtoimage from "dom-to-image"; + +const changeClasses=(class1,class2)=>{ + var elements = document.getElementsByClassName(class1) + Array.prototype.map.call(elements, function(testElement){ + testElement.classList.add(class2); + testElement.classList.remove(class1); + }); +} + +const revertCss=()=>{ + changeClasses("dss-white-pre-temp",'dss-white-pre-line'); +} + +const applyCss=()=>{ + changeClasses('dss-white-pre-line',"dss-white-pre-temp"); +} + +const Download = { + Image: (node, fileName, share, resolve = null) => { + const saveAs = (uri, filename) => { + const link = document.createElement("a"); + + if (typeof link.download === "string") { + link.href = uri; + link.download = filename; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } else { + window.open(uri); + } + }; + + const element = ReactDOM.findDOMNode(node.current); + html2canvas(element, { + scrollY: -window.scrollY, + scrollX: 0, + useCORS: true, + scale: 1.5, + }).then((canvas) => { + return share + ? canvas.toBlob((blob) => resolve(new File([blob], `${fileName}.jpeg`, { type: "image/jpeg" })), "image/jpeg", 1) + : saveAs(canvas.toDataURL("image/jpeg", 1), `${fileName}.jpeg`); + }); + }, + + Excel: (data, filename) => { + const file = filename.substring(0,30); + const wb = XLSX.utils.book_new(); + let ws = null; + ws = XLSX.utils.json_to_sheet(data) + wb.SheetNames.push(file); + wb.Sheets[file] = ws; + XLSX.writeFile(wb, `${file}.xlsx`); + }, + + PDF: (node, fileName, share, resolve = null) => { + + + + const saveAs = (uri, filename) => { + if(window.mSewaApp && window.mSewaApp.isMsewaApp()){ + window.mSewaApp.downloadBase64File(uri, filename); + } + const link = document.createElement("a"); + + if (typeof link.download === "string") { + link.href = uri; + link.download = filename; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } else { + window.open(uri); + } + }; + const dataURItoBlob = (dataURI) => { + var binary = atob(dataURI.split(',')[1]); + var array = []; + for (var i = 0; i < binary.length; i++) { + array.push(binary.charCodeAt(i)); + } + return new Blob([new Uint8Array(array)], { type: 'image/jpeg' }); + }; + changeClasses('dss-white-pre-line',"dss-white-pre-temp"); + + applyCss(); + const element = ReactDOM.findDOMNode(node.current); + + + return domtoimage.toJpeg(element, { + quality: 1, + bgcolor: 'white', + filter:node=>!node?.className?.includes?.("divToBeHidden"), + style:{ + margin:'25px' + } + }).then(function (dataUrl) { +/* to enable pdf + var htmlImage = new Image(); + htmlImage.src = dataUrl; + var pdf = new jsPDF( 'l', 'pt', [element.offsetWidth, element.offsetHeight] ); + pdf.setFontStyle?.("Bold"); + pdf.setFontSize?.(30); + pdf.text?.(325, 40, 'Certificate'); + // e(imageData, format, x, y, width, height, alias, compression, rotation) + pdf.addImage?.( htmlImage, 25, 50, 50, element.offsetWidth, element.offsetHeight ); + pdf.save?.( fileName +'.pdf' ); + */ + changeClasses("dss-white-pre-temp",'dss-white-pre-line'); + + revertCss(); + var blobData = dataURItoBlob(dataUrl); + revertCss(); + return share + ? resolve(new File([blobData], `${fileName}.jpeg`, { type: "image/jpeg" })) + : saveAs(dataUrl, `${fileName}.jpeg`) + }); + + + /* + const getPDF = (canvas) => { + const width = canvas.width; + const height = canvas.height; + const o = width > height ? "l" : "p"; + const format = "a4"; + + return new jsPDF(o, "mm", format); + }; + + const element = ReactDOM.findDOMNode(node.current); + return html2canvas(element, { + scrollY: -window.scrollY, + scrollX: 0, + useCORS: true, + scale: 1.5, + windowWidth: document.documentElement.offsetWidth, + windowHeight: document.documentElement.offsetHeight, + }).then((canvas) => { + const pdf = getPDF(canvas); + const jpegImage = canvas.toDataURL("image/jpeg"); + const imgProps = pdf.getImageProperties(jpegImage); + const margin = 0.1; + const pageHeight = 295; + // const pdfWidth = pdf.internal.pageSize.width * (1 - margin); + const pdfWidth = (imgProps.width * pageHeight) / (imgProps.height * 1.2) + const pdfHeight = (imgProps.height * pdfWidth) / imgProps.width; + const x = (pdf.internal.pageSize.width - pdfWidth) / 2; + let position = 5; + // let heightLeft = pdfHeight; + pdf.addImage(jpegImage, "JPEG", x, position, pdfWidth, pdfHeight, "a", "FAST"); + // heightLeft -= pageHeight; + // while (heightLeft > 0) { + // position += heightLeft - pdfHeight; + // pdf.addPage(); + // pdf.addImage(jpegImage, "JPEG", x, position, pdfWidth, pdfHeight, "a", "FAST"); + // heightLeft -= pageHeight; + // } + return share ? new File([pdf.output("blob")], `${fileName}.pdf`, { type: "application/pdf" }) : pdf.save(`${fileName}.pdf`); + }); + */ + }, + + IndividualChartImage: (node, fileName, share, resolve = null) => { + const saveAs = (uri, filename) => { + if(window.mSewaApp && window.mSewaApp.isMsewaApp()){ + window.mSewaApp.downloadBase64File(uri, filename); + } + const link = document.createElement("a"); + + if (typeof link.download === "string") { + link.href = uri; + link.download = filename; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } else { + window.open(uri); + } + }; + const dataURItoBlob = (dataURI) => { + var binary = atob(dataURI.split(',')[1]); + var array = []; + for (var i = 0; i < binary.length; i++) { + array.push(binary.charCodeAt(i)); + } + return new Blob([new Uint8Array(array)], { type: 'image/jpeg' }); + }; + changeClasses('dss-white-pre-line',"dss-white-pre-temp"); + const element = ReactDOM.findDOMNode(node.current); + return domtoimage.toJpeg(element, { + quality: 1, + bgcolor: 'white' + }).then(function (dataUrl) { + var blobData = dataURItoBlob(dataUrl); + changeClasses("dss-white-pre-temp",'dss-white-pre-line'); + return share + ? resolve(new File([blobData], `${fileName}.jpeg`, { type: "image/jpeg" })) + : saveAs(dataUrl, `${fileName}.jpeg`) + }); + + }, +}; +export default Download; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/JsDictionary.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/JsDictionary.js new file mode 100644 index 0000000..45d3a34 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/JsDictionary.js @@ -0,0 +1,24 @@ +class JsDictionary { + constructor(defaultFiller){ + this.defaultFiller = defaultFiller || [] + // [["key1", "valu1"],["key2", "value2"]] + } + + set(key, value){ + const __mutatedMap = this.defaultFiller.push([key, value]) + return __mutatedMap + } + + get(){ + + } + + delete(key){ + const __indexofKeyToDelete = this.defaultFiller.findIndex( e => e[0] === key ) + const __mutatedMap = this.defaultFiller.splice(__indexofKeyToDelete, 1) + return __mutatedMap + } + +} + +export default new JsDictionary([]) \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/UploadServices.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/UploadServices.js new file mode 100644 index 0000000..493b743 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/UploadServices.js @@ -0,0 +1,51 @@ +import Axios from "axios"; +import Urls from "./urls"; +export const UploadServices = { + Filestorage: async (module, filedata, tenantId) => { + const formData = new FormData(); + + formData.append("file", filedata, filedata.name); + formData.append("tenantId", tenantId); + formData.append("module", module); + let tenantInfo=window?.globalConfigs?.getConfig("ENABLE_SINGLEINSTANCE")?`?tenantId=${tenantId}`:""; + var config = { + method: "post", + url:`${Urls.FileStore}${tenantInfo}`, + data: formData, + headers: { "auth-token": Digit.UserService.getUser() ? Digit.UserService.getUser()?.access_token : null}, + }; + + return Axios(config); + }, + + MultipleFilesStorage: async (module, filesData, tenantId) => { + const formData = new FormData(); + const filesArray = Array.from(filesData) + filesArray?.forEach((fileData, index) => fileData ? formData.append("file", fileData, fileData.name) : null); + formData.append("tenantId", tenantId); + formData.append("module", module); + let tenantInfo=window?.globalConfigs?.getConfig("ENABLE_SINGLEINSTANCE")?`?tenantId=${tenantId}`:""; + var config = { + method: "post", + url:`${Urls.FileStore}${tenantInfo}`, + data: formData, + headers: { 'Content-Type': 'multipart/form-data',"auth-token": Digit.UserService.getUser().access_token }, + }; + + return Axios(config); + }, + + Filefetch: async (filesArray, tenantId) => { + let tenantInfo=window?.globalConfigs?.getConfig("ENABLE_SINGLEINSTANCE")?`?tenantId=${tenantId}`:""; + var config = { + method: "get", + url:`${Urls.FileFetch}${tenantInfo}`, + params: { + tenantId: tenantId, + fileStoreIds: filesArray?.join(","), + }, + }; + const res = await Axios(config); + return res; + }, +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Date.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Date.js new file mode 100644 index 0000000..3b3cfc5 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Date.js @@ -0,0 +1,39 @@ +import { format, toDate } from "date-fns"; + +export const ConvertTimestampToDate = (timestamp, dateFormat = "d-MMM-yyyy") => { + return timestamp ? format(toDate(timestamp), dateFormat) : null; +}; + +export const ConvertEpochToDate = (dateEpoch) => { + if (dateEpoch == null || dateEpoch == undefined || dateEpoch == "") { + return "NA"; + } + const dateFromApi = new Date(dateEpoch); + let month = dateFromApi.getMonth() + 1; + let day = dateFromApi.getDate(); + let year = dateFromApi.getFullYear(); + month = (month > 9 ? "" : "0") + month; + day = (day > 9 ? "" : "0") + day; + return `${day}/${month}/${year}`; +}; + +export const ConvertEpochToTimeInHours = (dateEpoch) => { + if (dateEpoch == null || dateEpoch == undefined || dateEpoch == "") { + return "NA"; + } + const dateFromApi = new Date(dateEpoch); + let hour = dateFromApi.getHours(); + let min = dateFromApi.getMinutes(); + let period = hour > 12 ? "PM" : "AM"; + hour = hour > 12 ? hour - 12 : hour; + hour = (hour > 9 ? "" : "0") + hour; + min = (min > 9 ? "" : "0") + min; + return `${hour}:${min} ${period}`; +}; + +export const getDayfromTimeStamp = (timestamp) => { + var a = new Date(timestamp); + var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; + var dayOfWeek = days[a.getDay()] + return dayOfWeek +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/ParsingUtils.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/ParsingUtils.js new file mode 100644 index 0000000..f056008 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/ParsingUtils.js @@ -0,0 +1,53 @@ +import XLSX from 'xlsx'; + +export const parseXlsToJson = (event,setter) => { + event.preventDefault() + + const file = event.target.files[0]; + const reader = new FileReader(); + reader.onload = (e) => { + const data = new Uint8Array(e.target.result); + const workbook = XLSX.read(data, { type: 'array' }); + const sheetName = workbook.SheetNames[0]; // Assuming you want the first sheet + + const result = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName]); + setter(()=>result) + }; + + reader.readAsArrayBuffer(file); +} + +export const parseXlsToJsonMultipleSheets = (uploadEvent) => { + const allowedFileTypes = ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-excel']; + + return new Promise((resolve, reject) => { + const uploadedFile = uploadEvent.target.files[0]; + + if (!allowedFileTypes.includes(uploadedFile.type)) { + reject(new Error('WBH_LOC_INAVLID_FILY_TYPE')); + return; + } + const reader = new FileReader(); + + reader.onload = function(event) { + const arrayBuffer = event.target.result; + const workbook = XLSX.read(arrayBuffer, { type: 'arraybuffer' }); + const jsonData = {}; + + workbook.SheetNames.forEach(sheetName => { + const worksheet = workbook.Sheets[sheetName]; + const jsonSheetData = XLSX.utils.sheet_to_json(worksheet); + jsonData[sheetName] = jsonSheetData; + }); + + resolve(jsonData); + }; + + reader.onerror = function(error) { + reject(error); + }; + + reader.readAsArrayBuffer(uploadEvent.target.files[0]); + }); +} + diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Request.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Request.js new file mode 100644 index 0000000..d6874cf --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Request.js @@ -0,0 +1,212 @@ +import Axios from "axios"; + +/** + * Custom Request to make all api calls + * + * @author jagankumar-egov + * + */ + +Axios.interceptors.response.use( + (res) => res, + (err) => { + const isEmployee = window.location.pathname.split("/").includes("employee"); + if (err?.response?.data?.Errors) { + for (const error of err.response.data.Errors) { + if (error.message.includes("InvalidAccessTokenException")) { + localStorage.clear(); + sessionStorage.clear(); + window.location.href = + (isEmployee ? `/${window?.contextPath}/employee/user/login` : `/${window?.contextPath}/citizen/login`) + + `?from=${encodeURIComponent(window.location.pathname + window.location.search)}`; + } else if ( + error?.message?.toLowerCase()?.includes("internal server error") || + error?.message?.toLowerCase()?.includes("some error occured") + ) { + window.location.href = + (isEmployee ? `/${window?.contextPath}/employee/user/error` : `/${window?.contextPath}/citizen/error`) + + `?type=maintenance&from=${encodeURIComponent(window.location.pathname + window.location.search)}`; + } else if (error.message.includes("ZuulRuntimeException")) { + window.location.href = + (isEmployee ? `/${window?.contextPath}/employee/user/error` : `/${window?.contextPath}/citizen/error`) + + `?type=notfound&from=${encodeURIComponent(window.location.pathname + window.location.search)}`; + } + } + } + throw err; + } +); + +const requestInfo = () => ({ + authToken: Digit.UserService.getUser()?.access_token || null, +}); + +const authHeaders = () => ({ + "auth-token": Digit.UserService.getUser()?.access_token || null, +}); + +const userServiceData = () => ({ userInfo: Digit.UserService.getUser()?.info }); + +window.Digit = window.Digit || {}; +window.Digit = { ...window.Digit, RequestCache: window.Digit.RequestCache || {} }; +export const Request = async ({ + method = "POST", + url, + data = {}, + headers = {}, + useCache = false, + params = {}, + auth=true, + urlParams = {}, + userService, + locale = true, + authHeader = false, + setTimeParam = true, + userDownload = false, + noRequestInfo = false, + multipartFormData = false, + multipartData = {}, + reqTimestamp = false, +}) => { + const ts = new Date().getTime(); + if (method.toUpperCase() === "POST") { + + data.RequestInfo = { + apiId: "Rainmaker", + }; + + if (auth) { + data.RequestInfo = { ...data.RequestInfo, ...requestInfo() }; + } + if (userService) { + data.RequestInfo = { ...data.RequestInfo, ...userServiceData() }; + } + if (locale) { + data.RequestInfo = { ...data.RequestInfo, msgId: `${ts}|${Digit.StoreData.getCurrentLanguage()}` }; + } + + if (noRequestInfo) { + delete data.RequestInfo; + } + + /* + Feature :: Privacy + + Desc :: To send additional field in HTTP Requests inside RequestInfo Object as plainAccessRequest + */ + const privacy = Digit.Utils.getPrivacyObject(); + if (privacy && !url.includes("/edcr/rest/dcr/")) { + if(!noRequestInfo){ + data.RequestInfo = { ...data.RequestInfo, plainAccessRequest: { ...privacy } }; + } + } + } + + const headers1 = { + "Content-Type": "application/json", + Accept: window?.globalConfigs?.getConfig("ENABLE_SINGLEINSTANCE") ? "application/pdf,application/json" : "application/pdf", + }; + + if (authHeader) headers = { ...headers, ...authHeaders() }; + + if (userDownload) headers = { ...headers, ...headers1 }; + + let key = ""; + if (useCache) { + key = `${method.toUpperCase()}.${url}.${btoa(escape(JSON.stringify(params, null, 0)))}.${btoa(escape(JSON.stringify(data, null, 0)))}`; + const value = window.Digit.RequestCache[key]; + if (value) { + return value; + } + } else if (setTimeParam) { + params._ = Date.now(); + } + if (reqTimestamp) { + data.RequestInfo = { ...data.RequestInfo, ts: Number(ts) }; + } + + let _url = url + .split("/") + .map((path) => { + let key = path.split(":")?.[1]; + return urlParams[key] ? urlParams[key] : path; + }) + .join("/"); + + if (multipartFormData) { + const multipartFormDataRes = await Axios({ + method, + url: _url, + data: multipartData.data, + params, + headers: { "Content-Type": "multipart/form-data", "auth-token": Digit.UserService.getUser()?.access_token || null }, + }); + return multipartFormDataRes; + } + /* + Feature :: Single Instance + + Desc :: Fix for central instance to send tenantID in all query params + */ + const tenantInfo = + Digit.SessionStorage.get("userType") === "citizen" + ? Digit.ULBService.getStateId() + : Digit.ULBService.getCurrentTenantId() || Digit.ULBService.getStateId(); + if (!params["tenantId"] && window?.globalConfigs?.getConfig("ENABLE_SINGLEINSTANCE")) { + params["tenantId"] = tenantInfo; + } + + const res = userDownload + ? await Axios({ method, url: _url, data, params, headers, responseType: "arraybuffer" }) + : await Axios({ method, url: _url, data, params, headers }); + + if (userDownload) return res; + + const returnData = res?.data || res?.response?.data || {}; + if (useCache && res?.data && Object.keys(returnData).length !== 0) { + window.Digit.RequestCache[key] = returnData; + } + return returnData; +}; + +/** + * + * @param {*} serviceName + * + * preHook: + * ({params, data}) => ({params, data}) + * + * postHook: + * ({resData}) => ({resData}) + * + */ + +export const ServiceRequest = async ({ + serviceName, + method = "POST", + url, + data = {}, + headers = {}, + useCache = false, + params = {}, + auth, + reqTimestamp, + userService, +}) => { + const preHookName = `${serviceName}Pre`; + const postHookName = `${serviceName}Post`; + + let reqParams = params; + let reqData = data; + if (window[preHookName] && typeof window[preHookName] === "function") { + let preHookRes = await window[preHookName]({ params, data }); + reqParams = preHookRes.params; + reqData = preHookRes.data; + } + const resData = await Request({ method, url, data: reqData, headers, useCache, params: reqParams, auth, userService,reqTimestamp }); + + if (window[postHookName] && typeof window[postHookName] === "function") { + return await window[postHookName](resData); + } + return resData; +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Storage.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Storage.js new file mode 100644 index 0000000..e53725b --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Storage.js @@ -0,0 +1,55 @@ +const localStoreSupport = () => { + try { + return "sessionStorage" in window && window["sessionStorage"] !== null; + } catch (e) { + return false; + } +}; + +const k = (key) => `Digit.${key}`; +const getStorage = (storageClass) => ({ + get: (key) => { + if (localStoreSupport() && key) { + let valueInStorage = storageClass.getItem(k(key)); + if (!valueInStorage || valueInStorage === "undefined") { + return null; + } + const item = JSON.parse(valueInStorage); + if (Date.now() > item.expiry) { + storageClass.removeItem(k(key)); + return null; + } + return item.value; + } else if (typeof window !== "undefined") { + return window?.eGov?.Storage && window.eGov.Storage[k(key)].value; + } else { + return null; + } + }, + set: (key, value, ttl = 86400) => { + const item = { + value, + ttl, + expiry: Date.now() + ttl * 1000, + }; + if (localStoreSupport()) { + storageClass.setItem(k(key), JSON.stringify(item)); + } else if (typeof window !== "undefined") { + window.eGov = window.eGov || {}; + window.eGov.Storage = window.eGov.Storage || {}; + window.eGov.Storage[k(key)] = item; + } + }, + del: (key) => { + if (localStoreSupport()) { + storageClass.removeItem(k(key)); + } else if (typeof window !== "undefined") { + window.eGov = window.eGov || {}; + window.eGov.Storage = window.eGov.Storage || {}; + delete window.eGov.Storage[k(key)]; + } + }, +}); + +export const Storage = getStorage(window.sessionStorage); +export const PersistantStorage = getStorage(window.localStorage); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/urls.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/urls.js new file mode 100644 index 0000000..b14bb45 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/urls.js @@ -0,0 +1,227 @@ +const mdmsV1Path = window?.globalConfigs?.getConfig("MDMS_V1_CONTEXT_PATH") || "egov-mdms-service"; +const mdmsV2Path = window?.globalConfigs?.getConfig("MDMS_V2_CONTEXT_PATH") || "mdms-v2"; +const Urls = { + MDMS: `/${mdmsV1Path}/v1/_search`, + WorkFlow: `/egov-workflow-v2/egov-wf/businessservice/_search`, + WorkFlowProcessSearch: `/egov-workflow-v2/egov-wf/process/_search`, + localization: `/localization/messages/v1/_search`, + location: { + localities: `/egov-location/location/v11/boundarys/_search?hierarchyTypeCode=ADMIN&boundaryType=Locality`, + wards: `/egov-location/location/v11/boundarys/_search?hierarchyTypeCode=ADMIN&boundaryType=Ward`, + revenue_localities: `/egov-location/location/v11/boundarys/_search?hierarchyTypeCode=REVENUE&boundaryType=Locality`, + }, + MDMS_V2:`/${mdmsV2Path}/v1/_search`, + pgr_search: `/pgr-services/v2/request/_search`, + pgr_update: `/pgr-services/v2/request/_update`, + filter_data: `https://run.mocky.io/v3/597a50a0-90e5-4a45-b82e-8a2186b760bd`, + FileStore: "/filestore/v1/files", + + FileFetch: "/filestore/v1/files/url", + PGR_Create: `/pgr-services/v2/request/_create`, + pgr_count: `/pgr-services/v2/request/_count`, + + OTP_Send: "/user-otp/v1/_send", + Authenticate: "/user/oauth/token", + RegisterUser: "/user/citizen/_create", + ChangePassword: "/user/password/nologin/_update", + ChangePassword1: "/user/password/_update", + UserProfileUpdate: "/user/profile/_update", + EmployeeSearch: "/egov-hrms/employees/_search", + + InboxSearch: "/works-inbox-service/v2/_search", + + UserSearch: "/user/_search", + UserLogout: "/user/_logout", + + Shortener: "/egov-url-shortening/shortener", + + works: { + create:"/loi-service/v1/_create", + estimateSearch:"/estimate-service/estimate/v1/_search", + loiSearch:"/loi-service/v1/_search", + createEstimate:"/estimate-service/estimate/v1/_create", + approvedEstimateSearch:"/estimate-service/estimate/v1/_search", + searchEstimate:"/estimate-service/estimate/v1/_search", + updateLOI:"/loi-service/v1/_update", + updateEstimate:"/estimate-service/estimate/v1/_update", + download_pdf:"/egov-pdf/download/WORKSESTIMATE/estimatepdf" + }, + + fsm: { + search: "/fsm/v1/_search", + create: "/fsm/v1/_create", + update: "/fsm/v1/_update", + vendorSearch: "/vendor/v1/_search", + vehicleSearch: "/vehicle/v1/_search", + audit: "/fsm/v1/_audit", + vehicleTripSearch: "/vehicle/trip/v1/_search", + billingSlabSearch: "/fsm-calculator/v1/billingSlab/_search", + vehilceUpdate: "/vehicle/trip/v1/_update", + createVendor: "/vendor/v1/_create", + updateVendor: "/vendor/v1/_update", + createVehicle: "/vehicle/v1/_create", + updateVehicle: "/vehicle/v1/_update", + driverSearch: "/vendor/driver/v1/_search", + createDriver: "/vendor/driver/v1/_create", + updateDriver: "/vendor/driver/v1/_update", + vehicleTripCreate: "/vehicle/trip/v1/_create", + }, + + payment: { + fetch_bill: "/billing-service/bill/v2/_fetchbill", + demandSearch: "/billing-service/demand/_search", + create_reciept: "/collection-services/payments/_create", + print_reciept: "/collection-services/payments", + generate_pdf: "/pdf-service/v1/_create", + create_citizen_reciept: "/pg-service/transaction/v1/_create", + update_citizen_reciept: "/pg-service/transaction/v1/_update", + search_bill: "/billing-service/bill/v2/_search", + reciept_search: "/collection-services/payments/:buisnessService/_search", + obps_Reciept_Search: "/collection-services/payments/_search", + billAmendmentSearch: "/billing-service/amendment/_search", + getBulkPdfRecordsDetails: "/pdf-service/v1/_getBulkPdfRecordsDetails", + }, + + pt: { + fectch_property: "/property-services/property/_search", + fetch_payment_details: "/billing-service/bill/v2/_fetchbill", + create: "/property-services/property/_create", + search: "/property-services/property/_search", + update: "/property-services/property/_update", + pt_calculation_estimate: "/pt-calculator-v2/propertytax/v2/_estimate", + assessment_create: "/property-services/assessment/_create", + assessment_search: "/property-services/assessment/_search", + payment_search: "/collection-services/payments/PT/_search", + pt_calculate_mutation: "/pt-calculator-v2/propertytax/mutation/_calculate", + }, + + dss: { + dashboardConfig: "/dashboard-analytics/dashboard/getDashboardConfig", + getCharts: "/dashboard-analytics/dashboard/getChartV2", + }, + + mcollect: { + search: "/echallan-services/eChallan/v1/_search", + create: "/echallan-services/eChallan/v1/_create?", + fetch_bill: "/billing-service/bill/v2/_fetchbill?", + search_bill: "/egov-searcher/bill-genie/mcollectbills/_get", + search_bill_pt: "/egov-searcher/bill-genie/billswithaddranduser/_get", + update: "/echallan-services/eChallan/v1/_update", + download_pdf: "/egov-pdf/download/UC/mcollect-challan", + receipt_download: "/egov-pdf/download/PAYMENT/consolidatedreceipt", + bill_download: "/egov-pdf/download/BILL/consolidatedbill", + count: "/echallan-services/eChallan/v1/_count", + }, + hrms: { + search: "/egov-hrms/employees/_search", + count: "/egov-hrms/employees/_count", + create: "/egov-hrms/employees/_create", + update: "/egov-hrms/employees/_update", + }, + tl: { + create: "/tl-services/v1/_create", + search: "/tl-services/v1/_search", + fetch_payment_details: "/billing-service/bill/v2/_fetchbill", + download_pdf: "/egov-pdf/download/TL/", + update: "/tl-services/v1/_update", + billingslab: "/tl-calculator/billingslab/_search", + }, + receipts: { + receipt_download: "/egov-pdf/download/PAYMENT/consolidatedreceipt", + payments: "/collection-services/payments", + count: "/egov-hrms/employees/_count", + }, + obps: { + scrutinyDetails: "/edcr/rest/dcr/scrutinydetails", + comparisionReport: "/edcr/rest/dcr/occomparison", + create: "/bpa-services/v1/bpa/_create", + nocSearch: "/noc-services/v1/noc/_search", + updateNOC: "/noc-services/v1/noc/_update", + update: "/bpa-services/v1/bpa/_update", + bpaSearch: "/bpa-services/v1/bpa/_search", + bpaRegSearch: "/tl-services/v1/BPAREG/_search", + bpaRegCreate: "/tl-services/v1/BPAREG/_create", + bpaRegGetBill: "/tl-calculator/v1/BPAREG/_getbill", + bpaRegUpdate: "/tl-services/v1/BPAREG/_update", + receipt_download: "/egov-pdf/download/PAYMENT/consolidatedreceipt", + edcrreportdownload: "/bpa-services/v1/bpa/_permitorderedcr", + getSearchDetails: "/inbox/v1/dss/_search" + }, + + edcr: { + create: "/edcr/rest/dcr/scrutinize", + }, + + events: { + search: "/egov-user-event/v1/events/_search", + update: "/egov-user-event/v1/events/lat/_update", + updateEvent: "/egov-user-event/v1/events/_update", + updateEventCDG: "/egov-user-event/v1/events/lat/_update", + count: "/egov-user-event/v1/events/notifications/_count", + create: "/egov-user-event/v1/events/_create", + }, + + ws: { + water_create: "/ws-services/wc/_create", + sewarage_create: "/sw-services/swc/_create", + water_search: "/ws-services/wc/_search", + sewarage_search: "/sw-services/swc/_search", + water_update: "/ws-services/wc/_update", + sewarage_update: "/sw-services/swc/_update", + ws_calculation_estimate: "/ws-calculator/waterCalculator/_estimate", + sw_calculation_estimate: "/sw-calculator/sewerageCalculator/_estimate", + ws_connection_search: "/ws-calculator/meterConnection/_search", + sw_payment_search: "/collection-services/payments/SW/_search", + ws_payment_search: "/collection-services/payments/WS/_search", + billAmendmentCreate: "/billing-service/amendment/_create", + billAmendmentUpdate: "/billing-service/amendment/_update", + ws_meter_conncetion_create: "/ws-calculator/meterConnection/_create", + sw_meter_conncetion_create: "/sw-calculator/meterConnection/_create", + wns_group_bill: "/egov-pdf/download/WNS/wnsgroupbill", + cancel_group_bill: "/pdf-service/v1/_cancelProcess", + wns_generate_pdf: "/egov-pdf/download/WNS/wnsbill", + water_applyAdhocTax : "/ws-calculator/waterCalculator/_applyAdhocTax", + sewerage_applyAdhocTax: "/sw-calculator/sewerageCalculator/_applyAdhocTax", + getSearchDetails: "/inbox/v1/dss/_search", + }, + + engagement: { + document: { + search: "/egov-document-uploader/egov-du/document/_search", + create: "/egov-document-uploader/egov-du/document/_create", + delete: "/egov-document-uploader/egov-du/document/_delete", + update: "/egov-document-uploader/egov-du/document/_update", + }, + surveys: { + create: "/egov-survey-services/egov-ss/survey/_create", + update: "/egov-survey-services/egov-ss/survey/_update", + search: "/egov-survey-services/egov-ss/survey/_search", + delete: "/egov-survey-services/egov-ss/survey/_delete", + submitResponse: "/egov-survey-services/egov-ss/survey/response/_submit", + showResults: "/egov-survey-services/egov-ss/survey/response/_results", + }, + }, + + attendencemgmt: { + mustorRoll: { + estimate: "/muster-roll/v1/_estimate", + create: "/muster-roll/v1/_create", + update: "/muster-roll/v1/_update", + search: "/muster-roll/v1/_search" + } + }, + + noc: { + nocSearch: "/noc-services/v1/noc/_search", + }, + reports: { + reportSearch: "/report/", + }, + bills:{ + cancelBill:"/billing-service/bill/v2/_cancelbill" + }, + access_control: "/access/v1/actions/mdms/_get", + billgenie: "/egov-searcher", +}; + +export default Urls; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Access.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Access.js new file mode 100644 index 0000000..cbc74bc --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Access.js @@ -0,0 +1,21 @@ +import { ServiceRequest } from "../atoms/Utils/Request"; +import Urls from "../atoms/urls"; + +const AccessControlService = { + getAccessControl: (roles = []) => + ServiceRequest({ + url: Urls.access_control, + method: "POST", + auth: true, + useCache: true, + userService: true, + data: { + roleCodes: roles, + tenantId: Digit.ULBService.getStateId(), + actionMaster: "actions-test", + enabled: true, + }, + reqTimestamp: true, + }), +}; +export default AccessControlService; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/ApplicationUpdateActionsCustom.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/ApplicationUpdateActionsCustom.js new file mode 100644 index 0000000..1477fc9 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/ApplicationUpdateActionsCustom.js @@ -0,0 +1,14 @@ +import { CustomService } from "./CustomService"; + + +const ApplicationUpdateActionsCustom = async ({ url, body }) => { + try { + //here need to update this object to send + const response = await CustomService.getResponse({ url, body,useCache:false,setTimeParam:false }); + return response; + } catch (error) { + throw new Error(error?.response?.data?.Errors[0].message); + } +}; + +export default ApplicationUpdateActionsCustom; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Bill.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Bill.js new file mode 100644 index 0000000..37c198b --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Bill.js @@ -0,0 +1,34 @@ +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +const BillingService = { + search_bill: ({ tenantId, filters }) => + Request({ + url: `${Urls.billgenie}${filters.url}`, + useCache: false, + method: "POST", + data: { + searchCriteria: { + tenantId: tenantId, + ...filters, + }, + }, + auth: true, + userService: false, + }), + cancel_bill:(filters) => + Request({ + url: Urls?.bills?.cancelBill, + useCache: false, + method: "POST", + data: { + UpdateBillCriteria: { + ...filters, + }, + }, + auth: true, + userService: false, + }), +} + +export default BillingService diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Complaint.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Complaint.js new file mode 100644 index 0000000..6fc521f --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Complaint.js @@ -0,0 +1,87 @@ +export const Complaint = { + create: async ({ + cityCode, + complaintType, + description, + landmark, + city, + district, + region, + state, + pincode, + localityCode, + localityName, + uploadedImages, + mobileNumber, + name, + }) => { + const tenantId = Digit.ULBService.getCurrentTenantId(); + const defaultData = { + service: { + tenantId: cityCode, + serviceCode: complaintType, + description: description, + additionalDetail: {}, + source: Digit.Utils.browser.isWebview() ? "mobile" : "web", + address: { + landmark: landmark, + city: city, + district: district, + region: region, + state: state, + pincode: pincode, + locality: { + code: localityCode, + name: localityName, + }, + geoLocation: {}, + }, + }, + workflow: { + action: "APPLY", + verificationDocuments: uploadedImages, + }, + }; + + if (Digit.SessionStorage.get("user_type") === "employee") { + defaultData.service.citizen = { + name: name, + type: "CITIZEN", + mobileNumber: mobileNumber, + roles: [ + { + id: null, + name: "Citizen", + code: "CITIZEN", + tenantId: tenantId, + }, + ], + tenantId: tenantId, + }; + } + const response = await Digit.PGRService.create(defaultData, cityCode); + return response; + }, + + assign: async (complaintDetails, action, employeeData, comments, uploadedDocument, tenantId) => { + complaintDetails.workflow.action = action; + complaintDetails.workflow.assignes = employeeData ? [employeeData.uuid] : null; + complaintDetails.workflow.comments = comments; + uploadedDocument + ? (complaintDetails.workflow.verificationDocuments = [ + { + documentType: "PHOTO", + fileStoreId: uploadedDocument, + documentUid: "", + additionalDetails: {}, + }, + ]) + : null; + + if (!uploadedDocument) complaintDetails.workflow.verificationDocuments = []; + + //TODO: get tenant id + const response = await Digit.PGRService.update(complaintDetails, tenantId); + return response; + }, +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/ComponentRegistry.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/ComponentRegistry.js new file mode 100644 index 0000000..2d8c5c2 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/ComponentRegistry.js @@ -0,0 +1,19 @@ +import ComponentRegistry from "../../utils/componentRegistry"; +const componentRegistry = new ComponentRegistry(); + +export const ComponentRegistryService = { + getComponent: (id) => { + return componentRegistry.getComponent(id); + }, + + setComponent: (id, component = {}) => { + return componentRegistry.setComponent(id, component); + }, + + setupRegistry: (components) => { + // should be call only once at the starting + return componentRegistry.setAllComponents(components); + }, + + getRegistry: () => componentRegistry, +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/CustomService.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/CustomService.js new file mode 100644 index 0000000..1aa184d --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/CustomService.js @@ -0,0 +1,18 @@ +import { Request } from "../atoms/Utils/Request"; + +export const CustomService = { + getResponse: ({ url, params, body, plainAccessRequest,useCache=true,userService=true,setTimeParam=true,userDownload=false,auth=true}) => Request({ + url: url, + data: body, + useCache, + userService, + method: "POST", + auth:auth, + params: params, + plainAccessRequest: plainAccessRequest, + userDownload:userDownload, + setTimeParam + }) +}; + + diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/DSS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/DSS.js new file mode 100644 index 0000000..fe9f2cf --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/DSS.js @@ -0,0 +1,45 @@ +import { getCustomFiltersDynamicValues, getFilterOptionsForConfig } from "../../utils/dss"; +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; +import { MdmsService } from "./MDMS"; + +export const DSSService = { + getDashboardConfig: (moduleCode) => + Request({ + url: Urls.dss.dashboardConfig + `/${moduleCode}`, + useCache: false, + userService: false, + method: "GET", + authHeader: true, + }), + getCharts: (data) => + Request({ + url: Urls.dss.getCharts, + useCache: false, + userService: false, + method: "POST", + auth: true, + data, + }), + getFiltersConfigData: (data) => getFilterOptionsForConfig(data), + getCustomFiltersDynamicValues: async (data) => { + let tenantId = Digit.ULBService.getCurrentTenantId() || Digit.ULBService.getStateId(); + let mdmsResp = await MdmsService.call(tenantId, { + moduleDetails: [ + { + moduleName: "dss-dashboard", + masterDetails: [ + { + name: "CustomFilterValues", + }, + ], + }, + ] + }) + if (!mdmsResp) mdmsResp = {}; + if (!mdmsResp?.tenantId) { + _.set(mdmsResp, 'tenantId', tenantId) + } + return getCustomFiltersDynamicValues(data, mdmsResp); + } +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Engagement.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Engagement.js new file mode 100644 index 0000000..e0f1bdf --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Engagement.js @@ -0,0 +1,42 @@ +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +export const Engagement = { + search: (filters = {}) => + Request({ + url: Urls.engagement.document.search, + useCache: false, + method: "POST", + auth: true, + userService: false, + params: { ...filters }, + }), + create: (details) => + Request({ + url: Urls.engagement.document.create, + data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + locale: true + }), + delete: (details) => + Request({ + url: Urls.engagement.document.delete, + data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + }), + update: (details) => + Request({ + url: Urls.engagement.document.update, + data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + }), +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Events.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Events.js new file mode 100644 index 0000000..047b4fe --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Events.js @@ -0,0 +1,64 @@ +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +const Events = { + Search: ({tenantId, data, filter= {}, auth = false}) => { + // const userType = Digit.UserService.getType(); + // if(userType==="employee") auth = true + // else auth = false + //reverting these changes as it is working fine without sending authToken + return Request({ + url: Urls.events.search, + useCache: false, + data: data, + method: "POST", + auth, + userService: false, + params: { tenantId, ...filter }, + }) + }, + ClearNotification: ({tenantId}) => Request({ + url: Urls.events.update, + useCache: false, + method: "POST", + auth: true, + userService: false, + params: { tenantId }, + }), + NotificationCount: ({tenantId}) => Request({ + url: Urls.events.count, + useCache: false, + method: "POST", + auth: true, + userService: false, + params: { tenantId }, + }), + Create: (data) => + Request({ + url: Urls.events.create, + useCache: false, + method: "POST", + auth: true, + data: data, + userService: false, + }), + Update: (data) => + Request({ + url: window?.globalConfigs?.getConfig("ENABLE_SINGLEINSTANCE") ? Urls.events.updateEventCDG : Urls.events.updateEvent , + useCache: false, + method: "POST", + auth: true, + data: data, + userService: false, + }), + EventDetails: async (tenantId, filter) => { + const eventRes = await Events.Search({ tenantId, filter }); + if (eventRes?.events?.length < 1) return; + const [event] = eventRes?.events; + const fileStoresIds = event?.eventDetails?.documents?.map(document => document?.fileStoreId); + const uploadedFilesData = fileStoresIds?.length > 0 ? await Digit.UploadServices.Filefetch(fileStoresIds, tenantId) : null + return {...event, uploadedFilesData} + } +} + +export default Events \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/HRMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/HRMS.js new file mode 100644 index 0000000..1fe9a3f --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/HRMS.js @@ -0,0 +1,46 @@ +import { roundToNearestMinutes } from "date-fns/esm"; +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +const HrmsService = { + search: (tenantId, filters, searchParams) => + Request({ + url: Urls.hrms.search, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId, ...filters, ...searchParams }, + }), + create: (data, tenantId) => + Request({ + data: data, + url: Urls.hrms.create, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId }, + }), + update: (data, tenantId) => + Request({ + data: data, + url: Urls.hrms.update, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId }, + }), + count: (tenantId) => + Request({ + url: Urls.hrms.count, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId }, + }), +}; + +export default HrmsService; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/InboxService.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/InboxService.js new file mode 100644 index 0000000..6b6b45e --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/InboxService.js @@ -0,0 +1,15 @@ +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +export const InboxGeneral = { + Search: ({ ...filters }) =>{ + return Request({ + url: Urls.InboxSearch, + useCache: false, + method: "POST", + auth: true, + userService: true, + data: { ...filters }, + }) + }, +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Localities.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Localities.js new file mode 100644 index 0000000..0ef16e7 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Localities.js @@ -0,0 +1,25 @@ +import { LocalizationService } from "./Localization/service"; + +const ADMIN_CODE = ({ tenantId, hierarchyType }) => { + return tenantId.replace(".", "_").toUpperCase() + "_" + hierarchyType.code; +}; + +const getI18nKeys = (localitiesWithLocalizationKeys) => { + return localitiesWithLocalizationKeys.map((locality) => ({ + code: locality.code, + message: locality.name, + })); +}; + +const getLocalities = (tenantBoundry) => { + const adminCode = ADMIN_CODE(tenantBoundry); + const localitiesWithLocalizationKeys = tenantBoundry.boundary.map((boundaryObj) => ({ + ...boundaryObj, + i18nkey: adminCode + "_" + boundaryObj.code, + })); + return localitiesWithLocalizationKeys; +}; + +export const LocalityService = { + get: (tenantBoundry) => getLocalities(tenantBoundry), +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Localization/service.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Localization/service.js new file mode 100644 index 0000000..993767d --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Localization/service.js @@ -0,0 +1,93 @@ +import Urls from "../../atoms/urls"; +import { PersistantStorage } from "../../atoms/Utils/Storage"; +import i18next from "i18next"; +import { Request } from "../../atoms/Utils/Request"; +import { ApiCacheService } from "../../atoms/ApiCacheService"; + +const LOCALE_LIST = (locale) => `Locale.${locale}.List`; +const LOCALE_ALL_LIST = () => `Locale.List`; +const LOCALE_MODULE = (locale, module) => `Locale.${locale}.${module}`; + +const TransformArrayToObj = (traslationList) => { + return traslationList.reduce( + // eslint-disable-next-line + (obj, item) => ((obj[item.code] = item.message), obj), + {} + ); + // return trasformedTraslation; +}; + +const getUnique = (arr) => { + return arr.filter((value, index, self) => self.indexOf(value) === index); +}; + +const LocalizationStore = { + getCaheData: (key) => PersistantStorage.get(key), + setCacheData: (key, value) => { + const cacheSetting = ApiCacheService.getSettingByServiceUrl(Urls.localization); + PersistantStorage.set(key, value, cacheSetting.cacheTimeInSecs); + }, + getList: (locale) => LocalizationStore.getCaheData(LOCALE_LIST(locale)) || [], + setList: (locale, namespaces) => LocalizationStore.setCacheData(LOCALE_LIST(locale), namespaces), + getAllList: () => LocalizationStore.getCaheData(LOCALE_ALL_LIST()) || [], + setAllList: (namespaces) => LocalizationStore.setCacheData(LOCALE_ALL_LIST(), namespaces), + store: (locale, modules, messages) => { + const AllNamespaces = LocalizationStore.getAllList(); + const Namespaces = LocalizationStore.getList(locale); + modules.forEach((module) => { + if (!Namespaces.includes(module)) { + Namespaces.push(module); + const moduleMessages = messages.filter((message) => message.module === module); + LocalizationStore.setCacheData(LOCALE_MODULE(locale, module), moduleMessages); + } + }); + LocalizationStore.setCacheData(LOCALE_LIST(locale), Namespaces); + LocalizationStore.setAllList(getUnique([...AllNamespaces, ...Namespaces])); + }, + get: (locale, modules) => { + const storedModules = LocalizationStore.getList(locale); + const newModules = modules.filter((module) => !storedModules.includes(module)); + const messages = []; + storedModules.forEach((module) => { + messages.push(...LocalizationStore.getCaheData(LOCALE_MODULE(locale, module))); + }); + return [newModules, messages]; + }, + + updateResources: (locale, messages) => { + let locales = TransformArrayToObj(messages); + i18next.addResources(locale, "translations", locales); + }, +}; + +export const LocalizationService = { + getLocale: async ({ modules = [], locale = Digit.Utils.getDefaultLanguage(), tenantId }) => { + if (locale.indexOf(Digit.Utils.getLocaleRegion()) === -1) { + locale += Digit.Utils.getLocaleRegion(); + } + const [newModules, messages] = LocalizationStore.get(locale, modules); + if (newModules.length > 0) { + const data = await Request({ url: Urls.localization, params: { module: newModules.join(","), locale, tenantId }, useCache: false }); + messages.push(...data.messages); + setTimeout(() => LocalizationStore.store(locale, newModules, data.messages), 100); + } + LocalizationStore.updateResources(locale, messages); + return messages; + }, + changeLanguage: (locale, tenantId) => { + const modules = LocalizationStore.getList(locale); + const allModules = LocalizationStore.getAllList(); + const uniqueModules = allModules.filter((module) => !modules.includes(module)); + LocalizationService.getLocale({ modules: uniqueModules, locale, tenantId }); + localStorage.setItem("Employee.locale", locale); + localStorage.setItem("Citizen.locale", locale); + Digit.SessionStorage.set("locale", locale); + i18next.changeLanguage(locale); + }, + updateResources: (locale = Digit.Utils.getDefaultLanguage(), messages) => { + if (locale.indexOf(Digit.Utils.getLocaleRegion()) === -1) { + locale += Digit.Utils.getLocaleRegion(); + } + LocalizationStore.updateResources(locale, messages); + }, +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Location.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Location.js new file mode 100644 index 0000000..0263422 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Location.js @@ -0,0 +1,30 @@ +import Urls from "../atoms/urls"; +import { ServiceRequest } from "../atoms/Utils/Request"; + +export const LocationService = { + getLocalities: (tenantId) => { + return ServiceRequest({ + serviceName: "getLocalities", + url: Urls.location.localities, + params: { tenantId: tenantId }, + useCache: true, + }); + }, + getRevenueLocalities: async (tenantId) => { + const response = await ServiceRequest({ + serviceName: "getRevenueLocalities", + url: Urls.location.revenue_localities, + params: { tenantId: tenantId }, + useCache: true, + }); + return response; + }, + getWards: (tenantId) => { + return ServiceRequest({ + serviceName: "getWards", + url: Urls.location.wards, + params: { tenantId: tenantId }, + useCache: true, + }); + } +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Login.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Login.js new file mode 100644 index 0000000..c02ecf6 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Login.js @@ -0,0 +1,50 @@ +import Axios from "axios"; +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +export const LoginService = { + sendOtp: (details, stateCode) => + Request({ + url: Urls.OTP_Send, + data: details, + auth: false, + method: "POST", + params: { tenantId: stateCode }, + }), + authenticate: async (details, stateCode) => { + const params = new URLSearchParams(); + Object.entries(details).forEach(([key, value]) => params.append(key, value)); + params.append("scope", "read"); + params.append("grant_type", "password"); + const config = { + url: Urls.Authenticate, + method: "post", + params, + headers: { + authorization: `Basic ${window?.globalConfigs?.getConfig("JWT_TOKEN")||"ZWdvdi11c2VyLWNsaWVudDo="}`, + "Content-Type": "application/x-www-form-urlencoded", + }, + }; + + return Axios(config); + }, + registerUser: async (details, stateCode) => + Request({ + url: Urls.Register_User, + data: { + User: details, + }, + method: "POST", + params: { tenantId: stateCode }, + }), + updateUser: async (details, stateCode) => + Request({ + url: Urls.UserProfileUpdate, + auth: true, + data: { + user: details, + }, + method: "POST", + params: { tenantId: stateCode }, + }), +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMS.js new file mode 100644 index 0000000..8f791f7 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMS.js @@ -0,0 +1,1730 @@ +//HAVE TO CHANGE THI +import { ApiCacheService } from "../atoms/ApiCacheService"; +import Urls from "../atoms/urls"; +import { Request, ServiceRequest } from "../atoms/Utils/Request"; +import { PersistantStorage } from "../atoms/Utils/Storage"; + +// export const stringReplaceAll = (str = "", searcher = "", replaceWith = "") => { +// if (searcher == "") return str; +// while (str.includes(searcher)) { +// str = str.replace(searcher, replaceWith); +// } +// return str; +// }; + +const SortByName = (na, nb) => { + if (na < nb) { + return -1; + } + if (na > nb) { + return 1; + } + return 0; +}; + +const GetCitiesWithi18nKeys = (MdmsRes, moduleCode) => { + const cityList = (MdmsRes.tenant.citymodule && MdmsRes.tenant.citymodule.find((module) => module.code === moduleCode).tenants) || []; + const citiesMap = cityList.map((city) => city.code); + const cities = MdmsRes.tenant.tenants + .filter((city) => citiesMap.includes(city.code)) + .map(({ code, name, logoId, emailId, address, contactNumber }) => ({ + code, + name, + logoId, + emailId, + address, + contactNumber, + i18nKey: "TENANT_TENANTS_" + code.replace(".", "_").toUpperCase(), + })) + .sort((cityA, cityB) => { + const na = cityA.name.toLowerCase(), + nb = cityB.name.toLowerCase(); + return SortByName(na, nb); + }); + return cities; +}; + +const initRequestBody = (tenantId) => ({ + MdmsCriteria: { + tenantId, + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [{ name: "Department" }, { name: "Designation" }, { name: "StateInfo" }, { name: "wfSlaConfig" }, { name: "uiHomePage" }], + }, + { + moduleName: "tenant", + masterDetails: [{ name: "tenants" }, { name: "citymodule" }], + }, + { + moduleName: "DIGIT-UI", + masterDetails: [{ name: "ApiCachingSettings" }], + }, + ], + }, +}); + +const getCriteria = (tenantId, moduleDetails) => { + return { + MdmsCriteria: { + tenantId, + ...moduleDetails, + }, + }; +}; + +export const getGeneralCriteria = (tenantId, moduleCode, type) => ({ + details: { + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: type, + }, + ], + }, + ], + }, +}); + +export const getMultipleTypes = (tenantId, moduleCode, types) => ({ + details: { + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: types.map((type) => ({ name: type })), + }, + ], + }, +}); +export const getMultipleTypesWithFilter = (moduleCode, masterDetails) => ({ + details: { + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: masterDetails, + }, + ], + }, +}); + +const getReceiptKey = (tenantId, moduleCode) => ({ + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "uiCommonPay", + }, + ], + }, + ], + }, +}); + +const getBillsGenieKey = (tenantId, moduleCode) => ({ + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "BusinessService", + }, + ], + }, + { + moduleName: "tenant", + masterDetails: [{ name: "tenants" }, { name: "citymodule" }], + }, + { + moduleName: "common-masters", + masterDetails: [{name: "uiCommonPay"}] + } + ], + }, +}); + +const getModuleServiceDefsCriteria = (tenantId, moduleCode) => ({ + type: "serviceDefs", + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: `RAINMAKER-${moduleCode}`, + masterDetails: [ + { + name: "ServiceDefs", + }, + ], + }, + ], + }, +}); + +const getSanitationTypeCriteria = (tenantId, moduleCode) => ({ + type: "SanitationType", + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "SanitationType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getPitTypeCriteria = (tenantId, moduleCode) => ({ + type: "PitType", + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PitType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getApplicationChannelCriteria = (tenantId, moduleCode) => ({ + type: "ApplicationChannel", + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "ApplicationChannel", + filter: null, + }, + ], + }, + ], + }, +}); + +const getPropertyTypeCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PropertyType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getPropertyUsageCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PropertyType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getCommonFieldsCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "CommonFieldsConfig", + filter: null, + }, + ], + }, + ], + }, +}); + +const getPreFieldsCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PreFieldsConfig", + filter: null, + }, + ], + }, + ], + }, +}); + +const getPostFieldsCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PostFieldsConfig", + filter: null, + }, + ], + }, + ], + }, +}); + +const getConfig = (tenantId, moduleCode) => ({ + type: "Config", + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "Config", + }, + ], + }, + ], + }, +}); + +const getVehicleTypeCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "VehicleMakeModel", + filter: null, + }, + ], + }, + ], + }, +}); + +const getChecklistCriteria = (tenantId, moduleCode) => ({ + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "CheckList", + filter: null, + }, + ], + }, + ], + }, +}); + +const getSlumLocalityCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "Slum", + }, + ], + }, + ], + }, +}); +const getPropertyOwnerTypeCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "OwnerType" }], + }, + ], + }, +}); + +const getSubPropertyOwnerShipCategoryCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "SubOwnerShipCategory" }], + }, + ], + }, +}); +const getPropertyOwnerShipCategoryCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "OwnerShipCategory" }], + }, + ], + }, +}); + +const getTradeOwnerShipCategoryCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "OwnerShipCategory" }], + }, + ], + }, +}); + +const getDocumentRequiredScreenCategory = (tenantId, moduleCode) => ({ + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "Documents", + }, + ], + }, + ], + }, +}); + +const getDefaultMapConfig = (tenantId, moduleCode) => ({ + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "MapConfig", + }, + ], + }, + ], + }, +}); + +const getUsageCategoryList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "UsageCategory" }], + }, + ], + }, +}); + +const getPTPropertyTypeList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "PropertyType" }], + }, + ], + }, +}); + +const getTLStructureTypeList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "StructureType" }], + }, + ], + }, +}); + +const getTLAccessoriesTypeList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "AccessoriesCategory" }], + }, + ], + }, +}); + +const getTLFinancialYearList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "FinancialYear", filter: `[?(@.module == "TL")]` }], + }, + ], + }, +}); + +const getPTFloorList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "Floor" }], + }, + ], + }, +}); + +const getReasonCriteria = (tenantId, moduleCode, type, payload) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: payload.map((mdmsLoad) => ({ + name: mdmsLoad, + })), + }, + ], + }, +}); + +const getBillingServiceForBusinessServiceCriteria = (filter) => ({ + moduleDetails: [ + { + moduleName: "BillingService", + masterDetails: [ + { name: "BusinessService", filter }, + { + name: "TaxHeadMaster", + }, + { + name: "TaxPeriod", + }, + ], + }, + ], +}); + +const getRoleStatusCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "RoleStatusMapping", + filter: null, + }, + ], + }, + ], + }, +}); +const getRentalDetailsCategoryCriteria = (tenantId, moduleCode) => ({ + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "RentalDetails", + }, + ], + }, + ], + }, +}); + +const getChargeSlabsCategoryCriteria = (tenantId, moduleCode) => ({ + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "ChargeSlabs", + }, + ], + }, + ], + }, +}); + +const getGenderTypeList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "GenderType", + }, + ], + }, + ], + }, +}); + +const getMeterStatusTypeList = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "ws-services-calculation", + masterDetails: [ + { + name: "MeterStatus", + filter: `$.*.name` + }, + ], + }, + ], + +}); + +const getBillingPeriodValidation = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "ws-services-masters", + masterDetails: [ + { + name: "billingPeriod", + filter: "*" + }, + ], + }, + ], +}); + +const getDssDashboardCriteria = (tenantId, moduleCode) => ({ + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "dashboard-config", + }, + ], + }, + ], + }, +}); + +const getMCollectBillingServiceCriteria = (tenantId, moduleCode, type, filter) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "BusinessService", filter: filter }], + }, + ], + }, +}); + +const getTradeUnitsDataList = (tenantId, moduleCode, type, filter) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "TradeType", filter: filter }], + }, + ], + }, +}); + +const getMCollectApplicationStatusCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "applicationStatus" }], + }, + ], + }, +}); + +const getHrmsEmployeeRolesandDesignations = () => ({ + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [ + { name: "Department", filter: "[?(@.active == true)]" }, + { name: "Designation", filter: "[?(@.active == true)]" }, + ], + }, + { + moduleName: "tenant", + masterDetails: [{ name: "tenants" }], + }, + { + moduleName: "ACCESSCONTROL-ROLES", + masterDetails: [{ name: "roles", filter: "$.[?(@.code!='CITIZEN')]" }], + }, + { moduleName: "egov-location", masterDetails: [{ name: "TenantBoundary" }] }, + ], +}); +const getFSTPPlantCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "FSTPPlantInfo" }], + }, + ], + }, +}); +const getCancelReceiptReason = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "CancelReceiptReason" }], + }, + ], + }, +}); +const getReceiptStatus = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "ReceiptStatus" }], + }, + ], + }, +}); +const getCancelReceiptReasonAndStatus = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "ReceiptStatus" }, { name: "uiCommonPay" }], + }, + ], + }, +}); + +const getDocumentTypesCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "DocTypeMapping", + }, + ], + }, + ], + }, +}); + +const getTradeTypeRoleCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "TradeTypetoRoleMapping", + }, + ], + }, + ], + }, +}); + +const getFSTPORejectionReasonCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "FSTPORejectionReason", + filter: null, + }, + ], + }, + ], + }, +}); + +const getFSMPaymentTypeCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PaymentType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getFSMTripNumberCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "TripNumber", + filter: null, + }, + ], + }, + ], + }, +}); + +const getFSMReceivedPaymentTypeCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "ReceivedPaymentType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getWSTaxHeadMasterCritera = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: "BillingService", + masterDetails: [ + { + name: "TaxHeadMaster", + filter: null, + }, + ], + }, + ], + }, +}); + +const getHowItWorksJSON = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [ + { + name: "howItWorks", + }, + ], + }, + ], +}); + +const getFAQsJSON = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [ + { + name: "faqs", + }, + ], + }, +], +}); +const getDSSFAQsJSON = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "dss-dashboard", + masterDetails: [ + { + name: "FAQs", + }, + ], + }, +], +}); +const getDSSAboutJSON = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "dss-dashboard", + masterDetails: [ + { + name: "About", + }, + ], + }, +], +}); + +const getStaticData = () => ({ + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [ + { + name: "StaticData", + }, + ], + }, + ], +}); + +const GetEgovLocations = (MdmsRes) => { + return MdmsRes["egov-location"].TenantBoundary[0].boundary.children.map((obj) => ({ + name: obj.localname, + i18nKey: obj.localname, + })); +}; + +const GetServiceDefs = (MdmsRes, moduleCode) => MdmsRes[`RAINMAKER-${moduleCode}`].ServiceDefs.filter((def) => def.active); + +const GetSanitationType = (MdmsRes) => MdmsRes["FSM"].SanitationType.filter((type) => type.active); + +const GetPitType = (MdmsRes) => + MdmsRes["FSM"].PitType.filter((item) => item.active).map((type) => ({ ...type, i18nKey: `PITTYPE_MASTERS_${type.code}` })); + +const GetApplicationChannel = (MdmsRes) => + MdmsRes["FSM"].ApplicationChannel.filter((type) => type.active).map((channel) => ({ + ...channel, + i18nKey: `ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_${channel.code}`, + })); + +const GetPropertyType = (MdmsRes) => + MdmsRes["FSM"].PropertyType.filter((property) => property.active && !property.propertyType).map((item) => ({ + ...item, + i18nKey: `PROPERTYTYPE_MASTERS_${item.code}`, + code: item.code, + })); + +const GetPropertySubtype = (MdmsRes) => + MdmsRes["FSM"].PropertyType.filter((property) => property.active && property.propertyType).map((item) => ({ + ...item, + i18nKey: `PROPERTYTYPE_MASTERS_${item.code}`, + code: item.code, + })); + +const GetVehicleType = (MdmsRes) => + MdmsRes["Vehicle"].VehicleMakeModel.filter((vehicle) => vehicle.active) + .filter((vehicle) => vehicle.make) + .map((vehicleDetails) => { + return { + ...vehicleDetails, + i18nKey: `COMMON_MASTER_VEHICLE_${vehicleDetails.code}`, + }; + }); + +const GetVehicleMakeModel = (MdmsRes) => + MdmsRes["Vehicle"].VehicleMakeModel.filter((vehicle) => vehicle.active) + .map((vehicleDetails) => { + return { + ...vehicleDetails, + i18nKey: `COMMON_MASTER_VEHICLE_${vehicleDetails.code}`, + }; + }); + +const GetSlumLocalityMapping = (MdmsRes, tenantId) => + MdmsRes["FSM"].Slum.filter((type) => type.active).reduce((prev, curr) => { + return prev[curr.locality] + ? { + ...prev, + [curr.locality]: [ + ...prev[curr.locality], + { + ...curr, + i18nKey: `${tenantId.toUpperCase().replace(".", "_")}_${curr.locality}_${curr.code}`, + }, + ], + } + : { + ...prev, + [curr.locality]: [ + { + ...curr, + i18nKey: `${tenantId.toUpperCase().replace(".", "_")}_${curr.locality}_${curr.code}`, + }, + ], + }; + }, {}); + +const GetPropertyOwnerShipCategory = (MdmsRes) => + MdmsRes["PropertyTax"].OwnerShipCategory.filter((ownerShip) => ownerShip.active).map((ownerShipDetails) => { + return { + ...ownerShipDetails, + i18nKey: `COMMON_MASTER_OWNER_TYPE_${ownerShipDetails.code}`, + }; + }); + +const GetTradeOwnerShipCategory = (MdmsRes) => + MdmsRes["common-masters"].OwnerShipCategory.filter((ownerShip) => ownerShip.active).map((ownerShipDetails) => { + return { + ...ownerShipDetails, + i18nKey: `COMMON_MASTER_OWNER_TYPE_${ownerShipDetails.code}`, + }; + }); + +const GetPropertyOwnerType = (MdmsRes) => + MdmsRes["PropertyTax"].OwnerType.filter((owner) => owner.active).map((ownerDetails) => { + return { + ...ownerDetails, + i18nKey: `PROPERTYTAX_OWNERTYPE_${ownerDetails.code}`, + }; + }); + +const getSubPropertyOwnerShipCategory = (MdmsRes) => { + MdmsRes["PropertyTax"].SubOwnerShipCategory.filter((category) => category.active).map((subOwnerShipDetails) => { + return { + ...subOwnerShipDetails, + i18nKey: `PROPERTYTAX_BILLING_SLAB_${subOwnerShipDetails.code}`, + }; + }); + sessionStorage.setItem("getSubPropertyOwnerShipCategory", JSON.stringify(MdmsRes)); +}; + +const getDocumentRequiredScreen = (MdmsRes) => { + MdmsRes["PropertyTax"].Documents.filter((Documents) => Documents.active).map((dropdownData) => { + return { + ...Documents, + i18nKey: `${dropdownData.code}`, + }; + }); +}; + +const getTLDocumentRequiredScreen = (MdmsRes) => { + MdmsRes["TradeLicense"].Documents.filter((Documents) => Documents.active).map((dropdownData) => { + return { + ...Documents, + i18nKey: `${dropdownData.code}`, + }; + }); +}; + +const getMapConfig = (MdmsRes) => { + MdmsRes["PropertyTax"].MapConfig.filter((MapConfig) => MapConfig).map((MapData) => { + return { + ...MapConfig, + defaultconfig: MapData.defaultConfig, + }; + }); +}; + +const getUsageCategory = (MdmsRes) => + MdmsRes["PropertyTax"].UsageCategory.filter((UsageCategory) => UsageCategory.active).map((UsageCategorylist) => { + return { + ...UsageCategorylist, + i18nKey: `PROPERTYTAX_BILLING_SLAB_${UsageCategorylist.code}`, + }; + }); + +const getPTPropertyType = (MdmsRes) => + MdmsRes["PropertyTax"].UsageCategory.filter((PropertyType) => PropertyType.active).map((PTPropertyTypelist) => { + return { + ...UsageCategorylist, + i18nKey: `COMMON_PROPTYPE_${Digit.Utils.locale.stringReplaceAll(PTPropertyTypelist.code, ".", "_")}`, + }; + }); + +const getTLStructureType = (MdmsRes) => + MdmsRes["common-masters"].StructureType.filter((StructureType) => StructureType.active).map((TLStructureTypeList) => { + return { + ...TLStructureTypeList, + i18nKey: `COMMON_MASTERS_STRUCTURETYPE_${Digit.Utils.locale.stringReplaceAll(TLStructureTypeList.code, ".", "_")}`, + }; + }); + +const getTLAccessoriesType = (MdmsRes) => + MdmsRes["TradeLicense"].AccessoriesCategory.filter((AccessoriesCategory) => AccessoriesCategory.active).map((TLAccessoryTypeList) => { + return { + ...TLAccessoryTypeList, + i18nKey: `TRADELICENSE_ACCESSORIESCATEGORY_${Digit.Utils.locale.stringReplaceAll(TLAccessoryTypeList.code, ".", "_")}`, + }; + }); + +const getTLFinancialYear = (MdmsRes) => + MdmsRes["egf-master"].FinancialYear.filter((FinancialYear) => FinancialYear.active && FinancialYear.module === "TL").map((FinancialYearList) => { + return { + ...FinancialYearList, + //i18nKey: `TRADELICENSE_ACCESSORIESCATEGORY_${stringReplaceAll(TLAccessoryTypeList.code, ".", "_")}`, + }; + }); +const getFloorList = (MdmsRes) => + MdmsRes["PropertyTax"].Floor.filter((PTFloor) => PTFloor.active).map((PTFloorlist) => { + return { + ...PTFloorlist, + i18nKey: `PROPERTYTAX_FLOOR_${PTFloorlist.code}`, + }; + }); + +const GetReasonType = (MdmsRes, type, moduleCode) => + Object.assign( + {}, + ...Object.keys(MdmsRes[moduleCode]).map((collection) => ({ + [collection]: MdmsRes[moduleCode][collection] + .filter((reason) => reason.active) + .map((reason) => ({ + ...reason, + i18nKey: `ES_ACTION_REASON_${reason.code}`, + })), + })) + ); + +const getRentalDetailsCategory = (MdmsRes) => { + MdmsRes["PropertyTax"].RentalDetails.filter((category) => category.active).map((RentalDetailsInfo) => { + return { + ...RentalDetailsInfo, + i18nKey: `PROPERTYTAX_BILLING_SLAB_${RentalDetailsInfo.code}`, + }; + }); +}; + +const getChargeSlabsCategory = (MdmsRes) => { + MdmsRes["PropertyTax"].ChargeSlabs.filter((category) => category.active).map((ChargeSlabsInfo) => { + return { + ...ChargeSlabsInfo, + }; + }); +}; + +const getGenderType = (MdmsRes) => { + return MdmsRes["common-masters"].GenderType.filter((GenderType) => GenderType.active).map((genderDetails) => { + return { + ...genderDetails, + i18nKey: `PT_COMMON_GENDER_${genderDetails.code}`, + }; + }); + //return MdmsRes; +}; + +const TLGenderType = (MdmsRes) => { + MdmsRes["common-masters"].GenderType.filter((GenderType) => GenderType.active).map((genders) => { + return { + ...genders, + i18nKey: `TL_GENDER_${genders.code}`, + }; + }); +}; + +const PTGenderType = (MdmsRes) => { + MdmsRes["common-masters"].GenderType.filter((GenderType) => GenderType.active).map((formGender) => { + return { + ...formGender, + i18nKey: `PT_FORM3_${formGender.code}`, + }; + }); +}; + +const HRGenderType = (MdmsRes) => { + MdmsRes["common-masters"].GenderType.filter((GenderType) => GenderType.active).map((comGender) => { + return { + ...comGender, + i18nKey: `COMMON_GENDER_${comGender.code}`, + }; + }); +}; + +const GetMCollectBusinessService = (MdmsRes) => + MdmsRes["BillingService"].BusinessService.map((businesServiceDetails) => { + return { + ...businesServiceDetails, + i18nKey: `BILLINGSERVICE_BUSINESSSERVICE_${businesServiceDetails.code}`, + }; + }); + +const GetMCollectApplicationStatus = (MdmsRes) => + MdmsRes["mCollect"].applcationStatus.map((appStatusDetails) => { + return { + ...appStatusDetails, + i18nKey: `BILLINGSERVICE_BUSINESSSERVICE_${appStatusDetails.code}`, + }; + }); + +const getFSMGenderType = (MdmsRes) => { + return MdmsRes["common-masters"].GenderType.map((genderDetails) => { + return { + ...genderDetails, + i18nKey: `COMMON_GENDER_${genderDetails.code}`, + }; + }); +}; + +const GetFSTPORejectionReason = (MdmsRes) => { + return MdmsRes["Vehicle"].FSTPORejectionReason.filter((reason) => reason.active).map((reasonDetails) => { + return { + ...reasonDetails, + i18nKey: `ES_ACTION_REASON_${reasonDetails.code}`, + }; + }); +}; + +const GetPaymentType = (MdmsRes) => { + return MdmsRes["FSM"].PaymentType.filter((option) => option.active).map((reasonDetails) => { + return { + ...reasonDetails, + i18nKey: `ES_ACTION_${reasonDetails.code}`, + }; + }); +}; + +const GetTripNumber = (MdmsRes) => { + return MdmsRes["FSM"].TripNumber.filter((option) => option.active).map((reasonDetails) => { + return { + ...reasonDetails, + i18nKey: `ES_ACTION_TRIP_${reasonDetails.code}`, + }; + }); +}; + +const GetReceivedPaymentType = (MdmsRes) => { + return MdmsRes["FSM"].ReceivedPaymentType.filter((option) => option.active).map((reasonDetails) => { + return { + ...reasonDetails, + i18nKey: `ES_ACTION_${reasonDetails.code}`, + }; + }); +}; + +const getDssDashboard = (MdmsRes) => MdmsRes["dss-dashboard"]["dashboard-config"]; + +const GetRoleStatusMapping = (MdmsRes) => MdmsRes["DIGIT-UI"].RoleStatusMapping; +const GetCommonFields = (MdmsRes, moduleCode) => + moduleCode.toUpperCase() === "PROPERTYTAX" ? MdmsRes["PropertyTax"].CommonFieldsConfig : MdmsRes["FSM"].CommonFieldsConfig; + +const GetPreFields = (MdmsRes) => MdmsRes["FSM"].PreFieldsConfig; + +const GetPostFields = (MdmsRes) => MdmsRes["FSM"].PostFieldsConfig; + +const GetFSTPPlantInfo = (MdmsRes) => MdmsRes["FSM"]?.FSTPPlantInfo; + +const GetDocumentsTypes = (MdmsRes) => MdmsRes["BPA"].DocTypeMapping; + +const GetChecklist = (MdmsRes) => MdmsRes["BPA"].CheckList; + +const transformResponse = (type, MdmsRes, moduleCode, tenantId) => { + switch (type) { + case "citymodule": + return GetCitiesWithi18nKeys(MdmsRes, moduleCode); + case "egovLocation": + return GetEgovLocations(MdmsRes); + case "serviceDefs": + return GetServiceDefs(MdmsRes, moduleCode); + case "ApplicationChannel": + return GetApplicationChannel(MdmsRes); + case "SanitationType": + return GetSanitationType(MdmsRes); + case "PropertyType": + return GetPropertyType(MdmsRes); + case "PropertySubtype": + return GetPropertySubtype(MdmsRes); + case "PitType": + return GetPitType(MdmsRes); + case "VehicleType": + return GetVehicleType(MdmsRes); + case "VehicleMakeModel": + return GetVehicleMakeModel(MdmsRes); + case "Slum": + return GetSlumLocalityMapping(MdmsRes, tenantId); + case "OwnerShipCategory": + return GetPropertyOwnerShipCategory(MdmsRes); + case "TLOwnerShipCategory": + return GetTradeOwnerShipCategory(MdmsRes); + case "OwnerType": + return GetPropertyOwnerType(MdmsRes); + case "SubOwnerShipCategory": + return getSubPropertyOwnerShipCategory(MdmsRes); + case "Documents": + return getDocumentRequiredScreen(MdmsRes); + case "TLDocuments": + return getTLDocumentRequiredScreen(MdmsRes); + case "MapConfig": + return getMapConfig(MdmsRes); + case "UsageCategory": + return getUsageCategory(MdmsRes); + case "PTPropertyType": + return getPTPropertyType(MdmsRes); + case "StructureType": + return getTLStructureType(MdmsRes); + case "AccessoryCategory": + return getTLAccessoriesType(MdmsRes); + case "FinancialYear": + return getTLFinancialYear(MdmsRes); + case "Floor": + return getFloorList(MdmsRes); + case "Reason": + return GetReasonType(MdmsRes, type, moduleCode); + case "RoleStatusMapping": + return GetRoleStatusMapping(MdmsRes); + case "CommonFieldsConfig": + return GetCommonFields(MdmsRes, moduleCode); + case "PreFieldsConfig": + return GetPreFields(MdmsRes); + case "PostFieldsConfig": + return GetPostFields(MdmsRes); + case "RentalDeatils": + return getRentalDetailsCategory(MdmsRes); + case "ChargeSlabs": + return getChargeSlabsCategory(MdmsRes); + case "DssDashboard": + return getDssDashboard(MdmsRes); + case "BusinessService": + return GetMCollectBusinessService(MdmsRes); + case "applcatonStatus": + return GetMCollectApplicationStatus(MdmsRes); + case "FSTPPlantInfo": + return GetFSTPPlantInfo(MdmsRes); + case "GenderType": + return getGenderType(MdmsRes); + case "TLGendertype": + return TLGenderType(MdmsRes); + case "PTGenderType": + return PTGenderType(MdmsRes); + case "HRGenderType": + return HRGenderType(MdmsRes); + case "DocumentTypes": + return GetDocumentsTypes(MdmsRes); + case "CheckList": + return GetChecklist(MdmsRes); + case "FSMGenderType": + return getFSMGenderType(MdmsRes); + case "FSTPORejectionReason": + return GetFSTPORejectionReason(MdmsRes); + case "PaymentType": + return GetPaymentType(MdmsRes); + case "TripNumber": + return GetTripNumber(MdmsRes); + case "ReceivedPaymentType": + return GetReceivedPaymentType(MdmsRes); + default: + return MdmsRes; + } +}; + +const getCacheSetting = (moduleName) => { + return ApiCacheService.getSettingByServiceUrl(Urls.MDMS, moduleName); +}; + +const mergedData = {}; +const mergedPromises = {}; +const callAllPromises = (success, promises = [], resData) => { + promises.forEach((promise) => { + if (success) { + promise.resolve(resData); + } else { + promise.reject(resData); + } + }); +}; +const mergeMDMSData = (data, tenantId) => { + if (!mergedData[tenantId] || Object.keys(mergedData[tenantId]).length === 0) { + mergedData[tenantId] = data; + } else { + data.MdmsCriteria.moduleDetails.forEach((dataModuleDetails) => { + const moduleName = dataModuleDetails.moduleName; + const masterDetails = dataModuleDetails.masterDetails; + let found = false; + mergedData[tenantId].MdmsCriteria.moduleDetails.forEach((moduleDetail) => { + if (moduleDetail.moduleName === moduleName) { + found = true; + moduleDetail.masterDetails = [...moduleDetail.masterDetails, ...masterDetails]; + } + }); + if (!found) { + mergedData[tenantId].MdmsCriteria.moduleDetails.push(dataModuleDetails); + } + }); + } +}; +const debouncedCall = ({ serviceName, url, data, useCache, params }, resolve, reject) => { + if (!mergedPromises[params.tenantId] || mergedPromises[params.tenantId].length === 0) { + const cacheSetting = getCacheSetting(); + setTimeout(() => { + let callData = JSON.parse(JSON.stringify(mergedData[params.tenantId])); + mergedData[params.tenantId] = {}; + let callPromises = [...mergedPromises[params.tenantId]]; + mergedPromises[params.tenantId] = []; + ServiceRequest({ + serviceName, + url, + data: callData, + useCache, + params, + }) + .then((data) => { + callAllPromises(true, callPromises, data); + }) + .catch((err) => { + callAllPromises(false, callPromises, err); + }); + }, cacheSetting.debounceTimeInMS || 500); + } + mergeMDMSData(data, params.tenantId); + if (!mergedPromises[params.tenantId]) { + mergedPromises[params.tenantId] = []; + } + mergedPromises[params.tenantId].push({ resolve, reject }); +}; + +export const MdmsService = { + init: (stateCode) => + ServiceRequest({ + serviceName: "mdmsInit", + url: Urls.MDMS, + data: initRequestBody(stateCode), + useCache: true, + params: { tenantId: stateCode }, + }), + call: (tenantId, details) => { + return new Promise((resolve, reject) => + debouncedCall( + { + serviceName: "mdmsCall", + url: Urls.MDMS, + data: getCriteria(tenantId, details), + useCache: true, + params: { tenantId }, + }, + resolve, + reject + ) + ); + }, + getDataByCriteria: async (tenantId, mdmsDetails, moduleCode) => { + const key = `MDMS.${tenantId}.${moduleCode}.${mdmsDetails.type}.${JSON.stringify(mdmsDetails.details)}`; + const inStoreValue = PersistantStorage.get(key); + if (inStoreValue) { + return inStoreValue; + } + const { MdmsRes } = await MdmsService.call(tenantId, mdmsDetails.details); + const responseValue = transformResponse(mdmsDetails.type, MdmsRes, moduleCode.toUpperCase(), tenantId); + const cacheSetting = getCacheSetting(mdmsDetails.details.moduleDetails[0].moduleName); + PersistantStorage.set(key, responseValue, cacheSetting.cacheTimeInSecs); + return responseValue; + }, + getServiceDefs: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getModuleServiceDefsCriteria(tenantId, moduleCode), moduleCode); + }, + getSanitationType: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getSanitationTypeCriteria(tenantId, moduleCode), moduleCode); + }, + getApplicationChannel: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getApplicationChannelCriteria(tenantId, moduleCode), moduleCode); + }, + getPropertyType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getPropertyTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getPropertyUsage: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getPropertyUsageCriteria(tenantId, moduleCode, type), moduleCode); + }, + getPropertySubtype: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getPropertyTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getPitType: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getPitTypeCriteria(tenantId, moduleCode), moduleCode); + }, + getVehicleType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getVehicleTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getChecklist: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getChecklistCriteria(tenantId, moduleCode), moduleCode); + }, + getPaymentRules: (tenantId, filter) => { + return MdmsService.call(tenantId, getBillingServiceForBusinessServiceCriteria(filter)); + }, + + getCustomizationConfig: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getConfig(tenantId, moduleCode), moduleCode); + }, + getSlumLocalityMapping: (tenantId, moduleCode, type) => + MdmsService.getDataByCriteria(tenantId, getSlumLocalityCriteria(tenantId, moduleCode, type), moduleCode), + + getReason: (tenantId, moduleCode, type, payload) => + MdmsService.getDataByCriteria(tenantId, getReasonCriteria(tenantId, moduleCode, type, payload), moduleCode), + + getRoleStatus: (tenantId, moduleCode, type) => + MdmsService.getDataByCriteria(tenantId, getRoleStatusCriteria(tenantId, moduleCode, type), moduleCode), + + getCommonFieldsConfig: (tenantId, moduleCode, type, payload) => + MdmsService.getDataByCriteria(tenantId, getCommonFieldsCriteria(tenantId, moduleCode, type, payload), moduleCode), + + getPreFieldsConfig: (tenantId, moduleCode, type, payload) => + MdmsService.getDataByCriteria(tenantId, getPreFieldsCriteria(tenantId, moduleCode, type, payload), moduleCode), + + getPostFieldsConfig: (tenantId, moduleCode, type, payload) => + MdmsService.getDataByCriteria(tenantId, getPostFieldsCriteria(tenantId, moduleCode, type, payload), moduleCode), + + getPropertyOwnerShipCategory: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getPropertyOwnerShipCategoryCriteria(tenantId, moduleCode, type), moduleCode); + }, + + GetTradeOwnerShipCategory: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getTradeOwnerShipCategoryCriteria(tenantId, moduleCode, type), moduleCode); + }, + + getPropertyOwnerType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getPropertyOwnerTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getPropertySubOwnerShipCategory: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getSubPropertyOwnerShipCategoryCriteria(tenantId, moduleCode, type), moduleCode); + }, + getDocumentRequiredScreen: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getDocumentRequiredScreenCategory(tenantId, moduleCode), moduleCode); + }, + getTLDocumentRequiredScreen: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getDocumentRequiredScreenCategory(tenantId, moduleCode), moduleCode); + }, + getTradeUnitsData: (tenantId, moduleCode, type, filter) => { + return MdmsService.getDataByCriteria(tenantId, getTradeUnitsDataList(tenantId, moduleCode, type, filter), moduleCode); + }, + getMapConfig: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getDefaultMapConfig(tenantId, moduleCode), moduleCode); + }, + getUsageCategory: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getUsageCategoryList(tenantId, moduleCode), moduleCode); + }, + getPTPropertyType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getPTPropertyTypeList(tenantId, moduleCode), moduleCode); + }, + getTLStructureType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getTLStructureTypeList(tenantId, moduleCode), moduleCode); + }, + getTLAccessoriesType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getTLAccessoriesTypeList(tenantId, moduleCode), moduleCode); + }, + getTLFinancialYear: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getTLFinancialYearList(tenantId, moduleCode), moduleCode); + }, + getFloorList: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getPTFloorList(tenantId, moduleCode, type), moduleCode); + }, + getRentalDetails: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getRentalDetailsCategoryCriteria(tenantId, moduleCode), moduleCode); + }, + getChargeSlabs: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getChargeSlabsCategoryCriteria(tenantId, moduleCode), moduleCode); + }, + getDssDashboard: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getDssDashboardCriteria(tenantId, moduleCode), moduleCode); + }, + getPaymentGateway: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getGeneralCriteria(tenantId, moduleCode, type), moduleCode); + }, + getReceiptKey: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getReceiptKey(tenantId, moduleCode), moduleCode); + }, + getHelpText: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getGeneralCriteria(tenantId, moduleCode, type), moduleCode); + }, + getMCollectBillingService: (tenantId, moduleCode, type, filter) => { + return MdmsService.getDataByCriteria(tenantId, getMCollectBillingServiceCriteria(tenantId, moduleCode, type, filter), moduleCode); + }, + getMCollectApplcationStatus: (tenantId, moduleCode, type, filter) => { + return MdmsService.getDataByCriteria(tenantId, getMCollectApplicationStatusCriteria(tenantId, moduleCode, type, filter), moduleCode); + }, + getHrmsEmployeeRolesandDesignation: (tenantId) => { + return MdmsService.call(tenantId, getHrmsEmployeeRolesandDesignations()); + }, + getHrmsEmployeeTypes: (tenantId, moduleCode, type, filter) => { + return MdmsService.getDataByCriteria(tenantId, getGeneralCriteria(tenantId, moduleCode, type), moduleCode); + }, + getHrmsEmployeeReason: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getGeneralCriteria(tenantId, moduleCode, type), moduleCode); + }, + getMultipleTypes: (tenantId, moduleCode, types) => { + return MdmsService.getDataByCriteria(tenantId, getMultipleTypes(tenantId, moduleCode, types), moduleCode); + }, + getMultipleTypesWithFilter: (tenantId, moduleCode, types) => { + return MdmsService.getDataByCriteria(tenantId, getMultipleTypesWithFilter(moduleCode, types), moduleCode); + }, + getFSTPPlantInfo: (tenantId, moduleCode, types) => { + return MdmsService.getDataByCriteria(tenantId, getFSTPPlantCriteria(tenantId, moduleCode, types), moduleCode); + }, + getCancelReceiptReason: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getCancelReceiptReason(tenantId, moduleCode), moduleCode); + }, + getReceiptStatus: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getReceiptStatus(tenantId, moduleCode), moduleCode); + }, + getCancelReceiptReasonAndStatus: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getCancelReceiptReasonAndStatus(tenantId, moduleCode), moduleCode); + }, + + getGenderType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getGenderTypeList(tenantId, moduleCode, type), moduleCode); + }, + + TLGenderType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getGenderTypeList(tenantId, moduleCode, type), moduleCode); + }, + + PTGenderType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getGenderTypeList(tenantId, moduleCode, type), moduleCode); + }, + + HRGenderType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getGenderTypeList(tenantId, moduleCode, type), moduleCode); + }, + + getDocumentTypes: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getDocumentTypesCriteria(tenantId, moduleCode, type), moduleCode); + }, + + getTradeTypeRoleTypes: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getTradeTypeRoleCriteria(tenantId, moduleCode, type), moduleCode); + }, + + getFSMGenderType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getGenderTypeList(tenantId, moduleCode, type), moduleCode); + }, + + getFSTPORejectionReason: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getFSTPORejectionReasonCriteria(tenantId, moduleCode, type), moduleCode); + }, + + getFSMPaymentType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getFSMPaymentTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getBillsGenieKey: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getBillsGenieKey(tenantId, moduleCode), moduleCode); + }, + + getFSMTripNumber: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getFSMTripNumberCriteria(tenantId, moduleCode, type), moduleCode); + }, + + getFSMReceivedPaymentType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getFSMReceivedPaymentTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getWSTaxHeadMaster: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getWSTaxHeadMasterCritera(tenantId, moduleCode, type), moduleCode); + }, + + getMeterStatusType: (tenantId) => { + return MdmsService.call(tenantId, getMeterStatusTypeList(tenantId)); + }, + + getBillingPeriod: (tenantId) => { + return MdmsService.call(tenantId, getBillingPeriodValidation(tenantId)); + }, + getHowItWorksJSONData: (tenantId) => { + return MdmsService.call(tenantId, getHowItWorksJSON(tenantId)); + }, + getFAQsJSONData: (tenantId) => { + return MdmsService.call(tenantId, getFAQsJSON(tenantId)); + }, + getDSSFAQsJSONData: (tenantId) => { + return MdmsService.call(tenantId, getDSSFAQsJSON(tenantId)); + }, + + getDSSAboutJSONData: (tenantId) => { + return MdmsService.call(tenantId, getDSSAboutJSON(tenantId)); + }, + getStaticDataJSON: (tenantId) => { + return MdmsService.call(tenantId, getStaticData()); + } +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/PGR.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/PGR.js new file mode 100644 index 0000000..d0bce11 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/PGR.js @@ -0,0 +1,61 @@ +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +export const PGRService = { + search: (tenantId, filters = {}) => { + return Request({ + url: Urls.pgr_search, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId: tenantId, ...filters }, + }); + }, + create: (details, tenantId) => + Request({ + url: Urls.PGR_Create, + data: details, + useCache: true, + method: "POST", + params: { tenantId }, + auth: true, + userService: true, + }), + update: (details) => + Request({ + url: Urls.pgr_update, + data: details, + useCache: true, + auth: true, + method: "POST", + params: { tenantId: details.tenantId }, + userService: true, + }), + count: (tenantId, params) => + Request({ + url: Urls.pgr_count, + useCache: true, + auth: true, + method: "POST", + params: { tenantId, ...params }, + }), + + employeeSearch: (tenantId, roles) => { + return Request({ + url: Urls.EmployeeSearch, + params: { tenantId, roles }, + auth: true, + }); + }, + + PGROpensearch: ({ tenantId, filters }) => + Request({ + url: Urls.pgr_search, + useCache: false, + method: "POST", + auth: false , + userService: false, + params: { tenantId, ...filters }, + }), +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Payment.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Payment.js new file mode 100644 index 0000000..d54d5a6 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Payment.js @@ -0,0 +1,143 @@ +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +export const PaymentService = { + fetchBill: (tenantId, filters = {}) => + Request({ + url: Urls.payment.fetch_bill, + useCache: false, + method: "POST", + auth: false, + userService: false, + params: { tenantId, ...filters }, + }) + .then((d) => { + return d; + }) + .catch((err) => { + if (err?.response?.data?.Errors?.[0]?.code === "EG_BS_BILL_NO_DEMANDS_FOUND") return { Bill: [] }; + else throw err; + }), + searchBill: (tenantId, filters = {}) => + Request({ + url: Urls.payment.search_bill, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId, ...filters }, + }), + searchAmendment: (tenantId, filters = {}) => { + return Request({ + url: Urls.payment.billAmendmentSearch, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId, ...filters }, + }); + }, + createReciept: (tenantId, details = {}) => + Request({ + url: Urls.payment.create_reciept, + useCache: false, + method: "POST", + auth: true, + userService: true, + locale: true, + params: { tenantId }, + data: { ...details }, + }), + + getReciept: (tenantId, businessservice, filters = {}) => + Request({ + url: + businessservice && businessservice !== "BPAREG" + ? `${Urls.payment.print_reciept}/${businessservice}/_search` + : `${Urls.payment.print_reciept}/_search`, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId, ...filters }, + }), + + generatePdf: (tenantId, data = {}, key) => + Request({ + url: Urls.payment.generate_pdf, + useCache: false, + method: "POST", + auth: true, + userService: true, + locale: true, + params: { tenantId, key }, + data: data, + }), + + printReciept: (tenantId, filters = {}) => + Request({ + url: Urls.FileFetch, + useCache: false, + method: "GET", + auth: true, + userService: true, + params: { tenantId, ...filters }, + }), + + createCitizenReciept: (tenantId, details = {}) => + Request({ + url: Urls.payment.create_citizen_reciept, + useCache: false, + method: "POST", + auth: false, + userService: false, + params: { tenantId }, + data: { ...details }, + }), + + updateCitizenReciept: (transactionId) => + Request({ + url: Urls.payment.update_citizen_reciept, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { transactionId }, + }), + + demandSearch: (tenantId, consumerCode, businessService) => + Request({ + url: Urls.payment.demandSearch, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId, consumerCode, businessService }, + }), + + recieptSearch: (tenantId, businessService, params) => + Request({ + url: + businessService === "BPAREG" && !params?.isEmployee /* || businessService.includes("BPA.") && !params?.isEmployee ) */ + ? Urls.payment.obps_Reciept_Search + : Urls.payment.reciept_search, + urlParams: + businessService === "BPAREG" && !params?.isEmployee /* || businessService.includes("BPA.") && !params?.isEmployee) */ + ? {} + : { buisnessService: businessService }, + method: "POST", + // do not change this directly add a param if needed + auth: true, + params: { tenantId, ...params }, + }), + + getBulkPdfRecordsDetails: (filters) => + Request({ + url: Urls.payment.getBulkPdfRecordsDetails, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { ...filters }, + }), +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Surveys.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Surveys.js new file mode 100644 index 0000000..e887d76 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Surveys.js @@ -0,0 +1,61 @@ +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +export const Surveys = { + search: (filters = {}) => + Request({ + url: Urls.engagement.surveys.search, + useCache: false, + method: "POST", + auth: true, + userService: false, + params: { ...filters }, + }), + create: (details) => + Request({ + url: Urls.engagement.surveys.create, + data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + locale: true + }), + delete: (details) => + Request({ + url: Urls.engagement.surveys.delete, + data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + }), + update: (details) => + Request({ + url: Urls.engagement.surveys.update, + data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + }), + submitResponse: (details) => + Request({ + url: Urls.engagement.surveys.submitResponse, + data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + }), + showResults: (details) => + Request({ + url: Urls.engagement.surveys.showResults, + // data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + params:{surveyId:details.surveyId} + }), +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/UrlShortener.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/UrlShortener.js new file mode 100644 index 0000000..3886b33 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/UrlShortener.js @@ -0,0 +1,15 @@ +import { Request } from "../atoms/Utils/Request"; +import Urls from "../atoms/urls"; + +const UrlShortener = (fileStoreId) => + Request({ + data: { url: fileStoreId }, + url: Urls.Shortener, + useCache: false, + method: "POST", + auth: false, + userService: false, + noRequestInfo: true, + }); + +export default UrlShortener; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/User/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/User/index.js new file mode 100644 index 0000000..3cac213 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/User/index.js @@ -0,0 +1,139 @@ +import Urls from "../../atoms/urls"; +import { Request, ServiceRequest } from "../../atoms/Utils/Request"; +import { Storage } from "../../atoms/Utils/Storage"; + +export const UserService = { + authenticate: async(details) => { + const data = new URLSearchParams(); + Object.entries(details).forEach(([key, value]) => data.append(key, value)); + data.append("scope", "read"); + data.append("grant_type", "password"); + + let authResponse= await ServiceRequest({ + serviceName: "authenticate", + url: Urls.Authenticate, + data, + headers: { + authorization: `Basic ${window?.globalConfigs?.getConfig("JWT_TOKEN")||"ZWdvdi11c2VyLWNsaWVudDo="}`, + "Content-Type": "application/x-www-form-urlencoded", + }, + }); + const invalidRoles = window?.globalConfigs?.getConfig("INVALIDROLES") || []; + if (invalidRoles && invalidRoles.length > 0 && authResponse && authResponse?.UserRequest?.roles?.some((role) => invalidRoles.includes(role.code))) { + throw new Error("ES_ERROR_USER_NOT_PERMITTED"); + } + return authResponse; + }, + logoutUser: () => { + let user = UserService.getUser(); + if (!user || !user.info || !user.access_token) return false; + const { type } = user.info; + return ServiceRequest({ + serviceName: "logoutUser", + url: Urls.UserLogout, + data: { access_token: user?.access_token }, + auth: true, + params: { tenantId: type === "CITIZEN" ? Digit.ULBService.getStateId() : Digit.ULBService.getCurrentTenantId() }, + }); + }, + getType: () => { + return Storage.get("userType") || "citizen"; + }, + setType: (userType) => { + Storage.set("userType", userType); + Storage.set("user_type", userType); + }, + getUser: () => { + return Digit.SessionStorage.get("User"); + }, + logout: async () => { + const userType = UserService.getType(); + try { + await UserService.logoutUser(); + } catch (e) { + } + finally{ + window.localStorage.clear(); + window.sessionStorage.clear(); + if (userType === "citizen") { + window.location.replace(`/${window?.contextPath}/citizen`); + } else { + window.location.replace(`/${window?.contextPath}/employee/user/language-selection`); + } + } + }, + sendOtp: (details, stateCode) => + ServiceRequest({ + serviceName: "sendOtp", + url: Urls.OTP_Send, + data: details, + auth: false, + params: { tenantId: stateCode }, + }), + setUser: (data) => { + return Digit.SessionStorage.set("User", data); + }, + setExtraRoleDetails: (data) => { + const userDetails = Digit.SessionStorage.get("User"); + return Digit.SessionStorage.set("User", { ...userDetails, extraRoleInfo: data }); + }, + getExtraRoleDetails: () => { + return Digit.SessionStorage.get("User")?.extraRoleInfo; + }, + registerUser: (details, stateCode) => + ServiceRequest({ + serviceName: "registerUser", + url: Urls.RegisterUser, + data: { + User: details, + }, + params: { tenantId: stateCode }, + }), + updateUser: async (details, stateCode) => + ServiceRequest({ + serviceName: "updateUser", + url: Urls.UserProfileUpdate, + auth: true, + data: { + user: details, + }, + params: { tenantId: stateCode }, + }), + hasAccess: (accessTo) => { + const user = Digit.UserService.getUser(); + if (!user || !user.info) return false; + const { roles } = user.info; + return roles && Array.isArray(roles) && roles.filter((role) => accessTo.includes(role.code)).length; + }, + + changePassword: (details, stateCode) => + ServiceRequest({ + serviceName: "changePassword", + url: Digit.SessionStorage.get("User")?.info ? Urls.ChangePassword1 : Urls.ChangePassword, + data: { + ...details, + }, + auth: true, + params: { tenantId: stateCode }, + }), + + employeeSearch: (tenantId, filters) => { + return Request({ + url: Urls.EmployeeSearch, + params: { tenantId, ...filters }, + auth: true, + }); + }, + userSearch: async (tenantId, data, filters) => { + + return ServiceRequest({ + url: Urls.UserSearch, + params: { ...filters }, + method: "POST", + auth: true, + useCache: true, + userService: true, + data: data.pageSize ? { tenantId, ...data } : { tenantId, ...data, pageSize: "100" }, + }); + }, +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/WorkFlow.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/WorkFlow.js new file mode 100644 index 0000000..6f00237 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/WorkFlow.js @@ -0,0 +1,410 @@ +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; +import cloneDeep from "lodash/cloneDeep"; + +const getThumbnails = async (ids, tenantId, documents = []) => { + + + const res = await Digit.UploadServices.Filefetch(ids, tenantId); + if (res.data.fileStoreIds && res.data.fileStoreIds.length !== 0) { + return { + thumbs: res.data.fileStoreIds.map((o) => o.url.split(",")[3] || o.url.split(",")[0]), + images: res.data.fileStoreIds.map((o) => Digit.Utils.getFileUrl(o.url)) + }; + } else { + return null; + } + +}; + +const makeCommentsSubsidariesOfPreviousActions = async (wf) => { + const TimelineMap = new Map(); + const tenantId = wf?.[0]?.tenantId; + let fileStoreIdsList = []; + let res = {}; + + for (const eventHappened of wf) { + if (eventHappened?.documents) { + eventHappened.thumbnailsToShow = await getThumbnails(eventHappened?.documents?.map(e => e?.fileStoreId), eventHappened?.tenantId, eventHappened?.documents) + } + if (eventHappened.action === "COMMENT") { + const commentAccumulator = TimelineMap.get("tlCommentStack") || [] + TimelineMap.set("tlCommentStack", [...commentAccumulator, eventHappened]) + } + else { + const eventAccumulator = TimelineMap.get("tlActions") || [] + const commentAccumulator = TimelineMap.get("tlCommentStack") || [] + eventHappened.wfComments = [...commentAccumulator, ...eventHappened.comment ? [eventHappened] : []] + TimelineMap.set("tlActions", [...eventAccumulator, eventHappened]) + TimelineMap.delete("tlCommentStack") + } + } + const response = TimelineMap.get("tlActions") + return response +} + +const getThumbnailsV2 = async (ids, tenantId, documents = []) => { + + const res = await Digit.UploadServices.Filefetch(ids, tenantId); + if (res.data.fileStoreIds && res.data.fileStoreIds.length !== 0) { + return { + thumbs: res.data.fileStoreIds.map((o) => o.url.split(",")[3] || o.url.split(",")[0]), + images: res.data.fileStoreIds.map((o) => Digit.Utils.getFileUrl(o.url)) + }; + } else { + return null; + } +}; + +const makeCommentsSubsidariesOfPreviousActionsV2 = async (wf) => { + const TimelineMap = new Map(); + // const tenantId = window.location.href.includes("/obps/") ? Digit.ULBService.getStateId() : wf?.[0]?.tenantId; + + + for (const eventHappened of wf) { + + //currenlty in workflow documentUid is getting populated so while update we are sending fileStoreId in documentUid field + if (eventHappened?.documents) { + eventHappened.thumbnailsToShow = await getThumbnailsV2(eventHappened?.documents?.map(e => e?.documentUid || e?.fileStoreId), eventHappened?.tenantId, eventHappened?.documents) + } + + + } + +} + +const getAssignerDetails = (instance, nextStep, moduleCode) => { + let assigner = instance?.assigner + if (moduleCode === "FSM" || moduleCode === "FSM_POST_PAY_SERVICE") { + if (instance.state.applicationStatus === "CREATED") { + assigner = instance?.assigner + } else { + assigner = nextStep?.assigner || instance?.assigner + } + } else { + assigner = instance?.assigner + } + return assigner +} + +export const WorkflowService = { + init: (stateCode, businessServices) => { + return Request({ + url: Urls.WorkFlow, + useCache: true, + method: "POST", + params: { tenantId: stateCode, businessServices }, + auth: true, + }); + }, + + getByBusinessId: (stateCode, businessIds, params = {}, history = true) => { + return Request({ + url: Urls.WorkFlowProcessSearch, + useCache: false, + method: "POST", + params: { tenantId: stateCode, businessIds: businessIds, ...params, history }, + auth: true, + }); + }, + getDetailsByIdV2: async ({ tenantId, id, moduleCode }) => { + + //process instance search + const workflow = await Digit.WorkflowService.getByBusinessId(tenantId, id); + const applicationProcessInstance = cloneDeep(workflow?.ProcessInstances); + //business service search + const businessServiceResponse = (await Digit.WorkflowService.init(tenantId, moduleCode))?.BusinessServices[0]?.states; + + if (workflow && workflow.ProcessInstances) { + const processInstances = workflow.ProcessInstances; + const nextStates = processInstances[0]?.nextActions.map((action) => ({ action: action?.action, nextState: processInstances[0]?.state.uuid })); + const nextActions = nextStates.map((id) => ({ + action: id.action, + state: businessServiceResponse?.find((state) => state.uuid === id.nextState), + })); + + /* To check state is updatable and provide edit option*/ + const currentState = businessServiceResponse?.find((state) => state.uuid === processInstances[0]?.state.uuid); + + // if current state is editable then we manually append an edit action + //(doing only for muster) + //beacuse in other module edit action is defined in workflow + + // if (currentState && currentState?.isStateUpdatable && moduleCode==="muster-roll-approval" ) { + // nextActions.push({ action: "EDIT", state: currentState }); + // } + // Check when to add Edit action(In Estimate only when send back to originator action is taken) + + const getStateForUUID = (uuid) => businessServiceResponse?.find((state) => state.uuid === uuid); + + //this actionState is used in WorkflowActions component + const actionState = businessServiceResponse + ?.filter((state) => state.uuid === processInstances[0]?.state.uuid) + .map((state) => { + let _nextActions = state.actions?.map?.((ac) => { + let actionResultantState = getStateForUUID(ac.nextState); + let assignees = actionResultantState?.actions?.reduce?.((acc, act) => { + return [...acc, ...act.roles]; + }, []); + return { ...actionResultantState, assigneeRoles: assignees, action: ac.action, roles: ac.roles }; + }); + // if (state?.isStateUpdatable && moduleCode==="MR") { + // _nextActions.push({ action: "RE-SUBMIT", ...state, roles: state?.actions?.[0]?.roles }) + // } + //CHECK WHEN EDIT ACTION TO BE SHOWN + return { ...state, nextActions: _nextActions, roles: state?.action, roles: state?.actions?.reduce((acc, el) => [...acc, ...el.roles], []) }; + })?.[0]; + + + //mapping nextActions with suitable roles + const actionRolePair = nextActions?.map((action) => ({ + action: action?.action, + roles: action.state?.actions?.map((action) => action.roles).join(","), + })); + + + if (processInstances.length > 0) { + // const EnrichedWfData = await makeCommentsSubsidariesOfPreviousActions(processInstances) + //if any documents are there this fn will add thumbnails to show + + await makeCommentsSubsidariesOfPreviousActionsV2(processInstances) + + let timeline = processInstances.map((instance, ind) => { + let checkPoint = { + performedAction: instance.action, + status: instance.state.applicationStatus, + state: instance.state.state, + assigner: instance?.assigner, + rating: instance?.rating, + // wfComment: instance?.wfComments?.map(e => e?.comment), + comment:instance?.comment, + wfDocuments: instance?.documents, + thumbnailsToShow: { thumbs: instance?.thumbnailsToShow?.thumbs, fullImage: instance?.thumbnailsToShow?.images }, + assignes: instance.assignes, + caption: instance.assignes ? instance.assignes?.map((assignee) => ({ name: assignee.name, mobileNumber: assignee.mobileNumber })) : null, + auditDetails: { + created: Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.createdTime), + lastModified: Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.lastModifiedTime), + lastModifiedEpoch: instance.auditDetails.lastModifiedTime, + }, + isTerminateState : instance?.state?.isTerminateState + }; + return checkPoint; + }); + + + const details = { + timeline, + nextActions:actionRolePair, + actionState, + applicationBusinessService: workflow?.ProcessInstances?.[0]?.businessService, + processInstances: applicationProcessInstance, + }; + + + return details; + } + } else { + throw new Error("error fetching workflow services"); + } + return {}; + }, + getDetailsById: async ({ tenantId, id, moduleCode, role, getTripData }) => { + const workflow = await Digit.WorkflowService.getByBusinessId(tenantId, id); + const applicationProcessInstance = cloneDeep(workflow?.ProcessInstances); + const getLocationDetails = window.location.href.includes("/obps/") || window.location.href.includes("noc/inbox"); + const moduleCodeData = getLocationDetails ? applicationProcessInstance?.[0]?.businessService : moduleCode; + const businessServiceResponse = (await Digit.WorkflowService.init(tenantId, moduleCodeData))?.BusinessServices[0]?.states; + if (workflow && workflow.ProcessInstances) { + const processInstances = workflow.ProcessInstances; + const nextStates = processInstances[0]?.nextActions.map((action) => ({ action: action?.action, nextState: processInstances[0]?.state.uuid })); + const nextActions = nextStates.map((id) => ({ + action: id.action, + state: businessServiceResponse?.find((state) => state.uuid === id.nextState), + })); + + /* To check state is updatable and provide edit option*/ + const currentState = businessServiceResponse?.find((state) => state.uuid === processInstances[0]?.state.uuid); + if (currentState && currentState?.isStateUpdatable) { + if (moduleCode === "FSM" || moduleCode === "FSM_POST_PAY_SERVICE" || moduleCode === "FSM_VEHICLE_TRIP" || moduleCode === "PGR" || moduleCode === "OBPS") null; + else nextActions.push({ action: "EDIT", state: currentState }); + } + + const getStateForUUID = (uuid) => businessServiceResponse?.find((state) => state.uuid === uuid); + + const actionState = businessServiceResponse + ?.filter((state) => state.uuid === processInstances[0]?.state.uuid) + .map((state) => { + let _nextActions = state.actions?.map?.((ac) => { + let actionResultantState = getStateForUUID(ac.nextState); + let assignees = actionResultantState?.actions?.reduce?.((acc, act) => { + return [...acc, ...act.roles]; + }, []); + return { ...actionResultantState, assigneeRoles: assignees, action: ac.action, roles: ac.roles }; + }); + if(state?.isStateUpdatable) { + _nextActions.push({ action: "EDIT", ...state, roles: state?.actions?.[0]?.roles}) + } + return { ...state, nextActions: _nextActions, roles: state?.action, roles: state?.actions?.reduce((acc, el) => [...acc, ...el.roles], []) }; + })?.[0]; + + // HANDLING ACTION for NEW VEHICLE LOG FROM UI SIDE + const action_newVehicle = [{ + "action": "READY_FOR_DISPOSAL", + "roles": "FSM_EMP_FSTPO,FSM_EMP_FSTPO" + }] + + const actionRolePair = nextActions?.map((action) => ({ + action: action?.action, + roles: action.state?.actions?.map((action) => action.roles).join(","), + })); + + if (processInstances.length > 0) { + const TLEnrichedWithWorflowData = await makeCommentsSubsidariesOfPreviousActions(processInstances) + let timeline = TLEnrichedWithWorflowData.map((instance, ind) => { + let checkPoint = { + performedAction: instance.action, + status: moduleCode === "BS.AMENDMENT" ? instance.state.state :instance.state.applicationStatus, + state: instance.state.state, + assigner: getAssignerDetails(instance, TLEnrichedWithWorflowData[ind - 1], moduleCode), + rating: instance?.rating, + wfComment: instance?.wfComments.map(e => e?.comment), + wfDocuments: instance?.documents, + thumbnailsToShow: { thumbs: instance?.thumbnailsToShow?.thumbs, fullImage: instance?.thumbnailsToShow?.images }, + assignes: instance.assignes, + caption: instance.assignes ? instance.assignes.map((assignee) => ({ name: assignee.name, mobileNumber: assignee.mobileNumber })) : null, + auditDetails: { + created: Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.createdTime), + lastModified: Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.lastModifiedTime), + lastModifiedEpoch: instance.auditDetails.lastModifiedTime, + }, + timeLineActions: instance.nextActions + ? instance.nextActions.filter((action) => action.roles.includes(role)).map((action) => action?.action) + : null, + }; + return checkPoint; + }); + + if (getTripData) { + try { + const filters = { + businessService: 'FSM_VEHICLE_TRIP', + refernceNos: id + }; + const tripSearchResp = await Digit.FSMService.vehicleSearch(tenantId, filters) + if (tripSearchResp && tripSearchResp.vehicleTrip && tripSearchResp.vehicleTrip.length) { + const numberOfTrips = tripSearchResp.vehicleTrip.length + let cretaedTime = 0 + let lastModifiedTime = 0 + let waitingForDisposedCount = 0 + let disposedCount = 0 + let waitingForDisposedAction = [] + let disposedAction = [] + for (const data of tripSearchResp.vehicleTrip) { + const resp = await Digit.WorkflowService.getByBusinessId(tenantId, data.applicationNo) + resp?.ProcessInstances?.map((instance, ind) => { + if (instance.state.applicationStatus === "WAITING_FOR_DISPOSAL") { + waitingForDisposedCount++ + cretaedTime = Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.createdTime) + lastModifiedTime = Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.lastModifiedTime) + waitingForDisposedAction = [{ + performedAction: instance.action, + status: instance.state.applicationStatus, + state: instance.state.state, + assigner: instance?.assigner, + rating: instance?.rating, + thumbnailsToShow: { thumbs: instance?.thumbnailsToShow?.thumbs, fullImage: instance?.thumbnailsToShow?.images }, + assignes: instance.assignes, + caption: instance.assignes ? instance.assignes.map((assignee) => ({ name: assignee.name, mobileNumber: assignee.mobileNumber })) : null, + auditDetails: { + created: cretaedTime, + lastModified: lastModifiedTime, + }, + numberOfTrips: numberOfTrips + }] + } + if (instance.state.applicationStatus === "DISPOSED") { + disposedCount++ + cretaedTime = instance.auditDetails.createdTime > cretaedTime ? Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.createdTime) : cretaedTime + lastModifiedTime = instance.auditDetails.lastModifiedTime > lastModifiedTime ? Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.lastModifiedTime) : lastModifiedTime + disposedAction = [{ + performedAction: instance.action, + status: instance.state.applicationStatus, + state: instance.state.state, + assigner: instance?.assigner, + rating: instance?.rating, + thumbnailsToShow: { thumbs: instance?.thumbnailsToShow?.thumbs, fullImage: instance?.thumbnailsToShow?.images }, + assignes: instance.assignes, + caption: instance.assignes ? instance.assignes.map((assignee) => ({ name: assignee.name, mobileNumber: assignee.mobileNumber })) : null, + auditDetails: { + created: cretaedTime, + lastModified: lastModifiedTime, + }, + numberOfTrips: disposedCount + }] + } + }) + } + + let tripTimeline = [] + const disposalInProgressPosition = timeline.findIndex((data) => data.status === "DISPOSAL_IN_PROGRESS") + if (disposalInProgressPosition !== -1) { + timeline[disposalInProgressPosition].numberOfTrips = numberOfTrips + timeline.splice(disposalInProgressPosition + 1, 0, ...waitingForDisposedAction) + tripTimeline = disposedAction + } else { + tripTimeline = disposedAction.concat(waitingForDisposedAction) + } + const feedbackPosition = timeline.findIndex((data) => data.status === "CITIZEN_FEEDBACK_PENDING") + if (feedbackPosition !== -1) { + timeline.splice(feedbackPosition + 1, 0, ...tripTimeline) + } else { + timeline = tripTimeline.concat(timeline) + } + } + } catch (err) { } + } + + // HANDLING ACTION FOR NEW VEHICLE LOG FROM UI SIDE + const nextActions = location.pathname.includes("new-vehicle-entry") ? action_newVehicle : actionRolePair; + + if (role !== "CITIZEN" && moduleCode === "PGR") { + const onlyPendingForAssignmentStatusArray = timeline?.filter(e => e?.status === "PENDINGFORASSIGNMENT") + const duplicateCheckpointOfPendingForAssignment = onlyPendingForAssignmentStatusArray.at(-1) + // const duplicateCheckpointOfPendingForAssignment = timeline?.find( e => e?.status === "PENDINGFORASSIGNMENT") + timeline.push({ + ...duplicateCheckpointOfPendingForAssignment, + status: "COMPLAINT_FILED", + }); + } + + if (timeline[timeline.length - 1].status !== "CREATED" && (moduleCode === "FSM" || moduleCode === "FSM_POST_PAY_SERVICE")) + timeline.push({ + status: "CREATED", + }); + + const details = { + timeline, + nextActions, + actionState, + applicationBusinessService: workflow?.ProcessInstances?.[0]?.businessService, + processInstances: applicationProcessInstance, + }; + return details; + } + } else { + throw new Error("error fetching workflow services"); + } + return {}; + }, + + getAllApplication: (tenantId, filters) => { + return Request({ + url: Urls.WorkFlowProcessSearch, + useCache: false, + method: "POST", + params: { tenantId, ...filters }, + auth: true, + }); + }, +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/index.js new file mode 100644 index 0000000..d74d967 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/index.js @@ -0,0 +1,3 @@ +import { useStore, useInitStore } from "../hooks/store"; + +export { useStore, useInitStore }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/DSS/getDSSDashboardData.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/DSS/getDSSDashboardData.js new file mode 100644 index 0000000..cdc4605 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/DSS/getDSSDashboardData.js @@ -0,0 +1,11 @@ +import useDssMDMS from "../../../hooks/dss/useMDMS"; + +export const getDSSDashboardData = (stateCode, mdmsType, moduleCode) => { + const { data: dssConfig, isLoading: configLoading, isSuccess: configLoaded } = useDssMDMS(stateCode, mdmsType, moduleCode); + return [ + { + queryKey: ["DSS_DASHBOARD_DATA", mdmsType, moduleCode], + queryFn: () => dssConfig, + }, + ]; +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ServiceDefinitions.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ServiceDefinitions.js new file mode 100644 index 0000000..17c0767 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ServiceDefinitions.js @@ -0,0 +1,57 @@ +import { MdmsService } from "../elements/MDMS"; +import { Storage } from "../atoms/Utils/Storage"; + +export const GetServiceDefinitions = { + get: async (tenantId) => { + const criteria = { + type: "serviceDefs", + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: "RAINMAKER-PGR", + masterDetails: [ + { + name: "ServiceDefs", + }, + ], + }, + ], + }, + }; + + const serviceDefs = await MdmsService.getDataByCriteria(tenantId, criteria, "PGR"); + Storage.set("serviceDefinitions", serviceDefs); + return serviceDefs; + }, + getMenu: async (stateCode, t) => { + var Menu = []; + const response = await GetServiceDefinitions.get(stateCode); + await Promise.all( + response.map((def) => { + if (!Menu.find((e) => e.key === def.menuPath)) { + def.menuPath === "" + ? Menu.push({ + name: t("SERVICEDEFS.OTHERS"), + key: def.menuPath, + }) + : Menu.push({ + name: t("SERVICEDEFS." + def.menuPath.toUpperCase()), + key: def.menuPath, + }); + } + }) + ); + return Menu; + }, + + getSubMenu: async (tenantId, selectedType, t) => { + const fetchServiceDefs = await GetServiceDefinitions.get(tenantId); + return fetchServiceDefs + .filter((def) => def.menuPath === selectedType.key) + .map((id) => ({ + key: id.serviceCode, + name: t("SERVICEDEFS." + id.serviceCode.toUpperCase()), + })); + }, +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ShareFiles.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ShareFiles.js new file mode 100644 index 0000000..99988a0 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ShareFiles.js @@ -0,0 +1,75 @@ +import Download from "../atoms/Download"; +import { UploadServices } from "../atoms/UploadServices"; +import UrlShortener from "../elements/UrlShortener"; + +const isMobileOrTablet = () => { + return (/(android|iphone|ipad|mobile)/i.test(navigator.userAgent)); +} + +const ShareFiles = { + targetLink: (target, shortUrl) => { + switch (target) { + case "mail": + return window.open(`mailto:?body=${encodeURIComponent(shortUrl)}`, "_blank"); + case "whatsapp": + return window.open('https://' + (isMobileOrTablet() ? 'api' : 'web') + '.whatsapp.com/send?text=' + encodeURIComponent(shortUrl), "_blank"); + default: + return window.open(shortUrl, "_blank"); + } + }, + + getShortener: async (tenantId, data) => { + const fileUploadId = await UploadServices.Filestorage("DSS", data, tenantId); + const fileUrl = await UploadServices.Filefetch([fileUploadId.data.files[0].fileStoreId], fileUploadId.data.files[0].tenantId); + return UrlShortener(Digit.Utils.getFileUrl(fileUrl.data[fileUploadId.data.files[0].fileStoreId])); + }, + + PDF: async (tenantId, node, filename, target) => { + const pdfData = await Download.PDF(node, filename, true); + if (!target && navigator.share) { + return navigator.share({ + files: [pdfData], + title: filename, + }); + } + const shortUrl = await ShareFiles.getShortener(tenantId, pdfData); + return ShareFiles.targetLink(target, shortUrl); + }, + + Image: async (tenantId, node, filename, target) => { + const imageData = await new Promise((resolve) => Download.Image(node, filename, true, resolve)); + if (!target && navigator.share) { + return navigator.share({ + files: [imageData], + title: filename, + }); + } + const shortUrl = await ShareFiles.getShortener(tenantId, imageData); + return ShareFiles.targetLink(target, shortUrl); + }, + + IndividualChartImage: async (tenantId, node, filename, target) => { + const imageData = await new Promise((resolve) => Download.IndividualChartImage(node, filename, true, resolve)); + if (!target && navigator.share) { + return navigator.share({ + files: [imageData], + title: filename, + }); + } + const shortUrl = await ShareFiles.getShortener(tenantId, imageData); + return ShareFiles.targetLink(target, shortUrl); + }, + DownloadImage: async (tenantId, node, filename, target) => { + const imageData = await new Promise((resolve) => Download.PDF(node, filename, true, resolve)); + if (!target && navigator.share) { + return navigator.share({ + files: [imageData], + title: filename, + }); + } + const shortUrl = await ShareFiles.getShortener(tenantId, imageData); + return ShareFiles.targetLink(target, shortUrl); + }, +}; + +export default ShareFiles; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js new file mode 100644 index 0000000..30c503d --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js @@ -0,0 +1,119 @@ +import { LocalizationService } from "../../elements/Localization/service"; +import { MdmsService } from "../../elements/MDMS"; +import { Storage } from "../../atoms/Utils/Storage"; +import { ApiCacheService } from "../../atoms/ApiCacheService"; + +const getImgUrl = (url, fallbackUrl) => { + if (!url && fallbackUrl) { + return fallbackUrl; + } + if (url?.includes("s3.ap-south-1.amazonaws.com")) { + const baseDomain = window?.location?.origin; + return url.replace("https://s3.ap-south-1.amazonaws.com", baseDomain); + } + return url; +}; +const addLogo = (id, url, fallbackUrl = "") => { + const containerDivId = "logo-img-container"; + let containerDiv = document.getElementById(containerDivId); + if (!containerDiv) { + containerDiv = document.createElement("div"); + containerDiv.id = containerDivId; + containerDiv.style = "position: absolute; top: 0; left: -9999px;"; + document.body.appendChild(containerDiv); + } + const img = document.createElement("img"); + img.src = getImgUrl(url, fallbackUrl); + img.id = `logo-${id}`; + containerDiv.appendChild(img); +}; + +const renderTenantLogos = (stateInfo, tenants) => { + addLogo(stateInfo.code, stateInfo.logoUrl); + tenants.forEach((tenant) => { + addLogo(tenant.code, tenant.logoId, stateInfo.logoUrl); + }); +}; + +export const StoreService = { + getInitData: () => { + return Storage.get("initData"); + }, + + getBoundries: async (tenants) => { + let allBoundries = []; + allBoundries = tenants.map((tenant) => { + return Digit.LocationService.getLocalities(tenant.code); + }); + return await Promise.all(allBoundries); + }, + getRevenueBoundries: async (tenants) => { + let allBoundries = []; + allBoundries = tenants.map((tenant) => { + return Digit.LocationService.getRevenueLocalities(tenant.code); + }); + return await Promise.all(allBoundries); + }, + digitInitData: async (stateCode, enabledModules , modulePrefix) => { + const { MdmsRes } = await MdmsService.init(stateCode); + const stateInfo = MdmsRes["common-masters"]?.StateInfo?.[0]||{}; + const uiHomePage = MdmsRes["common-masters"]?.uiHomePage?.[0]||{}; + const localities = {}; + const revenue_localities = {}; + const initData = { + languages: stateInfo.hasLocalisation ? stateInfo.languages : [{ label: "ENGLISH", value: Digit.Utils.getDefaultLanguage() }], + stateInfo: { + code: stateInfo.code, + name: stateInfo.name, + logoUrl: stateInfo.logoUrl, + statelogo: stateInfo.statelogo, + logoUrlWhite: stateInfo.logoUrlWhite, + bannerUrl: stateInfo.bannerUrl, + }, + localizationModules: stateInfo.localizationModules, + modules: MdmsRes?.tenant?.citymodule?.filter((module) => module?.active)?.filter((module) => enabledModules?.includes(module?.code))?.sort((x,y)=>x?.order-y?.order)|| [], + uiHomePage: uiHomePage + }; + + + initData.selectedLanguage = Digit.SessionStorage.get("locale") || initData.languages[0].value; + + ApiCacheService.saveSetting(MdmsRes["DIGIT-UI"]?.ApiCachingSettings); + + const moduleTenants = initData.modules + .map((module) => module.tenants) + .flat() + .reduce((unique, ele) => (unique.find((item) => item.code === ele.code) ? unique : [...unique, ele]), []); + initData.tenants = MdmsRes?.tenant?.tenants + .map((tenant) => ({ i18nKey: `TENANT_TENANTS_${tenant.code.replace(".", "_").toUpperCase()}`, ...tenant })); + // .filter((item) => !!moduleTenants.find((mt) => mt.code === item.code)) + // .map((tenant) => ({ i18nKey: `TENANT_TENANTS_${tenant.code.replace(".", "_").toUpperCase()}`, ...tenant })); + + await LocalizationService.getLocale({ + modules: [ + `${modulePrefix}-common`, + `${modulePrefix}-${stateCode.toLowerCase()}` + ], + locale: initData.selectedLanguage, + tenantId: stateCode, + }); + Storage.set("initData", initData); + initData.revenue_localities = revenue_localities; + initData.localities = localities; + setTimeout(() => { + renderTenantLogos(stateInfo, initData.tenants); + }, 0); + return initData; + }, + defaultData: async (stateCode, moduleCode, language, modulePrefix) => { + let moduleCodes = []; + if(typeof moduleCode !== "string") moduleCode.forEach(code => { moduleCodes.push(`${modulePrefix}-${code.toLowerCase()}`) }); + const LocalePromise = LocalizationService.getLocale({ + modules: typeof moduleCode == "string" ? [`${modulePrefix}-${moduleCode.toLowerCase()}`] : moduleCodes, + locale: language, + tenantId: stateCode, + }); + await LocalePromise; + return {}; + }, +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/StoreData.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/StoreData.js new file mode 100644 index 0000000..dcc5e2f --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/StoreData.js @@ -0,0 +1,8 @@ +import { StoreService } from "./Store/service"; + +const StoreData = { + getInitData: () => StoreService.getInitData(), + getCurrentLanguage: () => Digit.SessionStorage.get("locale") || Digit.Utils.getDefaultLanguage(), +}; + +export default StoreData; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Ulb/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Ulb/index.js new file mode 100644 index 0000000..9d1be0b --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Ulb/index.js @@ -0,0 +1,148 @@ +import { StoreService } from "../Store/service"; +import { UserService } from "../../elements/User"; + +/** + * Custom service which can be used to + * get current tenantId + * get state tenant + * get current ulb + * get citizen selected tenant + * get all ulbs of employee + * + * @author jagankumar-egov + * + * @example + * Digit.ULBService.getCurrentTenantId() + * + * @returns {Object} Returns based on the called function + */ +export const ULBService = { + /** + * Custom method to get employee's current selected city + * + * @author jagankumar-egov + * + * @example + * Digit.ULBService.getCurrentTenantId() + * + * @returns {String} + */ + getCurrentTenantId: () => { + // TODO: change when setter is done. + const user = UserService.getUser(); + if (user?.extraRoleInfo) { + const isDsoRoute = Digit.Utils.detectDsoRoute(window.location.pathname); + if (isDsoRoute) { + return user.extraRoleInfo?.tenantId; + } + } + //TODO: fix tenant id from userinfo + const tenantId = + user?.info?.type === "EMPLOYEE" && user?.info?.tenantId ? user?.info?.tenantId : window?.globalConfigs.getConfig("STATE_LEVEL_TENANT_ID"); + return tenantId; + }, + /** + * Custom method to get current environment home / state tenant + * + * @author jagankumar-egov + * + * @example + * Digit.ULBService.getStateId() + * + * @returns {String} + */ + getStateId: () => { + return window?.globalConfigs?.getConfig("STATE_LEVEL_TENANT_ID"); + }, + /** + * Custom method to get employee's current ulb object + * + * @author jagankumar-egov + * + * @example + * Digit.ULBService.getCurrentUlb() + * + * @returns {Object} + */ + getCurrentUlb: () => { + const initData = StoreService.getInitData(); + const tenantId = ULBService.getCurrentTenantId(); + return initData?.tenants?.find((tenant) => tenant?.code === tenantId)||ULBService.getStateId(); + } + /** + * Custom method to get citizen's current selected city + * + * @author jagankumar-egov + * + * @example + * Digit.ULBService.getCitizenCurrentTenant() -> will return selected home city if not loggedin users city if not state tenant + * + * Digit.ULBService.getCitizenCurrentTenant(true) -> will return selected home city + * + * @returns {String} + */, + getCitizenCurrentTenant: (selectedCity=false) => { + const homeCity=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; + if(selectedCity){ + return homeCity; + } + return homeCity|| Digit.UserService.getUser()?.info?.permanentCity || ULBService.getStateId(); + }, + /** + * Custom method to get all ulb's which the loggedin employee has access to + * + * + * @example + * Digit.ULBService.getUserUlbs() + * + * @returns {Array} array of objects in the following structure + * + * [ { + * i18nKey:"", + * value:"", + * code:"", + * name:"" + * }] + */ + getUserUlbs: (userRole = "") => { + const stringReplaceAll = (str = "", searcher = "", replaceWith = "") => { + if (searcher == "") return str; + while (str?.includes(searcher)) { + str = str?.replace(searcher, replaceWith); + } + return str; + }; + + const userloggedValues = Digit.SessionStorage.get("citizen.userRequestObject"); + let teantsArray = [], + filteredArray = []; + if (userRole === "") { + userloggedValues?.info?.roles?.forEach((role) => teantsArray.push(role.tenantId)); + let unique = teantsArray.filter((item, i, ar) => ar.indexOf(item) === i); + + unique?.forEach((uniCode) => { + filteredArray.push({ + i18nKey: `TENANT_TENANTS_${stringReplaceAll(uniCode, ".", "_")?.toUpperCase()}`, + value: uniCode, + code: uniCode, + name: uniCode.substring(uniCode.indexOf(".") + 1), + }); + }); + return filteredArray; + } else { + userloggedValues?.info?.roles?.forEach((role) => { + if (userRole === role.code) teantsArray.push(role.tenantId); + }); + let unique = teantsArray.filter((item, i, ar) => ar.indexOf(item) === i); + unique?.forEach((uniCode) => { + filteredArray.push({ + i18nKey: `TENANT_TENANTS_${stringReplaceAll(uniCode, ".", "_")?.toUpperCase()}`, + value: uniCode, + code: uniCode, + name: uniCode.substring(uniCode.indexOf(".") + 1), + }); + }); + return filteredArray; + } + } +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/getLocalities.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/getLocalities.js new file mode 100644 index 0000000..84c713e --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/getLocalities.js @@ -0,0 +1,13 @@ +import { LocationService } from "../elements/Location"; +import { StoreService } from "./Store/service"; + +export const getLocalities = { + admin: async (tenant) => { + await StoreService.defaultData(tenant, tenant, Digit.StoreData.getCurrentLanguage()); + return (await LocationService.getLocalities(tenant)).TenantBoundary[0]; + }, + revenue: async (tenant) => { + await StoreService.defaultData(tenant, tenant, Digit.StoreData.getCurrentLanguage()); + return (await LocationService.getRevenueLocalities(tenant)).TenantBoundary[0]; + }, +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/subFormRegistry.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/subFormRegistry.js new file mode 100644 index 0000000..0ffa4ec --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/subFormRegistry.js @@ -0,0 +1,43 @@ +export class SubformRegistry { + constructor(registry = {}) { + this._registry = registry; + } + + getSubform = (key) => this._registry[key]; + + addSubForm = (key, config) => (this._registry[key] = config); + + changeConfig = async (key, callBack) => { + let config = this.getSubform(key); + let newConfig = await callBack(config); + this._registry[key] = newConfig; + }; + + addMiddleware = ( + subFormKey, + middlewareKey, + middlewareFn, + { functionName, preceedingName = "", preceedingIndex = null, exceedingName = "", exceedingIndex = null } + ) => { + let config = this.getSubform(subFormKey); + let { middlewares } = config; + const setPreceedingIndex = (preceedingIndex) => { + let firstChunk = middlewares.splice(0, preceedingIndex + 1); + middlewares = [...firstChunk, { [functionName]: middlewareFn }, ...middlewares]; + }; + + const setExceedingIndex = (exceedingIndex) => { + let firstChunk = middlewares.splice(0, exceedingIndex); + middlewares = [...firstChunk, { [functionName]: middlewareFn }, ...middlewares]; + }; + + if (preceedingIndex) setPreceedingIndex(preceedingIndex); + else if (exceedingIndex) setExceedingIndex(exceedingIndex); + else if (preceedingName) { + let element = middlewares.filter((e) => Object.keys(e)[0] === preceedingName)[0] || null; + } else if (exceedingName) { + } + }; +} + +export const subFormRegistry = new SubformRegistry({}); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/translations/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/translations/index.js new file mode 100644 index 0000000..9c54bbe --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/translations/index.js @@ -0,0 +1,61 @@ +import i18next from "i18next"; +import { initReactI18next } from "react-i18next"; +import ReactPostprocessor from "i18next-react-postprocessor"; + +const i18nextConfig = () => ({ + lng: Digit.StoreData.getCurrentLanguage(), + fallbackLng: Digit.Utils.getDefaultLanguage(), + debug: false, + ns: ["translations"], + defaultNS: "translations", + keySeparator: false, + saveMissing: false, + saveMissingTo: "current", + interpolation: { + escapeValue: false, + formatSeparator: ",", + }, + postProcess: [`reactPostprocessor`, "templatePostprocessor"], + react: { + useSuspense: true, + bindI18n: "loaded", + bindI18nStore: "added", + }, + resources: { + [Digit.Utils.getDefaultLanguage()]: { + translations: { + welcome: "Welcome", + }, + }, + }, +}); + +function replaceLiterals(text = "", dynamicValues = {}) { + let returnText = text; + const regex = /[^\{\{][\{]\w+/; + if (regex.exec(text) !== null) { + Object.keys(dynamicValues).forEach((key) => { + returnText = returnText.replace(`{${key.toUpperCase()}}`, dynamicValues[key]); + }); + } + return returnText; +} + +const templatePostprocessor = { + type: "postProcessor", + name: "templatePostprocessor", + process: function (value, key, options, translator) { + return replaceLiterals(value, options); + }, +}; + +export const initI18n = (callback) => { + return i18next + .use(new ReactPostprocessor()) + .use(templatePostprocessor) + .use(initReactI18next) + .init(i18nextConfig(), () => { + window.i18next = i18next; + callback(); + }); +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/browser.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/browser.js new file mode 100644 index 0000000..56074b7 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/browser.js @@ -0,0 +1,35 @@ +const checkWebview = () => { + const ua = navigator.userAgent; + let rules = [ + // if it says it's a webview, let's go with that + "WebView", + // iOS webview will be the same as safari but missing "Safari" + "(iPhone|iPod|iPad)(?!.*Safari)", + // Android Lollipop and Above: webview will be the same as native but it will contain "wv" + // Android KitKat to lollipop webview will put {version}.0.0.0 + "Android.*(wv|.0.0.0)", + // old chrome android webview agent + "Linux; U; Android", + ]; + + const webviewRegExp = new RegExp("(" + rules.join("|") + ")", "ig"); + return !!ua.match(webviewRegExp); +}; + +const mobileCheck = () => { + let check = false; + (function (a) { + if ( + /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test( + a + ) || + /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test( + a.substr(0, 4) + ) + ) + check = true; + })(navigator.userAgent || navigator.vendor || window.opera); + return check; +}; + +export default { isWebview: checkWebview, isMobile: mobileCheck }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/componentRegistry.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/componentRegistry.js new file mode 100644 index 0000000..8c1a5a2 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/componentRegistry.js @@ -0,0 +1,23 @@ +class ComponentRegistry { + constructor() { + this._registry = {}; + } + + getComponent(id) { + return this._registry[id]; + } + + setComponent(id, component) { + this._registry[id] = component; + return true; + } + + setAllComponents(components) { + Object.entries(components).forEach(([key, value]) => { + this.setComponent(key, value); + }); + return this._registry; + } +} + +export default ComponentRegistry; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/date.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/date.js new file mode 100644 index 0000000..f2f4160 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/date.js @@ -0,0 +1,56 @@ +function getDate(timestamp) { + const dt = timestamp ? new Date(timestamp) : new Date(); + let dd = dt.getDate(); + let mm = dt.getMonth() + 1; + var yyyy = dt.getFullYear(); + + if (dd < 10) { + dd = "0" + dd; + } + + if (mm < 10) { + mm = "0" + mm; + } + + return yyyy + "-" + mm + "-" + dd; +} + +const monthNames = ["Jan", "Feb", "March", "Apr", "May", "June", "July", "Aug", "Sep", "Oct", "Nov", "Dec"]; + +/* +Digit.Utils.date.convertDateToEpoch() +* @params dateString date as string +dayStartOrEnd defaults to dayend + + //example input format : "2018-10-02" + +*/ +const convertDateToEpoch = (dateString, dayStartOrEnd = "dayend") => { + try { + const parts = dateString.match(/(\d{4})-(\d{1,2})-(\d{1,2})/); + const DateObj = new Date(Date.UTC(parts[1], parts[2] - 1, parts[3])); + DateObj.setMinutes(DateObj.getMinutes() + DateObj.getTimezoneOffset()); + if (dayStartOrEnd === "dayend") { + DateObj.setHours(DateObj.getHours() + 24); + DateObj.setSeconds(DateObj.getSeconds() - 1); + } + return DateObj.getTime(); + } catch (e) { + return dateString; + } +}; + + const convertEpochToDate = (dateEpoch) => { + if (dateEpoch == null || dateEpoch == undefined || dateEpoch == "") { + return "NA"; + } + const dateFromApi = new Date(dateEpoch); + let month = dateFromApi.getMonth() + 1; + let day = dateFromApi.getDate(); + let year = dateFromApi.getFullYear(); + month = (month > 9 ? "" : "0") + month; + day = (day > 9 ? "" : "0") + day; + return `${day}/${month}/${year}`; +}; + +export { getDate, monthNames ,convertDateToEpoch , convertEpochToDate }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/dss/dynamicRequestGenerator.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/dss/dynamicRequestGenerator.js new file mode 100644 index 0000000..9d5d4b2 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/dss/dynamicRequestGenerator.js @@ -0,0 +1,101 @@ +import { Request } from "../../services/atoms/Utils/Request"; +export const getFilterValue = (filter) => { + if (filter?.source?.type == 'request') { + return getRequestFilterValues(filter); + } else if (filter?.source?.type == 'list') { + return getListFilterValues(filter); + } else return; +} + +const getRequestFilterValues = (filter) => { + return new Promise((resolve, reject) => { + try { + let request = getRequestPayload(filter.source); + Request(request).then((res) => { + var jp = require('jsonpath'); + let keys = jp.query(res, filter.source.keyPath); + let values = jp.query(res, filter.source.valuesPath); + let filtersValues = []; + if (keys && values && keys.length && values.length && keys.length == values.length) { + keys.forEach((key, idx) => { + filtersValues.push({'key': key, 'value': values[idx]}) + }) + } + resolve({'id': filter.id, 'values': filtersValues}) + }).catch(err => { + resolve({'id': filter.id, 'values': null}) + }) + } catch (error) { + reject(error); + } + }) +} + +const getListFilterValues = (filter) => { + return new Promise((resolve, reject) => { + let listValue = filter.source.list; + var jp = require('jsonpath'); + let keys = jp.query(listValue, filter.source.keyPath); + let values = jp.query(listValue, filter.source.valuesPath); + let filtersValues = []; + if (keys && values && keys.length && values.length && keys.length == values.length) { + keys.forEach((key, idx) => { + filtersValues.push({'key': key, 'value': values[idx]}) + }) + } + resolve({'id': filter.id, 'values': filtersValues}) + }) +} + +const getRequestPayload = (filterConfig) => { + let request = {}; + request["method"] = filterConfig?.requestMethod ? filterConfig.requestMethod : "POST"; + request["url"] = filterConfig?.hostUrl ? filterConfig.hostUrl + filterConfig.requestUrl : filterConfig.requestUrl; + request["authHeader"] = true; + request["useCache"] = true; + request["userService"] = true; + request["locale"] = true; + if (filterConfig?.requestBody && filterConfig.requestBody.length) { + request["data"] = JSON.parse(filterConfig.requestBody); + } + return request; +} + +export const getParsedRequest = (filterSource, filterValues) => { + var jp = require('jsonpath'); + if (filterSource?.requestUrl && filterSource?.requestUrl.length) { + let replacableList = getReplacableValues(filterSource.requestUrl); + replacableList.forEach((str) => { + let value = jp.query(filterValues, str); + filterSource.requestUrl = filterSource.requestUrl.replace(`{${str}}`, value) + }) + } + if (filterSource?.requestBody && filterSource?.requestBody.length) { + let replacableList = getReplacableValues(filterSource.requestBody); + replacableList.forEach((str) => { + let value = jp.query(filterValues, str); + filterSource.requestBody = filterSource.requestBody.replace(`{${str}}`, value) + }) + } + return filterSource; +} + +const getReplacableValues = (requestString) => { + let replacableValues = []; + let isReplacable = false; + let replacableStr = ""; + for (let idx=0; idx { + const currencyFormatter = new Intl.NumberFormat("en-IN", { currency: "INR" }); + + switch (denomination) { + case "Lac": + return `₹ ${currencyFormatter.format((value / 100000).toFixed(2) || 0)} ${t("ES_DSS_LAC")}`; + case "Cr": + return `₹ ${currencyFormatter.format((value / 10000000).toFixed(2) || 0)} ${t("ES_DSS_CR")}`; + case "Unit": + return `₹ ${currencyFormatter.format(value?.toFixed(2) || 0)}`; + default: + return ""; + } +}; + +export const formatter = (value, symbol, unit, commaSeparated = true, t) => { + if (!value && value !== 0) return ""; + switch (symbol) { + case "amount": + return amountFormatter(value, unit, t); + //this case needs to be removed as backend should handle case sensitiviy from their end + case "Amount": + return amountFormatter(value, unit, t); + case "number": + if (!commaSeparated) { + return parseInt(value); + } + const Nformatter = new Intl.NumberFormat("en-IN"); + return Nformatter.format(value); + case "percentage": + const Pformatter = new Intl.NumberFormat("en-IN", { maximumSignificantDigits: 3 }); + return `${Pformatter.format(value.toFixed(2))} %`; + default: + return ""; + } +}; + +export const getDuration = (startDate, endDate) => { + let noOfDays = (new Date(endDate).getTime() - new Date(startDate).getTime()) / (1000 * 3600 * 24); + if (noOfDays > 91) { + return "month"; + } + if (noOfDays < 90 && noOfDays >= 14) { + return "week"; + } + if (noOfDays <= 14) { + return "day"; + } +}; + +export const getInitialRange = () => { + const startDate = addMonths(startOfYear(new Date()), 3); + const endDate = addMonths(endOfYear(new Date()), 3); + const title = `${format(startDate, "MMM d, yy")} - ${format(endDate, "MMM d, yy")}`; + const duration = Digit.Utils.dss.getDuration(startDate, endDate); + return { startDate, endDate, title, duration }; +}; + +export const getDatesBackFromToday = (numberOfDays) => { + const endDate = endOfDay(new Date()); + const startDate = startOfDay(addDays(new Date(), - (numberOfDays-1))); + const title = `${format(startDate, "MMM d, yy")} - ${format(endDate, "MMM d, yy")}`; + const duration = Digit.Utils.dss.getDuration(startDate, endDate); + return { startDate, endDate, title, duration }; +}; + +export const getDateDiffrenence = (startDate, endDate) => { + return differenceInDays(startDate, endDate); +} + +export const getDefaultFinacialYear = () => { + const currDate = new Date().getMonth(); + if (currDate < 3) { + return { + startDate: subYears(addMonths(startOfYear(new Date()), 3), 1), + endDate: endOfToday(new Date()), + // endDate: subYears(addMonths(endOfYear(new Date()), 3), 1), RAIN-5752 : to keep date till current date and not a financial year + + }; + } else { + return { + startDate: addMonths(startOfYear(new Date()), 3), + endDate: endOfToday(new Date()), +// endDate: addMonths(endOfYear(new Date()), 3), + + }; + } +}; + +/* Used in DSS to get the current module id */ +export const getCurrentModuleName=()=>{ + const allPaths= window.location.pathname.split('/'); + return allPaths[allPaths.length-1]; +} + +/* Used in DSS to get the filtered ulbs for selected city */ +export const checkSelected = (e, selectedDDRs) => { + if (!selectedDDRs || selectedDDRs?.length == 0) { + return true; + } else if (selectedDDRs.find((ddr) => ddr.ddrKey == e.ddrKey)) { + return true; + } else { + return false; + } +}; + + +/* Used in DSS to get the filtered ulbs for selected city for global filter*/ +export const getCitiesAvailable = (e, selectedDDRs) => { + if (!selectedDDRs || selectedDDRs?.length == 0) { + return true; + } else if (selectedDDRs.find((ddr) => ddr == e.ddrKey)) { + return true; + } else { + return false; + } +}; + +export const getCustomFiltersDynamicValues = async (filterConfig, dynamicValues) => { + if (filterConfig && dynamicValues) { + filterConfig = filterConfig.map((filter) => { + if (filter?.source?.type == 'request') { + filter.source = getParsedRequest(filter.source, dynamicValues); + } + return filter; + }) + } + return filterConfig; +} + +export const getFilterOptionsForConfig = async (filterConfig) => { + let filtersData = {}; + if (filterConfig) { + let requests = []; + filterConfig.forEach((filter) => { + if (filter?.source) { + requests.push(getFilterValue(filter)) + } + }) + await Promise.all(requests).then((res) => { + if (res && res.length) { + res.forEach((filterRes) => { + if (filterRes?.id && filterRes?.values) + filtersData[filterRes.id] = filterRes?.values; + }) + } + }); + } + return filtersData; +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/fileType.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/fileType.js new file mode 100644 index 0000000..1eb15cf --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/fileType.js @@ -0,0 +1,7 @@ +const getFileTypeFromFileStoreURL = (filestoreURL) => { + if(filestoreURL.includes(".pdf")) return "pdf" + if(filestoreURL.includes(".jpg") || filestoreURL.includes(".jpeg") || filestoreURL.includes(".png") || filestoreURL.includes(".webp")) return "image" + else return "image" +} + +export default getFileTypeFromFileStoreURL \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/fonts.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/fonts.js new file mode 100644 index 0000000..da43efd --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/fonts.js @@ -0,0 +1,2 @@ +export const Fonts = { + }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/fsm/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/fsm/index.js new file mode 100644 index 0000000..8f93baf --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/fsm/index.js @@ -0,0 +1,94 @@ +export const getPropertyTypeLocale = (value) => { + return `PROPERTYTYPE_MASTERS_${value?.split(".")[0]}`; +}; + +export const getPropertySubtypeLocale = (value) => `PROPERTYTYPE_MASTERS_${value}`; + +export const getVehicleType = (vehicle, t) => { + return (vehicle?.i18nKey && vehicle?.capacity && `${t(vehicle.i18nKey)} - ${vehicle.capacity} ${t("CS_COMMON_CAPACITY_LTRS")}`) || null; +}; + +export const updateConfiguration = ({ config, defaultConfig, detailsConfig, customConfiguration, isDefaultConfig }) => { + const fieldSectionNamesInsideConfig = []; + const detailsConfigCopy = { ...detailsConfig }; + + customConfiguration.forEach((detail) => { + // Adding custom fields to FieldSection fields array (body) + if (detailsConfigCopy[detail.name] && detail.addFields) { + detailsConfigCopy[detail.name].body.push(...detail.addFields); + } + + let body = []; + + // adding fields to body array + if (detail?.fieldsOrder?.length > 0) { + // fields order + detail.fieldsOrder.forEach((fieldName) => { + if (detailsConfigCopy[detail.name]) { + body.push(detailsConfigCopy[detail.name].body.find((value) => value.name === fieldName)); + } + }); + + // adding remaining fields to the body array which are not in detail?.fieldsOrder + if (detail?.allFields) { + detailsConfigCopy[detail.name]?.body?.forEach((field) => { + if (!detail?.fieldsOrder?.includes(field.name)) { + body.push(detailsConfigCopy[detail.name].body.find((value) => value.name === field.name)); + } + }); + } + } else { + body = detailsConfigCopy[detail.name].body; + } + + // remove fields + if (detail?.removeFields) { + detail?.removeFields?.forEach((fieldName) => { + body = body.filter((field) => field.name !== fieldName); + }); + } + + // adding FieldSection to config + if (detailsConfigCopy[detail.name]) { + config.push({ + head: detailsConfigCopy[detail.name].head, + body, + }); + fieldSectionNamesInsideConfig.push(detail.name); + } + }); + + // adding remaining FieldSection to config + if (isDefaultConfig) { + defaultConfig?.forEach((fieldSectionName) => { + if (!fieldSectionNamesInsideConfig.includes(fieldSectionName) && detailsConfigCopy[fieldSectionName]) { + config.push(detailsConfigCopy[fieldSectionName]); + fieldSectionNamesInsideConfig.push(fieldSectionName); + } + }); + } +}; + +// How to use above updateConfiguration function +// let config = []; + +// const defaultConfig = ["applicationDetails", "propertyDetails", "locationDetails", "paymentDetails"]; + +// const { Customizations } = window.Digit; +// let employeeCustomizations = false; + +// if (Customizations?.FSM?.getEmployeeApplicationCustomization) { +// employeeCustomizations = Customizations?.FSM?.getEmployeeApplicationCustomization(defaultConfig, t); +// } + +// if (employeeCustomizations?.config?.length > 0) { +// updateConfiguration({ +// config, +// defaultConfig, +// detailsConfig, +// customConfiguration: employeeCustomizations?.config, +// isDefaultConfig: employeeCustomizations?.defaultConfig, +// }); +// } else { +// defaultConfig.forEach((fieldSectionName) => config.push(detailsConfig[fieldSectionName])); +// } diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js new file mode 100644 index 0000000..6eef77a --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js @@ -0,0 +1,382 @@ +import BrowserUtil from "./browser"; +import * as date from "./date"; +import * as dss from "./dss"; +import * as locale from "./locale"; +import * as obps from "./obps"; +import * as pt from "./pt"; +import * as privacy from "./privacy"; +import PDFUtil, { downloadReceipt ,downloadPDFFromLink,downloadBill ,getFileUrl} from "./pdf"; +import getFileTypeFromFileStoreURL from "./fileType"; +import preProcessMDMSConfig from "./preProcessMDMSConfig"; +import preProcessMDMSConfigInboxSearch from "./preProcessMDMSConfigInboxSearch"; +import * as parsingUtils from "../services/atoms/Utils/ParsingUtils" +const GetParamFromUrl = (key, fallback, search) => { + if (typeof window !== "undefined") { + search = search || window.location.search; + const params = new URLSearchParams(search); + return params.has(key) ? params.get(key) : fallback; + } + return fallback; +}; + +const getPattern = (type) => { + switch (type) { + case "Name": + return /^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i; + case "SearchOwnerName": + return /^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{3,50}$/i; + case "MobileNo": + return /^[6789][0-9]{9}$/i; + case "Amount": + return /^[0-9]{0,8}$/i; + case "NonZeroAmount": + return /^[1-9][0-9]{0,7}$/i; + case "DecimalNumber": + return /^\d{0,8}(\.\d{1,2})?$/i; + case "Email": + return /^(?=^.{1,64}$)((([^<>()\[\]\\.,;:\s$*@'"]+(\.[^<>()\[\]\\.,;:\s@'"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,})))$/i; + case "Address": + return /^[^\$\"<>?\\\\~`!@$%^()+={}\[\]*:;“”‘’]{1,500}$/i; + case "PAN": + return /^[A-Za-z]{5}\d{4}[A-Za-z]{1}$/i; + case "TradeName": + return /^[-@.\/#&+\w\s]*$/; + case "Date": + return /^[12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/i; + case "UOMValue": + return /^(0)*[1-9][0-9]{0,5}$/i; + case "OperationalArea": + return /^(0)*[1-9][0-9]{0,6}$/i; + case "NoOfEmp": + return /^(0)*[1-9][0-9]{0,6}$/i; + case "GSTNo": + return /^\d{2}[A-Z]{5}\d{4}[A-Z]{1}\d[Z]{1}[A-Z\d]{1}$/i; + case "DoorHouseNo": + return /^[^\$\"'<>?~`!@$%^={}\[\]*:;“”‘’]{1,50}$/i; + case "BuildingStreet": + return /^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,64}$/i; + case "Pincode": + return /^[1-9][0-9]{5}$/i; + case "Landline": + return /^[0-9]{11}$/i; + case "PropertyID": + return /^[a-zA-z0-9\s\\/\-]$/i; + case "ElectricityConnNo": + return /^.{1,15}$/i; + case "DocumentNo": + return /^[0-9]{1,15}$/i; + case "eventName": + return /^[^\$\"<>?\\\\~`!@#$%^()+={}\[\]*,.:;“”]{1,65}$/i; + case "eventDescription": + return /^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,500}$/i; + case "cancelChallan": + return /^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,100}$/i; + case "FireNOCNo": + return /^[a-zA-Z0-9-]*$/i; + case "consumerNo": + return /^[a-zA-Z0-9/-]*$/i; + case "AadharNo": + return /^([0-9]){12}$/; + case "ChequeNo": + return /^(?!0{6})[0-9]{6}$/; + case "Comments": + return /^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,50}$/i; + case "OldLicenceNo": + return /^[a-zA-Z0-9-/]{0,64}$/; + case "bankAccountNo": + return /^\d{9,18}$/; + case "IFSC": + return /^[A-Z]{4}0[A-Z0-9]{6}$/; + case "ApplicationNo": + return /^[a-zA-z0-9\s\\/\-]$/i; + } +}; +/* +Digit.Utils.getUnique() +get unique elements from an array */ +const getUnique = (arr) => { + return arr.filter((value, index, self) => self.indexOf(value) === index); +}; + +/* +Digit.Utils.createFunction() +get function from a string */ +const createFunction = (functionAsString) => { + return Function("return " + functionAsString)(); +}; + +const getStaticMapUrl = (latitude, longitude) => { + const key = globalConfigs?.getConfig("GMAPS_API_KEY"); + return `https://maps.googleapis.com/maps/api/staticmap?markers=${latitude},${longitude}&zoom=15&size=400x400&key=${key}&style=element:geometry%7Ccolor:0xf5f5f5&style=element:labels.icon%7Cvisibility:off&style=element:labels.text.fill%7Ccolor:0x616161&style=element:labels.text.stroke%7Ccolor:0xf5f5f5&style=feature:administrative.land_parcel%7Celement:labels.text.fill%7Ccolor:0xbdbdbd&style=feature:poi%7Celement:geometry%7Ccolor:0xeeeeee&style=feature:poi%7Celement:labels.text.fill%7Ccolor:0x757575&style=feature:poi.park%7Celement:geometry%7Ccolor:0xe5e5e5&style=feature:poi.park%7Celement:labels.text.fill%7Ccolor:0x9e9e9e&style=feature:road%7Celement:geometry%7Ccolor:0xffffff&style=feature:road.arterial%7Celement:labels.text.fill%7Ccolor:0x757575&style=feature:road.highway%7Celement:geometry%7Ccolor:0xdadada&style=feature:road.highway%7Celement:labels.text.fill%7Ccolor:0x616161&style=feature:road.local%7Celement:labels.text.fill%7Ccolor:0x9e9e9e&style=feature:transit.line%7Celement:geometry%7Ccolor:0xe5e5e5&style=feature:transit.station%7Celement:geometry%7Ccolor:0xeeeeee&style=feature:water%7Celement:geometry%7Ccolor:0xc9c9c9&style=feature:water%7Celement:labels.text.fill%7Ccolor:0x9e9e9e`; +}; + +/** + * Custom util to get the default region + * + * @author jagankumar-egov + * + * @example + * Digit.Hooks.Utils.getLocaleRegion() + * + * @returns {string} + */ +const getLocaleRegion = () => { + return window?.globalConfigs?.getConfig("LOCALE_REGION") || "IN"; +}; +/** + * Custom util to get the default locale + * + * @author jagankumar-egov + * + * @example + * Digit.Hooks.Utils.getLocaleDefault() + * + * @returns {string} + */ +const getLocaleDefault = () => { + return globalConfigs?.getConfig("LOCALE_DEFAULT") || "en"; +}; + +/** + * Custom util to get the default language + * + * @author jagankumar-egov + * + * @example + * Digit.Utils.getDefaultLanguage() + * + * @returns {string} + */ +const getDefaultLanguage = () => { + return `${getLocaleDefault()}_${getLocaleRegion()}`; +}; + +const detectDsoRoute = (pathname) => { + const employeePages = ["search", "inbox", "dso-dashboard", "dso-application-details", "user"]; + + return employeePages.some((url) => pathname.split("/").includes(url)); +}; + +const routeSubscription = (pathname) => { + let classname = "citizen"; + const isEmployeeUrl = detectDsoRoute(pathname); + if (isEmployeeUrl && classname === "citizen") { + return (classname = "employee"); + } else if (!isEmployeeUrl && classname === "employee") { + return (classname = "citizen"); + } +}; + + +/* to check the employee (loggedin user ) has given role */ +const didEmployeeHasRole = (role = "") => { + const tenantId = Digit.ULBService.getCurrentTenantId(); + const userInfo = Digit.UserService.getUser(); + const rolearray = userInfo?.info?.roles.filter((item) => { + if (item.code === role && item.tenantId === tenantId) return true; + }); + return rolearray?.length > 0; +}; + +/* to check the employee (loggedin user ) has given roles */ +const didEmployeeHasAtleastOneRole = (roles = []) => { + return roles.some((role) => didEmployeeHasRole(role)); +}; + +const pgrAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + const pgrRoles = ["PGR_LME", "PGR-ADMIN", "CSR", "CEMP", "FEMP", "DGRO", "ULB Operator", "GRO", "GO", "RO", "GA"]; + + const PGR_ACCESS = userRoles?.filter((role) => pgrRoles.includes(role)); + + return PGR_ACCESS?.length > 0; +}; + +const fsmAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + const fsmRoles = [ + "FSM_CREATOR_EMP", + "FSM_EDITOR_EMP", + "FSM_VIEW_EMP", + "FSM_REPORT_VIEWER", + "FSM_DASHBOARD_VIEWER", + "FSM_ADMIN", + "FSM_DSO", + "FSM_DRIVER", + "FSM_EMP_FSTPO", + "FSM_COLLECTOR", + ]; + + const FSM_ACCESS = userRoles?.filter((role) => fsmRoles?.includes(role)); + + return FSM_ACCESS?.length > 0; +}; + +const NOCAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + + const NOC_ROLES = [ + "FIRE_NOC_APPROVER" + ] + + const NOC_ACCESS = userRoles?.filter((role) => NOC_ROLES?.includes(role)); + + return NOC_ACCESS?.length > 0; +}; + +const BPAREGAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + + const BPAREG_ROLES = ["BPAREG_APPROVER", "BPAREG_DOC_VERIFIER"]; + + const BPAREG_ACCESS = userRoles?.filter((role) => BPAREG_ROLES?.includes(role)); + + return BPAREG_ACCESS?.length > 0; +}; + +const BPAAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + + const BPA_ROLES = [ + "BPA_VERIFIER", + "CEMP", + "BPA_APPROVER", + "BPA_FIELD_INSPECTOR", + "BPA_NOC_VERIFIER", + "AIRPORT_AUTHORITY_APPROVER", + "FIRE_NOC_APPROVER", + "NOC_DEPT_APPROVER", + "BPA_NOC_VERIFIER", + "BPA_TOWNPLANNER", + "BPA_ENGINEER", + "BPA_BUILDER", + "BPA_STRUCTURALENGINEER", + "BPA_SUPERVISOR", + "BPA_DOC_VERIFIER", + "EMPLOYEE", + ]; + + const BPA_ACCESS = userRoles?.filter((role) => BPA_ROLES?.includes(role)); + + return BPA_ACCESS?.length > 0; +}; + +const ptAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + const ptRoles = ["PT_APPROVER", "PT_CEMP", "PT_DOC_VERIFIER", "PT_FIELD_INSPECTOR"]; + + const PT_ACCESS = userRoles?.filter((role) => ptRoles?.includes(role)); + + return PT_ACCESS?.length > 0; +}; + +const tlAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + const tlRoles = ["TL_CEMP", "TL_APPROVER", "TL_FIELD_INSPECTOR", "TL_DOC_VERIFIER"]; + + const TL_ACCESS = userRoles?.filter((role) => tlRoles?.includes(role)); + + return TL_ACCESS?.length > 0; +}; + +const mCollectAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + const mCollectRoles = ["UC_EMP"]; + + const MCOLLECT_ACCESS = userRoles?.filter((role) => mCollectRoles?.includes(role)); + + return MCOLLECT_ACCESS?.length > 0; +}; + +const receiptsAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles.map((roleData) => roleData?.code); + const receiptsRoles = ["CR_PT"]; + const RECEIPTS_ACCESS = userRoles?.filter((role) => receiptsRoles?.includes(role)); + return RECEIPTS_ACCESS?.length > 0; +}; +const hrmsRoles = ["HRMS_ADMIN"]; +const hrmsAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + const HRMS_ACCESS = userRoles?.filter((role) => hrmsRoles?.includes(role)); + return HRMS_ACCESS?.length > 0; +}; + +const wsAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + const waterRoles = ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER","WS_CLERK"]; + + const WS_ACCESS = userRoles?.filter((role) => waterRoles?.includes(role)); + + return WS_ACCESS?.length > 0; +}; + +const swAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + const sewerageRoles = ["SW_CEMP", "SW_APPROVER", "SW_FIELD_INSPECTOR", "SW_DOC_VERIFIER","SW_CLERK"]; + + const SW_ACCESS = userRoles?.filter((role) => sewerageRoles?.includes(role)); + + return SW_ACCESS?.length > 0; +}; + +/* to get the MDMS config module name */ +const getConfigModuleName = () => { + return window?.globalConfigs?.getConfig("UICONFIG_MODULENAME") || "commonUiConfig"; +}; +export default { + pdf: PDFUtil, + createFunction, + downloadReceipt, + downloadBill, + downloadPDFFromLink, + downloadBill, + getFileUrl, + getFileTypeFromFileStoreURL, + browser: BrowserUtil, + locale, + date, + GetParamFromUrl, + getStaticMapUrl, + detectDsoRoute, + routeSubscription, + pgrAccess, + fsmAccess, + BPAREGAccess, + BPAAccess, + dss, + obps, + pt, + ptAccess, + NOCAccess, + mCollectAccess, + receiptsAccess, + didEmployeeHasRole, + didEmployeeHasAtleastOneRole, + hrmsAccess, + getPattern, + hrmsRoles, + getUnique, + tlAccess, + wsAccess, + swAccess, + getConfigModuleName, + preProcessMDMSConfig, + preProcessMDMSConfigInboxSearch, + parsingUtils, + ...privacy, + getDefaultLanguage, + getLocaleDefault, + getLocaleRegion +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/locale.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/locale.js new file mode 100644 index 0000000..fc21d80 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/locale.js @@ -0,0 +1,110 @@ +/** + * Custom utils related for all locale related items + * + * @author jagankumar-egov + * + * @example + * Digit.Utils.locale. ** () + * + * + */ + +export const getLocalityCode = (locality, tenantId) => { + if (typeof locality === "string") return locality.includes("_") ? locality : `${tenantId.replace(".", "_").toUpperCase()}_ADMIN_${locality}`; + else if (locality.code) return locality.code.includes("_") ? locality : `${tenantId.replace(".", "_").toUpperCase()}_ADMIN_${locality.code}`; +}; + +export const getRevenueLocalityCode = (locality, tenantId) => { + if (typeof locality === "string") return locality.includes("_") ? locality : `${tenantId.replace(".", "_").toUpperCase()}_REVENUE_${locality}`; + else if (locality.code) return locality.code.includes("_") ? locality : `${tenantId.replace(".", "_").toUpperCase()}_REVENUE_${locality.code}`; +}; + +export const stringReplaceAll = (str = "", searcher = "", replaceWith = "") => { + if (searcher === "") return str; + while (str.includes(searcher)) { + str = str.replace(searcher, replaceWith); + } + return str; +}; + +/* method to check not null if not returns false*/ +export const checkForNotNull = (value = "") => { + return value && value != null && value != undefined && value != "" ? true : false; +}; + +export const convertDotValues = (value = "") => { + return ( + (checkForNotNull(value) && ((value.replaceAll && value.replaceAll(".", "_")) || (value.replace && stringReplaceAll(value, ".", "_")))) || "NA" + ); +}; + +export const convertToLocale = (value = "", key = "") => { + let convertedValue = convertDotValues(value)?.toUpperCase(); + if (convertedValue == "NA") { + return "COMMON_NA"; + } + return `${key}_${convertedValue}`; +}; + +export const getMohallaLocale = (value = "", tenantId = "") => { + let convertedValue = convertDotValues(tenantId); + if (convertedValue == "NA" || !checkForNotNull(value)) { + return "COMMON_NA"; + } + convertedValue = convertedValue.toUpperCase(); + return convertToLocale(value, `${convertedValue}_REVENUE`); +}; + +export const getCityLocale = (value = "") => { + let convertedValue = convertDotValues(value); + if (convertedValue == "NA" || !checkForNotNull(value)) { + return "COMMON_NA"; + } + convertedValue = convertedValue.toUpperCase(); + return convertToLocale(convertedValue, `TENANT_TENANTS`); +}; + +/* to convert the dropdown data to locale data */ +export const convertToLocaleData = (dropdownValues = [], key = "", t) => { + return dropdownValues.map((ele) => { + ele["i18text"] = convertToLocale(ele.code, key); + if (t) { + ele["i18text"] = t(ele["i18text"]); + } + return ele; + }); +}; + +/** + * Custom util to format the code for localisation + * + * @author jagankumar-egov + * + * @example + * Digit.Utils.locale.getTransformedLocale( + * code) + * + * @returns {Array} Returns the Array of object + */ +export const getTransformedLocale = (label) => { + if (typeof label === "number") return label; + label = label?.trim(); + return label && label.toUpperCase().replace(/[.:-\s\/]/g, "_"); +}; + +/** + * Custom util to sort the dropdowns based on Alphabeticaly order by localising the codes + * + * @author jagankumar-egov + * + * @example + * Digit.Utils.locale.sortDropdownNames( + * options, + * optionKey, + * t) + * + * @returns {Array} Returns the Array of object + */ +export const sortDropdownNames = (options = [], optionkey = "i18nKey", t) => { + return options?.sort((a, b) => t(a?.[optionkey])?.localeCompare?.(t(b?.[optionkey]))); +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/obps/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/obps/index.js new file mode 100644 index 0000000..e1da9d1 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/obps/index.js @@ -0,0 +1,23 @@ +export const calculateRiskType = (riskTypes, plotArea, blocks) => { + const buildingHeight = blocks?.reduce((acc, block) => { + return Math.max(acc, block.building.buildingHeight) + }, Number.NEGATIVE_INFINITY); + + const risk = riskTypes?.find(riskType => { + if (riskType.riskType === "HIGH" && (plotArea > riskType?.fromPlotArea || buildingHeight >= riskType?.fromBuildingHeight)) { + return true; + } + + if (riskType.riskType === "MEDIUM" && ((plotArea >= riskType?.fromPlotArea && plotArea <= riskType?.toPlotArea) || + (buildingHeight >= riskType?.fromBuildingHeight && buildingHeight <= riskType?.toBuildingHeight))) { + return true; + } + + if (riskType?.riskType === "LOW" && plotArea < riskType.toPlotArea && buildingHeight < riskType.toBuildingHeight) { + return true; + } + + return false; + }) + return risk?.riskType; +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/pdf.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/pdf.js new file mode 100644 index 0000000..5b7442d --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/pdf.js @@ -0,0 +1,1083 @@ +import { Fonts } from "./fonts"; + +const pdfMake = require("pdfmake/build/pdfmake.js"); +// const pdfFonts = require("pdfmake/build/vfs_fonts.js"); +// pdfMake.vfs = pdfFonts.pdfMake.vfs; + +let pdfFonts = { + // Roboto: { + // normal: "https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.66/fonts/Roboto/Roboto-Regular.ttf", + // bold: "https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.66/fonts/Roboto/Roboto-Medium.ttf" + // }, + Hind: { + normal: "Hind-Regular.ttf", + bold: "Hind-Bold.ttf", + }, + en_IN: { + normal: "Hind-Regular.ttf", + bold: "Hind-Bold.ttf", + }, + pn_IN: { + normal: "BalooPaaji2-Regular.ttf", + bold: "BalooPaaji2-Bold.ttf", + }, + od_IN: { + normal: "BalooBhaina2-Regular.ttf", + bold: "BalooBhaina2-Bold.ttf", + }, + hi_IN: { + normal: "Hind-Regular.ttf", + bold: "Hind-Bold.ttf", + }, +}; +pdfMake.vfs = Fonts; + +pdfMake.fonts = pdfFonts; + +const downloadPDFFileUsingBase64 = (receiptPDF, filename) => { + if ( + window && + window.mSewaApp && + window.mSewaApp.isMsewaApp && + window.mSewaApp.isMsewaApp() && + window.mSewaApp.downloadBase64File && + window.Digit.Utils.browser.isMobile() + ) { + // we are running under webview + receiptPDF.getBase64((data) => { + window.mSewaApp.downloadBase64File(data, filename); + }); + } else { + // we are running in browser + receiptPDF.download(filename); + } +}; + +function getBase64Image(tenantId) { + try { + const img = document.getElementById(`logo-${tenantId}`); + var canvas = document.createElement("canvas"); + canvas.width = img.width; + canvas.height = img.height; + var ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0); + return canvas.toDataURL("image/png"); + } catch (e) { + return ""; + } +} + +const defaultLogo = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABBtJREFUWAntV11oVEcUnjN3mzXm111toQ8lWOtLTbIG0YgpMdQ05CEv0iTU1hhR7EMRWYuKSkteVExJBRGkpaUk0ChRSYtpKam4sbE0ia7RSNaS0uIfWtT4E8Xs5u7O8Vy7c3f27t2fh4W+ZF7OmfN9c86Ze2bOvZex/3mAGv/RIU9xJCL2IWIdAS7C/Nyhtbm8l39XeVKfOrLcHZoOHmCA7zJkC6VdSmAQRoYBAHbCXZBzED726xKT0kwgGnyUgpdI0JBEEMD4B+4dV3pU+9Mvyl4NMTZKAV5X7cl0APC5P127BqBNqBwuJ5Gw2G8NbmDIGEcQR+9/u6pAcg0ZYtiRaXCDT75rHnT0bjF0dZgJkLP3VEDVEakcj58ti7MBJOWrPFUHJurUuaGbCVCd5llBdQ4Yw7GnUaM9Fal4JjptJCGGmQA964upnPBXHCYOTSciDMGcp1qnYpzBBXVu6LEEGHxOByViJURJX7m2+W+qmKax3cn4Kk/qdJgnnXOdHXIupZnA/B1jw5TP+wzgngSpLEhX6ahLy/dKm5Su7WODBK4l/I60JZPkJ0DcuvxPLvxr5ZjXUAL45crchxD00A12OR3apTyv/67E7CQerndOztwto9uymPI1N2RwOcMwgBYorigah5qBsN36WVtCCZI9kqqu8Td0DG2mhlJKdb8JGvQOrV86YMevPDZagjpuQoFLqPY3gDtOjawvH7TjZpRAZeelesHwON3jQtUJtej2kdalu1RbZZe/QSB0U6L5ph0AObB9wy0Vn5m2qJI2geWd19yI09eo8SywLjbmdMgaRjZ4+gx9RffV13BGD1BXNV5kCYMzrW641dOvAnGnVgVMHYLUPu2DGxxk4iPJFeFwfbLgL7lcfCi5UqZNgK7WIkm2k4AxHARLyaUSJuBpE6AtBuwCmzaAGM5Tc6neMW7UQdoEcnOdv9Cpv24GjFNAAPCvpalwTuFP1J5vy7kqqRtGOGjfqDZDT5vAQNPbzzTgzQmOAWZotXe4xXNeOj3T9OYTjUMzHU1Le4YQImwdaimndh8/0t4CSV/T83fR1PRUI9W8lALc4jla3x/ryv6UuCqrvh+bp+t6IwL81weQn6abMqFyZnX5BDIugVyQifT52hxD7HyVAFFKb8nreVg46K354bHd2qwn0H6u9i0dI9S2scIMSN8YHHDjnmrfz6YtqmQ1gZ7xxpyJ+5MX6ROYDqplADzPAc2zs/rXv1Qk7TVUyen0iclHDbbBjYWIc3UR3mb1kdUEQGC5NYA6p1dzAp7VBKjulgakhjf+sqwNKoNOGO8i9Uxz8H6KEkzKAvzRimX1Cex+58w/9O2/nT4S4v7/jKDUyo/vrfZ1WxPI6i2Qzvf/VrtKRMJbKewSeiI3aJcn96w++53EVfkCw79XQZYr/EsAAAAASUVORK5CYII="; +const jsPdfGenerator = async ({ breakPageLimit = null, tenantId, logo, name, email, phoneNumber, heading, details, t = (text) => text }) => { + + const emailLeftMargin = + email.length <= 15 + ? 190 + : email.length <= 20 + ? 150 + : email.length <= 25 + ? 130 + : email.length <= 30 + ? 90 + : email.length <= 35 + ? 50 + : email.length <= 40 + ? 10 + : email.length <= 45 + ? 0 + : email.length <= 50 + ? -20 + : email.length <= 55 + ? -70 + : email.length <= 60 + ? -100 + : -60; + + const dd = { + pageMargins: [40, 80, 40, 30], + header: { + columns: [ + { + image: logo || getBase64Image(tenantId) || defaultLogo, + width: 50, + margin: [10, 10], + }, + { + text: name, + margin: [20, 25], + font: "Hind", + fontSize: 14, + bold: true, + }, + { + text: email, + margin: [emailLeftMargin, 25, 0, 25], + font: "Hind", + fontSize: 11, + color: "#464747", + }, + { + text: phoneNumber, + color: "#6f777c", + font: "Hind", + fontSize: 11, + margin: [-65, 45, 0, 25], + }, + ], + }, + + footer: function (currentPage, pageCount) { + return { + columns: [ + { text: `${name} / ${heading}`, margin: [15, 0, 0, 0], fontSize: 11, color: "#6f777c", width: 400, font: "Hind" }, + { text: `Page ${currentPage}`, alignment: "right", margin: [0, 0, 25, 0], fontSize: 11, color: "#6f777c", font: "Hind" }, + ], + }; + }, + content: [ + { + text: heading, + font: "Hind", + fontSize: 24, + bold: true, + margin: [-25, 5, 0, 0], + }, + ...createContent(details, phoneNumber, breakPageLimit), + { + text: t("PDF_SYSTEM_GENERATED_ACKNOWLEDGEMENT"), + font: "Hind", + fontSize: 11, + color: "#6f777c", + margin: [-25, 32], + }, + ], + defaultStyle: { + font: "Hind", + }, + }; + pdfMake.vfs = Fonts; + let locale = Digit.SessionStorage.get("locale") || Digit.Utils.getDefaultLanguage(); + let Hind = pdfFonts[locale] || pdfFonts["Hind"]; + pdfMake.fonts = { Hind: { ...Hind } }; + const generatedPDF = pdfMake.createPdf(dd); + downloadPDFFileUsingBase64(generatedPDF, "acknowledgement.pdf"); +}; + + +/** + * Util function that can be used + * to download WS connection acknowledgement pdfs + * Data is passed to this function from this file + * packages\modules\ws\src\utils\getWSAcknowledgementData.js + * @author nipunarora-egov + * + * @example + * Digit.Utils.pdf.generatev1() + * + * @returns Downloads a pdf + */ +const jsPdfGeneratorv1 = async ({ breakPageLimit = null, tenantId, logo, name, email, phoneNumber, heading, details, headerDetails, t = (text) => text }) => { + const emailLeftMargin = + email.length <= 15 + ? 190 + : email.length <= 20 + ? 150 + : email.length <= 25 + ? 130 + : email.length <= 30 + ? 90 + : email.length <= 35 + ? 50 + : email.length <= 40 + ? 10 + : email.length <= 45 + ? 0 + : email.length <= 50 + ? -20 + : email.length <= 55 + ? -70 + : email.length <= 60 + ? -100 + : -60; + + const dd = { + pageMargins: [40, 40, 40, 30], + header: {}, + footer: function (currentPage, pageCount) { + return { + columns: [ + { text: `${name} / ${heading}`, margin: [15, 0, 0, 0], fontSize: 11, color: "#6f777c", width: 400, font: "Hind" }, + { text: `Page ${currentPage}`, alignment: "right", margin: [0, 0, 25, 0], fontSize: 11, color: "#6f777c", font: "Hind" }, + ], + }; + }, + content: [ + ...createHeader(headerDetails,logo,tenantId), + // { + // text: heading, + // font: "Hind", + // fontSize: 24, + // bold: true, + // margin: [-25, 5, 0, 0], + // }, + ...createContentDetails(details), + { + text: t("PDF_SYSTEM_GENERATED_ACKNOWLEDGEMENT"), + font: "Hind", + fontSize: 11, + color: "#6f777c", + margin: [-25, 32], + }, + ], + defaultStyle: { + font: "Hind", + }, + }; + + pdfMake.vfs = Fonts; + let locale = Digit.SessionStorage.get("locale") || Digit.Utils.getDefaultLanguage(); + let Hind = pdfFonts[locale] || pdfFonts["Hind"]; + pdfMake.fonts = { Hind: { ...Hind } }; + const generatedPDF = pdfMake.createPdf(dd); + downloadPDFFileUsingBase64(generatedPDF, "acknowledgement.pdf"); +}; + +export default { generate: jsPdfGenerator ,generatev1:jsPdfGeneratorv1}; + +const createBodyContentBillAmend = (table,t) => { + let bodyData = [] + bodyData.push({ + text: t(table?.title), + color: "#F47738", + style: "header", + fontSize: 14, + bold: true, + margin: [0, 15, 0, 10] + }) + bodyData.push({ + layout:{ + fillColor:function(rowIndex,node,columnIndex){ + if(rowIndex === (table?.tableRows?.length)) { + return "#F47738" + } + return (rowIndex % 2 === 0) ? "#F47738" : null; + }, + fillOpacity:function(rowIndex,node,columnIndex) { + if (rowIndex === (table?.tableRows?.length)) { + return 1; + } + return (rowIndex % 2 === 0) ? 0.15 : 1; + } + }, + table:{ + headerRows:1, + widths: ["*", "*", "*", "*"], + body:[ + table?.headers?.map(header =>{ + return { + text:t(header), + style:"header", + fontSize:11, + bold:true, + border: [false, false, false, false] + } + }), + ...table?.tableRows?.map(row => { + return [ + { + text:t(row?.[0]), + style:"header", + fontSize:11, + border: [false, false, false, false] + }, + { + text: t(row?.[1]), + style: "header", + fontSize: 11, + border: [false, false, false, false] + }, + { + text: t(row?.[2]), + style: "header", + fontSize: 11, + border: [false, false, false, false] + }, + { + text: t(row?.[3]), + style: "header", + fontSize: 11, + border: [false, false, false, false] + } + ] + }) + ] + } + }) + return bodyData +} + +const createHeaderBillAmend = (headerDetails, logo, tenantId,t) => { + + let headerData = []; + headerData.push({ + style: 'tableExample', + layout: "noBorders", + fillColor: "#f7e0d4", + margin: [-40, -40, -40, 40], + table: { + widths: ['5%', 'auto', '*'], + body: [ + [ + { + image: logo || getBase64Image(tenantId) || defaultLogo, + // width: 50, + margin: [10, 10], + fit: [50, 50], + //width: 50, + //margin: [10, 10] + }, + { + text: headerDetails?.header, //"Amritsar Municipal Corporation", + margin: [40, 10, 2, 4], + style: "header", + // italics: true, + fontSize: 18, + bold: true + }, + { + text: headerDetails?.typeOfApplication, //"New Sewerage Connection", + bold: true, + fontSize: 16, + alignment: "right", + margin: [-40, 10, 2, 0], + color: "#F47738" + } + ], + [ + { text: "" }, + { + text: headerDetails?.subHeader, //"Municipal Corporation Amritsar, Town Hall, Amritsar, Punjab.", + margin: [40, -45, -2, -5], + style: "header", + // italics: true, + fontSize: 10, + bold: true + }, + + { + text: headerDetails?.date, //"28/03/2022", + bold: true, + fontSize: 16, + margin: [0, -45, 10, 0], + alignment: "right", + color: "#F47738" + } + ], + [ + { text: "" }, + + { + text: headerDetails?.description, //"0183-2545155 | www.amritsarcorp.com | cmcasr@gmail.com", + margin: [40, -40, 2, 10], + style: "header", + // italics: true, + fontSize: 10, + bold: true + }, + { + text: "", + } + ] + ] + } + }); + headerDetails?.values?.forEach((header, index) => { + headerData.push({ + style: 'tableExample', + layout: "noBorders", + fillColor: "#f7e0d4", + margin: [-40, -40, -40, 20], + table: { + widths: ['30%', '*'], + body: [ + [ + { + text: header?.title, + margin: index == 0 ? [40, 0, 2, 10] : [40, 10, 2, 10], + style: "header", + fontSize: 10, + bold: true + }, + { + text: header?.value, + bold: true, + fontSize: 10, + alignment: "left", + margin: index == 0 ? [0, 0, 2, 10] : [0, 10, 2, 10], + } + ] + ] + } + }) + }) + //push demand revision details old way + + headerData.push({ + style: 'tableExample', + layout: "noBorders", + fillColor: "#f7e0d4", + margin: [-40, -25, -1000000, 20], + table: { + widths: ['30%', '*'], + body: [ + [ + { + text: headerDetails?.DemandRevision?.title, + margin: [40, 0, 2, 20], + style: "header", + fontSize: 13, + bold: true + } + ] + ] + } + }) + + headerDetails?.DemandRevision?.values?.forEach((header, index) => { + headerData.push({ + style: 'tableExample', + layout: "noBorders", + fillColor: "#f7e0d4", + margin: [-40, -40, -40, 20], + table: { + widths: ['30%', '*'], + body: [ + [ + { + text: header?.title, + margin: index == 0 ? [40, 0, 2, 10] : [40, 10, 2, 10], + style: "header", + fontSize: 10, + bold: true + }, + { + text: header?.value, + bold: false, + fontSize: 10, + alignment: "left", + margin: index == 0 ? [0, 0, 2, 10] : [0, 10, 2, 10], + } + ] + ] + } + }) + }) + + //attachment details + headerData.push({ + style: 'tableExample', + layout: "noBorders", + fillColor: "#f7e0d4", + margin: [-40, -25, -1000000, 20], + table: { + widths: ['30%', '*'], + body: [ + [ + { + text: headerDetails?.Attachments?.title, + margin: [40, 0, 2, 110], + style: "header", + fontSize: 13, + bold: true + } + ] + ] + } + }) + + headerData.push({ + layout: "noBorders", + ul: headerDetails?.Attachments?.values, + margin:[0,-130,0,40] + }) + + return headerData; +} + +const createBodyContent = (details) => { + let detailsHeaders = [] + details.map((table,index) =>{ + if (table?.isAttachments && table.values) { + detailsHeaders.push({ + style: 'tableExample', + layout: "noBorders", + margin: [0, 13, 0, 5], + table: { + body: [ + [ + { + text: table?.title, + color: "#F47738", + style: "header", + fontSize: 14, + bold: true + } + ] + ] + } + }) + detailsHeaders.push({ + layout:'noBorders', + ul: table?.values + }) + return + } + detailsHeaders.push({ + layout:'noBorders', + table:{ + headerRows:1, + widths:["*","*","*"], + body:[ + table?.title?.map(t=>{ + return { + text:t, + color: "#F47738", + style: "header", + fontSize: 14, + bold: true, + margin:[0,15,0,0] + } + }), + ...table?.values?.map((value,index) => { + return [ + { + text:value?.val1, + style: "header", + fontSize: 10, + bold: true + }, + { + text: value?.val2, + fontSize: 10 + }, + { + text: value?.val3, + fontSize: 10 + } + ] + }) + ] + } + }) + }) + + return detailsHeaders +} + +function createContentDetails(details) { + let detailsHeaders = []; + details.forEach((detail, index) => { + if (detail?.title) { + detailsHeaders.push({ + style: 'tableExample', + layout: "noBorders", + margin:[0,13,0,5], + table: { + body: [ + [ + { + text: detail?.title, + color: "#F47738", + style: "header", + fontSize: 14, + bold: true + } + ] + ] + } + }) + } + if (detail?.isAttachments && detail.values) { + detailsHeaders.push({ + ul: detail?.values + }) + } else { + detail?.values?.forEach(indData => { + detailsHeaders.push({ + style: 'tableExample', + layout: "noBorders", + table: { + widths: ['40%', '*'], + body: [ + [ + { + text: indData?.title, + style: "header", + fontSize: 10, + bold: true + }, + + { + text: indData?.value, + fontSize: 10 + } + ] + ] + } + }) + }) + } + }); + return detailsHeaders; +} + +function createHeader(headerDetails,logo,tenantId) { + let headerData = []; + headerData.push({ + style: 'tableExample', + layout: "noBorders", + fillColor: "#f7e0d4", + "margin": [-40, -40, -40, 40], + table: { + widths: ['5%', 'auto', '*'], + body: [ + [ + // { + // margin: [40, 10, 2, 2], + // "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABBtJREFUWAntV11oVEcUnjN3mzXm111toQ8lWOtLTbIG0YgpMdQ05CEv0iTU1hhR7EMRWYuKSkteVExJBRGkpaUk0ChRSYtpKam4sbE0ia7RSNaS0uIfWtT4E8Xs5u7O8Vy7c3f27t2fh4W+ZF7OmfN9c86Ze2bOvZex/3mAGv/RIU9xJCL2IWIdAS7C/Nyhtbm8l39XeVKfOrLcHZoOHmCA7zJkC6VdSmAQRoYBAHbCXZBzED726xKT0kwgGnyUgpdI0JBEEMD4B+4dV3pU+9Mvyl4NMTZKAV5X7cl0APC5P127BqBNqBwuJ5Gw2G8NbmDIGEcQR+9/u6pAcg0ZYtiRaXCDT75rHnT0bjF0dZgJkLP3VEDVEakcj58ti7MBJOWrPFUHJurUuaGbCVCd5llBdQ4Yw7GnUaM9Fal4JjptJCGGmQA964upnPBXHCYOTSciDMGcp1qnYpzBBXVu6LEEGHxOByViJURJX7m2+W+qmKax3cn4Kk/qdJgnnXOdHXIupZnA/B1jw5TP+wzgngSpLEhX6ahLy/dKm5Su7WODBK4l/I60JZPkJ0DcuvxPLvxr5ZjXUAL45crchxD00A12OR3apTyv/67E7CQerndOztwto9uymPI1N2RwOcMwgBYorigah5qBsN36WVtCCZI9kqqu8Td0DG2mhlJKdb8JGvQOrV86YMevPDZagjpuQoFLqPY3gDtOjawvH7TjZpRAZeelesHwON3jQtUJtej2kdalu1RbZZe/QSB0U6L5ph0AObB9wy0Vn5m2qJI2geWd19yI09eo8SywLjbmdMgaRjZ4+gx9RffV13BGD1BXNV5kCYMzrW641dOvAnGnVgVMHYLUPu2DGxxk4iPJFeFwfbLgL7lcfCi5UqZNgK7WIkm2k4AxHARLyaUSJuBpE6AtBuwCmzaAGM5Tc6neMW7UQdoEcnOdv9Cpv24GjFNAAPCvpalwTuFP1J5vy7kqqRtGOGjfqDZDT5vAQNPbzzTgzQmOAWZotXe4xXNeOj3T9OYTjUMzHU1Le4YQImwdaimndh8/0t4CSV/T83fR1PRUI9W8lALc4jla3x/ryv6UuCqrvh+bp+t6IwL81weQn6abMqFyZnX5BDIugVyQifT52hxD7HyVAFFKb8nreVg46K354bHd2qwn0H6u9i0dI9S2scIMSN8YHHDjnmrfz6YtqmQ1gZ7xxpyJ+5MX6ROYDqplADzPAc2zs/rXv1Qk7TVUyen0iclHDbbBjYWIc3UR3mb1kdUEQGC5NYA6p1dzAp7VBKjulgakhjf+sqwNKoNOGO8i9Uxz8H6KEkzKAvzRimX1Cex+58w/9O2/nT4S4v7/jKDUyo/vrfZ1WxPI6i2Qzvf/VrtKRMJbKewSeiI3aJcn96w++53EVfkCw79XQZYr/EsAAAAASUVORK5CYII=" + // }, + { + image: logo || getBase64Image(tenantId) || defaultLogo, + // width: 50, + margin: [10, 10], + fit: [50,50], + //width: 50, + //margin: [10, 10] + }, + { + text: headerDetails?.[0]?.header, //"Amritsar Municipal Corporation", + margin: [40, 10, 2, 4], + style: "header", + // italics: true, + fontSize: 18, + bold: true + }, + { + text: headerDetails?.[0]?.typeOfApplication, //"New Sewerage Connection", + bold: true, + fontSize: 16, + alignment: "right", + margin: [-40, 10, 2, 0], + color: "#F47738" + } + ], + [ + { text: "" }, + { + text: headerDetails?.[0]?.subHeader, //"Municipal Corporation Amritsar, Town Hall, Amritsar, Punjab.", + margin: [40, -45, -2, -5], + style: "header", + // italics: true, + fontSize: 10, + bold: true + }, + + { + text: headerDetails?.[0]?.date, //"28/03/2022", + bold: true, + fontSize: 16, + margin: [0, -50, 10, 0], + alignment: "right", + color: "#F47738" + } + ], + [ + { text: "" }, + + { + text: headerDetails?.[0]?.description, //"0183-2545155 | www.amritsarcorp.com | cmcasr@gmail.com", + margin: [40, -40, 2, 10], + style: "header", + // italics: true, + fontSize: 10, + bold: true + }, + { + text: "", + } + ] + ] + } + }); + headerDetails?.[0]?.values?.forEach((header, index) => { + headerData.push({ + style: 'tableExample', + layout: "noBorders", + fillColor: "#f7e0d4", + "margin": [-40, -40, -40, 20], + table: { + widths: ['30%', '*'], + body: [ + [ + { + text: header?.title, + margin: index == 0 ? [40, 0, 2, 10] : [40, 10, 2, 10], + style: "header", + fontSize: 10, + bold: true + }, + { + text: header?.value, + bold: true, + fontSize: 10, + alignment: "left", + margin: index == 0 ? [0, 0, 2, 10] : [0, 10, 2, 10], + } + ] + ] + } + }) + }) + + return headerData; +} + + +function createContent(details, phoneNumber, breakPageLimit = null) { + const data = []; + + details.forEach((detail, index) => { + if (detail?.values?.length > 0) { + let column1 = []; + let column2 = []; + + if ( breakPageLimit ? (index + 1) % breakPageLimit === 0 : (index + 1) % 7 === 0) { + data.push({ + text: "", + margin: [-25, 0, 0, 200], + }); + } + + data.push({ + text: `${detail.title}`, + font: "Hind", + fontSize: 18, + bold: true, + margin: [-25, 20, 0, 20], + }); + + const newArray = []; + let count = 0; + let arrayNumber = 0; + + detail.values.forEach((value, index) => { + if (count <= 3) { + if (!newArray[arrayNumber]) { + newArray[arrayNumber] = []; + } + if (value) { + newArray[arrayNumber].push(value); + } + count++; + } + if (count === 4) { + count = 0; + arrayNumber++; + } + }); + + newArray.forEach((value) => { + if (value?.length === 2) { + createContentForDetailsWithLengthOfTwo(value, data, column1, column2, detail.values.length > 3 ? 10 : 0); + } else if (value?.length === 1 || value?.length === 3) { + createContentForDetailsWithLengthOfOneAndThree(value, data, column1, column2, detail.values.length > 3 ? 10 : 0); + } else { + value.forEach((value, index) => { + let margin = [-25, 0, 0, 5]; + if (index === 1) margin = [15, 0, 0, 5]; + if (index === 2) margin = [26, 0, 0, 5]; + if (index === 3) margin = [30, 0, 0, 5]; + column1.push({ + text: value.title, + font: "Hind", + fontSize: 11, + bold: true, + margin, + }); + if (index === 1) margin = [15, 0, 0, 10]; + if (index === 2) margin = [26, 0, 0, 10]; + if (index === 3) margin = [30, 0, 0, 10]; + column2.push({ + text: value.value, + font: "Hind", + fontSize: 9, + margin, + color: "#1a1a1a", + width: "25%", + }); + }); + data.push({ columns: column1 }); + data.push({ columns: column2 }); + column1 = []; + column2 = []; + } + }); + } + }); + + return data; +} + +function createContentForDetailsWithLengthOfTwo(values, data, column1, column2, num = 0) { + values.forEach((value, index) => { + if (index === 0) { + column1.push({ + text: value.title, + font: "Hind", + fontSize: 12, + bold: true, + margin: [-25, num - 10, -25, 0], + }); + column2.push({ + text: value.value, + font: "Hind", + fontSize: 9, + margin: [-25, 5, 0, 0], + color: "#1a1a1a", + width: "25%", + }); + } else { + column1.push({ + text: value.title, + font: "Hind", + fontSize: 12, + bold: true, + margin: [-115, num - 10, -115, 0], + }); + column2.push({ + text: value.value, + font: "Hind", + fontSize: 9, + margin: [15, 5, 0, 0], + color: "#1a1a1a", + width: "25%", + }); + } + }); + data.push({ columns: column1 }); + data.push({ columns: column2 }); +} + +function createContentForDetailsWithLengthOfOneAndThree(values, data, column1, column2, num = 0) { + values.forEach((value, index) => { + if (index === 0) { + column1.push({ + text: value.title, + font: "Hind", + fontSize: 12, + bold: true, + margin: values.length > 1 ? [-25, -5, 0, 0] : [-25, 0, 0, 0], + }); + column2.push({ + text: value.value, + font: "Hind", + fontSize: 9, + color: "#1a1a1a", + margin: values.length > 1 ? [-25, 5, 0, 0] : [-25, 5, 0, 0], + width: "25%", + }); + } else if (index === 2) { + column1.push({ + text: value.title, + font: "Hind", + fontSize: 12, + bold: true, + margin: [-60, -5, 0, 0], + }); + column2.push({ + text: value.value, + font: "Hind", + fontSize: 9, + margin: [26, 5, 0, 0], + color: "#1a1a1a", + width: "25%", + }); + } else { + column1.push({ + text: value.title, + font: "Hind", + fontSize: 12, + bold: true, + margin: [-28, -5, 0, 0], + }); + column2.push({ + text: value.value, + font: "Hind", + fontSize: 9, + margin: [15, 5, 0, 0], + color: "#1a1a1a", + width: "25%", + }); + } + }); + data.push({ columns: column1 }); + data.push({ columns: column2 }); +} + +// EXAMPLE +// , + +const downloadPdf = (blob, fileName) => { + if (window.mSewaApp && window.mSewaApp.isMsewaApp() && window.mSewaApp.downloadBase64File) { + var reader = new FileReader(); + reader.readAsDataURL(blob); + reader.onloadend = function () { + var base64data = reader.result; + window.mSewaApp.downloadBase64File(base64data, fileName); + }; + } else { + const link = document.createElement("a"); + // create a blobURI pointing to our Blob + link.href = URL.createObjectURL(blob); + link.download = fileName; + // some browser needs the anchor to be in the doc + document.body.append(link); + link.click(); + link.remove(); + // in case the Blob uses a lot of memory + setTimeout(() => URL.revokeObjectURL(link.href), 7000); + } +}; + +/* Download Receipts */ + +export const downloadReceipt = async ( + consumerCode, + businessService, + pdfKey = "consolidatedreceipt", + tenantId = Digit.ULBService.getCurrentTenantId(), + receiptNumber = null +) => { + const response = await Digit.ReceiptsService.receipt_download(businessService, consumerCode, tenantId, pdfKey, receiptNumber); + const responseStatus = parseInt(response.status, 10); + if (responseStatus === 201 || responseStatus === 200) { + let filename = receiptNumber ? `receiptNumber-${receiptNumber}.pdf` : `consumer-${consumerCode}.pdf`; + downloadPdf(new Blob([response.data], { type: "application/pdf" }), filename); + } +}; +/* Download Bills */ + +export const downloadBill = async ( + consumerCode, + businessService, + pdfKey = "consolidatedbill", + tenantId = Digit.ULBService.getCurrentTenantId(), +) => { + const response = await Digit.ReceiptsService.bill_download(businessService, consumerCode, tenantId, pdfKey); + const responseStatus = parseInt(response.status, 10); + if (responseStatus === 201 || responseStatus === 200) { + let filename = consumerCode ? `consumerCode-${consumerCode}.pdf` : `consumer-${consumerCode}.pdf`; + downloadPdf(new Blob([response.data], { type: "application/pdf" }), filename); + } +}; + +export const getFileUrl = (linkText = "") => { + const linkList = (linkText && typeof linkText == "string" && linkText.split(",")) || []; + let fileURL = ""; + linkList && + linkList.map((link) => { + if (!link.includes("large") && !link.includes("medium") && !link.includes("small")) { + fileURL = link; + } + }); + return fileURL; +}; + +/* Use this util function to download the file from any s3 links */ +export const downloadPDFFromLink = async (link, openIn = "_blank") => { + var response = await fetch(link, { + responseType: "arraybuffer", + headers: { + "Content-Type": "application/json", + Accept: "application/pdf", + }, + method: "GET", + mode: "cors", + }).then((res) => res.blob()); + if (window.mSewaApp && window.mSewaApp.isMsewaApp() && window.mSewaApp.downloadBase64File) { + var reader = new FileReader(); + reader.readAsDataURL(response); + reader.onloadend = function () { + var base64data = reader.result; + window.mSewaApp.downloadBase64File(base64data, decodeURIComponent(link.split("?")[0].split("/").pop().slice(13))); + }; + } else { + var a = document.createElement("a"); + document.body.appendChild(a); + a.style = "display: none"; + let url = window.URL.createObjectURL(response); + a.href = url; + a.download = decodeURIComponent(link.split("?")[0].split("/").pop().slice(13)); + a.click(); + window.URL.revokeObjectURL(url); + } +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/preProcessMDMSConfig.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/preProcessMDMSConfig.js new file mode 100644 index 0000000..5d3aa07 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/preProcessMDMSConfig.js @@ -0,0 +1,128 @@ + +import _ from "lodash"; + +/* +PRE-PROCESS MDMS CONFIG +----------------------- +@Author - Hariom Sinha + +Usually FormComposer configs needs some dependendent params to drive the rendering and functionality. In MDMS config, we cannot inject those params. +So, this component is developed to help convert any MDMS config to a FormComposer enabled config by injecting multiple params. +As of now, two params are introduced - + a. translate + b. updateDependent + c. convertStringToRegEx + Based on the newer requirement, this utility can be enhanced to support extra types of params. + +How to use this Pre-Process Utility - +1. Fetch any config from MDMS. +2. In each input object of the config, set preProcess object with required Params. + ex - + { + isMandatory: false, + key: "noSubProject_locality", + type: "radioordropdown", + label: "WORKS_LOCALITY", + disable: false, + preProcess : { + translate : ["populators.error"], + updateDependent : ["populators.options"] + }, + populators: { + name: "noSubProject_locality", + optionsKey: "i18nKey", + error: "WORKS_REQUIRED_ERR", + required: false, + optionsCustomStyle : { + top : "2.5rem" + }, + options: [] + }, + }, +3. Both 'translate' and 'updateDependent' supports multiple JSON paths. This means that we can inject multiple params at a time in the same input object. +4. Any component who wants to transform MDMS config to FormComposer config using this Pre-Process Utility should pass the dependencies based on their requirement. + Example, if one needs to update the dropdown value based on other dropdown field change, then the component can pass that Param as state. + The Component should make calls to this config only when the dependent state changes, to avoid performance issues. + + const config = useMemo( + () => Digit.Utils.preProcessMDMSConfig(t, createProjectConfig, { + updateDependent : [ + { + key : 'withSubProject_project_subScheme', + value : [withSubProjectSubSchemeOptions] + } + ] + }), + [withSubProjectSubSchemeOptions]); +5. Translation and convertStringToRegEx will be handled by the Pre-Preprocess on its own. No params are required for this. +*/ + + +const translate = (config, index, inputIndex, t) => { + + let input = config?.form[index].body[inputIndex]; + //iterate all translate keys and handle translation + for(let toTranslate = 0; toTranslate { + let input = config?.form[index].body[inputIndex]; + //iterate all update options keys and add options as params + for(let toUpdate = 0; toUpdatedependent?.key === inputKey)?.[0]?.value?.[toUpdate])); + } + + return config; +} + +const convertStringToRegEx = (config, index, inputIndex) => { + + let input = config?.form[index].body[inputIndex]; + //iterate all translate keys and handle translation + for(let toValidate = 0; toValidate { + //Do not loop preProcess object, to avoid unnecessary 'translate' and 'updateDependent' calls + //To add any new transform object, simply add a new if statement + if(preProcesses?.translate) { + config = translate(config, index, inputIndex, t); + } + if(preProcesses?.updateDependent) { + config = updateDependent(config, index, inputIndex, inputKey, dependencyConfig); + } + if(preProcesses?.convertStringToRegEx) { + config = convertStringToRegEx(config, index, inputIndex, inputKey); + } + return config; +} + +const preProcessMDMSConfig = (t, config, dependencyConfig) => { + config?.form?.map((section, index)=>{ + section?.body?.map((input, inputIndex)=>{ + let preProcesses = input?.preProcess; + if(preProcesses){ + config = transform(preProcesses, config, index, inputIndex, input?.key, t, dependencyConfig); + } + }) + }) + return config; +} + +export default preProcessMDMSConfig; + diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/preProcessMDMSConfigInboxSearch.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/preProcessMDMSConfigInboxSearch.js new file mode 100644 index 0000000..05743c9 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/preProcessMDMSConfigInboxSearch.js @@ -0,0 +1,110 @@ + +import _ from "lodash"; + +/* +PRE-PROCESS MDMS CONFIG +----------------------- +@Author - Hariom Sinha + +Usually FormComposer configs needs some dependendent params to drive the rendering and functionality. In MDMS config, we cannot inject those params. +So, this component is developed to help convert any MDMS config to a FormComposer enabled config by injecting multiple params. +As of now, two params are introduced - + a. translate + b. updateDependent + c. convertStringToRegEx + Based on the newer requirement, this utility can be enhanced to support extra types of params. + +How to use this Pre-Process Utility - +1. Fetch any config from MDMS. +2. In each input object of the config, set preProcess object with required Params. + ex - + { + isMandatory: false, + key: "noSubProject_locality", + type: "radioordropdown", + label: "WORKS_LOCALITY", + disable: false, + preProcess : { + translate : ["populators.error"], + updateDependent : ["populators.options"] + }, + populators: { + name: "noSubProject_locality", + optionsKey: "i18nKey", + error: "WORKS_REQUIRED_ERR", + required: false, + optionsCustomStyle : { + top : "2.5rem" + }, + options: [] + }, + }, +3. Both 'translate' and 'updateDependent' supports multiple JSON paths. This means that we can inject multiple params at a time in the same input object. +4. Any component who wants to transform MDMS config to FormComposer config using this Pre-Process Utility should pass the dependencies based on their requirement. + Example, if one needs to update the dropdown value based on other dropdown field change, then the component can pass that Param as state. + The Component should make calls to this config only when the dependent state changes, to avoid performance issues. + + const config = useMemo( + () => Digit.Utils.preProcessMDMSConfig(t, createProjectConfig, { + updateDependent : [ + { + key : 'withSubProject_project_subScheme', + value : [withSubProjectSubSchemeOptions] + } + ] + }), + [withSubProjectSubSchemeOptions]); +5. Translation and convertStringToRegEx will be handled by the Pre-Preprocess on its own. No params are required for this. +*/ + +const convertStringToRegEx = (target) => { + //iterate all translate keys and handle translation + for(let toValidate = 0; toValidate { + //iterate all translate keys and handle translation + for(let toUpdate = 0; toUpdatedependent?.key === inputKey)?.[0]?.value)); + + _.set(target, keyToUpdate, dependentObject); + } + return target; +} + +const transform = (preProcesses, target, inputIndex, inputKey, t, dependencyConfig) => { + //Do not loop preProcess object, to avoid unnecessary 'translate' and 'updateDependent' calls + //To add any new transform object, simply add a new if statement + if(preProcesses?.convertStringToRegEx) { + target = convertStringToRegEx(target); + } + if(preProcesses?.updateDependent) { + target = updateDependent(target, dependencyConfig, inputKey); + } + return target; +} + +const preProcessMDMSConfigInboxSearch = (t, config, jsonpath, dependencyConfig) => { + let targetConfig = _.get(config, jsonpath); + let updatedConfig = []; + //Iterate the entire jsonpath array and push the updated objects in the new res array. + //Set the updated res in place of the targetConfig + targetConfig?.map((target, inputIndex) => { + let preProcesses = target?.preProcess; + updatedConfig.push(transform(preProcesses, target, inputIndex, target?.key, t, dependencyConfig)); + }) + _.set(config, jsonpath, updatedConfig); + return config; +} + +export default preProcessMDMSConfigInboxSearch; + diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/privacy.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/privacy.js new file mode 100644 index 0000000..ae2d62c --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/privacy.js @@ -0,0 +1,107 @@ +/** + * Contains all utils used for Privacy + * + * @author jagankumar-egov + * + * Feature :: Privacy + */ + +/** + * Custom util to get the privacy object of current screen + * + * @author jagankumar-egov + * + * @example + * Digit.Utils.getPrivacyObject() + * + * @returns {object} Returns the privacy object + */ +export const getPrivacyObject = () => { + const privacyObj = getAllPrivacyObject(); + return privacyObj?.[window.location.pathname] || {}; +}; + +/** + * Custom util to get the complete privacy object. + * + * @author jagankumar-egov + * + * @example + * Digit.Utils.getAllPrivacyObject() + * + * @returns {object} Returns the key value pair of privacy object in every screens + */ +export const getAllPrivacyObject = () => { + return Digit.SessionStorage.get("PRIVACY_OBJECT") || {}; +}; + +/** + * Custom util to update the privacy object. + * + * @author jagankumar-egov + * + * @example + * Digit.Utils.setPrivacyObject({}) + * + */ +export const setPrivacyObject = (updatedPrivacyValue = {}) => { + return Digit.SessionStorage.set("PRIVACY_OBJECT", { ...updatedPrivacyValue }); +}; + +/** + * Main Util to update the privacy + * + * @author jagankumar-egov + * + * Feature :: Privacy + * + * @example + * Digit.Utils.updatePrivacy(uuid, fieldName) + * + * @returns {object} Returns the updated privacy object + */ +export const updatePrivacy = (uuid, fieldName) => { + const privacyObj = Digit.Utils.getAllPrivacyObject(); + const plainRequestFields = + privacyObj?.[window.location.pathname]?.recordId === uuid ? privacyObj?.[window.location.pathname]?.plainRequestFields || [] : []; + const newObj = { + ...privacyObj, + [window.location.pathname]: { recordId: uuid, plainRequestFields: Array.isArray(fieldName) ? [...fieldName, ...plainRequestFields] : [fieldName, ...plainRequestFields] }, + }; + Digit.Utils.setPrivacyObject({ ...newObj }); + return newObj; +}; + +/** + * Core Component Logic for showing the unmask button and for which fields will be controlled by + * mdms -> DataSecurity -> SecurityPolicy.json + * + * @author jagankumar-egov + * + * Feature :: Privacy + * + * @example + * Digit.Utils.checkPrivacy(mdmsObj, privacyDetail) + * + * @returns {boolean} Returns the show or hide in boolean type + */ + +export const checkPrivacy = (mdmsObj, privacyDetail) => { + if (mdmsObj?.attributes?.some((ele) => (ele?.name === privacyDetail?.fieldName || privacyDetail?.fieldName?.includes(ele?.name) )&& ele?.defaultVisibility === "MASKED")) { + return true; + } + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + if ( + mdmsObj?.roleBasedDecryptionPolicy?.some( + (ele) => + ele?.roles?.some((e) => userRoles?.includes(e)) && + ele?.attributeAccessList?.some( + (ele) => (ele?.attribute === privacyDetail?.fieldName || privacyDetail?.fieldName?.includes(ele?.attribute)) && ele?.firstLevelVisibility === "MASKED" && ele?.secondLevelVisibility === "PLAIN" + ) + ) + ) { + return true; + } + return false; +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/pt/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/pt/index.js new file mode 100644 index 0000000..ec8ff04 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/pt/index.js @@ -0,0 +1,65 @@ +export const getPropertyTypeLocale = (value) => { + return `PROPERTYTAX_BILLING_SLAB_${value?.split(".")[0]}`; +}; + +export const getPropertySubtypeLocale = (value) => `PROPERTYTAX_BILLING_SLAB_${value}`; + +export const stringReplaceAll = (str = "", searcher = "", replaceWith = "") => { + if (searcher === "") return str; + while (str.includes(searcher)) { + str = str.replace(searcher, replaceWith); + } + return str; +}; + +/* method to check not null if not returns false*/ +export const checkForNotNull = (value = "") => { + return value && value != null && value != undefined && value != "" ? true : false; +}; + +export const convertDotValues = (value = "") => { + return ( + (checkForNotNull(value) && ((value.replaceAll && value.replaceAll(".", "_")) || (value.replace && stringReplaceAll(value, ".", "_")))) || "NA" + ); +}; + +export const convertToLocale = (value = "", key = "") => { + let convertedValue = convertDotValues(value); + if (convertedValue === "NA") { + return "PT_NA"; + } + return `${key}_${convertedValue}`; +}; +export const getMohallaLocale = (value = "", tenantId = "") => { + let convertedValue = convertDotValues(tenantId); + if (convertedValue === "NA" || !checkForNotNull(value)) { + return "PT_NA"; + } + convertedValue = convertedValue.toUpperCase(); + return convertToLocale(value, `${convertedValue}_REVENUE`); +}; + +export const getCityLocale = (value = "") => { + let convertedValue = convertDotValues(value); + if (convertedValue === "NA" || !checkForNotNull(value)) { + return "PT_NA"; + } + convertedValue = convertedValue.toUpperCase(); + return convertToLocale(convertedValue, `TENANT_TENANTS`); +}; + +export const convertDateToEpoch = (dateString, dayStartOrEnd = "dayend") => { + //example input format : "2018-10-02" + try { + const parts = dateString.match(/(\d{4})-(\d{1,2})-(\d{1,2})/); + const DateObj = new Date(Date.UTC(parts[1], parts[2] - 1, parts[3])); + DateObj.setMinutes(DateObj.getMinutes() + DateObj.getTimezoneOffset()); + if (dayStartOrEnd === "dayend") { + DateObj.setHours(DateObj.getHours() + 24); + DateObj.setSeconds(DateObj.getSeconds() - 1); + } + return DateObj.getTime(); + } catch (e) { + return dateString; + } +}; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/CHANGELOG.md b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/CHANGELOG.md new file mode 100644 index 0000000..4340cc5 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/CHANGELOG.md @@ -0,0 +1,201 @@ +# Changelog + +## 1.8.2-beta.12 +- Updated the css + +## 1.8.2-beta.11 +- Changed the policy schema + +## 1.8.2-beta.10 +- Enchanced Privacy component for table of contents + +## 1.8.2-beta.9 +- Added classname for languageselection + +## 1.8.2-beta.8 +- Fixed header logout issue + +## 1.8.2-beta.7 +- Added privacy component in mdms + +## 1.8.2-beta.6 +- Fixed forgot password link + +## 1.8.2-beta.5 +- Added Privacy Component(Don't use beta.4 has issues) + +## 1.8.2-beta.4 +- Added Privacy Component + +## 1.8.2-beta.2 +- Updated LogoutDialog + +## 1.8.2-beta.1 +- Fixed the jenkins build issue + +## 1.8.1-beta.23 +- Added a new classname to homescreen classes. + +## 1.8.1-beta.21 +- Updated Toast Component Props. + +## 1.8.1-beta.18 +- Updated utilities module Kibana logic to support sidebar actions. + +## 1.8.1-beta.17 +- Updated UI components: Toast, RemovableTag, and ErrorMessage. + +## 1.8.1-beta.16 +- Updated library with spacers and CSS. +- Modified dropdown in UI components. + +## 1.8.1-beta.15 +- Updated UI components dropdown option labels. +- Updated version of UI components and CSS. + +## 1.8.1-beta.14 +- Updated UI components and CSS versions for dropdown option labels and toast info. + +## 1.8.1-beta.13 +- Updated UI components and CSS versions. + +## 1.8.1-beta.12 +- Used a new Primary constant color `#c84c0e`. + - **Note:** Use this version with CSS 1.8.1-beta.8, component 1.8.1-beta.15. + +## 1.8.1-beta.11 +- Enhancements of components and CSS. + +## 1.8.1-beta.10 +- Fixed login screen issue. + +## 1.8.1-beta.9 +- Fixed stability issue. + +## 1.8.1-beta.8 +- Enhanced to load screen even if MDMS is failing. + +## 1.8.1-beta.7 +- Added custom support for all SVG icons to be used in the sidebar by specifying the icon as `svg:localairport` (svg:iconname). + +## 1.8.1-beta.6 +- Resolved duplicacy issue in the Sidebar. + +## 1.8.1-beta.5 +- Fixed Sidebar Path issue. + +## 1.8.1-beta.4 +- Added a null check for homescreen landing issue. + +## 1.8.1-beta.3 +- User profile back button fixes for mobile view. + +## 1.8.1-beta.2 +- User profile Save and Change Password button fixes for mobile view. + +## 1.8.1-beta.1 +- Republished after merging with Master due to version issues. + +## 1.8.0-beta.16 +- Fixed the hardcoded logout message. + +## 1.8.0-beta.15 +- Fixed the sidebar sort order issue. + +## 1.8.0-beta.14 + +## 1.8.0-beta.13 + +## 1.8.0-beta.12 + +## 1.8.0-beta.11 +- Republished due to some version issues. + +## 1.8.0-beta.10 +- Constants updated for mgramsewa. + +## 1.8.0-beta.9 +- Updated How It Works screen to take header from MDMS config and show PDF card only when required. + +## 1.8.0-beta.8 +- Redefined additional component to render only under employee home page. + +## 1.8.0-beta.6 +- Added additional component render for TQM modules. + +## 1.8.0 +- Workbench v1.0. + +## 1.8.0-beta.5 +- Fix for login screen alignments. + +## 1.8.0-beta.4 +- Made the default localisation in global config. + +## 1.8.0-beta +- Workbench base version beta release. + +## 1.7.0 +- Urban 2.9. + +## 1.6.0 +- Urban 2.8. + +## 1.5.43 +- Redirection issue fix in case of no roles in selected city. + +## 1.5.46 +- Added classname for topbar options dropdown. + +## 1.5.45 +- Alignment issue in edit and logout. + +## 1.5.44 +- Updated login SCSS and alignment issues. + +## 1.5.42 +- Fixed the MDMS call in login component for dynamic updating. + +## 1.5.41 +- Updated the readme content. + +## 1.5.40 +- Updated the login component to handle MDMS config, which can be accessed from master - `commonUiConfig` and module - `LoginConfig`. + +## 1.5.39 +- Show the Toast when password changed and need to logout from profile page. + +## 1.5.38 +- Enabled the admin mode for employee login which can be accessed through route `employee/user/login?mode=admin`. +- Updated to use `formcomposerv2`. + +## 1.5.37 +- Fixed hiding upload drawer icons. + +## 1.5.36 +- Fixed error when clicking on change password and then trying to save profile without changing the password. + +## 1.5.35 +- Fixed user profile email being prefilled when clicking on change password. + +## 1.5.34 +- Fixed module not found redirection issue. + +## 1.5.33 +- Fixed payment not throwing error page for sanitation. + +## 1.5.32 +- Fixed the localisation issue by adding translation to the keys. +- Fixed payment response issue for sanitation UI. + +## 1.5.31 +- Fixed the all services screen back button for sanitation UI. + +## 1.5.30 +- Fixed the home routing issue in error screen. + +## 1.5.29 +- Added the readme file. + +## 1.5.28 +- Fixed the route issue for profile screen. diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/README.md b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/README.md new file mode 100644 index 0000000..36062d1 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/README.md @@ -0,0 +1,101 @@ + + +# digit-ui-module-core + +## Install + +```bash +npm install --save @egovernments/digit-ui-module-core +``` + +## Limitation + +```bash +This Package is more specific to DIGIT-UI's can be used across mission's +``` + +## Usage + +After adding the dependency make sure you have this dependency in + +```bash +frontend/micro-ui/web/package.json +``` + +```json +"@egovernments/digit-ui-module-core":"^1.5.0", +``` + +then navigate to App.js + +```bash + frontend/micro-ui/web/src/App.js +``` + +```jsx +/** add this import **/ + +import { DigitUI } from "@egovernments/digit-ui-module-core"; + + +/** inside render Function add the import for the component **/ + + ReactDOM.render(, document.getElementById("root")); + +``` + +# Mandatory changes to use following version + +``` +from 1.5.38 add the following utility method in micro-ui-internals/packages/libraries/src/utils/index.js + +const createFunction = (functionAsString) => { + return Function("return " + functionAsString)(); +}; + +export as createFunction; + +similarly update line 76 of react-components/src/molecules/CustomDropdown.js + +with + .filter((opt) => (opt?.hasOwnProperty("active") ? opt.active : true)) + +``` + * Digit.Utils.getDefaultLanguage() + +``` +from 1.8.0 beta version add the following utility method in micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js + +const getDefaultLanguage = () => { + return `${getLocaleDefault()}_${getLocaleRegion()}`; +}; + +and add its related functions + +``` + +## Changelog + +### Summary for Version [1.8.2-beta.1] - 2024-06-05 + +For a detailed changelog, see the [CHANGELOG.md](./CHANGELOG.md) file. + + +### Contributors + +[jagankumar-egov] [nipunarora-eGov] [Tulika-eGov] [Ramkrishna-egov] [nabeelmd-eGov] [anil-egov] [vamshikrishnakole-wtt-egov] + +## Documentation + +Documentation Site (https://core.digit.org/guides/developer-guide/ui-developer-guide/digit-ui) + +## Maintainer + +- [jagankumar-egov](https://www.github.com/jagankumar-egov) + + +### Published from DIGIT Frontend +DIGIT Frontend Repo (https://github.com/egovernments/Digit-Frontend/tree/develop) + + +![Logo](https://s3.ap-south-1.amazonaws.com/works-dev-asset/mseva-white-logo.png) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/package.json b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/package.json new file mode 100644 index 0000000..b03e924 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/package.json @@ -0,0 +1,37 @@ +{ + "name": "@egovernments/digit-ui-module-core", + "version": "1.8.2-beta.12", + "license": "MIT", + "main": "dist/index.js", + "module": "dist/index.modern.js", + "source": "src/Module.js", + "files": [ + "dist" + ], + "scripts": { + "start": "microbundle-crl watch --no-compress --format modern,cjs", + "build": "microbundle-crl --compress --no-sourcemap --format cjs", + "prepublish": "yarn build" + }, + "dependencies": { + "@egovernments/digit-ui-components": "0.0.2-beta.38", + "@egovernments/digit-ui-react-components": "1.8.2-beta.12", + "react": "17.0.2", + "react-dom": "17.0.2", + "react-i18next": "11.16.2", + "react-query": "3.6.1", + "react-redux": "7.2.8", + "react-router-dom": "5.3.0", + "react-tooltip": "4.1.2", + "redux": "4.1.2", + "redux-thunk": "2.4.1" + }, + "author": "JaganKumar ", + "keywords": [ + "digit", + "egov", + "dpg", + "digit-ui", + "core" + ] +} \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/App.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/App.js new file mode 100644 index 0000000..e5151d0 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/App.js @@ -0,0 +1,59 @@ +import React, { useEffect } from "react"; +import { Redirect, Route, Switch, useHistory, useLocation } from "react-router-dom"; +import EmployeeApp from "./pages/employee"; +import IndividualApp from "./pages/individual"; + +export const DigitApp = ({ stateCode, modules, appTenants, logoUrl, initData ,defaultLanding="citizen"}) => { + const history = useHistory(); + const { pathname } = useLocation(); + const innerWidth = window.innerWidth; + const cityDetails = Digit.ULBService.getCurrentUlb(); + const userDetails = Digit.UserService.getUser(); + const { data: storeData } = Digit.Hooks.useStore.getInitData(); + const { stateInfo } = storeData || {}; + + const DSO = Digit.UserService.hasAccess(["FSM_DSO"]); + let CITIZEN = userDetails?.info?.type === "CITIZEN" || !window.location.pathname.split("/").includes("employee") ? true : false; + + if (window.location.pathname.split("/").includes("employee")) CITIZEN = false; + + history.listen(() => { + window?.scrollTo({ top: 0, left: 0, behavior: "smooth" }); + }); + + const handleUserDropdownSelection = (option) => { + option.func(); + }; + + const mobileView = innerWidth <= 640; + let sourceUrl = `${window.location.origin}/citizen`; + const commonProps = { + stateInfo, + userDetails, + CITIZEN, + cityDetails, + mobileView, + handleUserDropdownSelection, + logoUrl, + DSO, + stateCode, + modules, + appTenants, + sourceUrl, + pathname, + initData, + }; + return ( + + + + + + + + + + + + ); +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/Module.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/Module.js new file mode 100644 index 0000000..b7e4f74 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/Module.js @@ -0,0 +1,110 @@ +import { BodyContainer } from "@egovernments/digit-ui-components"; +import { Loader } from "@egovernments/digit-ui-components"; +import React from "react"; +import { getI18n } from "react-i18next"; +import { QueryClient, QueryClientProvider } from "react-query"; +import { Provider } from "react-redux"; +import { BrowserRouter as Router } from "react-router-dom"; +import { DigitApp } from "./App"; +import { useState } from "react"; +import ErrorBoundary from "./components/ErrorBoundaries"; +import getStore from "./redux/store"; + +const DigitUIWrapper = ({ stateCode, enabledModules, moduleReducers, defaultLanding }) => { + const { isLoading, data: initData={} } = Digit.Hooks.useInitStore(stateCode, enabledModules); + if (isLoading) { + return ; + } + const data=getStore(initData, moduleReducers(initData)) || {}; + + const i18n = getI18n(); + + return ( + + + + + + + + ); +}; + +export const DigitUI = ({ stateCode, registry, enabledModules, moduleReducers, defaultLanding }) => { + const [privacy, setPrivacy] = useState(Digit.Utils.getPrivacyObject() || {}); + const userType = Digit.UserService.getType(); + const queryClient = new QueryClient({ + defaultOptions: { + queries: { + staleTime: 15 * 60 * 1000, + cacheTime: 50 * 60 * 1000, + retry: false, + retryDelay: (attemptIndex) => Infinity, + /* + enable this to have auto retry incase of failure + retryDelay: attemptIndex => Math.min(1000 * 3 ** attemptIndex, 60000) + */ + }, + }, + }); + + const ComponentProvider = Digit.Contexts.ComponentProvider; + const PrivacyProvider = Digit.Contexts.PrivacyProvider; + + const DSO = Digit.UserService.hasAccess(["FSM_DSO"]); + + return ( +
+ + + + { + Digit.Utils.setPrivacyObject({}); + setPrivacy({}); + }, + getPrivacy: () => { + const privacyObj = Digit.Utils.getPrivacyObject(); + setPrivacy(privacyObj); + return privacyObj; + }, + /* Descoped method to update privacy object */ + updatePrivacyDescoped: (_data) => { + const privacyObj = Digit.Utils.getAllPrivacyObject(); + const newObj = { ...privacyObj, [window.location.pathname]: _data }; + Digit.Utils.setPrivacyObject({ ...newObj }); + setPrivacy(privacyObj?.[window.location.pathname] || {}); + }, + /** + * Main Method to update the privacy object anywhere in the application + * + * @author jagankumar-egov + * + * Feature :: Privacy + * + * @example + * const { privacy , updatePrivacy } = Digit.Hooks.usePrivacyContext(); + */ + updatePrivacy: (uuid, fieldName) => { + setPrivacy(Digit.Utils.updatePrivacy(uuid, fieldName) || {}); + }, + }} + > + + + + + +
+ ); +}; + diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/AppModules.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/AppModules.js new file mode 100644 index 0000000..5c7d8fe --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/AppModules.js @@ -0,0 +1,59 @@ +import React from "react"; +import { Redirect, Route, Switch, useLocation, useRouteMatch } from "react-router-dom"; + +import ChangePassword from "../pages/employee/ChangePassword/index"; +import ForgotPassword from "../pages/employee/ForgotPassword/index"; +import { AppHome } from "./Home"; +// import UserProfile from "./userProfile"; + +const getTenants = (codes, tenants) => { + return tenants.filter((tenant) => codes?.map?.((item) => item.code).includes(tenant.code)); +}; + +export const AppModules = ({ stateCode, userType, modules, appTenants, additionalComponent }) => { + const ComponentProvider = Digit.Contexts.ComponentProvider; + const { path } = useRouteMatch(); + const location = useLocation(); + + const user = Digit.UserService.getUser(); + + if (!user || !user?.access_token || !user?.info) { + return ; + } + + const appRoutes = modules.map(({ code, tenants }, index) => { + const Module = Digit.ComponentRegistryService.getComponent(`${code}Module`); + return Module ? ( + + + + ) : ( + + + + ); + }); + + return ( +
+ + {appRoutes} + + + + + + + + + + + + + {/* */} + +
+ ); +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Background.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Background.js new file mode 100644 index 0000000..f2b4c0c --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Background.js @@ -0,0 +1,7 @@ +import React from "react"; + +const Background = ({ children }) => { + return
{children}
; +}; + +export default Background; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeCity.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeCity.js new file mode 100644 index 0000000..c463eb2 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeCity.js @@ -0,0 +1,92 @@ +import { Dropdown } from "@egovernments/digit-ui-components"; +import React, { useEffect, useState } from "react"; +import { useHistory } from "react-router-dom"; + +const stringReplaceAll = (str = "", searcher = "", replaceWith = "") => { + if (searcher == "") return str; + while (str?.includes(searcher)) { + str = str?.replace(searcher, replaceWith); + } + return str; +}; + +const ChangeCity = (prop) => { + const [dropDownData, setDropDownData] = useState(null); + const [selectCityData, setSelectCityData] = useState([]); + const [selectedCity, setSelectedCity] = useState([]); //selectedCities?.[0]?.value + const history = useHistory(); + const isDropdown = prop.dropdown || false; + let selectedCities = []; + + const handleChangeCity = (city) => { + const loggedInData = Digit.SessionStorage.get("citizen.userRequestObject"); + const filteredRoles = Digit.SessionStorage.get("citizen.userRequestObject")?.info?.roles?.filter((role) => role.tenantId === city.value); + if (filteredRoles?.length > 0) { + loggedInData.info.roles = filteredRoles; + loggedInData.info.tenantId = city?.value; + } + Digit.SessionStorage.set("Employee.tenantId", city?.value); + Digit.UserService.setUser(loggedInData); + setDropDownData(city); + if (window.location.href.includes(`/${window?.contextPath}/employee/`)) { + const redirectPath = location.state?.from || `/${window?.contextPath}/employee`; + history.replace(redirectPath); + } + window.location.reload(); + }; + + useEffect(() => { + const userloggedValues = Digit.SessionStorage.get("citizen.userRequestObject"); + let teantsArray = [], + filteredArray = []; + userloggedValues?.info?.roles?.forEach((role) => teantsArray.push(role.tenantId)); + let unique = teantsArray.filter((item, i, ar) => ar.indexOf(item) === i); + unique?.forEach((uniCode) => { + filteredArray.push({ + label: `TENANT_TENANTS_${stringReplaceAll(uniCode, ".", "_")?.toUpperCase()}`, + value: uniCode, + }); + }); + selectedCities = filteredArray?.filter((select) => select.value == Digit.SessionStorage.get("Employee.tenantId")); + setSelectCityData(filteredArray); + }, [dropDownData]); + + // if (isDropdown) { + return ( +
+ cityValue.value === dropDownData?.value)} + optionKey={"label"} + select={handleChangeCity} + freeze={true} + customSelector={ + + } + /> +
+ ); + // } else { + // return ( + // + //
City
+ //
+ // {selectCityData?.map((city, index) => ( + //
+ // handleChangeCity(city)} + // > + //
+ // ))} + //
+ //
+ // ); + // } +}; + +export default ChangeCity; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeLanguage.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeLanguage.js new file mode 100644 index 0000000..6de32dd --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeLanguage.js @@ -0,0 +1,51 @@ +import { Button, Dropdown } from "@egovernments/digit-ui-components"; +import React, { useState } from "react"; + +const ChangeLanguage = (prop) => { + const isDropdown = prop.dropdown || false; + const { data: storeData, isLoading } = Digit.Hooks.useStore.getInitData(); + const { languages, stateInfo } = storeData || {}; + const selectedLanguage = Digit.StoreData.getCurrentLanguage(); + const [selected, setselected] = useState(selectedLanguage); + const handleChangeLanguage = (language) => { + setselected(language.value); + Digit.LocalizationService.changeLanguage(language.value, stateInfo.code); + }; + + if (isLoading) return null; + + if (isDropdown) { + return ( +
+ language.value === selectedLanguage)} + optionKey={"label"} + select={handleChangeLanguage} + freeze={true} + customSelector={} + /> +
+ ); + } else { + return ( + +
Language
+
+ {languages.map((language, index) => ( +
+
+ ))} +
+
+ ); + } +}; + +export default ChangeLanguage; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Dialog/LogoutDialog.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Dialog/LogoutDialog.js new file mode 100644 index 0000000..0e8a5bd --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Dialog/LogoutDialog.js @@ -0,0 +1,62 @@ +import { CardText, PopUp, Button } from "@egovernments/digit-ui-components"; +import React from "react"; +import { useTranslation } from "react-i18next"; + +const LogoutDialog = ({ onSelect, onCancel, onDismiss, PopupStyles, isDisabled, hideSubmit }) => { + const { t } = useTranslation(); + + const children = [ +
+ + {t("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE") + " "} + {t("CORE_LOGOUT_MESSAGE")} + +
, + ]; + + const footer = [ + + + + ); +}; + +export default ErrorComponent; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Header.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Header.js new file mode 100644 index 0000000..541e9f6 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Header.js @@ -0,0 +1,20 @@ +import { Loader } from "@egovernments/digit-ui-components"; +import React from "react"; +import { useTranslation } from "react-i18next"; + +const Header = () => { + const { data: storeData, isLoading } = Digit.Hooks.useStore.getInitData(); + const { stateInfo } = storeData || {}; + const { t } = useTranslation() + + if (isLoading) return ; + + return ( +
+ +

{t(`TENANT_TENANTS_${stateInfo?.code?.toUpperCase()}`)}

+
+ ); +} + +export default Header; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Home.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Home.js new file mode 100644 index 0000000..e59ed59 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Home.js @@ -0,0 +1,171 @@ +import { + BackButton, + CitizenHomeCard, + CitizenInfoLabel, + Loader, +} from "@egovernments/digit-ui-components"; + +import React, { Fragment } from "react"; +import { useTranslation } from "react-i18next"; + +/* +Feature :: Citizen All service screen cards +*/ +export const processLinkData = (newData, code, t) => { + const obj = newData?.[`${code}`]; + if (obj) { + obj.map((link) => { + (link.link = link["navigationURL"]), (link.i18nKey = t(link["name"])); + }); + } + const newObj = { + links: obj?.reverse(), + header: Digit.Utils.locale.getTransformedLocale(`ACTION_TEST_${code}`), + iconName: `CITIZEN_${code}_ICON`, + }; + if (code === "FSM") { + const roleBasedLoginRoutes = [ + { + role: "FSM_DSO", + from: `/${window?.contextPath}/citizen/fsm/dso-dashboard`, + dashoardLink: "CS_LINK_DSO_DASHBOARD", + loginLink: "CS_LINK_LOGIN_DSO", + }, + ]; + //RAIN-7297 + roleBasedLoginRoutes.map(({ role, from, loginLink, dashoardLink }) => { + if (Digit.UserService.hasAccess(role)) + newObj?.links?.push({ + link: from, + i18nKey: t(dashoardLink), + }); + else + newObj?.links?.push({ + link: `/${window?.contextPath}/citizen/login`, + state: { role: "FSM_DSO", from }, + i18nKey: t(loginLink), + }); + }); + } + + return newObj; +}; +const iconSelector = (code) => { +
No Icon Found
+}; +const CitizenHome = ({ + modules, + getCitizenMenu, + fetchedCitizen, + isLoading, +}) => { + const paymentModule = modules.filter(({ code }) => code === "Payment")[0]; + const moduleArr = modules.filter(({ code }) => code !== "Payment"); + const moduleArray = [paymentModule, ...moduleArr]; + const { t } = useTranslation(); + if (isLoading) { + return ; + } + + return ( + +
+ {location.pathname.includes( + "sanitation-ui/citizen/all-services" + ) ? null : ( + + )} +
+ {moduleArray + .filter((mod) => mod) + .map(({ code }, index) => { + let mdmsDataObj; + if (fetchedCitizen) + mdmsDataObj = fetchedCitizen + ? processLinkData(getCitizenMenu, code, t) + : undefined; + if (mdmsDataObj?.links?.length > 0) { + return ( + ele?.link) + ?.sort((x, y) => x?.orderNumber - y?.orderNumber)} + Icon={() => iconSelector(code)} + Info={ + code === "OBPS" + ? () => ( + + ) + : null + } + isInfo={code === "OBPS" ? true : false} + /> + ); + } else return ; + })} +
+
+
+ ); +}; + +const EmployeeHome = ({ modules, additionalComponent }) => { + return ( + <> +
+
+ {modules.map(({ code }, index) => { + const Card = + Digit.ComponentRegistryService.getComponent(`${code}Card`) || + (() => ); + return ; + })} +
+
+ + {additionalComponent && + additionalComponent?.length > 0 && + additionalComponent.map((i) => { + const Component = + typeof i === "string" + ? Digit.ComponentRegistryService.getComponent(i) + : null; + return Component ? ( +
+ +
+ ) : null; + })} + + ); +}; + +export const AppHome = ({ + userType, + modules, + getCitizenMenu, + fetchedCitizen, + isLoading, + additionalComponent, +}) => { + if (userType === "citizen") { + return ( + + ); + } + return ( + + ); +}; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/PrivacyComponent.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/PrivacyComponent.js new file mode 100644 index 0000000..8dec540 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/PrivacyComponent.js @@ -0,0 +1,156 @@ +import React, { useState, useEffect, Fragment } from "react"; +import { useTranslation } from "react-i18next"; +import { CheckBox, PopUp, Button, Header } from "@egovernments/digit-ui-components"; +import { LinkButton } from "@egovernments/digit-ui-react-components"; + +const PrivacyComponent = ({ onSelect, formData, control, formState, ...props }) => { + const { t } = useTranslation(); + const tenantId = Digit.ULBService.getCurrentTenantId(); + const [isChecked, setIsChecked] = useState(false); + const [showPopUp, setShowPopUp] = useState(false); + const { data: privacy } = Digit.Hooks.useCustomMDMS(tenantId, "commonUiConfig", [{ name: "PrivacyPolicy" }], { + select: (data) => { + const filteredPrivacyPolicy = data?.commonUiConfig?.PrivacyPolicy.find(policy => policy.module === props?.props?.module); + return filteredPrivacyPolicy; + }, + }); + const handleCheckboxChange = (event) => { + setIsChecked(event.target.checked); + }; + useEffect(() => { + onSelect("check", isChecked); + }, [isChecked]); + const onButtonClick = () => { + setShowPopUp(true); + }; + + const handleScrollToElement = (id) => { + const element = document.getElementById(id); + if (element) { + element.scrollIntoView({ behavior: "smooth" }); + } + }; + + return ( + +
+ + +
+ {showPopUp && ( + { + setShowPopUp(false); + }} + footerChildren={[ + + + ))} + + + {privacy?.contents.map((content, index) => ( +
+
+ {t(content.header)} +
+ {content.descriptions.map((description, subIndex) => ( +
+
+ {description.type === 'points' && ( + + )} + {description.type === 'step' && ( + {subIndex + 1}. + )} + {t(description.text)} +
+ {description?.subDescriptions && description?.subDescriptions.length > 0 && ( +
+ {description.subDescriptions.map((subDesc, subSubIndex) => ( +
+ {subDesc.type === 'points' && ( + + )} + {subDesc.type === 'step' && ( + {subSubIndex + 1}. + )} + {subDesc.type === null && ( + + )} + {t(subDesc.text)} +
+ ))} +
+ )} +
+ ))} +
+ ))} +
+ )} +
+ ); +}; + +export default PrivacyComponent; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Search/MobileSearchApplication.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Search/MobileSearchApplication.js new file mode 100644 index 0000000..cf20ec6 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Search/MobileSearchApplication.js @@ -0,0 +1,254 @@ +import { + BackButton, + DetailsCard, + Header, + Loader, + PopUp, + SearchAction, + SearchForm, + CloseSvg, + DownloadBtnCommon, +} from "@egovernments/digit-ui-components"; +import React, { + useCallback, + useEffect, + useMemo, + useReducer, + useState, +} from "react"; +import SearchFormFields from "./SearchFields"; +// import { convertEpochToDateDMY } from "../../utils"; + +const MobileSearchApplication = ({ + Controller, + register, + control, + t, + reset, + previousPage, + handleSubmit, + tenantId, + data, + onSubmit, + isLoading, +}) => { + function activateModal(state, action) { + switch (action.type) { + case "set": + return action.payload; + case "remove": + return false; + default: + break; + } + } + const [tabledata, settabledata] = useState([]); + const DownloadBtn = (props) => { + return ( +
+ +
+ ); + }; + const handleExcelDownload = (tabData) => { + if (tabData?.[0] !== undefined) { + return Digit.Download.Excel(tabData?.[0], "AuditReport"); + } + }; + useEffect(() => { + if (data?.length > 0) { + settabledata([ + data?.map((obj) => { + let returnObject = {}; + returnObject[t("AUDIT_DATE_LABEL")] = convertEpochToDate( + obj?.timestamp + ); + returnObject[t("AUDIT_TIME_LABEL")] = convertEpochToTimeInHours( + obj?.timestamp + ); + returnObject[t("AUDIT_DATAVIEWED_LABEL")] = + obj?.dataView[0] + "," + obj?.dataView[1]; + returnObject[t("AUDIT_DATAVIEWED_BY_LABEL")] = obj?.dataViewedBy; + returnObject[t("AUDIT_ROLE_LABEL")] = obj?.roles + .map((obj) => obj.name) + .join(","); + return { + ...returnObject, + }; + }), + ]); + } + }, [data]); + const convertEpochToDate = (dateEpoch) => { + if (dateEpoch == null || dateEpoch == undefined || dateEpoch == "") { + return "NA"; + } + const dateFromApi = new Date(dateEpoch); + let month = dateFromApi.getMonth() + 1; + let day = dateFromApi.getDate(); + let year = dateFromApi.getFullYear(); + month = (month > 9 ? "" : "0") + month; + day = (day > 9 ? "" : "0") + day; + return `${day}/${month}/${year}`; + }; + const convertEpochToTimeInHours = (dateEpoch) => { + if (dateEpoch == null || dateEpoch == undefined || dateEpoch == "") { + return "NA"; + } + const dateFromApi = new Date(dateEpoch); + let hour = dateFromApi.getHours(); + let min = dateFromApi.getMinutes(); + let period = hour > 12 ? "PM" : "AM"; + hour = hour > 12 ? hour - 12 : hour; + hour = (hour > 9 ? "" : "0") + hour; + min = (min > 9 ? "" : "0") + min; + return `${hour}:${min} ${period}`; + }; + const [currentlyActiveMobileModal, setActiveMobileModal] = useReducer( + activateModal, + false + ); + + const closeMobilePopupModal = () => { + setActiveMobileModal({ type: "remove" }); + }; + + const MobilePopUpCloseButton = () => ( +
+ +
+ ); + const searchFormFieldsComponentProps = { + Controller, + register, + control, + t, + reset, + previousPage, + }; + + const MobileComponentDirectory = ({ + currentlyActiveMobileModal, + searchFormFieldsComponentProps, + tenantId, + ...props + }) => { + const { closeMobilePopupModal } = props; + switch (currentlyActiveMobileModal) { + case "SearchFormComponent": + return ( + + +
+

{t("PRIVACY_AUDIT_REPORT")}:

+
+ + {/* + +

{t(`ES_COMMON_CLEAR_ALL`)}

+
*/} +
+ ); + default: + return ; + } + }; + const CurrentMobileModalComponent = useCallback( + ({ + currentlyActiveMobileModal, + searchFormFieldsComponentProps, + tenantId, + ...props + }) => + MobileComponentDirectory({ + currentlyActiveMobileModal, + searchFormFieldsComponentProps, + tenantId, + ...props, + }), + [currentlyActiveMobileModal] + ); + let roles = []; + data?.roles?.forEach((item) => { + roles.push(item?.name); + }); + const propsMobileInboxCards = useMemo(() => { + if (data?.display) { + return []; + } + if (data === "") { + return []; + } + return data?.map((data) => ({ + [t("AUDIT_DATE_LABEL")]: convertEpochToDate(data.timestamp), + [t("AUDIT_TIME_LABEL")]: convertEpochToTimeInHours(data.timestamp), + [t("AUDIT_DATAVIEWED_LABEL")]: data.dataView[0] + "," + data.dataView[1], + [t("AUDIT_DATAVIEWED_BY_LABEL")]: data.dataViewedBy, + [t("AUDIT_ROLE_LABEL")]: data.roles + .slice(0, 3) + ?.map((e) => e.name) + .join(","), + })); + }, [data]); + + return ( + + +
+ handleExcelDownload(tabledata)} + /> +
+
{t("PRIVACY_AUDIT_REPORT")}:
+
+ + setActiveMobileModal({ + type: "set", + payload: "SearchFormComponent", + }) + } + {...{ tenantId, t }} + /> +
+ {currentlyActiveMobileModal ? ( + + { + setActiveMobileModal({ type: "remove" }); + onSubmit(data); + }} + handleSubmit={handleSubmit} + id="search-form" + className="rm-mb form-field-flex-one inboxPopupMobileWrapper" + {...{ + searchFormFieldsComponentProps, + currentlyActiveMobileModal, + closeMobilePopupModal, + tenantId, + }} + /> + + ) : null} + {isLoading && } + +
+ ); +}; + +export default MobileSearchApplication; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Search/SearchFields.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Search/SearchFields.js new file mode 100644 index 0000000..6c31b13 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Search/SearchFields.js @@ -0,0 +1,27 @@ +import { DatePicker, SearchField, Button } from "@egovernments/digit-ui-components"; +import React from "react"; +import { Controller } from "react-hook-form"; +const SearchFields = ({ register, control, reset, tenantId, t, previousPage, formState, isLoading }) => { + const isMobile = window.Digit.Utils.browser.isMobile(); + + return ( + <> + + + } name="fromDate" control={control} /> + + + + } name="toDate" control={control} /> + + +