Skip to content

Commit

Permalink
added save as draft and published changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sriranjan-s authored and sriranjan-s committed Sep 22, 2024
1 parent 80fd1a0 commit 8f64d31
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 31 deletions.
2 changes: 1 addition & 1 deletion frontend/micro-ui/web/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN yarn add @upyog/digit-ui-module-noc@1.7.0-beta.3
RUN yarn add @upyog/digit-ui-module-engagement@1.7.0-beta.4
RUN yarn add @upyog/digit-ui-module-hrms@1.7.0-beta.3
RUN yarn add @upyog/digit-ui-module-core@1.7.0-beta.3
RUN yarn add @upyog/digit-ui-module-obps@1.7.0-beta.17
RUN yarn add @upyog/digit-ui-module-obps@1.7.0-beta.20
RUN yarn add @upyog/digit-ui-module-common@1.7.0-beta.5
RUN yarn add @upyog/digit-ui-module-ws@1.7.0-beta.12
RUN yarn add @upyog/digit-ui-module-commonpt@1.7.0-beta.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@upyog/digit-ui-module-fsm":"1.7.0-beta.18",
"@upyog/digit-ui-module-mcollect":"1.7.0-beta.4",
"@upyog/digit-ui-module-noc":"1.7.0-beta.3",
"@upyog/digit-ui-module-obps":"1.7.0-beta.17",
"@upyog/digit-ui-module-obps":"1.7.0-beta.20",
"@upyog/digit-ui-module-pgr":"1.7.0-beta.6",
"@upyog/digit-ui-module-pt":"1.7.0-beta.4",
"@upyog/digit-ui-module-receipts":"1.7.0-beta.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@upyog/digit-ui-module-fsm": "1.7.0-beta.18",
"@upyog/digit-ui-module-mcollect": "1.7.0-beta.4",
"@upyog/digit-ui-module-noc": "1.7.0-beta.3",
"@upyog/digit-ui-module-obps": "1.7.0-beta.17",
"@upyog/digit-ui-module-obps": "1.7.0-beta.20",
"@upyog/digit-ui-module-pgr": "1.7.0-beta.6",
"@upyog/digit-ui-module-pt": "1.7.0-beta.4",
"@upyog/digit-ui-module-receipts": "1.7.0-beta.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,11 @@ export const convertEpochToDate = (dateEpoch) => {
setTimeout(() => URL.revokeObjectURL(link.href), 7000);
}
};

