Skip to content

Commit

Permalink
Merge pull request #1104 from deepa-s-13/Dev-2.0
Browse files Browse the repository at this point in the history
OBPAS changes
  • Loading branch information
sriranjan-s committed May 19, 2024
2 parents 9b2a2ce + b034359 commit 5cf9ac5
Show file tree
Hide file tree
Showing 18 changed files with 333 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ const useBPAInbox = ({ tenantId, filters, config={} }) => {
table: data?.items.map( application => ({
applicationId: application.businessObject.applicationNo || application.businessObject.applicationNumber,
date: application.businessObject.auditDetails.createdTime,
submissionDate: application?.ProcessInstanceForBPA?.auditDetails?.createdTime ,
businessService: application?.ProcessInstance?.businessService,
applicationType: application?.businessObject?.additionalDetails?.applicationType ? `WF_BPA_${application?.businessObject?.additionalDetails?.applicationType}` : "-",
locality: `${application.businessObject?.tenantId?.toUpperCase()?.split(".")?.join("_")}_REVENUE_${application.businessObject?.landInfo?.address?.locality?.code?.toUpperCase()}`,
status: application?.ProcessInstance?.state?.state,
state: application?.ProcessInstance?.state?.state,
owner: application?.ProcessInstance?.assignes?.[0]?.name || "NA",
owner: application?.businessObject?.additionalDetails?.ownerName || "NA",
sla: application?.businessObject?.status.match(/^(APPROVED)$/) ? "CS_NA" : Math.round(application.ProcessInstance?.businesssServiceSla / (24 * 60 * 60 * 1000))
})),
totalCount: data.totalCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,15 @@ const getMohallaLocale = (value = "", tenantId = "") => {
}
]
},
{
title: t(`BPA_NOC_DETAILS_SUMMARY`) ,
values: [
{
title: t(`BPA_NOC_NUMBER`),
value: application?.additionalDetails?.nocNumber || "NA",
}

],
},
// {
// title: t(`BPA_NOC_DETAILS_SUMMARY`) ,
// values: [
// {
// title: t(`BPA_NOC_NUMBER`),
// value: application?.additionalDetails?.nocNumber || "NA",
// }
// ],
// },
{
title: t("BPA_APPLICANT_DETAILS_HEADER"),
values: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ const SearchFormFieldsComponent = ({ formState, Controller, register, control, t
<label>{t("BPA_SEARCH_APPLICATION_NO_LABEL")}</label>
<TextInput name="applicationNo" inputRef={register({})} />
</SearchField>
<SearchField>
<label>{t("BPA_SEARCH_OWNER_NAME")}</label>
<TextInput name="name" inputRef={register({})} />
</SearchField>
{
!window.location.href.includes("citizen/obps/search/application") &&
<SearchField>
Expand Down Expand Up @@ -190,6 +194,7 @@ const SearchFormFieldsComponent = ({ formState, Controller, register, control, t
applicationNo: "",
mobileNumber: window.location.href.includes("/search/obps-application") ? currentUserPhoneNumber : "",
// mobileNumber: "",
name:"",
fromDate: "",
toDate: "",
status: "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const OBPSSearchApplication = ({ tenantId, t, onSubmit, data, error, searchData,
applicationNo: "",
mobileNumber: window.location.href.includes("/search/obps-application") ? currentUserPhoneNumber : "",
// mobileNumber: "",
name:"",
fromDate: "",
toDate: "",
status: "",
Expand Down Expand Up @@ -80,6 +81,7 @@ const OBPSSearchApplication = ({ tenantId, t, onSubmit, data, error, searchData,
applicationNo: "",
// mobileNumber: "",
mobileNumber: window.location.href.includes("/search/obps-application") ? Digit.UserService.getUser()?.info?.mobileNumber : "",
name:"",
fromDate: "",
toDate: "",
status: "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ const useSearchApplicationTableConfig = ({t}) => {
accessor: (row) => GetCell(t(row.additionalDetails?.serviceType || t(`TRADELICENSE_TRADETYPE_${row?.tradeLicenseDetail?.tradeUnits?.[0]?.tradeType?.split(".")[0]}`) || "-")),
},
{
Header: t("BPA_CURRENT_OWNER_HEAD"),
accessor: (row) => GetCell(row?.assignee || "-"),
Header: t("BPA_OWNER_HEAD"),
accessor: (row) => GetCell(row?.additionalDetails?.ownerName || "NA"),
// accessor: (row) => GetCell(row.businessService === "BPAREG"?row?.tradeLicenseDetail?.owners.map( o => o.name ). join(",") || "-" : row?.landInfo?.owners.map( o => o.name ). join(",") || "-"),
disableSortBy: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const getAction = (flow) => {
default:
actions = [
"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",
"COLONY_DETAILS",
"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",
"BPA_NOC_DETAILS_SUMMARY",
"BPA_STEPPER_SUMMARY_HEADER",
];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useState, Fragment } from "react";
import { FormStep, TextInput, CardLabel, Dropdown } from "@upyog/digit-ui-react-components";
import { FormStep, TextInput, CardLabel, Dropdown,UploadFile,SearchIcon } from "@upyog/digit-ui-react-components";
import Timeline from "../components/Timeline";
import { useLocation, useRouteMatch } from "react-router-dom";
import { Controller, useForm } from "react-hook-form";

Expand All @@ -25,7 +26,36 @@
const [schemeName, setschemeName] = useState(formData?.owners?.schemeName || "");
const [transferredscheme, settransferredscheme] = useState("Pre-Approved Standard Designs" || "");
const [Ulblisttype, setUlblisttype] = useState(formData?.owners?.Ulblisttype || "");

const [uploadedFile, setUploadedFile] = useState(formData?.owners?.uploadedFile);
const [file, setFile] = useState();
const [error, setError] = useState(null);
const [uploadMessage, setUploadMessage] = useState("");
let Webview = !Digit.Utils.browser.isMobile();
let acceptFormat = ".pdf"
useEffect(() => {
(async () => {
setError(null);
if (file&& file?.type) {
if(!(acceptFormat?.split(",")?.includes(`.${file?.type?.split("/")?.pop()}`)))
{
setError(t("PT_UPLOAD_FORMAT_NOT_SUPPORTED"));
}
else if (file.size >= 2000000) {
setError(t("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
} else {
try {
const response = await Digit.UploadServices.Filestorage("property-upload", file, Digit.ULBService.getStateId());
if (response?.data?.files?.length > 0) {
setUploadedFile(response?.data?.files[0]?.fileStoreId);
} else {
setError(t("PT_FILE_UPLOAD_ERROR"));
}
} catch (err) {
}
}
}
})();
}, [file]);



Expand Down Expand Up @@ -202,22 +232,34 @@
function TransferredScheme(e){
settransferredscheme(e.target.value);
}

function selectfile(e) {
setUploadedFile(e.target.files[0]);
setFile(e.target.files[0]);
}
function onClick(e){
console.log("inside_NOC_search")
}


const goNext = () => {
let owners = formData.owners && formData.owners[index];
let ownerStep = { ...owners, approvedColony, UlbName, Ulblisttype, District, masterPlan, coreArea, buildingStatus, schemes, schemesselection, purchasedFAR, greenbuilding, restrictedArea, proposedSite, nameofApprovedcolony, schemeName, transferredscheme, NocNumber };
let ownerStep = { ...owners, approvedColony, UlbName, Ulblisttype, District, masterPlan, coreArea, buildingStatus, schemes, schemesselection, purchasedFAR, greenbuilding, restrictedArea, proposedSite, nameofApprovedcolony, schemeName, transferredscheme, NocNumber, uploadedFile };
let updatedFormData = { ...formData };

// Check if owners array exists in formData if not , then it will add it
if (!updatedFormData.owners) {
updatedFormData.owners = [];
}

onSelect(config.key, { ...formData[config.key], ...ownerStep }, updatedFormData, false, index);


if((approvedColony?.code=="NO") )
{ if(NocNumber || uploadedFile || formData?.owners?.uploadedFile || formData?.owners?.NocNumber){
onSelect(config.key, { ...formData[config.key], ...ownerStep }, updatedFormData, false, index);
}
else{
alert("Please fill NOC number or Upload NOC Document")
} }
else{
onSelect(config.key, { ...formData[config.key], ...ownerStep }, updatedFormData, false, index);
}
};


Expand Down Expand Up @@ -253,25 +295,40 @@
case "NO":
return (
<>
<CardLabel>{`${t("BPA_NOC_NUMBER")}`}</CardLabel>
<CardLabel>{`${t("BPA_NOC_NUMBER")}`}</CardLabel>
<div className="field-container">
<TextInput
t={t}
type={"text"}
isMandatory={false}
optionKey="i18nKey"
defaultValue={formData?.owners?.NocNumber}
name="NocNumber"
value={NocNumber}
onChange={setnocNumber}
style={{ width: "86%" }}
//style={{ width: "86%" }}
ValidationRequired={false}
{...(validation = {
isRequired: true,
//isRequired: true,
pattern: "^[a-zA-Z0-9]*$",
type: "text",
title: t("TL_NAME_ERROR_MESSAGE"),
})}
/>

<div style={{ position: "relative", zIndex: "100", right: "20px", marginTop: "-24px", marginRight:Webview?"-20px":"-20px" }} onClick={(e) => onClick( e)}> <SearchIcon /> </div>
</div>
<div style={{ position: "relative", fontWeight:"bold", left:"20px"}}>OR</div>
<UploadFile
id={"noc-doc"}
onUpload={selectfile}
onDelete={() => {
setUploadedFile(null);
setFile("");
}}
message={uploadedFile ? `1 ${t(`FILEUPLOADED`)}` : t(`ES_NO_FILE_SELECTED_LABEL`)}
error={error}
uploadMessage={uploadMessage}
/>
</>
);
default:
Expand Down Expand Up @@ -354,6 +411,7 @@

return (
<React.Fragment>
<Timeline currentStep={2} />
<FormStep
config={config} onSelect={goNext} onSkip={onSkip} t={t}

Expand Down Expand Up @@ -385,7 +443,7 @@



<CardLabel>{`${t("BPA_MASTER_PLAN")}`}</CardLabel>
<CardLabel style={{marginTop:"15px"}}>{`${t("BPA_MASTER_PLAN")}`}</CardLabel>
<Controller
control={control}
name={"masterPlan"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const DocumentDetails = ({ t, config, onSelect, userType, formData, setError: se

return (
<div>
<Timeline currentStep={checkingFlow === "OCBPA" ? 3 : 2} flow= {checkingFlow === "OCBPA" ? "OCBPA" : ""}/>
<Timeline currentStep={checkingFlow === "OCBPA" ? 3 : 3} flow= {checkingFlow === "OCBPA" ? "OCBPA" : ""}/>
{!isLoading ?
<FormStep
t={t}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => {

if(found){
setCanmovenext(false);
setownerRoleCheck(found);
//setownerRoleCheck(found);
setShowToast({ key: "true", error: true, message: `BPA_OWNER_VALIDATION_${found?.code}` });
return;
}
Expand Down Expand Up @@ -342,7 +342,8 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => {
payload.additionalDetails.height = (formData?.data.edcrDetails.planDetail.blocks[0].building.buildingHeight).toString() || "NA";
payload.additionalDetails.usage = formData?.data.occupancyType || "NA";
payload.additionalDetails.builtUpArea =(formData?.data.edcrDetails.planDetail.blocks[0].building.totalBuitUpArea).toString();
payload.additionalDetails.nocNumber=(formData?.nocnumber?.nocNumber).toString();
//payload.additionalDetails.nocNumber=(formData?.nocnumber?.nocNumber).toString();
payload.additionalDetails.ownerName=conversionOwners.map(obj=>obj.name).join(',');

if (formData?.data?.registrationDetails) payload.additionalDetails.registrationDetails = formData?.data?.registrationDetails;
if (formData?.data?.applicationType) payload.additionalDetails.applicationType = formData?.data?.applicationType;
Expand Down Expand Up @@ -380,7 +381,7 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => {
if (formData?.owners?.schemeName) payload.additionalDetails.schemeName = formData?.owners?.schemeName;
if (formData?.owners?.transferredscheme) payload.additionalDetails.transferredscheme = formData?.owners?.transferredscheme;
if (formData?.owners?.Ulblisttype?.code) payload.additionalDetails.Ulblisttype = formData?.owners?.Ulblisttype?.code;

if (formData?.owners?.uploadedFile) payload.additionalDetails.uploadedFileNoc = formData?.owners?.uploadedFile;

//For LandInfo
payload.landInfo = {};
Expand Down Expand Up @@ -507,7 +508,7 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => {

return (
<div>
<Timeline currentStep={2} />
<Timeline currentStep={3} />
<FormStep config={config} onSelect={goNext} onSkip={onSkip} t={t} isDisabled={canmovenext || getCanMoveNextMultiple() || !ownershipCategory || isDisable} forcedError={t(error)}>
{!isLoading ?
<div style={{marginBottom: "10px"}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ const BpaApplicationDetail = () => {
{/* to get Fee values */}
{detail?.additionalDetails?.inspectionReport && detail?.isFeeDetails && <ScruntinyDetails scrutinyDetails={detail?.additionalDetails} paymentsList={[]}/>}
{/*blocking reason*/}
{detail?.additionalDetails?.inspectionReport && detail?.isFeeDetails && (workflowDetails?.data?.actionState?.nextActions[0]?.state=="POST_PAYMENT_CITIZEN_APPROVAL_PENDING"|| workflowDetails?.data?.actionState?.state=="POST_PAYMENT_CITIZEN_APPROVAL_PENDING") &&
{detail?.additionalDetails?.inspectionReport && detail?.isFeeDetails && (workflowDetails?.data?.actionState?.nextActions[0]?.state=="POST_PAYMENT_CITIZEN_APPROVAL_PENDING"|| workflowDetails?.data?.actionState?.state=="POST_PAYMENT_CITIZEN_APPROVAL_PENDING" || workflowDetails?.data?.actionState?.state=="POST_PAYMENT_INPROGRESS") &&
<div style={ { marginTop: "19px", background: "#FAFAFA", border: "1px solid #D6D5D4", borderRadius: "4px", padding: "8px", lineHeight: "19px", maxWidth: "950px", minWidth: "280px"} }>
<Row className="border-none" label={t(`BLOCKING_REASON`)} labelStyle={{fontSize: "15px"}} text={data?.applicationData.additionalDetails.blockingReason || "NA"}> </Row>
</div>
Expand Down
Loading

0 comments on commit 5cf9ac5

Please sign in to comment.