@djb25/digit-ui-module-ws 1.0.15 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1705 -236
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef, useMemo, Fragment as Fragment$1, useReducer, useCallback } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { Link, useLocation, Switch, Route, useHistory, useRouteMatch, Redirect, useParams } from 'react-router-dom';
|
|
4
|
-
import { Loader, Card, KeyNote, SubmitBar, InfoBannerIcon, Header, BackButton, PrivateRoute, Banner, CardText, ActionBar, HomeIcon, PrintBtnCommon, MultiLink, LinkButton, Toast, BreadcrumbHeader, ArrowLeft, TickMark, FormStep, CardLabel, RadioOrSelect, TextInput, CardHeader, CitizenInfoLabel, CardSubHeader,
|
|
4
|
+
import { Loader, Card, KeyNote, SubmitBar, InfoBannerIcon, Header, BackButton, PrivateRoute, Banner, CardText, ActionBar, HomeIcon, PrintBtnCommon, MultiLink, LinkButton, Toast, BreadcrumbHeader, ArrowLeft, TickMark, FormStep, CardLabel, RadioOrSelect, TextInput, CardHeader, CitizenInfoLabel, CardSubHeader, Dropdown, UploadFile, CheckBox, RadioButtons, MobileNumber, LabelFieldPair, DatePicker, CardLabelError, DeleteIcon, WrapUnMaskComponent, StatusTable, Row, CardSectionHeader, InfoIcon, TextArea, SearchField, FilterFormField, RemoveableTag, MultiSelectDropdown, InboxComposer, DropIcon, WSICon, EmployeeModuleCard, SearchAction, PopUp, DetailsCard, SearchForm, CloseSvg, CollapsibleCardPage, Table, Localities, Modal, DownloadBtnCommon, CollectionIcon, ResponseComposer, TelePhone, DisplayPhotos, CheckPoint, ConnectingCheckPoints, ActionLinks, PDFSvg, EditIcon, CardSectionSubText, DownloadIcon, CardLabelDesc, VerticalTimeline, FormComposer, MultiUploadWrapper, Close as Close$e, BreakLine, ViewsIcon, Menu, ButtonSelector, CitizenHomeCard } from '@djb25/digit-ui-react-components';
|
|
5
5
|
import { useForm, Controller, useWatch, useFormContext } from 'react-hook-form';
|
|
6
6
|
import { read, utils as utils$1 } from 'xlsx';
|
|
7
7
|
import { useQueryClient } from 'react-query';
|
|
@@ -9860,15 +9860,6 @@ const WSDocsRequired = ({
|
|
|
9860
9860
|
const goNext = () => {
|
|
9861
9861
|
onSelect("DocsReq", "");
|
|
9862
9862
|
};
|
|
9863
|
-
const {
|
|
9864
|
-
control,
|
|
9865
|
-
formState: localFormState,
|
|
9866
|
-
getValues
|
|
9867
|
-
} = useForm();
|
|
9868
|
-
const [zro, setZro] = useState({
|
|
9869
|
-
value: "",
|
|
9870
|
-
error: ""
|
|
9871
|
-
});
|
|
9872
9863
|
sessionStorage.removeItem("Digit.PT_CREATE_EMP_WS_NEW_FORM");
|
|
9873
9864
|
sessionStorage.removeItem("IsDetailsExists");
|
|
9874
9865
|
sessionStorage.removeItem("FORMSTATE_ERRORS");
|
|
@@ -9935,23 +9926,6 @@ const WSDocsRequired = ({
|
|
|
9935
9926
|
onSubmit: goNext
|
|
9936
9927
|
})));
|
|
9937
9928
|
}
|
|
9938
|
-
const menu = [{
|
|
9939
|
-
i18nKey: "ASHOK VIHAR",
|
|
9940
|
-
code: "ASHOK VIHAR",
|
|
9941
|
-
value: "ASHOK VIHAR"
|
|
9942
|
-
}, {
|
|
9943
|
-
i18nKey: "BURARI",
|
|
9944
|
-
code: "BURARI",
|
|
9945
|
-
value: "BURARI"
|
|
9946
|
-
}, {
|
|
9947
|
-
i18nKey: "DWARKA",
|
|
9948
|
-
code: "DWARKA",
|
|
9949
|
-
value: "DWARKA"
|
|
9950
|
-
}, {
|
|
9951
|
-
i18nKey: "OKHLA",
|
|
9952
|
-
code: "OKHLA",
|
|
9953
|
-
value: "OKHLA"
|
|
9954
|
-
}];
|
|
9955
9929
|
return /*#__PURE__*/React.createElement("div", {
|
|
9956
9930
|
className: "employee-form-content-with-action-bar"
|
|
9957
9931
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -9980,37 +9954,7 @@ const WSDocsRequired = ({
|
|
|
9980
9954
|
}, /*#__PURE__*/React.createElement("span", {
|
|
9981
9955
|
className: "ws-doc-bullet"
|
|
9982
9956
|
}, idx + 1, "."), /*#__PURE__*/React.createElement("span", null, t(value === null || value === void 0 ? void 0 : value.i18nKey))))));
|
|
9983
|
-
}), /*#__PURE__*/React.createElement(
|
|
9984
|
-
className: "ws-doc-card"
|
|
9985
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
9986
|
-
className: "card-label-smaller"
|
|
9987
|
-
}, "ZRO Location"), /*#__PURE__*/React.createElement("div", {
|
|
9988
|
-
className: "field"
|
|
9989
|
-
}, /*#__PURE__*/React.createElement(Controller, {
|
|
9990
|
-
control: control,
|
|
9991
|
-
name: "zro",
|
|
9992
|
-
defaultValue: zro,
|
|
9993
|
-
rules: {
|
|
9994
|
-
required: t("REQUIRED_FIELD")
|
|
9995
|
-
},
|
|
9996
|
-
isMandatory: true,
|
|
9997
|
-
render: props => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Dropdown, {
|
|
9998
|
-
className: "form-field",
|
|
9999
|
-
selected: getValues("gender"),
|
|
10000
|
-
disable: false,
|
|
10001
|
-
option: menu,
|
|
10002
|
-
errorStyle: localFormState.touched.gender && zro.error ? true : false,
|
|
10003
|
-
select: e => {
|
|
10004
|
-
setZro(prev => ({
|
|
10005
|
-
...prev,
|
|
10006
|
-
value: e
|
|
10007
|
-
}));
|
|
10008
|
-
},
|
|
10009
|
-
optionKey: "i18nKey",
|
|
10010
|
-
onBlur: props.onBlur,
|
|
10011
|
-
t: t
|
|
10012
|
-
}))
|
|
10013
|
-
}))), localFormState && zro.error && /*#__PURE__*/React.createElement(CardLabelError, null, zro.error)))), /*#__PURE__*/React.createElement(ActionBar, {
|
|
9957
|
+
})), /*#__PURE__*/React.createElement(ActionBar, {
|
|
10014
9958
|
style: {
|
|
10015
9959
|
display: "flex",
|
|
10016
9960
|
justifyContent: "flex-end",
|
|
@@ -10020,8 +9964,7 @@ const WSDocsRequired = ({
|
|
|
10020
9964
|
label: t("ACTION_TEST_APPLY"),
|
|
10021
9965
|
onSubmit: () => {
|
|
10022
9966
|
history.push(match.path.replace("create-application", "new-application"));
|
|
10023
|
-
}
|
|
10024
|
-
disabled: wsDocsLoading || !zro.value ? true : false
|
|
9967
|
+
}
|
|
10025
9968
|
}))));
|
|
10026
9969
|
};
|
|
10027
9970
|
|
|
@@ -30945,32 +30888,395 @@ const RequiredDocuments = ({
|
|
|
30945
30888
|
})));
|
|
30946
30889
|
};
|
|
30947
30890
|
|
|
30891
|
+
const FORM_STORAGE_KEY = "WS_EMPLOYEE_NEW_APPLICATION_FORM";
|
|
30892
|
+
const MAX_FILE_SIZE = 5242880;
|
|
30893
|
+
const SUPPORTED_FILE_TYPES = /(\.pdf|\.png|\.jpe?g)$/i;
|
|
30894
|
+
const NAME_PATTERN = /^[a-zA-Z\s.'-]{1,50}$/;
|
|
30895
|
+
const EMAIL_PATTERN = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/;
|
|
30896
|
+
const MOBILE_PATTERN = /^[6-9][0-9]{9}$/;
|
|
30897
|
+
const OFFICE_PATTERN = /^[0-9]{6,12}$/;
|
|
30898
|
+
const PINCODE_PATTERN = /^[1-9][0-9]{5}$/;
|
|
30899
|
+
const NUMBER_PATTERN = /^\d+$/;
|
|
30900
|
+
const DECIMAL_PATTERN = /^\d+(\.\d{1,2})?$/;
|
|
30901
|
+
const IFSC_PATTERN = /^[A-Z]{4}0[A-Z0-9]{6}$/;
|
|
30902
|
+
const ACCOUNT_PATTERN = /^[0-9]{9,18}$/;
|
|
30903
|
+
const COLLAPSIBLE_CONTENT_TAB = "__WS_SECTION_CONTENT__";
|
|
30904
|
+
const createOption = (code, name) => ({
|
|
30905
|
+
code,
|
|
30906
|
+
name
|
|
30907
|
+
});
|
|
30908
|
+
const TYPE_OF_REQUEST_OPTIONS = [createOption("NEW_CONNECTION", "New Connection"), createOption("TEMPORARY_CONNECTION", "Temporary Connection"), createOption("CHANGE_REQUEST", "Change Request")];
|
|
30909
|
+
const CONNECTION_TYPE_OPTIONS = [createOption("METERED", "Metered"), createOption("NON_METERED", "Non Metered")];
|
|
30910
|
+
const LOCALITY_OPTIONS = [createOption("DWARKA", "Dwarka"), createOption("ROHINI", "Rohini"), createOption("KAROL_BAGH", "Karol Bagh")];
|
|
30911
|
+
const SUB_LOCALITY_OPTIONS = {
|
|
30912
|
+
DWARKA: [createOption("SECTOR_6", "Sector 6"), createOption("SECTOR_10", "Sector 10"), createOption("SECTOR_12", "Sector 12")],
|
|
30913
|
+
ROHINI: [createOption("SECTOR_3", "Sector 3"), createOption("SECTOR_8", "Sector 8"), createOption("SECTOR_16", "Sector 16")],
|
|
30914
|
+
KAROL_BAGH: [createOption("DEV_NAGAR", "Dev Nagar"), createOption("PAHAR_GANJ", "Pahar Ganj"), createOption("PATEL_NAGAR", "Patel Nagar")]
|
|
30915
|
+
};
|
|
30916
|
+
const ASSEMBLY_OPTIONS = [createOption("DWARKA_ASSEMBLY", "Dwarka Assembly"), createOption("ROHINI_ASSEMBLY", "Rohini Assembly"), createOption("KAROL_BAGH_ASSEMBLY", "Karol Bagh Assembly")];
|
|
30917
|
+
const WARD_OPTIONS = [createOption("WARD_101", "Ward 101"), createOption("WARD_102", "Ward 102"), createOption("WARD_103", "Ward 103")];
|
|
30918
|
+
const PROPERTY_TYPE_OPTIONS = [createOption("RESIDENTIAL", "Residential"), createOption("COMMERCIAL", "Commercial"), createOption("INDUSTRIAL", "Industrial"), createOption("INSTITUTIONAL", "Institutional"), createOption("HOSPITAL_NURSING_HOME", "Hospital / Nursing Home")];
|
|
30919
|
+
const WATER_CONNECTION_CATEGORY_OPTIONS = [createOption("DOMESTIC", "Domestic"), createOption("NON_DOMESTIC", "Non-Domestic"), createOption("MIXED_USE", "Mixed Use")];
|
|
30920
|
+
const WATER_CONNECTION_USED_BY_OPTIONS = [createOption("OWNER", "Owner"), createOption("TENANT", "Tenant"), createOption("AUTHORIZED_OCCUPIER", "Authorized Occupier")];
|
|
30921
|
+
const PROOF_OF_IDENTITY_OPTIONS = [createOption("AADHAAR", "Aadhaar"), createOption("PAN", "PAN"), createOption("VOTER_ID", "Voter ID"), createOption("PASSPORT", "Passport"), createOption("DRIVING_LICENSE", "Driving License")];
|
|
30922
|
+
const OWNERSHIP_STATUS_OPTIONS = [createOption("SELF_OWNED", "Self Owned"), createOption("LEASED", "Leased"), createOption("RENTED", "Rented"), createOption("GOVERNMENT_ALLOTTED", "Government Allotted")];
|
|
30923
|
+
const SUBMITTED_BY_OPTIONS = [createOption("APPLICANT", "Applicant"), createOption("AUTHORIZED_SIGNATORY", "Authorized Signatory"), createOption("DJB_COUNTER", "DJB Counter")];
|
|
30924
|
+
const DEFAULT_SECTION_STATE = {
|
|
30925
|
+
application: true,
|
|
30926
|
+
applicant: true,
|
|
30927
|
+
contact: true,
|
|
30928
|
+
employee: true,
|
|
30929
|
+
address: true,
|
|
30930
|
+
usage: true,
|
|
30931
|
+
bank: true,
|
|
30932
|
+
rainWaterHarvesting: true,
|
|
30933
|
+
documents: true,
|
|
30934
|
+
declaration: true
|
|
30935
|
+
};
|
|
30936
|
+
const DEFAULT_FORM_VALUES = {
|
|
30937
|
+
typeOfRequest: null,
|
|
30938
|
+
connectionType: null,
|
|
30939
|
+
applicant: {
|
|
30940
|
+
firstName: "",
|
|
30941
|
+
middleName: "",
|
|
30942
|
+
lastName: "",
|
|
30943
|
+
fatherOrHusbandName: "",
|
|
30944
|
+
isGovernmentOrganization: false,
|
|
30945
|
+
applicantIdProofFile: null,
|
|
30946
|
+
governmentOrganizationName: ""
|
|
30947
|
+
},
|
|
30948
|
+
contact: {
|
|
30949
|
+
emailId: "",
|
|
30950
|
+
mobileNumber: "",
|
|
30951
|
+
officeNumber: ""
|
|
30952
|
+
},
|
|
30953
|
+
djbEmployee: {
|
|
30954
|
+
isDjbEmployee: false,
|
|
30955
|
+
employeeId: "",
|
|
30956
|
+
retirementDate: "",
|
|
30957
|
+
officeNameAndAddress: ""
|
|
30958
|
+
},
|
|
30959
|
+
propertyAddress: {
|
|
30960
|
+
address: "",
|
|
30961
|
+
landmark: "",
|
|
30962
|
+
pinCode: "",
|
|
30963
|
+
locality: null,
|
|
30964
|
+
subLocality: null,
|
|
30965
|
+
assembly: null,
|
|
30966
|
+
ward: null
|
|
30967
|
+
},
|
|
30968
|
+
useDetails: {
|
|
30969
|
+
propertyType: null,
|
|
30970
|
+
noOfFloors: "",
|
|
30971
|
+
hospitalBeds: "",
|
|
30972
|
+
plotArea: "",
|
|
30973
|
+
builtUpArea: "",
|
|
30974
|
+
waterConnectionCategory: null,
|
|
30975
|
+
waterConnectionUsedBy: null
|
|
30976
|
+
},
|
|
30977
|
+
bankDetails: {
|
|
30978
|
+
bankName: "",
|
|
30979
|
+
branchName: "",
|
|
30980
|
+
ifscCode: "",
|
|
30981
|
+
bankAccountNumber: ""
|
|
30982
|
+
},
|
|
30983
|
+
rainWaterHarvesting: {
|
|
30984
|
+
applyForAdequacyCertificate: false
|
|
30985
|
+
},
|
|
30986
|
+
documents: {
|
|
30987
|
+
proofOfIdentity: null,
|
|
30988
|
+
identityProofFile: null,
|
|
30989
|
+
ownershipStatus: null,
|
|
30990
|
+
ownershipDocumentFile: null,
|
|
30991
|
+
otherDocumentFile: null
|
|
30992
|
+
},
|
|
30993
|
+
declaration: {
|
|
30994
|
+
submittedBy: null,
|
|
30995
|
+
signatureFile: null,
|
|
30996
|
+
captcha: "",
|
|
30997
|
+
agree: false
|
|
30998
|
+
},
|
|
30999
|
+
cpt: {
|
|
31000
|
+
id: "",
|
|
31001
|
+
details: null
|
|
31002
|
+
}
|
|
31003
|
+
};
|
|
31004
|
+
const fieldWrapperStyle = {
|
|
31005
|
+
display: "flex",
|
|
31006
|
+
flexDirection: "column",
|
|
31007
|
+
gap: "8px",
|
|
31008
|
+
minWidth: 0
|
|
31009
|
+
};
|
|
31010
|
+
const secondaryButtonStyle = {
|
|
31011
|
+
background: "#FFFFFF",
|
|
31012
|
+
border: "1px solid #0B4B66",
|
|
31013
|
+
boxShadow: "none",
|
|
31014
|
+
color: "#0B4B66"
|
|
31015
|
+
};
|
|
31016
|
+
const actionBarStyle = {
|
|
31017
|
+
display: "flex",
|
|
31018
|
+
justifyContent: "flex-end",
|
|
31019
|
+
alignItems: "center",
|
|
31020
|
+
gap: "16px",
|
|
31021
|
+
flexWrap: "wrap"
|
|
31022
|
+
};
|
|
31023
|
+
const captchaBoxStyle = {
|
|
31024
|
+
background: "#F3F7F9",
|
|
31025
|
+
border: "1px dashed #0B4B66",
|
|
31026
|
+
borderRadius: "4px",
|
|
31027
|
+
fontFamily: "monospace",
|
|
31028
|
+
fontSize: "20px",
|
|
31029
|
+
fontWeight: "700",
|
|
31030
|
+
letterSpacing: "4px",
|
|
31031
|
+
padding: "12px 16px"
|
|
31032
|
+
};
|
|
31033
|
+
const linkButtonStyle = {
|
|
31034
|
+
background: "transparent",
|
|
31035
|
+
border: "none",
|
|
31036
|
+
color: "#0B4B66",
|
|
31037
|
+
cursor: "pointer",
|
|
31038
|
+
fontSize: "14px",
|
|
31039
|
+
fontWeight: "600",
|
|
31040
|
+
padding: 0,
|
|
31041
|
+
textDecoration: "underline"
|
|
31042
|
+
};
|
|
31043
|
+
const getStoredFormData = () => {
|
|
31044
|
+
if (typeof window === "undefined") return {};
|
|
31045
|
+
try {
|
|
31046
|
+
const savedData = window.sessionStorage.getItem(FORM_STORAGE_KEY);
|
|
31047
|
+
return savedData ? JSON.parse(savedData) : {};
|
|
31048
|
+
} catch (error) {
|
|
31049
|
+
return {};
|
|
31050
|
+
}
|
|
31051
|
+
};
|
|
31052
|
+
const buildDefaultValues = (savedFormData = {}) => ({
|
|
31053
|
+
typeOfRequest: (savedFormData === null || savedFormData === void 0 ? void 0 : savedFormData.typeOfRequest) || DEFAULT_FORM_VALUES.typeOfRequest,
|
|
31054
|
+
connectionType: (savedFormData === null || savedFormData === void 0 ? void 0 : savedFormData.connectionType) || DEFAULT_FORM_VALUES.connectionType,
|
|
31055
|
+
applicant: {
|
|
31056
|
+
...DEFAULT_FORM_VALUES.applicant,
|
|
31057
|
+
...((savedFormData === null || savedFormData === void 0 ? void 0 : savedFormData.applicant) || {})
|
|
31058
|
+
},
|
|
31059
|
+
contact: {
|
|
31060
|
+
...DEFAULT_FORM_VALUES.contact,
|
|
31061
|
+
...((savedFormData === null || savedFormData === void 0 ? void 0 : savedFormData.contact) || {})
|
|
31062
|
+
},
|
|
31063
|
+
djbEmployee: {
|
|
31064
|
+
...DEFAULT_FORM_VALUES.djbEmployee,
|
|
31065
|
+
...((savedFormData === null || savedFormData === void 0 ? void 0 : savedFormData.djbEmployee) || {})
|
|
31066
|
+
},
|
|
31067
|
+
propertyAddress: {
|
|
31068
|
+
...DEFAULT_FORM_VALUES.propertyAddress,
|
|
31069
|
+
...((savedFormData === null || savedFormData === void 0 ? void 0 : savedFormData.propertyAddress) || {})
|
|
31070
|
+
},
|
|
31071
|
+
useDetails: {
|
|
31072
|
+
...DEFAULT_FORM_VALUES.useDetails,
|
|
31073
|
+
...((savedFormData === null || savedFormData === void 0 ? void 0 : savedFormData.useDetails) || {})
|
|
31074
|
+
},
|
|
31075
|
+
bankDetails: {
|
|
31076
|
+
...DEFAULT_FORM_VALUES.bankDetails,
|
|
31077
|
+
...((savedFormData === null || savedFormData === void 0 ? void 0 : savedFormData.bankDetails) || {})
|
|
31078
|
+
},
|
|
31079
|
+
rainWaterHarvesting: {
|
|
31080
|
+
...DEFAULT_FORM_VALUES.rainWaterHarvesting,
|
|
31081
|
+
...((savedFormData === null || savedFormData === void 0 ? void 0 : savedFormData.rainWaterHarvesting) || {})
|
|
31082
|
+
},
|
|
31083
|
+
documents: {
|
|
31084
|
+
...DEFAULT_FORM_VALUES.documents,
|
|
31085
|
+
...((savedFormData === null || savedFormData === void 0 ? void 0 : savedFormData.documents) || {})
|
|
31086
|
+
},
|
|
31087
|
+
declaration: {
|
|
31088
|
+
...DEFAULT_FORM_VALUES.declaration,
|
|
31089
|
+
...((savedFormData === null || savedFormData === void 0 ? void 0 : savedFormData.declaration) || {})
|
|
31090
|
+
},
|
|
31091
|
+
cpt: (savedFormData === null || savedFormData === void 0 ? void 0 : savedFormData.cpt) || {
|
|
31092
|
+
id: "",
|
|
31093
|
+
details: null
|
|
31094
|
+
}
|
|
31095
|
+
});
|
|
31096
|
+
const resolveNestedValue = (value, path) => path.split(".").reduce((accumulator, currentKey) => {
|
|
31097
|
+
if (accumulator === null || accumulator === undefined) return undefined;
|
|
31098
|
+
return accumulator[currentKey];
|
|
31099
|
+
}, value);
|
|
31100
|
+
const getDisplayValue = value => {
|
|
31101
|
+
if (value === null || value === undefined || value === "") return "Not provided";
|
|
31102
|
+
if (typeof value === "boolean") return value ? "Yes" : "No";
|
|
31103
|
+
if (typeof value === "object") {
|
|
31104
|
+
if (value !== null && value !== void 0 && value.fileName) return value.fileName;
|
|
31105
|
+
if (value !== null && value !== void 0 && value.name) return value.name;
|
|
31106
|
+
if (value !== null && value !== void 0 && value.code) return value.code;
|
|
31107
|
+
}
|
|
31108
|
+
return String(value);
|
|
31109
|
+
};
|
|
31110
|
+
const generateCaptcha = () => {
|
|
31111
|
+
const characters = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
|
|
31112
|
+
let captcha = "";
|
|
31113
|
+
for (let index = 0; index < 6; index += 1) {
|
|
31114
|
+
captcha += characters.charAt(Math.floor(Math.random() * characters.length));
|
|
31115
|
+
}
|
|
31116
|
+
return captcha;
|
|
31117
|
+
};
|
|
31118
|
+
const FieldBlock = ({
|
|
31119
|
+
label,
|
|
31120
|
+
required,
|
|
31121
|
+
error,
|
|
31122
|
+
children,
|
|
31123
|
+
hint,
|
|
31124
|
+
isFullWidth
|
|
31125
|
+
}) => {
|
|
31126
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31127
|
+
style: {
|
|
31128
|
+
...fieldWrapperStyle,
|
|
31129
|
+
...(isFullWidth ? {
|
|
31130
|
+
gridColumn: "1 / -1"
|
|
31131
|
+
} : {})
|
|
31132
|
+
}
|
|
31133
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
31134
|
+
style: {
|
|
31135
|
+
fontWeight: "600",
|
|
31136
|
+
marginBottom: "0px"
|
|
31137
|
+
}
|
|
31138
|
+
}, required ? `${label} *` : label), children, hint ? /*#__PURE__*/React.createElement(CardText, {
|
|
31139
|
+
style: {
|
|
31140
|
+
color: "#505A5F",
|
|
31141
|
+
fontSize: "14px",
|
|
31142
|
+
marginBottom: "0px",
|
|
31143
|
+
marginTop: "0px"
|
|
31144
|
+
}
|
|
31145
|
+
}, hint) : null, error ? /*#__PURE__*/React.createElement(CardLabelError, null, (error === null || error === void 0 ? void 0 : error.message) || error) : null);
|
|
31146
|
+
};
|
|
31147
|
+
const SectionCard = ({
|
|
31148
|
+
title,
|
|
31149
|
+
description,
|
|
31150
|
+
isOpen: _isOpen = true,
|
|
31151
|
+
children
|
|
31152
|
+
}) => {
|
|
31153
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31154
|
+
className: "ws-new-application-collapsible",
|
|
31155
|
+
style: {
|
|
31156
|
+
marginBottom: "16px"
|
|
31157
|
+
}
|
|
31158
|
+
}, /*#__PURE__*/React.createElement(CollapsibleCardPage, {
|
|
31159
|
+
defaultOpen: _isOpen,
|
|
31160
|
+
defaultTab: COLLAPSIBLE_CONTENT_TAB,
|
|
31161
|
+
tabs: [COLLAPSIBLE_CONTENT_TAB],
|
|
31162
|
+
title: title
|
|
31163
|
+
}, () => /*#__PURE__*/React.createElement(React.Fragment, null, description ? /*#__PURE__*/React.createElement(CardSectionSubText, {
|
|
31164
|
+
style: {
|
|
31165
|
+
marginBottom: "16px"
|
|
31166
|
+
}
|
|
31167
|
+
}, description) : null, /*#__PURE__*/React.createElement("div", {
|
|
31168
|
+
className: "formcomposer-section-grid"
|
|
31169
|
+
}, children))));
|
|
31170
|
+
};
|
|
31171
|
+
const PreviewItem = ({
|
|
31172
|
+
label,
|
|
31173
|
+
value,
|
|
31174
|
+
isFullWidth
|
|
31175
|
+
}) => {
|
|
31176
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31177
|
+
style: {
|
|
31178
|
+
...fieldWrapperStyle,
|
|
31179
|
+
...(isFullWidth ? {
|
|
31180
|
+
gridColumn: "1 / -1"
|
|
31181
|
+
} : {})
|
|
31182
|
+
}
|
|
31183
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
31184
|
+
style: {
|
|
31185
|
+
fontWeight: "600",
|
|
31186
|
+
marginBottom: "0px"
|
|
31187
|
+
}
|
|
31188
|
+
}, label), /*#__PURE__*/React.createElement(CardText, {
|
|
31189
|
+
style: {
|
|
31190
|
+
marginBottom: "0px",
|
|
31191
|
+
marginTop: "0px"
|
|
31192
|
+
}
|
|
31193
|
+
}, getDisplayValue(value)));
|
|
31194
|
+
};
|
|
31195
|
+
const FileUploadField = ({
|
|
31196
|
+
id,
|
|
31197
|
+
label,
|
|
31198
|
+
value,
|
|
31199
|
+
onUpload,
|
|
31200
|
+
onDelete,
|
|
31201
|
+
error,
|
|
31202
|
+
isUploading,
|
|
31203
|
+
helperText,
|
|
31204
|
+
required
|
|
31205
|
+
}) => {
|
|
31206
|
+
return /*#__PURE__*/React.createElement(FieldBlock, {
|
|
31207
|
+
label: label,
|
|
31208
|
+
required: required,
|
|
31209
|
+
error: error,
|
|
31210
|
+
hint: helperText
|
|
31211
|
+
}, /*#__PURE__*/React.createElement(UploadFile, {
|
|
31212
|
+
accept: "image/*,.pdf,.png,.jpeg,.jpg",
|
|
31213
|
+
buttonType: "button",
|
|
31214
|
+
error: !!error,
|
|
31215
|
+
id: id,
|
|
31216
|
+
message: value !== null && value !== void 0 && value.fileStoreId ? "1 file uploaded" : "No file uploaded",
|
|
31217
|
+
onDelete: onDelete,
|
|
31218
|
+
onUpload: onUpload
|
|
31219
|
+
}), /*#__PURE__*/React.createElement(CardText, {
|
|
31220
|
+
style: {
|
|
31221
|
+
marginBottom: "0px",
|
|
31222
|
+
marginTop: "0px"
|
|
31223
|
+
}
|
|
31224
|
+
}, isUploading ? "Uploading file..." : (value === null || value === void 0 ? void 0 : value.fileName) || "No file selected"));
|
|
31225
|
+
};
|
|
30948
31226
|
const NewApplication = () => {
|
|
30949
|
-
var _Digit$SessionStorage;
|
|
31227
|
+
var _Digit$SessionStorage, _formValues$applicant, _formValues$applicant2, _formValues$applicant3, _formValues$applicant4, _formValues$applicant5, _formValues$applicant6, _formValues$applicant7, _formValues$applicant8, _formValues$contact, _formValues$contact2, _formValues$contact3, _formValues$djbEmploy, _formValues$djbEmploy2, _formValues$djbEmploy3, _formValues$djbEmploy4, _formValues$djbEmploy5, _formValues$propertyA, _formValues$propertyA2, _formValues$propertyA3, _formValues$propertyA4, _formValues$propertyA5, _formValues$propertyA6, _formValues$propertyA7, _formValues$useDetail, _formValues$useDetail2, _formValues$useDetail3, _formValues$useDetail4, _formValues$useDetail5, _formValues$useDetail6, _formValues$useDetail7, _formValues$useDetail8, _formValues$useDetail9, _formValues$bankDetai, _formValues$bankDetai2, _formValues$bankDetai3, _formValues$bankDetai4, _formValues$rainWater, _formValues$documents, _formValues$documents2, _formValues$documents3, _formValues$documents4, _formValues$documents5, _formValues$declarati, _formValues$declarati2, _formValues$declarati3, _formValues$declarati4;
|
|
30950
31228
|
const {
|
|
30951
31229
|
t
|
|
30952
31230
|
} = useTranslation();
|
|
30953
31231
|
const history = useHistory();
|
|
30954
|
-
const
|
|
30955
|
-
const
|
|
31232
|
+
const location = useLocation();
|
|
31233
|
+
const stateId = Digit.ULBService.getStateId();
|
|
31234
|
+
const tenantId = Digit.ULBService.getCurrentTenantId() || ((_Digit$SessionStorage = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.code);
|
|
31235
|
+
const [previewMode, setPreviewMode] = useState(false);
|
|
31236
|
+
const [currentStep, setCurrentStep] = useState(1);
|
|
31237
|
+
const [collapsedSections, setCollapsedSections] = useState(DEFAULT_SECTION_STATE);
|
|
30956
31238
|
const [showToast, setShowToast] = useState(null);
|
|
31239
|
+
const [generatedCaptcha, setGeneratedCaptcha] = useState(generateCaptcha());
|
|
31240
|
+
const [uploadingFields, setUploadingFields] = useState({});
|
|
31241
|
+
const [isEnableLoader, setIsEnableLoader] = useState(false);
|
|
30957
31242
|
const [appDetails, setAppDetails] = useState({});
|
|
30958
31243
|
const [waterAndSewerageBoth, setWaterAndSewerageBoth] = useState(null);
|
|
30959
|
-
const [
|
|
30960
|
-
|
|
30961
|
-
|
|
31244
|
+
const [propertyId, setPropertyId] = useState(new URLSearchParams(location.search).get("propertyId"));
|
|
31245
|
+
const [zro, setZro] = useState({
|
|
31246
|
+
value: "",
|
|
31247
|
+
error: ""
|
|
30962
31248
|
});
|
|
30963
|
-
|
|
30964
|
-
tenantId ? tenantId : (_Digit$SessionStorage = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.code;
|
|
30965
|
-
const stateId = Digit.ULBService.getStateId();
|
|
30966
|
-
let {
|
|
30967
|
-
data: newConfig,
|
|
30968
|
-
isLoading
|
|
30969
|
-
} = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {});
|
|
30970
|
-
const [propertyId, setPropertyId] = useState(new URLSearchParams(useLocation().search).get("propertyId"));
|
|
30971
|
-
const [sessionFormData, setSessionFormData, clearSessionFormData] = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {});
|
|
31249
|
+
const initialFormValues = buildDefaultValues(getStoredFormData());
|
|
30972
31250
|
const {
|
|
30973
|
-
|
|
31251
|
+
register,
|
|
31252
|
+
control,
|
|
31253
|
+
handleSubmit,
|
|
31254
|
+
watch,
|
|
31255
|
+
setValue,
|
|
31256
|
+
setError,
|
|
31257
|
+
clearErrors,
|
|
31258
|
+
reset,
|
|
31259
|
+
getValues,
|
|
31260
|
+
formState: {
|
|
31261
|
+
errors,
|
|
31262
|
+
localFormState
|
|
31263
|
+
}
|
|
31264
|
+
} = useForm({
|
|
31265
|
+
defaultValues: initialFormValues,
|
|
31266
|
+
shouldUnregister: false
|
|
31267
|
+
});
|
|
31268
|
+
const formValues = watch();
|
|
31269
|
+
const isGovernmentOrganization = watch("applicant.isGovernmentOrganization");
|
|
31270
|
+
const isDjbEmployee = watch("djbEmployee.isDjbEmployee");
|
|
31271
|
+
const selectedPropertyType = watch("useDetails.propertyType");
|
|
31272
|
+
const selectedLocality = watch("propertyAddress.locality");
|
|
31273
|
+
const selectedSubLocality = watch("propertyAddress.subLocality");
|
|
31274
|
+
const subLocalityOptions = selectedLocality ? SUB_LOCALITY_OPTIONS[selectedLocality.code] || [] : [];
|
|
31275
|
+
const hasPendingUpload = Object.values(uploadingFields).some(Boolean);
|
|
31276
|
+
const isHospitalProperty = (selectedPropertyType === null || selectedPropertyType === void 0 ? void 0 : selectedPropertyType.code) === "HOSPITAL_NURSING_HOME";
|
|
31277
|
+
const {
|
|
31278
|
+
data: propertyDetails,
|
|
31279
|
+
isLoading: isPropertyLoading
|
|
30974
31280
|
} = Digit.Hooks.pt.usePropertySearch({
|
|
30975
31281
|
filters: {
|
|
30976
31282
|
propertyIds: propertyId
|
|
@@ -30981,114 +31287,189 @@ const NewApplication = () => {
|
|
|
30981
31287
|
propertyIds: propertyId
|
|
30982
31288
|
},
|
|
30983
31289
|
tenantId: tenantId,
|
|
30984
|
-
enabled: propertyId
|
|
31290
|
+
enabled: !!propertyId
|
|
30985
31291
|
});
|
|
30986
|
-
useEffect(() => {
|
|
30987
|
-
if (!isLoading) {
|
|
30988
|
-
var _config$body;
|
|
30989
|
-
const config = newConfig.find(conf => conf.hideInCitizen && conf.isCreate);
|
|
30990
|
-
config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_LABEL";
|
|
30991
|
-
let bodyDetails = [];
|
|
30992
|
-
config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
|
|
30993
|
-
if (data !== null && data !== void 0 && data.isCreateConnection) bodyDetails.push(data);
|
|
30994
|
-
});
|
|
30995
|
-
config.body = bodyDetails;
|
|
30996
|
-
setConfig(config);
|
|
30997
|
-
}
|
|
30998
|
-
}, [newConfig]);
|
|
30999
|
-
useEffect(() => {
|
|
31000
|
-
var _sessionFormData$cpt, _sessionFormData$cpt$, _sessionFormData$cpt2, _sessionFormData$cpt3;
|
|
31001
|
-
!propertyId && (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt = sessionFormData.cpt) === null || _sessionFormData$cpt === void 0 ? void 0 : (_sessionFormData$cpt$ = _sessionFormData$cpt.details) === null || _sessionFormData$cpt$ === void 0 ? void 0 : _sessionFormData$cpt$.propertyId) && setPropertyId(sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt2 = sessionFormData.cpt) === null || _sessionFormData$cpt2 === void 0 ? void 0 : (_sessionFormData$cpt3 = _sessionFormData$cpt2.details) === null || _sessionFormData$cpt3 === void 0 ? void 0 : _sessionFormData$cpt3.propertyId);
|
|
31002
|
-
}, [sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
|
|
31003
|
-
useEffect(() => {
|
|
31004
|
-
var _propertyDetails$Prop;
|
|
31005
|
-
setSessionFormData({
|
|
31006
|
-
...sessionFormData,
|
|
31007
|
-
cpt: {
|
|
31008
|
-
details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop[0]
|
|
31009
|
-
}
|
|
31010
|
-
});
|
|
31011
|
-
}, [propertyDetails]);
|
|
31012
31292
|
const {
|
|
31013
|
-
isLoading: creatingWaterApplicationLoading,
|
|
31014
|
-
isError: createWaterApplicationError,
|
|
31015
|
-
data: createWaterResponse,
|
|
31016
|
-
error: createWaterError,
|
|
31017
31293
|
mutate: waterMutation
|
|
31018
31294
|
} = Digit.Hooks.ws.useWaterCreateAPI("WATER");
|
|
31019
31295
|
const {
|
|
31020
|
-
isLoading: updatingWaterApplicationLoading,
|
|
31021
|
-
isError: updateWaterApplicationError,
|
|
31022
|
-
data: updateWaterResponse,
|
|
31023
|
-
error: updateWaterError,
|
|
31024
31296
|
mutate: waterUpdateMutation
|
|
31025
31297
|
} = Digit.Hooks.ws.useWSApplicationActions("WATER");
|
|
31026
31298
|
const {
|
|
31027
|
-
isLoading: creatingSewerageApplicationLoading,
|
|
31028
|
-
isError: createSewerageApplicationError,
|
|
31029
|
-
data: createSewerageResponse,
|
|
31030
|
-
error: createSewerageError,
|
|
31031
31299
|
mutate: sewerageMutation
|
|
31032
31300
|
} = Digit.Hooks.ws.useWaterCreateAPI("SEWERAGE");
|
|
31033
31301
|
const {
|
|
31034
|
-
isLoading: updatingSewerageApplicationLoading,
|
|
31035
|
-
isError: updateSewerageApplicationError,
|
|
31036
|
-
data: updateSewerageResponse,
|
|
31037
|
-
error: updateSewerageError,
|
|
31038
31302
|
mutate: sewerageUpdateMutation
|
|
31039
31303
|
} = Digit.Hooks.ws.useWSApplicationActions("SEWERAGE");
|
|
31040
|
-
|
|
31041
|
-
|
|
31042
|
-
|
|
31043
|
-
|
|
31044
|
-
|
|
31045
|
-
|
|
31304
|
+
useEffect(() => {
|
|
31305
|
+
if (typeof window === "undefined") return;
|
|
31306
|
+
window.sessionStorage.setItem(FORM_STORAGE_KEY, JSON.stringify(formValues));
|
|
31307
|
+
}, [formValues]);
|
|
31308
|
+
useEffect(() => {
|
|
31309
|
+
if (!isGovernmentOrganization) {
|
|
31310
|
+
setValue("applicant.governmentOrganizationName", "");
|
|
31311
|
+
clearErrors("applicant.governmentOrganizationName");
|
|
31312
|
+
}
|
|
31313
|
+
}, [isGovernmentOrganization, setValue, clearErrors]);
|
|
31314
|
+
useEffect(() => {
|
|
31315
|
+
if (!isDjbEmployee) {
|
|
31316
|
+
setValue("djbEmployee.employeeId", "");
|
|
31317
|
+
setValue("djbEmployee.retirementDate", "");
|
|
31318
|
+
setValue("djbEmployee.officeNameAndAddress", "");
|
|
31319
|
+
clearErrors("djbEmployee.employeeId");
|
|
31320
|
+
clearErrors("djbEmployee.retirementDate");
|
|
31321
|
+
clearErrors("djbEmployee.officeNameAndAddress");
|
|
31322
|
+
}
|
|
31323
|
+
}, [isDjbEmployee, setValue, clearErrors]);
|
|
31324
|
+
useEffect(() => {
|
|
31325
|
+
if (!isHospitalProperty) {
|
|
31326
|
+
setValue("useDetails.hospitalBeds", "");
|
|
31327
|
+
clearErrors("useDetails.hospitalBeds");
|
|
31328
|
+
}
|
|
31329
|
+
}, [isHospitalProperty, setValue, clearErrors]);
|
|
31330
|
+
useEffect(() => {
|
|
31331
|
+
const isValidSubLocality = selectedSubLocality ? subLocalityOptions.some(option => option.code === selectedSubLocality.code) : true;
|
|
31332
|
+
if (!isValidSubLocality) {
|
|
31333
|
+
setValue("propertyAddress.subLocality", null);
|
|
31334
|
+
}
|
|
31335
|
+
}, [selectedLocality === null || selectedLocality === void 0 ? void 0 : selectedLocality.code, selectedSubLocality === null || selectedSubLocality === void 0 ? void 0 : selectedSubLocality.code, setValue]);
|
|
31336
|
+
const closeToast = () => setShowToast(null);
|
|
31337
|
+
const closeToastOfError = () => setShowToast(null);
|
|
31338
|
+
const toggleSection = sectionKey => {
|
|
31339
|
+
setCollapsedSections(previousState => ({
|
|
31340
|
+
...previousState,
|
|
31341
|
+
[sectionKey]: !previousState[sectionKey]
|
|
31342
|
+
}));
|
|
31343
|
+
};
|
|
31344
|
+
const getFieldError = fieldName => resolveNestedValue(errors, fieldName);
|
|
31345
|
+
const refreshCaptcha = () => {
|
|
31346
|
+
setGeneratedCaptcha(generateCaptcha());
|
|
31347
|
+
setValue("declaration.captcha", "");
|
|
31348
|
+
clearErrors("declaration.captcha");
|
|
31349
|
+
};
|
|
31350
|
+
const uploadFile = async (event, fieldName, onChange) => {
|
|
31351
|
+
var _event$target, _event$target$files;
|
|
31352
|
+
const file = event === null || event === void 0 ? void 0 : (_event$target = event.target) === null || _event$target === void 0 ? void 0 : (_event$target$files = _event$target.files) === null || _event$target$files === void 0 ? void 0 : _event$target$files[0];
|
|
31353
|
+
if (!file) {
|
|
31354
|
+
onChange(null);
|
|
31355
|
+
return;
|
|
31356
|
+
}
|
|
31357
|
+
setUploadingFields(previousState => ({
|
|
31358
|
+
...previousState,
|
|
31359
|
+
[fieldName]: true
|
|
31360
|
+
}));
|
|
31361
|
+
clearErrors(fieldName);
|
|
31362
|
+
try {
|
|
31363
|
+
var _response$data, _response$data$files, _response$data$files$;
|
|
31364
|
+
if (file.size > MAX_FILE_SIZE) {
|
|
31365
|
+
throw new Error("File size should be 5 MB or less.");
|
|
31366
|
+
}
|
|
31367
|
+
if (!SUPPORTED_FILE_TYPES.test(file.name)) {
|
|
31368
|
+
throw new Error("Only PDF, PNG, JPG and JPEG files are supported.");
|
|
31369
|
+
}
|
|
31370
|
+
const response = await Digit.UploadServices.Filestorage("WS", file, stateId);
|
|
31371
|
+
const fileStoreId = response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$files = _response$data.files) === null || _response$data$files === void 0 ? void 0 : (_response$data$files$ = _response$data$files[0]) === null || _response$data$files$ === void 0 ? void 0 : _response$data$files$.fileStoreId;
|
|
31372
|
+
if (!fileStoreId) {
|
|
31373
|
+
throw new Error("File upload failed. Please try again.");
|
|
31374
|
+
}
|
|
31375
|
+
onChange({
|
|
31376
|
+
fileName: file.name,
|
|
31377
|
+
fileSize: file.size,
|
|
31378
|
+
fileStoreId,
|
|
31379
|
+
fileType: file.type
|
|
31380
|
+
});
|
|
31381
|
+
clearErrors(fieldName);
|
|
31382
|
+
} catch (error) {
|
|
31383
|
+
onChange(null);
|
|
31384
|
+
setError(fieldName, {
|
|
31385
|
+
type: "manual",
|
|
31386
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || "File upload failed. Please try again."
|
|
31387
|
+
});
|
|
31388
|
+
setShowToast({
|
|
31389
|
+
key: "error",
|
|
31390
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || "File upload failed. Please try again."
|
|
31046
31391
|
});
|
|
31047
|
-
|
|
31392
|
+
} finally {
|
|
31393
|
+
setUploadingFields(previousState => ({
|
|
31394
|
+
...previousState,
|
|
31395
|
+
[fieldName]: false
|
|
31396
|
+
}));
|
|
31048
31397
|
}
|
|
31049
|
-
if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState !== null && formState !== void 0 && (_formState$errors = formState.errors) !== null && _formState$errors !== void 0 && (_formState$errors$Con = _formState$errors["ConnectionHolderDetails"]) !== null && _formState$errors$Con !== void 0 && _formState$errors$Con.type && ((_Object$keys = Object.keys(formState === null || formState === void 0 ? void 0 : (_formState$errors2 = formState.errors) === null || _formState$errors2 === void 0 ? void 0 : (_formState$errors2$Co = _formState$errors2["ConnectionHolderDetails"]) === null || _formState$errors2$Co === void 0 ? void 0 : _formState$errors2$Co.type)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) == 1 && formState.errors["ConnectionHolderDetails"] && Object.values(formState.errors["ConnectionHolderDetails"].type).filter(ob => {
|
|
31050
|
-
var _ob$ref;
|
|
31051
|
-
return ob.type === "required" && (ob === null || ob === void 0 ? void 0 : (_ob$ref = ob.ref) === null || _ob$ref === void 0 ? void 0 : _ob$ref.value) !== "";
|
|
31052
|
-
}).length > 0) setSubmitValve(true);else setSubmitValve(!Object.keys(formState.errors).length);
|
|
31053
31398
|
};
|
|
31054
|
-
const
|
|
31055
|
-
|
|
31399
|
+
const clearUploadedFile = (fieldName, onChange) => {
|
|
31400
|
+
onChange(null);
|
|
31401
|
+
clearErrors(fieldName);
|
|
31056
31402
|
};
|
|
31057
|
-
const
|
|
31058
|
-
|
|
31059
|
-
|
|
31060
|
-
|
|
31061
|
-
|
|
31062
|
-
|
|
31063
|
-
key: "error",
|
|
31064
|
-
message: "ERR_INVALID_PROPERTY_ID"
|
|
31065
|
-
});
|
|
31066
|
-
return;
|
|
31067
|
-
}
|
|
31403
|
+
const scrollToTop = () => {
|
|
31404
|
+
if (typeof window !== "undefined") {
|
|
31405
|
+
window.scrollTo({
|
|
31406
|
+
top: 0,
|
|
31407
|
+
behavior: "smooth"
|
|
31408
|
+
});
|
|
31068
31409
|
}
|
|
31069
|
-
|
|
31070
|
-
|
|
31071
|
-
|
|
31072
|
-
|
|
31073
|
-
|
|
31074
|
-
|
|
31410
|
+
};
|
|
31411
|
+
const validateCaptcha = data => {
|
|
31412
|
+
var _data$declaration, _data$declaration$cap, _data$declaration$cap2;
|
|
31413
|
+
if ((data === null || data === void 0 ? void 0 : (_data$declaration = data.declaration) === null || _data$declaration === void 0 ? void 0 : (_data$declaration$cap = _data$declaration.captcha) === null || _data$declaration$cap === void 0 ? void 0 : (_data$declaration$cap2 = _data$declaration$cap.trim()) === null || _data$declaration$cap2 === void 0 ? void 0 : _data$declaration$cap2.toUpperCase()) !== generatedCaptcha) {
|
|
31414
|
+
setError("declaration.captcha", {
|
|
31415
|
+
type: "manual",
|
|
31416
|
+
message: "Captcha does not match."
|
|
31417
|
+
});
|
|
31075
31418
|
setShowToast({
|
|
31076
31419
|
warning: true,
|
|
31077
|
-
message: "
|
|
31420
|
+
message: "Captcha does not match."
|
|
31421
|
+
});
|
|
31422
|
+
return false;
|
|
31423
|
+
}
|
|
31424
|
+
clearErrors("declaration.captcha");
|
|
31425
|
+
return true;
|
|
31426
|
+
};
|
|
31427
|
+
const onPreview = data => {
|
|
31428
|
+
if (hasPendingUpload) {
|
|
31429
|
+
setShowToast({
|
|
31430
|
+
warning: true,
|
|
31431
|
+
message: "Please wait for all file uploads to complete."
|
|
31078
31432
|
});
|
|
31079
31433
|
return;
|
|
31080
|
-
}
|
|
31081
|
-
|
|
31082
|
-
|
|
31083
|
-
|
|
31084
|
-
|
|
31085
|
-
|
|
31086
|
-
|
|
31087
|
-
|
|
31088
|
-
|
|
31089
|
-
|
|
31434
|
+
}
|
|
31435
|
+
if (!validateCaptcha(data)) return;
|
|
31436
|
+
setPreviewMode(true);
|
|
31437
|
+
scrollToTop();
|
|
31438
|
+
};
|
|
31439
|
+
const onSubmit = async data => {
|
|
31440
|
+
var _propertyDetails$Prop;
|
|
31441
|
+
if (hasPendingUpload) {
|
|
31442
|
+
setShowToast({
|
|
31443
|
+
warning: true,
|
|
31444
|
+
message: "Please wait for all file uploads to complete."
|
|
31445
|
+
});
|
|
31446
|
+
return;
|
|
31447
|
+
}
|
|
31448
|
+
if (!validateCaptcha(data)) return;
|
|
31449
|
+
if (!(propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop = propertyDetails.Properties) !== null && _propertyDetails$Prop !== void 0 && _propertyDetails$Prop[0])) {
|
|
31450
|
+
setShowToast({
|
|
31451
|
+
key: "error",
|
|
31452
|
+
message: "ERR_INVALID_PROPERTY_ID"
|
|
31453
|
+
});
|
|
31454
|
+
return;
|
|
31455
|
+
}
|
|
31456
|
+
try {
|
|
31457
|
+
var _propertyDetails$Prop2;
|
|
31458
|
+
const formDataWithProperty = {
|
|
31459
|
+
...data,
|
|
31460
|
+
cpt: {
|
|
31461
|
+
details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop2 = propertyDetails.Properties) === null || _propertyDetails$Prop2 === void 0 ? void 0 : _propertyDetails$Prop2[0]
|
|
31462
|
+
}
|
|
31463
|
+
};
|
|
31464
|
+
const payload = await createPayloadOfWS(formDataWithProperty);
|
|
31090
31465
|
let waterAndSewerageLoader = false;
|
|
31091
31466
|
if (payload !== null && payload !== void 0 && payload.water && payload !== null && payload !== void 0 && payload.sewerage) waterAndSewerageLoader = true;
|
|
31467
|
+
if (waterAndSewerageLoader) {
|
|
31468
|
+
setWaterAndSewerageBoth(true);
|
|
31469
|
+
sessionStorage.setItem("setWaterAndSewerageBoth", JSON.stringify(true));
|
|
31470
|
+
} else {
|
|
31471
|
+
sessionStorage.setItem("setWaterAndSewerageBoth", JSON.stringify(false));
|
|
31472
|
+
}
|
|
31092
31473
|
let waterConnection = {
|
|
31093
31474
|
WaterConnection: payload,
|
|
31094
31475
|
disconnectRequest: false,
|
|
@@ -31099,26 +31480,20 @@ const NewApplication = () => {
|
|
|
31099
31480
|
disconnectRequest: false,
|
|
31100
31481
|
reconnectRequest: false
|
|
31101
31482
|
};
|
|
31102
|
-
if (waterAndSewerageLoader) {
|
|
31103
|
-
setWaterAndSewerageBoth(true);
|
|
31104
|
-
sessionStorage.setItem("setWaterAndSewerageBoth", JSON.stringify(true));
|
|
31105
|
-
} else {
|
|
31106
|
-
sessionStorage.setItem("setWaterAndSewerageBoth", JSON.stringify(false));
|
|
31107
|
-
}
|
|
31108
31483
|
if (payload !== null && payload !== void 0 && payload.water && payload !== null && payload !== void 0 && payload.sewerage) {
|
|
31109
31484
|
if (waterMutation && sewerageMutation) {
|
|
31110
31485
|
setIsEnableLoader(true);
|
|
31111
31486
|
await waterMutation(waterConnection, {
|
|
31112
|
-
onError:
|
|
31113
|
-
var _error$response, _error$response$data, _error$response$data
|
|
31487
|
+
onError: error => {
|
|
31488
|
+
var _error$response, _error$response$data, _error$response$data$;
|
|
31114
31489
|
setIsEnableLoader(false);
|
|
31115
31490
|
setShowToast({
|
|
31116
31491
|
key: "error",
|
|
31117
|
-
message:
|
|
31492
|
+
message: (error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : _error$response$data$[0].message) || error
|
|
31118
31493
|
});
|
|
31119
31494
|
setTimeout(closeToastOfError, 5000);
|
|
31120
31495
|
},
|
|
31121
|
-
onSuccess: async
|
|
31496
|
+
onSuccess: async waterData => {
|
|
31122
31497
|
var _waterData$WaterConne;
|
|
31123
31498
|
let response = await updatePayloadOfWS(waterData === null || waterData === void 0 ? void 0 : (_waterData$WaterConne = waterData.WaterConnection) === null || _waterData$WaterConne === void 0 ? void 0 : _waterData$WaterConne[0], "WATER");
|
|
31124
31499
|
let waterConnectionUpdate = {
|
|
@@ -31127,32 +31502,34 @@ const NewApplication = () => {
|
|
|
31127
31502
|
reconnectRequest: false
|
|
31128
31503
|
};
|
|
31129
31504
|
waterUpdateMutation(waterConnectionUpdate, {
|
|
31130
|
-
onError:
|
|
31131
|
-
var _error$
|
|
31505
|
+
onError: error => {
|
|
31506
|
+
var _error$response2, _error$response2$data, _error$response2$data2;
|
|
31132
31507
|
setIsEnableLoader(false);
|
|
31133
31508
|
setShowToast({
|
|
31134
31509
|
key: "error",
|
|
31135
|
-
message:
|
|
31510
|
+
message: (error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : (_error$response2$data2 = _error$response2$data.Errors) === null || _error$response2$data2 === void 0 ? void 0 : _error$response2$data2[0].message) || error
|
|
31136
31511
|
});
|
|
31137
31512
|
setTimeout(closeToastOfError, 5000);
|
|
31138
31513
|
},
|
|
31139
|
-
onSuccess: async
|
|
31140
|
-
|
|
31141
|
-
|
|
31142
|
-
|
|
31143
|
-
|
|
31514
|
+
onSuccess: async waterUpdateData => {
|
|
31515
|
+
setAppDetails(prev => {
|
|
31516
|
+
var _waterUpdateData$Wate;
|
|
31517
|
+
return {
|
|
31518
|
+
...prev,
|
|
31519
|
+
waterConnection: waterUpdateData === null || waterUpdateData === void 0 ? void 0 : (_waterUpdateData$Wate = waterUpdateData.WaterConnection) === null || _waterUpdateData$Wate === void 0 ? void 0 : _waterUpdateData$Wate[0]
|
|
31520
|
+
};
|
|
31144
31521
|
});
|
|
31145
31522
|
await sewerageMutation(sewerageConnection, {
|
|
31146
|
-
onError:
|
|
31147
|
-
var _error$
|
|
31523
|
+
onError: error => {
|
|
31524
|
+
var _error$response3, _error$response3$data, _error$response3$data2;
|
|
31148
31525
|
setIsEnableLoader(false);
|
|
31149
31526
|
setShowToast({
|
|
31150
31527
|
key: "error",
|
|
31151
|
-
message:
|
|
31528
|
+
message: (error === null || error === void 0 ? void 0 : (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : (_error$response3$data = _error$response3.data) === null || _error$response3$data === void 0 ? void 0 : (_error$response3$data2 = _error$response3$data.Errors) === null || _error$response3$data2 === void 0 ? void 0 : _error$response3$data2[0].message) || error
|
|
31152
31529
|
});
|
|
31153
31530
|
setTimeout(closeToastOfError, 5000);
|
|
31154
31531
|
},
|
|
31155
|
-
onSuccess: async
|
|
31532
|
+
onSuccess: async sewerageData => {
|
|
31156
31533
|
var _sewerageData$Sewerag;
|
|
31157
31534
|
let response = await updatePayloadOfWS(sewerageData === null || sewerageData === void 0 ? void 0 : (_sewerageData$Sewerag = sewerageData.SewerageConnections) === null || _sewerageData$Sewerag === void 0 ? void 0 : _sewerageData$Sewerag[0], "SEWERAGE");
|
|
31158
31535
|
let sewerageConnectionUpdate = {
|
|
@@ -31161,22 +31538,25 @@ const NewApplication = () => {
|
|
|
31161
31538
|
reconnectRequest: false
|
|
31162
31539
|
};
|
|
31163
31540
|
await sewerageUpdateMutation(sewerageConnectionUpdate, {
|
|
31164
|
-
onError:
|
|
31165
|
-
var _error$
|
|
31541
|
+
onError: error => {
|
|
31542
|
+
var _error$response4, _error$response4$data, _error$response4$data2;
|
|
31166
31543
|
setIsEnableLoader(false);
|
|
31167
31544
|
setShowToast({
|
|
31168
31545
|
key: "error",
|
|
31169
|
-
message:
|
|
31546
|
+
message: (error === null || error === void 0 ? void 0 : (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : (_error$response4$data = _error$response4.data) === null || _error$response4$data === void 0 ? void 0 : (_error$response4$data2 = _error$response4$data.Errors) === null || _error$response4$data2 === void 0 ? void 0 : _error$response4$data2[0].message) || error
|
|
31170
31547
|
});
|
|
31171
31548
|
setTimeout(closeToastOfError, 5000);
|
|
31172
31549
|
},
|
|
31173
|
-
onSuccess: async
|
|
31174
|
-
var
|
|
31175
|
-
setAppDetails({
|
|
31176
|
-
|
|
31177
|
-
|
|
31550
|
+
onSuccess: async sewerageUpdateData => {
|
|
31551
|
+
var _waterUpdateData$Wate2, _waterUpdateData$Wate3, _sewerageUpdateData$S2, _sewerageUpdateData$S3;
|
|
31552
|
+
setAppDetails(prev => {
|
|
31553
|
+
var _sewerageUpdateData$S;
|
|
31554
|
+
return {
|
|
31555
|
+
...prev,
|
|
31556
|
+
sewerageConnection: sewerageUpdateData === null || sewerageUpdateData === void 0 ? void 0 : (_sewerageUpdateData$S = sewerageUpdateData.SewerageConnections) === null || _sewerageUpdateData$S === void 0 ? void 0 : _sewerageUpdateData$S[0]
|
|
31557
|
+
};
|
|
31178
31558
|
});
|
|
31179
|
-
|
|
31559
|
+
window.sessionStorage.removeItem(FORM_STORAGE_KEY);
|
|
31180
31560
|
history.push(`/digit-ui/employee/ws/ws-response?applicationNumber=${waterUpdateData === null || waterUpdateData === void 0 ? void 0 : (_waterUpdateData$Wate2 = waterUpdateData.WaterConnection) === null || _waterUpdateData$Wate2 === void 0 ? void 0 : (_waterUpdateData$Wate3 = _waterUpdateData$Wate2[0]) === null || _waterUpdateData$Wate3 === void 0 ? void 0 : _waterUpdateData$Wate3.applicationNo}&applicationNumber1=${sewerageUpdateData === null || sewerageUpdateData === void 0 ? void 0 : (_sewerageUpdateData$S2 = sewerageUpdateData.SewerageConnections) === null || _sewerageUpdateData$S2 === void 0 ? void 0 : (_sewerageUpdateData$S3 = _sewerageUpdateData$S2[0]) === null || _sewerageUpdateData$S3 === void 0 ? void 0 : _sewerageUpdateData$S3.applicationNo}`);
|
|
31181
31561
|
}
|
|
31182
31562
|
});
|
|
@@ -31191,38 +31571,41 @@ const NewApplication = () => {
|
|
|
31191
31571
|
if (waterMutation) {
|
|
31192
31572
|
setIsEnableLoader(true);
|
|
31193
31573
|
await waterMutation(waterConnection, {
|
|
31194
|
-
onError:
|
|
31195
|
-
var _error$
|
|
31574
|
+
onError: error => {
|
|
31575
|
+
var _error$response5, _error$response5$data, _error$response5$data2;
|
|
31196
31576
|
setIsEnableLoader(false);
|
|
31197
31577
|
setShowToast({
|
|
31198
31578
|
key: "error",
|
|
31199
|
-
message:
|
|
31579
|
+
message: (error === null || error === void 0 ? void 0 : (_error$response5 = error.response) === null || _error$response5 === void 0 ? void 0 : (_error$response5$data = _error$response5.data) === null || _error$response5$data === void 0 ? void 0 : (_error$response5$data2 = _error$response5$data.Errors) === null || _error$response5$data2 === void 0 ? void 0 : _error$response5$data2[0].message) || error
|
|
31200
31580
|
});
|
|
31201
31581
|
setTimeout(closeToastOfError, 5000);
|
|
31202
31582
|
},
|
|
31203
|
-
onSuccess: async
|
|
31583
|
+
onSuccess: async data => {
|
|
31204
31584
|
var _data$WaterConnection;
|
|
31205
31585
|
let response = await updatePayloadOfWS(data === null || data === void 0 ? void 0 : (_data$WaterConnection = data.WaterConnection) === null || _data$WaterConnection === void 0 ? void 0 : _data$WaterConnection[0], "WATER");
|
|
31206
31586
|
let waterConnectionUpdate = {
|
|
31207
31587
|
WaterConnection: response
|
|
31208
31588
|
};
|
|
31209
31589
|
waterUpdateMutation(waterConnectionUpdate, {
|
|
31210
|
-
onError:
|
|
31211
|
-
var _error$
|
|
31590
|
+
onError: error => {
|
|
31591
|
+
var _error$response6, _error$response6$data, _error$response6$data2;
|
|
31212
31592
|
setIsEnableLoader(false);
|
|
31213
31593
|
setShowToast({
|
|
31214
31594
|
key: "error",
|
|
31215
|
-
message:
|
|
31595
|
+
message: (error === null || error === void 0 ? void 0 : (_error$response6 = error.response) === null || _error$response6 === void 0 ? void 0 : (_error$response6$data = _error$response6.data) === null || _error$response6$data === void 0 ? void 0 : (_error$response6$data2 = _error$response6$data.Errors) === null || _error$response6$data2 === void 0 ? void 0 : _error$response6$data2[0].message) || error
|
|
31216
31596
|
});
|
|
31217
31597
|
setTimeout(closeToastOfError, 5000);
|
|
31218
31598
|
},
|
|
31219
|
-
onSuccess:
|
|
31220
|
-
var _data$
|
|
31221
|
-
setAppDetails({
|
|
31222
|
-
|
|
31223
|
-
|
|
31599
|
+
onSuccess: data => {
|
|
31600
|
+
var _data$WaterConnection3, _data$WaterConnection4;
|
|
31601
|
+
setAppDetails(prev => {
|
|
31602
|
+
var _data$WaterConnection2;
|
|
31603
|
+
return {
|
|
31604
|
+
...prev,
|
|
31605
|
+
waterConnection: data === null || data === void 0 ? void 0 : (_data$WaterConnection2 = data.WaterConnection) === null || _data$WaterConnection2 === void 0 ? void 0 : _data$WaterConnection2[0]
|
|
31606
|
+
};
|
|
31224
31607
|
});
|
|
31225
|
-
|
|
31608
|
+
window.sessionStorage.removeItem(FORM_STORAGE_KEY);
|
|
31226
31609
|
history.push(`/digit-ui/employee/ws/ws-response?applicationNumber=${data === null || data === void 0 ? void 0 : (_data$WaterConnection3 = data.WaterConnection) === null || _data$WaterConnection3 === void 0 ? void 0 : (_data$WaterConnection4 = _data$WaterConnection3[0]) === null || _data$WaterConnection4 === void 0 ? void 0 : _data$WaterConnection4.applicationNo}`);
|
|
31227
31610
|
}
|
|
31228
31611
|
});
|
|
@@ -31233,38 +31616,41 @@ const NewApplication = () => {
|
|
|
31233
31616
|
if (sewerageMutation) {
|
|
31234
31617
|
setIsEnableLoader(true);
|
|
31235
31618
|
await sewerageMutation(sewerageConnection, {
|
|
31236
|
-
onError:
|
|
31237
|
-
var _error$
|
|
31619
|
+
onError: error => {
|
|
31620
|
+
var _error$response7, _error$response7$data, _error$response7$data2;
|
|
31238
31621
|
setIsEnableLoader(false);
|
|
31239
31622
|
setShowToast({
|
|
31240
31623
|
key: "error",
|
|
31241
|
-
message:
|
|
31624
|
+
message: (error === null || error === void 0 ? void 0 : (_error$response7 = error.response) === null || _error$response7 === void 0 ? void 0 : (_error$response7$data = _error$response7.data) === null || _error$response7$data === void 0 ? void 0 : (_error$response7$data2 = _error$response7$data.Errors) === null || _error$response7$data2 === void 0 ? void 0 : _error$response7$data2[0].message) || error
|
|
31242
31625
|
});
|
|
31243
31626
|
setTimeout(closeToastOfError, 5000);
|
|
31244
31627
|
},
|
|
31245
|
-
onSuccess: async
|
|
31628
|
+
onSuccess: async data => {
|
|
31246
31629
|
var _data$SewerageConnect;
|
|
31247
31630
|
let response = await updatePayloadOfWS(data === null || data === void 0 ? void 0 : (_data$SewerageConnect = data.SewerageConnections) === null || _data$SewerageConnect === void 0 ? void 0 : _data$SewerageConnect[0], "SEWERAGE");
|
|
31248
31631
|
let sewerageConnectionUpdate = {
|
|
31249
31632
|
SewerageConnection: response
|
|
31250
31633
|
};
|
|
31251
31634
|
await sewerageUpdateMutation(sewerageConnectionUpdate, {
|
|
31252
|
-
onError:
|
|
31253
|
-
var _error$
|
|
31635
|
+
onError: error => {
|
|
31636
|
+
var _error$response8, _error$response8$data, _error$response8$data2;
|
|
31254
31637
|
setIsEnableLoader(false);
|
|
31255
31638
|
setShowToast({
|
|
31256
31639
|
key: "error",
|
|
31257
|
-
message:
|
|
31640
|
+
message: (error === null || error === void 0 ? void 0 : (_error$response8 = error.response) === null || _error$response8 === void 0 ? void 0 : (_error$response8$data = _error$response8.data) === null || _error$response8$data === void 0 ? void 0 : (_error$response8$data2 = _error$response8$data.Errors) === null || _error$response8$data2 === void 0 ? void 0 : _error$response8$data2[0].message) || error
|
|
31258
31641
|
});
|
|
31259
31642
|
setTimeout(closeToastOfError, 5000);
|
|
31260
31643
|
},
|
|
31261
|
-
onSuccess:
|
|
31262
|
-
var _data$
|
|
31263
|
-
setAppDetails({
|
|
31264
|
-
|
|
31265
|
-
|
|
31644
|
+
onSuccess: data => {
|
|
31645
|
+
var _data$SewerageConnect3, _data$SewerageConnect4;
|
|
31646
|
+
setAppDetails(prev => {
|
|
31647
|
+
var _data$SewerageConnect2;
|
|
31648
|
+
return {
|
|
31649
|
+
...prev,
|
|
31650
|
+
sewerageConnection: data === null || data === void 0 ? void 0 : (_data$SewerageConnect2 = data.SewerageConnections) === null || _data$SewerageConnect2 === void 0 ? void 0 : _data$SewerageConnect2[0]
|
|
31651
|
+
};
|
|
31266
31652
|
});
|
|
31267
|
-
|
|
31653
|
+
window.sessionStorage.removeItem(FORM_STORAGE_KEY);
|
|
31268
31654
|
history.push(`/digit-ui/employee/ws/ws-response?applicationNumber1=${data === null || data === void 0 ? void 0 : (_data$SewerageConnect3 = data.SewerageConnections) === null || _data$SewerageConnect3 === void 0 ? void 0 : (_data$SewerageConnect4 = _data$SewerageConnect3[0]) === null || _data$SewerageConnect4 === void 0 ? void 0 : _data$SewerageConnect4.applicationNo}`);
|
|
31269
31655
|
}
|
|
31270
31656
|
});
|
|
@@ -31272,32 +31658,1115 @@ const NewApplication = () => {
|
|
|
31272
31658
|
});
|
|
31273
31659
|
}
|
|
31274
31660
|
}
|
|
31661
|
+
} catch (error) {
|
|
31662
|
+
setIsEnableLoader(false);
|
|
31663
|
+
setShowToast({
|
|
31664
|
+
key: "error",
|
|
31665
|
+
message: "Failed to generate payload or submit application."
|
|
31666
|
+
});
|
|
31275
31667
|
}
|
|
31276
31668
|
};
|
|
31277
|
-
const
|
|
31669
|
+
const onEdit = () => {
|
|
31670
|
+
setPreviewMode(false);
|
|
31671
|
+
scrollToTop();
|
|
31672
|
+
};
|
|
31673
|
+
const onReset = () => {
|
|
31674
|
+
reset(DEFAULT_FORM_VALUES);
|
|
31675
|
+
setPreviewMode(false);
|
|
31676
|
+
setGeneratedCaptcha(generateCaptcha());
|
|
31677
|
+
setCollapsedSections(DEFAULT_SECTION_STATE);
|
|
31678
|
+
setUploadingFields({});
|
|
31278
31679
|
setShowToast(null);
|
|
31680
|
+
if (typeof window !== "undefined") {
|
|
31681
|
+
window.sessionStorage.removeItem(FORM_STORAGE_KEY);
|
|
31682
|
+
}
|
|
31683
|
+
scrollToTop();
|
|
31279
31684
|
};
|
|
31280
|
-
if (isEnableLoader ||
|
|
31685
|
+
if (isEnableLoader || isPropertyLoading) {
|
|
31281
31686
|
return /*#__PURE__*/React.createElement(Loader, null);
|
|
31282
31687
|
}
|
|
31283
|
-
|
|
31284
|
-
|
|
31285
|
-
|
|
31286
|
-
|
|
31287
|
-
|
|
31288
|
-
|
|
31289
|
-
|
|
31290
|
-
|
|
31291
|
-
|
|
31292
|
-
|
|
31293
|
-
|
|
31294
|
-
|
|
31295
|
-
|
|
31296
|
-
|
|
31297
|
-
|
|
31688
|
+
const menu = [{
|
|
31689
|
+
i18nKey: "ASHOK VIHAR",
|
|
31690
|
+
code: "ASHOK VIHAR",
|
|
31691
|
+
value: "ASHOK VIHAR"
|
|
31692
|
+
}, {
|
|
31693
|
+
i18nKey: "BURARI",
|
|
31694
|
+
code: "BURARI",
|
|
31695
|
+
value: "BURARI"
|
|
31696
|
+
}, {
|
|
31697
|
+
i18nKey: "DWARKA",
|
|
31698
|
+
code: "DWARKA",
|
|
31699
|
+
value: "DWARKA"
|
|
31700
|
+
}, {
|
|
31701
|
+
i18nKey: "OKHLA",
|
|
31702
|
+
code: "OKHLA",
|
|
31703
|
+
value: "OKHLA"
|
|
31704
|
+
}];
|
|
31705
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("style", null, `
|
|
31706
|
+
.ws-new-application-collapsible .collapsible-card-tabs {
|
|
31707
|
+
display: none;
|
|
31708
|
+
}
|
|
31709
|
+
|
|
31710
|
+
.ws-new-application-collapsible .collapsible-card-tab-content {
|
|
31711
|
+
padding: 0;
|
|
31712
|
+
}
|
|
31713
|
+
`), /*#__PURE__*/React.createElement(Header, null, t("New Water / Sewerage Application")), /*#__PURE__*/React.createElement("div", {
|
|
31714
|
+
style: {
|
|
31715
|
+
display: "flex",
|
|
31716
|
+
alignItems: "flex-start",
|
|
31717
|
+
gap: "24px"
|
|
31718
|
+
}
|
|
31719
|
+
}, /*#__PURE__*/React.createElement(VerticalTimeline, {
|
|
31720
|
+
config: [{
|
|
31721
|
+
route: "application-selection",
|
|
31722
|
+
timeLine: [{
|
|
31723
|
+
actions: "Application Selection",
|
|
31724
|
+
currentStep: 1
|
|
31725
|
+
}]
|
|
31726
|
+
}, {
|
|
31727
|
+
route: "applicant-details",
|
|
31728
|
+
timeLine: [{
|
|
31729
|
+
actions: "Details of Applicant",
|
|
31730
|
+
currentStep: 2
|
|
31731
|
+
}]
|
|
31732
|
+
}, {
|
|
31733
|
+
route: "contact-details",
|
|
31734
|
+
timeLine: [{
|
|
31735
|
+
actions: "Contact Details",
|
|
31736
|
+
currentStep: 3
|
|
31737
|
+
}]
|
|
31738
|
+
}, {
|
|
31739
|
+
route: "djb-employee",
|
|
31740
|
+
timeLine: [{
|
|
31741
|
+
actions: "For DJB Employee",
|
|
31742
|
+
currentStep: 4
|
|
31743
|
+
}]
|
|
31744
|
+
}, {
|
|
31745
|
+
route: "property-address",
|
|
31746
|
+
timeLine: [{
|
|
31747
|
+
actions: "Property Address",
|
|
31748
|
+
currentStep: 5
|
|
31749
|
+
}]
|
|
31750
|
+
}, {
|
|
31751
|
+
route: "use-details",
|
|
31752
|
+
timeLine: [{
|
|
31753
|
+
actions: "Property & Connection Use Details",
|
|
31754
|
+
currentStep: 6
|
|
31755
|
+
}]
|
|
31756
|
+
}, {
|
|
31757
|
+
route: "bank-details",
|
|
31758
|
+
timeLine: [{
|
|
31759
|
+
actions: "Bank Details",
|
|
31760
|
+
currentStep: 7
|
|
31761
|
+
}]
|
|
31762
|
+
}, {
|
|
31763
|
+
route: "rain-water-harvesting",
|
|
31764
|
+
timeLine: [{
|
|
31765
|
+
actions: "Rain Water Harvesting",
|
|
31766
|
+
currentStep: 8
|
|
31767
|
+
}]
|
|
31768
|
+
}, {
|
|
31769
|
+
route: "documents",
|
|
31770
|
+
timeLine: [{
|
|
31771
|
+
actions: "Documents to be Attached",
|
|
31772
|
+
currentStep: 9
|
|
31773
|
+
}]
|
|
31774
|
+
}, {
|
|
31775
|
+
route: "declaration",
|
|
31776
|
+
timeLine: [{
|
|
31777
|
+
actions: "Declaration / Undertaking",
|
|
31778
|
+
currentStep: 10
|
|
31779
|
+
}]
|
|
31780
|
+
}],
|
|
31781
|
+
currentActiveIndex: currentStep - 1,
|
|
31782
|
+
showFinalStep: false
|
|
31783
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
31784
|
+
style: {
|
|
31785
|
+
flex: "1",
|
|
31786
|
+
overflowY: "auto",
|
|
31787
|
+
minWidth: 0
|
|
31788
|
+
}
|
|
31789
|
+
}, /*#__PURE__*/React.createElement(SectionCard, {
|
|
31790
|
+
isOpen: collapsedSections.application,
|
|
31791
|
+
onToggle: toggleSection,
|
|
31792
|
+
sectionKey: "application",
|
|
31793
|
+
title: "Application Selection"
|
|
31794
|
+
}, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
31795
|
+
className: "card-label-smaller"
|
|
31796
|
+
}, "ZRO Location"), /*#__PURE__*/React.createElement("div", {
|
|
31797
|
+
className: "field"
|
|
31798
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
31799
|
+
control: control,
|
|
31800
|
+
name: "zro",
|
|
31801
|
+
defaultValue: zro,
|
|
31802
|
+
rules: {
|
|
31803
|
+
required: t("REQUIRED_FIELD")
|
|
31804
|
+
},
|
|
31805
|
+
isMandatory: true,
|
|
31806
|
+
render: props => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Dropdown, {
|
|
31807
|
+
className: "form-field",
|
|
31808
|
+
selected: getValues("gender"),
|
|
31809
|
+
disable: false,
|
|
31810
|
+
option: menu,
|
|
31811
|
+
errorStyle: !!getFieldError("zro"),
|
|
31812
|
+
select: e => {
|
|
31813
|
+
setZro(prev => ({
|
|
31814
|
+
...prev,
|
|
31815
|
+
value: e
|
|
31816
|
+
}));
|
|
31817
|
+
},
|
|
31818
|
+
optionKey: "i18nKey",
|
|
31819
|
+
onBlur: props.onBlur,
|
|
31820
|
+
t: t
|
|
31821
|
+
}))
|
|
31822
|
+
}))), localFormState && zro.error && /*#__PURE__*/React.createElement(CardLabelError, null, zro.error), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
31823
|
+
className: "card-label-smaller"
|
|
31824
|
+
}, "Type of Request"), /*#__PURE__*/React.createElement("div", {
|
|
31825
|
+
className: "field"
|
|
31826
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
31827
|
+
control: control,
|
|
31828
|
+
name: "zro",
|
|
31829
|
+
defaultValue: zro,
|
|
31830
|
+
rules: {
|
|
31831
|
+
required: t("REQUIRED_FIELD")
|
|
31832
|
+
},
|
|
31833
|
+
isMandatory: true,
|
|
31834
|
+
render: props => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Dropdown, {
|
|
31835
|
+
className: "form-field",
|
|
31836
|
+
selected: getValues("gender"),
|
|
31837
|
+
disable: false,
|
|
31838
|
+
option: TYPE_OF_REQUEST_OPTIONS,
|
|
31839
|
+
errorStyle: !!getFieldError("zro"),
|
|
31840
|
+
select: e => {
|
|
31841
|
+
setZro(prev => ({
|
|
31842
|
+
...prev,
|
|
31843
|
+
value: e
|
|
31844
|
+
}));
|
|
31845
|
+
},
|
|
31846
|
+
optionKey: "name",
|
|
31847
|
+
onBlur: props.onBlur,
|
|
31848
|
+
t: t
|
|
31849
|
+
}))
|
|
31850
|
+
}))), localFormState && zro.error && /*#__PURE__*/React.createElement(CardLabelError, null, zro.error), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
31851
|
+
className: "card-label-smaller"
|
|
31852
|
+
}, "Connection Type"), /*#__PURE__*/React.createElement("div", {
|
|
31853
|
+
className: "field"
|
|
31854
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
31855
|
+
control: control,
|
|
31856
|
+
name: "zro",
|
|
31857
|
+
defaultValue: zro,
|
|
31858
|
+
rules: {
|
|
31859
|
+
required: t("REQUIRED_FIELD")
|
|
31860
|
+
},
|
|
31861
|
+
isMandatory: true,
|
|
31862
|
+
render: props => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Dropdown, {
|
|
31863
|
+
className: "form-field",
|
|
31864
|
+
selected: getValues("gender"),
|
|
31865
|
+
disable: false,
|
|
31866
|
+
option: CONNECTION_TYPE_OPTIONS,
|
|
31867
|
+
errorStyle: !!getFieldError("zro"),
|
|
31868
|
+
select: e => {
|
|
31869
|
+
setZro(prev => ({
|
|
31870
|
+
...prev,
|
|
31871
|
+
value: e
|
|
31872
|
+
}));
|
|
31873
|
+
},
|
|
31874
|
+
optionKey: "name",
|
|
31875
|
+
onBlur: props.onBlur,
|
|
31876
|
+
t: t
|
|
31877
|
+
}))
|
|
31878
|
+
}))), localFormState && zro.error && /*#__PURE__*/React.createElement(CardLabelError, null, zro.error)), /*#__PURE__*/React.createElement("div", {
|
|
31879
|
+
style: {
|
|
31880
|
+
display: previewMode ? "none" : "block"
|
|
31881
|
+
}
|
|
31882
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SectionCard, {
|
|
31883
|
+
description: "Applicant name, organization details, and supporting ID proof.",
|
|
31884
|
+
isOpen: collapsedSections.applicant,
|
|
31885
|
+
onToggle: toggleSection,
|
|
31886
|
+
sectionKey: "applicant",
|
|
31887
|
+
title: "Details of Applicant"
|
|
31888
|
+
}, /*#__PURE__*/React.createElement(FieldBlock, {
|
|
31889
|
+
error: getFieldError("applicant.firstName"),
|
|
31890
|
+
label: "First Name",
|
|
31891
|
+
required: true
|
|
31892
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
31893
|
+
errorStyle: !!getFieldError("applicant.firstName"),
|
|
31894
|
+
inputRef: register({
|
|
31895
|
+
pattern: {
|
|
31896
|
+
value: NAME_PATTERN,
|
|
31897
|
+
message: "Use letters only."
|
|
31898
|
+
},
|
|
31899
|
+
required: "First Name is required."
|
|
31900
|
+
}),
|
|
31901
|
+
name: "applicant.firstName"
|
|
31902
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
31903
|
+
error: getFieldError("applicant.middleName"),
|
|
31904
|
+
label: "Middle Name"
|
|
31905
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
31906
|
+
errorStyle: !!getFieldError("applicant.middleName"),
|
|
31907
|
+
inputRef: register({
|
|
31908
|
+
pattern: {
|
|
31909
|
+
value: NAME_PATTERN,
|
|
31910
|
+
message: "Use letters only."
|
|
31911
|
+
}
|
|
31912
|
+
}),
|
|
31913
|
+
name: "applicant.middleName"
|
|
31914
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
31915
|
+
error: getFieldError("applicant.lastName"),
|
|
31916
|
+
label: "Last Name",
|
|
31917
|
+
required: true
|
|
31918
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
31919
|
+
errorStyle: !!getFieldError("applicant.lastName"),
|
|
31920
|
+
inputRef: register({
|
|
31921
|
+
pattern: {
|
|
31922
|
+
value: NAME_PATTERN,
|
|
31923
|
+
message: "Use letters only."
|
|
31924
|
+
},
|
|
31925
|
+
required: "Last Name is required."
|
|
31926
|
+
}),
|
|
31927
|
+
name: "applicant.lastName"
|
|
31928
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
31929
|
+
error: getFieldError("applicant.fatherOrHusbandName"),
|
|
31930
|
+
label: "Father / Husband Name",
|
|
31931
|
+
required: true
|
|
31932
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
31933
|
+
errorStyle: !!getFieldError("applicant.fatherOrHusbandName"),
|
|
31934
|
+
inputRef: register({
|
|
31935
|
+
pattern: {
|
|
31936
|
+
value: NAME_PATTERN,
|
|
31937
|
+
message: "Use letters only."
|
|
31938
|
+
},
|
|
31939
|
+
required: "Father / Husband Name is required."
|
|
31940
|
+
}),
|
|
31941
|
+
name: "applicant.fatherOrHusbandName"
|
|
31942
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
31943
|
+
label: "Government Organization"
|
|
31944
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
31945
|
+
control: control,
|
|
31946
|
+
name: "applicant.isGovernmentOrganization",
|
|
31947
|
+
render: props => /*#__PURE__*/React.createElement(CheckBox, {
|
|
31948
|
+
checked: !!props.value,
|
|
31949
|
+
label: "Applicant belongs to a Government Organization",
|
|
31950
|
+
onChange: event => props.onChange(event.target.checked)
|
|
31951
|
+
})
|
|
31952
|
+
})), isGovernmentOrganization ? /*#__PURE__*/React.createElement(FieldBlock, {
|
|
31953
|
+
error: getFieldError("applicant.governmentOrganizationName"),
|
|
31954
|
+
isFullWidth: true,
|
|
31955
|
+
label: "Name of Government Organization",
|
|
31956
|
+
required: true
|
|
31957
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
31958
|
+
errorStyle: !!getFieldError("applicant.governmentOrganizationName"),
|
|
31959
|
+
inputRef: register({
|
|
31960
|
+
required: isGovernmentOrganization ? "Government Organization Name is required." : false
|
|
31961
|
+
}),
|
|
31962
|
+
name: "applicant.governmentOrganizationName"
|
|
31963
|
+
})) : null, /*#__PURE__*/React.createElement(Controller, {
|
|
31964
|
+
control: control,
|
|
31965
|
+
name: "applicant.applicantIdProofFile",
|
|
31966
|
+
rules: {
|
|
31967
|
+
validate: value => !!value || "Applicant ID Proof is required."
|
|
31968
|
+
},
|
|
31969
|
+
render: props => /*#__PURE__*/React.createElement(FileUploadField, {
|
|
31970
|
+
error: getFieldError("applicant.applicantIdProofFile"),
|
|
31971
|
+
helperText: "Max size 5 MB. Allowed types: PDF, PNG, JPG, JPEG.",
|
|
31972
|
+
id: "applicant-id-proof",
|
|
31973
|
+
isUploading: !!uploadingFields["applicant.applicantIdProofFile"],
|
|
31974
|
+
label: "Upload ID Proof",
|
|
31975
|
+
onDelete: () => clearUploadedFile("applicant.applicantIdProofFile", props.onChange),
|
|
31976
|
+
onUpload: event => uploadFile(event, "applicant.applicantIdProofFile", props.onChange),
|
|
31977
|
+
required: true,
|
|
31978
|
+
value: props.value
|
|
31979
|
+
})
|
|
31980
|
+
})), /*#__PURE__*/React.createElement(SectionCard, {
|
|
31981
|
+
description: "Basic communication details for the application.",
|
|
31982
|
+
isOpen: collapsedSections.contact,
|
|
31983
|
+
onToggle: toggleSection,
|
|
31984
|
+
sectionKey: "contact",
|
|
31985
|
+
title: "Contact Details"
|
|
31986
|
+
}, /*#__PURE__*/React.createElement(FieldBlock, {
|
|
31987
|
+
error: getFieldError("contact.emailId"),
|
|
31988
|
+
label: "Email ID",
|
|
31989
|
+
required: true
|
|
31990
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
31991
|
+
errorStyle: !!getFieldError("contact.emailId"),
|
|
31992
|
+
inputRef: register({
|
|
31993
|
+
pattern: {
|
|
31994
|
+
value: EMAIL_PATTERN,
|
|
31995
|
+
message: "Enter a valid email address."
|
|
31996
|
+
},
|
|
31997
|
+
required: "Email ID is required."
|
|
31998
|
+
}),
|
|
31999
|
+
name: "contact.emailId"
|
|
32000
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32001
|
+
error: getFieldError("contact.mobileNumber"),
|
|
32002
|
+
label: "Mobile Number",
|
|
32003
|
+
required: true
|
|
32004
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
32005
|
+
errorStyle: !!getFieldError("contact.mobileNumber"),
|
|
32006
|
+
inputRef: register({
|
|
32007
|
+
pattern: {
|
|
32008
|
+
value: MOBILE_PATTERN,
|
|
32009
|
+
message: "Enter a valid 10-digit mobile number."
|
|
32010
|
+
},
|
|
32011
|
+
required: "Mobile Number is required."
|
|
32012
|
+
}),
|
|
32013
|
+
maxlength: 10,
|
|
32014
|
+
name: "contact.mobileNumber"
|
|
32015
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32016
|
+
error: getFieldError("contact.officeNumber"),
|
|
32017
|
+
label: "Office No."
|
|
32018
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
32019
|
+
errorStyle: !!getFieldError("contact.officeNumber"),
|
|
32020
|
+
inputRef: register({
|
|
32021
|
+
pattern: {
|
|
32022
|
+
value: OFFICE_PATTERN,
|
|
32023
|
+
message: "Enter a valid office number."
|
|
32024
|
+
}
|
|
32025
|
+
}),
|
|
32026
|
+
name: "contact.officeNumber"
|
|
32027
|
+
}))), /*#__PURE__*/React.createElement(SectionCard, {
|
|
32028
|
+
description: "Enable this section only when the applicant is a DJB employee.",
|
|
32029
|
+
isOpen: collapsedSections.employee,
|
|
32030
|
+
onToggle: toggleSection,
|
|
32031
|
+
sectionKey: "employee",
|
|
32032
|
+
title: "For DJB Employee"
|
|
32033
|
+
}, /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32034
|
+
label: "DJB Employee"
|
|
32035
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
32036
|
+
control: control,
|
|
32037
|
+
name: "djbEmployee.isDjbEmployee",
|
|
32038
|
+
render: props => /*#__PURE__*/React.createElement(CheckBox, {
|
|
32039
|
+
checked: !!props.value,
|
|
32040
|
+
label: "Applicant is a DJB Employee",
|
|
32041
|
+
onChange: event => props.onChange(event.target.checked)
|
|
32042
|
+
})
|
|
32043
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32044
|
+
error: getFieldError("djbEmployee.employeeId"),
|
|
32045
|
+
label: "Employee ID",
|
|
32046
|
+
required: isDjbEmployee
|
|
32047
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
32048
|
+
errorStyle: !!getFieldError("djbEmployee.employeeId"),
|
|
32049
|
+
inputRef: register({
|
|
32050
|
+
required: isDjbEmployee ? "Employee ID is required." : false
|
|
32051
|
+
}),
|
|
32052
|
+
name: "djbEmployee.employeeId"
|
|
32053
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32054
|
+
error: getFieldError("djbEmployee.retirementDate"),
|
|
32055
|
+
label: "Date of Retirement",
|
|
32056
|
+
required: isDjbEmployee
|
|
32057
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
32058
|
+
control: control,
|
|
32059
|
+
name: "djbEmployee.retirementDate",
|
|
32060
|
+
rules: {
|
|
32061
|
+
required: isDjbEmployee ? "Date of Retirement is required." : false
|
|
32062
|
+
},
|
|
32063
|
+
render: props => /*#__PURE__*/React.createElement(DatePicker, {
|
|
32064
|
+
date: props.value,
|
|
32065
|
+
onChange: props.onChange
|
|
32066
|
+
})
|
|
32067
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32068
|
+
error: getFieldError("djbEmployee.officeNameAndAddress"),
|
|
32069
|
+
isFullWidth: true,
|
|
32070
|
+
label: "Office Name & Address",
|
|
32071
|
+
required: isDjbEmployee
|
|
32072
|
+
}, /*#__PURE__*/React.createElement(TextArea, {
|
|
32073
|
+
className: getFieldError("djbEmployee.officeNameAndAddress") ? "employee-card-input-error" : "",
|
|
32074
|
+
inputRef: register({
|
|
32075
|
+
required: isDjbEmployee ? "Office Name & Address is required." : false
|
|
32076
|
+
}),
|
|
32077
|
+
name: "djbEmployee.officeNameAndAddress",
|
|
32078
|
+
style: {
|
|
32079
|
+
minHeight: "96px"
|
|
32080
|
+
}
|
|
32081
|
+
}))), /*#__PURE__*/React.createElement(SectionCard, {
|
|
32082
|
+
description: "Property location and administrative boundary details.",
|
|
32083
|
+
isOpen: collapsedSections.address,
|
|
32084
|
+
onToggle: toggleSection,
|
|
32085
|
+
sectionKey: "address",
|
|
32086
|
+
title: "Property Address"
|
|
32087
|
+
}, /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32088
|
+
error: getFieldError("propertyAddress.address"),
|
|
32089
|
+
isFullWidth: true,
|
|
32090
|
+
label: "Address",
|
|
32091
|
+
required: true
|
|
32092
|
+
}, /*#__PURE__*/React.createElement(TextArea, {
|
|
32093
|
+
className: getFieldError("propertyAddress.address") ? "employee-card-input-error" : "",
|
|
32094
|
+
inputRef: register({
|
|
32095
|
+
required: "Address is required."
|
|
32096
|
+
}),
|
|
32097
|
+
name: "propertyAddress.address",
|
|
32098
|
+
style: {
|
|
32099
|
+
minHeight: "96px"
|
|
32100
|
+
}
|
|
32101
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32102
|
+
error: getFieldError("propertyAddress.landmark"),
|
|
32103
|
+
label: "Landmark"
|
|
32104
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
32105
|
+
errorStyle: !!getFieldError("propertyAddress.landmark"),
|
|
32106
|
+
inputRef: register(),
|
|
32107
|
+
name: "propertyAddress.landmark"
|
|
32108
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32109
|
+
error: getFieldError("propertyAddress.pinCode"),
|
|
32110
|
+
label: "Pin Code",
|
|
32111
|
+
required: true
|
|
32112
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
32113
|
+
errorStyle: !!getFieldError("propertyAddress.pinCode"),
|
|
32114
|
+
inputRef: register({
|
|
32115
|
+
pattern: {
|
|
32116
|
+
value: PINCODE_PATTERN,
|
|
32117
|
+
message: "Enter a valid 6-digit pin code."
|
|
32118
|
+
},
|
|
32119
|
+
required: "Pin Code is required."
|
|
32120
|
+
}),
|
|
32121
|
+
maxlength: 6,
|
|
32122
|
+
name: "propertyAddress.pinCode"
|
|
32123
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32124
|
+
error: getFieldError("propertyAddress.locality"),
|
|
32125
|
+
label: "Locality",
|
|
32126
|
+
required: true
|
|
32127
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
32128
|
+
control: control,
|
|
32129
|
+
name: "propertyAddress.locality",
|
|
32130
|
+
rules: {
|
|
32131
|
+
required: "Locality is required."
|
|
32132
|
+
},
|
|
32133
|
+
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
32134
|
+
option: LOCALITY_OPTIONS,
|
|
32135
|
+
optionKey: "name",
|
|
32136
|
+
selected: props.value,
|
|
32137
|
+
select: props.onChange,
|
|
32138
|
+
t: t
|
|
32139
|
+
})
|
|
32140
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32141
|
+
error: getFieldError("propertyAddress.subLocality"),
|
|
32142
|
+
label: "Sub Locality",
|
|
32143
|
+
required: true
|
|
32144
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
32145
|
+
control: control,
|
|
32146
|
+
name: "propertyAddress.subLocality",
|
|
32147
|
+
rules: {
|
|
32148
|
+
required: "Sub Locality is required."
|
|
32149
|
+
},
|
|
32150
|
+
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
32151
|
+
disable: !selectedLocality,
|
|
32152
|
+
option: subLocalityOptions,
|
|
32153
|
+
optionKey: "name",
|
|
32154
|
+
selected: props.value,
|
|
32155
|
+
select: props.onChange,
|
|
32156
|
+
t: t
|
|
32157
|
+
})
|
|
32158
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32159
|
+
error: getFieldError("propertyAddress.assembly"),
|
|
32160
|
+
label: "Assembly",
|
|
32161
|
+
required: true
|
|
32162
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
32163
|
+
control: control,
|
|
32164
|
+
name: "propertyAddress.assembly",
|
|
32165
|
+
rules: {
|
|
32166
|
+
required: "Assembly is required."
|
|
32167
|
+
},
|
|
32168
|
+
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
32169
|
+
option: ASSEMBLY_OPTIONS,
|
|
32170
|
+
optionKey: "name",
|
|
32171
|
+
selected: props.value,
|
|
32172
|
+
select: props.onChange,
|
|
32173
|
+
t: t
|
|
32174
|
+
})
|
|
32175
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32176
|
+
error: getFieldError("propertyAddress.ward"),
|
|
32177
|
+
label: "Ward",
|
|
32178
|
+
required: true
|
|
32179
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
32180
|
+
control: control,
|
|
32181
|
+
name: "propertyAddress.ward",
|
|
32182
|
+
rules: {
|
|
32183
|
+
required: "Ward is required."
|
|
32184
|
+
},
|
|
32185
|
+
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
32186
|
+
option: WARD_OPTIONS,
|
|
32187
|
+
optionKey: "name",
|
|
32188
|
+
selected: props.value,
|
|
32189
|
+
select: props.onChange,
|
|
32190
|
+
t: t
|
|
32191
|
+
})
|
|
32192
|
+
}))), /*#__PURE__*/React.createElement(SectionCard, {
|
|
32193
|
+
description: "Usage attributes for the property and the requested water connection.",
|
|
32194
|
+
isOpen: collapsedSections.usage,
|
|
32195
|
+
onToggle: toggleSection,
|
|
32196
|
+
sectionKey: "usage",
|
|
32197
|
+
title: "Property and Water Connection Use Details"
|
|
32198
|
+
}, /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32199
|
+
error: getFieldError("useDetails.propertyType"),
|
|
32200
|
+
label: "Property Type",
|
|
32201
|
+
required: true
|
|
32202
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
32203
|
+
control: control,
|
|
32204
|
+
name: "useDetails.propertyType",
|
|
32205
|
+
rules: {
|
|
32206
|
+
required: "Property Type is required."
|
|
32207
|
+
},
|
|
32208
|
+
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
32209
|
+
option: PROPERTY_TYPE_OPTIONS,
|
|
32210
|
+
optionKey: "name",
|
|
32211
|
+
selected: props.value,
|
|
32212
|
+
select: props.onChange,
|
|
32213
|
+
t: t
|
|
32214
|
+
})
|
|
32215
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32216
|
+
error: getFieldError("useDetails.noOfFloors"),
|
|
32217
|
+
label: "No. of Floors",
|
|
32218
|
+
required: true
|
|
32219
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
32220
|
+
errorStyle: !!getFieldError("useDetails.noOfFloors"),
|
|
32221
|
+
inputRef: register({
|
|
32222
|
+
pattern: {
|
|
32223
|
+
value: NUMBER_PATTERN,
|
|
32224
|
+
message: "Enter a valid whole number."
|
|
32225
|
+
},
|
|
32226
|
+
required: "No. of Floors is required."
|
|
32227
|
+
}),
|
|
32228
|
+
name: "useDetails.noOfFloors"
|
|
32229
|
+
})), isHospitalProperty ? /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32230
|
+
error: getFieldError("useDetails.hospitalBeds"),
|
|
32231
|
+
label: "No. of Beds for Hospitals & Nursing Home",
|
|
32232
|
+
required: true
|
|
32233
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
32234
|
+
errorStyle: !!getFieldError("useDetails.hospitalBeds"),
|
|
32235
|
+
inputRef: register({
|
|
32236
|
+
pattern: {
|
|
32237
|
+
value: NUMBER_PATTERN,
|
|
32238
|
+
message: "Enter a valid whole number."
|
|
32239
|
+
},
|
|
32240
|
+
required: isHospitalProperty ? "No. of Beds is required for Hospital / Nursing Home." : false
|
|
32241
|
+
}),
|
|
32242
|
+
name: "useDetails.hospitalBeds"
|
|
32243
|
+
})) : null, /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32244
|
+
error: getFieldError("useDetails.plotArea"),
|
|
32245
|
+
label: "Plot Area in Sqm",
|
|
32246
|
+
required: true
|
|
32247
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
32248
|
+
errorStyle: !!getFieldError("useDetails.plotArea"),
|
|
32249
|
+
inputRef: register({
|
|
32250
|
+
pattern: {
|
|
32251
|
+
value: DECIMAL_PATTERN,
|
|
32252
|
+
message: "Enter a valid numeric value."
|
|
32253
|
+
},
|
|
32254
|
+
required: "Plot Area is required."
|
|
32255
|
+
}),
|
|
32256
|
+
name: "useDetails.plotArea"
|
|
32257
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32258
|
+
error: getFieldError("useDetails.builtUpArea"),
|
|
32259
|
+
label: "Built Up Area",
|
|
32260
|
+
required: true
|
|
32261
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
32262
|
+
errorStyle: !!getFieldError("useDetails.builtUpArea"),
|
|
32263
|
+
inputRef: register({
|
|
32264
|
+
pattern: {
|
|
32265
|
+
value: DECIMAL_PATTERN,
|
|
32266
|
+
message: "Enter a valid numeric value."
|
|
32267
|
+
},
|
|
32268
|
+
required: "Built Up Area is required."
|
|
32269
|
+
}),
|
|
32270
|
+
name: "useDetails.builtUpArea"
|
|
32271
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32272
|
+
error: getFieldError("useDetails.waterConnectionCategory"),
|
|
32273
|
+
label: "Water Connection Category",
|
|
32274
|
+
required: true
|
|
32275
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
32276
|
+
control: control,
|
|
32277
|
+
name: "useDetails.waterConnectionCategory",
|
|
32278
|
+
rules: {
|
|
32279
|
+
required: "Water Connection Category is required."
|
|
32280
|
+
},
|
|
32281
|
+
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
32282
|
+
option: WATER_CONNECTION_CATEGORY_OPTIONS,
|
|
32283
|
+
optionKey: "name",
|
|
32284
|
+
selected: props.value,
|
|
32285
|
+
select: props.onChange,
|
|
32286
|
+
t: t
|
|
32287
|
+
})
|
|
32288
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32289
|
+
error: getFieldError("useDetails.waterConnectionUsedBy"),
|
|
32290
|
+
label: "Water Connection Used By",
|
|
32291
|
+
required: true
|
|
32292
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
32293
|
+
control: control,
|
|
32294
|
+
name: "useDetails.waterConnectionUsedBy",
|
|
32295
|
+
rules: {
|
|
32296
|
+
required: "Water Connection Used By is required."
|
|
32297
|
+
},
|
|
32298
|
+
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
32299
|
+
option: WATER_CONNECTION_USED_BY_OPTIONS,
|
|
32300
|
+
optionKey: "name",
|
|
32301
|
+
selected: props.value,
|
|
32302
|
+
select: props.onChange,
|
|
32303
|
+
t: t
|
|
32304
|
+
})
|
|
32305
|
+
}))), /*#__PURE__*/React.createElement(SectionCard, {
|
|
32306
|
+
description: "Refund or payment-linked bank account details.",
|
|
32307
|
+
isOpen: collapsedSections.bank,
|
|
32308
|
+
onToggle: toggleSection,
|
|
32309
|
+
sectionKey: "bank",
|
|
32310
|
+
title: "Bank Details"
|
|
32311
|
+
}, /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32312
|
+
error: getFieldError("bankDetails.bankName"),
|
|
32313
|
+
label: "Name of the Bank",
|
|
32314
|
+
required: true
|
|
32315
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
32316
|
+
errorStyle: !!getFieldError("bankDetails.bankName"),
|
|
32317
|
+
inputRef: register({
|
|
32318
|
+
required: "Bank Name is required."
|
|
32319
|
+
}),
|
|
32320
|
+
name: "bankDetails.bankName"
|
|
32321
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32322
|
+
error: getFieldError("bankDetails.branchName"),
|
|
32323
|
+
label: "Name of the Branch",
|
|
32324
|
+
required: true
|
|
32325
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
32326
|
+
errorStyle: !!getFieldError("bankDetails.branchName"),
|
|
32327
|
+
inputRef: register({
|
|
32328
|
+
required: "Branch Name is required."
|
|
32329
|
+
}),
|
|
32330
|
+
name: "bankDetails.branchName"
|
|
32331
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32332
|
+
error: getFieldError("bankDetails.ifscCode"),
|
|
32333
|
+
label: "IFSC Code",
|
|
32334
|
+
required: true
|
|
32335
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
32336
|
+
errorStyle: !!getFieldError("bankDetails.ifscCode"),
|
|
32337
|
+
inputRef: register({
|
|
32338
|
+
pattern: {
|
|
32339
|
+
value: IFSC_PATTERN,
|
|
32340
|
+
message: "Enter a valid IFSC code."
|
|
32341
|
+
},
|
|
32342
|
+
required: "IFSC Code is required."
|
|
32343
|
+
}),
|
|
32344
|
+
name: "bankDetails.ifscCode",
|
|
32345
|
+
onChange: event => {
|
|
32346
|
+
event.target.value = event.target.value.toUpperCase();
|
|
32347
|
+
}
|
|
32348
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32349
|
+
error: getFieldError("bankDetails.bankAccountNumber"),
|
|
32350
|
+
label: "Bank Account No.",
|
|
32351
|
+
required: true
|
|
32352
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
32353
|
+
errorStyle: !!getFieldError("bankDetails.bankAccountNumber"),
|
|
32354
|
+
inputRef: register({
|
|
32355
|
+
pattern: {
|
|
32356
|
+
value: ACCOUNT_PATTERN,
|
|
32357
|
+
message: "Enter a valid bank account number."
|
|
32358
|
+
},
|
|
32359
|
+
required: "Bank Account Number is required."
|
|
32360
|
+
}),
|
|
32361
|
+
name: "bankDetails.bankAccountNumber"
|
|
32362
|
+
}))), /*#__PURE__*/React.createElement(SectionCard, {
|
|
32363
|
+
description: "Optional rain water harvesting certificate request.",
|
|
32364
|
+
isOpen: collapsedSections.rainWaterHarvesting,
|
|
32365
|
+
onToggle: toggleSection,
|
|
32366
|
+
sectionKey: "rainWaterHarvesting",
|
|
32367
|
+
title: "Rain Water Harvesting"
|
|
32368
|
+
}, /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32369
|
+
isFullWidth: true,
|
|
32370
|
+
label: "Apply for RWH Adequacy Certificate"
|
|
32371
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
32372
|
+
control: control,
|
|
32373
|
+
name: "rainWaterHarvesting.applyForAdequacyCertificate",
|
|
32374
|
+
render: props => /*#__PURE__*/React.createElement(CheckBox, {
|
|
32375
|
+
checked: !!props.value,
|
|
32376
|
+
label: "Apply for RWH Adequacy Certificate",
|
|
32377
|
+
onChange: event => props.onChange(event.target.checked)
|
|
32378
|
+
})
|
|
32379
|
+
}))), /*#__PURE__*/React.createElement(SectionCard, {
|
|
32380
|
+
description: "Documents to be attached. Maximum allowed file size is 5 MB.",
|
|
32381
|
+
isOpen: collapsedSections.documents,
|
|
32382
|
+
onToggle: toggleSection,
|
|
32383
|
+
sectionKey: "documents",
|
|
32384
|
+
title: "Documents to be Attached"
|
|
32385
|
+
}, /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32386
|
+
error: getFieldError("documents.proofOfIdentity"),
|
|
32387
|
+
label: "Proof of Identity",
|
|
32388
|
+
required: true
|
|
32389
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
32390
|
+
control: control,
|
|
32391
|
+
name: "documents.proofOfIdentity",
|
|
32392
|
+
rules: {
|
|
32393
|
+
required: "Proof of Identity is required."
|
|
32394
|
+
},
|
|
32395
|
+
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
32396
|
+
option: PROOF_OF_IDENTITY_OPTIONS,
|
|
32397
|
+
optionKey: "name",
|
|
32398
|
+
selected: props.value,
|
|
32399
|
+
select: props.onChange,
|
|
32400
|
+
t: t
|
|
32401
|
+
})
|
|
32402
|
+
})), /*#__PURE__*/React.createElement(Controller, {
|
|
32403
|
+
control: control,
|
|
32404
|
+
name: "documents.identityProofFile",
|
|
32405
|
+
rules: {
|
|
32406
|
+
validate: value => !!value || "Upload Identity Proof is required."
|
|
32407
|
+
},
|
|
32408
|
+
render: props => /*#__PURE__*/React.createElement(FileUploadField, {
|
|
32409
|
+
error: getFieldError("documents.identityProofFile"),
|
|
32410
|
+
helperText: "Max size 5 MB. Allowed types: PDF, PNG, JPG, JPEG.",
|
|
32411
|
+
id: "identity-proof-file",
|
|
32412
|
+
isUploading: !!uploadingFields["documents.identityProofFile"],
|
|
32413
|
+
label: "Upload Identity Proof",
|
|
32414
|
+
onDelete: () => clearUploadedFile("documents.identityProofFile", props.onChange),
|
|
32415
|
+
onUpload: event => uploadFile(event, "documents.identityProofFile", props.onChange),
|
|
32416
|
+
required: true,
|
|
32417
|
+
value: props.value
|
|
32418
|
+
})
|
|
32419
|
+
}), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32420
|
+
error: getFieldError("documents.ownershipStatus"),
|
|
32421
|
+
label: "Ownership Status",
|
|
32422
|
+
required: true
|
|
32423
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
32424
|
+
control: control,
|
|
32425
|
+
name: "documents.ownershipStatus",
|
|
32426
|
+
rules: {
|
|
32427
|
+
required: "Ownership Status is required."
|
|
32428
|
+
},
|
|
32429
|
+
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
32430
|
+
option: OWNERSHIP_STATUS_OPTIONS,
|
|
32431
|
+
optionKey: "name",
|
|
32432
|
+
selected: props.value,
|
|
32433
|
+
select: props.onChange,
|
|
32434
|
+
t: t
|
|
32435
|
+
})
|
|
32436
|
+
})), /*#__PURE__*/React.createElement(Controller, {
|
|
32437
|
+
control: control,
|
|
32438
|
+
name: "documents.ownershipDocumentFile",
|
|
32439
|
+
rules: {
|
|
32440
|
+
validate: value => !!value || "Upload Ownership Document is required."
|
|
32441
|
+
},
|
|
32442
|
+
render: props => /*#__PURE__*/React.createElement(FileUploadField, {
|
|
32443
|
+
error: getFieldError("documents.ownershipDocumentFile"),
|
|
32444
|
+
helperText: "Max size 5 MB. Allowed types: PDF, PNG, JPG, JPEG.",
|
|
32445
|
+
id: "ownership-document-file",
|
|
32446
|
+
isUploading: !!uploadingFields["documents.ownershipDocumentFile"],
|
|
32447
|
+
label: "Upload Ownership Document",
|
|
32448
|
+
onDelete: () => clearUploadedFile("documents.ownershipDocumentFile", props.onChange),
|
|
32449
|
+
onUpload: event => uploadFile(event, "documents.ownershipDocumentFile", props.onChange),
|
|
32450
|
+
required: true,
|
|
32451
|
+
value: props.value
|
|
32452
|
+
})
|
|
32453
|
+
}), /*#__PURE__*/React.createElement(Controller, {
|
|
32454
|
+
control: control,
|
|
32455
|
+
name: "documents.otherDocumentFile",
|
|
32456
|
+
render: props => /*#__PURE__*/React.createElement(FileUploadField, {
|
|
32457
|
+
error: getFieldError("documents.otherDocumentFile"),
|
|
32458
|
+
helperText: "Optional. Max size 5 MB. Allowed types: PDF, PNG, JPG, JPEG.",
|
|
32459
|
+
id: "other-document-file",
|
|
32460
|
+
isUploading: !!uploadingFields["documents.otherDocumentFile"],
|
|
32461
|
+
label: "Other Document",
|
|
32462
|
+
onDelete: () => clearUploadedFile("documents.otherDocumentFile", props.onChange),
|
|
32463
|
+
onUpload: event => uploadFile(event, "documents.otherDocumentFile", props.onChange),
|
|
32464
|
+
value: props.value
|
|
32465
|
+
})
|
|
32466
|
+
})), /*#__PURE__*/React.createElement(SectionCard, {
|
|
32467
|
+
description: "Final undertaking details before preview and submit.",
|
|
32468
|
+
isOpen: collapsedSections.declaration,
|
|
32469
|
+
onToggle: toggleSection,
|
|
32470
|
+
sectionKey: "declaration",
|
|
32471
|
+
title: "Declaration / Undertaking"
|
|
32472
|
+
}, /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32473
|
+
error: getFieldError("declaration.submittedBy"),
|
|
32474
|
+
label: "Submitted By",
|
|
32475
|
+
required: true
|
|
32476
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
32477
|
+
control: control,
|
|
32478
|
+
name: "declaration.submittedBy",
|
|
32479
|
+
rules: {
|
|
32480
|
+
required: "Submitted By is required."
|
|
32481
|
+
},
|
|
32482
|
+
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
32483
|
+
option: SUBMITTED_BY_OPTIONS,
|
|
32484
|
+
optionKey: "name",
|
|
32485
|
+
selected: props.value,
|
|
32486
|
+
select: props.onChange,
|
|
32487
|
+
t: t
|
|
32488
|
+
})
|
|
32489
|
+
})), /*#__PURE__*/React.createElement(Controller, {
|
|
32490
|
+
control: control,
|
|
32491
|
+
name: "declaration.signatureFile",
|
|
32492
|
+
rules: {
|
|
32493
|
+
validate: value => !!value || "Upload Signature is required."
|
|
32494
|
+
},
|
|
32495
|
+
render: props => /*#__PURE__*/React.createElement(FileUploadField, {
|
|
32496
|
+
error: getFieldError("declaration.signatureFile"),
|
|
32497
|
+
helperText: "Max size 5 MB. Allowed types: PDF, PNG, JPG, JPEG.",
|
|
32498
|
+
id: "signature-file",
|
|
32499
|
+
isUploading: !!uploadingFields["declaration.signatureFile"],
|
|
32500
|
+
label: "Upload Signature",
|
|
32501
|
+
onDelete: () => clearUploadedFile("declaration.signatureFile", props.onChange),
|
|
32502
|
+
onUpload: event => uploadFile(event, "declaration.signatureFile", props.onChange),
|
|
32503
|
+
required: true,
|
|
32504
|
+
value: props.value
|
|
32505
|
+
})
|
|
32506
|
+
}), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32507
|
+
isFullWidth: true,
|
|
32508
|
+
label: "Captcha",
|
|
32509
|
+
required: true
|
|
32510
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
32511
|
+
style: {
|
|
32512
|
+
display: "flex",
|
|
32513
|
+
gap: "16px",
|
|
32514
|
+
flexWrap: "wrap",
|
|
32515
|
+
alignItems: "center"
|
|
32516
|
+
}
|
|
32517
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
32518
|
+
style: captchaBoxStyle
|
|
32519
|
+
}, generatedCaptcha), /*#__PURE__*/React.createElement("button", {
|
|
32520
|
+
type: "button",
|
|
32521
|
+
onClick: refreshCaptcha,
|
|
32522
|
+
style: linkButtonStyle
|
|
32523
|
+
}, "Refresh Captcha"))), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32524
|
+
error: getFieldError("declaration.captcha"),
|
|
32525
|
+
label: "Enter Captcha",
|
|
32526
|
+
required: true
|
|
32527
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
32528
|
+
errorStyle: !!getFieldError("declaration.captcha"),
|
|
32529
|
+
inputRef: register({
|
|
32530
|
+
required: "Captcha is required."
|
|
32531
|
+
}),
|
|
32532
|
+
name: "declaration.captcha"
|
|
32533
|
+
})), /*#__PURE__*/React.createElement(FieldBlock, {
|
|
32534
|
+
error: getFieldError("declaration.agree"),
|
|
32535
|
+
isFullWidth: true,
|
|
32536
|
+
label: "Declaration",
|
|
32537
|
+
required: true
|
|
32538
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
32539
|
+
control: control,
|
|
32540
|
+
name: "declaration.agree",
|
|
32541
|
+
rules: {
|
|
32542
|
+
validate: value => value || "Please accept the declaration to continue."
|
|
32543
|
+
},
|
|
32544
|
+
render: props => /*#__PURE__*/React.createElement(CheckBox, {
|
|
32545
|
+
checked: !!props.value,
|
|
32546
|
+
label: "I Agree",
|
|
32547
|
+
onChange: event => props.onChange(event.target.checked)
|
|
32548
|
+
})
|
|
32549
|
+
}))))), previewMode && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SectionCard, {
|
|
32550
|
+
description: "Selected request and connection type.",
|
|
32551
|
+
isOpen: collapsedSections.application,
|
|
32552
|
+
onToggle: toggleSection,
|
|
32553
|
+
sectionKey: "application",
|
|
32554
|
+
title: "Application Selection"
|
|
32555
|
+
}, /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32556
|
+
label: "Type of Request",
|
|
32557
|
+
value: formValues === null || formValues === void 0 ? void 0 : formValues.typeOfRequest
|
|
32558
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32559
|
+
label: "Connection Type",
|
|
32560
|
+
value: formValues === null || formValues === void 0 ? void 0 : formValues.connectionType
|
|
32561
|
+
})), /*#__PURE__*/React.createElement(SectionCard, {
|
|
32562
|
+
description: "Applicant identity and organization information.",
|
|
32563
|
+
isOpen: collapsedSections.applicant,
|
|
32564
|
+
onToggle: toggleSection,
|
|
32565
|
+
sectionKey: "applicant",
|
|
32566
|
+
title: "Details of Applicant"
|
|
32567
|
+
}, /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32568
|
+
label: "First Name",
|
|
32569
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$applicant = formValues.applicant) === null || _formValues$applicant === void 0 ? void 0 : _formValues$applicant.firstName
|
|
32570
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32571
|
+
label: "Middle Name",
|
|
32572
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$applicant2 = formValues.applicant) === null || _formValues$applicant2 === void 0 ? void 0 : _formValues$applicant2.middleName
|
|
32573
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32574
|
+
label: "Last Name",
|
|
32575
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$applicant3 = formValues.applicant) === null || _formValues$applicant3 === void 0 ? void 0 : _formValues$applicant3.lastName
|
|
32576
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32577
|
+
label: "Father / Husband Name",
|
|
32578
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$applicant4 = formValues.applicant) === null || _formValues$applicant4 === void 0 ? void 0 : _formValues$applicant4.fatherOrHusbandName
|
|
32579
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32580
|
+
label: "Government Organization",
|
|
32581
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$applicant5 = formValues.applicant) === null || _formValues$applicant5 === void 0 ? void 0 : _formValues$applicant5.isGovernmentOrganization
|
|
32582
|
+
}), formValues !== null && formValues !== void 0 && (_formValues$applicant6 = formValues.applicant) !== null && _formValues$applicant6 !== void 0 && _formValues$applicant6.isGovernmentOrganization ? /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32583
|
+
isFullWidth: true,
|
|
32584
|
+
label: "Name of Government Organization",
|
|
32585
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$applicant7 = formValues.applicant) === null || _formValues$applicant7 === void 0 ? void 0 : _formValues$applicant7.governmentOrganizationName
|
|
32586
|
+
}) : null, /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32587
|
+
isFullWidth: true,
|
|
32588
|
+
label: "Uploaded ID Proof",
|
|
32589
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$applicant8 = formValues.applicant) === null || _formValues$applicant8 === void 0 ? void 0 : _formValues$applicant8.applicantIdProofFile
|
|
32590
|
+
})), /*#__PURE__*/React.createElement(SectionCard, {
|
|
32591
|
+
description: "Communication details captured in the application.",
|
|
32592
|
+
isOpen: collapsedSections.contact,
|
|
32593
|
+
onToggle: toggleSection,
|
|
32594
|
+
sectionKey: "contact",
|
|
32595
|
+
title: "Contact Details"
|
|
32596
|
+
}, /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32597
|
+
label: "Email ID",
|
|
32598
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$contact = formValues.contact) === null || _formValues$contact === void 0 ? void 0 : _formValues$contact.emailId
|
|
32599
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32600
|
+
label: "Mobile Number",
|
|
32601
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$contact2 = formValues.contact) === null || _formValues$contact2 === void 0 ? void 0 : _formValues$contact2.mobileNumber
|
|
32602
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32603
|
+
label: "Office No.",
|
|
32604
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$contact3 = formValues.contact) === null || _formValues$contact3 === void 0 ? void 0 : _formValues$contact3.officeNumber
|
|
32605
|
+
})), /*#__PURE__*/React.createElement(SectionCard, {
|
|
32606
|
+
description: "DJB employee-specific information.",
|
|
32607
|
+
isOpen: collapsedSections.employee,
|
|
32608
|
+
onToggle: toggleSection,
|
|
32609
|
+
sectionKey: "employee",
|
|
32610
|
+
title: "For DJB Employee"
|
|
32611
|
+
}, /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32612
|
+
label: "DJB Employee",
|
|
32613
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$djbEmploy = formValues.djbEmployee) === null || _formValues$djbEmploy === void 0 ? void 0 : _formValues$djbEmploy.isDjbEmployee
|
|
32614
|
+
}), formValues !== null && formValues !== void 0 && (_formValues$djbEmploy2 = formValues.djbEmployee) !== null && _formValues$djbEmploy2 !== void 0 && _formValues$djbEmploy2.isDjbEmployee ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32615
|
+
label: "Employee ID",
|
|
32616
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$djbEmploy3 = formValues.djbEmployee) === null || _formValues$djbEmploy3 === void 0 ? void 0 : _formValues$djbEmploy3.employeeId
|
|
32617
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32618
|
+
label: "Date of Retirement",
|
|
32619
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$djbEmploy4 = formValues.djbEmployee) === null || _formValues$djbEmploy4 === void 0 ? void 0 : _formValues$djbEmploy4.retirementDate
|
|
32620
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32621
|
+
isFullWidth: true,
|
|
32622
|
+
label: "Office Name & Address",
|
|
32623
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$djbEmploy5 = formValues.djbEmployee) === null || _formValues$djbEmploy5 === void 0 ? void 0 : _formValues$djbEmploy5.officeNameAndAddress
|
|
32624
|
+
})) : null), /*#__PURE__*/React.createElement(SectionCard, {
|
|
32625
|
+
description: "Property address and administrative boundary values.",
|
|
32626
|
+
isOpen: collapsedSections.address,
|
|
32627
|
+
onToggle: toggleSection,
|
|
32628
|
+
sectionKey: "address",
|
|
32629
|
+
title: "Property Address"
|
|
32630
|
+
}, /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32631
|
+
isFullWidth: true,
|
|
32632
|
+
label: "Address",
|
|
32633
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$propertyA = formValues.propertyAddress) === null || _formValues$propertyA === void 0 ? void 0 : _formValues$propertyA.address
|
|
32634
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32635
|
+
label: "Landmark",
|
|
32636
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$propertyA2 = formValues.propertyAddress) === null || _formValues$propertyA2 === void 0 ? void 0 : _formValues$propertyA2.landmark
|
|
32637
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32638
|
+
label: "Pin Code",
|
|
32639
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$propertyA3 = formValues.propertyAddress) === null || _formValues$propertyA3 === void 0 ? void 0 : _formValues$propertyA3.pinCode
|
|
32640
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32641
|
+
label: "Locality",
|
|
32642
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$propertyA4 = formValues.propertyAddress) === null || _formValues$propertyA4 === void 0 ? void 0 : _formValues$propertyA4.locality
|
|
32643
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32644
|
+
label: "Sub Locality",
|
|
32645
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$propertyA5 = formValues.propertyAddress) === null || _formValues$propertyA5 === void 0 ? void 0 : _formValues$propertyA5.subLocality
|
|
32646
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32647
|
+
label: "Assembly",
|
|
32648
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$propertyA6 = formValues.propertyAddress) === null || _formValues$propertyA6 === void 0 ? void 0 : _formValues$propertyA6.assembly
|
|
32649
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32650
|
+
label: "Ward",
|
|
32651
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$propertyA7 = formValues.propertyAddress) === null || _formValues$propertyA7 === void 0 ? void 0 : _formValues$propertyA7.ward
|
|
32652
|
+
})), /*#__PURE__*/React.createElement(SectionCard, {
|
|
32653
|
+
description: "Property and connection usage values.",
|
|
32654
|
+
isOpen: collapsedSections.usage,
|
|
32655
|
+
onToggle: toggleSection,
|
|
32656
|
+
sectionKey: "usage",
|
|
32657
|
+
title: "Property and Water Connection Use Details"
|
|
32658
|
+
}, /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32659
|
+
label: "Property Type",
|
|
32660
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$useDetail = formValues.useDetails) === null || _formValues$useDetail === void 0 ? void 0 : _formValues$useDetail.propertyType
|
|
32661
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32662
|
+
label: "No. of Floors",
|
|
32663
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$useDetail2 = formValues.useDetails) === null || _formValues$useDetail2 === void 0 ? void 0 : _formValues$useDetail2.noOfFloors
|
|
32664
|
+
}), (formValues === null || formValues === void 0 ? void 0 : (_formValues$useDetail3 = formValues.useDetails) === null || _formValues$useDetail3 === void 0 ? void 0 : (_formValues$useDetail4 = _formValues$useDetail3.propertyType) === null || _formValues$useDetail4 === void 0 ? void 0 : _formValues$useDetail4.code) === "HOSPITAL_NURSING_HOME" ? /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32665
|
+
label: "No. of Beds for Hospitals & Nursing Home",
|
|
32666
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$useDetail5 = formValues.useDetails) === null || _formValues$useDetail5 === void 0 ? void 0 : _formValues$useDetail5.hospitalBeds
|
|
32667
|
+
}) : null, /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32668
|
+
label: "Plot Area in Sqm",
|
|
32669
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$useDetail6 = formValues.useDetails) === null || _formValues$useDetail6 === void 0 ? void 0 : _formValues$useDetail6.plotArea
|
|
32670
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32671
|
+
label: "Built Up Area",
|
|
32672
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$useDetail7 = formValues.useDetails) === null || _formValues$useDetail7 === void 0 ? void 0 : _formValues$useDetail7.builtUpArea
|
|
32673
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32674
|
+
label: "Water Connection Category",
|
|
32675
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$useDetail8 = formValues.useDetails) === null || _formValues$useDetail8 === void 0 ? void 0 : _formValues$useDetail8.waterConnectionCategory
|
|
32676
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32677
|
+
label: "Water Connection Used By",
|
|
32678
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$useDetail9 = formValues.useDetails) === null || _formValues$useDetail9 === void 0 ? void 0 : _formValues$useDetail9.waterConnectionUsedBy
|
|
32679
|
+
})), /*#__PURE__*/React.createElement(SectionCard, {
|
|
32680
|
+
description: "Banking information as entered in the form.",
|
|
32681
|
+
isOpen: collapsedSections.bank,
|
|
32682
|
+
onToggle: toggleSection,
|
|
32683
|
+
sectionKey: "bank",
|
|
32684
|
+
title: "Bank Details"
|
|
32685
|
+
}, /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32686
|
+
label: "Name of the Bank",
|
|
32687
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$bankDetai = formValues.bankDetails) === null || _formValues$bankDetai === void 0 ? void 0 : _formValues$bankDetai.bankName
|
|
32688
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32689
|
+
label: "Name of the Branch",
|
|
32690
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$bankDetai2 = formValues.bankDetails) === null || _formValues$bankDetai2 === void 0 ? void 0 : _formValues$bankDetai2.branchName
|
|
32691
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32692
|
+
label: "IFSC Code",
|
|
32693
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$bankDetai3 = formValues.bankDetails) === null || _formValues$bankDetai3 === void 0 ? void 0 : _formValues$bankDetai3.ifscCode
|
|
32694
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32695
|
+
label: "Bank Account No.",
|
|
32696
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$bankDetai4 = formValues.bankDetails) === null || _formValues$bankDetai4 === void 0 ? void 0 : _formValues$bankDetai4.bankAccountNumber
|
|
32697
|
+
})), /*#__PURE__*/React.createElement(SectionCard, {
|
|
32698
|
+
description: "Rain water harvesting request status.",
|
|
32699
|
+
isOpen: collapsedSections.rainWaterHarvesting,
|
|
32700
|
+
onToggle: toggleSection,
|
|
32701
|
+
sectionKey: "rainWaterHarvesting",
|
|
32702
|
+
title: "Rain Water Harvesting"
|
|
32703
|
+
}, /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32704
|
+
isFullWidth: true,
|
|
32705
|
+
label: "Apply for RWH Adequacy Certificate",
|
|
32706
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$rainWater = formValues.rainWaterHarvesting) === null || _formValues$rainWater === void 0 ? void 0 : _formValues$rainWater.applyForAdequacyCertificate
|
|
32707
|
+
})), /*#__PURE__*/React.createElement(SectionCard, {
|
|
32708
|
+
description: "Uploaded supporting documents.",
|
|
32709
|
+
isOpen: collapsedSections.documents,
|
|
32710
|
+
onToggle: toggleSection,
|
|
32711
|
+
sectionKey: "documents",
|
|
32712
|
+
title: "Documents to be Attached"
|
|
32713
|
+
}, /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32714
|
+
label: "Proof of Identity",
|
|
32715
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$documents = formValues.documents) === null || _formValues$documents === void 0 ? void 0 : _formValues$documents.proofOfIdentity
|
|
32716
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32717
|
+
label: "Upload Identity Proof",
|
|
32718
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$documents2 = formValues.documents) === null || _formValues$documents2 === void 0 ? void 0 : _formValues$documents2.identityProofFile
|
|
32719
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32720
|
+
label: "Ownership Status",
|
|
32721
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$documents3 = formValues.documents) === null || _formValues$documents3 === void 0 ? void 0 : _formValues$documents3.ownershipStatus
|
|
32722
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32723
|
+
label: "Upload Ownership Document",
|
|
32724
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$documents4 = formValues.documents) === null || _formValues$documents4 === void 0 ? void 0 : _formValues$documents4.ownershipDocumentFile
|
|
32725
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32726
|
+
label: "Other Document",
|
|
32727
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$documents5 = formValues.documents) === null || _formValues$documents5 === void 0 ? void 0 : _formValues$documents5.otherDocumentFile
|
|
32728
|
+
})), /*#__PURE__*/React.createElement(SectionCard, {
|
|
32729
|
+
description: "Declaration and undertaking details.",
|
|
32730
|
+
isOpen: collapsedSections.declaration,
|
|
32731
|
+
onToggle: toggleSection,
|
|
32732
|
+
sectionKey: "declaration",
|
|
32733
|
+
title: "Declaration / Undertaking"
|
|
32734
|
+
}, /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32735
|
+
label: "Submitted By",
|
|
32736
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$declarati = formValues.declaration) === null || _formValues$declarati === void 0 ? void 0 : _formValues$declarati.submittedBy
|
|
32737
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32738
|
+
label: "Upload Signature",
|
|
32739
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$declarati2 = formValues.declaration) === null || _formValues$declarati2 === void 0 ? void 0 : _formValues$declarati2.signatureFile
|
|
32740
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32741
|
+
label: "Entered Captcha",
|
|
32742
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$declarati3 = formValues.declaration) === null || _formValues$declarati3 === void 0 ? void 0 : _formValues$declarati3.captcha
|
|
32743
|
+
}), /*#__PURE__*/React.createElement(PreviewItem, {
|
|
32744
|
+
label: "I Agree",
|
|
32745
|
+
value: formValues === null || formValues === void 0 ? void 0 : (_formValues$declarati4 = formValues.declaration) === null || _formValues$declarati4 === void 0 ? void 0 : _formValues$declarati4.agree
|
|
32746
|
+
}))))), /*#__PURE__*/React.createElement(ActionBar, {
|
|
32747
|
+
style: actionBarStyle
|
|
32748
|
+
}, !previewMode ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
32749
|
+
label: "Reset",
|
|
32750
|
+
onSubmit: onReset,
|
|
32751
|
+
style: secondaryButtonStyle
|
|
32752
|
+
}), /*#__PURE__*/React.createElement(SubmitBar, {
|
|
32753
|
+
disabled: hasPendingUpload,
|
|
32754
|
+
label: hasPendingUpload ? "Uploading..." : "Preview",
|
|
32755
|
+
onSubmit: handleSubmit(onPreview)
|
|
32756
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
32757
|
+
label: "Edit Details",
|
|
32758
|
+
onSubmit: onEdit,
|
|
32759
|
+
style: secondaryButtonStyle
|
|
32760
|
+
}), /*#__PURE__*/React.createElement(SubmitBar, {
|
|
32761
|
+
disabled: hasPendingUpload,
|
|
32762
|
+
label: hasPendingUpload ? "Uploading..." : "Submit",
|
|
32763
|
+
onSubmit: handleSubmit(onSubmit)
|
|
32764
|
+
}))), showToast ? /*#__PURE__*/React.createElement(Toast, {
|
|
32765
|
+
error: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "error",
|
|
32766
|
+
label: showToast === null || showToast === void 0 ? void 0 : showToast.message,
|
|
31298
32767
|
onClose: closeToast,
|
|
31299
|
-
|
|
31300
|
-
}));
|
|
32768
|
+
warning: showToast === null || showToast === void 0 ? void 0 : showToast.warning
|
|
32769
|
+
}) : null);
|
|
31301
32770
|
};
|
|
31302
32771
|
|
|
31303
32772
|
const configPTApproverApplication = ({
|