// let workflowDetails = Digit.Hooks.useWorkflowDetails({
// tenantId: data?.[0]?.tenantId,
// id: data?.[0]?.applicationNo,
// moduleCode: "OBPS",
// });
const getPermitOccupancyOrderSearch = async(order, mode="download") => {
let queryObj = { applicationNo: bpaData?.[0]?.applicationNo };
let bpaResponse = await Digit.OBPSService.BPASearch(bpaData?.[0]?.tenantId, queryObj);
Expand All @@ -321,12 +325,14 @@ export const convertEpochToDate = (dateEpoch) => {
const state = Digit.ULBService.getStateId();

let count=0;
for(let i=0;i<workflowDetails?.data?.processInstances?.length;i++){
if((workflowDetails?.data?.processInstances[i]?.action==="POST_PAYMENT_APPLY" ||workflowDetails?.data?.processInstances[i]?.action==="PAY" ) && (workflowDetails?.data?.processInstances?.[i]?.state?.applicationStatus==="APPROVAL_INPROGRESS") && count==0 ){
reqData.additionalDetails.submissionDate=workflowDetails?.data?.processInstances[i]?.auditDetails?.createdTime;
count=1;
}
}
// console.log("workflowDetails",workflowDetails)
// debugger
// for(let i=0;i<workflowDetails?.data?.processInstances?.length;i++){
// if((workflowDetails?.data?.processInstances[i]?.action==="POST_PAYMENT_APPLY" ||workflowDetails?.data?.processInstances[i]?.action==="PAY" ) && (workflowDetails?.data?.processInstances?.[i]?.state?.applicationStatus==="APPROVAL_INPROGRESS") && count==0 ){
// reqData.additionalDetails.submissionDate=workflowDetails?.data?.processInstances[i]?.auditDetails?.createdTime;
// count=1;
// }
// }

if(reqData?.additionalDetails?.approvedColony=="NO"){
reqData.additionalDetails.permitData= "The plot has been officially regularized under No."+reqData?.additionalDetails?.NocNumber +" dated dd/mm/yyyy, registered in the name of <name as per the NOC>. This regularization falls within the jurisdiction of "+ state +".Any form of misrepresentation of the NoC is strictly prohibited. Such misrepresentation renders the building plan null and void, and it will be regarded as an act of impersonation. Criminal proceedings will be initiated against the owner and concerned architect / engineer/ building designer / supervisor involved in such actions"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@upyog/digit-ui-module-obps",
"version": "1.7.0-beta.17",
"version": "1.7.0-beta.20",
"description": "",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ import EXIF from 'exif-js';

const DocumentDetails = ({ t, config, onSelect, userType, formData, setError: setFormError, clearErrors: clearFormErrors, formState, onSubmit }) => {
const stateId = Digit.ULBService.getStateId();
const tenantId = "pg.citya";
const [documents, setDocuments] = useState(formData?.documents?.documents || []);
const tenantId = Digit.ULBService.getCurrentTenantId();
const [documents, setDocuments] = useState(formData?.documents?.documents|| formData?.documents ||[]);
const [error, setError] = useState(null);
const [enableSubmit, setEnableSubmit] = useState(true)
const [checkRequiredFields, setCheckRequiredFields] = useState(false);
Expand Down Expand Up @@ -78,17 +78,17 @@ const DocumentDetails = ({ t, config, onSelect, userType, formData, setError: se
...updatedFormData.landInfo?.address,
city: updatedFormData.landInfo?.address?.city?.code, // Ensure city is a string
},
owners: updatedFormData.landInfo?.owners.map(owner => ({
owners: updatedFormData?.landInfo?.owners.map(owner => ({
...owner,
gender: owner.gender?.code // Ensure gender is a string
})),
unit: updatedFormData.landInfo?.unit.map(unit => ({
id: unit.id,
floorNo: unit.floorNo,
unitType: unit.unitType,
blockIndex: unit.blockIndex,
usageCategory: unit.usageCategory,
occupancyType: unit.occupancyType // Only necessary fields
unit: updatedFormData?.landInfo?.unit?.map(unit => ({
id: unit?.id,
floorNo: unit?.floorNo,
unitType: unit?.unitType,
blockIndex: unit?.blockIndex,
usageCategory: unit?.usageCategory,
occupancyType: unit?.occupancyType // Only necessary fields
})),
},

Expand Down Expand Up @@ -123,7 +123,7 @@ const DocumentDetails = ({ t, config, onSelect, userType, formData, setError: se
let document = formData.documents;
let documentStep;
let RealignedDocument = [];
bpaTaxDocuments && bpaTaxDocuments.map((ob) => {
bpaTaxDocuments && bpaTaxDocuments?.map((ob) => {
documents && documents.filter(x => ob.code === stringReplaceAll(x?.additionalDetails.category,"_",".")).map((doc) => {
RealignedDocument.push(doc);
})
Expand Down Expand Up @@ -187,11 +187,11 @@ const DocumentDetails = ({ t, config, onSelect, userType, formData, setError: se
})}
{error && <Toast label={error} onClose={() => setError(null)} error />}
{/*Adding Save As Draft Button */}
{/* <SubmitBar
<SubmitBar
label={t("BPA_SAVE_AS_DRAFT")}
onSubmit={handleSaveAsDraft}
disabled={enableSubmit}
/> */}
/>
<br></br>
</FormStep>: <Loader />}
{(window.location.href.includes("/bpa/building_plan_scrutiny/new_construction") || window.location.href.includes("/ocbpa/building_oc_plan_scrutiny/new_construction")) && formData?.applicationNo ? <CitizenInfoLabel info={t("CS_FILE_APPLICATION_INFO_LABEL")} text={`${t("BPA_APPLICATION_NUMBER_LABEL")} ${formData?.applicationNo} ${t("BPA_DOCS_INFORMATION")}`} className={"info-banner-wrap-citizen-override"} /> : ""}
Expand Down Expand Up @@ -422,13 +422,21 @@ const SelectDocument = React.memo(function MyComponent({

const allowedFileTypes = /(.*?)(jpg|jpeg|png|image|pdf)$/i;

const uploadedFilesPreFill = useMemo(()=>{
let selectedUplDocs=[];
formData?.documents?.documents?.filter((ob) => ob.documentType === selectedDocument.code).forEach(e =>
selectedUplDocs.push([e.fileName, {file: {name: e.fileName, type: e.documentType}, fileStoreId: {fileStoreId: e.fileStoreId, tenantId}}])
)
const uploadedFilesPreFill = useMemo(() => {
if (!formData) return [];
const docs = formData.documents?.documents || formData.documents || [];
const selectedUplDocs = docs
.filter(ob => ob.documentType === selectedDocument.code)
.map(e => [
e.fileName,
{
file: { name: e.fileName, type: e.documentType },
fileStoreId: { fileStoreId: e.fileStoreId, tenantId },
},
]);
return selectedUplDocs;
},[formData])
}, [formData, selectedDocument.code, tenantId]);



return (
Expand Down
2 changes: 1 addition & 1 deletion frontend/micro-ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@upyog/digit-ui-module-hrms": "1.7.0-beta.3",
"@upyog/digit-ui-module-mcollect": "1.7.0-beta.4",
"@upyog/digit-ui-module-commonpt":"1.7.0-beta.4",
"@upyog/digit-ui-module-obps": "1.7.0-beta.17",
"@upyog/digit-ui-module-obps": "1.7.0-beta.20",
"@upyog/digit-ui-module-noc": "1.7.0-beta.3",
"@upyog/digit-ui-module-pgr": "1.7.0-beta.6",
"@upyog/digit-ui-module-pt": "1.7.0-beta.4",
Expand Down

0 comments on commit 8f64d31

Please sign in to comment.