Skip to content

Commit

Permalink
Merge pull request #1374 from ShivankShuklaa/Dev-2.0
Browse files Browse the repository at this point in the history
Button removed for Demo
  • Loading branch information
sriranjan-s authored Sep 19, 2024
2 parents 179cd96 + 1ab573d commit d35aefc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ const BPANewBuildingdetails = ({ t, config, onSelect, formData }) => {
/>
{Master_plan_render_fields()}

<CardLabel>{`${t("BPA_ULB_NAME")}`}</CardLabel>
<CardLabel>{`${t("BPA_DISTRICT")}`}</CardLabel>
<Controller
control={control}
name={"UlbName"}
Expand All @@ -652,7 +652,7 @@ const BPANewBuildingdetails = ({ t, config, onSelect, formData }) => {
)}
/>

<CardLabel>{`${t("BPA_DISTRICT")}`}</CardLabel>
<CardLabel>{`${t("BPA_ULB_NAME")}`}</CardLabel>
<Controller
control={control}
name={"District"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,16 @@ import cloneDeep from "lodash/cloneDeep";
import EXIF from 'exif-js';

const DocumentDetails = ({ t, config, onSelect, userType, formData, setError: setFormError, clearErrors: clearFormErrors, formState, onSubmit }) => {
console.log("formData",formData);
const stateId = Digit.ULBService.getStateId();
const tenantId = "pg.citya";
const [documents, setDocuments] = useState(formData?.documents || []);
const [documents, setDocuments] = useState(formData?.documents?.documents || []);
const [error, setError] = useState(null);
const [enableSubmit, setEnableSubmit] = useState(true)
const [checkRequiredFields, setCheckRequiredFields] = useState(false);
const checkingFlow = formData?.uiFlow?.flow;

const [isNextButtonDisabled, setIsNextButtonDisabled] = useState(false);
console.log("documentsdocuments",documents);


const beforeUploadDocuments = cloneDeep(formData?.PrevStateDocuments || []);
const {data: bpaTaxDocuments, isLoading} = Digit.Hooks.obps.useBPATaxDocuments(stateId, formData, beforeUploadDocuments || []);
Expand Down Expand Up @@ -188,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 @@ -225,8 +224,8 @@ const SelectDocument = React.memo(function MyComponent({
const [uploadedFile, setUploadedFile] = useState(() => documents?.filter((item) => item?.documentType?.includes(doc?.code)).map( e => ({fileStoreId: e?.fileStoreId, fileName: e?.fileName || ""}) ) || null);
const [newArray, setnewArray ] = useState([]);
const [uploadedfileArray, setuploadedfileArray] = useState([]);
const [fileArray, setfileArray] = useState([] || formData?.documents.filter((ob) => ob.documentType === selectedDocument.code) );
console.log("")
const [fileArray, setfileArray] = useState([] || formData?.documents?.documents.filter((ob) => ob.documentType === selectedDocument.code) );

const [latitude, setLatitude] = useState(null);
const [longitude, setLongitude] = useState(null);
function extractGeoLocation(file) {
Expand Down Expand Up @@ -297,12 +296,12 @@ const SelectDocument = React.memo(function MyComponent({
// Continue with your existing codezz
data = Object.fromEntries(e);
newArr = Object.values(data);
newArr = formData?.documents?.filter((ob) => ob.documentType === selectedDocument.code);
newArr = formData?.documents?.documents?.filter((ob) => ob.documentType === selectedDocument.code);
setnewArray(newArr);
// const filteredDocumentsByFileStoreId = documents?.filter((item) => item?.fileStoreId !== uploadedFile.fileStoreId) || []
let newfiles = [];
e?.map((doc, index) => {
console.log("docinnewfilessss",doc);

newfiles.push({
documentType: selectedDocument?.code,
fileName: doc?.[0] || "",
Expand Down Expand Up @@ -425,7 +424,7 @@ const SelectDocument = React.memo(function MyComponent({

const uploadedFilesPreFill = useMemo(()=>{
let selectedUplDocs=[];
formData?.documents?.filter((ob) => ob.documentType === selectedDocument.code).forEach(e =>
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}}])
)
return selectedUplDocs;
Expand Down

0 comments on commit d35aefc

Please sign in to comment.