Skip to content

Commit

Permalink
Merge pull request #1115 from abhijniua/Dev-2.0
Browse files Browse the repository at this point in the history
Rating and Upload Fields are added, Citizen Underatking code corrected from frontend
  • Loading branch information
deepikaarora88 authored May 28, 2024
2 parents 64ab920 + acbeff2 commit c953bd4
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,17 @@
const [schemesselection, setschemesselection] = useState(formData?.owners?.schemesselection || "");
const [schemeName, setschemeName] = useState(formData?.owners?.schemeName || "");
const [transferredscheme, settransferredscheme] = useState("Pre-Approved Standard Designs" || "");
const [rating, setrating] = useState(formData?.owners?.rating || "");


const [Ulblisttype, setUlblisttype] = useState(formData?.owners?.Ulblisttype || "");
const [uploadedFile, setUploadedFile] = useState(formData?.owners?.uploadedFile);

const [greenuploadedFile, setGreenUploadedFile] = useState(formData?.owners?.greenuploadedFile);


const [files, setFiles] = useState();

const [file, setFile] = useState();
const [error, setError] = useState(null);
const [uploadMessage, setUploadMessage] = useState("");
Expand Down Expand Up @@ -57,6 +66,32 @@
})();
}, [file]);

useEffect(() => {
(async () => {
setError(null);
if (files&& files?.type) {
if(!(acceptFormat?.split(",")?.includes(`.${files?.type?.split("/")?.pop()}`)))
{
setError(t("PT_UPLOAD_FORMAT_NOT_SUPPORTED"));
}
else if (files.size >= 2000000) {
setError(t("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
} else {
try {
const response = await Digit.UploadServices.Filestorage("property-upload", files, Digit.ULBService.getStateId());
if (response?.data?.files?.length > 0) {
setGreenUploadedFile(response?.data?.files[0]?.fileStoreId);
} else {
setError(t("PT_FILE_UPLOAD_ERROR"));
}
} catch (err) {
}
}
}
})();
}, [files]);





Expand All @@ -74,6 +109,20 @@
i18nKey: "LAL LAKEER"
}
]
const ratingvalue = [
{
code: "PLATINUM",
i18nKey: "PLATINUM"
},
{
code: "GOLD",
i18nKey: "GOLD"
},
{
code: "BRONZE",
i18nKey: "BRONZE"
}
]

const common = [
{
Expand All @@ -85,7 +134,6 @@
i18nKey: "NO"
}
]


const Typeofproposedsite = [
{
Expand Down Expand Up @@ -182,6 +230,10 @@
setcoreArea(e.target.value);
}

function setRatings(e) {
setrating(e.target.value)
}


function setulbname(e) {
setUlbName(e.target.value);
Expand Down Expand Up @@ -239,11 +291,15 @@
function onClick(e){
console.log("inside_NOC_search")
}
function selectfiles(e) {
setGreenUploadedFile(e.target.files[0]);
setFiles(e.target.files[0]);
}


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, uploadedFile };
let ownerStep = { ...owners, approvedColony, UlbName, Ulblisttype, District, rating, masterPlan, coreArea, buildingStatus, schemes, schemesselection, purchasedFAR, greenbuilding, restrictedArea, proposedSite, nameofApprovedcolony, schemeName, transferredscheme, NocNumber, uploadedFile,greenuploadedFile };
let updatedFormData = { ...formData };

// Check if owners array exists in formData if not , then it will add it
Expand All @@ -257,6 +313,13 @@
else{
alert("Please fill NOC number or Upload NOC Document")
} }
if((greenbuilding?.code==="YES"))
{ if(greenuploadedFile || formData?.owners?.greenuploadedFile){
onSelect(config.key, { ...formData[config.key], ...ownerStep }, updatedFormData, false, index);
}
else{
alert("Please Upload Document")
} }
else{
onSelect(config.key, { ...formData[config.key], ...ownerStep }, updatedFormData, false, index);
}
Expand Down Expand Up @@ -336,6 +399,52 @@
return null;
}
}

