Skip to content

Commit

Permalink
Merge pull request #180 from egovernments/ISNE-555
Browse files Browse the repository at this point in the history
Feedback popup issue solved
  • Loading branch information
vinothrallapalli-eGov authored Feb 12, 2025
2 parents 7ef322b + 2b5c768 commit 3d055ad
Showing 1 changed file with 33 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
import { Card, CardSubHeader, Header, LinkButton, Loader, Row, StatusTable, MultiLink, PopUp, Toast, SubmitBar } from "@egovernments/digit-ui-react-components";
import {
Card,
CardSubHeader,
Header,
LinkButton,
Loader,
Row,
StatusTable,
MultiLink,
PopUp,
Toast,
SubmitBar,
} from "@egovernments/digit-ui-react-components";
import React, { useEffect, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { useHistory, useParams } from "react-router-dom";
Expand All @@ -20,6 +32,7 @@ const PTApplicationDetails = () => {
const [showOptions, setShowOptions] = useState(false);
const [popup, setpopup] = useState(false);
const [showToast, setShowToast] = useState(null);

// const tenantId = Digit.ULBService.getCurrentTenantId();
const { data: storeData } = Digit.Hooks.useStore.getInitData();
const { tenants } = storeData || {};
Expand All @@ -31,19 +44,21 @@ const PTApplicationDetails = () => {
const [billStatus, setBillStatus] = useState(null);

let serviceSearchArgs = {
tenantId : tenantId,
code: [`PT_${data?.Properties?.[0]?.creationReason}`],
tenantId: tenantId,
code: [`PT_${data?.Properties?.[0]?.creationReason}`],
module: ["PT"],
referenceIds : [data?.Properties?.[0]?.acknowldgementNumber]
referenceIds: [data?.Properties?.[0]?.acknowldgementNumber],
//removing thid as of now sending ack no in referenceId
// attributes: {
// "attributeCode": "referenceId",
// "value": data?.Properties?.[0]?.acknowldgementNumber,
// }
}

const { isLoading:serviceloading, error : serviceerror, data : servicedata} = Digit.Hooks.pt.useServiceSearchCF({ filters: { serviceSearchArgs } },{ filters: { serviceSearchArgs }, enabled : data?.Properties?.[0]?.acknowldgementNumber ?true : false, cacheTime : 0 });
};

const { isLoading: serviceloading, error: serviceerror, data: servicedata } = Digit.Hooks.pt.useServiceSearchCF(
{ filters: { serviceSearchArgs } },
{ filters: { serviceSearchArgs }, enabled: data?.Properties?.[0]?.acknowldgementNumber ? true : false, cacheTime: 0 }
);

const properties = get(data, "Properties", []);
const propertyId = get(data, "Properties[0].propertyId", []);
Expand All @@ -52,9 +67,9 @@ const PTApplicationDetails = () => {
sessionStorage.setItem("pt-property", JSON.stringify(application));

useMemo(() => {
if(data?.Properties?.[0]?.status === "ACTIVE" && popup == false && (Array.isArray(servicedata?.Services) && servicedata?.Services?.length === 0))
if (data?.Properties?.[0]?.status === "ACTIVE" && popup == false && Array.isArray(servicedata?.Service) && servicedata?.Service?.length === 0)
setpopup(true);
},[data,servicedata])
}, [data, servicedata]);

useEffect(async () => {
if (acknowledgementIds && tenantId && property) {
Expand Down Expand Up @@ -542,15 +557,15 @@ const PTApplicationDetails = () => {
</div>
<PTWFApplicationTimeline application={application} id={acknowledgementIds} userType={"citizen"} />
{showToast && (
<Toast
error={showToast.key}
label={t(showToast.label)}
style={{bottom:"0px"}}
onClose={() => {
setShowToast(null);
}}
/>
)}
<Toast
error={showToast.key}
label={t(showToast.label)}
style={{ bottom: "0px" }}
onClose={() => {
setShowToast(null);
}}
/>
)}
</Card>
{/* <LinkButton style={{marginLeft:"5%",color:"#F47738"}} label={t("CS_RATE_US")} onClick={() => setpopup(true)} /> */}
{/* {popup && (<PopUp>
Expand Down

0 comments on commit 3d055ad

Please sign in to comment.