Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions frontend/micro-ui/web/micro-ui-internals/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"@egovernments/digit-ui-module-pt": "1.7.35",
"@egovernments/digit-ui-module-receipts": "1.7.0-beta.2",
"@egovernments/digit-ui-module-tl": "1.7.35",
"@egovernments/digit-ui-module-ws": "1.7.35",
"@egovernments/digit-ui-module-ws": "1.7.36",
"@egovernments/digit-ui-module-bills": "1.7.35",
"@egovernments/digit-ui-module-commonpt": "1.7.35",
"@egovernments/digit-ui-module-hrms": "1.7.35",
"@egovernments/digit-ui-module-core": "1.7.35",
"@egovernments/digit-ui-module-dss": "1.7.35",
"@egovernments/digit-ui-react-components": "1.7.35",
"@egovernments/digit-ui-module-hrms":"1.7.35",
"@egovernments/digit-ui-module-core":"1.7.35",
"@egovernments/digit-ui-module-dss":"1.7.36",
"@egovernments/digit-ui-react-components":"1.7.35",
"http-proxy-middleware": "1.0.5",
"react": "17.0.2",
"react-dom": "17.0.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-module-dss",
"version": "1.7.35",
"version": "1.7.36",
"license": "MIT",
"description": "Digit Dashboard Module",
"main": "dist/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { useContext, useEffect, useMemo, useState } from "react";
import DateRange from "./DateRange";
import FilterContext from "./FilterContext";
import Switch from "./Switch";
import { useLocation } from "react-router-dom";