const renderGreenbuildingfields = () => {
switch (greenbuilding?.code) {
case "YES":
return(
<>
<UploadFile
id={"green-building-doc"}
onUpload={selectfiles}
onDelete={() => {
setGreenUploadedFile(null);
setFiles("");
}}
message={greenuploadedFile ? `1 ${t(`FILEUPLOADED`)}` : t(`ES_NO_FILE_SELECTED_LABEL`)}
error={error}
uploadMessage={uploadMessage}
/>
<br></br>

<CardLabel>{`${t("BPA_SELECT_RATINGS")}`}</CardLabel>
<Controller
control={control}
name={"rating"}
defaultValue={rating}
rules={{ required: t("CORE_COMMON_REQUIRED_ERRMSG")}}
render={(props) => (
<Dropdown
className="form-field"
selected={rating}
select={setrating}
option={ratingvalue}
optionKey="i18nKey"
t={t}
/>
)}
/>

</>
);
case "NO":
return null;

default:
return null;
}
}

const renderschemedropdown = () => {
switch (schemes?.code) {
Expand Down Expand Up @@ -615,6 +724,8 @@
/>
)}
/>
{renderGreenbuildingfields()}

<CardLabel>{`${t("BPA_RESTRICTED_AREA")}`}</CardLabel>
<Controller
control={control}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Timeline from "../components/Timeline";
import cloneDeep from "lodash/cloneDeep";

