diff --git a/micro-ui/web/core/package.json b/micro-ui/web/core/package.json index 9cbded5ef3f..4ee124781b8 100644 --- a/micro-ui/web/core/package.json +++ b/micro-ui/web/core/package.json @@ -15,9 +15,9 @@ ], "homepage": "/core-ui", "dependencies": { - "@egovernments/digit-ui-libraries": "1.8.1-beta.1", + "@egovernments/digit-ui-libraries": "1.8.1-beta.4", "@egovernments/digit-ui-module-workbench": "1.0.1-beta.9", - "@egovernments/digit-ui-module-core": "1.8.1-beta.6", + "@egovernments/digit-ui-module-core": "1.8.1-beta.8", "@egovernments/digit-ui-module-hrms": "1.8.0", "@egovernments/digit-ui-module-pgr": "1.7.5", "@egovernments/digit-ui-module-utilities": "1.0.1-beta.1", diff --git a/micro-ui/web/micro-ui-internals/example/package.json b/micro-ui/web/micro-ui-internals/example/package.json index 21d3e183bf8..1fc2beeea98 100644 --- a/micro-ui/web/micro-ui-internals/example/package.json +++ b/micro-ui/web/micro-ui-internals/example/package.json @@ -9,11 +9,11 @@ "start": "react-scripts start" }, "devDependencies": { - "@egovernments/digit-ui-libraries": "1.8.1-beta.2", + "@egovernments/digit-ui-libraries": "1.8.1-beta.4", "@egovernments/digit-ui-module-workbench": "1.0.1-beta.9", "@egovernments/digit-ui-module-pgr": "1.7.5", "@egovernments/digit-ui-module-dss": "1.8.0", - "@egovernments/digit-ui-module-core": "1.8.1-beta.7", + "@egovernments/digit-ui-module-core": "1.8.1-beta.8", "@egovernments/digit-ui-module-common": "1.8.0", "@egovernments/digit-ui-module-hrms": "1.8.0", "@egovernments/digit-ui-module-utilities": "1.0.1-beta.1", diff --git a/micro-ui/web/micro-ui-internals/packages/libraries/README.md b/micro-ui/web/micro-ui-internals/packages/libraries/README.md index 2cb55abb526..fc5d00c88b3 100644 --- a/micro-ui/web/micro-ui-internals/packages/libraries/README.md +++ b/micro-ui/web/micro-ui-internals/packages/libraries/README.md @@ -55,6 +55,8 @@ export default App; ### Changelog ```bash +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 Republished after merging with Master due to version issues. 1.8.0 Released as part of workbench v1.0 diff --git a/micro-ui/web/micro-ui-internals/packages/libraries/package.json b/micro-ui/web/micro-ui-internals/packages/libraries/package.json index 00a01501b0c..667099a3a9c 100644 --- a/micro-ui/web/micro-ui-internals/packages/libraries/package.json +++ b/micro-ui/web/micro-ui-internals/packages/libraries/package.json @@ -1,6 +1,6 @@ { "name": "@egovernments/digit-ui-libraries", - "version": "1.8.1-beta.3", + "version": "1.8.1-beta.4", "main": "dist/index.js", "module": "dist/index.modern.js", "source": "src/index.js", diff --git a/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js b/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js index c8dacd95506..b66f6f406c9 100644 --- a/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js +++ b/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js @@ -71,7 +71,7 @@ export const StoreService = { 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), + modules: MdmsRes?.tenant?.citymodule?.filter((module) => module?.active)?.filter((module) => enabledModules?.includes(module?.code))?.sort((x,y)=>x?.order-y?.order)|| [], uiHomePage: uiHomePage }; diff --git a/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Ulb/index.js b/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Ulb/index.js index e5249335b20..9d1be0baf24 100644 --- a/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Ulb/index.js +++ b/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Ulb/index.js @@ -67,7 +67,7 @@ export const ULBService = { getCurrentUlb: () => { const initData = StoreService.getInitData(); const tenantId = ULBService.getCurrentTenantId(); - return initData.tenants.find((tenant) => tenant.code === tenantId); + return initData?.tenants?.find((tenant) => tenant?.code === tenantId)||ULBService.getStateId(); } /** * Custom method to get citizen's current selected city diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/README.md b/micro-ui/web/micro-ui-internals/packages/modules/core/README.md index d5a4ad77aff..90b2fab3f09 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/README.md +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/README.md @@ -78,6 +78,7 @@ and add its related functions ### Changelog ```bash +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 sidebar by specifiying 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 diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/package.json b/micro-ui/web/micro-ui-internals/packages/modules/core/package.json index b94b2ddcc34..3f6c11a9c17 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/package.json +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/package.json @@ -1,6 +1,6 @@ { "name": "@egovernments/digit-ui-module-core", - "version": "1.8.1-beta.7", + "version": "1.8.1-beta.8", "license": "MIT", "main": "dist/index.js", "module": "dist/index.modern.js", @@ -14,8 +14,8 @@ "prepublish": "yarn build" }, "dependencies": { + "@egovernments/digit-ui-components": "0.0.1-beta.9", "@egovernments/digit-ui-react-components": "1.8.1-beta.9", - "@egovernments/digit-ui-components": "0.0.1-beta.3", "react": "17.0.2", "react-dom": "17.0.2", "react-i18next": "11.16.2", diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/Module.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/Module.js index 631bf4ca839..688b9de9bde 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/Module.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/Module.js @@ -1,4 +1,5 @@ -import { Body, Loader } from "@egovernments/digit-ui-react-components"; +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"; @@ -12,17 +13,18 @@ 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); +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}) => { +export const DigitUI = ({ stateCode, registry, enabledModules, moduleReducers, defaultLanding }) => { const [privacy, setPrivacy] = useState(Digit.Utils.getPrivacyObject() || {}); const userType = Digit.UserService.getType(); const queryClient = new QueryClient({ @@ -99,7 +101,7 @@ export const DigitUI = ({ stateCode, registry, enabledModules, moduleReducers ,d }, }} > - + diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeCity.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeCity.js index 3c77daf0e54..c463eb245e7 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeCity.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeCity.js @@ -1,4 +1,4 @@ -import { Dropdown } from "@egovernments/digit-ui-react-components"; +import { Dropdown } from "@egovernments/digit-ui-components"; import React, { useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeLanguage.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeLanguage.js index a5eba9163fd..9d0bad559c7 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeLanguage.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeLanguage.js @@ -1,4 +1,4 @@ -import { CustomButton, Dropdown } from "@egovernments/digit-ui-react-components"; +import { Button, Dropdown } from "@egovernments/digit-ui-components"; import React, { useState } from "react"; const ChangeLanguage = (prop) => { @@ -34,11 +34,7 @@ const ChangeLanguage = (prop) => {
{languages.map((language, index) => (
- handleChangeLanguage(language)} - > +
))}
diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Dialog/LogoutDialog.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Dialog/LogoutDialog.js index c36ca264588..cb55d19e392 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Dialog/LogoutDialog.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Dialog/LogoutDialog.js @@ -1,4 +1,4 @@ -import { CardText, CloseSvg, Modal } from "@egovernments/digit-ui-react-components"; +import {CardText, SVG, Modal} from "@egovernments/digit-ui-components"; import React from "react"; import { useTranslation } from "react-i18next"; @@ -15,11 +15,10 @@ const CloseBtn = (props) => { return (
{props?.isMobileView ? ( - + ) : (
- {" "} - {" "} +
)}
@@ -69,7 +68,7 @@ const LogoutDialog = ({ onSelect, onCancel, onDismiss }) => { position: "absolute", left: 0, bottom: 0, - padding: "18px", + padding: "5px", }} style={{ flex: 1, diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Header.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Header.js index a07bdb9d04c..541e9f68f93 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Header.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Header.js @@ -1,6 +1,6 @@ +import { Loader } from "@egovernments/digit-ui-components"; import React from "react"; import { useTranslation } from "react-i18next"; -import { Loader } from "@egovernments/digit-ui-react-components" const Header = () => { const { data: storeData, isLoading } = Digit.Hooks.useStore.getInitData(); @@ -12,7 +12,7 @@ const Header = () => { return (
-

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

+

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

); } diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Home.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Home.js index b456135702e..ba12833022f 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Home.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Home.js @@ -1,17 +1,13 @@ import { BackButton, - BillsIcon, CitizenHomeCard, CitizenInfoLabel, - FSMIcon, Loader, + FSMIcon, MCollectIcon, - OBPSIcon, - PGRIcon, - PTIcon, - TLIcon, - WSICon, -} from "@egovernments/digit-ui-react-components"; + BillsIcon +} from "@egovernments/digit-ui-components"; + import React, { Fragment } from "react"; import { useTranslation } from "react-i18next"; @@ -79,7 +75,12 @@ const iconSelector = (code) => { return ; } }; -const CitizenHome = ({ modules, getCitizenMenu, fetchedCitizen, isLoading }) => { +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]; @@ -91,18 +92,27 @@ const CitizenHome = ({ modules, getCitizenMenu, fetchedCitizen, isLoading }) => return (
- {location.pathname.includes("sanitation-ui/citizen/all-services") ? null : } + {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 (fetchedCitizen) + mdmsDataObj = fetchedCitizen + ? processLinkData(getCitizenMenu, code, t) + : undefined; if (mdmsDataObj?.links?.length > 0) { return ( ele?.link)?.sort((x, y) => x?.orderNumber - y?.orderNumber)} + links={mdmsDataObj?.links + ?.filter((ele) => ele?.link) + ?.sort((x, y) => x?.orderNumber - y?.orderNumber)} Icon={() => iconSelector(code)} Info={ code === "OBPS" @@ -110,7 +120,9 @@ const CitizenHome = ({ modules, getCitizenMenu, fetchedCitizen, isLoading }) => ) : null @@ -132,7 +144,9 @@ const EmployeeHome = ({ modules, additionalComponent }) => {
{modules.map(({ code }, index) => { - const Card = Digit.ComponentRegistryService.getComponent(`${code}Card`) || (() => ); + const Card = + Digit.ComponentRegistryService.getComponent(`${code}Card`) || + (() => ); return ; })}
@@ -141,7 +155,10 @@ const EmployeeHome = ({ modules, additionalComponent }) => { {additionalComponent && additionalComponent?.length > 0 && additionalComponent.map((i) => { - const Component = typeof i === "string" ? Digit.ComponentRegistryService.getComponent(i) : null; + const Component = + typeof i === "string" + ? Digit.ComponentRegistryService.getComponent(i) + : null; return Component ? (
@@ -152,9 +169,25 @@ const EmployeeHome = ({ modules, additionalComponent }) => { ); }; -export const AppHome = ({ userType, modules, getCitizenMenu, fetchedCitizen, isLoading, additionalComponent }) => { +export const AppHome = ({ + userType, + modules, + getCitizenMenu, + fetchedCitizen, + isLoading, + additionalComponent, +}) => { if (userType === "citizen") { - return ; + return ( + + ); } - return ; + return ( + + ); }; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Search/MobileSearchApplication.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Search/MobileSearchApplication.js index 0e85156f574..cf20ec6d2e1 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Search/MobileSearchApplication.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Search/MobileSearchApplication.js @@ -1,11 +1,37 @@ import { - BackButton, CloseSvg, DetailsCard, DownloadBtnCommon, Header, Loader, PopUp, SearchAction, SearchForm -} from "@egovernments/digit-ui-react-components"; -import React, { useCallback, useEffect, useMemo, useReducer, useState } from "react"; + 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 }) => { +const MobileSearchApplication = ({ + Controller, + register, + control, + t, + reset, + previousPage, + handleSubmit, + tenantId, + data, + onSubmit, + isLoading, +}) => { function activateModal(state, action) { switch (action.type) { case "set": @@ -34,11 +60,18 @@ const MobileSearchApplication = ({ Controller, register, control, t, reset, prev 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_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(","); + returnObject[t("AUDIT_ROLE_LABEL")] = obj?.roles + .map((obj) => obj.name) + .join(","); return { ...returnObject, }; @@ -71,20 +104,38 @@ const MobileSearchApplication = ({ Controller, register, control, t, reset, prev min = (min > 9 ? "" : "0") + min; return `${hour}:${min} ${period}`; }; - const [currentlyActiveMobileModal, setActiveMobileModal] = useReducer(activateModal, false); + const [currentlyActiveMobileModal, setActiveMobileModal] = useReducer( + activateModal, + false + ); const closeMobilePopupModal = () => { setActiveMobileModal({ type: "remove" }); }; const MobilePopUpCloseButton = () => ( -
+
); - const searchFormFieldsComponentProps = { Controller, register, control, t, reset, previousPage }; + const searchFormFieldsComponentProps = { + Controller, + register, + control, + t, + reset, + previousPage, + }; - const MobileComponentDirectory = ({ currentlyActiveMobileModal, searchFormFieldsComponentProps, tenantId, ...props }) => { + const MobileComponentDirectory = ({ + currentlyActiveMobileModal, + searchFormFieldsComponentProps, + tenantId, + ...props + }) => { const { closeMobilePopupModal } = props; switch (currentlyActiveMobileModal) { case "SearchFormComponent": @@ -94,7 +145,10 @@ const MobileSearchApplication = ({ Controller, register, control, t, reset, prev

{t("PRIVACY_AUDIT_REPORT")}:

- + {/*

{t(`ES_COMMON_CLEAR_ALL`)}

@@ -106,8 +160,18 @@ const MobileSearchApplication = ({ Controller, register, control, t, reset, prev } }; const CurrentMobileModalComponent = useCallback( - ({ currentlyActiveMobileModal, searchFormFieldsComponentProps, tenantId, ...props }) => - MobileComponentDirectory({ currentlyActiveMobileModal, searchFormFieldsComponentProps, tenantId, ...props }), + ({ + currentlyActiveMobileModal, + searchFormFieldsComponentProps, + tenantId, + ...props + }) => + MobileComponentDirectory({ + currentlyActiveMobileModal, + searchFormFieldsComponentProps, + tenantId, + ...props, + }), [currentlyActiveMobileModal] ); let roles = []; @@ -136,14 +200,25 @@ const MobileSearchApplication = ({ Controller, register, control, t, reset, prev return ( -
- handleExcelDownload(tabledata)} /> +
+ handleExcelDownload(tabledata)} + />
{t("PRIVACY_AUDIT_REPORT")}:
-
+
setActiveMobileModal({ type: "set", payload: "SearchFormComponent" })} + handleActionClick={() => + setActiveMobileModal({ + type: "set", + payload: "SearchFormComponent", + }) + } {...{ tenantId, t }} />
@@ -157,7 +232,12 @@ const MobileSearchApplication = ({ Controller, register, control, t, reset, prev handleSubmit={handleSubmit} id="search-form" className="rm-mb form-field-flex-one inboxPopupMobileWrapper" - {...{ searchFormFieldsComponentProps, currentlyActiveMobileModal, closeMobilePopupModal, tenantId }} + {...{ + searchFormFieldsComponentProps, + currentlyActiveMobileModal, + closeMobilePopupModal, + tenantId, + }} /> ) : null} diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Search/SearchFields.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Search/SearchFields.js index c3a37bd296e..6c31b13da0d 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Search/SearchFields.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Search/SearchFields.js @@ -1,6 +1,4 @@ -import { - DatePicker, SearchField, SubmitBar -} from "@egovernments/digit-ui-react-components"; +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 }) => { @@ -17,7 +15,7 @@ const SearchFields = ({ register, control, reset, tenantId, t, previousPage, for } name="toDate" control={control} /> - { - const initialValues = Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL") || { + const initialValues = Digit.SessionStorage.get( + "AUDIT_APPLICATION_DETAIL" + ) || { offset: 0, limit: 5, sortOrder: "DESC", }; - const { register, control, handleSubmit, setValue, getValues, reset } = useForm({ + const { + register, + control, + handleSubmit, + setValue, + getValues, + reset, + } = useForm({ defaultValues: initialValues, }); const convertEpochToDate = (dateEpoch) => { @@ -61,11 +79,18 @@ const SearchApplication = ({ tenantId, t, onSubmit, data, count }) => { 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_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(","); + returnObject[t("AUDIT_ROLE_LABEL")] = obj?.roles + .map((obj) => obj.name) + .join(","); return { ...returnObject, }; @@ -95,7 +120,22 @@ const SearchApplication = ({ tenantId, t, onSubmit, data, count }) => { const isMobile = window.Digit.Utils.browser.isMobile(); if (isMobile) { - return ; + return ( + + ); } //need to get from workflow @@ -106,7 +146,10 @@ const SearchApplication = ({ tenantId, t, onSubmit, data, count }) => { Header: t("AUDIT_DATE_LABEL"), disableSortBy: true, accessor: (row) => { - const timestamp = row.timestamp === "NA" ? t("WS_NA") : convertEpochToDate(row.timestamp); + const timestamp = + row.timestamp === "NA" + ? t("WS_NA") + : convertEpochToDate(row.timestamp); return GetCell(`${timestamp}`); }, }, @@ -114,19 +157,26 @@ const SearchApplication = ({ tenantId, t, onSubmit, data, count }) => { Header: t("AUDIT_TIME_LABEL"), disableSortBy: true, accessor: (row) => { - const timestamp = row.timestamp === "NA" ? t("WS_NA") : convertEpochToTimeInHours(row.timestamp); + const timestamp = + row.timestamp === "NA" + ? t("WS_NA") + : convertEpochToTimeInHours(row.timestamp); return GetCell(`${timestamp}`); }, }, { - Header: isMobile ? t("AUDIT_DATAVIEWED_LABEL") : t("AUDIT_DATAVIEWED_PRIVACY"), + Header: isMobile + ? t("AUDIT_DATAVIEWED_LABEL") + : t("AUDIT_DATAVIEWED_PRIVACY"), disableSortBy: true, accessor: (row) => { return GetCell(`${row?.dataView}`); }, }, { - Header: isMobile ? t("AUDIT_DATAVIEWED_BY_LABEL") : t("AUDIT_DATAVIEWED_BY_PRIVACY"), + Header: isMobile + ? t("AUDIT_DATAVIEWED_BY_LABEL") + : t("AUDIT_DATAVIEWED_BY_PRIVACY"), disableSortBy: true, accessor: (row) => { return GetCell(`${row?.dataViewedBy}`); @@ -153,12 +203,33 @@ const SearchApplication = ({ tenantId, t, onSubmit, data, count }) => { {" "}
{t("PRIVACY_AUDIT_REPORT")}
{" "}
- - + + -
+
{data?.display ? ( -
+
{t(data.display) .split("\\n") .map((text, index) => ( @@ -168,9 +239,21 @@ const SearchApplication = ({ tenantId, t, onSubmit, data, count }) => { ))}
) : data !== "" ? ( -
-
- handleExcelDownload(tabledata)} /> +
+
+ handleExcelDownload(tabledata)} + />
{ getCellProps={(cellInfo) => { return { style: { - minWidth: cellInfo.column.Header === t("ES_INBOX_APPLICATION_NO") ? "240px" : "", + minWidth: + cellInfo.column.Header === t("ES_INBOX_APPLICATION_NO") + ? "240px" + : "", padding: "20px 18px", fontSize: "16px", }, @@ -194,7 +280,12 @@ const SearchApplication = ({ tenantId, t, onSubmit, data, count }) => { pageSizeLimit={getValues("limit")} onSort={onSort} disableSort={false} - sortParams={[{ id: getValues("sortBy"), desc: getValues("sortOrder") === "DESC" ? true : false }]} + sortParams={[ + { + id: getValues("sortBy"), + desc: getValues("sortOrder") === "DESC" ? true : false, + }, + ]} /> ) : ( diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/CitizenSideBar.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/CitizenSideBar.js index a8139463aec..f5e4e4bbfb8 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/CitizenSideBar.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/CitizenSideBar.js @@ -1,6 +1,5 @@ -import { - Loader, NavBar -} from "@egovernments/digit-ui-react-components"; +import { NavBar } from "@egovernments/digit-ui-react-components"; +import { Loader } from "@egovernments/digit-ui-components"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { useHistory } from "react-router-dom"; @@ -9,14 +8,17 @@ import ChangeCity from "../../ChangeCity"; import { defaultImage } from "../../utils"; import StaticCitizenSideBar from "./StaticCitizenSideBar"; - const Profile = ({ info, stateName, t }) => { const [profilePic, setProfilePic] = React.useState(null); React.useEffect(async () => { const tenant = Digit.ULBService.getCurrentTenantId(); const uuid = info?.uuid; if (uuid) { - const usersResponse = await Digit.UserService.userSearch(tenant, { uuid: [uuid] }, {}); + const usersResponse = await Digit.UserService.userSearch( + tenant, + { uuid: [uuid] }, + {} + ); if (usersResponse && usersResponse.user && usersResponse.user.length) { const userDetails = usersResponse.user[0]; @@ -26,7 +28,9 @@ const Profile = ({ info, stateName, t }) => { } }, [profilePic !== null]); - const CustomEmployeeTopBar = Digit.ComponentRegistryService?.getComponent("CustomEmployeeTopBar") + const CustomEmployeeTopBar = Digit.ComponentRegistryService?.getComponent( + "CustomEmployeeTopBar" + ); return (
@@ -51,7 +55,8 @@ const Profile = ({ info, stateName, t }) => {
{window.location.href.includes("/employee") && !window.location.href.includes("/employee/user/login") && - !window.location.href.includes("employee/user/language-selection") && !CustomEmployeeTopBar && } + !window.location.href.includes("employee/user/language-selection") && + !CustomEmployeeTopBar && }
); }; @@ -62,7 +67,9 @@ const PoweredBy = () => ( src={window?.globalConfigs?.getConfig?.("DIGIT_FOOTER")} style={{ cursor: "pointer" }} onClick={() => { - window.open(window?.globalConfigs?.getConfig?.("DIGIT_HOME_URL"), "_blank").focus(); + window + .open(window?.globalConfigs?.getConfig?.("DIGIT_HOME_URL"), "_blank") + .focus(); }} />{" "} @@ -71,7 +78,15 @@ const PoweredBy = () => ( /* Feature :: Citizen Webview sidebar */ -export const CitizenSideBar = ({ isOpen, isMobile = false, toggleSidebar, onLogout, isEmployee = false, linkData, islinkDataLoading }) => { +export const CitizenSideBar = ({ + isOpen, + isMobile = false, + toggleSidebar, + onLogout, + isEmployee = false, + linkData, + islinkDataLoading, +}) => { const { data: storeData, isFetched } = Digit.Hooks.useStore.getInitData(); const { stateInfo } = storeData || {}; const user = Digit.UserService.getUser(); @@ -87,7 +102,9 @@ export const CitizenSideBar = ({ isOpen, isMobile = false, toggleSidebar, onLogo const { isLoading, data } = Digit.Hooks.useAccessControl(); const tenantId = Digit.ULBService.getCurrentTenantId(); const showProfilePage = () => { - const redirectUrl = isEmployee ? `/${window?.contextPath}/employee/user/profile` : `/${window?.contextPath}/citizen/user/profile`; + const redirectUrl = isEmployee + ? `/${window?.contextPath}/employee/user/profile` + : `/${window?.contextPath}/citizen/user/profile`; history.push(redirectUrl); closeSidebar(); }; @@ -101,10 +118,14 @@ export const CitizenSideBar = ({ isOpen, isMobile = false, toggleSidebar, onLogo return ; } - let menuItems = [...SideBarMenu(t, closeSidebar, redirectToLoginPage, isEmployee)]; + let menuItems = [ + ...SideBarMenu(t, closeSidebar, redirectToLoginPage, isEmployee), + ]; let profileItem; if (isFetched && user && user.access_token) { - profileItem = ; + profileItem = ( + + ); menuItems = menuItems.filter((item) => item?.id !== "login-btn"); menuItems = [ ...menuItems, @@ -132,16 +153,22 @@ export const CitizenSideBar = ({ isOpen, isMobile = false, toggleSidebar, onLogo {storeData?.tenants.map((i) => { i.code === tenantId ? ( ) : ( ); })} @@ -160,8 +187,12 @@ export const CitizenSideBar = ({ isOpen, isMobile = false, toggleSidebar, onLogo ?.map((key) => { if (linkData[key][0]?.sidebar === "digit-ui-links") menuItems.splice(1, 0, { - type: linkData[key][0]?.sidebarURL?.includes(window?.contextPath) ? "link" : "external-link", - text: t(`ACTION_TEST_${Digit.Utils.locale.getTransformedLocale(key)}`), + type: linkData[key][0]?.sidebarURL?.includes(window?.contextPath) + ? "link" + : "external-link", + text: t( + `ACTION_TEST_${Digit.Utils.locale.getTransformedLocale(key)}` + ), links: linkData[key], icon: linkData[key][0]?.leftIcon, link: linkData[key][0]?.sidebarURL, @@ -179,7 +210,10 @@ export const CitizenSideBar = ({ isOpen, isMobile = false, toggleSidebar, onLogo } else { configEmployeeSideBar[index].push(item); } - } else if (item.path !== "" && item?.displayName?.toLowerCase().includes(search.toLowerCase())) { + } else if ( + item.path !== "" && + item?.displayName?.toLowerCase().includes(search.toLowerCase()) + ) { let index = item.path.split(".")[0]; if (index === "TradeLicense") index = "Trade License"; if (!configEmployeeSideBar[index]) { @@ -191,8 +225,14 @@ export const CitizenSideBar = ({ isOpen, isMobile = false, toggleSidebar, onLogo }); const keys = Object.keys(configEmployeeSideBar); for (let i = 0; i < keys.length; i++) { - const getSingleDisplayName = configEmployeeSideBar[keys[i]][0]?.displayName?.toUpperCase()?.replace(/[ -]/g, "_"); - const getParentDisplayName = keys[i]?.toUpperCase()?.replace(/[ -]/g, "_"); + const getSingleDisplayName = configEmployeeSideBar[ + keys[i] + ][0]?.displayName + ?.toUpperCase() + ?.replace(/[ -]/g, "_"); + const getParentDisplayName = keys[i] + ?.toUpperCase() + ?.replace(/[ -]/g, "_"); if (configEmployeeSideBar[keys[i]][0].path.indexOf(".") === -1) { menuItems.splice(1, 0, { @@ -211,22 +251,31 @@ export const CitizenSideBar = ({ isOpen, isMobile = false, toggleSidebar, onLogo menuItems.splice(1, 0, { type: "dynamic", moduleName: t(`ACTION_TEST_${getParentDisplayName}`), - links: configEmployeeSideBar[keys[i]]?.map((ob) => {return {...ob, displayName: t(`ACTION_TEST_${ob?.displayName?.toUpperCase()?.replace(/[ -]/g, "_")}`)}}), + links: configEmployeeSideBar[keys[i]]?.map((ob) => { + return { + ...ob, + displayName: t( + `ACTION_TEST_${ob?.displayName + ?.toUpperCase() + ?.replace(/[ -]/g, "_")}` + ), + }; + }), icon: configEmployeeSideBar[keys[i]][1]?.leftIcon, }); } } - const indx = menuItems.findIndex(a => a.element === "HOME"); - const home = menuItems.splice(indx,1); - const comp = menuItems.findIndex(a => a.element === "LANGUAGE"); - const part = menuItems.splice(comp,menuItems?.length-comp); - menuItems.sort((a,b) => { + const indx = menuItems.findIndex((a) => a.element === "HOME"); + const home = menuItems.splice(indx, 1); + const comp = menuItems.findIndex((a) => a.element === "LANGUAGE"); + const part = menuItems.splice(comp, menuItems?.length - comp); + menuItems.sort((a, b) => { let c1 = a?.type === "dynamic" ? a?.moduleName : a?.text; let c2 = b?.type === "dynamic" ? b?.moduleName : b?.text; - return c1.localeCompare(c2) - } ); - home?.[0] && menuItems.splice(0,0,home[0]); - menuItems = part?.length > 0 ? menuItems.concat(part) : menuItems; + return c1.localeCompare(c2); + }); + home?.[0] && menuItems.splice(0, 0, home[0]); + menuItems = part?.length > 0 ? menuItems.concat(part) : menuItems; } /* URL with openlink wont have sidebar and actions */ diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/EmployeeSideBar.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/EmployeeSideBar.js index 1386aa5c5ce..35463d62c6f 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/EmployeeSideBar.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/EmployeeSideBar.js @@ -1,5 +1,5 @@ import React, { useRef, useEffect, useState } from "react"; -import { Loader, SearchIcon } from "@egovernments/digit-ui-react-components"; +import { Loader,SearchIcon } from "@egovernments/digit-ui-components"; import { useTranslation } from "react-i18next"; import Sidebar from "./SideBar"; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/SideBar.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/SideBar.js index fa8131f3091..d29b289b194 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/SideBar.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/SideBar.js @@ -6,34 +6,45 @@ import { HomeIcon, ComplaintIcon, BPAHomeIcon, + CollectionIcon, + FinanceChartIcon, + CollectionsBookmarIcons, + DropIcon, + DocumentIconSolid, + PersonIcon, PropertyHouse, - CaseIcon, ReceiptIcon, - PersonIcon, - DocumentIconSolid, - DropIcon, - CollectionsBookmarIcons, - FinanceChartIcon, - CollectionIcon, -} from "@egovernments/digit-ui-react-components"; + CaseIcon, +} from "@egovernments/digit-ui-components"; import ReactTooltip from "react-tooltip"; import { set } from "lodash"; import { useHistory, useLocation, Link } from "react-router-dom"; import { useTranslation } from "react-i18next"; -const DIGIT_UI_CONTEXTS = ["digit-ui", "works-ui", "workbench-ui", "health-ui", "sanitation-ui", "core-ui", "mgramseva-web"]; +const DIGIT_UI_CONTEXTS = [ + "digit-ui", + "works-ui", + "workbench-ui", + "health-ui", + "sanitation-ui", + "core-ui", + "mgramseva-web", +]; // Function to recursively get the key of a nested object based on a parent key const getKey = (obj, parent) => { - if (typeof obj !== 'object' || obj === null) { + if (typeof obj !== "object" || obj === null) { // If obj is not an object or is null, return null return null; } // Use Object.keys to get an array of keys in the object const key = Object.keys(obj).map((key) => { // Check if the object has an 'item' property with a 'path' property - if (typeof obj[key]?.item?.path === 'string') { - return obj[key]?.item?.path?.split(parent ? `${parent}.${key}` : `.${key}`) || getKey(obj[key], key); + if (typeof obj[key]?.item?.path === "string") { + return ( + obj[key]?.item?.path?.split(parent ? `${parent}.${key}` : `.${key}`) || + getKey(obj[key], key) + ); } return null; // or return some default value if neither condition is met }); @@ -46,11 +57,11 @@ const findKey = (key = "") => { // Split the key string into an array using dot as a separator const newSplitedList = key?.split("."); // Check if the key string ends with a dot - return key?.endsWith?.(".") ? - // If it ends with a dot, return the first element of the array - newSplitedList[0] : - // If not, return the last element of the array - newSplitedList[newSplitedList?.length - 1]; + return key?.endsWith?.(".") + ? // If it ends with a dot, return the first element of the array + newSplitedList[0] + : // If not, return the last element of the array + newSplitedList[newSplitedList?.length - 1]; }; /* @@ -59,7 +70,11 @@ Used to navigate to other mission's ui if user has access const navigateToRespectiveURL = (history = {}, url = "") => { if (url?.indexOf(`/${window?.contextPath}`) === -1) { const hostUrl = window.location.origin; - const updatedURL = DIGIT_UI_CONTEXTS?.every((e) => url?.indexOf(`/${e}`) === -1) ? hostUrl + "/employee/" + url : hostUrl + url; + const updatedURL = DIGIT_UI_CONTEXTS?.every( + (e) => url?.indexOf(`/${e}`) === -1 + ) + ? hostUrl + "/employee/" + url + : hostUrl + url; window.location.href = updatedURL; } else { history.push(url); @@ -116,8 +131,8 @@ const Sidebar = ({ data }) => { if (key === "item" && item?.leftIcon !== "") { return { - iconKey: item.leftIcon.split(":")[0], - iconName: item.leftIcon.split(":")[1], + iconKey: item?.leftIcon?.split(":")?.[0], + iconName: item?.leftIcon?.split(":")?.[1], }; } @@ -131,7 +146,12 @@ const Sidebar = ({ data }) => { return null; // Return null if no non-empty leftIcon is found } - const renderSidebarItems = (items, parentKey = null, flag = true, level = 0) => { + const renderSidebarItems = ( + items, + parentKey = null, + flag = true, + level = 0 + ) => { /* added the logic to sort the side bar items based on the ordernumber */ const keysArray = Object.values(items) .sort((x, y) => { @@ -147,25 +167,41 @@ const Sidebar = ({ data }) => { return 0; } }) - .map((x) => (x?.item?.path && findKey(x?.item?.path)) || findKey(getKey(x)?.[0])); + .map( + (x) => + (x?.item?.path && findKey(x?.item?.path)) || findKey(getKey(x)?.[0]) + ); return (
{keysArray.map((key, index) => { const subItems = items[key]; - const subItemKeys = subItems ? Object.keys(subItems)[0] === "item" : null; + const subItemKeys = subItems + ? Object.keys(subItems)[0] === "item" + : null; const isSubItemOpen = openItems[key] || false; var itemKey = parentKey ? `${parentKey}` : key; const getModuleName = key?.replace(/[ -]/g, "_"); - const appendTranslate = t(Digit.Utils.locale.getTransformedLocale(`ACTION_TEST_${getModuleName}`)); - const trimModuleName = t(appendTranslate?.length > 20 ? appendTranslate.substring(0, 20) + "..." : appendTranslate); + const appendTranslate = t( + Digit.Utils.locale.getTransformedLocale( + `ACTION_TEST_${getModuleName}` + ) + ); + const trimModuleName = t( + appendTranslate?.length > 20 + ? appendTranslate.substring(0, 20) + "..." + : appendTranslate + ); if (!subItemKeys && subItems && Object.keys(subItems).length > 0) { // If the item has sub-items, render a dropdown with toggle button const { iconKey,iconName } = extractLeftIcon(subItems) || {}; - let leftIcon = IconsObject[iconName] || IconsObject.collections; + let leftIcon = + IconsObject[iconName] || IconsObject.collections; if (iconKey === "dynamic") { - var IconComp = require("@egovernments/digit-ui-react-components")?.[iconName]; + var IconComp = require("@egovernments/digit-ui-react-components")?.[ + iconName + ]; leftIcon = IconComp ? : leftIcon; } if (iconKey === "svg") { @@ -178,28 +214,37 @@ const Sidebar = ({ data }) => { return (
{ toggleSidebar(key); setSelectedParent((prevItem) => { if (prevItem === itemKey) { - return null - } - else return itemKey - + return null; + } else return itemKey; }); - const itemToHighlight = e.target.innerText + const itemToHighlight = e.target.innerText; setSelectedChildLevelOne((prevItem) => { if (prevItem === itemToHighlight || isSubItemOpen) { - return null - } - else return itemToHighlight + return null; + } else return itemToHighlight; }); setSelectedChild(null); // setOpenItems(prevState => { @@ -210,30 +255,63 @@ const Sidebar = ({ data }) => { // } // }) }} - style={{ display: "flex", flexDirection: "row", width: "100%" }} + style={{ + display: "flex", + flexDirection: "row", + width: "100%", + }} > {flag &&
{leftIcon}
}
{trimModuleName} {trimModuleName?.includes("...") && ( - - {t(Digit.Utils.locale.getTransformedLocale(`ACTION_TEST_${key}`))} + + {t( + Digit.Utils.locale.getTransformedLocale( + `ACTION_TEST_${key}` + ) + )} )}
-
- {isSubItemOpen ? : } +
+ {isSubItemOpen ? ( + + ) : ( + + )}
- {subNav &&
{isSubItemOpen && renderSidebarItems(subItems, itemKey, false, level + 1)}
} + {subNav && ( +
+ {isSubItemOpen && + renderSidebarItems(subItems, itemKey, false, level + 1)} +
+ )}
); } else if (subItemKeys) { // If the item is a link, render it - const { iconKey,iconName } = extractLeftIcon(subItems) || {}; - let leftIcon = IconsObject[iconName] || IconsObject.collections; + const { iconName, iconKey } = + extractLeftIcon(subItems) || {}; + let leftIcon = + IconsObject[iconName] || IconsObject.collections; if (iconKey === "dynamic") { - var IconComp = require("@egovernments/digit-ui-react-components")?.[iconName]; + var IconComp = require("@egovernments/digit-ui-react-components")?.[ + iconName + ]; leftIcon = IconComp ? : leftIcon; } if (iconKey === "svg") { @@ -244,27 +322,45 @@ const Sidebar = ({ data }) => { return ( { const keyToHighlight = subItems.item.path; setSelectedParent(parentKey); // Update the selected parent when a child is clicked setSelectedChild(keyToHighlight); - setSelectedChildLevelOne(null) + setSelectedChildLevelOne(null); // setOpenItems({}); // setSelectedChildLevelOne(null) - navigateToRespectiveURL(history, `${subItems?.item?.navigationURL}`); + navigateToRespectiveURL( + history, + `${subItems?.item?.navigationURL}` + ); }} >
{flag &&
{leftIcon}
} {trimModuleName} {trimModuleName?.includes("...") && ( - - {t(Digit.Utils.locale.getTransformedLocale(`ACTION_TEST_${key}`))} + + {t( + Digit.Utils.locale.getTransformedLocale( + `ACTION_TEST_${key}` + ) + )} )}
@@ -277,7 +373,11 @@ const Sidebar = ({ data }) => { }; return ( -
+
{renderSidebarItems(data)}
); diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js index 901cce4753d..4fe2e6d8b77 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js @@ -3,7 +3,6 @@ import { HomeIcon, EditPencilIcon, LogoutIcon, - Loader, AddressBookIcon, PropertyHouse, CaseIcon, @@ -18,7 +17,8 @@ import { BirthIcon, DeathIcon, FirenocIcon, -} from "@egovernments/digit-ui-react-components"; + Loader +} from "@egovernments/digit-ui-components"; import { Link, useLocation } from "react-router-dom"; import SideBarMenu from "../../../config/sidebar-menu"; import { useTranslation } from "react-i18next"; @@ -27,14 +27,16 @@ import LogoutDialog from "../../Dialog/LogoutDialog"; import ChangeCity from "../../ChangeCity"; import { defaultImage } from "../../utils"; - /* Feature :: Citizen Webview sidebar */ const Profile = ({ info, stateName, t }) => (
- +
{info?.name}
@@ -50,7 +52,9 @@ const Profile = ({ info, stateName, t }) => (
{window.location.href.includes("/employee") && !window.location.href.includes("/employee/user/login") && - !window.location.href.includes("employee/user/language-selection") && } + !window.location.href.includes("employee/user/language-selection") && ( + + )}
); const IconsObject = { @@ -110,14 +114,18 @@ const StaticCitizenSideBar = ({ linkData, islinkDataLoading }) => { history.push(`/${window?.contextPath}/citizen/user/profile`); }; - let menuItems = [...SideBarMenu(t, showProfilePage, redirectToLoginPage, isEmployee)]; + let menuItems = [ + ...SideBarMenu(t, showProfilePage, redirectToLoginPage, isEmployee), + ]; menuItems = menuItems.filter((item) => item.element !== "LANGUAGE"); const tenantId = Digit.ULBService.getCurrentTenantId(); const MenuItem = ({ item }) => { const leftIconArray = item?.icon || item.icon?.type?.name; - const leftIcon = leftIconArray ? IconsObject[leftIconArray] : IconsObject.BillsIcon; + const leftIcon = leftIconArray + ? IconsObject[leftIconArray] + : IconsObject.BillsIcon; let itemComponent; if (item.type === "component") { itemComponent = item.action; @@ -150,7 +158,9 @@ const StaticCitizenSideBar = ({ linkData, islinkDataLoading }) => { let profileItem; if (isFetched && user && user.access_token) { - profileItem = ; + profileItem = ( + + ); menuItems = menuItems.filter((item) => item?.id !== "login-btn"); menuItems = [ ...menuItems, @@ -176,16 +186,22 @@ const StaticCitizenSideBar = ({ linkData, islinkDataLoading }) => { {storeData?.tenants.map((i) => { i.code === tenantId ? (
) : ( ); })}
@@ -200,8 +216,12 @@ const StaticCitizenSideBar = ({ linkData, islinkDataLoading }) => { ?.map((key) => { if (linkData[key][0]?.sidebar === `${window.contextPath}-links`) { menuItems.splice(1, 0, { - type: linkData[key][0]?.sidebarURL?.includes(window?.contextPath) ? "link" : "external-link", - text: t(`ACTION_TEST_${Digit.Utils.locale.getTransformedLocale(key)}`), + type: linkData[key][0]?.sidebarURL?.includes(window?.contextPath) + ? "link" + : "external-link", + text: t( + `ACTION_TEST_${Digit.Utils.locale.getTransformedLocale(key)}` + ), links: linkData[key], icon: linkData[key][0]?.leftIcon, link: linkData[key][0]?.sidebarURL, @@ -232,13 +252,28 @@ const StaticCitizenSideBar = ({ linkData, islinkDataLoading }) => { {profileItem}
{menuItems?.map((item, index) => ( -
+
))}
-
{showDialog && }
+
+ {showDialog && ( + + )} +
); diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/SubMenu.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/SubMenu.js index 542e92484ae..c339766c9da 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/SubMenu.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/SubMenu.js @@ -16,7 +16,7 @@ import { CollectionsBookmarIcons, FinanceChartIcon, CollectionIcon, -} from "@egovernments/digit-ui-react-components"; +} from "@egovernments/digit-ui-components"; import { useTranslation } from "react-i18next"; import ReactTooltip from "react-tooltip"; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/index.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/index.js index c47afa498f7..bd0a8aa6071 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/index.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/index.js @@ -14,10 +14,17 @@ const SideBar = ({ t, CITIZEN, isSidebarOpen, toggleSidebar, handleLogout, mobil islinkDataLoading={islinkDataLoading} /> ); - else { - if (!mobileView && userDetails?.access_token) return ; - else return ; - } + else { + return (!isSidebarOpen && userDetails?.access_token) ? ( +
+ +
+ ) : ( +
+ +
+ ); + } }; export default SideBar; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js index 0dfca1ca834..f170b9c38db 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js @@ -1,4 +1,5 @@ -import { Dropdown, Hamburger, TopBar as TopBarComponent } from "@egovernments/digit-ui-react-components"; +import { Hamburger, TopBar as TopBarComponent } from "@egovernments/digit-ui-react-components"; +import { Dropdown } from "@egovernments/digit-ui-components"; import React from "react"; import { useHistory, useLocation } from "react-router-dom"; import ChangeCity from "../ChangeCity"; @@ -71,13 +72,12 @@ const TopBar = ({ function onNotificationIconClick() { history.push(`/${window?.contextPath}/citizen/engagement/notifications`); } - + const urlsToDisableNotificationIcon = (pathname) => !!Digit.UserService?.getUser()?.access_token ? false : [`/${window?.contextPath}/citizen/select-language`, `/${window?.contextPath}/citizen/select-location`].includes(pathname); - if (CITIZEN) { return (
@@ -121,12 +121,12 @@ const TopBar = ({ } return (
- {mobileView ? : null} +
{}
- + {loggedin && (cityDetails?.city?.ulbGrade ? ( -

+

{t(cityDetails?.i18nKey).toUpperCase()}{" "} {t(`ULBGRADE_${cityDetails?.city?.ulbGrade.toUpperCase().replace(" ", "_").replace(".", "_")}`).toUpperCase()}

@@ -134,42 +134,41 @@ const TopBar = ({ ))} {!loggedin && ( -

+

{t(`MYCITY_${stateInfo?.code?.toUpperCase()}_LABEL`)} {t(`MYCITY_STATECODE_LABEL`)}

)} - {!mobileView && ( -
-
- {!window.location.href.includes("employee/user/login") && !window.location.href.includes("employee/user/language-selection") && ( - - )} -
-
{showLanguageChange && }
- {userDetails?.access_token && ( -
- - ) : ( - - ) - } - /> -
+
+
+ {!window.location.href.includes("employee/user/login") && !window.location.href.includes("employee/user/language-selection") && ( + )} -
- )} +
{showLanguageChange && }
+ {userDetails?.access_token && ( +
+ + ) : ( + + ) + } + showIcon={true} + /> +
+ )} + +
); diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/index.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/index.js index 2fc53a86562..f6323f753f4 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/index.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/index.js @@ -1,5 +1,4 @@ import React, { useState } from "react"; -import { EditPencilIcon, LogoutIcon } from "@egovernments/digit-ui-react-components"; import TopBar from "./TopBar"; import { useHistory } from "react-router-dom"; import SideBar from "./SideBar"; @@ -32,19 +31,23 @@ const TopBarSideBar = ({ const handleOnCancel = () => { setShowDialog(false); } + + const handleSidebar = () => { + toggleSidebar(!isSidebarOpen); + } const userProfile = () => { history.push(`/${window?.contextPath}/employee/user/profile`); }; const userOptions = [ - { name: t("EDIT_PROFILE"), icon: , func: userProfile }, - { name: t("CORE_COMMON_LOGOUT"), icon: , func: handleLogout }, + { name: t("EDIT_PROFILE"), icon: "Edit", func: userProfile }, + { name: t("CORE_COMMON_LOGOUT"), icon: "Logout", func: handleLogout }, ]; return ( [ diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/FAQs/FAQs.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/FAQs/FAQs.js index 199cd50ca09..4b2e39dda52 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/FAQs/FAQs.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/FAQs/FAQs.js @@ -1,4 +1,4 @@ -import { BackButton, Header, Loader, SearchIconSvg } from "@egovernments/digit-ui-react-components"; +import { BackButton, Header, Loader ,SearchIconSvg} from "@egovernments/digit-ui-components"; import React, { Fragment } from "react"; import { useTranslation } from "react-i18next"; import FaqComponent from "./FaqComponent"; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/FAQs/FaqComponent.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/FAQs/FaqComponent.js index 0bfe078291c..6d669ffdf96 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/FAQs/FaqComponent.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/FAQs/FaqComponent.js @@ -1,4 +1,4 @@ -import { ArrowForward } from "@egovernments/digit-ui-react-components"; +import { ArrowForward } from "@egovernments/digit-ui-components"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/ImageUpload/UploadDrawer.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/ImageUpload/UploadDrawer.js index 088eeaa74e9..f3cd76a4d89 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/ImageUpload/UploadDrawer.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/ImageUpload/UploadDrawer.js @@ -1,5 +1,5 @@ import React, { useState, useEffect } from "react"; -import { GalleryIcon, RemoveIcon, UploadFile } from "@egovernments/digit-ui-react-components"; +import { GalleryIcon, RemoveIcon } from "@egovernments/digit-ui-components"; import { useTranslation } from "react-i18next"; function UploadDrawer({ setProfilePic, closeDrawer, userType, removeProfilePic ,showToast}) { diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/LanguageSelection.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/LanguageSelection.js index 1e840a4ca97..78a6561b038 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/LanguageSelection.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/LanguageSelection.js @@ -1,5 +1,5 @@ +import { PageBasedInput, Loader, RadioButtons, CardHeader } from "@egovernments/digit-ui-components"; import React, { useMemo } from "react"; -import { PageBasedInput, Loader, RadioButtons, CardHeader } from "@egovernments/digit-ui-react-components"; import { useTranslation } from "react-i18next"; import { useHistory } from "react-router-dom"; @@ -22,7 +22,7 @@ const LanguageSelection = () => { () => ({ options: languages, optionsKey: "label", - additionalWrapperClass: "reverse-radio-selection-wrapper", + additionalWrapperClass: "digit-reverse-radio-selection-wrapper", onSelect: (language) => Digit.LocalizationService.changeLanguage(language.value, stateInfo.code), selectedOption: languages?.filter((i) => i.value === selectedLanguage)[0], }), diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/LocationSelection.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/LocationSelection.js index 97b1764e7ba..a75b9391bed 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/LocationSelection.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/LocationSelection.js @@ -1,4 +1,4 @@ -import { BackButton, CardHeader, CardLabelError, PageBasedInput, SearchOnRadioButtons } from "@egovernments/digit-ui-react-components"; +import { BackButton, CardHeader, CardLabelError, PageBasedInput, SearchOnRadioButtons } from "@egovernments/digit-ui-components"; import React, { useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; import { useHistory, useLocation } from "react-router-dom"; @@ -29,7 +29,7 @@ const LocationSelection = () => { return { options: cities, optionsKey: "i18nKey", - additionalWrapperClass: "reverse-radio-selection-wrapper", + additionalWrapperClass: "digit-reverse-radio-selection-wrapper", onSelect: selectCity, selectedOption: selectedCity, }; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/UserProfile.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/UserProfile.js index eeaa20b1123..17dbc0f81a4 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/UserProfile.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/UserProfile.js @@ -1,17 +1,19 @@ import { - CameraIcon, - CardLabel, + SVG, Dropdown, LabelFieldPair, MobileNumber, TextInput, - Toast, CardLabelError, - BreadCrumb, BackButton, Loader, - SubmitBar -} from "@egovernments/digit-ui-react-components"; + Button, + SubmitBar, + CardLabel, + CameraIcon, + BreadCrumb, + Toast +} from "@egovernments/digit-ui-components"; import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { useHistory } from "react-router-dom"; @@ -51,8 +53,12 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { const [name, setName] = useState(userInfo?.name ? userInfo.name : ""); const [email, setEmail] = useState(userInfo?.emailId ? userInfo.emailId : ""); const [gender, setGender] = useState(userDetails?.gender); - const [city, setCity] = useState(userInfo?.permanentCity ? userInfo.permanentCity : cityDetails.name); - const [mobileNumber, setMobileNo] = useState(userInfo?.mobileNumber ? userInfo.mobileNumber : ""); + const [city, setCity] = useState( + userInfo?.permanentCity ? userInfo.permanentCity : cityDetails.name + ); + const [mobileNumber, setMobileNo] = useState( + userInfo?.mobileNumber ? userInfo.mobileNumber : "" + ); const [profilePic, setProfilePic] = useState(null); const [profileImg, setProfileImg] = useState(""); const [openUploadSlide, setOpenUploadSide] = useState(false); @@ -69,15 +75,24 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { const getUserInfo = async () => { const uuid = userInfo?.uuid; if (uuid) { - const usersResponse = await Digit.UserService.userSearch(tenant, { uuid: [uuid] }, {}); - usersResponse && usersResponse.user && usersResponse.user.length && setUserDetails(usersResponse.user[0]); + const usersResponse = await Digit.UserService.userSearch( + tenant, + { uuid: [uuid] }, + {} + ); + usersResponse && + usersResponse.user && + usersResponse.user.length && + setUserDetails(usersResponse.user[0]); } }; React.useEffect(() => { window.addEventListener("resize", () => setWindowWidth(window.innerWidth)); return () => { - window.removeEventListener("resize", () => setWindowWidth(window.innerWidth)); + window.removeEventListener("resize", () => + setWindowWidth(window.innerWidth) + ); }; }); @@ -108,21 +123,34 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { const setUserName = (value) => { setName(value); - if(!new RegExp(/^[a-zA-Z ]+$/i).test(value) || value.length === 0 || value.length > 50){ - setErrors({...errors, userName : {type: "pattern", message: "CORE_COMMON_PROFILE_NAME_INVALID"}}); - }else{ - setErrors({...errors, userName : null}) + if ( + !new RegExp(/^[a-zA-Z ]+$/i).test(value) || + value.length === 0 || + value.length > 50 + ) { + setErrors({ + ...errors, + userName: { + type: "pattern", + message: "CORE_COMMON_PROFILE_NAME_INVALID", + }, + }); + } else { + setErrors({ ...errors, userName: null }); } - } + }; const setUserEmailAddress = (value) => { if (userInfo?.userName !== value) { setEmail(value); - + if (value.length && !(value.includes("@") && value.includes("."))) { setErrors({ ...errors, - emailAddress: { type: "pattern", message: "CORE_COMMON_PROFILE_EMAIL_INVALID" }, + emailAddress: { + type: "pattern", + message: "CORE_COMMON_PROFILE_EMAIL_INVALID", + }, }); } else { setErrors({ ...errors, emailAddress: null }); @@ -135,42 +163,69 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { const setUserMobileNumber = (value) => { setMobileNo(value); - if (userType === "employee" && !new RegExp(/^[6-9]{1}[0-9]{9}$/).test(value)) { - setErrors({...errors, mobileNumber: {type: 'pattern', message: "CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"}}) - }else{ - setErrors({...errors, mobileNumber: null}); + if ( + userType === "employee" && + !new RegExp(/^[6-9]{1}[0-9]{9}$/).test(value) + ) { + setErrors({ + ...errors, + mobileNumber: { + type: "pattern", + message: "CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID", + }, + }); + } else { + setErrors({ ...errors, mobileNumber: null }); } - } + }; const setUserCurrentPassword = (value) => { setCurrentPassword(value); if (!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(value)) { - setErrors({...errors, currentPassword: {type: "pattern", message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"}}) - }else{ - setErrors({...errors, currentPassword: null}); + setErrors({ + ...errors, + currentPassword: { + type: "pattern", + message: "CORE_COMMON_PROFILE_PASSWORD_INVALID", + }, + }); + } else { + setErrors({ ...errors, currentPassword: null }); } - } + }; const setUserNewPassword = (value) => { setNewPassword(value); if (!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(value)) { - setErrors({...errors, newPassword: {type: "pattern", message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"}}) - }else{ - setErrors({...errors, newPassword: null}); + setErrors({ + ...errors, + newPassword: { + type: "pattern", + message: "CORE_COMMON_PROFILE_PASSWORD_INVALID", + }, + }); + } else { + setErrors({ ...errors, newPassword: null }); } - } + }; const setUserConfirmPassword = (value) => { setConfirmPassword(value); if (!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(value)) { - setErrors({...errors, confirmPassword: {type: "pattern", message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"}}) - }else{ - setErrors({...errors, confirmPassword: null}); + setErrors({ + ...errors, + confirmPassword: { + type: "pattern", + message: "CORE_COMMON_PROFILE_PASSWORD_INVALID", + }, + }); + } else { + setErrors({ ...errors, confirmPassword: null }); } - } + }; const removeProfilePic = () => { setProfilePic(null); @@ -195,33 +250,74 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { photo: profilePic, }; - if (!new RegExp(/^([a-zA-Z ])*$/).test(name) || name === "" || name.length > 50 || name.length < 1) { - throw JSON.stringify({ type: "error", message: t("CORE_COMMON_PROFILE_NAME_INVALID") }); + if ( + !new RegExp(/^([a-zA-Z ])*$/).test(name) || + name === "" || + name.length > 50 || + name.length < 1 + ) { + throw JSON.stringify({ + type: "error", + message: t("CORE_COMMON_PROFILE_NAME_INVALID"), + }); } - if (userType === "employee" && !new RegExp(/^[6-9]{1}[0-9]{9}$/).test(mobileNumber)) { - throw JSON.stringify({ type: "error", message: t("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID") }); + if ( + userType === "employee" && + !new RegExp(/^[6-9]{1}[0-9]{9}$/).test(mobileNumber) + ) { + throw JSON.stringify({ + type: "error", + message: t("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"), + }); } if (email.length && !(email.includes("@") && email.includes("."))) { - throw JSON.stringify({ type: "error", message: t("CORE_COMMON_PROFILE_EMAIL_INVALID") }); + throw JSON.stringify({ + type: "error", + message: t("CORE_COMMON_PROFILE_EMAIL_INVALID"), + }); } - if (changepassword && (currentPassword.length || newPassword.length || confirmPassword.length)) { + if ( + changepassword && + (currentPassword.length || newPassword.length || confirmPassword.length) + ) { if (newPassword !== confirmPassword) { - throw JSON.stringify({ type: "error", message: t("CORE_COMMON_PROFILE_PASSWORD_MISMATCH") }); + throw JSON.stringify({ + type: "error", + message: t("CORE_COMMON_PROFILE_PASSWORD_MISMATCH"), + }); } - if (!(currentPassword.length && newPassword.length && confirmPassword.length)) { - throw JSON.stringify({ type: "error", message: t("CORE_COMMON_PROFILE_PASSWORD_INVALID") }); + if ( + !( + currentPassword.length && + newPassword.length && + confirmPassword.length + ) + ) { + throw JSON.stringify({ + type: "error", + message: t("CORE_COMMON_PROFILE_PASSWORD_INVALID"), + }); } - if (!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(newPassword) && !new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(confirmPassword)) { - throw JSON.stringify({ type: "error", message: t("CORE_COMMON_PROFILE_PASSWORD_INVALID") }); + if ( + !new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(newPassword) && + !new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(confirmPassword) + ) { + throw JSON.stringify({ + type: "error", + message: t("CORE_COMMON_PROFILE_PASSWORD_INVALID"), + }); } } - const { responseInfo, user } = await Digit.UserService.updateUser(requestData, stateCode); + const { responseInfo, user } = await Digit.UserService.updateUser( + requestData, + stateCode + ); if (responseInfo && responseInfo.status === "200") { const user = Digit.UserService.getUser(); @@ -240,7 +336,11 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { } } - if (currentPassword.length && newPassword.length && confirmPassword.length) { + if ( + currentPassword.length && + newPassword.length && + confirmPassword.length + ) { const requestData = { existingPassword: currentPassword, newPassword: newPassword, @@ -252,11 +352,21 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { if (newPassword === confirmPassword) { try { - const res = await Digit.UserService.changePassword(requestData, tenant); + const res = await Digit.UserService.changePassword( + requestData, + tenant + ); const { responseInfo: changePasswordResponseInfo } = res; - if (changePasswordResponseInfo?.status && changePasswordResponseInfo.status === "200") { - showToast("success", t("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"), 5000); + if ( + changePasswordResponseInfo?.status && + changePasswordResponseInfo.status === "200" + ) { + showToast( + "success", + t("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"), + 5000 + ); setTimeout(() => Digit.UserService.logout(), 2000); } else { throw ""; @@ -264,11 +374,16 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { } catch (error) { throw JSON.stringify({ type: "error", - message: error.Errors?.at(0)?.description ? error.Errors.at(0).description : "CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD", + message: error.Errors?.at(0)?.description + ? error.Errors.at(0).description + : "CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD", }); } } else { - throw JSON.stringify({ type: "error", message: "CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH" }); + throw JSON.stringify({ + type: "error", + message: "CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH", + }); } } else if (responseInfo?.status && responseInfo.status === "200") { showToast("success", t("CORE_COMMON_PROFILE_UPDATE_SUCCESS"), 5000); @@ -282,16 +397,26 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { }; let menu = []; - const { data: Menu } = Digit.Hooks.useGenderMDMS(stateId, "common-masters", "GenderType"); + const { data: Menu } = Digit.Hooks.useGenderMDMS( + stateId, + "common-masters", + "GenderType" + ); Menu && Menu.map((genderDetails) => { - menu.push({ i18nKey: `PT_COMMON_GENDER_${genderDetails.code}`, code: `${genderDetails.code}`, value: `${genderDetails.code}` }); + menu.push({ + i18nKey: `PT_COMMON_GENDER_${genderDetails.code}`, + code: `${genderDetails.code}`, + value: `${genderDetails.code}`, + }); }); const setFileStoreId = async (fileStoreId) => { setProfilePic(fileStoreId); - const thumbnails = fileStoreId ? await getThumbnails([fileStoreId], stateId) : null; + const thumbnails = fileStoreId + ? await getThumbnails([fileStoreId], stateId) + : null; setProfileImg(thumbnails?.thumbs[0]); @@ -314,7 +439,9 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { return (
-
+
{userType === "citizen" || isMobile ? ( ) : ( @@ -338,10 +465,12 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { style={{ display: "flex", flex: 1, - flexDirection: windowWidth < 768 || userType === "citizen" ? "column" : "row", + flexDirection: + windowWidth < 768 || userType === "citizen" ? "column" : "row", margin: userType === "citizen" ? "8px" : "16px", gap: userType === "citizen" ? "" : "0 24px", - boxShadow: userType === "citizen" ? "1px 1px 4px 0px rgba(0,0,0,0.2)" : "", + boxShadow: + userType === "citizen" ? "1px 1px 4px 0px rgba(0,0,0,0.2)" : "", background: userType === "citizen" ? "white" : "", borderRadius: userType === "citizen" ? "4px" : "", maxWidth: userType === "citizen" ? "960px" : "", @@ -357,7 +486,8 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { maxWidth: "100%", height: "376px", borderRadius: "4px", - boxShadow: userType === "citizen" ? "" : "1px 1px 4px 0px rgba(0,0,0,0.2)", + boxShadow: + userType === "citizen" ? "" : "1px 1px 4px 0px rgba(0,0,0,0.2)", border: `${userType === "citizen" ? "8px" : "24px"} solid #fff`, background: "#EEEEEE", padding: userType === "citizen" ? "8px" : "16px", @@ -381,7 +511,15 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { }} src={!profileImg || profileImg === "" ? defaultImage : profileImg} /> -
@@ -394,17 +532,20 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { width: "100%", borderRadius: "4px", height: "fit-content", - boxShadow: userType === "citizen" ? "" : "1px 1px 4px 0px rgba(0,0,0,0.2)", + boxShadow: + userType === "citizen" ? "" : "1px 1px 4px 0px rgba(0,0,0,0.2)", background: "white", padding: userType === "citizen" ? "8px" : "24px", - paddingBottom : "20px", + paddingBottom: "20px", }} > {userType === "citizen" ? ( - {`${t("CORE_COMMON_PROFILE_NAME")}`}* -
+ + {`${t("CORE_COMMON_PROFILE_NAME")}`}* + +
{ isMandatory={false} name="name" value={name} - onChange={(e)=>setUserName(e.target.value)} + onChange={(e) => setUserName(e.target.value)} {...(validation = { isRequired: true, pattern: "^[a-zA-Z-.`' ]*$", @@ -421,12 +562,19 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { })} disable={editScreen} /> - {errors?.userName && {t(errors?.userName?.message)} } + {errors?.userName && ( + + {" "} + {t(errors?.userName?.message)}{" "} + + )}
- {`${t("CORE_COMMON_PROFILE_GENDER")}`} + {`${t( + "CORE_COMMON_PROFILE_GENDER" + )}`} { - {`${t("CORE_COMMON_PROFILE_EMAIL")}`} + {`${t( + "CORE_COMMON_PROFILE_EMAIL" + )}`}
{ optionKey="i18nKey" name="email" value={email} - onChange={(e)=>setUserEmailAddress(e.target.value)} - disable={editScreen} + onChange={(e) => setUserEmailAddress(e.target.value)} + disabled={editScreen} /> - {errors?.emailAddress && {t(errors?.emailAddress?.message)} } + {errors?.emailAddress && ( + + {" "} + {t(errors?.emailAddress?.message)}{" "} + + )}
- + - ) : null - } + ) : null} )}
- { userType === "employee" && !isMobile ? ( + {userType === "employee" && !isMobile ? (
- - + {/* */} -
- ) : null } + ) : null} {toast && ( setToast(null)} style={{ maxWidth: "670px" }} /> diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/index.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/index.js index 84e33e7ad58..5bb709751d5 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/index.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/index.js @@ -1,6 +1,15 @@ import { - Calender, CardBasedOptions, CaseIcon, ComplaintIcon, DocumentIcon, HomeIcon, Loader, OBPSIcon, PTIcon, WhatsNewCard -} from "@egovernments/digit-ui-react-components"; + Calender, + CardBasedOptions, + CaseIcon, + ComplaintIcon, + DocumentIcon, + HomeIcon, + OBPSIcon, + PTIcon, + Loader, + WhatsNewCard, +} from "@egovernments/digit-ui-components"; import React from "react"; import { useTranslation } from "react-i18next"; import { useHistory } from "react-router-dom"; @@ -9,7 +18,10 @@ const Home = () => { const { t } = useTranslation(); const history = useHistory(); const tenantId = Digit.ULBService.getCitizenCurrentTenant(true); - const { data: { stateInfo, uiHomePage } = {}, isLoading } = Digit.Hooks.useStore.getInitData(); + const { + data: { stateInfo, uiHomePage } = {}, + isLoading, + } = Digit.Hooks.useStore.getInitData(); let isMobile = window.Digit.Utils.browser.isMobile(); const conditionsToDisableNotificationCountTrigger = () => { @@ -18,7 +30,10 @@ const Home = () => { return true; }; - const { data: EventsData, isLoading: EventsDataLoading } = Digit.Hooks.useEvents({ + const { + data: EventsData, + isLoading: EventsDataLoading, + } = Digit.Hooks.useEvents({ tenantId, variant: "whats-new", config: { @@ -55,23 +70,27 @@ const Home = () => { header: t(citizenServicesObj?.headerLabel), sideOption: { name: t(citizenServicesObj?.sideOption?.name), - onClick: () => history.push(citizenServicesObj?.sideOption?.navigationUrl), + onClick: () => + history.push(citizenServicesObj?.sideOption?.navigationUrl), }, options: [ { name: t(citizenServicesObj?.props?.[0]?.label), Icon: , - onClick: () => history.push(citizenServicesObj?.props?.[0]?.navigationUrl), + onClick: () => + history.push(citizenServicesObj?.props?.[0]?.navigationUrl), }, { name: t(citizenServicesObj?.props?.[1]?.label), Icon: , - onClick: () => history.push(citizenServicesObj?.props?.[1]?.navigationUrl), + onClick: () => + history.push(citizenServicesObj?.props?.[1]?.navigationUrl), }, { name: t(citizenServicesObj?.props?.[2]?.label), Icon: , - onClick: () => history.push(citizenServicesObj?.props?.[2]?.navigationUrl), + onClick: () => + history.push(citizenServicesObj?.props?.[2]?.navigationUrl), }, // { // name: t("ACTION_TEST_WATER_AND_SEWERAGE"), @@ -81,10 +100,16 @@ const Home = () => { { name: t(citizenServicesObj?.props?.[3]?.label), Icon: , - onClick: () => history.push(citizenServicesObj?.props?.[3]?.navigationUrl), + onClick: () => + history.push(citizenServicesObj?.props?.[3]?.navigationUrl), }, ], - styles: { display: "flex", flexWrap: "wrap", justifyContent: "flex-start", width: "100%" }, + styles: { + display: "flex", + flexWrap: "wrap", + justifyContent: "flex-start", + width: "100%", + }, }; const allInfoAndUpdatesProps = { header: t(infoAndUpdatesObj?.headerLabel), @@ -96,29 +121,38 @@ const Home = () => { { name: t(infoAndUpdatesObj?.props?.[0]?.label), Icon: , - onClick: () => history.push(infoAndUpdatesObj?.props?.[0]?.navigationUrl), + onClick: () => + history.push(infoAndUpdatesObj?.props?.[0]?.navigationUrl), }, { name: t(infoAndUpdatesObj?.props?.[1]?.label), Icon: , - onClick: () => history.push(infoAndUpdatesObj?.props?.[1]?.navigationUrl), + onClick: () => + history.push(infoAndUpdatesObj?.props?.[1]?.navigationUrl), }, { name: t(infoAndUpdatesObj?.props?.[2]?.label), Icon: , - onClick: () => history.push(infoAndUpdatesObj?.props?.[2]?.navigationUrl), + onClick: () => + history.push(infoAndUpdatesObj?.props?.[2]?.navigationUrl), }, { name: t(infoAndUpdatesObj?.props?.[3]?.label), Icon: , - onClick: () => history.push(infoAndUpdatesObj?.props?.[3]?.navigationUrl), + onClick: () => + history.push(infoAndUpdatesObj?.props?.[3]?.navigationUrl), }, // { // name: t("CS_COMMON_HELP"), // Icon: // } ], - styles: { display: "flex", flexWrap: "wrap", justifyContent: "flex-start", width: "100%" }, + styles: { + display: "flex", + flexWrap: "wrap", + justifyContent: "flex-start", + width: "100%", + }, }; return isLoading ? ( @@ -131,13 +165,23 @@ const Home = () => {
{
- {isMobile ? : } + {isMobile ? ( + + ) : ( + + )} {/*
*/}
- - + +
} @@ -145,9 +189,19 @@ const Home = () => { {(whatsAppBannerMobObj || whatsAppBannerWebObj) && (
{isMobile ? ( - handleClickOnWhatsAppBanner(whatsAppBannerMobObj)} /> + + handleClickOnWhatsAppBanner(whatsAppBannerMobObj) + } + /> ) : ( - handleClickOnWhatsAppBanner(whatsAppBannerWebObj)} /> + + handleClickOnWhatsAppBanner(whatsAppBannerWebObj) + } + /> )}
)} @@ -159,7 +213,13 @@ const Home = () => {

{t(whatsNewSectionObj?.headerLabel)}

-

history.push(whatsNewSectionObj?.sideOption?.navigationUrl)}>{t(whatsNewSectionObj?.sideOption?.name)}

+

+ history.push(whatsNewSectionObj?.sideOption?.navigationUrl) + } + > + {t(whatsNewSectionObj?.sideOption?.name)} +

diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/HowItWorks/howItWorks.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/HowItWorks/howItWorks.js index 761a4d773ac..80c94756d92 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/HowItWorks/howItWorks.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/HowItWorks/howItWorks.js @@ -1,12 +1,19 @@ import { - BackButton, CloseSvg, CustomButton, DownloadImgIcon, Header, Loader, PDFSvg -} from "@egovernments/digit-ui-react-components"; + BackButton, + Header, + Loader, + CloseSvg, + DownloadImgIcon, + PDFSvg, +} from "@egovernments/digit-ui-components"; +import { CustomButton } from "@egovernments/digit-ui-react-components"; import React, { Fragment, useState } from "react"; import { useTranslation } from "react-i18next"; const HowItWorks = ({ module }) => { const user = Digit.UserService.getUser(); - const tenantId = user?.info?.tenantId || Digit.ULBService.getCurrentTenantId(); + const tenantId = + user?.info?.tenantId || Digit.ULBService.getCurrentTenantId(); const { t } = useTranslation(); const storeData = Digit.SessionStorage.get("initData"); const stateInfo = storeData.stateInfo; @@ -20,7 +27,13 @@ const HowItWorks = ({ module }) => { const [vidSrc, setVidSrc] = useState(""); const ViDSvg = () => ( - + { setVideoPlay(false); }; - const { isLoading, data } = Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()); + const { isLoading, data } = Digit.Hooks.useGetHowItWorksJSON( + Digit.ULBService.getStateId() + ); - const mdmsConfigResult = data?.MdmsRes["common-masters"]?.howItWorks[0]?.[`${module}`]; + const mdmsConfigResult = + data?.MdmsRes["common-masters"]?.howItWorks[0]?.[`${module}`]; const languages = [ { label: "ENGLISH", @@ -61,7 +77,13 @@ const HowItWorks = ({ module }) => {
-
{t(mdmsConfigResult.screenHeader ? mdmsConfigResult.screenHeader : "HOW_IT_WORKS")}
+
+ {t( + mdmsConfigResult.screenHeader + ? mdmsConfigResult.screenHeader + : "HOW_IT_WORKS" + )} +
{languages.map((language, index) => ( @@ -76,7 +98,15 @@ const HowItWorks = ({ module }) => {
{mdmsConfigResult.videosJson.map((videos, index) => (
-
+
onClickVideo(videos)}>
@@ -89,22 +119,32 @@ const HowItWorks = ({ module }) => {
))} - {mdmsConfigResult.pdfHeader && mdmsConfigResult.pdfDesc &&
-
-
-
- + {mdmsConfigResult.pdfHeader && mdmsConfigResult.pdfDesc && ( +
+
+
+
+ +
+
+

{t(mdmsConfigResult.pdfHeader)}

+

{t(mdmsConfigResult.pdfDesc)}

+
-
-

{t(mdmsConfigResult.pdfHeader)}

-

{t(mdmsConfigResult.pdfDesc)}

+
+
-
- -
-
} + )} {videoPlay && (
diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/SelectMobileNumber.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/SelectMobileNumber.js index 353f8336eee..baff9d85db4 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/SelectMobileNumber.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/SelectMobileNumber.js @@ -1,4 +1,4 @@ -import { FormStep } from "@egovernments/digit-ui-react-components"; +import { FormStep } from "@egovernments/digit-ui-components"; import React from "react"; const SelectMobileNumber = ({ t, onSelect, showRegisterLink, mobileNumber, onMobileChange, config, canSubmit }) => { diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/SelectName.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/SelectName.js index 489998a48a8..e8d7f9db018 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/SelectName.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/SelectName.js @@ -1,4 +1,4 @@ -import { FormStep } from "@egovernments/digit-ui-react-components"; +import { FormStep } from "@egovernments/digit-ui-components"; import React from "react"; const SelectName = ({ config, onSelect, t, isDisabled }) => { diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/SelectOtp.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/SelectOtp.js index 0162167a0c2..64461b2d209 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/SelectOtp.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/SelectOtp.js @@ -1,4 +1,4 @@ -import { CardLabelError, CardText, FormStep, OTPInput } from "@egovernments/digit-ui-react-components"; +import { CardText, CardLabelError, FormStep, OTPInput } from "@egovernments/digit-ui-components"; import React, { Fragment, useState } from "react"; import useInterval from "../../../hooks/useInterval"; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/index.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/index.js index fc41c87b26c..92545334409 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/index.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/index.js @@ -1,4 +1,4 @@ -import { AppContainer, BackButton, Toast } from "@egovernments/digit-ui-react-components"; +import { AppContainer, BackButton ,Toast} from "@egovernments/digit-ui-components"; import React, { useEffect, useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; import { Route, Switch, useHistory, useLocation, useRouteMatch } from "react-router-dom"; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/StaticDynamicComponent/StaticDynamicCard.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/StaticDynamicComponent/StaticDynamicCard.js index 143a62d71f0..716e0382a6b 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/StaticDynamicComponent/StaticDynamicCard.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/StaticDynamicComponent/StaticDynamicCard.js @@ -1,16 +1,33 @@ import { Card, - CaseIcon, ComplaintIcon, HelpLineIcon, Loader, MCollectIcon, PTIcon, RupeeSymbol, ServiceCenterIcon, TimerIcon, ValidityTimeIcon, - WhatsappIconGreen -} from "@egovernments/digit-ui-react-components"; + Loader, + CaseIcon, + ComplaintIcon, + HelpLineIcon, + MCollectIcon, + PTIcon, + RupeeSymbol, + ServiceCenterIcon, + TimerIcon, + ValidityTimeIcon, + WhatsappIconGreen, +} from "@egovernments/digit-ui-components"; import React from "react"; import { useTranslation } from "react-i18next"; const StaticDynamicCard = ({ moduleCode }) => { const { t } = useTranslation(); const tenantId = Digit.ULBService.getCitizenCurrentTenant(); - const { isLoading: isMdmsLoading, data: mdmsData } = Digit.Hooks.useStaticData(Digit.ULBService.getStateId()); - const { isLoading: isSearchLoading, error, data: dynamicData, isSuccess } = Digit.Hooks.useDynamicData({ + const { + isLoading: isMdmsLoading, + data: mdmsData, + } = Digit.Hooks.useStaticData(Digit.ULBService.getStateId()); + const { + isLoading: isSearchLoading, + error, + data: dynamicData, + isSuccess, + } = Digit.Hooks.useDynamicData({ moduleCode, tenantId: tenantId, filters: {}, @@ -27,14 +44,19 @@ const StaticDynamicCard = ({ moduleCode }) => { case "PT": return ; case "MCOLLECT": - return ; + return ( + + ); case "PGR": - return ; + return ( + + ); default: return ; } }; - const mdmsConfigResult = mdmsData?.MdmsRes["common-masters"]?.StaticData[0]?.[`${moduleCode}`]; + const mdmsConfigResult = + mdmsData?.MdmsRes["common-masters"]?.StaticData[0]?.[`${moduleCode}`]; const StaticDataIconComponentOne = ({ module }) => { switch (module) { @@ -74,7 +96,11 @@ const StaticDynamicCard = ({ moduleCode }) => { case "MCOLLECT": return { staticCommonContent: t("COMMON_VALIDITY"), - validity: mdmsConfigResult?.validity + (mdmsConfigResult?.validity === "1" ? t("COMMON_DAY") : t("COMMON_DAYS")), + validity: + mdmsConfigResult?.validity + + (mdmsConfigResult?.validity === "1" + ? t("COMMON_DAY") + : t("COMMON_DAYS")), }; case "PGR": return { @@ -83,7 +109,12 @@ const StaticDynamicCard = ({ moduleCode }) => { case "OBPS": return { staticCommonContent: t("BUILDING_PLAN_PERMIT_VALIDITY"), - validity: mdmsConfigResult?.validity + " " + (mdmsConfigResult?.validity === "1" ? t("COMMON_DAY") : t("COMMON_DAYS")), + validity: + mdmsConfigResult?.validity + + " " + + (mdmsConfigResult?.validity === "1" + ? t("COMMON_DAY") + : t("COMMON_DAYS")), }; default: return { @@ -96,7 +127,8 @@ const StaticDynamicCard = ({ moduleCode }) => { switch (module) { case "PT": return { - staticDataOne: mdmsConfigResult?.staticDataOne + " " + t("COMMON_DAYS"), + staticDataOne: + mdmsConfigResult?.staticDataOne + " " + t("COMMON_DAYS"), staticDataOneHeader: t("APPLICATION_PROCESSING_TIME"), staticDataTwo: mdmsConfigResult?.staticDataTwo, staticDataTwoHeader: t("APPLICATION_PROCESSING_FEE"), @@ -105,8 +137,15 @@ const StaticDynamicCard = ({ moduleCode }) => { return { staticDataOne: "", staticDataOneHeader: - t("PAY_WATER_CHARGES_BY") + " " + mdmsConfigResult?.staticDataOne + " " + t("COMMON_DAYS") + " " + t("OF_BILL_GEN_TO_AVOID_LATE_FEE"), - staticDataTwo: mdmsConfigResult?.staticDataTwo + " " + t("COMMON_DAYS"), + t("PAY_WATER_CHARGES_BY") + + " " + + mdmsConfigResult?.staticDataOne + + " " + + t("COMMON_DAYS") + + " " + + t("OF_BILL_GEN_TO_AVOID_LATE_FEE"), + staticDataTwo: + mdmsConfigResult?.staticDataTwo + " " + t("COMMON_DAYS"), staticDataTwoHeader: t("APPLICATION_PROCESSING_TIME"), }; default: @@ -121,7 +160,12 @@ const StaticDynamicCard = ({ moduleCode }) => { {mdmsConfigResult && mdmsConfigResult?.payViaWhatsApp ? ( -
handleClickOnWhatsApp(mdmsConfigResult?.payViaWhatsApp)}> +
+ handleClickOnWhatsApp(mdmsConfigResult?.payViaWhatsApp) + } + >
{t("PAY_VIA_WHATSAPP")}
@@ -132,7 +176,9 @@ const StaticDynamicCard = ({ moduleCode }) => { {mdmsConfigResult && mdmsConfigResult?.helpline ? (
-
{t("CALL_CENTER_HELPLINE")}
+
+ {t("CALL_CENTER_HELPLINE")} +
@@ -140,12 +186,16 @@ const StaticDynamicCard = ({ moduleCode }) => {
{mdmsConfigResult?.helpline?.contactOne ? ( ) : null} {mdmsConfigResult?.helpline?.contactTwo ? ( ) : null}
@@ -154,13 +204,17 @@ const StaticDynamicCard = ({ moduleCode }) => { {mdmsConfigResult && mdmsConfigResult?.serviceCenter ? (
-
{t("CITIZEN_SERVICE_CENTER")}
+
+ {t("CITIZEN_SERVICE_CENTER")} +
-
{mdmsConfigResult?.serviceCenter}
+
+ {mdmsConfigResult?.serviceCenter} +
{mdmsConfigResult?.viewMapLocation ? (
@@ -172,23 +226,37 @@ const StaticDynamicCard = ({ moduleCode }) => {
)} - {error || dynamicData == null || dynamicData?.dynamicDataOne === null ? ( + {error || + dynamicData == null || + dynamicData?.dynamicDataOne === null ? (
) : (
- - {dynamicData?.dynamicDataOne} + + + {dynamicData?.dynamicDataOne} +
)} - {error || dynamicData == null || dynamicData?.dynamicDataTwo === null ? ( + {error || + dynamicData == null || + dynamicData?.dynamicDataTwo === null ? (
) : (
- - {dynamicData?.dynamicDataTwo} + + + {dynamicData?.dynamicDataTwo} +
)} @@ -200,12 +268,17 @@ const StaticDynamicCard = ({ moduleCode }) => { {staticData(moduleCode)?.staticDataOneHeader} - {`${staticData(moduleCode)?.staticDataOne}`} + {`${ + staticData(moduleCode)?.staticDataOne + }`}
@@ -217,8 +290,12 @@ const StaticDynamicCard = ({ moduleCode }) => {
- {staticData(moduleCode)?.staticDataTwoHeader} - {staticData(moduleCode)?.staticDataTwo} + + {staticData(moduleCode)?.staticDataTwoHeader} + + + {staticData(moduleCode)?.staticDataTwo} +
@@ -232,29 +309,48 @@ const StaticDynamicCard = ({ moduleCode }) => { - {staticContent(moduleCode)?.staticCommonContent} - {staticContent(moduleCode)?.validity} + + {staticContent(moduleCode)?.staticCommonContent} + + + {staticContent(moduleCode)?.validity} +
) : (
)} - {error || dynamicData == null || !dynamicData?.staticData || dynamicData?.staticData === null ? ( + {error || + dynamicData == null || + !dynamicData?.staticData || + dynamicData?.staticData === null ? (
) : (
{moduleCode === "PGR" ? ( - + ) : ( )} - {staticContent(moduleCode)?.staticCommonContent} - {dynamicData?.staticData} + + {staticContent(moduleCode)?.staticCommonContent} + + + {dynamicData?.staticData} +
diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/index.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/index.js index ac66a2ceb32..74e041144a7 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/index.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/index.js @@ -1,4 +1,4 @@ -import { BackButton, CitizenHomeCard, CitizenInfoLabel } from "@egovernments/digit-ui-react-components"; +import { BackButton, CitizenHomeCard, CitizenInfoLabel } from "@egovernments/digit-ui-components"; import React from "react"; import { useTranslation } from "react-i18next"; import { Route, Switch, useHistory, useRouteMatch } from "react-router-dom"; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js index c67853708cb..1205198ae55 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js @@ -1,4 +1,5 @@ -import { BackButton, CardSubHeader, CardText, FormComposer, Toast } from "@egovernments/digit-ui-react-components"; +import { CardSubHeader, FormComposer} from "@egovernments/digit-ui-react-components"; +import { BackButton, CardText,Toast} from "@egovernments/digit-ui-components"; import PropTypes from "prop-types"; import React, { useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; @@ -6,7 +7,6 @@ import Background from "../../../components/Background"; import Header from "../../../components/Header"; import SelectOtp from "../../citizen/Login/SelectOtp"; - const ChangePasswordComponent = ({ config: propsConfig, t }) => { const [user, setUser] = useState(null); const { mobile_number: mobileNumber, tenantId } = Digit.Hooks.useQueryParams(); diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js index bba787e5bb7..188a0340e5c 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js @@ -1,4 +1,5 @@ -import { BackButton, Dropdown, FormComposer, Loader, Toast } from "@egovernments/digit-ui-react-components"; +import { FormComposer } from "@egovernments/digit-ui-react-components"; +import { BackButton, Dropdown, Loader,Toast } from "@egovernments/digit-ui-components"; import PropTypes from "prop-types"; import React, { useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/LanguageSelection/index.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/LanguageSelection/index.js index eca20e76f5d..c3d703ac079 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/LanguageSelection/index.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/LanguageSelection/index.js @@ -1,14 +1,18 @@ -import { Card, CustomButton, SubmitBar } from "@egovernments/digit-ui-react-components"; +import { Button, Card ,SubmitBar, Loader} from "@egovernments/digit-ui-components"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { useHistory } from "react-router-dom"; import Background from "../../../components/Background"; - +const defaultLanguage= {label:"English",value:Digit.Hooks.Utils.getDefaultLanguage()}; const LanguageSelection = () => { const { data: storeData, isLoading } = Digit.Hooks.useStore.getInitData(); const { t } = useTranslation(); const history = useHistory(); const { languages, stateInfo } = storeData || {}; + let defaultLanguages=languages; + if(!defaultLanguages || defaultLanguages?.length==0){ + defaultLanguages=[defaultLanguage]; + } const selectedLanguage = Digit.StoreData.getCurrentLanguage(); const [selected, setselected] = useState(selectedLanguage); const handleChangeLanguage = (language) => { @@ -20,28 +24,27 @@ const LanguageSelection = () => { history.push(`/${window?.contextPath}/employee/user/login`); }; - if (isLoading) return null; - + if (isLoading) return ; return (
Digit - -

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

+

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

- {languages.map((language, index) => ( -
- handleChangeLanguage(language)} - > -
- ))} + {defaultLanguages.map((language, index) => ( +
+ handleChangeLanguage(language)} + > +
+ ) + )}
- +
- + DIGIT diff --git a/micro-ui/web/workbench/package.json b/micro-ui/web/workbench/package.json index 22e75482960..142d4395420 100644 --- a/micro-ui/web/workbench/package.json +++ b/micro-ui/web/workbench/package.json @@ -14,9 +14,9 @@ ], "homepage": "/workbench-ui", "dependencies": { - "@egovernments/digit-ui-libraries": "1.8.1-beta.1", + "@egovernments/digit-ui-libraries": "1.8.1-beta.4", "@egovernments/digit-ui-module-workbench": "1.0.1-beta.9", - "@egovernments/digit-ui-module-core": "1.8.1-beta.6", + "@egovernments/digit-ui-module-core": "1.8.1-beta.8", "@egovernments/digit-ui-module-utilities": "1.0.1-beta.1", "@egovernments/digit-ui-react-components": "1.8.1-beta.9", "@egovernments/digit-ui-components": "0.0.1-beta.3",