diff --git a/react/components-core/package.json b/react/components-core/package.json index 0eefa691493..7352e91a960 100644 --- a/react/components-core/package.json +++ b/react/components-core/package.json @@ -51,7 +51,7 @@ ], "dependencies": { "@egovernments/digit-ui-css": "1.2.176", - "@egovernments/digit-ui-libraries": "1.7.10", + "@egovernments/digit-ui-libraries": "1.8.1-beta.1", "@egovernments/digit-ui-svg-components": "0.0.8", "@googlemaps/js-api-loader": "1.13.10", diff --git a/react/components-core/src/atoms/BodyContainer.js b/react/components-core/src/atoms/BodyContainer.js index 539633c40f8..2a82ca50d63 100644 --- a/react/components-core/src/atoms/BodyContainer.js +++ b/react/components-core/src/atoms/BodyContainer.js @@ -3,7 +3,7 @@ import PropTypes from "prop-types"; const BodyContainer = (props) => { return ( -
+
{props.children}
); diff --git a/react/components-core/src/hoc/Modal.js b/react/components-core/src/hoc/Modal.js index 9c72ac3b6d7..f77912fa2e9 100644 --- a/react/components-core/src/hoc/Modal.js +++ b/react/components-core/src/hoc/Modal.js @@ -48,10 +48,10 @@ const Modal = ({ style={popupModuleActionBarStyles} > {actionCancelLabel ? ( -
diff --git a/react/example/package.json b/react/example/package.json index 6d8ea754af0..fda34f1b476 100644 --- a/react/example/package.json +++ b/react/example/package.json @@ -9,12 +9,12 @@ "start": "react-scripts start" }, "devDependencies": { - "@egovernments/digit-ui-libraries": "1.7.10", - "@egovernments/digit-ui-module-core": "1.7.10", + "@egovernments/digit-ui-libraries": "1.8.1-beta.1", + "@egovernments/digit-ui-module-core": "1.8.1-beta.6", "@egovernments/digit-ui-module-common": "1.7.10", "@egovernments/digit-ui-module-sample": "0.0.1", "@egovernments/digit-ui-module-project": "0.3.4", - "@egovernments/digit-ui-react-components": "1.7.10", + "@egovernments/digit-ui-react-components": "1.8.1-beta.4", "@egovernments/digit-ui-svg-components": "0.0.8", "@egovernments/digit-ui-components-core": "0.0.1", "http-proxy-middleware": "^1.0.5", diff --git a/react/libraries/README.md b/react/libraries/README.md index 39fc8cb4ee5..0719d6ca091 100644 --- a/react/libraries/README.md +++ b/react/libraries/README.md @@ -1,6 +1,6 @@ -# digit-ui-libraries -> Made with @egovernments/create-ui-library + +# digit-ui-svg-components ## Install @@ -8,6 +8,31 @@ npm install --save @egovernments/digit-ui-libraries ``` +## Limitation + +```bash +This Package is more specific to DIGIT-UI's can be used across mission's +``` + +## Usage + +After adding the dependency make sure you have this dependency in + +```bash +frontend/micro-ui/web/package.json +``` + +```json +"@egovernments/digit-ui-libraries":"1.8.0", +``` + +then navigate to App.js + +```bash + frontend/micro-ui/web/src/App.js +``` + + ## Usage ```jsx @@ -27,6 +52,23 @@ const App = ({ deltaConfig, stateCode, cityCode, moduleCode }) => { export default App; ``` +### Changelog + +```bash +1.8.1-beta.1 Republished after merging with Master due to version issues. +1.8.0 Released as part of workbench v1.0 +``` + +### Published from DIGIT Frontend +DIGIT Frontend Repo (https://github.com/egovernments/Digit-Frontend/tree/develop) + +### Contributors + +[jagankumar-egov] [nipunarora-eGov] [Tulika-eGov] [Ramkrishna-egov] [nabeelmd-eGov] [anil-egov] [vamshikrishnakole-wtt-egov] + ## License -MIT © [](https://github.com/) +MIT © [jagankumar-egov](https://github.com/jagankumar-egov) + + +![Logo](https://s3.ap-south-1.amazonaws.com/works-dev-asset/mseva-white-logo.png) diff --git a/react/libraries/package.json b/react/libraries/package.json index 6d773109f8c..374d1185336 100644 --- a/react/libraries/package.json +++ b/react/libraries/package.json @@ -1,6 +1,6 @@ { "name": "@egovernments/digit-ui-libraries", - "version": "1.7.10", + "version": "1.8.1-beta.1", "main": "dist/index.js", "module": "dist/index.modern.js", "source": "src/index.js", diff --git a/react/libraries/src/index.js b/react/libraries/src/index.js index 5a7d61a4d9f..1a1b885c738 100644 --- a/react/libraries/src/index.js +++ b/react/libraries/src/index.js @@ -3,6 +3,7 @@ import Enums from "./enums/index"; import mergeConfig from "./config/mergeConfig"; import { useStore } from "./services/index"; import { initI18n } from "./translations/index"; +import { Request } from "./services/atoms/Utils/Request"; import { Storage, PersistantStorage } from "./services/atoms/Utils/Storage"; import { UploadServices } from "./services/atoms/UploadServices"; @@ -87,4 +88,4 @@ const initLibraries = () => { }); }; -export { initLibraries, Enums, Hooks, subFormRegistry }; +export { initLibraries, Enums, Hooks, subFormRegistry ,Request}; diff --git a/react/libraries/src/services/molecules/Works/Search.js b/react/libraries/src/services/molecules/Works/Search.js index dd4e4b60975..91530552ebc 100644 --- a/react/libraries/src/services/molecules/Works/Search.js +++ b/react/libraries/src/services/molecules/Works/Search.js @@ -1,6 +1,7 @@ import cloneDeep from "lodash/cloneDeep"; import _ from "lodash"; import { WorksService } from "../../elements/Works"; +import HrmsService from "../../elements/HRMS"; import { convertEpochToDate } from "../../../utils/pt"; const createProjectsArray = (t, project, searchParams, headerLocale) => { @@ -129,7 +130,6 @@ const createProjectsArray = (t, project, searchParams, headerLocale) => { return totalProjects; } - export const WorksSearch = { searchEstimate: async (tenantId="pb.jalandhar", filters = {} ) => { @@ -147,51 +147,45 @@ export const WorksSearch = { const response = await WorksService?.loiSearch({tenantId,filters}) return response?.letterOfIndents }, - viewProjectDetailsScreen: async ( - t, - tenantId, - searchParams, - filters = { limit: 10, offset: 0, includeAncestors: true, includeDescendants: true }, - headerLocale - ) => { + viewProjectDetailsScreen: async(t,tenantId, searchParams, filters = {limit : 10, offset : 0, includeAncestors : true, includeDescendants : true}, headerLocale)=> { const response = await WorksService?.searchProject(tenantId, searchParams, filters); - + //Categoring the response into an object of searched project and its sub-projects ( if any ) + //searched projects will have basic details, project details and financial details + //subprojects will be shown in a table similar to what create project has let projectDetails = { - searchedProject: { - basicDetails: {}, - details: { - projectDetails: [], + searchedProject : { + basicDetails : {}, + details : { + projectDetails : [], + financialDetails : [] + } }, - }, - }; - - if (response?.Project) { - let projects = createProjectsArray(t, response?.Project, searchParams, headerLocale); - - //searched Project details - projectDetails.searchedProject["basicDetails"] = projects?.searchedProject?.basicDetails; - projectDetails.searchedProject["details"]["projectDetails"] = { - applicationDetails: [ - projects?.searchedProject?.headerDetails, - projects?.searchedProject?.projectDetails, - projects?.searchedProject?.locationDetails, - projects?.searchedProject?.documentDetails, - ], - }; //rest categories will come here + subProjects : [] } - - return { - projectDetails: response?.Project ? projectDetails : [], - response: response?.Project, - processInstancesDetails: [], - applicationData: {}, - workflowDetails: [], - applicationData: {}, - isNoDataFound: response?.Project?.length === 0, - }; - }, + //Upon Search, we will get a response of one Project which will be our Searched Projects + //That project will have descendants, which will be the part of Sub-Projects. + + let projects = createProjectsArray(t, response?.Projects, searchParams, headerLocale); + //searched Project details + projectDetails.searchedProject['basicDetails'] = projects?.searchedProject?.basicDetails; + projectDetails.searchedProject['details']['projectDetails'] = {applicationDetails : [projects?.searchedProject?.departmentDetails, projects?.searchedProject?.workTypeDetails, projects?.searchedProject?.locationDetails, projects?.searchedProject?.documentDetails]}; //rest categories will come here + projectDetails.searchedProject['details']['financialDetails'] = {applicationDetails : [projects?.searchedProject?.financialDetails]}; //rest categories will come here + + if(response?.Projects?.[0]?.descendants) { + projects = createProjectsArray(t, response?.Projects?.[0]?.descendants, searchParams, headerLocale); + //all details of searched project will come here + projectDetails.subProjects?.push(projects?.subProjects); + } + return { + projectDetails : projectDetails, + processInstancesDetails: [], + applicationData: {}, + workflowDetails: [], + applicationData:{} + } + }, viewEstimateScreen: async (t, tenantId, estimateNumber) => { diff --git a/react/libraries/src/utils/date.js b/react/libraries/src/utils/date.js index c6a547946a3..f2f41608b7f 100644 --- a/react/libraries/src/utils/date.js +++ b/react/libraries/src/utils/date.js @@ -17,4 +17,40 @@ function getDate(timestamp) { const monthNames = ["Jan", "Feb", "March", "Apr", "May", "June", "July", "Aug", "Sep", "Oct", "Nov", "Dec"]; -export { getDate, monthNames }; +/* +Digit.Utils.date.convertDateToEpoch() +* @params dateString date as string +dayStartOrEnd defaults to dayend + + //example input format : "2018-10-02" + +*/ +const convertDateToEpoch = (dateString, dayStartOrEnd = "dayend") => { + try { + const parts = dateString.match(/(\d{4})-(\d{1,2})-(\d{1,2})/); + const DateObj = new Date(Date.UTC(parts[1], parts[2] - 1, parts[3])); + DateObj.setMinutes(DateObj.getMinutes() + DateObj.getTimezoneOffset()); + if (dayStartOrEnd === "dayend") { + DateObj.setHours(DateObj.getHours() + 24); + DateObj.setSeconds(DateObj.getSeconds() - 1); + } + return DateObj.getTime(); + } catch (e) { + return dateString; + } +}; + + const convertEpochToDate = (dateEpoch) => { + if (dateEpoch == null || dateEpoch == undefined || dateEpoch == "") { + return "NA"; + } + const dateFromApi = new Date(dateEpoch); + let month = dateFromApi.getMonth() + 1; + let day = dateFromApi.getDate(); + let year = dateFromApi.getFullYear(); + month = (month > 9 ? "" : "0") + month; + day = (day > 9 ? "" : "0") + day; + return `${day}/${month}/${year}`; +}; + +export { getDate, monthNames ,convertDateToEpoch , convertEpochToDate }; diff --git a/react/modules/Project/src/Module.js b/react/modules/Project/src/Module.js index 55d83069c9c..17a93259ff1 100644 --- a/react/modules/Project/src/Module.js +++ b/react/modules/Project/src/Module.js @@ -1,4 +1,4 @@ -import { CitizenInfoLabel, Loader } from "@egovernments/digit-ui-react-components"; +import { CitizenInfoLabel, Loader } from "@egovernments/digit-ui-components-core"; import React, { useEffect } from "react"; import { useRouteMatch } from "react-router-dom"; import ProjectCard from "./components/ProjectCard"; diff --git a/react/modules/Project/src/components/ProjectCard.js b/react/modules/Project/src/components/ProjectCard.js index 7c342fe7449..1db6ef3721f 100644 --- a/react/modules/Project/src/components/ProjectCard.js +++ b/react/modules/Project/src/components/ProjectCard.js @@ -1,6 +1,7 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { EmployeeModuleCard, PTIcon } from "@egovernments/digit-ui-react-components"; +import { EmployeeModuleCard } from "@egovernments/digit-ui-react-components"; +import {PTIcon } from "@egovernments/digit-ui-components-core"; const ProjectCard = () => { const { t } = useTranslation(); diff --git a/react/modules/Project/src/components/SelectGeoLocation.js b/react/modules/Project/src/components/SelectGeoLocation.js index d928342c938..e85061904b9 100644 --- a/react/modules/Project/src/components/SelectGeoLocation.js +++ b/react/modules/Project/src/components/SelectGeoLocation.js @@ -1,6 +1,6 @@ import React, { Fragment, useState } from "react"; -import {LocationSearch, Modal} from "@egovernments/digit-ui-react-components"; -import { CardLabel, LabelFieldPair, TextInput} from "@egovernments/digit-ui-components-core"; +import {LocationSearch} from "@egovernments/digit-ui-react-components"; +import { CardLabel, LabelFieldPair, TextInput, Modal} from "@egovernments/digit-ui-components-core"; import { useTranslation } from "react-i18next"; const SelectGeoLocation = ({ onSelect, config, formData }) => { diff --git a/react/modules/Project/src/components/SubProjectDetailsTable.js b/react/modules/Project/src/components/SubProjectDetailsTable.js index 26a34b256f6..90e3dc06ff5 100644 --- a/react/modules/Project/src/components/SubProjectDetailsTable.js +++ b/react/modules/Project/src/components/SubProjectDetailsTable.js @@ -1,427 +1,727 @@ -import React, { Fragment, useEffect, useMemo, useState } from 'react' -import { AddIcon, DeleteIcon, RemoveIcon, CardLabelError, Loader } from '@egovernments/digit-ui-react-components' -import {TextInput,Dropdown,CustomDropdown,MultiUploadWrapper} from "@egovernments/digit-ui-components-core" -import { Controller } from 'react-hook-form'; -import _ from 'lodash'; +import React, { Fragment, useEffect, useMemo, useState } from "react"; +import { + TextInput, + Dropdown, + CustomDropdown, + MultiUploadWrapper, + CardLabelError, + Loader, + AddIcon, + DeleteIcon, + RemoveIcon, +} from "@egovernments/digit-ui-components-core"; +import { Controller } from "react-hook-form"; +import _ from "lodash"; //these params depend on what the controller of the associated type is sending. -const SubProjectDetailsTable = ({t, register, control, setValue, onChange, errors, sectionFormCategory, selectedFormCategory}) => { - const orgSession = Digit.Hooks.useSessionStorage("NEW_PROJECT_CREATE",{}); - const [sessionFormData, setSessionFormData, clearSessionFormData] = orgSession; +const SubProjectDetailsTable = ({ + t, + register, + control, + setValue, + onChange, + errors, + sectionFormCategory, + selectedFormCategory, +}) => { + const orgSession = Digit.Hooks.useSessionStorage("NEW_PROJECT_CREATE", {}); + const [ + sessionFormData, + setSessionFormData, + clearSessionFormData, + ] = orgSession; - //update sub project table with session data - const renderSubProjectsFromSession = () => { - if(!sessionFormData?.withSubProject_project_subProjects) { - return [{ - key: 1, - isShow: true, - }]; - } - let tableState = []; - for(let i = 1; i { + if (!sessionFormData?.withSubProject_project_subProjects) { + return [ + { + key: 1, + isShow: true, + }, + ]; + } + let tableState = []; + for ( + let i = 1; + i < sessionFormData?.withSubProject_project_subProjects?.length; + i++ + ) { + tableState.push({ + key: i, + isShow: true, + }); } - const [rows, setRows] = useState(renderSubProjectsFromSession()); - const columns = [ - {label : t('WORKS_SNO'), isMandatory : false }, - {label : t('WORKS_NAME_OF_SUB_PROJECT'), isMandatory : true }, - {label : t('WORKS_ESTIMATED_AMOUNT'), isMandatory : false }, - {label : t('WORKS_PROJECT_TYPE'), isMandatory : true }, - {label : t('WORKS_SUB_PROJECT_TYPE'), isMandatory : false }, - {label : t('WORKS_WORK_NATURE'), isMandatory : false }, - {label : t('WORKS_PROJECT_START_DATE'), isMandatory : false }, - {label : t('WORKS_PROJECT_END_DATE'), isMandatory : false }, - {label : t('WORKS_MODE_OF_ENTRUSTMENT'), isMandatory : false }, - {label : t('WORKS_WARD'), isMandatory : false }, - {label : t('WORKS_LOCALITY'), isMandatory : false }, - {label : t('ES_COMMON_ULB'), isMandatory : false }, - {label : t('WORKS_GEO_LOCATION'), isMandatory : false }, - {label : t('WORKS_UPLOAD_DOCS'), isMandatory : false }, - {label : t('WORKS_ACTIONS'), isMandatory : false } - ]; - const [subProjectTypeOfProjectOptions, setSubProjectTypeOfProjectOptions] = useState([]); - const [subProjectSubTypeOfWorkOptions, setSubProjectSubTypeOfProjectOptions] = useState([]); - const formFieldName = "withSubProject_project_subProjects"; //keep this name diff from the key in config - const tenantId = Digit.ULBService.getCurrentTenantId(); - const headerLocale = Digit.Utils.locale.getTransformedLocale(tenantId); - const [subProjectDetailsSelectedWard, setSubProjectDetailsSelectedWard] = useState([]); - const [subProjectDetailsLocalities, setSubProjectDetailsLocalities] = useState([]); - const { data: cities } = Digit.Hooks.useTenants(); - const getCities = () => cities?.filter((e) => e.code.includes(tenantId)) || []; + return tableState; + }; + const [rows, setRows] = useState(renderSubProjectsFromSession()); + const columns = [ + { label: t("WORKS_SNO"), isMandatory: false }, + { label: t("WORKS_NAME_OF_SUB_PROJECT"), isMandatory: true }, + { label: t("WORKS_ESTIMATED_AMOUNT"), isMandatory: false }, + { label: t("WORKS_PROJECT_TYPE"), isMandatory: true }, + { label: t("WORKS_SUB_PROJECT_TYPE"), isMandatory: false }, + { label: t("WORKS_WORK_NATURE"), isMandatory: false }, + { label: t("WORKS_PROJECT_START_DATE"), isMandatory: false }, + { label: t("WORKS_PROJECT_END_DATE"), isMandatory: false }, + { label: t("WORKS_MODE_OF_ENTRUSTMENT"), isMandatory: false }, + { label: t("WORKS_WARD"), isMandatory: false }, + { label: t("WORKS_LOCALITY"), isMandatory: false }, + { label: t("ES_COMMON_ULB"), isMandatory: false }, + { label: t("WORKS_GEO_LOCATION"), isMandatory: false }, + { label: t("WORKS_UPLOAD_DOCS"), isMandatory: false }, + { label: t("WORKS_ACTIONS"), isMandatory: false }, + ]; + const [ + subProjectTypeOfProjectOptions, + setSubProjectTypeOfProjectOptions, + ] = useState([]); + const [ + subProjectSubTypeOfWorkOptions, + setSubProjectSubTypeOfProjectOptions, + ] = useState([]); + const formFieldName = "withSubProject_project_subProjects"; //keep this name diff from the key in config + const tenantId = Digit.ULBService.getCurrentTenantId(); + const headerLocale = Digit.Utils.locale.getTransformedLocale(tenantId); + const [ + subProjectDetailsSelectedWard, + setSubProjectDetailsSelectedWard, + ] = useState([]); + const [ + subProjectDetailsLocalities, + setSubProjectDetailsLocalities, + ] = useState([]); + const { data: cities } = Digit.Hooks.useTenants(); + const getCities = () => + cities?.filter((e) => e.code.includes(tenantId)) || []; - const { isLoading, data : wardsAndLocalities } = Digit.Hooks.useLocation( - tenantId, 'Ward', - { - select: (data) => { - const wards = [] - const localities = {} - data?.TenantBoundary[0]?.boundary.forEach((item) => { - localities[item?.code] = item?.children.map(item => ({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}`, label : item?.label })) - wards.push({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}` }) - }); - return { - wards, localities - } - } + const { isLoading, data: wardsAndLocalities } = Digit.Hooks.useLocation( + tenantId, + "Ward", + { + select: (data) => { + const wards = []; + const localities = {}; + data?.TenantBoundary[0]?.boundary.forEach((item) => { + localities[item?.code] = item?.children.map((item) => ({ + code: item.code, + name: item.name, + i18nKey: `${headerLocale}_ADMIN_${item?.code}`, + label: item?.label, + })); + wards.push({ + code: item.code, + name: item.name, + i18nKey: `${headerLocale}_ADMIN_${item?.code}`, + }); }); - - useEffect(()=>{ - let filteredSubTypeOfProject = ( subProjectTypeOfProjectOptions && subProjectTypeOfProjectOptions?.projectSubType ) ? ( - subProjectTypeOfProjectOptions?.projectSubType.map(projectSubType=>({code : projectSubType, name : `COMMON_MASTERS_${projectSubType}`}))) : []; - setSubProjectSubTypeOfProjectOptions(filteredSubTypeOfProject); - },[subProjectTypeOfProjectOptions]); + return { + wards, + localities, + }; + }, + } + ); - useEffect(()=>{ - setSubProjectDetailsLocalities(wardsAndLocalities?.localities[subProjectDetailsSelectedWard?.code] ? wardsAndLocalities?.localities[subProjectDetailsSelectedWard?.code]: [] ); - },[subProjectDetailsSelectedWard]); + useEffect(() => { + let filteredSubTypeOfProject = + subProjectTypeOfProjectOptions && + subProjectTypeOfProjectOptions?.projectSubType + ? subProjectTypeOfProjectOptions?.projectSubType.map( + (projectSubType) => ({ + code: projectSubType, + name: `COMMON_MASTERS_${projectSubType}`, + }) + ) + : []; + setSubProjectSubTypeOfProjectOptions(filteredSubTypeOfProject); + }, [subProjectTypeOfProjectOptions]); - const getDropDownDataFromMDMS = (t, row, inputName, props, register, optionKey="name", options=[]) => { - const { isLoading, data } = Digit.Hooks.useCustomMDMS( - Digit.ULBService.getStateId(), - options?.mdmsConfig?.moduleName, - [{ name: options?.mdmsConfig?.masterName }], - { - select: (data) => { - const optionsData = _.get(data, `${options?.mdmsConfig?.moduleName}.${options?.mdmsConfig?.masterName}`, []); - return optionsData.filter((opt) => opt?.active).map((opt) => ({ ...opt, name: `${options?.mdmsConfig?.localePrefix}_${Digit.Utils.locale.getTransformedLocale(opt.code)}` })); - }, - enabled: options?.mdmsConfig ? true : false, - } - ); - if (isLoading) { - return ; - //show MDMS data if options are not provided. Options are in use here for pre defined options from config. - //Usage example : dependent dropdown - } else return handleDropdownChange(e, props, row, inputName)} - onBlur={props?.onBlur} - optionCardStyles={{maxHeight : '15rem'}} - /> - } + useEffect(() => { + setSubProjectDetailsLocalities( + wardsAndLocalities?.localities[subProjectDetailsSelectedWard?.code] + ? wardsAndLocalities?.localities[subProjectDetailsSelectedWard?.code] + : [] + ); + }, [subProjectDetailsSelectedWard]); - const handleDropdownChange = (e,props, row, inputName) => { - if(inputName === "typeOfProject") { - setValue(`${formFieldName}.${row.key}.subTypeOfProject`, ''); - setSubProjectTypeOfProjectOptions(e); - } - if(inputName === "ward") { - setValue(`${formFieldName}.${row.key}.locality`, ''); - setSubProjectDetailsSelectedWard(e); - } - props?.onChange(e); - } + const getDropDownDataFromMDMS = ( + t, + row, + inputName, + props, + register, + optionKey = "name", + options = [] + ) => { + const { isLoading, data } = Digit.Hooks.useCustomMDMS( + Digit.ULBService.getStateId(), + options?.mdmsConfig?.moduleName, + [{ name: options?.mdmsConfig?.masterName }], + { + select: (data) => { + const optionsData = _.get( + data, + `${options?.mdmsConfig?.moduleName}.${options?.mdmsConfig?.masterName}`, + [] + ); + return optionsData + .filter((opt) => opt?.active) + .map((opt) => ({ + ...opt, + name: `${ + options?.mdmsConfig?.localePrefix + }_${Digit.Utils.locale.getTransformedLocale(opt.code)}`, + })); + }, + enabled: options?.mdmsConfig ? true : false, + } + ); + if (isLoading) { + return ; + //show MDMS data if options are not provided. Options are in use here for pre defined options from config. + //Usage example : dependent dropdown + } else + return ( + handleDropdownChange(e, props, row, inputName)} + onBlur={props?.onBlur} + optionCardStyles={{ maxHeight: "15rem" }} + /> + ); + }; - const getStyles = (type) => { - if(type === "upload") { - return { "minWidth": "20rem" }; - } - if(type === "SNO") { - return { "minWidth": "2rem" }; - } - if(type === "PROJECT_NAME") { - return { "minWidth": "20rem" }; - } - if(type === "DATE") { - return { "minWidth": "20rem" }; - } - return { "minWidth": "14rem" }; + const handleDropdownChange = (e, props, row, inputName) => { + if (inputName === "typeOfProject") { + setValue(`${formFieldName}.${row.key}.subTypeOfProject`, ""); + setSubProjectTypeOfProjectOptions(e); } - - const renderHeader = () => { - return columns?.map((column, index) => { - if(column.label === t("WORKS_ACTIONS") || column.label === t("WORKS_SNO")) { - return {column?.label}{column?.isMandatory && '*'} - } - if(column.label === t("WORKS_UPLOAD_DOCS")) { - return {column?.label}{` (${t("WORKS_DOC_UPLOAD_HINT")})`} - } - return {column?.label}{column?.isMandatory && '*'} - }) + if (inputName === "ward") { + setValue(`${formFieldName}.${row.key}.locality`, ""); + setSubProjectDetailsSelectedWard(e); } + props?.onChange(e); + }; - const showDelete = () => { - let countIsShow = 0 - rows.map(row => row.isShow && countIsShow++) - if (countIsShow === 1) { - return false - } - return true + const getStyles = (type) => { + if (type === "upload") { + return { minWidth: "20rem" }; } - const removeRow = (row) => { - //make a new state here which doesn't have this key - const updatedState = rows.map(e => { - if (e.key === row.key) { - return { - key: e.key, - isShow: false - } - } - return e - }) - - setRows(prev => updatedState) + if (type === "SNO") { + return { minWidth: "2rem" }; } - const addRow = () => { - const obj = { - key: null, - isShow: true - } - obj.key = rows[rows.length - 1].key + 1 - setRows(prev => [...prev, obj]) + if (type === "PROJECT_NAME") { + return { minWidth: "20rem" }; } + if (type === "DATE") { + return { minWidth: "20rem" }; + } + return { minWidth: "14rem" }; + }; + + const renderHeader = () => { + return columns?.map((column, index) => { + if ( + column.label === t("WORKS_ACTIONS") || + column.label === t("WORKS_SNO") + ) { + return ( + + {column?.label} + {column?.isMandatory && "*"}{" "} + + ); + } + if (column.label === t("WORKS_UPLOAD_DOCS")) { + return ( + + {column?.label} + {` (${t("WORKS_DOC_UPLOAD_HINT")})`}{" "} + + ); + } + return ( + + {column?.label} + {column?.isMandatory && "*"}{" "} + + ); + }); + }; - const renderErrorIfAny = (row, name, isErrorForDropdown=false) => { - switch(name) { - case "projectName" : { - return <> - {errors && ( errors?.[formFieldName]?.[row.key]?.[name]?.type === "pattern" || errors?.[formFieldName]?.[row.key]?.[name]?.type === "required" ) && ( - {t(`PROJECT_PATTERN_ERR_MSG_PROJECT_NAME`)})} - - } - case "endDate" : { - return <> - {errors && ( errors?.[formFieldName]?.[row.key]?.[`${name}_custom`]?.type === "custom" || errors?.[formFieldName]?.[row.key]?.[`${name}_custom`]?.type === "pattern" || errors?.[formFieldName]?.[row.key]?.[`${name}_custom`]?.type === "required" ) && ( - {t(`COMMON_END_DATE_SHOULD_BE_GREATER_THAN_START_DATE`)})} - - } - default : { - return <> - {errors && errors?.[formFieldName]?.[row.key]?.[name]?.type === "pattern" && ( - {t(`WORKS_PATTERN_ERR`)})} - {errors && errors?.[formFieldName]?.[row.key]?.[name]?.type === "required" && ( - {t(`WORKS_REQUIRED_ERR`)})} - - } - } + const showDelete = () => { + let countIsShow = 0; + rows.map((row) => row.isShow && countIsShow++); + if (countIsShow === 1) { + return false; } + return true; + }; + const removeRow = (row) => { + //make a new state here which doesn't have this key + const updatedState = rows.map((e) => { + if (e.key === row.key) { + return { + key: e.key, + isShow: false, + }; + } + return e; + }); - const renderBody = () => { - let i = 0 - return rows.map((row, index) => { - if (row.isShow) i++ - return row.isShow && - {i} - -
- ?\\\\~`!@$%^()+={}\[\]*:;“”‘’]{1,50}$/i, minLength: 2}) : register({required : false})}/> - {renderErrorIfAny(row, "projectName")} -
- - -
- - {renderErrorIfAny(row, "estimatedCostInRs")} -
- - -
- ( - getDropDownDataFromMDMS(t, row, "typeOfProject" , props, register, "name", { - mdmsConfig: { - masterName: "ProjectType", - moduleName: "works", - localePrefix: "COMMON_MASTERS", - }}) - )} - /> - {renderErrorIfAny(row, "typeOfProject", true)} -
- - -
- ( - getDropDownDataFromMDMS(t, row, "subTypeOfProject", props, register, "name", subProjectSubTypeOfWorkOptions) - )} - /> - {renderErrorIfAny(row, "subTypeOfProject", true)} -
- - -
- ( - getDropDownDataFromMDMS(t, row, "natureOfWork", props, register, "name", { - mdmsConfig: { - masterName: "NatureOfWork", - moduleName: "works", - localePrefix: "COMMON_MASTERS", - }}) - )} - /> - {renderErrorIfAny(row, "natureOfWork", true)} -
- - -
- - {renderErrorIfAny(row, "startDate")} -
- - -
- - {renderErrorIfAny(row, "endDate")} -
- - -
- ( - getDropDownDataFromMDMS(t, row, "recommendedModeOfEntrustment", props, register, "name", { - mdmsConfig: { - masterName: "EntrustmentMode", - moduleName: "works", - localePrefix: "COMMON_MASTERS", - }}) - )} - /> - {renderErrorIfAny(row, "recommendedModeOfEntrustment", true)} -
- - -
- ( - getDropDownDataFromMDMS(t, row, "ward", props, register, "i18nKey", wardsAndLocalities?.wards) - )} - /> - {renderErrorIfAny(row, "ward", true)} -
- - -
- ( - getDropDownDataFromMDMS(t, row, "locality", props, register, "i18nKey", subProjectDetailsLocalities) - )} - /> - {renderErrorIfAny(row, "locality", true)} -
- - -
- ( - getDropDownDataFromMDMS(t, row, "ulb", props, register, "i18nKey", getCities()) - )} - /> - {renderErrorIfAny(row, "ulb", true)} -
- - -
- - {renderErrorIfAny(row, "geoLocation")} -
- - -
- { - function getFileStoreData(filesData) { - const numberOfFiles = filesData.length; - let finalDocumentData = []; - if (numberOfFiles > 0) { - filesData.forEach((value) => { - finalDocumentData.push({ - fileName: value?.[0], - fileStoreId: value?.[1]?.fileStoreId?.fileStoreId, - documentType: value?.[1]?.file?.type, - }); - }); - } - //here we need to update the form the same way as the state of the reducer in multiupload, since Upload component within the multiupload wrapper uses that same format of state so we need to set the form data as well in the same way. Previously we were altering it and updating the formData - onChange(numberOfFiles>0?filesData:[]); - } - return ( - - ); - }} - /> - {renderErrorIfAny(row, "uploadedFiles")} -
- - {showDelete() && removeRow(row)}>} - - }) + setRows((prev) => updatedState); + }; + const addRow = () => { + const obj = { + key: null, + isShow: true, + }; + obj.key = rows[rows.length - 1].key + 1; + setRows((prev) => [...prev, obj]); + }; + + const renderErrorIfAny = (row, name, isErrorForDropdown = false) => { + switch (name) { + case "projectName": { + return ( + <> + {errors && + (errors?.[formFieldName]?.[row.key]?.[name]?.type === "pattern" || + errors?.[formFieldName]?.[row.key]?.[name]?.type === + "required") && ( + + {t(`PROJECT_PATTERN_ERR_MSG_PROJECT_NAME`)} + + )} + + ); + } + case "endDate": { + return ( + <> + {errors && + (errors?.[formFieldName]?.[row.key]?.[`${name}_custom`]?.type === + "custom" || + errors?.[formFieldName]?.[row.key]?.[`${name}_custom`]?.type === + "pattern" || + errors?.[formFieldName]?.[row.key]?.[`${name}_custom`]?.type === + "required") && ( + + {t(`COMMON_END_DATE_SHOULD_BE_GREATER_THAN_START_DATE`)} + + )} + + ); + } + default: { + return ( + <> + {errors && + errors?.[formFieldName]?.[row.key]?.[name]?.type === + "pattern" && ( + + {t(`WORKS_PATTERN_ERR`)} + + )} + {errors && + errors?.[formFieldName]?.[row.key]?.[name]?.type === + "required" && ( + + {t(`WORKS_REQUIRED_ERR`)} + + )} + + ); + } } + }; + + const renderBody = () => { + let i = 0; + return rows.map((row, index) => { + if (row.isShow) i++; + return ( + row.isShow && ( + + {i} + +
+ ?\\\\~`!@$%^()+={}\[\]*:;“”‘’]{1,50}$/i, + minLength: 2, + }) + : register({ required: false }) + } + /> + {renderErrorIfAny(row, "projectName")} +
+ + +
+ + {renderErrorIfAny(row, "estimatedCostInRs")} +
+ + +
+ + getDropDownDataFromMDMS( + t, + row, + "typeOfProject", + props, + register, + "name", + { + mdmsConfig: { + masterName: "ProjectType", + moduleName: "works", + localePrefix: "COMMON_MASTERS", + }, + } + ) + } + /> + {renderErrorIfAny(row, "typeOfProject", true)} +
+ + +
+ + getDropDownDataFromMDMS( + t, + row, + "subTypeOfProject", + props, + register, + "name", + subProjectSubTypeOfWorkOptions + ) + } + /> + {renderErrorIfAny(row, "subTypeOfProject", true)} +
+ + +
+ + getDropDownDataFromMDMS( + t, + row, + "natureOfWork", + props, + register, + "name", + { + mdmsConfig: { + masterName: "NatureOfWork", + moduleName: "works", + localePrefix: "COMMON_MASTERS", + }, + } + ) + } + /> + {renderErrorIfAny(row, "natureOfWork", true)} +
+ + +
+ + {renderErrorIfAny(row, "startDate")} +
+ + +
+ + {renderErrorIfAny(row, "endDate")} +
+ + +
+ + getDropDownDataFromMDMS( + t, + row, + "recommendedModeOfEntrustment", + props, + register, + "name", + { + mdmsConfig: { + masterName: "EntrustmentMode", + moduleName: "works", + localePrefix: "COMMON_MASTERS", + }, + } + ) + } + /> + {renderErrorIfAny(row, "recommendedModeOfEntrustment", true)} +
+ + +
+ + getDropDownDataFromMDMS( + t, + row, + "ward", + props, + register, + "i18nKey", + wardsAndLocalities?.wards + ) + } + /> + {renderErrorIfAny(row, "ward", true)} +
+ + +
+ + getDropDownDataFromMDMS( + t, + row, + "locality", + props, + register, + "i18nKey", + subProjectDetailsLocalities + ) + } + /> + {renderErrorIfAny(row, "locality", true)} +
+ + +
+ + getDropDownDataFromMDMS( + t, + row, + "ulb", + props, + register, + "i18nKey", + getCities() + ) + } + /> + {renderErrorIfAny(row, "ulb", true)} +
+ + +
+ + {renderErrorIfAny(row, "geoLocation")} +
+ + +
+ { + function getFileStoreData(filesData) { + const numberOfFiles = filesData.length; + let finalDocumentData = []; + if (numberOfFiles > 0) { + filesData.forEach((value) => { + finalDocumentData.push({ + fileName: value?.[0], + fileStoreId: value?.[1]?.fileStoreId?.fileStoreId, + documentType: value?.[1]?.file?.type, + }); + }); + } + //here we need to update the form the same way as the state of the reducer in multiupload, since Upload component within the multiupload wrapper uses that same format of state so we need to set the form data as well in the same way. Previously we were altering it and updating the formData + onChange(numberOfFiles > 0 ? filesData : []); + } + return ( + + ); + }} + /> + {renderErrorIfAny(row, "uploadedFiles")} +
+ + + {showDelete() && ( + removeRow(row)}> + + + )} + + + ) + ); + }); + }; - return ( -
- - - {renderHeader()} - - - {renderBody()} - - - - - - - -
-
- ) -} -export default SubProjectDetailsTable; \ No newline at end of file + return ( +
+ + + {renderHeader()} + + + {renderBody()} + + + + + + + +
+ + + + +
+
+ ); +}; +export default SubProjectDetailsTable; diff --git a/react/modules/Project/src/configs/createProjectConfigMUKTA.js b/react/modules/Project/src/configs/createProjectConfigMUKTA.js index ffc1f649713..343449148fd 100644 --- a/react/modules/Project/src/configs/createProjectConfigMUKTA.js +++ b/react/modules/Project/src/configs/createProjectConfigMUKTA.js @@ -38,9 +38,6 @@ export const createProjectConfigMUKTA = { "key": "basicDetails_dateOfProposal", "type": "date", "disable": false, - "preProcess" : { - "updateDependent" : ["populators.validation.max"] - }, "populators": { "name": "basicDetails_dateOfProposal", "validation":{ diff --git a/react/modules/Project/src/pageComponents/ViewFinancialDetails.js b/react/modules/Project/src/pageComponents/ViewFinancialDetails.js index 090b8d7c8d4..eb5838830f9 100644 --- a/react/modules/Project/src/pageComponents/ViewFinancialDetails.js +++ b/react/modules/Project/src/pageComponents/ViewFinancialDetails.js @@ -1,4 +1,4 @@ -import { Loader, Card } from '@egovernments/digit-ui-react-components'; +import { Loader, Card } from '@egovernments/digit-ui-components-core'; import React, { Fragment, useState, useEffect } from 'react' import { useTranslation } from 'react-i18next'; import ApplicationDetails from '../../../templates/ApplicationDetails'; diff --git a/react/modules/Project/src/pageComponents/ViewProject.js b/react/modules/Project/src/pageComponents/ViewProject.js index ed0203b3d9d..a8f8a36912c 100644 --- a/react/modules/Project/src/pageComponents/ViewProject.js +++ b/react/modules/Project/src/pageComponents/ViewProject.js @@ -1,4 +1,4 @@ -import { Loader, Card, Toast } from "@egovernments/digit-ui-react-components"; +import { Loader, Card,Toast } from "@egovernments/digit-ui-components-core"; import React, { Fragment, useState, useEffect } from "react"; import { useTranslation } from "react-i18next"; import ApplicationDetails from "../../../templates/ApplicationDetails"; diff --git a/react/modules/Project/src/pages/employee/CreateProject/CreateProjectForm.js b/react/modules/Project/src/pages/employee/CreateProject/CreateProjectForm.js index 3ae42bd6747..b1e795c78e1 100644 --- a/react/modules/Project/src/pages/employee/CreateProject/CreateProjectForm.js +++ b/react/modules/Project/src/pages/employee/CreateProject/CreateProjectForm.js @@ -1,5 +1,5 @@ -import { FormComposer, Header, Toast } from "@egovernments/digit-ui-react-components"; -import { FormComposerV2 } from "@egovernments/digit-ui-components-core"; +import { FormComposerV2} from "@egovernments/digit-ui-components-core"; +import { Header } from "@egovernments/digit-ui-react-components"; import React, { Fragment, useEffect, useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; import _ from "lodash"; diff --git a/react/modules/Project/src/pages/employee/CreateProject/CreateProjectResponse.js b/react/modules/Project/src/pages/employee/CreateProject/CreateProjectResponse.js index 3c057074066..2bf138496c8 100644 --- a/react/modules/Project/src/pages/employee/CreateProject/CreateProjectResponse.js +++ b/react/modules/Project/src/pages/employee/CreateProject/CreateProjectResponse.js @@ -1,63 +1,94 @@ import React, { useEffect, useState } from "react"; import { Link, useHistory, useLocation } from "react-router-dom"; import { useTranslation } from "react-i18next"; -import { Banner, Card, LinkLabel, AddFileFilled, ArrowLeftWhite, ActionBar, SubmitBar} from "@egovernments/digit-ui-react-components"; +import { Banner } from "@egovernments/digit-ui-react-components"; +import { + LinkLabel, + Card, + SubmitBar, + ActionBar, + ArrowLeftWhite, + AddFileFilled, +} from "@egovernments/digit-ui-components-core"; const CreateProjectResponse = () => { - const {t} = useTranslation(); - const history = useHistory(); - const queryStrings = Digit.Hooks.useQueryParams(); - const [ projectIDsList, setProjectIDsList ] = useState(queryStrings?.projectIDs.split(',')); - const loggedInUserRoles = Digit.Utils.getLoggedInUserDetails("roles"); - const [isEstimateCreator, setIsEstimateCreator] = useState(false); - const [ isResponseSuccess, setIsResponseSuccess ] = useState(queryStrings?.isSuccess === "true" ? true : queryStrings?.isSuccess === "false" ? false : true); - const {state} = useLocation(); + const { t } = useTranslation(); + const history = useHistory(); + const queryStrings = Digit.Hooks.useQueryParams(); + const [projectIDsList, setProjectIDsList] = useState( + queryStrings?.projectIDs.split(",") + ); + const loggedInUserRoles = Digit.Utils.getLoggedInUserDetails("roles"); + const [isEstimateCreator, setIsEstimateCreator] = useState(false); + const [isResponseSuccess, setIsResponseSuccess] = useState( + queryStrings?.isSuccess === "true" + ? true + : queryStrings?.isSuccess === "false" + ? false + : true + ); + const { state } = useLocation(); - useEffect(()=>{ - setIsEstimateCreator(loggedInUserRoles?.includes("ESTIMATE_CREATOR")); - },[]); + useEffect(() => { + setIsEstimateCreator(loggedInUserRoles?.includes("ESTIMATE_CREATOR")); + }, []); - const navigate = (page) =>{ - switch(page){ - case "search-project" : { - history.push(`/${window.contextPath}/employee/project/search-project`); - break; - } - case "create-estimate" : { - history.push(`/${window.contextPath}/employee/estimate/create-detailed-estimate?tenantId=${queryStrings?.tenantId}&projectNumber=${projectIDsList?.[0]}`); - break; - } - case "home-screen" : { - history.push(`/${window.contextPath}/employee`); - break; - } - } + const navigate = (page) => { + switch (page) { + case "search-project": { + history.push(`/${window.contextPath}/employee/project/search-project`); + break; + } + case "create-estimate": { + history.push( + `/${window.contextPath}/employee/estimate/create-detailed-estimate?tenantId=${queryStrings?.tenantId}&projectNumber=${projectIDsList?.[0]}` + ); + break; + } + case "home-screen": { + history.push(`/${window.contextPath}/employee`); + break; + } } + }; - return ( - - -
- navigate('search-project')}> - {t("PROJECT_GO_TO_SEARCH_PROJECT")} - - {isResponseSuccess && isEstimateCreator && navigate('create-estimate')}> - {t("COMMON_CREATE_ESTIMATE")} - } -
- - - - - -
- ) -} + return ( + + +
+ navigate("search-project")} + > + + {t("PROJECT_GO_TO_SEARCH_PROJECT")} + + {isResponseSuccess && isEstimateCreator && ( + navigate("create-estimate")} + > + + {t("COMMON_CREATE_ESTIMATE")} + + )} +
+ + + + + +
+ ); +}; export default CreateProjectResponse; diff --git a/react/modules/Project/src/pages/employee/CreateProject/index.js b/react/modules/Project/src/pages/employee/CreateProject/index.js index 0ddbea02330..ceb74235eb7 100644 --- a/react/modules/Project/src/pages/employee/CreateProject/index.js +++ b/react/modules/Project/src/pages/employee/CreateProject/index.js @@ -1,4 +1,3 @@ -import { Loader, ProjectIcon } from "@egovernments/digit-ui-react-components"; import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { useLocation } from "react-router-dom"; diff --git a/react/modules/Project/src/pages/employee/ProjectDetails/index.js b/react/modules/Project/src/pages/employee/ProjectDetails/index.js index 97a9542023a..ca6851a77cf 100644 --- a/react/modules/Project/src/pages/employee/ProjectDetails/index.js +++ b/react/modules/Project/src/pages/employee/ProjectDetails/index.js @@ -1,220 +1,318 @@ -import { Header, MultiLink, Card, StatusTable, Row, CardSubHeader,Loader,SubmitBar,ActionBar, HorizontalNav, Menu, Toast } from '@egovernments/digit-ui-react-components' -import React, { Fragment,useEffect,useRef,useState } from 'react' -import { useTranslation } from 'react-i18next' -import { useHistory, useLocation } from 'react-router-dom' -import ProjectDetailsNavDetails from './ProjectDetailsNavDetails' +import { + MultiLink, + StatusTable, + Row, + CardSubHeader, + Menu, +} from "@egovernments/digit-ui-react-components"; +import { + Header, + Card, + Loader, + SubmitBar, + ActionBar, + HorizontalNav, + Toast, +} from "@egovernments/digit-ui-components-core"; +import React, { Fragment, useEffect, useRef, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { useHistory, useLocation } from "react-router-dom"; +import ProjectDetailsNavDetails from "./ProjectDetailsNavDetails"; const ProjectDetails = () => { - const { t } = useTranslation(); - const [activeLink, setActiveLink] = useState("Project_Details"); - const tenantId = Digit.ULBService.getCurrentTenantId(); - const queryStrings = Digit.Hooks.useQueryParams(); - const history = useHistory(); - const headerLocale = Digit.Utils.locale.getTransformedLocale(tenantId); - const [configNavItems, setNavTypeConfig] = useState([]); - const [subProjects, setSubProjects] = useState([]); - const menuRef = useRef(); - const [showActions, setShowActions] = useState(false); - const loggedInUserRoles = Digit.Utils.getLoggedInUserDetails("roles"); - const [hideActionBar, setHideActionBar] = useState(false); - const projectSession = Digit.Hooks.useSessionStorage("NEW_PROJECT_CREATE", {}); - const [sessionFormData, clearSessionFormData] = projectSession; - const location = useLocation(); - let isProjectModifier = false; - let isEstimateViewerAndCreator = false; - const [actionsMenu, setActionsMenu] = useState([]); - const [toast, setToast] = useState({show : false, label : "", error : false}); - const navConfigs = [ - { - "name":"Project_Details", - "code":"WORKS_PROJECT_DETAILS", - "active" : true - }, - { - "name":"Financial_Details", - "code":"WORKS_FINANCIAL_DETAILS", - "active" : true - }, - { - "name":"Sub_Projects_Details", - "code":"PROJECTS_SUB_PROJECT_DETAILS", - "active" : false - } - ]; - const searchParams = { - Projects : [ - { - tenantId : queryStrings?.tenantId || tenantId, - projectNumber : queryStrings?.projectNumber - } - ] - } - const filters = { - limit : 11, - offset : 0, - includeAncestors : true, - includeDescendants : true - } + const { t } = useTranslation(); + const [activeLink, setActiveLink] = useState("Project_Details"); + const tenantId = Digit.ULBService.getCurrentTenantId(); + const queryStrings = Digit.Hooks.useQueryParams(); + const history = useHistory(); + const headerLocale = Digit.Utils.locale.getTransformedLocale(tenantId); + const [configNavItems, setNavTypeConfig] = useState([]); + const [subProjects, setSubProjects] = useState([]); + const menuRef = useRef(); + const [showActions, setShowActions] = useState(false); + const loggedInUserRoles = Digit.Utils.getLoggedInUserDetails("roles"); + const [hideActionBar, setHideActionBar] = useState(false); + const projectSession = Digit.Hooks.useSessionStorage( + "NEW_PROJECT_CREATE", + {} + ); + const [sessionFormData, clearSessionFormData] = projectSession; + const location = useLocation(); + let isProjectModifier = false; + let isEstimateViewerAndCreator = false; + const [actionsMenu, setActionsMenu] = useState([]); + const [toast, setToast] = useState({ show: false, label: "", error: false }); + const navConfigs = [ + { + name: "Project_Details", + code: "WORKS_PROJECT_DETAILS", + active: true, + }, + { + name: "Financial_Details", + code: "WORKS_FINANCIAL_DETAILS", + active: true, + }, + { + name: "Sub_Projects_Details", + code: "PROJECTS_SUB_PROJECT_DETAILS", + active: false, + }, + ]; + const searchParams = { + Projects: [ + { + tenantId: queryStrings?.tenantId || tenantId, + projectNumber: queryStrings?.projectNumber, + }, + ], + }; + const filters = { + limit: 11, + offset: 0, + includeAncestors: true, + includeDescendants: true, + }; - const closeMenu = () => { - setShowActions(false); - } + const closeMenu = () => { + setShowActions(false); + }; - Digit.Hooks.useClickOutside(menuRef, closeMenu, showActions ); + Digit.Hooks.useClickOutside(menuRef, closeMenu, showActions); - const handleParentProjectSearch = (parentProjectNumber) => { - history.push(`/${window.contextPath}/employee/project/project-details?tenantId=${searchParams?.Projects?.[0]?.tenantId}&projectNumber=${parentProjectNumber}`); - } + const handleParentProjectSearch = (parentProjectNumber) => { + history.push( + `/${window.contextPath}/employee/project/project-details?tenantId=${searchParams?.Projects?.[0]?.tenantId}&projectNumber=${parentProjectNumber}` + ); + }; - const handleActionBar = (option) => { - if(option?.name === "CREATE_ESTIMATE"){ - history.push(`/${window.contextPath}/employee/estimate/create-detailed-estimate?tenantId=${searchParams?.Projects?.[0]?.tenantId}&projectNumber=${searchParams?.Projects?.[0]?.projectNumber}`); - } - if(option?.name === "VIEW_ESTIMATE"){ - history.push(`/${window.contextPath}/employee/estimate/estimate-details?tenantId=${searchParams?.Projects?.[0]?.tenantId}&estimateNumber=${estimates?.[0]?.estimateNumber}`); - } - if(option?.name === "MODIFY_PROJECT"){ - if(estimates?.length !==0 && estimates?.[0]?.wfStatus !== "" && estimates?.[0]?.wfStatus !== "REJECTED") { - setToast({show : true, label : t("COMMON_CANNOT_MODIFY_PROJECT_EST_CREATED"), error : true}); - }else { - // history.push(`/${window.contextPath}/employee/project/modify-project?tenantId=${searchParams?.Projects?.[0]?.tenantId}&projectNumber=${searchParams?.Projects?.[0]?.projectNumber}`); - history.push({ - pathname : `/${window.contextPath}/employee/project/create-project`, - search : `?tenantId=${searchParams?.Projects?.[0]?.tenantId}&projectNumber=${searchParams?.Projects?.[0]?.projectNumber}`, - }) - } - } + const handleActionBar = (option) => { + if (option?.name === "CREATE_ESTIMATE") { + history.push( + `/${window.contextPath}/employee/estimate/create-detailed-estimate?tenantId=${searchParams?.Projects?.[0]?.tenantId}&projectNumber=${searchParams?.Projects?.[0]?.projectNumber}` + ); } - - const handleToastClose = () => { - setToast({show : false, label : "", error : false}); + if (option?.name === "VIEW_ESTIMATE") { + history.push( + `/${window.contextPath}/employee/estimate/estimate-details?tenantId=${searchParams?.Projects?.[0]?.tenantId}&estimateNumber=${estimates?.[0]?.estimateNumber}` + ); } - - const HandleDownloadPdf = () => { - const projectId=searchParams?.Projects?.[0]?.projectNumber; - Digit.Utils.downloadEgovPDF('project/project-details',{projectId,tenantId:searchParams?.Projects?.[0]?.tenantId},`Project-${projectId}.pdf`) + if (option?.name === "MODIFY_PROJECT") { + if ( + estimates?.length !== 0 && + estimates?.[0]?.wfStatus !== "" && + estimates?.[0]?.wfStatus !== "REJECTED" + ) { + setToast({ + show: true, + label: t("COMMON_CANNOT_MODIFY_PROJECT_EST_CREATED"), + error: true, + }); + } else { + // history.push(`/${window.contextPath}/employee/project/modify-project?tenantId=${searchParams?.Projects?.[0]?.tenantId}&projectNumber=${searchParams?.Projects?.[0]?.projectNumber}`); + history.push({ + pathname: `/${window.contextPath}/employee/project/create-project`, + search: `?tenantId=${searchParams?.Projects?.[0]?.tenantId}&projectNumber=${searchParams?.Projects?.[0]?.projectNumber}`, + }); + } } + }; - const { data } = Digit.Hooks.works.useViewProjectDetails(t, tenantId, searchParams, filters, headerLocale); + const handleToastClose = () => { + setToast({ show: false, label: "", error: false }); + }; - //fetch estimate details - const { data : estimates, isError : isEstimateSearchError,isLoading:estimateLoading } = Digit.Hooks.works.useSearchEstimate( tenantId, {limit : 1, offset : 0, projectId : data?.projectDetails?.searchedProject?.basicDetails?.uuid }); - + const HandleDownloadPdf = () => { + const projectId = searchParams?.Projects?.[0]?.projectNumber; + Digit.Utils.downloadEgovPDF( + "project/project-details", + { projectId, tenantId: searchParams?.Projects?.[0]?.tenantId }, + `Project-${projectId}.pdf` + ); + }; - useEffect(()=>{ - const projectModifierRoles = ["PROJECT_CREATOR"]; - isProjectModifier = projectModifierRoles?.some(role=>loggedInUserRoles?.includes(role)); - },[loggedInUserRoles]); + const { data } = Digit.Hooks.works.useViewProjectDetails( + t, + tenantId, + searchParams, + filters, + headerLocale + ); - useEffect(()=>{ - const estimateViewerAndCreatorRole = ["ESTIMATE_CREATOR", "ESTIMATE_VERIFIER", "TECHNICAL_SANCTIONER", "ESTIMATE_APPROVER"]; - isEstimateViewerAndCreator = estimateViewerAndCreatorRole?.some(role=>loggedInUserRoles?.includes(role)); - },[loggedInUserRoles]); + //fetch estimate details + const { + data: estimates, + isError: isEstimateSearchError, + isLoading: estimateLoading, + } = Digit.Hooks.works.useSearchEstimate(tenantId, { + limit: 1, + offset: 0, + projectId: data?.projectDetails?.searchedProject?.basicDetails?.uuid, + }); - const setUniqueActions = (objToSet) => { - const set = actionsMenu.filter(row => row.name === objToSet.name).length === 0 - if(set){ - setActionsMenu((prev)=>[...prev, objToSet]) - } + useEffect(() => { + const projectModifierRoles = ["PROJECT_CREATOR"]; + isProjectModifier = projectModifierRoles?.some((role) => + loggedInUserRoles?.includes(role) + ); + }, [loggedInUserRoles]); + + useEffect(() => { + const estimateViewerAndCreatorRole = [ + "ESTIMATE_CREATOR", + "ESTIMATE_VERIFIER", + "TECHNICAL_SANCTIONER", + "ESTIMATE_APPROVER", + ]; + isEstimateViewerAndCreator = estimateViewerAndCreatorRole?.some((role) => + loggedInUserRoles?.includes(role) + ); + }, [loggedInUserRoles]); + + const setUniqueActions = (objToSet) => { + const set = + actionsMenu.filter((row) => row.name === objToSet.name).length === 0; + if (set) { + setActionsMenu((prev) => [...prev, objToSet]); } + }; - useEffect(()=>{ - let isUserEstimateCreator = loggedInUserRoles?.includes("ESTIMATE_CREATOR"); - if(isEstimateSearchError && isEstimateViewerAndCreator) { - setToast({show : true, label : t("COMMON_ERROR_FETCHING_ESTIMATE_DETAILS"), error : true}); - setHideActionBar(true); - }else { - if((estimates?.length === 0 || estimates?.[0]?.wfStatus === "" || estimates?.[0]?.wfStatus === "REJECTED")) { - if(isUserEstimateCreator) { - setHideActionBar(false); - setUniqueActions({ - name : "CREATE_ESTIMATE" - }) - }else { - // setHideActionBar(true); - } - }else if(isProjectModifier || isEstimateViewerAndCreator){ - //we have given search estimate access to project creator - setHideActionBar(false); - estimates && estimates?.length !== 0 && setUniqueActions({ - name : "VIEW_ESTIMATE" - }) - } - if(isProjectModifier) { - setHideActionBar(false); - setUniqueActions({ - name : "MODIFY_PROJECT" - }) - } + useEffect(() => { + let isUserEstimateCreator = loggedInUserRoles?.includes("ESTIMATE_CREATOR"); + if (isEstimateSearchError && isEstimateViewerAndCreator) { + setToast({ + show: true, + label: t("COMMON_ERROR_FETCHING_ESTIMATE_DETAILS"), + error: true, + }); + setHideActionBar(true); + } else { + if ( + estimates?.length === 0 || + estimates?.[0]?.wfStatus === "" || + estimates?.[0]?.wfStatus === "REJECTED" + ) { + if (isUserEstimateCreator) { + setHideActionBar(false); + setUniqueActions({ + name: "CREATE_ESTIMATE", + }); + } else { + // setHideActionBar(true); } - },[estimates, isEstimateSearchError,estimateLoading]); - - //remove Toast after 3s - useEffect(()=>{ - if(toast?.show) { - setTimeout(()=>{ - handleToastClose(); - },3000); - } - },[toast?.show]) - - //update config for Nav once we get the data - useEffect(()=>{ - if(data?.projectDetails?.subProjects?.length > 0) { - navConfigs[2].active = true; - setSubProjects(data?.projectDetails?.subProjects); - }else{ - navConfigs[2].active = false; - } - let filterdNavConfig = navConfigs.filter((config)=>config.active === true); - setNavTypeConfig(filterdNavConfig); - },[data]); - - //remove session form data if user navigates away from the project create screen - useEffect(()=>{ - if (!window.location.href.includes("create-project") && sessionFormData && Object.keys(sessionFormData) != 0) { - clearSessionFormData(); - } - },[location]); - - return ( -
-
-
{t("WORKS_PROJECT_DETAILS")}
- HandleDownloadPdf()} - downloadBtnClassName={"employee-download-btn-className"} - label={t("CS_COMMON_DOWNLOAD")} + } else if (isProjectModifier || isEstimateViewerAndCreator) { + //we have given search estimate access to project creator + setHideActionBar(false); + estimates && + estimates?.length !== 0 && + setUniqueActions({ + name: "VIEW_ESTIMATE", + }); + } + if (isProjectModifier) { + setHideActionBar(false); + setUniqueActions({ + name: "MODIFY_PROJECT", + }); + } + } + }, [estimates, isEstimateSearchError, estimateLoading]); + + //remove Toast after 3s + useEffect(() => { + if (toast?.show) { + setTimeout(() => { + handleToastClose(); + }, 3000); + } + }, [toast?.show]); + + //update config for Nav once we get the data + useEffect(() => { + if (data?.projectDetails?.subProjects?.length > 0) { + navConfigs[2].active = true; + setSubProjects(data?.projectDetails?.subProjects); + } else { + navConfigs[2].active = false; + } + let filterdNavConfig = navConfigs.filter( + (config) => config.active === true + ); + setNavTypeConfig(filterdNavConfig); + }, [data]); + + //remove session form data if user navigates away from the project create screen + useEffect(() => { + if ( + !window.location.href.includes("create-project") && + sessionFormData && + Object.keys(sessionFormData) != 0 + ) { + clearSessionFormData(); + } + }, [location]); + + return ( +
+
+
+ {t("WORKS_PROJECT_DETAILS")} +
+ HandleDownloadPdf()} + downloadBtnClassName={"employee-download-btn-className"} + label={t("CS_COMMON_DOWNLOAD")} + /> +
+ + + + + {!hideActionBar && ( + + {showActions ? ( + -
- - - - - - { - !hideActionBar && - - {showActions ? - : null - } - setShowActions(!showActions)}/> - - } - {toast?.show && } -
- ) -} - -export default ProjectDetails; \ No newline at end of file + ) : null} + setShowActions(!showActions)} + /> + + )} + {toast?.show && ( + + )} +
+ ); +}; + +export default ProjectDetails; diff --git a/react/modules/Project/src/pages/employee/ProjectSearch/index.js b/react/modules/Project/src/pages/employee/ProjectSearch/index.js index 0587b407884..37b9075c59a 100644 --- a/react/modules/Project/src/pages/employee/ProjectSearch/index.js +++ b/react/modules/Project/src/pages/employee/ProjectSearch/index.js @@ -1,6 +1,7 @@ import React, { useEffect, useMemo } from "react"; import { useTranslation } from "react-i18next"; -import { Header, InboxSearchComposer, Loader, Button, AddFilled } from "@egovernments/digit-ui-react-components"; +import {InboxSearchComposer, Loader, Button ,AddFilled} from "@egovernments/digit-ui-components-core"; +import { Header } from "@egovernments/digit-ui-react-components"; import { useHistory, useLocation } from "react-router-dom"; import searchConfigMUKTA from "../../../configs/searchConfigMUKTA"; diff --git a/react/modules/Project/src/pages/employee/ProjectSearchAndInbox/index.js b/react/modules/Project/src/pages/employee/ProjectSearchAndInbox/index.js index dc109e9bbb3..e9fe187f44f 100644 --- a/react/modules/Project/src/pages/employee/ProjectSearchAndInbox/index.js +++ b/react/modules/Project/src/pages/employee/ProjectSearchAndInbox/index.js @@ -1,7 +1,6 @@ import React from "react"; import { useTranslation } from "react-i18next"; import { Header, Loader,InboxSearchComposer} from "@egovernments/digit-ui-components-core"; -// import { InboxSearchComposer } from "@egovernments/digit-ui-react-components"; import inboxConfig from "../../../configs/InboxConfig"; const ProjectSearchAndInboxComponent = () => { diff --git a/react/modules/Project/src/pages/employee/ProjectWMSSearch/index.js b/react/modules/Project/src/pages/employee/ProjectWMSSearch/index.js index a09308fc209..7702853584a 100644 --- a/react/modules/Project/src/pages/employee/ProjectWMSSearch/index.js +++ b/react/modules/Project/src/pages/employee/ProjectWMSSearch/index.js @@ -1,11 +1,9 @@ import React, { useEffect, useMemo } from "react"; import { useTranslation } from "react-i18next"; -import { Header, Loader } from "@egovernments/digit-ui-react-components"; -import { InboxSearchComposer } from "@egovernments/digit-ui-components-core"; -import {Button} from "@egovernments/digit-ui-components-core"; +import { Button, Loader ,InboxSearchComposer } from "@egovernments/digit-ui-components-core"; +import { Header } from "@egovernments/digit-ui-react-components"; import { useHistory, useLocation } from "react-router-dom"; import searchWMSProjectConfig from "../../../configs/searchWMSProjectConfig"; -// import { InboxSearchComposer } from "@egovernments/digit-ui-react-components"; const ProjectWMSSearch = () => { const { t } = useTranslation(); diff --git a/react/modules/Project/src/pages/employee/index.js b/react/modules/Project/src/pages/employee/index.js index 9c084ef9784..175d8f141b3 100644 --- a/react/modules/Project/src/pages/employee/index.js +++ b/react/modules/Project/src/pages/employee/index.js @@ -1,7 +1,7 @@ import React, { useEffect } from "react"; import { Switch, useLocation } from "react-router-dom"; import { useTranslation } from "react-i18next"; -import { PrivateRoute, AppContainer, BreadCrumb } from "@egovernments/digit-ui-react-components"; +import { PrivateRoute, AppContainer,BreadCrumb } from "@egovernments/digit-ui-components-core"; import WorkflowCompTest from "./WorkflowCompTest"; // import SampleComp from "./SampleComp"; const ProjectBreadCrumb = ({ location }) => { diff --git a/react/modules/core/README.md b/react/modules/core/README.md index 6388cb7f4f1..9e5caf45793 100644 --- a/react/modules/core/README.md +++ b/react/modules/core/README.md @@ -1,4 +1,4 @@ - + # digit-ui-module-core @@ -61,10 +61,40 @@ with .filter((opt) => (opt?.hasOwnProperty("active") ? opt.active : true)) ``` + * Digit.Hooks.Utils.getDefaultLanguage() + +``` +from 1.8.0 beta version add the following utility method in micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js -# Changelog +const getDefaultLanguage = () => { + return `${getLocaleDefault()}_${getLocaleRegion()}`; +}; + +and add its related functions + +``` + + +### Changelog ```bash +1.8.1-beta.6 Resolved duplicacy issue in the Sidebar +1.8.1-beta.5 Fixed Sidebar Path issue +1.8.1-beta.4 Added a null check for homescreen landing issue +1.8.1-beta.3 User profile back button fixes for mobile view +1.8.1-beta.2 User profile Save and change password button fixes for mobile view +1.8.1-beta.1 Republished after merging with Master due to version issues. +1.8.0-beta.16 fixed the hardcoded logout message +1.8.0-beta.15 fixed the sidebar sort order issue +1.8.0-beta.14 +1.8.0-beta.13 +1.8.0-beta.12 +1.8.0-beta.11 republished due to some version issues +1.8.0-beta.10 Constants updated for mgramsewa +1.8.0-beta.9 Updated How It works screen to take header from mdms config and show pdf card only when required +1.8.0-beta.8 redefine addtional component to render only under employee home page +1.8.0-beta.6 added addtional component render for tqm modules +1.8.0 workbench v1.0 1.8.0-beta.5 fix for login screen alignments 1.8.0-beta.4 made the default localisation in globalconfig 1.8.0-beta workbench base version beta release @@ -91,14 +121,21 @@ with 1.5.28 fixed the route issue for profile screen ``` -# Contributors +### Contributors [jagankumar-egov] [nipunarora-eGov] [Tulika-eGov] [Ramkrishna-egov] [nabeelmd-eGov] [anil-egov] [vamshikrishnakole-wtt-egov] -## Published from DIGIT Core +## Documentation + +Documentation Site (https://core.digit.org/guides/developer-guide/ui-developer-guide/digit-ui) + +## Maintainer + +- [jagankumar-egov](https://www.github.com/jagankumar-egov) + -Digit Dev Repo () +### Published from DIGIT Frontend +DIGIT Frontend Repo (https://github.com/egovernments/Digit-Frontend/tree/develop) -## License -MIT © [jagankumar-egov](https://github.com/jagankumar-egov) +![Logo](https://s3.ap-south-1.amazonaws.com/works-dev-asset/mseva-white-logo.png) diff --git a/react/modules/core/package.json b/react/modules/core/package.json index 4ba0c212a0f..33627f4cc51 100644 --- a/react/modules/core/package.json +++ b/react/modules/core/package.json @@ -1,6 +1,6 @@ { "name": "@egovernments/digit-ui-module-core", - "version": "1.7.10", + "version": "1.8.1-beta.6", "license": "MIT", "main": "dist/index.js", "module": "dist/index.modern.js", @@ -15,7 +15,7 @@ }, "dependencies": { "@egovernments/digit-ui-components-core": "^0.0.1", - "@egovernments/digit-ui-react-components": "1.7.10", + "@egovernments/digit-ui-react-components": "1.8.1-beta.4", "react": "17.0.2", "react-dom": "17.0.2", "react-i18next": "11.16.2", diff --git a/react/modules/core/src/Module.js b/react/modules/core/src/Module.js index 9c775c3ee97..169eb52483e 100644 --- a/react/modules/core/src/Module.js +++ b/react/modules/core/src/Module.js @@ -1,4 +1,4 @@ -import { Body } from "@egovernments/digit-ui-react-components"; +import { BodyContainer } from "@egovernments/digit-ui-components-core"; import { Loader } from "@egovernments/digit-ui-components-core"; import React from "react"; import { getI18n } from "react-i18next"; @@ -7,7 +7,8 @@ import { Provider } from "react-redux"; import { BrowserRouter as Router } from "react-router-dom"; import { DigitApp } from "./App"; import SelectOtp from "./pages/citizen/Login/SelectOtp"; - +import ChangeCity from "./components/ChangeCity"; +import ChangeLanguage from "./components/ChangeLanguage"; import { useState } from "react"; import ErrorBoundary from "./components/ErrorBoundaries"; import getStore from "./redux/store"; @@ -22,7 +23,7 @@ const DigitUIWrapper = ({ stateCode, enabledModules, moduleReducers, defaultLand return ( - + - + ); @@ -110,6 +111,8 @@ export const DigitUI = ({ stateCode, registry, enabledModules, moduleReducers, d const componentsToRegister = { SelectOtp, + ChangeCity, + ChangeLanguage }; export const initCoreComponents = () => { diff --git a/react/modules/core/src/components/AppModules.js b/react/modules/core/src/components/AppModules.js index cce867f3836..423c61d2689 100644 --- a/react/modules/core/src/components/AppModules.js +++ b/react/modules/core/src/components/AppModules.js @@ -9,7 +9,7 @@ const getTenants = (codes, tenants) => { return tenants.filter((tenant) => codes?.map?.((item) => item.code).includes(tenant.code)); }; -export const AppModules = ({ stateCode, userType, modules, appTenants }) => { +export const AppModules = ({ stateCode, userType, modules, appTenants, additionalComponent }) => { const ComponentProvider = Digit.Contexts.ComponentProvider; const { path } = useRouteMatch(); const location = useLocation(); @@ -49,7 +49,7 @@ export const AppModules = ({ stateCode, userType, modules, appTenants }) => { - + {/* */} diff --git a/react/modules/core/src/components/Dialog/LogoutDialog.js b/react/modules/core/src/components/Dialog/LogoutDialog.js index 4b180caed36..e1176b6c7c2 100644 --- a/react/modules/core/src/components/Dialog/LogoutDialog.js +++ b/react/modules/core/src/components/Dialog/LogoutDialog.js @@ -104,7 +104,7 @@ const LogoutDialog = ({ onSelect, onCancel, onDismiss }) => {
{t("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE") + " "} - {t("CORE_LOGOUT_MESSAGE")}? + {t("CORE_LOGOUT_MESSAGE")}
diff --git a/react/modules/core/src/components/Home.js b/react/modules/core/src/components/Home.js index 3bec68c11b5..2d79c29ad74 100644 --- a/react/modules/core/src/components/Home.js +++ b/react/modules/core/src/components/Home.js @@ -1,6 +1,14 @@ -import { BackButton, CitizenHomeCard, CitizenInfoLabel, Loader } from "@egovernments/digit-ui-components-core"; -import { BillsIcon, FSMIcon, MCollectIcon, OBPSIcon, PGRIcon, PTIcon, TLIcon, WSICon } from "@egovernments/digit-ui-react-components"; -import React from "react"; +import { + BackButton, + CitizenHomeCard, + CitizenInfoLabel, + Loader, + FSMIcon, + MCollectIcon, + BillsIcon +} from "@egovernments/digit-ui-components-core"; + +import React, { Fragment } from "react"; import { useTranslation } from "react-i18next"; /* @@ -67,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]; @@ -79,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" @@ -98,7 +120,9 @@ const CitizenHome = ({ modules, getCitizenMenu, fetchedCitizen, isLoading }) => ) : null @@ -114,22 +138,56 @@ const CitizenHome = ({ modules, getCitizenMenu, fetchedCitizen, isLoading }) => ); }; -const EmployeeHome = ({ modules }) => { +const EmployeeHome = ({ modules, additionalComponent }) => { return ( -
-
- {modules.map(({ code }, index) => { - const Card = Digit.ComponentRegistryService.getComponent(`${code}Card`) || (() => ); - return ; - })} + <> +
+
+ {modules.map(({ code }, index) => { + const Card = + Digit.ComponentRegistryService.getComponent(`${code}Card`) || + (() => ); + return ; + })} +
-
+ + {additionalComponent && + additionalComponent?.length > 0 && + additionalComponent.map((i) => { + const Component = + typeof i === "string" + ? Digit.ComponentRegistryService.getComponent(i) + : null; + return Component ? ( +
+ +
+ ) : null; + })} + ); }; -export const AppHome = ({ userType, modules, getCitizenMenu, fetchedCitizen, isLoading }) => { +export const AppHome = ({ + userType, + modules, + getCitizenMenu, + fetchedCitizen, + isLoading, + additionalComponent, +}) => { if (userType === "citizen") { - return ; + return ( + + ); } - return ; + return ( + + ); }; diff --git a/react/modules/core/src/components/Search/MobileSearchApplication.js b/react/modules/core/src/components/Search/MobileSearchApplication.js index 45f32bd5362..1e021444ffb 100644 --- a/react/modules/core/src/components/Search/MobileSearchApplication.js +++ b/react/modules/core/src/components/Search/MobileSearchApplication.js @@ -1,10 +1,37 @@ -import { CloseSvg, DownloadBtnCommon } from "@egovernments/digit-ui-react-components"; -import { BackButton, DetailsCard, Header, Loader, PopUp, SearchAction, SearchForm } from "@egovernments/digit-ui-components-core"; -import React, { useCallback, useEffect, useMemo, useReducer, useState } from "react"; +import { + BackButton, + DetailsCard, + Header, + Loader, + PopUp, + SearchAction, + SearchForm, + CloseSvg, + DownloadBtnCommon, +} from "@egovernments/digit-ui-components-core"; +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": @@ -33,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, }; @@ -70,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": @@ -93,7 +145,10 @@ const MobileSearchApplication = ({ Controller, register, control, t, reset, prev

{t("PRIVACY_AUDIT_REPORT")}:

- + {/*

{t(`ES_COMMON_CLEAR_ALL`)}

@@ -105,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 = []; @@ -135,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 }} />
@@ -156,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/react/modules/core/src/components/Search/SearchFields.js b/react/modules/core/src/components/Search/SearchFields.js index b35d5b5ae6a..07ca41bacb1 100644 --- a/react/modules/core/src/components/Search/SearchFields.js +++ b/react/modules/core/src/components/Search/SearchFields.js @@ -1,7 +1,6 @@ -import { DatePicker, SubmitBar, SearchField, Button } from "@egovernments/digit-ui-components-core"; +import { DatePicker, SearchField, Button } from "@egovernments/digit-ui-components-core"; import React from "react"; import { Controller } from "react-hook-form"; - const SearchFields = ({ register, control, reset, tenantId, t, previousPage, formState, isLoading }) => { const isMobile = window.Digit.Utils.browser.isMobile(); diff --git a/react/modules/core/src/components/Search/index.js b/react/modules/core/src/components/Search/index.js index 1c3a51bfaf7..3776742febd 100644 --- a/react/modules/core/src/components/Search/index.js +++ b/react/modules/core/src/components/Search/index.js @@ -1,17 +1,34 @@ +import { + DownloadBtnCommon, + Table, +} from "@egovernments/digit-ui-react-components"; +import { + BackButton, + Loader, + SearchForm, + Header +} from "@egovernments/digit-ui-components-core"; import React, { useCallback, useEffect, useMemo, useState } from "react"; -import { BackButton, Loader, Header, SearchForm, SVG } from "@egovernments/digit-ui-components-core"; import { Controller, useForm } from "react-hook-form"; import MobileSearchApplication from "./MobileSearchApplication"; import SearchFields from "./SearchFields"; -import { Table } from "@egovernments/digit-ui-react-components"; const SearchApplication = ({ tenantId, t, onSubmit, data, count }) => { - 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) => { @@ -43,7 +60,7 @@ const SearchApplication = ({ tenantId, t, onSubmit, data, count }) => { const DownloadBtn = (props) => { return (
- +
); }; @@ -62,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, }; @@ -96,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 @@ -107,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}`); }, }, @@ -115,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}`); @@ -154,12 +203,33 @@ const SearchApplication = ({ tenantId, t, onSubmit, data, count }) => { {" "}
{t("PRIVACY_AUDIT_REPORT")}
{" "}
- - + + -
+
{data?.display ? ( -
+
{t(data.display) .split("\\n") .map((text, index) => ( @@ -169,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", }, @@ -195,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/react/modules/core/src/components/TopBarSideBar/SideBar/CitizenSideBar.js b/react/modules/core/src/components/TopBarSideBar/SideBar/CitizenSideBar.js index 1caafded694..7a3da7e8738 100644 --- a/react/modules/core/src/components/TopBarSideBar/SideBar/CitizenSideBar.js +++ b/react/modules/core/src/components/TopBarSideBar/SideBar/CitizenSideBar.js @@ -1,5 +1,5 @@ -import { Loader } from "@egovernments/digit-ui-components-core"; import { NavBar } from "@egovernments/digit-ui-react-components"; +import { Loader } from "@egovernments/digit-ui-components-core"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { useHistory } from "react-router-dom"; @@ -8,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]; @@ -24,6 +27,11 @@ const Profile = ({ info, stateName, t }) => { } } }, [profilePic !== null]); + + const CustomEmployeeTopBar = Digit.ComponentRegistryService?.getComponent( + "CustomEmployeeTopBar" + ); + return (
@@ -47,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") && } + !window.location.href.includes("employee/user/language-selection") && + !CustomEmployeeTopBar && }
); }; @@ -58,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(); }} />{" "}
@@ -67,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(); @@ -83,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(); }; @@ -97,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, @@ -128,16 +153,22 @@ export const CitizenSideBar = ({ isOpen, isMobile = false, toggleSidebar, onLogo {storeData?.tenants.map((i) => { i.code === tenantId ? ( ) : ( ); })} @@ -156,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, @@ -175,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]) { @@ -187,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, { @@ -208,23 +252,30 @@ export const CitizenSideBar = ({ isOpen, isMobile = false, toggleSidebar, onLogo type: "dynamic", moduleName: t(`ACTION_TEST_${getParentDisplayName}`), links: configEmployeeSideBar[keys[i]]?.map((ob) => { - return { ...ob, displayName: t(`ACTION_TEST_${ob?.displayName?.toUpperCase()?.replace(/[ -]/g, "_")}`) }; + 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/react/modules/core/src/components/TopBarSideBar/SideBar/EmployeeSideBar.js b/react/modules/core/src/components/TopBarSideBar/SideBar/EmployeeSideBar.js index 08aae7c6819..4f9effa961b 100644 --- a/react/modules/core/src/components/TopBarSideBar/SideBar/EmployeeSideBar.js +++ b/react/modules/core/src/components/TopBarSideBar/SideBar/EmployeeSideBar.js @@ -1,8 +1,7 @@ import React, { useRef, useEffect, useState } from "react"; -import { SearchIcon } from "@egovernments/digit-ui-react-components"; +import { Loader,SearchIcon } from "@egovernments/digit-ui-components-core"; import { useTranslation } from "react-i18next"; import Sidebar from "./SideBar"; -import { Loader } from "@egovernments/digit-ui-components-core"; const checkMatch = (path = "", searchCriteria = "") => path.toLowerCase().includes(searchCriteria.toLowerCase()); @@ -41,12 +40,7 @@ const EmployeeSideBar = () => { } mergeObjects(obj1[key], obj2[key]); } else { - if (obj1[key]) { - if (!Array.isArray(obj1[key])) { - obj1[key] = [obj1[key]]; - } - obj1[key].push(obj2[key]); - } else { + if (!obj1[key]) { obj1[key] = obj2[key]; } } @@ -97,14 +91,18 @@ const EmployeeSideBar = () => { const objectArray = Object.entries(configEmployeeSideBar); // Sort the array based on the 'orderNumber' or the length of the object if 'orderNumber' is not present + // sort logic updated to sort the parent item by alphabetical objectArray.sort((a, b) => { - const orderNumberA = a[1].item - ? a[1].item.orderNumber || Object.keys(configEmployeeSideBar).length + 1 - : Object.keys(configEmployeeSideBar).length + 1; - const orderNumberB = b[1].item - ? b[1].item.orderNumber || Object.keys(configEmployeeSideBar).length + 1 - : Object.keys(configEmployeeSideBar).length + 1; - return orderNumberA - orderNumberB; + if (a[0] < b[0]) { return -1; } + if (a[0] > b[0]) { return 1; } + return 0; + // const orderNumberA = a[1].item + // ? a[1].item.orderNumber || Object.keys(configEmployeeSideBar).length + 1 + // : Object.keys(configEmployeeSideBar).length + 1; + // const orderNumberB = b[1].item + // ? b[1].item.orderNumber || Object.keys(configEmployeeSideBar).length + 1 + // : Object.keys(configEmployeeSideBar).length + 1; + // return orderNumberA - orderNumberB; }); const sortedObject = Object.fromEntries(objectArray); configEmployeeSideBar = sortedObject; diff --git a/react/modules/core/src/components/TopBarSideBar/SideBar/SideBar.js b/react/modules/core/src/components/TopBarSideBar/SideBar/SideBar.js index d8cb6446e5e..ec7d62824e9 100644 --- a/react/modules/core/src/components/TopBarSideBar/SideBar/SideBar.js +++ b/react/modules/core/src/components/TopBarSideBar/SideBar/SideBar.js @@ -6,29 +6,75 @@ 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-core"; 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"]; +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 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) + ); + } + return null; // or return some default value if neither condition is met + }); + // Return the first element of the array (the key) + return key?.[0]; +}; + +// Function to find the last key in a dot-separated key string +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]; +}; + /* 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); @@ -100,24 +146,63 @@ 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) => { + if (x?.item && y?.item) { + return x?.item?.orderNumber - y?.item?.orderNumber; + } else { + if (x?.[0] < y?.[0]) { + return -1; + } + if (x?.[0] > y?.[0]) { + return 1; + } + return 0; + } + }) + .map( + (x) => + (x?.item?.path && findKey(x?.item?.path)) || findKey(getKey(x)?.[0]) + ); + return (
- {Object.keys(items).map((key, index) => { + {keysArray.map((key, index) => { const subItems = items[key]; - const subItemKeys = Object.keys(subItems)[0] === "item"; + 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 { leftIconArray, isDynamic } = extractLeftIcon(subItems) || {}; - let leftIcon = IconsObject[leftIconArray] || IconsObject.collections; + const { leftIconArray, isDynamic } = + extractLeftIcon(subItems) || {}; + let leftIcon = + IconsObject[leftIconArray] || IconsObject.collections; if (isDynamic === "dynamic") { - var IconComp = require("@egovernments/digit-ui-react-components")?.[leftIconArray]; + var IconComp = require("@egovernments/digit-ui-react-components")?.[ + leftIconArray + ]; leftIcon = IconComp ? : leftIcon; } const isParentActive = selectedParent === itemKey; @@ -126,28 +211,37 @@ const Sidebar = ({ data }) => { return (
{ toggleSidebar(key); - setSelectedParent((prevItem)=> { - if(prevItem===itemKey ){ - return null - } - else return itemKey - + setSelectedParent((prevItem) => { + if (prevItem === itemKey) { + return null; + } else return itemKey; }); - const itemToHighlight = e.target.innerText - setSelectedChildLevelOne((prevItem)=>{ - if(prevItem===itemToHighlight || isSubItemOpen){ - return null - } - else return itemToHighlight + const itemToHighlight = e.target.innerText; + setSelectedChildLevelOne((prevItem) => { + if (prevItem === itemToHighlight || isSubItemOpen) { + return null; + } else return itemToHighlight; }); setSelectedChild(null); // setOpenItems(prevState => { @@ -158,57 +252,108 @@ 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 { leftIconArray, isDynamic } = extractLeftIcon(subItems) || {}; - let leftIcon = IconsObject[leftIconArray] || IconsObject.collections; + const { leftIconArray, isDynamic } = + extractLeftIcon(subItems) || {}; + let leftIcon = + IconsObject[leftIconArray] || IconsObject.collections; if (isDynamic === "dynamic") { - var IconComp = require("@egovernments/digit-ui-react-components")?.[leftIconArray]; + var IconComp = require("@egovernments/digit-ui-react-components")?.[ + leftIconArray + ]; leftIcon = IconComp ? : leftIcon; } const isChildActive = selectedChild === subItems.item.path; 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}` + ) + )} )}
@@ -221,7 +366,11 @@ const Sidebar = ({ data }) => { }; return ( -
+
{renderSidebarItems(data)}
); diff --git a/react/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js b/react/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js index 469f5e17040..fd5254ecb53 100644 --- a/react/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js +++ b/react/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js @@ -1,5 +1,4 @@ import React, { useEffect, useState } from "react"; -import { Loader } from "@egovernments/digit-ui-components-core"; import { HomeIcon, EditPencilIcon, @@ -18,7 +17,8 @@ import { BirthIcon, DeathIcon, FirenocIcon, -} from "@egovernments/digit-ui-react-components"; + Loader +} from "@egovernments/digit-ui-components-core"; import { Link, useLocation } from "react-router-dom"; import SideBarMenu from "../../../config/sidebar-menu"; import { useTranslation } from "react-i18next"; @@ -33,7 +33,10 @@ Feature :: Citizen Webview sidebar const Profile = ({ info, stateName, t }) => (
- +
{info?.name}
@@ -49,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 = { @@ -109,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; @@ -149,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, @@ -175,16 +186,22 @@ const StaticCitizenSideBar = ({ linkData, islinkDataLoading }) => { {storeData?.tenants.map((i) => { i.code === tenantId ? (
) : ( ); })}
@@ -199,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, @@ -231,13 +252,28 @@ const StaticCitizenSideBar = ({ linkData, islinkDataLoading }) => { {profileItem}
{menuItems?.map((item, index) => ( -
+
))}
-
{showDialog && }
+
+ {showDialog && ( + + )} +
); diff --git a/react/modules/core/src/components/TopBarSideBar/SideBar/SubMenu.js b/react/modules/core/src/components/TopBarSideBar/SideBar/SubMenu.js index 542e92484ae..1aa87463178 100644 --- a/react/modules/core/src/components/TopBarSideBar/SideBar/SubMenu.js +++ b/react/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-core"; import { useTranslation } from "react-i18next"; import ReactTooltip from "react-tooltip"; diff --git a/react/modules/core/src/components/TopBarSideBar/SideBar/index.js b/react/modules/core/src/components/TopBarSideBar/SideBar/index.js index 741ed849d3c..bd0a8aa6071 100644 --- a/react/modules/core/src/components/TopBarSideBar/SideBar/index.js +++ b/react/modules/core/src/components/TopBarSideBar/SideBar/index.js @@ -14,17 +14,17 @@ const SideBar = ({ t, CITIZEN, isSidebarOpen, toggleSidebar, handleLogout, mobil islinkDataLoading={islinkDataLoading} /> ); - else { - return (!isSidebarOpen && userDetails?.access_token) ? ( -
- -
- ) : ( -
- -
- ); - } + else { + return (!isSidebarOpen && userDetails?.access_token) ? ( +
+ +
+ ) : ( +
+ +
+ ); + } }; export default SideBar; diff --git a/react/modules/core/src/config/sidebar-menu.js b/react/modules/core/src/config/sidebar-menu.js index 01d786ad7f8..1e52335f9a1 100644 --- a/react/modules/core/src/config/sidebar-menu.js +++ b/react/modules/core/src/config/sidebar-menu.js @@ -1,5 +1,5 @@ import React from "react"; -import { HomeIcon, LanguageIcon, LogoutIcon, AddressBookIcon, LocationIcon } from "@egovernments/digit-ui-react-components"; +import { HomeIcon, LanguageIcon, LogoutIcon, AddressBookIcon, LocationIcon } from "@egovernments/digit-ui-components-core"; import ChangeLanguage from "../components/ChangeLanguage"; const SideBarMenu = (t, closeSidebar, redirectToLoginPage, isEmployee) => [ diff --git a/react/modules/core/src/pages/citizen/FAQs/FAQs.js b/react/modules/core/src/pages/citizen/FAQs/FAQs.js index 9bf6dfc036d..3f28b563a44 100644 --- a/react/modules/core/src/pages/citizen/FAQs/FAQs.js +++ b/react/modules/core/src/pages/citizen/FAQs/FAQs.js @@ -1,4 +1,4 @@ -import { BackButton, Header, Loader, SVG } from "@egovernments/digit-ui-components-core"; +import { BackButton, Header, Loader ,SearchIconSvg} from "@egovernments/digit-ui-components-core"; import React, { Fragment } from "react"; import { useTranslation } from "react-i18next"; import FaqComponent from "./FaqComponent"; @@ -9,7 +9,7 @@ const FAQsSection = ({ module }) => { const { t } = useTranslation(); const SearchImg = () => { - return ; + return ; }; const { isLoading, data } = Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()); diff --git a/react/modules/core/src/pages/citizen/FAQs/FaqComponent.js b/react/modules/core/src/pages/citizen/FAQs/FaqComponent.js index 0b9177ddf82..ecf0caeab3e 100644 --- a/react/modules/core/src/pages/citizen/FAQs/FaqComponent.js +++ b/react/modules/core/src/pages/citizen/FAQs/FaqComponent.js @@ -1,4 +1,4 @@ -import { SVG } from "@egovernments/digit-ui-components-core"; +import { ArrowForward } from "@egovernments/digit-ui-components-core"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; @@ -12,7 +12,7 @@ const FaqComponent = (props) => {
{t(question)} - {isOpen ? : } + {isOpen ? : }
diff --git a/react/modules/core/src/pages/citizen/Home/ImageUpload/UploadDrawer.js b/react/modules/core/src/pages/citizen/Home/ImageUpload/UploadDrawer.js index 0a6a9093fdf..f6cabba9bd9 100644 --- a/react/modules/core/src/pages/citizen/Home/ImageUpload/UploadDrawer.js +++ b/react/modules/core/src/pages/citizen/Home/ImageUpload/UploadDrawer.js @@ -1,5 +1,5 @@ import React, { useState, useEffect } from "react"; -import { GalleryIcon, RemoveIcon } from "@egovernments/digit-ui-react-components"; +import { GalleryIcon, RemoveIcon } from "@egovernments/digit-ui-components-core"; import { useTranslation } from "react-i18next"; function UploadDrawer({ setProfilePic, closeDrawer, userType, removeProfilePic ,showToast}) { diff --git a/react/modules/core/src/pages/citizen/Home/UserProfile.js b/react/modules/core/src/pages/citizen/Home/UserProfile.js index dbebc1a07d6..0ef1737ff81 100644 --- a/react/modules/core/src/pages/citizen/Home/UserProfile.js +++ b/react/modules/core/src/pages/citizen/Home/UserProfile.js @@ -4,15 +4,16 @@ import { LabelFieldPair, MobileNumber, TextInput, - Toast, CardLabelError, BackButton, Loader, Button, SubmitBar, - CardLabel + CardLabel, + CameraIcon, + BreadCrumb, + Toast } from "@egovernments/digit-ui-components-core"; -import { CameraIcon, BreadCrumb } from "@egovernments/digit-ui-react-components"; import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { useHistory } from "react-router-dom"; @@ -52,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); @@ -70,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) + ); }; }); @@ -109,8 +123,18 @@ 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" } }); + 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 }); } @@ -123,7 +147,10 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { 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 }); @@ -136,8 +163,17 @@ 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" } }); + 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 }); } @@ -147,7 +183,13 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { 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" } }); + setErrors({ + ...errors, + currentPassword: { + type: "pattern", + message: "CORE_COMMON_PROFILE_PASSWORD_INVALID", + }, + }); } else { setErrors({ ...errors, currentPassword: null }); } @@ -157,7 +199,13 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { 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" } }); + setErrors({ + ...errors, + newPassword: { + type: "pattern", + message: "CORE_COMMON_PROFILE_PASSWORD_INVALID", + }, + }); } else { setErrors({ ...errors, newPassword: null }); } @@ -167,7 +215,13 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { 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" } }); + setErrors({ + ...errors, + confirmPassword: { + type: "pattern", + message: "CORE_COMMON_PROFILE_PASSWORD_INVALID", + }, + }); } else { setErrors({ ...errors, confirmPassword: null }); } @@ -196,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(); @@ -241,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, @@ -253,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 ""; @@ -265,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); @@ -283,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]); @@ -315,8 +439,10 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { return (
-
- {userType === "citizen" ? ( +
+ {userType === "citizen" || isMobile ? ( ) : ( { 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" : "", @@ -358,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", @@ -382,7 +511,15 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { }} src={!profileImg || profileImg === "" ? defaultImage : profileImg} /> -
@@ -395,7 +532,8 @@ 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", @@ -404,7 +542,9 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { {userType === "citizen" ? ( - {`${t("CORE_COMMON_PROFILE_NAME")}`}* + + {`${t("CORE_COMMON_PROFILE_NAME")}`}* +
{ })} 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" + )}`}
{ name="email" value={email} onChange={(e) => setUserEmailAddress(e.target.value)} - disable={editScreen} + disabled={editScreen} /> - {errors?.emailAddress && {t(errors?.emailAddress?.message)} } + {errors?.emailAddress && ( + + {" "} + {t(errors?.emailAddress?.message)}{" "} + + )}
@@ -479,7 +633,14 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { ) : ( - + {`${t("CORE_COMMON_PROFILE_NAME")}`}*
@@ -499,14 +660,24 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { })} disabled={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_CITY" - )}`} + {`${t("CORE_COMMON_PROFILE_CITY")}`}
setCity(e.target.value)} placeholder="Enter Your City Name" {...(validation = { @@ -546,8 +726,11 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => {
- - {`${t("CORE_COMMON_PROFILE_MOBILE_NUMBER")}*`} + + {`${t("CORE_COMMON_PROFILE_MOBILE_NUMBER")}*`}
{ placeholder="Enter a valid Mobile No." onChange={(value) => setUserMobileNumber(value)} disable={true} - {...{ required: true, pattern: "[6-9]{1}[0-9]{9}", type: "tel", title: t("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID") }} + {...{ + required: true, + pattern: "[6-9]{1}[0-9]{9}", + type: "tel", + title: t("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"), + }} /> - {errors?.mobileNumber && {t(errors?.mobileNumber?.message)} } + {errors?.mobileNumber && ( + + {" "} + {t(errors?.mobileNumber?.message)}{" "} + + )}
- {`${t( - "CORE_COMMON_PROFILE_EMAIL" - )}`} + {`${t("CORE_COMMON_PROFILE_EMAIL")}`}
{ onChange={(e) => setUserEmailAddress(e.target.value)} disabled={editScreen} /> - {errors?.emailAddress && {t(errors?.emailAddress?.message)} } + {errors?.emailAddress && ( + + {" "} + {t(errors?.emailAddress?.message)}{" "} + + )}
-
- - {t("CORE_COMMON_CHANGE_PASSWORD")} - +
+ {changepassword == false ? ( + + {t("CORE_COMMON_CHANGE_PASSWORD")} + + ) : null} {changepassword ? (
{`${t("CORE_COMMON_PROFILE_CURRENT_PASSWORD")}`} + style={ + editScreen + ? { color: "#B1B4B6", width: "300px" } + : { width: "300px" } + } + >{`${t( + "CORE_COMMON_PROFILE_CURRENT_PASSWORD" + )}`}
{ isMandatory={false} name="name" pattern="^([a-zA-Z0-9@#$%])+$" - onChange={(e) => setUserCurrentPassword(e.target.value)} + onChange={(e) => + setUserCurrentPassword(e.target.value) + } disabled={editScreen} /> - {errors?.currentPassword && {t(errors?.currentPassword?.message)}} + {errors?.currentPassword && ( + + {t(errors?.currentPassword?.message)} + + )}
{`${t("CORE_COMMON_PROFILE_NEW_PASSWORD")}`} + style={ + editScreen + ? { color: "#B1B4B6", width: "300px" } + : { width: "300px" } + } + >{`${t( + "CORE_COMMON_PROFILE_NEW_PASSWORD" + )}`}
{ onChange={(e) => setUserNewPassword(e.target.value)} disabled={editScreen} /> - {errors?.newPassword && {t(errors?.newPassword?.message)}} + {errors?.newPassword && ( + + {t(errors?.newPassword?.message)} + + )}
{`${t("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")}`} + style={ + editScreen + ? { color: "#B1B4B6", width: "300px" } + : { width: "300px" } + } + >{`${t( + "CORE_COMMON_PROFILE_CONFIRM_PASSWORD" + )}`}
{ isMandatory={false} name="name" pattern="^([a-zA-Z0-9@#$%])+$" - onChange={(e) => setUserConfirmPassword(e.target.value)} + onChange={(e) => + setUserConfirmPassword(e.target.value) + } disabled={editScreen} /> - {errors?.confirmPassword && {t(errors?.confirmPassword?.message)}} + {errors?.confirmPassword && ( + + {t(errors?.confirmPassword?.message)} + + )}
@@ -651,14 +898,36 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { )}
+ {userType === "employee" && isMobile ? ( + + ) : null} )}
- {userType === "employee" ? ( + {userType === "employee" && !isMobile ? (
- + {/* */}
- ) : ( - "" - )} + ) : null} {toast && ( setToast(null)} style={{ maxWidth: "670px" }} /> diff --git a/react/modules/core/src/pages/citizen/Home/index.js b/react/modules/core/src/pages/citizen/Home/index.js index bb96f0c664b..d07ee2ed5bc 100644 --- a/react/modules/core/src/pages/citizen/Home/index.js +++ b/react/modules/core/src/pages/citizen/Home/index.js @@ -1,5 +1,15 @@ -import { CardBasedOptions, WhatsNewCard, Loader } from "@egovernments/digit-ui-components-core"; -import { Calender, CaseIcon, ComplaintIcon, DocumentIcon, HomeIcon, OBPSIcon, PTIcon } from "@egovernments/digit-ui-react-components"; +import { + Calender, + CardBasedOptions, + CaseIcon, + ComplaintIcon, + DocumentIcon, + HomeIcon, + OBPSIcon, + PTIcon, + Loader, + WhatsNewCard, +} from "@egovernments/digit-ui-components-core"; import React from "react"; import { useTranslation } from "react-i18next"; import { useHistory } from "react-router-dom"; @@ -8,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 = () => { @@ -17,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: { @@ -54,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"), @@ -80,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), @@ -95,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 ? ( @@ -130,13 +165,23 @@ const Home = () => {
{
- {isMobile ? : } + {isMobile ? ( + + ) : ( + + )} {/*
*/}
- - + +
} @@ -144,9 +189,19 @@ const Home = () => { {(whatsAppBannerMobObj || whatsAppBannerWebObj) && (
{isMobile ? ( - handleClickOnWhatsAppBanner(whatsAppBannerMobObj)} /> + + handleClickOnWhatsAppBanner(whatsAppBannerMobObj) + } + /> ) : ( - handleClickOnWhatsAppBanner(whatsAppBannerWebObj)} /> + + handleClickOnWhatsAppBanner(whatsAppBannerWebObj) + } + /> )}
)} @@ -158,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/react/modules/core/src/pages/citizen/HowItWorks/howItWorks.js b/react/modules/core/src/pages/citizen/HowItWorks/howItWorks.js index ae2bae02eed..bf8393f8ba6 100644 --- a/react/modules/core/src/pages/citizen/HowItWorks/howItWorks.js +++ b/react/modules/core/src/pages/citizen/HowItWorks/howItWorks.js @@ -1,11 +1,19 @@ -import { BackButton, Header, Loader, Button } from "@egovernments/digit-ui-components-core"; -import { CloseSvg, DownloadImgIcon, PDFSvg } from "@egovernments/digit-ui-react-components"; +import { + BackButton, + Header, + Loader, + CloseSvg, + DownloadImgIcon, + PDFSvg, +} from "@egovernments/digit-ui-components-core"; +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; @@ -19,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", @@ -60,18 +77,36 @@ const HowItWorks = ({ module }) => {
-
{t("HOW_IT_WORKS")}
+
+ {t( + mdmsConfigResult.screenHeader + ? mdmsConfigResult.screenHeader + : "HOW_IT_WORKS" + )} +
{languages.map((language, index) => (
-
))}
{mdmsConfigResult.videosJson.map((videos, index) => (
-
+
onClickVideo(videos)}>
@@ -84,22 +119,32 @@ const HowItWorks = ({ module }) => {
))} -
-
-
-
- + {mdmsConfigResult.pdfHeader && mdmsConfigResult.pdfDesc && ( +
+
+
+
+ +
+
+

{t(mdmsConfigResult.pdfHeader)}

+

{t(mdmsConfigResult.pdfDesc)}

+
-
-

{t(mdmsConfigResult.pdfHeader)}

-

{t(mdmsConfigResult.pdfDesc)}

+
+
-
- -
-
+ )} {videoPlay && (
diff --git a/react/modules/core/src/pages/citizen/Login/SelectOtp.js b/react/modules/core/src/pages/citizen/Login/SelectOtp.js index b687fdb3f71..2205ceb709d 100644 --- a/react/modules/core/src/pages/citizen/Login/SelectOtp.js +++ b/react/modules/core/src/pages/citizen/Login/SelectOtp.js @@ -1,4 +1,4 @@ -import { CardLabelError, CardText, FormStep, OTPInput } from "@egovernments/digit-ui-components-core"; +import { CardText, CardLabelError, FormStep, OTPInput } from "@egovernments/digit-ui-components-core"; import React, { Fragment, useState } from "react"; import useInterval from "../../../hooks/useInterval"; diff --git a/react/modules/core/src/pages/citizen/Login/index.js b/react/modules/core/src/pages/citizen/Login/index.js index 3cd27de1f82..d84d1c43321 100644 --- a/react/modules/core/src/pages/citizen/Login/index.js +++ b/react/modules/core/src/pages/citizen/Login/index.js @@ -1,4 +1,4 @@ -import { Toast, BackButton, AppContainer } from "@egovernments/digit-ui-components-core"; +import { AppContainer, BackButton ,Toast} from "@egovernments/digit-ui-components-core"; 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/react/modules/core/src/pages/citizen/StaticDynamicComponent/StaticDynamicCard.js b/react/modules/core/src/pages/citizen/StaticDynamicComponent/StaticDynamicCard.js index 11cae40a11d..0a25b571818 100644 --- a/react/modules/core/src/pages/citizen/StaticDynamicComponent/StaticDynamicCard.js +++ b/react/modules/core/src/pages/citizen/StaticDynamicComponent/StaticDynamicCard.js @@ -1,9 +1,9 @@ -import { Card } from "@egovernments/digit-ui-components-core"; import { + Card, + Loader, CaseIcon, ComplaintIcon, HelpLineIcon, - Loader, MCollectIcon, PTIcon, RupeeSymbol, @@ -11,15 +11,23 @@ import { TimerIcon, ValidityTimeIcon, WhatsappIconGreen, -} from "@egovernments/digit-ui-react-components"; +} from "@egovernments/digit-ui-components-core"; 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: {}, @@ -36,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) { @@ -83,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 { @@ -92,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 { @@ -105,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"), @@ -114,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: @@ -130,7 +160,12 @@ const StaticDynamicCard = ({ moduleCode }) => { {mdmsConfigResult && mdmsConfigResult?.payViaWhatsApp ? ( -
handleClickOnWhatsApp(mdmsConfigResult?.payViaWhatsApp)}> +
+ handleClickOnWhatsApp(mdmsConfigResult?.payViaWhatsApp) + } + >
{t("PAY_VIA_WHATSAPP")}
@@ -141,7 +176,9 @@ const StaticDynamicCard = ({ moduleCode }) => { {mdmsConfigResult && mdmsConfigResult?.helpline ? (
-
{t("CALL_CENTER_HELPLINE")}
+
+ {t("CALL_CENTER_HELPLINE")} +
@@ -149,12 +186,16 @@ const StaticDynamicCard = ({ moduleCode }) => {
{mdmsConfigResult?.helpline?.contactOne ? ( ) : null} {mdmsConfigResult?.helpline?.contactTwo ? ( ) : null}
@@ -163,13 +204,17 @@ const StaticDynamicCard = ({ moduleCode }) => { {mdmsConfigResult && mdmsConfigResult?.serviceCenter ? (
-
{t("CITIZEN_SERVICE_CENTER")}
+
+ {t("CITIZEN_SERVICE_CENTER")} +
-
{mdmsConfigResult?.serviceCenter}
+
+ {mdmsConfigResult?.serviceCenter} +
{mdmsConfigResult?.viewMapLocation ? (
@@ -181,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} +
)} @@ -209,12 +268,17 @@ const StaticDynamicCard = ({ moduleCode }) => { {staticData(moduleCode)?.staticDataOneHeader} - {`${staticData(moduleCode)?.staticDataOne}`} + {`${ + staticData(moduleCode)?.staticDataOne + }`}
@@ -226,8 +290,12 @@ const StaticDynamicCard = ({ moduleCode }) => {
- {staticData(moduleCode)?.staticDataTwoHeader} - {staticData(moduleCode)?.staticDataTwo} + + {staticData(moduleCode)?.staticDataTwoHeader} + + + {staticData(moduleCode)?.staticDataTwo} +
@@ -241,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/react/modules/core/src/pages/citizen/index.js b/react/modules/core/src/pages/citizen/index.js index 8f82960f913..eb781a7d9e1 100644 --- a/react/modules/core/src/pages/citizen/index.js +++ b/react/modules/core/src/pages/citizen/index.js @@ -1,4 +1,4 @@ -import { BackButton, CitizenHomeCard, CitizenInfoLabel, Footer } from "@egovernments/digit-ui-components-core"; +import { BackButton, CitizenHomeCard, CitizenInfoLabel } from "@egovernments/digit-ui-components-core"; import React from "react"; import { useTranslation } from "react-i18next"; import { Route, Switch, useHistory, useRouteMatch } from "react-router-dom"; @@ -210,7 +210,16 @@ const Home = ({
-
+
+ Powered by DIGIT { + window.open(window?.globalConfigs?.getConfig?.("DIGIT_HOME_URL"), "_blank").focus(); + }} + /> +
); }; diff --git a/react/modules/core/src/pages/employee/ChangePassword/changePassword.js b/react/modules/core/src/pages/employee/ChangePassword/changePassword.js index bd74feb53f3..79bc85ce975 100644 --- a/react/modules/core/src/pages/employee/ChangePassword/changePassword.js +++ b/react/modules/core/src/pages/employee/ChangePassword/changePassword.js @@ -1,5 +1,5 @@ -import { FormComposer } from "@egovernments/digit-ui-react-components"; -import { BackButton, CardText, Toast, CardHeader } from "@egovernments/digit-ui-components-core"; +import { CardSubHeader, FormComposer} from "@egovernments/digit-ui-react-components"; +import { BackButton, CardText,Toast} from "@egovernments/digit-ui-components-core"; import PropTypes from "prop-types"; import React, { useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; @@ -120,9 +120,7 @@ const ChangePasswordComponent = ({ config: propsConfig, t }) => { className="employeeChangePassword" >
- {/* V2-> replacing cardSubHeader with CardHeader. - To implement CardSubHeader, just add props variant -> "digit-card-sub-header"*/} - {propsConfig.texts.header} + {propsConfig.texts.header} {`${t(`CS_LOGIN_OTP_TEXT`)} `} diff --git a/react/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js b/react/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js index b331cd85413..ef6e9f2153a 100644 --- a/react/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js +++ b/react/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js @@ -1,5 +1,5 @@ -import { FormComposer, Dropdown } from "@egovernments/digit-ui-react-components"; -import { Loader, BackButton, Toast } from "@egovernments/digit-ui-components-core"; +import { FormComposer } from "@egovernments/digit-ui-react-components"; +import { BackButton, Dropdown, Loader,Toast } from "@egovernments/digit-ui-components-core"; import PropTypes from "prop-types"; import React, { useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; diff --git a/react/modules/core/src/pages/employee/Login/login.js b/react/modules/core/src/pages/employee/Login/login.js index 2af2ead257a..f9a4879274c 100644 --- a/react/modules/core/src/pages/employee/Login/login.js +++ b/react/modules/core/src/pages/employee/Login/login.js @@ -1,4 +1,4 @@ -import { FormComposerV2, BackButton, Loader, Toast } from "@egovernments/digit-ui-components-core"; +import { BackButton, Loader, FormComposerV2 ,Toast} from "@egovernments/digit-ui-components-core"; import PropTypes from "prop-types"; import React, { useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; @@ -98,7 +98,7 @@ const Login = ({ config: propsConfig, t, isDisabled }) => { name: Digit.Utils.locale.getTransformedLocale(`TENANT_TENANTS_${Digit.ULBService.getStateId()}`), }; - let config = [{ body: propsConfig?.inputs }]; + let config = [{body : propsConfig?.inputs}]; const { mode } = Digit.Hooks.useQueryParams(); if (mode === "admin" && config?.[0]?.body?.[2]?.disable == false && config?.[0]?.body?.[2]?.populators?.defaultValue == undefined) { @@ -132,7 +132,7 @@ const Login = ({ config: propsConfig, t, isDisabled }) => { >
- {showToast && } + {showToast && }
Powered by DIGIT i?.additionalComponent)?.map((i) => i?.additionalComponent); + return (
@@ -62,7 +64,7 @@ const EmployeeApp = ({ className={isUserProfile ? "grounded-container" : "loginContainer"} style={ isUserProfile - ? { padding: 0, paddingTop: "80px" } + ? { padding: 0, paddingTop: "80px", marginLeft: mobileView ? "" : "64px" } : { "--banner-url": `url(${stateInfo?.bannerUrl})`, padding: "0px" } } > @@ -111,7 +113,7 @@ const EmployeeApp = ({
- +
diff --git a/react/modules/sample/package.json b/react/modules/sample/package.json index 6a8e80ac027..9fff2399845 100644 --- a/react/modules/sample/package.json +++ b/react/modules/sample/package.json @@ -18,7 +18,7 @@ "react-router-dom": "5.3.0" }, "dependencies": { - "@egovernments/digit-ui-react-components": "1.5.24", + "@egovernments/digit-ui-react-components": "1.8.1-beta.4", "@egovernments/digit-ui-components-core": "0.0.1", "react": "17.0.2", "react-date-range": "^1.4.0", diff --git a/react/modules/sample/src/components/SampleCard.js b/react/modules/sample/src/components/SampleCard.js index 26df5ac0c92..0bfc9c73d91 100644 --- a/react/modules/sample/src/components/SampleCard.js +++ b/react/modules/sample/src/components/SampleCard.js @@ -1,4 +1,5 @@ -import {EmployeeModuleCard, ProjectIcon} from "@egovernments/digit-ui-react-components"; +import {EmployeeModuleCard} from "@egovernments/digit-ui-react-components"; +import {ProjectIcon} from "@egovernments/digit-ui-components-core"; import React from "react"; import { useTranslation } from "react-i18next"; diff --git a/react/modules/sample/src/pages/employee/index.js b/react/modules/sample/src/pages/employee/index.js index afa75468b8b..6f15a51c94e 100644 --- a/react/modules/sample/src/pages/employee/index.js +++ b/react/modules/sample/src/pages/employee/index.js @@ -1,5 +1,4 @@ -import { AppContainer,PrivateRoute } from "@egovernments/digit-ui-components-core"; -import {BreadCrumb} from "@egovernments/digit-ui-react-components"; +import { AppContainer,PrivateRoute,BreadCrumb } from "@egovernments/digit-ui-components-core"; import React from "react"; import { useTranslation } from "react-i18next"; import { Route, Switch } from "react-router-dom"; diff --git a/react/modules/templates/ApplicationDetails/Modal/AttendanceActionModal.js b/react/modules/templates/ApplicationDetails/Modal/AttendanceActionModal.js index a2c50215207..648e493e71d 100644 --- a/react/modules/templates/ApplicationDetails/Modal/AttendanceActionModal.js +++ b/react/modules/templates/ApplicationDetails/Modal/AttendanceActionModal.js @@ -1,6 +1,7 @@ import React, { useState, useEffect } from "react"; import _ from "lodash"; -import { Loader, Modal, FormComposer } from "@egovernments/digit-ui-react-components"; +import { FormComposer } from "@egovernments/digit-ui-react-components"; +import { Loader, Modal } from "@egovernments/digit-ui-components-core"; import { configAttendanceApproveModal, configAttendanceRejectModal, configAttendanceCheckModal } from "../config"; diff --git a/react/modules/templates/ApplicationDetails/Modal/BPAActionModal.js b/react/modules/templates/ApplicationDetails/Modal/BPAActionModal.js index 269bbefa1dd..f8e0a2f1650 100644 --- a/react/modules/templates/ApplicationDetails/Modal/BPAActionModal.js +++ b/react/modules/templates/ApplicationDetails/Modal/BPAActionModal.js @@ -1,4 +1,5 @@ -import { Loader, Modal, FormComposer } from "@egovernments/digit-ui-react-components"; +import { FormComposer } from "@egovernments/digit-ui-react-components"; +import { Loader, Modal } from "@egovernments/digit-ui-components-core"; import React, { useState, useEffect } from "react"; import { useQueryClient } from "react-query"; import { configBPAApproverApplication } from "../config"; diff --git a/react/modules/templates/ApplicationDetails/Modal/BPAREGActionModal.js b/react/modules/templates/ApplicationDetails/Modal/BPAREGActionModal.js index dc0bfe07776..1aff89866cc 100644 --- a/react/modules/templates/ApplicationDetails/Modal/BPAREGActionModal.js +++ b/react/modules/templates/ApplicationDetails/Modal/BPAREGActionModal.js @@ -1,4 +1,5 @@ -import { Loader, Modal, FormComposer } from "@egovernments/digit-ui-react-components"; +import { FormComposer } from "@egovernments/digit-ui-react-components"; +import { Loader, Modal } from "@egovernments/digit-ui-components-core"; import React, { useState, useEffect } from "react"; import { configBPAREGApproverApplication } from "../config"; import * as predefinedConfig from "../config"; diff --git a/react/modules/templates/ApplicationDetails/Modal/ExpenditureActionModal.js b/react/modules/templates/ApplicationDetails/Modal/ExpenditureActionModal.js index 95393b5ae05..55d87618803 100644 --- a/react/modules/templates/ApplicationDetails/Modal/ExpenditureActionModal.js +++ b/react/modules/templates/ApplicationDetails/Modal/ExpenditureActionModal.js @@ -1,4 +1,5 @@ -import { Loader, Modal, FormComposer, WorkflowModal } from "@egovernments/digit-ui-react-components"; +import { FormComposer, WorkflowModal } from "@egovernments/digit-ui-react-components"; +import { Loader, Modal } from "@egovernments/digit-ui-components-core"; import React, { useState, useEffect, Fragment } from "react"; import { configViewBillApproveModal, configViewBillRejectModal, configViewBillCheckModal } from "../config"; import _ from "lodash"; diff --git a/react/modules/templates/ApplicationDetails/Modal/FSMActionModal.js b/react/modules/templates/ApplicationDetails/Modal/FSMActionModal.js index af0e0e8e701..990793939b3 100644 --- a/react/modules/templates/ApplicationDetails/Modal/FSMActionModal.js +++ b/react/modules/templates/ApplicationDetails/Modal/FSMActionModal.js @@ -1,4 +1,5 @@ -import { Loader, Modal, FormComposer, Toast } from "@egovernments/digit-ui-react-components"; +import { FormComposer } from "@egovernments/digit-ui-react-components"; +import { Loader, Modal } from "@egovernments/digit-ui-components-core"; import React, { useState, useEffect } from "react"; import { useQueryClient } from "react-query"; diff --git a/react/modules/templates/ApplicationDetails/Modal/NOCActionModal.js b/react/modules/templates/ApplicationDetails/Modal/NOCActionModal.js index 09266ca1b7b..732312fc0d6 100644 --- a/react/modules/templates/ApplicationDetails/Modal/NOCActionModal.js +++ b/react/modules/templates/ApplicationDetails/Modal/NOCActionModal.js @@ -1,4 +1,5 @@ -import { Loader, Modal, FormComposer } from "@egovernments/digit-ui-react-components"; +import { FormComposer } from "@egovernments/digit-ui-react-components"; +import { Loader, Modal } from "@egovernments/digit-ui-components-core"; import React, { useState, useEffect } from "react"; import { useQueryClient } from "react-query"; import { useHistory } from "react-router-dom"; diff --git a/react/modules/templates/ApplicationDetails/Modal/PTActionModal.js b/react/modules/templates/ApplicationDetails/Modal/PTActionModal.js index 37b3d996177..7139ed95265 100644 --- a/react/modules/templates/ApplicationDetails/Modal/PTActionModal.js +++ b/react/modules/templates/ApplicationDetails/Modal/PTActionModal.js @@ -1,4 +1,5 @@ -import { Loader, Modal, FormComposer } from "@egovernments/digit-ui-react-components"; +import {FormComposer } from "@egovernments/digit-ui-react-components"; +import { Loader, Modal } from "@egovernments/digit-ui-components-core"; import React, { useState, useEffect } from "react"; import { configPTApproverApplication, configPTAssessProperty } from "../config"; diff --git a/react/modules/templates/ApplicationDetails/Modal/TLActionModal.js b/react/modules/templates/ApplicationDetails/Modal/TLActionModal.js index f11658a987a..fe021a3ee54 100644 --- a/react/modules/templates/ApplicationDetails/Modal/TLActionModal.js +++ b/react/modules/templates/ApplicationDetails/Modal/TLActionModal.js @@ -1,4 +1,5 @@ -import { Loader, Modal, FormComposer } from "@egovernments/digit-ui-react-components"; +import { FormComposer } from "@egovernments/digit-ui-react-components"; +import { Loader, Modal } from "@egovernments/digit-ui-components-core"; import React, { useState, useEffect } from "react"; import { configTLApproverApplication } from "../config"; diff --git a/react/modules/templates/ApplicationDetails/Modal/WNSActionModal.js b/react/modules/templates/ApplicationDetails/Modal/WNSActionModal.js index eb64a09804b..f67edd5dced 100644 --- a/react/modules/templates/ApplicationDetails/Modal/WNSActionModal.js +++ b/react/modules/templates/ApplicationDetails/Modal/WNSActionModal.js @@ -1,4 +1,5 @@ -import { Loader, Modal, FormComposer } from "@egovernments/digit-ui-react-components"; +import { FormComposer } from "@egovernments/digit-ui-react-components"; +import { Loader, Modal } from "@egovernments/digit-ui-components-core"; import React, { useState, useEffect } from "react"; import { configWSApproverApplication, configWSDisConnectApplication } from "../config"; import * as predefinedConfig from "../config"; diff --git a/react/modules/templates/ApplicationDetails/Modal/WorksActionModal.js b/react/modules/templates/ApplicationDetails/Modal/WorksActionModal.js index dd19cf33a1e..7ed288d056d 100644 --- a/react/modules/templates/ApplicationDetails/Modal/WorksActionModal.js +++ b/react/modules/templates/ApplicationDetails/Modal/WorksActionModal.js @@ -1,4 +1,5 @@ -import { Loader, Modal, FormComposer } from "@egovernments/digit-ui-react-components"; +import { FormComposer } from "@egovernments/digit-ui-react-components"; +import { Loader, Modal } from "@egovernments/digit-ui-components-core"; import React, { useState, useEffect } from "react"; import { configApproveModal, configRejectModal, configCheckModal } from "../config"; diff --git a/react/modules/templates/ApplicationDetails/components/ApplicationDetailsActionBar.js b/react/modules/templates/ApplicationDetails/components/ApplicationDetailsActionBar.js index 7ad3a0f95ce..9a61b969220 100644 --- a/react/modules/templates/ApplicationDetails/components/ApplicationDetailsActionBar.js +++ b/react/modules/templates/ApplicationDetails/components/ApplicationDetailsActionBar.js @@ -1,6 +1,7 @@ import React, {useEffect, useRef} from "react"; import { useTranslation } from "react-i18next"; -import { SubmitBar, ActionBar, Menu } from "@egovernments/digit-ui-react-components"; +import { Menu } from "@egovernments/digit-ui-react-components"; +import { SubmitBar, ActionBar } from "@egovernments/digit-ui-components-core"; function ApplicationDetailsActionBar({ workflowDetails, displayMenu, onActionSelect, setDisplayMenu, businessService, forcedActionPrefix,ActionBarStyle={},MenuStyle={}, saveAttendanceState }) { const { t } = useTranslation(); diff --git a/react/modules/templates/ApplicationDetails/components/ApplicationDetailsContent.js b/react/modules/templates/ApplicationDetails/components/ApplicationDetailsContent.js index 889fb530907..4dceb3c726b 100644 --- a/react/modules/templates/ApplicationDetails/components/ApplicationDetailsContent.js +++ b/react/modules/templates/ApplicationDetails/components/ApplicationDetailsContent.js @@ -1,17 +1,16 @@ import { BreakLine, - Card, CardSectionHeader, CardSubHeader, CheckPoint, CollapseAndExpandGroups, ConnectingCheckPoints, ViewImages, - Loader, Row, StatusTable, Table, } from "@egovernments/digit-ui-react-components"; +import { Card, Loader } from "@egovernments/digit-ui-components-core"; import { values } from "lodash"; import React, { Fragment, useCallback, useReducer, useState } from "react"; import { useTranslation } from "react-i18next"; @@ -37,8 +36,6 @@ import InfoDetails from "./InfoDetails"; import ViewBreakup from "./ViewBreakup"; import SubWorkTableDetails from "./SubWorkTableDetails"; - - function ApplicationDetailsContent({ applicationDetails, workflowDetails, @@ -54,11 +51,10 @@ function ApplicationDetailsContent({ noBoxShadow = false, sectionHeadStyle = false, modify, - setSaveAttendanceState + setSaveAttendanceState, }) { const { t } = useTranslation(); const [localSearchParams, setLocalSearchParams] = useState(() => ({})); - const handleDateRangeChange = useCallback((data) => { setLocalSearchParams(() => ({ ...data })); @@ -81,20 +77,33 @@ function ApplicationDetailsContent({ return `${day}/${month}/${year}`; }; const getTimelineCaptions = (checkpoint) => { - if (checkpoint.state === "OPEN" || (checkpoint.status === "INITIATED" && !window.location.href.includes("/obps/"))) { + if ( + checkpoint.state === "OPEN" || + (checkpoint.status === "INITIATED" && + !window.location.href.includes("/obps/")) + ) { const caption = { date: convertEpochToDateDMY(applicationData?.auditDetails?.createdTime), source: applicationData?.channel || "", }; return ; - } else if (window.location.href.includes("/obps/") || window.location.href.includes("/noc/") || window.location.href.includes("/ws/")) { + } else if ( + window.location.href.includes("/obps/") || + window.location.href.includes("/noc/") || + window.location.href.includes("/ws/") + ) { //From BE side assigneeMobileNumber is masked/unmasked with connectionHoldersMobileNumber and not assigneeMobileNumber - const privacy = { uuid: checkpoint?.assignes?.[0]?.uuid, fieldName: ["connectionHoldersMobileNumber"], model: "WaterConnectionOwner" }; + const privacy = { + uuid: checkpoint?.assignes?.[0]?.uuid, + fieldName: ["connectionHoldersMobileNumber"], + model: "WaterConnectionOwner", + }; const caption = { date: checkpoint?.auditDetails?.lastModified, name: checkpoint?.assignes?.[0]?.name, mobileNumber: - applicationData?.processInstance?.assignes?.[0]?.uuid === checkpoint?.assignes?.[0]?.uuid && + applicationData?.processInstance?.assignes?.[0]?.uuid === + checkpoint?.assignes?.[0]?.uuid && applicationData?.processInstance?.assignes?.[0]?.mobileNumber ? applicationData?.processInstance?.assignes?.[0]?.mobileNumber : checkpoint?.assignes?.[0]?.mobileNumber, @@ -102,12 +111,18 @@ function ApplicationDetailsContent({ wfComment: checkpoint.wfComment, thumbnailsToShow: checkpoint?.thumbnailsToShow, }; - return ; + return ( + + ); } else { const caption = { - date: `${Digit.DateUtils?.ConvertTimestampToDate(checkpoint.auditDetails.lastModifiedEpoch)} ${Digit.DateUtils?.ConvertEpochToTimeInHours( + date: `${Digit.DateUtils?.ConvertTimestampToDate( checkpoint.auditDetails.lastModifiedEpoch - )} ${Digit.DateUtils?.getDayfromTimeStamp(checkpoint.auditDetails.lastModifiedEpoch)}`, + )} ${Digit.DateUtils?.ConvertEpochToTimeInHours( + checkpoint.auditDetails.lastModifiedEpoch + )} ${Digit.DateUtils?.getDayfromTimeStamp( + checkpoint.auditDetails.lastModifiedEpoch + )}`, // name: checkpoint?.assigner?.name, name: checkpoint?.assignes?.[0]?.name, // mobileNumber: checkpoint?.assigner?.mobileNumber, @@ -128,56 +143,69 @@ function ApplicationDetailsContent({ }; const checkLocation = - window.location.href.includes("employee/tl") || window.location.href.includes("employee/obps") || window.location.href.includes("employee/noc"); + window.location.href.includes("employee/tl") || + window.location.href.includes("employee/obps") || + window.location.href.includes("employee/noc"); const isNocLocation = window.location.href.includes("employee/noc"); const isBPALocation = window.location.href.includes("employee/obps"); - let isWS = window.location.href.includes("employee/ws") || window.location.href.includes("employee/works")|| window.location.href.includes("employee/project") || window.location.href.includes("employee/estimate") ; - - + let isWS = + window.location.href.includes("employee/ws") || + window.location.href.includes("employee/works") || + window.location.href.includes("employee/project") || + window.location.href.includes("employee/estimate"); - const getRowStyles = (tab="") => { - - if (window.location.href.includes("employee/obps") || window.location.href.includes("employee/noc")) { - return { justifyContent: "space-between", fontSize: "16px", lineHeight: "19px", color: "#0B0C0C" }; + const getRowStyles = (tab = "") => { + if ( + window.location.href.includes("employee/obps") || + window.location.href.includes("employee/noc") + ) { + return { + justifyContent: "space-between", + fontSize: "16px", + lineHeight: "19px", + color: "#0B0C0C", + }; } else if (checkLocation) { - return { justifyContent: "space-between", fontSize: "16px", lineHeight: "19px", color: "#0B0C0C" }; - } - else if ( tab==="fieldSurvey") { - return { - justifyContent: "space-between", flexDirection:"column" - } - } - else { + return { + justifyContent: "space-between", + fontSize: "16px", + lineHeight: "19px", + color: "#0B0C0C", + }; + } else if (tab === "fieldSurvey") { + return { + justifyContent: "space-between", + flexDirection: "column", + }; + } else { return {}; } - }; - const getTextStyles = (tab="") => { - if ( tab==="fieldSurvey" ) { + const getTextStyles = (tab = "") => { + if (tab === "fieldSurvey") { return { - marginTop:"1rem", - marginBottom:"1rem" - } - } - else { + marginTop: "1rem", + marginBottom: "1rem", + }; + } else { return {}; } - }; const getLabelStyles = (tab = "") => { - if ( tab === "fieldSurvey") { + if (tab === "fieldSurvey") { return { - width:"100%" - } - } - else { + width: "100%", + }; + } else { return {}; } - }; const getTableStyles = () => { - if (window.location.href.includes("employee/obps") || window.location.href.includes("employee/noc")) { + if ( + window.location.href.includes("employee/obps") || + window.location.href.includes("employee/noc") + ) { return { position: "relative", marginTop: "19px" }; } else if (checkLocation) { return { position: "relative", marginTop: "19px" }; @@ -204,14 +232,32 @@ function ApplicationDetailsContent({ const getTextValue = (value) => { if (value?.skip) return value.value; - else if (value?.isUnit) return value?.value ? `${getTranslatedValues(value?.value, value?.isNotTranslated)} ${t(value?.isUnit)}` : t("N/A"); - else if (value?.value === "Approved") return { `${getTranslatedValues(value?.value, value?.isNotTranslated)}`} - else if (value?.value === "Rejected") return {t(value?.value)} - else return value?.value ? getTranslatedValues(value?.value, value?.isNotTranslated) : t("N/A"); + else if (value?.isUnit) + return value?.value + ? `${getTranslatedValues(value?.value, value?.isNotTranslated)} ${t( + value?.isUnit + )}` + : t("N/A"); + else if (value?.value === "Approved") + return ( + {`${getTranslatedValues( + value?.value, + value?.isNotTranslated + )}`} + ); + else if (value?.value === "Rejected") + return {t(value?.value)}; + else + return value?.value + ? getTranslatedValues(value?.value, value?.isNotTranslated) + : t("N/A"); }; const getClickInfoDetails = () => { - if (window.location.href.includes("disconnection") || window.location.href.includes("application")) { + if ( + window.location.href.includes("disconnection") || + window.location.href.includes("application") + ) { return "WS_DISCONNECTION_CLICK_ON_INFO_LABEL"; } else { return "WS_CLICK_ON_INFO_LABEL"; @@ -219,7 +265,10 @@ function ApplicationDetailsContent({ }; const getClickInfoDetails1 = () => { - if (window.location.href.includes("disconnection") || window.location.href.includes("application")) { + if ( + window.location.href.includes("disconnection") || + window.location.href.includes("application") + ) { return "WS_DISCONNECTION_CLICK_ON_INFO1_LABEL"; } else { return ""; @@ -227,47 +276,68 @@ function ApplicationDetailsContent({ }; const getCardStyles = () => { - let styles = { position: "relative" } + let styles = { position: "relative" }; if (noBoxShadow) styles = { ...styles, boxShadow: "none" }; return styles; }; return ( - - - {isInfoLabel ? ( - - ) : null} - {applicationDetails?.applicationDetails?.map((detail, index) => ( - - -
- {index === 0 && !detail?.asSectionHeader ? ( - {t(detail?.title)} - ) : ( - - - {isNocLocation ? `${t(detail?.title)}` : t(detail?.title)} - {detail?.Component ? : null} - - - )} - {/* TODO, Later will move to classes */} - {/* Here Render the table for adjustment amount details detail.isTable is true for that table*/} - {/* {detail?.isTable && ( + + + {isInfoLabel ? ( + + ) : null} + {applicationDetails?.applicationDetails?.map((detail, index) => ( + + +
+ {index === 0 && !detail?.asSectionHeader ? ( + + {t(detail?.title)} + + ) : ( + + + {isNocLocation ? `${t(detail?.title)}` : t(detail?.title)} + {detail?.Component ? : null} + + + )} + {/* TODO, Later will move to classes */} + {/* Here Render the table for adjustment amount details detail.isTable is true for that table*/} + {/* {detail?.isTable && (
{detail?.headers.map((header) => ( @@ -289,90 +359,135 @@ function ApplicationDetailsContent({ })}
)} */} - {detail?.isTable && } + {detail?.isTable && } - - {detail?.title && - !detail?.title.includes("NOC") && - detail?.values?.map((value, index) => { - if (value.map === true && value.value !== "N/A") { - return } />; - } - if (value?.isLink == true) { - return ( - - - - {t(value?.title)} - - -
- ) : isNocLocation || isBPALocation ? ( - `${t(value.title)}` - ) : ( - t(value.title) - ) - } - text={ -
- - - {value?.value} - - -
- } - last={index === detail?.values?.length - 1} - caption={value.caption} - className="border-none" - rowContainerStyle={getRowStyles()} - /> - ); - } - return ( - { }} />: getTextValue(value)} - last={index === detail?.values?.length - 1} - caption={value.caption} - className="border-none" - /* privacy object set to the Row Component */ - privacy={value?.privacy} - // TODO, Later will move to classes - rowContainerStyle={getRowStyles(detail?.tab)} - textStyle={getTextStyles(detail?.tab)} - labelStyle={getLabelStyles(detail?.tab)} - /> - ); - })} - -
- - - {detail?.additionalDetails?.table - ? detail?.additionalDetails?.table?.weekTable?.tableHeader && ( - <> - - {t(detail?.additionalDetails?.table?.weekTable?.tableHeader)} - - - ) - : null} - - {detail?.additionalDetails?.inspectionReport && ( - - )} - {applicationDetails?.applicationData?.additionalDetails?.fieldinspection_pending?.length > 0 && detail?.additionalDetails?.fiReport && ( - - )} - {/* {detail?.additionalDetails?.FIdocuments && detail?.additionalDetails?.values?.map((doc,index) => ( + + {detail?.title && + !detail?.title.includes("NOC") && + detail?.values?.map((value, index) => { + if (value.map === true && value.value !== "N/A") { + return ( + + } + /> + ); + } + if (value?.isLink == true) { + return ( + + + + {t(value?.title)} + + +
+ ) : isNocLocation || isBPALocation ? ( + `${t(value.title)}` + ) : ( + t(value.title) + ) + } + text={ +
+ + + {value?.value} + + +
+ } + last={index === detail?.values?.length - 1} + caption={value.caption} + className="border-none" + rowContainerStyle={getRowStyles()} + /> + ); + } + return ( + {}} + /> + ) : ( + getTextValue(value) + ) + } + last={index === detail?.values?.length - 1} + caption={value.caption} + className="border-none" + /* privacy object set to the Row Component */ + privacy={value?.privacy} + // TODO, Later will move to classes + rowContainerStyle={getRowStyles(detail?.tab)} + textStyle={getTextStyles(detail?.tab)} + labelStyle={getLabelStyles(detail?.tab)} + /> + ); + })} + +
+ + {detail?.additionalDetails?.table + ? detail?.additionalDetails?.table?.weekTable?.tableHeader && ( + <> + + {t( + detail?.additionalDetails?.table?.weekTable + ?.tableHeader + )} + + + ) + : null} + + {detail?.additionalDetails?.inspectionReport && ( + + )} + {applicationDetails?.applicationData?.additionalDetails + ?.fieldinspection_pending?.length > 0 && + detail?.additionalDetails?.fiReport && ( + + )} + {/* {detail?.additionalDetails?.FIdocuments && detail?.additionalDetails?.values?.map((doc,index) => (
{doc.isNotDuplicate &&
@@ -383,100 +498,166 @@ function ApplicationDetailsContent({
}
)) } */} - {detail?.additionalDetails?.floors && } - {detail?.additionalDetails?.owners && } - {detail?.additionalDetails?.units && } - {detail?.additionalDetails?.accessories && } - {detail?.additionalDetails?.permissions && workflowDetails?.data?.nextActions?.length > 0 && ( - - )} - {detail?.additionalDetails?.obpsDocuments && ( - - )} - {detail?.additionalDetails?.noc && ( - - )} - {detail?.additionalDetails?.scruntinyDetails && } - {detail?.additionalDetails?.buildingExtractionDetails && } - {detail?.additionalDetails?.subOccupancyTableDetails && ( - - )} - {detail?.additionalDetails?.documentsWithUrl && } - {detail?.additionalDetails?.documents && } - {detail?.additionalDetails?.taxHeadEstimatesCalculation && ( - - )} - {/* {detail?.isWaterConnectionDetails && } */} - {detail?.additionalDetails?.redirectUrl && ( -
- - - {detail?.additionalDetails?.redirectUrl?.title} - - -
- )} - {detail?.additionalDetails?.estimationDetails && } - {detail?.additionalDetails?.estimationDetails && } - - - ))} - {showTimeLine && workflowDetails?.data?.timeline?.length > 0 && ( - - {workflowDetails?.breakLineRequired === undefined ? : workflowDetails?.breakLineRequired ? : null} - {(workflowDetails?.isLoading || isDataLoading) && } - {!workflowDetails?.isLoading && !isDataLoading && ( - - - {/* {t("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")} */} - {t("WORKS_WORKFLOW_HISTORY")} - - {workflowDetails?.data?.timeline && workflowDetails?.data?.timeline?.length === 1 ? ( - + )} + {detail?.additionalDetails?.owners && ( + + )} + {detail?.additionalDetails?.units && ( + + )} + {detail?.additionalDetails?.accessories && ( + + )} + {detail?.additionalDetails?.permissions && + workflowDetails?.data?.nextActions?.length > 0 && ( + + )} + {detail?.additionalDetails?.obpsDocuments && ( + + )} + {detail?.additionalDetails?.noc && ( + - ) : ( - - {workflowDetails?.data?.timeline && - workflowDetails?.data?.timeline.map((checkpoint, index, arr) => { - return ( - - - - ); - })} - )} - - )} - - )} - + {detail?.additionalDetails?.scruntinyDetails && ( + + )} + {detail?.additionalDetails?.buildingExtractionDetails && ( + + )} + {detail?.additionalDetails?.subOccupancyTableDetails && ( + + )} + {detail?.additionalDetails?.documentsWithUrl && ( + + )} + {detail?.additionalDetails?.documents && ( + + )} + {detail?.additionalDetails?.taxHeadEstimatesCalculation && ( + + )} + {/* {detail?.isWaterConnectionDetails && } */} + {detail?.additionalDetails?.redirectUrl && ( +
+ + + {detail?.additionalDetails?.redirectUrl?.title} + + +
+ )} + {detail?.additionalDetails?.estimationDetails && ( + + )} + {detail?.additionalDetails?.estimationDetails && ( + + )} + + + ))} + {showTimeLine && workflowDetails?.data?.timeline?.length > 0 && ( + + {workflowDetails?.breakLineRequired === undefined ? ( + + ) : workflowDetails?.breakLineRequired ? ( + + ) : null} + {(workflowDetails?.isLoading || isDataLoading) && } + {!workflowDetails?.isLoading && !isDataLoading && ( + + + {/* {t("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")} */} + {t("WORKS_WORKFLOW_HISTORY")} + + {workflowDetails?.data?.timeline && + workflowDetails?.data?.timeline?.length === 1 ? ( + + ) : ( + + {workflowDetails?.data?.timeline && + workflowDetails?.data?.timeline.map( + (checkpoint, index, arr) => { + return ( + + + + ); + } + )} + + )} + + )} + + )} + ); } diff --git a/react/modules/templates/ApplicationDetails/components/ApplicationDetailsToast.js b/react/modules/templates/ApplicationDetails/components/ApplicationDetailsToast.js index 9540495f32a..3992adc9d7c 100644 --- a/react/modules/templates/ApplicationDetails/components/ApplicationDetailsToast.js +++ b/react/modules/templates/ApplicationDetails/components/ApplicationDetailsToast.js @@ -1,5 +1,5 @@ import React from "react"; -import { Toast } from "@egovernments/digit-ui-react-components"; +import { Toast } from "@egovernments/digit-ui-components-core"; function ApplicationDetailsToast({ t, showToast, closeToast, businessService }) { if (businessService?.includes("NewTL") || businessService?.includes("TL") || businessService?.includes("EDITRENEWAL")) { diff --git a/react/modules/templates/ApplicationDetails/components/ApplicationDetailsWarningPopup.js b/react/modules/templates/ApplicationDetails/components/ApplicationDetailsWarningPopup.js index e95b9e038cd..eee5238e586 100644 --- a/react/modules/templates/ApplicationDetails/components/ApplicationDetailsWarningPopup.js +++ b/react/modules/templates/ApplicationDetails/components/ApplicationDetailsWarningPopup.js @@ -1,54 +1,102 @@ -import { Card, ButtonSelector, CardText, CardSubHeader, Modal, CardSectionHeader, Row } from "@egovernments/digit-ui-react-components"; +import { + ButtonSelector, + Row, +} from "@egovernments/digit-ui-react-components"; +import { Card, Modal } from "@egovernments/digit-ui-components-core"; import React from "react"; import { useTranslation } from "react-i18next"; const Close = () => ( - - - - - ); - + + + + +); + const CloseBtn = (props) => { - return ( -
- -
- ); - }; + return ( +
+ +
+ ); +}; -function ApplicationDetailsWarningPopup({ action,workflowDetails,businessService,isWarningPop,closeWarningPopup }) { -const { t } = useTranslation(); -const isMobile = window.Digit.Utils.browser.isMobile(); -return ( +function ApplicationDetailsWarningPopup({ + action, + workflowDetails, + businessService, + isWarningPop, + closeWarningPopup, +}) { + const { t } = useTranslation(); + const isMobile = window.Digit.Utils.browser.isMobile(); + return ( - {t("PT_DUES_ARE_PENDING")}} - headerBarEnd={ - { - closeWarningPopup(); - }} - /> - } - hideSubmit={true} - isDisabled={false} - popupStyles={isMobile ? {} : { width: "29%", marginTop: "auto" }} - > - -
-

{t("PT_YOU_HAVE")} ₹{action?.AmountDueForPay} {t("PT_DUE_WARNING_MSG2")}

-
- -
- - window.location.assign(`${window.location.origin}${action?.redirectionUrl?.pathname}`)} style={{ marginLeft: "10px" }} /> -
-
-
- ) + {t("PT_DUES_ARE_PENDING")} + } + headerBarEnd={ + { + closeWarningPopup(); + }} + /> + } + hideSubmit={true} + isDisabled={false} + popupStyles={isMobile ? {} : { width: "29%", marginTop: "auto" }} + > + +
+

+ {t("PT_YOU_HAVE")} ₹{action?.AmountDueForPay}{" "} + {t("PT_DUE_WARNING_MSG2")} +

+
+ +
+ + + window.location.assign( + `${window.location.origin}${action?.redirectionUrl?.pathname}` + ) + } + style={{ marginLeft: "10px" }} + /> +
+
+
+ )
-) + ); } -export default ApplicationDetailsWarningPopup; \ No newline at end of file +export default ApplicationDetailsWarningPopup; diff --git a/react/modules/templates/ApplicationDetails/components/BPADocuments.js b/react/modules/templates/ApplicationDetails/components/BPADocuments.js index 9a1febe081b..8a359f5da8d 100644 --- a/react/modules/templates/ApplicationDetails/components/BPADocuments.js +++ b/react/modules/templates/ApplicationDetails/components/BPADocuments.js @@ -1,11 +1,13 @@ import React, { useEffect, useState } from "react"; import { CardLabel, + CardSubHeader +} from "@egovernments/digit-ui-react-components"; +import { Dropdown, LabelFieldPair, MultiUploadWrapper, - CardSubHeader -} from "@egovernments/digit-ui-react-components"; +} from "@egovernments/digit-ui-components-core"; import DocumentsPreview from "./DocumentsPreview"; const BPADocuments = ({ t, formData, applicationData, docs, bpaActionsDetails }) => { diff --git a/react/modules/templates/ApplicationDetails/components/DocumentsPreview.js b/react/modules/templates/ApplicationDetails/components/DocumentsPreview.js index dfd57683def..895e8180d49 100644 --- a/react/modules/templates/ApplicationDetails/components/DocumentsPreview.js +++ b/react/modules/templates/ApplicationDetails/components/DocumentsPreview.js @@ -1,6 +1,7 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { CardSubHeader, PDFSvg } from "@egovernments/digit-ui-react-components"; +import { CardSubHeader } from "@egovernments/digit-ui-react-components"; +import { PDFSvg } from "@egovernments/digit-ui-components-core"; function DocumentsPreview({ documents, svgStyles = {}, isSendBackFlow = false, isHrLine = false, titleStyles }) { const { t } = useTranslation(); diff --git a/react/modules/templates/ApplicationDetails/components/InfoDetails.js b/react/modules/templates/ApplicationDetails/components/InfoDetails.js index 12e2f64fac6..39e89cf191b 100644 --- a/react/modules/templates/ApplicationDetails/components/InfoDetails.js +++ b/react/modules/templates/ApplicationDetails/components/InfoDetails.js @@ -1,5 +1,5 @@ import React from "react"; -import { InfoBannerIcon } from "@egovernments/digit-ui-react-components"; +import { InfoBannerIcon } from "@egovernments/digit-ui-components-core"; const EyeSvgINdex = ({ style }) => { return diff --git a/react/modules/templates/ApplicationDetails/components/NOCDocuments.js b/react/modules/templates/ApplicationDetails/components/NOCDocuments.js index 1581744f756..384af099405 100644 --- a/react/modules/templates/ApplicationDetails/components/NOCDocuments.js +++ b/react/modules/templates/ApplicationDetails/components/NOCDocuments.js @@ -1,11 +1,13 @@ import React, { useEffect, useState } from "react"; import { CardLabel, - MultiUploadWrapper, StatusTable, Row, - LabelFieldPair } from "@egovernments/digit-ui-react-components"; +import { + MultiUploadWrapper, + LabelFieldPair +} from "@egovernments/digit-ui-components-core"; import DocumentsPreview from "./DocumentsPreview"; function SelectDocument({ diff --git a/react/modules/templates/ApplicationDetails/components/PermissionCheck.js b/react/modules/templates/ApplicationDetails/components/PermissionCheck.js index 89007789722..69f7e4bac64 100644 --- a/react/modules/templates/ApplicationDetails/components/PermissionCheck.js +++ b/react/modules/templates/ApplicationDetails/components/PermissionCheck.js @@ -1,4 +1,5 @@ -import { CheckBox, LinkButton, TextInput,Close, CardSubHeader } from "@egovernments/digit-ui-react-components"; +import { LinkButton, CardSubHeader } from "@egovernments/digit-ui-react-components"; +import { CheckBox, TextInput,Close } from "@egovernments/digit-ui-components-core"; import React, { useEffect, useState } from "react"; const PermissionCheck = ({ permissions, t }) => { diff --git a/react/modules/templates/ApplicationDetails/components/PropertyDocuments.js b/react/modules/templates/ApplicationDetails/components/PropertyDocuments.js index ea8cd1eb104..1fbb04bd704 100644 --- a/react/modules/templates/ApplicationDetails/components/PropertyDocuments.js +++ b/react/modules/templates/ApplicationDetails/components/PropertyDocuments.js @@ -1,6 +1,7 @@ import React, { useState, useEffect } from "react"; import { useTranslation } from "react-i18next"; -import { CardSubHeader, PDFSvg } from "@egovernments/digit-ui-react-components"; +import { CardSubHeader } from "@egovernments/digit-ui-react-components"; +import { PDFSvg } from "@egovernments/digit-ui-components-core"; // const PDFSvg = ({ width = 34, height = 34, style, viewBox = "0 0 34 34" }) => ( // diff --git a/react/modules/templates/ApplicationDetails/components/ScruntinyDetails.js b/react/modules/templates/ApplicationDetails/components/ScruntinyDetails.js index bde27623ba8..952205aac99 100644 --- a/react/modules/templates/ApplicationDetails/components/ScruntinyDetails.js +++ b/react/modules/templates/ApplicationDetails/components/ScruntinyDetails.js @@ -1,4 +1,5 @@ -import { StatusTable, Row, PDFSvg, CardLabel, CardSubHeader } from "@egovernments/digit-ui-react-components"; +import { StatusTable, Row, CardLabel, CardSubHeader } from "@egovernments/digit-ui-react-components"; +import { PDFSvg } from "@egovernments/digit-ui-components-core"; import React, { Fragment } from "react"; import { useTranslation } from "react-i18next"; diff --git a/react/modules/templates/ApplicationDetails/components/SubWorkTableDetails.js b/react/modules/templates/ApplicationDetails/components/SubWorkTableDetails.js index 08b89e68419..b978e244203 100644 --- a/react/modules/templates/ApplicationDetails/components/SubWorkTableDetails.js +++ b/react/modules/templates/ApplicationDetails/components/SubWorkTableDetails.js @@ -1,4 +1,4 @@ -import { EditIcon } from '@egovernments/digit-ui-react-components'; +import { EditIcon } from '@egovernments/digit-ui-components-core'; import React from 'react' import { useTranslation } from "react-i18next"; import { useHistory } from 'react-router-dom'; diff --git a/react/modules/templates/ApplicationDetails/components/TLCaption.js b/react/modules/templates/ApplicationDetails/components/TLCaption.js index e5fbcde20cd..a3479f7aa3f 100644 --- a/react/modules/templates/ApplicationDetails/components/TLCaption.js +++ b/react/modules/templates/ApplicationDetails/components/TLCaption.js @@ -1,6 +1,7 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { TelePhone, DisplayPhotos, UnMaskComponent } from "@egovernments/digit-ui-react-components"; +import {UnMaskComponent,TelePhone} from "@egovernments/digit-ui-react-components"; +import { DisplayPhotos } from "@egovernments/digit-ui-components-core"; import Reason from "./Reason"; const TLCaption = ({ data,OpenImage,privacy={}}) => { diff --git a/react/modules/templates/ApplicationDetails/components/ViewBreakup.js b/react/modules/templates/ApplicationDetails/components/ViewBreakup.js index 5608aeb2d2a..c3ed95a7614 100644 --- a/react/modules/templates/ApplicationDetails/components/ViewBreakup.js +++ b/react/modules/templates/ApplicationDetails/components/ViewBreakup.js @@ -1,6 +1,7 @@ import React, { useState, Fragment } from "react"; import { useTranslation } from "react-i18next"; -import { CardSectionHeader, Modal, Row, StatusTable } from "@egovernments/digit-ui-react-components"; +import { CardSectionHeader, Row, StatusTable } from "@egovernments/digit-ui-react-components"; +import { Modal } from "@egovernments/digit-ui-components-core"; const ViewBreakup = ({ wsAdditionalDetails, workflowDetails }) => { const { t } = useTranslation(); diff --git a/react/modules/templates/ApplicationDetails/components/WSFeeEstimation.js b/react/modules/templates/ApplicationDetails/components/WSFeeEstimation.js index 9a4fe591f9d..2f0d53b1c82 100644 --- a/react/modules/templates/ApplicationDetails/components/WSFeeEstimation.js +++ b/react/modules/templates/ApplicationDetails/components/WSFeeEstimation.js @@ -1,7 +1,7 @@ import React, { useState, Fragment, useEffect } from "react"; import { useTranslation } from "react-i18next"; -import { Card, CardSectionHeader, CardLabel } from "@egovernments/digit-ui-react-components"; -import { Modal, Dropdown, Row, StatusTable, TextInput, Toast } from "@egovernments/digit-ui-react-components"; +import { Card, CardSectionHeader, CardLabel,Row, StatusTable } from "@egovernments/digit-ui-react-components"; +import { Modal, Dropdown, TextInput,Toast } from "@egovernments/digit-ui-components-core"; import cloneDeep from "lodash/cloneDeep"; const Penality_menu = [ diff --git a/react/modules/templates/ApplicationDetails/config/AcceptDso.js b/react/modules/templates/ApplicationDetails/config/AcceptDso.js index e870f2e9a67..962da71ec18 100644 --- a/react/modules/templates/ApplicationDetails/config/AcceptDso.js +++ b/react/modules/templates/ApplicationDetails/config/AcceptDso.js @@ -1,5 +1,5 @@ import React from "react"; -import { Dropdown } from "@egovernments/digit-ui-react-components"; +import { Dropdown } from "@egovernments/digit-ui-components-core"; export const configAcceptDso = ({ t, dsoData, dso, selectVehicleNo, vehicleNoList, vehicleNo, vehicle, action }) => { return { diff --git a/react/modules/templates/ApplicationDetails/config/AssignDso.js b/react/modules/templates/ApplicationDetails/config/AssignDso.js index 418caf1e4bc..bf8864ecff5 100644 --- a/react/modules/templates/ApplicationDetails/config/AssignDso.js +++ b/react/modules/templates/ApplicationDetails/config/AssignDso.js @@ -1,5 +1,6 @@ import React from "react"; -import { DatePicker, Dropdown, CardLabelError } from "@egovernments/digit-ui-react-components"; +import {CardLabelError } from "@egovernments/digit-ui-react-components"; +import { DatePicker, Dropdown } from "@egovernments/digit-ui-components-core"; function todayDate() { var today = new Date(); diff --git a/react/modules/templates/ApplicationDetails/config/BPAApproverApplication.js b/react/modules/templates/ApplicationDetails/config/BPAApproverApplication.js index ca66865bb77..d2db7154b4a 100644 --- a/react/modules/templates/ApplicationDetails/config/BPAApproverApplication.js +++ b/react/modules/templates/ApplicationDetails/config/BPAApproverApplication.js @@ -1,4 +1,5 @@ -import { Dropdown, UploadFile } from "@egovernments/digit-ui-react-components"; +import { UploadFile } from "@egovernments/digit-ui-react-components"; +import { Dropdown } from "@egovernments/digit-ui-components-core"; import React from "react"; export const configBPAApproverApplication = ({ diff --git a/react/modules/templates/ApplicationDetails/config/BPAREGApproverApplication.js b/react/modules/templates/ApplicationDetails/config/BPAREGApproverApplication.js index 0bdba14bc5b..7269ecb9a20 100644 --- a/react/modules/templates/ApplicationDetails/config/BPAREGApproverApplication.js +++ b/react/modules/templates/ApplicationDetails/config/BPAREGApproverApplication.js @@ -1,4 +1,5 @@ -import { Dropdown, UploadFile } from "@egovernments/digit-ui-react-components"; +import { UploadFile } from "@egovernments/digit-ui-react-components"; +import { Dropdown } from "@egovernments/digit-ui-components-core"; import React from "react"; export const configBPAREGApproverApplication = ({ diff --git a/react/modules/templates/ApplicationDetails/config/CompleteApplication.js b/react/modules/templates/ApplicationDetails/config/CompleteApplication.js index a4c7c96b2fd..66124cb525f 100644 --- a/react/modules/templates/ApplicationDetails/config/CompleteApplication.js +++ b/react/modules/templates/ApplicationDetails/config/CompleteApplication.js @@ -1,5 +1,5 @@ import React from "react"; -import { DatePicker } from "@egovernments/digit-ui-react-components"; +import { DatePicker } from "@egovernments/digit-ui-components-core"; export const configCompleteApplication = ({ t, vehicle, applicationCreatedTime = 0, action }) => ({ label: { diff --git a/react/modules/templates/ApplicationDetails/config/NOCApproverApplication.js b/react/modules/templates/ApplicationDetails/config/NOCApproverApplication.js index 12922b0575e..4d023201917 100644 --- a/react/modules/templates/ApplicationDetails/config/NOCApproverApplication.js +++ b/react/modules/templates/ApplicationDetails/config/NOCApproverApplication.js @@ -1,4 +1,5 @@ -import { Dropdown, UploadFile } from "@egovernments/digit-ui-react-components"; +import { UploadFile } from "@egovernments/digit-ui-react-components"; +import { Dropdown } from "@egovernments/digit-ui-components-core"; import React from "react"; export const configNOCApproverApplication = ({ diff --git a/react/modules/templates/ApplicationDetails/config/PTApproverApplication.js b/react/modules/templates/ApplicationDetails/config/PTApproverApplication.js index afcc6a19be2..147eb4794dd 100644 --- a/react/modules/templates/ApplicationDetails/config/PTApproverApplication.js +++ b/react/modules/templates/ApplicationDetails/config/PTApproverApplication.js @@ -1,4 +1,5 @@ -import { Dropdown, UploadFile } from "@egovernments/digit-ui-react-components"; +import { UploadFile } from "@egovernments/digit-ui-react-components"; +import { Dropdown } from "@egovernments/digit-ui-components-core"; import React from "react"; export const configPTApproverApplication = ({ diff --git a/react/modules/templates/ApplicationDetails/config/PTAssessProperty.js b/react/modules/templates/ApplicationDetails/config/PTAssessProperty.js index dd04037aab6..01572eee875 100644 --- a/react/modules/templates/ApplicationDetails/config/PTAssessProperty.js +++ b/react/modules/templates/ApplicationDetails/config/PTAssessProperty.js @@ -1,5 +1,5 @@ import React from "react"; -import { RadioButtons } from "@egovernments/digit-ui-react-components"; +import { RadioButtons } from "@egovernments/digit-ui-components-core"; export const configPTAssessProperty = ({ t, action, financialYears, selectedFinancialYear, setSelectedFinancialYear }) => { return { diff --git a/react/modules/templates/ApplicationDetails/config/ReassignDso.js b/react/modules/templates/ApplicationDetails/config/ReassignDso.js index 132a5bc6a7c..f2ee1e416c2 100644 --- a/react/modules/templates/ApplicationDetails/config/ReassignDso.js +++ b/react/modules/templates/ApplicationDetails/config/ReassignDso.js @@ -1,5 +1,5 @@ import React from "react"; -import { Dropdown } from "@egovernments/digit-ui-react-components"; +import { Dropdown } from "@egovernments/digit-ui-components-core"; function getFilteredDsoData(dsoData, vehicle) { return dsoData?.filter((e) => e.vehicles?.find((veh) => veh?.type == vehicle?.code)); diff --git a/react/modules/templates/ApplicationDetails/config/RejectApplication.js b/react/modules/templates/ApplicationDetails/config/RejectApplication.js index a18bdaf1110..a3f73c899bf 100644 --- a/react/modules/templates/ApplicationDetails/config/RejectApplication.js +++ b/react/modules/templates/ApplicationDetails/config/RejectApplication.js @@ -1,5 +1,5 @@ import React from "react"; -import { Dropdown } from "@egovernments/digit-ui-react-components"; +import { Dropdown } from "@egovernments/digit-ui-components-core"; export const configRejectApplication = ({ t, rejectMenu, setReason, reason, action }) => { return { diff --git a/react/modules/templates/ApplicationDetails/config/TLApproverApplication.js b/react/modules/templates/ApplicationDetails/config/TLApproverApplication.js index 23b20e5be2b..36ec11f246b 100644 --- a/react/modules/templates/ApplicationDetails/config/TLApproverApplication.js +++ b/react/modules/templates/ApplicationDetails/config/TLApproverApplication.js @@ -1,4 +1,5 @@ -import { Dropdown, UploadFile } from "@egovernments/digit-ui-react-components"; +import { UploadFile } from "@egovernments/digit-ui-react-components"; +import { Dropdown } from "@egovernments/digit-ui-components-core"; import React from "react"; export const configTLApproverApplication = ({ diff --git a/react/modules/templates/ApplicationDetails/config/WSApproverApplication.js b/react/modules/templates/ApplicationDetails/config/WSApproverApplication.js index 2f5f2d45a6a..452805c45a6 100644 --- a/react/modules/templates/ApplicationDetails/config/WSApproverApplication.js +++ b/react/modules/templates/ApplicationDetails/config/WSApproverApplication.js @@ -1,4 +1,5 @@ -import { Dropdown, UploadFile } from "@egovernments/digit-ui-react-components"; +import { UploadFile } from "@egovernments/digit-ui-react-components"; +import { Dropdown } from "@egovernments/digit-ui-components-core"; import React from "react"; export const configWSApproverApplication = ({ diff --git a/react/modules/templates/ApplicationDetails/config/WSDisconnectApplication.js b/react/modules/templates/ApplicationDetails/config/WSDisconnectApplication.js index 5acdcebe041..442a76bacc8 100644 --- a/react/modules/templates/ApplicationDetails/config/WSDisconnectApplication.js +++ b/react/modules/templates/ApplicationDetails/config/WSDisconnectApplication.js @@ -1,4 +1,5 @@ -import { Dropdown, UploadFile, DatePicker } from "@egovernments/digit-ui-react-components"; +import { UploadFile } from "@egovernments/digit-ui-react-components"; +import { Dropdown ,DatePicker} from "@egovernments/digit-ui-components-core"; import React from "react"; export const configWSDisConnectApplication = ({ diff --git a/react/modules/templates/ApplicationDetails/config/configApproveModal.js b/react/modules/templates/ApplicationDetails/config/configApproveModal.js index 03beb885925..b131aa6521d 100644 --- a/react/modules/templates/ApplicationDetails/config/configApproveModal.js +++ b/react/modules/templates/ApplicationDetails/config/configApproveModal.js @@ -1,4 +1,4 @@ -import { Dropdown } from '@egovernments/digit-ui-react-components'; +import { Dropdown } from '@egovernments/digit-ui-components-core'; import React, { useState } from 'react' const configApproveModal = ({ diff --git a/react/modules/templates/ApplicationDetails/config/configAttendanceRejectModal.js b/react/modules/templates/ApplicationDetails/config/configAttendanceRejectModal.js index c732127aac7..184dd20713c 100644 --- a/react/modules/templates/ApplicationDetails/config/configAttendanceRejectModal.js +++ b/react/modules/templates/ApplicationDetails/config/configAttendanceRejectModal.js @@ -1,4 +1,5 @@ -import { LabelFieldPair,CardLabel} from '@egovernments/digit-ui-react-components'; +import { CardLabel} from '@egovernments/digit-ui-react-components'; +import { LabelFieldPair} from '@egovernments/digit-ui-components-core'; import React from 'react' const configAttendanceRejectModal = ({ diff --git a/react/modules/templates/ApplicationDetails/config/configCheckModal.js b/react/modules/templates/ApplicationDetails/config/configCheckModal.js index c267eb9f32f..ea7b046394b 100644 --- a/react/modules/templates/ApplicationDetails/config/configCheckModal.js +++ b/react/modules/templates/ApplicationDetails/config/configCheckModal.js @@ -1,4 +1,4 @@ -import { Dropdown,Loader } from '@egovernments/digit-ui-react-components'; +import { Dropdown,Loader } from '@egovernments/digit-ui-components-core'; import React,{useState} from 'react' const configCheckModal = ({ diff --git a/react/modules/templates/ApplicationDetails/config/configRejectModal.js b/react/modules/templates/ApplicationDetails/config/configRejectModal.js index ae4be5af3fd..4aadb0d7042 100644 --- a/react/modules/templates/ApplicationDetails/config/configRejectModal.js +++ b/react/modules/templates/ApplicationDetails/config/configRejectModal.js @@ -1,4 +1,5 @@ -import { Dropdown,LabelFieldPair,CardLabel} from '@egovernments/digit-ui-react-components'; +import { CardLabel} from '@egovernments/digit-ui-react-components'; +import { Dropdown,LabelFieldPair} from '@egovernments/digit-ui-components-core'; import React, { useState } from 'react' const configRejectModal = ({ diff --git a/react/modules/templates/ApplicationDetails/config/configViewBillApproveModal.js b/react/modules/templates/ApplicationDetails/config/configViewBillApproveModal.js index cd01fdc4414..cfcbec0a290 100644 --- a/react/modules/templates/ApplicationDetails/config/configViewBillApproveModal.js +++ b/react/modules/templates/ApplicationDetails/config/configViewBillApproveModal.js @@ -1,5 +1,6 @@ import React from 'react' -import { LabelFieldPair,CardLabel} from '@egovernments/digit-ui-react-components'; +import { CardLabel} from '@egovernments/digit-ui-react-components'; +import { LabelFieldPair} from '@egovernments/digit-ui-components-core'; const configViewBillApprovalModal = ({ t, diff --git a/react/modules/templates/ApplicationDetails/config/configViewBillCheckModal.js b/react/modules/templates/ApplicationDetails/config/configViewBillCheckModal.js index 53204b28e75..f2153ac0be5 100644 --- a/react/modules/templates/ApplicationDetails/config/configViewBillCheckModal.js +++ b/react/modules/templates/ApplicationDetails/config/configViewBillCheckModal.js @@ -1,4 +1,4 @@ -import { Dropdown, Loader } from '@egovernments/digit-ui-react-components'; +import { Dropdown, Loader } from '@egovernments/digit-ui-components-core'; import React, { useState } from 'react' const configViewBillCheckModal = ({ diff --git a/react/modules/templates/ApplicationDetails/config/configViewBillRejectModal.js b/react/modules/templates/ApplicationDetails/config/configViewBillRejectModal.js index 716d6179d10..e4d92b88007 100644 --- a/react/modules/templates/ApplicationDetails/config/configViewBillRejectModal.js +++ b/react/modules/templates/ApplicationDetails/config/configViewBillRejectModal.js @@ -1,5 +1,6 @@ import React from 'react' -import { LabelFieldPair,CardLabel} from '@egovernments/digit-ui-react-components'; +import { CardLabel} from '@egovernments/digit-ui-react-components'; +import { LabelFieldPair} from '@egovernments/digit-ui-components-core'; const configViewBillRejectModal = ({ t, diff --git a/react/modules/templates/ApplicationDetails/index.js b/react/modules/templates/ApplicationDetails/index.js index feb622ab712..2b71fd6faeb 100644 --- a/react/modules/templates/ApplicationDetails/index.js +++ b/react/modules/templates/ApplicationDetails/index.js @@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next"; import { useQueryClient } from "react-query"; import { format } from "date-fns"; -import { Loader } from "@egovernments/digit-ui-react-components"; +import { Loader } from "@egovernments/digit-ui-components-core"; import ActionModal from "./Modal"; diff --git a/react/yarn.lock b/react/yarn.lock index 83b5cc255bd..e370257f4d1 100644 --- a/react/yarn.lock +++ b/react/yarn.lock @@ -1536,11 +1536,44 @@ resolved "https://registry.yarnpkg.com/@csstools/normalize.css/-/normalize.css-10.1.0.tgz#f0950bba18819512d42f7197e56c518aa491cf18" integrity sha512-ij4wRiunFfaJxjB0BdrYHIH8FxBJpOwNPhhAcunlmPdXudL1WQV1qoP9un6JsEBAgQH+7UXyyjh0g7jTxXK6tg== +"@cyntler/react-doc-viewer@1.10.3": + version "1.10.3" + resolved "https://registry.yarnpkg.com/@cyntler/react-doc-viewer/-/react-doc-viewer-1.10.3.tgz#37ef8da5e38dd15e6791230ba8f1bd3c9cccbc61" + integrity sha512-ykJTCGtSYywAPDhMPtnSr5GrsFhV6lUgruU9Ur/TmSHS+au92c++t+8ZJNSq1DOwtFBqMv3rvYzhGLVkXYEXtg== + dependencies: + "@types/mustache" "^4.2.2" + "@types/papaparse" "^5.3.5" + mustache "^4.2.0" + papaparse "^5.3.2" + react-pdf "5.7.2" + styled-components "^5.3.6" + "@discoveryjs/json-ext@^0.5.3": version "0.5.7" resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== +"@egovernments/digit-ui-libraries@1.7.10": + version "1.7.10" + resolved "https://registry.yarnpkg.com/@egovernments/digit-ui-libraries/-/digit-ui-libraries-1.7.10.tgz#e97706a7c39f4bad6aeea3c6748a5f69ee622ad0" + integrity sha512-AdCpLa3tSXZm9zA5MQUtvcCUhHwoDwk4EXT7/8mw5djSxj0GHHTm3iitV6Up4FzO809qizaE2lwqvy9cOAuQoA== + dependencies: + axios "0.21.1" + babel-preset-react "6.24.1" + date-fns "2.28.0" + dom-to-image "2.6.0" + html2canvas "1.4.1" + i18next "19.9.2" + i18next-react-postprocessor "3.0.7" + pdfmake "0.1.72" + react "17.0.2" + react-i18next "11.16.2" + react-query "3.6.1" + react-redux "7.2.8" + react-router-dom "5.3.0" + redux "4.1.2" + xlsx "0.17.5" + "@egovernments/digit-ui-react-components@1.5.24": version "1.5.24" resolved "https://registry.yarnpkg.com/@egovernments/digit-ui-react-components/-/digit-ui-react-components-1.5.24.tgz#d713e3b00f9b634c4f3c7b9f0ec9d031949520fe" @@ -1552,12 +1585,13 @@ react-i18next "11.16.2" react-table "7.7.0" -"@egovernments/digit-ui-react-components@1.7.10": - version "1.7.10" - resolved "https://registry.yarnpkg.com/@egovernments/digit-ui-react-components/-/digit-ui-react-components-1.7.10.tgz#d58ccbe4438c3d1fb55d4325cb478f09a2a245a2" - integrity sha512-kFnHbKJssfgiWfN+c6O7qXUkdW3XDfn+kmK6kgOhEble1jO8Z6v0CZsQWj0eoPM53H3qV24UbeP0BEFkBHFMDA== +"@egovernments/digit-ui-react-components@1.8.1-beta.4": + version "1.8.1-beta.4" + resolved "https://registry.yarnpkg.com/@egovernments/digit-ui-react-components/-/digit-ui-react-components-1.8.1-beta.4.tgz#c69f9205c34b402d67d26da0c08f0478e9e9b64b" + integrity sha512-oOfo6U9AW94C59TOjfIOg7pYAFvCV9gtUgARaU+2QkaLPlPr8NyHorCWmRBJeaSBRSE4wjlT+jA/IVPLuwcG8w== dependencies: - "@egovernments/digit-ui-svg-components" "1.0.0-beta" + "@cyntler/react-doc-viewer" "1.10.3" + "@egovernments/digit-ui-svg-components" "1.0.0" "@googlemaps/js-api-loader" "1.13.10" "@hookform/resolvers" "1.3.7" ajv "^8.12.0" @@ -1568,6 +1602,7 @@ react-drag-drop-files "^2.3.10" react-hook-form "6.15.8" react-i18next "11.16.2" + react-joyride "2.5.5" react-table "7.7.0" "@egovernments/digit-ui-react-components@^1.5.0": @@ -1598,11 +1633,6 @@ resolved "https://registry.yarnpkg.com/@egovernments/digit-ui-svg-components/-/digit-ui-svg-components-1.0.0.tgz#0f7f54ebbf26db9a4f45c646256c75f7abaa9a03" integrity sha512-UArJzdg8Klr0AUja2uWWwi0ygdon67Mg7yER2FGfSf+n/czG9Aoa1z+lunyB0KcQKj7epRbh/n3FRByV7G9/Ig== -"@egovernments/digit-ui-svg-components@1.0.0-beta": - version "1.0.0-beta" - resolved "https://registry.yarnpkg.com/@egovernments/digit-ui-svg-components/-/digit-ui-svg-components-1.0.0-beta.tgz#cbe965afd3aefc47ff9f41c4961382ee2792cb03" - integrity sha512-2Mhq057YbtyAbdp6lV3WD4d8lH7At+vr7fqljVGE4ZpRt+2y466SwVzS5YRB6prlIQBNv6NT+pePbQVma4TgOQ== - "@emotion/cache@^10.0.27": version "10.0.29" resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-10.0.29.tgz#87e7e64f412c060102d589fe7c6dc042e6f9d1e0" @@ -1745,6 +1775,11 @@ resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== +"@gilbarbara/deep-equal@^0.1.1": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@gilbarbara/deep-equal/-/deep-equal-0.1.2.tgz#1a106721368dba5e7e9fb7e9a3a6f9efbd8df36d" + integrity sha512-jk+qzItoEb0D0xSSmrKDDzf9sheQj/BAPxlgNxgmOaA3mxpUa6ndJLYGZKsJnIVEQSD8zcTbyILz7I0HcnBCRA== + "@googlemaps/js-api-loader@1.13.10": version "1.13.10" resolved "https://registry.yarnpkg.com/@googlemaps/js-api-loader/-/js-api-loader-1.13.10.tgz#499cb58b9dcf8d29101d6d113650b27a55c70ae5" @@ -3385,6 +3420,11 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== +"@types/mustache@^4.2.2": + version "4.2.5" + resolved "https://registry.yarnpkg.com/@types/mustache/-/mustache-4.2.5.tgz#9129f0d6857f976e00e171bbb3460e4b702f84ef" + integrity sha512-PLwiVvTBg59tGFL/8VpcGvqOu3L4OuveNvPi0EYbWchRdEVP++yRUXJPFl+CApKEq13017/4Nf7aQ5lTtHUNsA== + "@types/node-fetch@^2.5.7": version "2.6.11" resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.11.tgz#9b39b78665dae0e82a08f02f4967d62c66f95d24" @@ -3422,6 +3462,13 @@ resolved "https://registry.yarnpkg.com/@types/overlayscrollbars/-/overlayscrollbars-1.12.5.tgz#a68a4caa4d1d108a40937fae81f6d500c8300383" integrity sha512-1yMmgFrq1DQ3sCHyb3DNfXnE0dB463MjG47ugX3cyade3sOt3U8Fjxk/Com0JJguTLPtw766TSDaO4NC65Wgkw== +"@types/papaparse@^5.3.5": + version "5.3.14" + resolved "https://registry.yarnpkg.com/@types/papaparse/-/papaparse-5.3.14.tgz#345cc2a675a90106ff1dc33b95500dfb30748031" + integrity sha512-LxJ4iEFcpqc6METwp9f6BV6VVc43m6MfH0VqFosHvrUgfXiFe6ww7R3itkOQ+TCK6Y+Iv/+RnnvtRZnkc5Kc9g== + dependencies: + "@types/node" "*" + "@types/parse-json@^4.0.0": version "4.0.2" resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.2.tgz#5950e50960793055845e956c427fc2b0d70c5239" @@ -6838,7 +6885,7 @@ deep-object-diff@^1.1.0: resolved "https://registry.yarnpkg.com/deep-object-diff/-/deep-object-diff-1.1.9.tgz#6df7ef035ad6a0caa44479c536ed7b02570f4595" integrity sha512-Rn+RuwkmkDwCi2/oXOFS9Gsr5lJZu/yTGpK7wAaAIE75CC+LCGEZHpY6VQJa/RoJcrmaA/docWJZvYohlNkWPA== -deepmerge@^4.2.2: +deepmerge@^4.2.2, deepmerge@^4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== @@ -8046,6 +8093,11 @@ execa@^5.1.1: signal-exit "^3.0.3" strip-final-newline "^2.0.0" +exenv@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/exenv/-/exenv-1.2.2.tgz#2ae78e85d9894158670b03d47bec1f03bd91bb9d" + integrity sha512-Z+ktTxTwv9ILfgKCk32OX3n/doe+OcLTRtqK9pcL+JsP3J1/VW8Uvl4ZjLlKqeW4rzK4oesDOGMEMRIZqtP4Iw== + exit-on-epipe@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz#0bdd92e87d5285d267daa8171d0eb06159689692" @@ -8309,7 +8361,7 @@ file-loader@6.1.1: loader-utils "^2.0.0" schema-utils "^3.0.0" -file-loader@^6.2.0: +file-loader@^6.0.0, file-loader@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.2.0.tgz#baef7cf8e1840df325e4390b4484879480eebe4d" integrity sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw== @@ -10402,6 +10454,16 @@ is-hexadecimal@^1.0.0: resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz#cc35c97588da4bd49a8eedd6bc4082d44dcb23a7" integrity sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw== +is-lite@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/is-lite/-/is-lite-0.8.2.tgz#26ab98b32aae8cc8b226593b9a641d2bf4bd3b6a" + integrity sha512-JZfH47qTsslwaAsqbMI3Q6HNNjUuq6Cmzzww50TdP5Esb6e1y2sK2UAaZZuzfAzpoI2AkxoPQapZdlDuP6Vlsw== + +is-lite@^0.9.2: + version "0.9.3" + resolved "https://registry.yarnpkg.com/is-lite/-/is-lite-0.9.3.tgz#b59cbc7b12e164bc68f263fd32b3d37150cc93bf" + integrity sha512-lbyynwsRRUMh1fHEinXkde/thdjj8OpW/okyGAVgmW4r/FkCEP966oSEg0B8ON5+mm73MJjFXB4ZViuaAldw4g== + is-map@^2.0.2, is-map@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.3.tgz#ede96b7fe1e270b3c4465e3a465658764926d62e" @@ -11839,6 +11901,11 @@ magic-string@^0.25.0, magic-string@^0.25.2, magic-string@^0.25.7: dependencies: sourcemap-codec "^1.4.8" +make-cancellable-promise@^1.0.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/make-cancellable-promise/-/make-cancellable-promise-1.3.2.tgz#993c8c8b79cff13c74fa93de0bd8a17fe66685c1" + integrity sha512-GCXh3bq/WuMbS+Ky4JBPW1hYTOU+znU+Q5m9Pu+pI8EoUqIHk9+tviOKC6/qhHh8C4/As3tzJ69IF32kdz85ww== + make-dir@^2.0.0, make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -11861,6 +11928,11 @@ make-dir@^4.0.0: dependencies: semver "^7.5.3" +make-event-props@^1.1.0: + version "1.6.2" + resolved "https://registry.yarnpkg.com/make-event-props/-/make-event-props-1.6.2.tgz#c8e0e48eb28b9b808730de38359f6341de7ec5a2" + integrity sha512-iDwf7mA03WPiR8QxvcVHmVWEPfMY1RZXerDVNCRYW7dUr2ppH3J58Rwb39/WG39yTZdRSxr3x+2v22tvI0VEvA== + make-iterator@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6" @@ -12060,11 +12132,21 @@ meow@^3.7.0: redent "^1.0.0" trim-newlines "^1.0.0" +merge-class-names@^1.1.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/merge-class-names/-/merge-class-names-1.4.2.tgz#78d6d95ab259e7e647252a7988fd25a27d5a8835" + integrity sha512-bOl98VzwCGi25Gcn3xKxnR5p/WrhWFQB59MS/aGENcmUc6iSm96yrFDF0XSNurX9qN4LbJm0R9kfvsQ17i8zCw== + merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== +merge-refs@^1.0.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/merge-refs/-/merge-refs-1.2.2.tgz#6142633398dd0d10a37626cae77ddeb1db26db0c" + integrity sha512-RwcT7GsQR3KbuLw1rRuodq4Nt547BKEBkliZ0qqsrpyNne9bGTFtsFIsIpx82huWhcl3kOlOlH4H0xkPk/DqVw== + merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" @@ -12392,6 +12474,11 @@ multicast-dns@^6.0.1: dns-packet "^1.3.1" thunky "^1.0.2" +mustache@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/mustache/-/mustache-4.2.0.tgz#e5892324d60a12ec9c2a73359edca52972bf6f64" + integrity sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ== + mute-stdout@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" @@ -13128,6 +13215,11 @@ pako@~1.0.5: resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== +papaparse@^5.3.2: + version "5.4.1" + resolved "https://registry.yarnpkg.com/papaparse/-/papaparse-5.4.1.tgz#f45c0f871853578bd3a30f92d96fdcfb6ebea127" + integrity sha512-HipMsgJkZu8br23pW15uvo6sib6wne/4woLZPlFf3rpDyMe9ywEXUsuD7+6K9PRkJlVT51j/sCOYDKGGS3ZJrw== + parallel-transform@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.2.0.tgz#9049ca37d6cb2182c3b1d2c720be94d14a5814fc" @@ -13351,6 +13443,11 @@ pbkdf2@^3.0.3, pbkdf2@^3.1.2: safe-buffer "^5.0.1" sha.js "^2.4.8" +pdfjs-dist@2.12.313: + version "2.12.313" + resolved "https://registry.yarnpkg.com/pdfjs-dist/-/pdfjs-dist-2.12.313.tgz#62f2273737bb956267ae2e02cdfaddcb1099819c" + integrity sha512-1x6iXO4Qnv6Eb+YFdN5JdUzt4pAkxSp3aLAYPX93eQCyg/m7QFzXVWJHJVtoW48CI8HCXju4dSkhQZwoheL5mA== + pdfkit@>=0.8.1: version "0.14.0" resolved "https://registry.yarnpkg.com/pdfkit/-/pdfkit-0.14.0.tgz#1416633d48b1271b8059e7f0f7675635fd42a53e" @@ -13524,6 +13621,11 @@ polished@^4.0.5: dependencies: "@babel/runtime" "^7.17.8" +popper.js@^1.16.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b" + integrity sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ== + portfinder@^1.0.26: version "1.0.32" resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.32.tgz#2fe1b9e58389712429dc2bea5beb2146146c7f81" @@ -14951,6 +15053,17 @@ react-fast-compare@^3.0.1, react-fast-compare@^3.2.0: resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.2.tgz#929a97a532304ce9fee4bcae44234f1ce2c21d49" integrity sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ== +react-floater@^0.7.6: + version "0.7.9" + resolved "https://registry.yarnpkg.com/react-floater/-/react-floater-0.7.9.tgz#b15a652e817f200bfa42a2023ee8d3105803b968" + integrity sha512-NXqyp9o8FAXOATOEo0ZpyaQ2KPb4cmPMXGWkx377QtJkIXHlHRAGer7ai0r0C1kG5gf+KJ6Gy+gdNIiosvSicg== + dependencies: + deepmerge "^4.3.1" + is-lite "^0.8.2" + popper.js "^1.16.0" + prop-types "^15.8.1" + tree-changes "^0.9.1" + react-helmet-async@^1.0.7: version "1.3.0" resolved "https://registry.yarnpkg.com/react-helmet-async/-/react-helmet-async-1.3.0.tgz#7bd5bf8c5c69ea9f02f6083f14ce33ef545c222e" @@ -14995,6 +15108,21 @@ react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== +react-joyride@2.5.5: + version "2.5.5" + resolved "https://registry.yarnpkg.com/react-joyride/-/react-joyride-2.5.5.tgz#a12024902347bea0a565ad2e69b291e35c6a274b" + integrity sha512-/esW9IcsuQJr4NcRZJUH8UYYTvB/yzVC0IyElopbjMFYPw3aylSny91QO3mQRRKPQJUqYa6wREOtQpsaLbu9fw== + dependencies: + deepmerge "^4.3.1" + exenv "^1.2.2" + is-lite "^0.9.2" + prop-types "^15.8.1" + react-floater "^0.7.6" + react-is "^16.13.1" + scroll "^3.0.1" + scrollparent "^2.1.0" + tree-changes "^0.9.2" + react-list@^0.8.13: version "0.8.17" resolved "https://registry.yarnpkg.com/react-list/-/react-list-0.8.17.tgz#49f55af2797cfdf3974ad2188a191e0ee919d254" @@ -15002,6 +15130,22 @@ react-list@^0.8.13: dependencies: prop-types "15" +react-pdf@5.7.2: + version "5.7.2" + resolved "https://registry.yarnpkg.com/react-pdf/-/react-pdf-5.7.2.tgz#c458dedf7983822668b40dcac1eae052c1f6e056" + integrity sha512-hdDwvf007V0i2rPCqQVS1fa70CXut17SN3laJYlRHzuqcu8sLLjEoeXihty6c0Ev5g1mw31b8OT8EwRw1s8C4g== + dependencies: + "@babel/runtime" "^7.0.0" + file-loader "^6.0.0" + make-cancellable-promise "^1.0.0" + make-event-props "^1.1.0" + merge-class-names "^1.1.1" + merge-refs "^1.0.0" + pdfjs-dist "2.12.313" + prop-types "^15.6.2" + tiny-invariant "^1.0.0" + tiny-warning "^1.0.0" + react-popper-tooltip@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/react-popper-tooltip/-/react-popper-tooltip-3.1.1.tgz#329569eb7b287008f04fcbddb6370452ad3f9eac" @@ -16129,6 +16273,16 @@ schema-utils@^3.0.0, schema-utils@^3.1.1: ajv "^6.12.5" ajv-keywords "^3.5.2" +scroll@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/scroll/-/scroll-3.0.1.tgz#d5afb59fb3592ee3df31c89743e78b39e4cd8a26" + integrity sha512-pz7y517OVls1maEzlirKO5nPYle9AXsFzTMNJrRGmT951mzpIBy7sNHOg5o/0MQd/NqliCiWnAi0kZneMPFLcg== + +scrollparent@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/scrollparent/-/scrollparent-2.1.0.tgz#6cae915c953835886a6ba0d77fdc2bb1ed09076d" + integrity sha512-bnnvJL28/Rtz/kz2+4wpBjHzWoEzXhVg/TE8BeVGJHUqE8THNIRnDxDWMktwM+qahvlRdvlLdsQfYe+cuqfZeA== + scss-tokenizer@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz#8eb06db9a9723333824d3f5530641149847ce5d1" @@ -17057,7 +17211,7 @@ style-to-object@0.3.0, style-to-object@^0.3.0: dependencies: inline-style-parser "0.1.1" -styled-components@^5.3.0: +styled-components@^5.3.0, styled-components@^5.3.6: version "5.3.11" resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-5.3.11.tgz#9fda7bf1108e39bf3f3e612fcc18170dedcd57a8" integrity sha512-uuzIIfnVkagcVHv9nE0VPlHPSCmXIUGKfJ42LNjxCCTDTL5sgnJ8Z7GZBq0EnLYGln77tPpEpExt2+qa+cZqSw== @@ -17449,7 +17603,7 @@ tiny-inflate@^1.0.0, tiny-inflate@^1.0.3: resolved "https://registry.yarnpkg.com/tiny-inflate/-/tiny-inflate-1.0.3.tgz#122715494913a1805166aaf7c93467933eea26c4" integrity sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw== -tiny-invariant@^1.0.2: +tiny-invariant@^1.0.0, tiny-invariant@^1.0.2: version "1.3.3" resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.3.3.tgz#46680b7a873a0d5d10005995eb90a70d74d60127" integrity sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg== @@ -17583,6 +17737,14 @@ tr46@~0.0.3: resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== +tree-changes@^0.9.1, tree-changes@^0.9.2: + version "0.9.3" + resolved "https://registry.yarnpkg.com/tree-changes/-/tree-changes-0.9.3.tgz#89433ab3b4250c2910d386be1f83912b7144efcc" + integrity sha512-vvvS+O6kEeGRzMglTKbc19ltLWNtmNt1cpBoSYLj/iEcPVvpJasemKOlxBrmZaCtDJoF+4bwv3m01UKYi8mukQ== + dependencies: + "@gilbarbara/deep-equal" "^0.1.1" + is-lite "^0.8.2" + trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613"