const OwnerDetails = ({ t, config, onSelect, userType, formData }) => {
console.log("formdatatstd",formData);
let validation = {};
sessionStorage.removeItem("currentPincode");
let isedittrade = window.location.href.includes("edit-application");
Expand Down Expand Up @@ -382,7 +383,10 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => {
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;

if (formData?.owners?.rating?.code) payload.additionalDetails.rating = formData?.owners?.rating?.code;
if (formData?.owners?.greenuploadedFile) payload.additionalDetails.uploadedFileGreenBuilding = formData?.owners?.greenuploadedFile;


//For LandInfo
payload.landInfo = {};
//For Address
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,16 @@
const architectid = data?.applicationData?.additionalDetails?.architectid
const architecttype = data?.applicationData?.additionalDetails?.typeOfArchitect
const TimeStamp = otpVerifiedTimestamp;
const selfdeclarationform =
`
To:

const ulbselection = data?. applicationData?.additionalDetails?.Ulblisttype === "MUNICIPAL_CORPORATION" ? "Commissioner" : "Executive Officer"

Executive Officer,
${ulbname}
${district}

const selfdeclarationform =
`
To,
${ulbselection}
ULB ${ulbname}
Dear Sir or Madam,
I/We, Shri/Smt/Kum. ${ownername} under signed owner of land bearing Kh. No. ${khasranumber} of ULB ${ulbname}
Expand All @@ -77,11 +79,13 @@
E-Naksha plan and nothing has been concealed thereof.
Name of Owner - ${ownername}
Mobile Number - ${ownermobileNumber}
Application Number - ${applicationnumber}
Email Id - ${ownerEmail}
Signature - Verified By OTP at ${TimeStamp}
This Document is Verified By OTP at ${TimeStamp}
Name of Owner - ${ownername}
Mobile Number - ${ownermobileNumber}
Email Id - ${ownerEmail}
`;

const openModal = () => {
Expand Down Expand Up @@ -221,9 +225,11 @@
<pre style={{ whiteSpace: 'pre-wrap', wordWrap: 'break-word', textAlign: 'justify', fontFamily: 'Roboto, serif'}}>{selfdeclarationform}</pre>


<div>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<SubmitBar label={t("BPA_CLOSE")} onSubmit={closeModal} />
</div>
<br></br>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<br></br>
<SubmitBar label={t("BPA_UPLOAD")} onSubmit={uploadSelfDeclaration} disabled={isUploading || isFileUploaded} />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ const BpaApplicationDetail = () => {



{user?.info?.type==="CITIZEN" && (
{workflowDetails?.data?.actionState?.state ==="CITIZEN_APPROVAL_PENDING" && (

<div>
<Card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,40 +35,38 @@
const architecname = user?.info?.name;
const architectmobileNumber = user?.info.mobileNumber
const [params] = Digit.Hooks.useSessionStorage("BUILDING_PERMIT", state?.edcrNumber ? { data: { scrutinyNumber: { edcrNumber: state?.edcrNumber } } } : {});

const [isUploading, setIsUploading] = useState(false); // it will check whether the file upload is in process or not
const [isFileUploaded, setIsFileUploaded] = useState(false);
const architectid = params?.additionalDetails?.architectid;
const ownername = params?.owners?.owners?.[0]?.name;
const mobile = params?.owners?.owners?.[0]?.mobileNumber
const architecttype = params?.additionalDetails?.typeOfArchitect;
const khasranumber = params?.additionalDetails?.khasraNumber;
const ulbname = params?.additionalDetails?.District;
const district = params?.additionalDetails?.UlbName;
const ward = params?.additionalDetails?.wardnumber;
const area = params?.additionalDetails?.area;
const zone = params?.additionalDetails?.zonenumber;
const ulbgrade = params?.address?.city?.city?.ulbGrade
const ulbgrade = params?.additionalDetails?.Ulblisttype
const TimeStamp = otpVerifiedTimestamp;




const selfdeclarationform =
`
To:
${ulbgrade}
ULB ${ulbname}
District ${district}
To,
${ulbgrade}
ULB ${district}
Dear Sir or Madam,
Dear Sir or Madam,
I, under signed Shri/Smt/Kum ${architecname} (${architecttype}) having Registration No. ${architectid} is
appointed by the ${ownername} for the development on land bearing Kh. No ${khasranumber} of ${ulbname},
Area ${area} (Sq.mts).
appointed by the ${ownername} Mobile number ${mobile} for the development on land bearing Kh. No
${khasranumber} of ${ulbname}, Area ${area} (Sq.mts).
This site falls in ward number ${ward} zone number ${zone} in the Master plan of ${district} and
the proposed Residential/Commercial/Industrial construction is permissible in this area.
This site falls in ward number ${ward} zone number ${zone} in the Master plan of ${district}
and the proposed Residential/Commercial/Industrial construction is permissible in this area.
I am currently registered as ${architecttype} with the Competent Authority and empanelled
under Self-Certification Scheme.
Expand Down Expand Up @@ -102,10 +100,15 @@
That above stated facts are true and all the requisite documents uploaded with this E-Naksha plan
have been signed by the owner/owners in my presence.
Architect Name - ${architecname} (${architecttype})
Architect Id - ${architectid}
Mobile Number - ${architectmobileNumber}
Signature - Verified By OTP at ${TimeStamp}
This Document is Verified By OTP at ${TimeStamp}
Name of Professional - ${architecname}
Designation - ${architecttype}
Architect Id - ${architectid}
Mobile Number - ${architectmobileNumber}
`;

const openModal = () => {
Expand Down Expand Up @@ -252,9 +255,11 @@
<pre style={{ whiteSpace: 'pre-wrap', wordWrap: 'break-word', textAlign: 'justify', fontFamily: 'Roboto, serif'}}>{selfdeclarationform}</pre>


<div>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<SubmitBar label={t("BPA_CLOSE")} onSubmit={closeModal} />
<br></br>
</div>
<br></br>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<br></br>
<SubmitBar label={t("BPA_UPLOAD")} onSubmit={uploadSelfDeclaration} disabled={isUploading || isFileUploaded} />
</div>
Expand Down

0 comments on commit c953bd4

Please sign in to comment.