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