const Filters = ({
Expand All @@ -20,17 +21,18 @@ const Filters = ({
}) => {
const { value, setValue } = useContext(FilterContext);

const location = useLocation();


const [selected, setSelected] = useState(() =>
ulbTenants?.ulb.filter((tenant) => value?.filters?.tenantId?.find((selectedTenant) => selectedTenant === tenant?.code))
);

useEffect(() => {
setSelected(ulbTenants?.ulb?.filter((tenant) => value?.filters?.tenantId?.find((selectedTenant) => selectedTenant === tenant?.code)));
}, [value?.filters?.tenantId]);


const [selectService, setSelectedService] = useState(() =>
services?.filter((module) => value?.moduleLevel === module?.code)
)

useEffect(() => {
setSelectedService(services?.filter((module) => value?.moduleLevel === module?.code));
Expand All @@ -44,10 +46,6 @@ const Filters = ({
setValue({ ...value, filters: { tenantId: e.map((allPropsData) => allPropsData?.[1]?.code) } });
};

const selectServicesFilters = (e, data) => {
setValue({ ...value, moduleLevel: e?.code });
};

const selectDDR = (e, data) => {
const DDRsSelectedByUser = ulbTenants.ulb.filter((ulb) => {
return !!e.find((tenant) => {
Expand All @@ -71,6 +69,35 @@ const Filters = ({
range: Digit.Utils.dss.getInitialRange(),
});
};


const [selectService, setSelectedService] = useState(() =>
services?.filter((module) => value?.moduleLevel === module?.code)
);
// Pseudo state to trigger a reset when `value?.moduleLevel` changes
const [serviceKey, setServiceKey] = useState(0);

useEffect(() => {
setServiceKey((prevKey) => prevKey + 1); // Force re-render when moduleLevel changes
setSelectedService(services?.filter((module) => value?.moduleLevel === module?.code));
}, [value?.moduleLevel]);

const selectServicesFilters = (e, data) => {
setValue({ ...value, moduleLevel: e?.code });
setSelectedService([e]); // Ensure selected service updates correctly
};


useEffect(() => {
setValue({
denomination: "Unit",
range: Digit.Utils.dss.getInitialRange(),
filters: { tenantId: [] },
moduleLevel: null,
});
}, [location.pathname]);


return (
<div className={`filters-wrapper ${isOpen ? "filters-modal" : ""}`} style={{
justifyContent: window.location.href.includes("dss/dashboard/finance") && !isOpen ? "space-between" : "unset",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ const MetricData = ({ t, data, code, indexValuesWithStar }) => {
>
{data?.insight?.indicator === "upper_green" ? ArrowUpwardElement("10px") : ArrowDownwardElement("10px")}
<p className={`${data?.insight.colorCode}`} style={{ whiteSpace: "pre" }}>
{insight?.[0] &&
`${Digit.Utils.dss.formatter(insight[0], "number", value?.denomination, true, t)}% ${t(
Digit.Utils.locale.getTransformedLocale("DSS" + insight?.[1] || "")
)}`}
{insight?.[0] !== undefined && insight?.[0] !== ""
? (isNaN(insight[0])
? `${insight[0]}`
: `${Digit.Utils.dss.formatter(insight[0], "number", value?.denomination, true, t)}%`
)
: ""}
</p>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,67 +276,67 @@ const Home = ({ stateCode }) => {

const shareOptions = navigator.share
? [
{
label: t("ES_DSS_SHARE_PDF"),
onClick: () => {
setShowOptions(!showOptions);
setTimeout(() => {
return Digit.ShareFiles.PDF(tenantId, fullPageRef, t(dashboardConfig?.[0]?.name));
}, 500);
},
{
label: t("ES_DSS_SHARE_PDF"),
onClick: () => {
setShowOptions(!showOptions);
setTimeout(() => {
return Digit.ShareFiles.PDF(tenantId, fullPageRef, t(dashboardConfig?.[0]?.name));
}, 500);
},
{
label: t("ES_DSS_SHARE_IMAGE"),
onClick: () => {
setShowOptions(!showOptions);
setTimeout(() => {
return Digit.ShareFiles.Image(tenantId, fullPageRef, t(dashboardConfig?.[0]?.name));
}, 500);
},
},
{
label: t("ES_DSS_SHARE_IMAGE"),
onClick: () => {
setShowOptions(!showOptions);
setTimeout(() => {
return Digit.ShareFiles.Image(tenantId, fullPageRef, t(dashboardConfig?.[0]?.name));
}, 500);
},
]
},
]
: [
{
icon: <EmailIcon />,
label: t("ES_DSS_SHARE_PDF"),
onClick: () => {
setShowOptions(!showOptions);
setTimeout(() => {
return Digit.ShareFiles.PDF(tenantId, fullPageRef, t(dashboardConfig?.[0]?.name), "mail");
}, 500);
},
{
icon: <EmailIcon />,
label: t("ES_DSS_SHARE_PDF"),
onClick: () => {
setShowOptions(!showOptions);
setTimeout(() => {
return Digit.ShareFiles.PDF(tenantId, fullPageRef, t(dashboardConfig?.[0]?.name), "mail");
}, 500);
},
{
icon: <WhatsappIcon />,
label: t("ES_DSS_SHARE_PDF"),
onClick: () => {
setShowOptions(!showOptions);
setTimeout(() => {
return Digit.ShareFiles.PDF(tenantId, fullPageRef, t(dashboardConfig?.[0]?.name), "whatsapp");
}, 500);
},
},
{
icon: <WhatsappIcon />,
label: t("ES_DSS_SHARE_PDF"),
onClick: () => {
setShowOptions(!showOptions);
setTimeout(() => {
return Digit.ShareFiles.PDF(tenantId, fullPageRef, t(dashboardConfig?.[0]?.name), "whatsapp");
}, 500);
},
{
icon: <EmailIcon />,
label: t("ES_DSS_SHARE_IMAGE"),
onClick: () => {
setShowOptions(!showOptions);
setTimeout(() => {
return Digit.ShareFiles.Image(tenantId, fullPageRef, t(dashboardConfig?.[0]?.name), "mail");
}, 500);
},
},
{
icon: <EmailIcon />,
label: t("ES_DSS_SHARE_IMAGE"),
onClick: () => {
setShowOptions(!showOptions);
setTimeout(() => {
return Digit.ShareFiles.Image(tenantId, fullPageRef, t(dashboardConfig?.[0]?.name), "mail");
}, 500);
},
{
icon: <WhatsappIcon />,
label: t("ES_DSS_SHARE_IMAGE"),
onClick: () => {
setShowOptions(!showOptions);
setTimeout(() => {
return Digit.ShareFiles.Image(tenantId, fullPageRef, t(dashboardConfig?.[0]?.name), "whatsapp");
}, 500);
},
},
{
icon: <WhatsappIcon />,
label: t("ES_DSS_SHARE_IMAGE"),
onClick: () => {
setShowOptions(!showOptions);
setTimeout(() => {
return Digit.ShareFiles.Image(tenantId, fullPageRef, t(dashboardConfig?.[0]?.name), "whatsapp");
}, 500);
},
];
},
];

if (isLoading || localizationLoading) {
return <Loader />;
Expand Down Expand Up @@ -396,13 +396,12 @@ const Home = ({ stateCode }) => {
} else if (item?.charts?.[0]?.chartType == "map") {
return (
<div
className={`dss-card-parent ${
item.vizType == "collection"
className={`dss-card-parent ${item.vizType == "collection"
? "w-100"
: item.name.includes("PROJECT_STAUS") || item.name.includes("LIVE_ACTIVE_ULBS")
? "dss-h-100"
: ""
}`}
? "dss-h-100"
: ""
}`}
style={item.vizType == "collection" ? { backgroundColor: "#fff", height: "600px" } : { backgroundColor: colors[index].light }}
key={index}
>
Expand Down Expand Up @@ -465,20 +464,19 @@ const Home = ({ stateCode }) => {
} else {
return (
<div
className={`dss-card-parent ${
item.vizType == "collection"
className={`dss-card-parent ${item.vizType == "collection"
? "dss-w-100"
: item.name.includes("PROJECT_STAUS") || item.name.includes("LIVE_ACTIVE_ULBS")
? "h-100"
: ""
}`}
? "h-100"
: ""
}`}
style={
item.vizType == "collection" || item.name.includes("PROJECT_STAUS") || item.name.includes("LIVE_ACTIVE_ULBS")
? { backgroundColor: "#fff", position: "relative" }
: { backgroundColor: colors[index].light, padding: "20px", paddingBottom: "40px", position: "relative" }
}
key={index}
// onClick={() => routeTo(`/digit-ui/employee/dss/dashboard/${item.ref.url}`)}
// onClick={() => routeTo(`/digit-ui/employee/dss/dashboard/${item.ref.url}`)}
>
<div style={{ justifyContent: "space-between", display: "flex", flexDirection: "row" }}>
<div className="dss-card-header" style={{ marginBottom: "10px" }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const DashBoard = ({ stateCode }) => {
return serviceJS;
},
});

const { data: nationalInfo, isLoadingNAT } = Digit.Hooks.dss.useMDMS(stateCode, "tenant", ["nationalInfo"], {
select: (data) => {
let nationalInfo = data?.tenant?.nationalInfo || [];
Expand Down Expand Up @@ -154,6 +155,7 @@ const DashBoard = ({ stateCode }) => {
...filters,
moduleLevel: "",
});
setFilters((prev) => ({ ...prev, moduleLevel: [] }));
};

const removeTenant = (id) => {
Expand All @@ -172,9 +174,13 @@ const DashBoard = ({ stateCode }) => {
};
const clearAllSt = () => {
handleFilters({ ...filters, filters: { ...filters?.filters, state: [], ulb: [] } });
};
};

const [refresh, setRefresh] = useState(false);
const clearAllServices = () => {
handleFilters({ ...filters, moduleLevel: "" });
setFilters({});
setRefresh((prev) => !prev);
};

const dashboardConfig = response?.responseData;
Expand Down Expand Up @@ -262,6 +268,7 @@ const DashBoard = ({ stateCode }) => {
if (isLoading || isUlbLoading || localizationLoading || isMdmsLoading || isLoadingNAT || isServicesLoading) {
return <Loader />;
}

return (
<FilterContext.Provider value={provided}>
<div ref={fullPageRef} id="divToPrint">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-module-ws",
"version": "1.7.35",
"version": "1.7.36",
"description": "",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -615,29 +615,29 @@ const ApplicationBillAmendment = () => {
submit={true}
label={state?.data?.action ? t("WF_CITIZEN_NEWSW1_RESUBMIT_APPLICATION") : t("WS_COMMON_BUTTON_SUBMIT")}
disabled={
(servicev1 == "WS" && ischeckedReduce &&
((getValues().WS_REDUCED_AMOUNT.WS_CHARGE == "" || getValues().WS_REDUCED_AMOUNT.WS_CHARGE == null)
&& (getValues().WS_REDUCED_AMOUNT.WS_TIME_PENALTY == "" || getValues().WS_REDUCED_AMOUNT.WS_TIME_PENALTY == null)
&& (getValues().WS_REDUCED_AMOUNT.WS_TIME_INTEREST == "" || getValues().WS_REDUCED_AMOUNT.WS_TIME_INTEREST == null)
&& (getValues().WS_REDUCED_AMOUNT.WS_WATER_CESS == "" || getValues().WS_REDUCED_AMOUNT.WS_WATER_CESS == null)))
||
(servicev1 == "SW" && ischeckedReduce &&
((getValues().SW_REDUCED_AMOUNT.SW_CHARGE == "" || getValues().SW_REDUCED_AMOUNT.SW_CHARGE == null)
&& (getValues().SW_REDUCED_AMOUNT.SW_TIME_PENALTY == "" || getValues().SW_REDUCED_AMOUNT.SW_TIME_PENALTY == null)
&& (getValues().SW_REDUCED_AMOUNT.SW_TIME_INTEREST == "" || getValues().SW_REDUCED_AMOUNT.SW_TIME_INTEREST == null)
&& (getValues().SW_REDUCED_AMOUNT.SW_SEWERAGE_CESS == "" || getValues().SW_REDUCED_AMOUNT.SW_SEWERAGE_CESS == null)))
||
(servicev1 == "WS" && ischeckedAddition &&
((getValues().WS_ADDITIONAL_AMOUNT.WS_CHARGE == "" || getValues().WS_ADDITIONAL_AMOUNT.WS_CHARGE == null)
&& (getValues().WS_ADDITIONAL_AMOUNT.WS_TIME_PENALTY == "" || getValues().WS_ADDITIONAL_AMOUNT.WS_TIME_PENALTY == null)
&& (getValues().WS_ADDITIONAL_AMOUNT.WS_TIME_INTEREST == "" || getValues().WS_ADDITIONAL_AMOUNT.WS_TIME_INTEREST == null)
&& (getValues().WS_ADDITIONAL_AMOUNT.WS_WATER_CESS == "" || getValues().WS_ADDITIONAL_AMOUNT.WS_WATER_CESS == null)))
||
(servicev1 == "SW" && ischeckedAddition &&
((getValues().SW_ADDITIONAL_AMOUNT.SW_CHARGE == "" || getValues().SW_ADDITIONAL_AMOUNT.SW_CHARGE == null)
&& (getValues().SW_ADDITIONAL_AMOUNT.SW_TIME_PENALTY == "" || getValues().SW_ADDITIONAL_AMOUNT.SW_TIME_PENALTY == null)
&& (getValues().SW_ADDITIONAL_AMOUNT.SW_TIME_INTEREST == "" || getValues().SW_ADDITIONAL_AMOUNT.SW_TIME_INTEREST == null)
&& (getValues().SW_ADDITIONAL_AMOUNT.SW_SEWERAGE_CESS == "" || getValues().SW_ADDITIONAL_AMOUNT.SW_SEWERAGE_CESS == null)))
(
(servicev1 == "WS" && ischeckedReduce &&
((getValues().WS_REDUCED_AMOUNT.WS_CHARGE == "" || getValues().WS_REDUCED_AMOUNT.WS_CHARGE == null) &&
(getValues().WS_REDUCED_AMOUNT.WS_TIME_PENALTY == "" || getValues().WS_REDUCED_AMOUNT.WS_TIME_PENALTY == null) &&
(getValues().WS_REDUCED_AMOUNT.WS_TIME_INTEREST == "" || getValues().WS_REDUCED_AMOUNT.WS_TIME_INTEREST == null) &&
(getValues().WS_REDUCED_AMOUNT.WS_WATER_CESS == "" || getValues().WS_REDUCED_AMOUNT.WS_WATER_CESS == null))) ||
(servicev1 == "SW" && ischeckedReduce &&
((getValues().SW_REDUCED_AMOUNT.SW_CHARGE == "" || getValues().SW_REDUCED_AMOUNT.SW_CHARGE == null) &&
(getValues().SW_REDUCED_AMOUNT.SW_TIME_PENALTY == "" || getValues().SW_REDUCED_AMOUNT.SW_TIME_PENALTY == null) &&
(getValues().SW_REDUCED_AMOUNT.SW_TIME_INTEREST == "" || getValues().SW_REDUCED_AMOUNT.SW_TIME_INTEREST == null) &&
(getValues().SW_REDUCED_AMOUNT.SW_SEWERAGE_CESS == "" || getValues().SW_REDUCED_AMOUNT.SW_SEWERAGE_CESS == null))) ||
(servicev1 == "WS" && ischeckedAddition &&
((getValues().WS_ADDITIONAL_AMOUNT.WS_CHARGE == "" || getValues().WS_ADDITIONAL_AMOUNT.WS_CHARGE == null) &&
(getValues().WS_ADDITIONAL_AMOUNT.WS_TIME_PENALTY == "" || getValues().WS_ADDITIONAL_AMOUNT.WS_TIME_PENALTY == null) &&
(getValues().WS_ADDITIONAL_AMOUNT.WS_TIME_INTEREST == "" || getValues().WS_ADDITIONAL_AMOUNT.WS_TIME_INTEREST == null) &&
(getValues().WS_ADDITIONAL_AMOUNT.WS_WATER_CESS == "" || getValues().WS_ADDITIONAL_AMOUNT.WS_WATER_CESS == null))) ||
(servicev1 == "SW" && ischeckedAddition &&
((getValues().SW_ADDITIONAL_AMOUNT.SW_CHARGE == "" || getValues().SW_ADDITIONAL_AMOUNT.SW_CHARGE == null) &&
(getValues().SW_ADDITIONAL_AMOUNT.SW_TIME_PENALTY == "" || getValues().SW_ADDITIONAL_AMOUNT.SW_TIME_PENALTY == null) &&
(getValues().SW_ADDITIONAL_AMOUNT.SW_TIME_INTEREST == "" || getValues().SW_ADDITIONAL_AMOUNT.SW_TIME_INTEREST == null) &&
(getValues().SW_ADDITIONAL_AMOUNT.SW_SEWERAGE_CESS == "" || getValues().SW_ADDITIONAL_AMOUNT.SW_SEWERAGE_CESS == null)))
) &&
!(getValues().WS_REBATE || getValues().WS_PENALTY || getValues().SW_REBATE || getValues().SW_PENALTY)
}
//UM-4354:: Above code is used To disable the button when reduced amount or additional amount is selected and none of the fields have any value
/>
Expand Down