@djb25/digit-ui-module-ws 1.0.80 → 1.0.81
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 +904 -383
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +904 -383
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13400,7 +13400,7 @@ const createConnectionHolderDetails = () => ({
|
|
|
13400
13400
|
isWatsappSameAsMobile: false
|
|
13401
13401
|
});
|
|
13402
13402
|
const WSConnectionHolderDetails = _ref => {
|
|
13403
|
-
var _formData$
|
|
13403
|
+
var _formData$ConnectionH16;
|
|
13404
13404
|
let config = _ref.config,
|
|
13405
13405
|
onSelect = _ref.onSelect,
|
|
13406
13406
|
userType = _ref.userType,
|
|
@@ -13412,7 +13412,35 @@ const WSConnectionHolderDetails = _ref => {
|
|
|
13412
13412
|
t = _useTranslation.t;
|
|
13413
13413
|
const _useLocation = reactRouterDom.useLocation();
|
|
13414
13414
|
const filters = getQueryStringParams(location.search);
|
|
13415
|
-
const _useState = React.useState(
|
|
13415
|
+
const _useState = React.useState(() => {
|
|
13416
|
+
if (formData !== null && formData !== void 0 && formData.ConnectionHolderDetails) {
|
|
13417
|
+
var _formData$ConnectionH;
|
|
13418
|
+
return [_extends({}, formData === null || formData === void 0 ? void 0 : (_formData$ConnectionH = formData.ConnectionHolderDetails) === null || _formData$ConnectionH === void 0 ? void 0 : _formData$ConnectionH[0])];
|
|
13419
|
+
} else {
|
|
13420
|
+
var _Digit$UserService$ge;
|
|
13421
|
+
let initData = createConnectionHolderDetails();
|
|
13422
|
+
const userInfo = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info;
|
|
13423
|
+
if (userInfo && userInfo.type === "CITIZEN" && window.location.href.includes("citizen")) {
|
|
13424
|
+
initData = _extends({}, initData, {
|
|
13425
|
+
name: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.name) || "",
|
|
13426
|
+
mobileNumber: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.mobileNumber) || "",
|
|
13427
|
+
emailId: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.emailId) || "",
|
|
13428
|
+
gender: userInfo !== null && userInfo !== void 0 && userInfo.gender ? {
|
|
13429
|
+
code: userInfo === null || userInfo === void 0 ? void 0 : userInfo.gender,
|
|
13430
|
+
i18nKey: "COMMON_GENDER_" + (userInfo === null || userInfo === void 0 ? void 0 : userInfo.gender),
|
|
13431
|
+
value: userInfo === null || userInfo === void 0 ? void 0 : userInfo.gender
|
|
13432
|
+
} : "",
|
|
13433
|
+
guardian: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.fatherOrHusbandName) || "",
|
|
13434
|
+
relationship: userInfo !== null && userInfo !== void 0 && userInfo.relationship ? {
|
|
13435
|
+
code: userInfo === null || userInfo === void 0 ? void 0 : userInfo.relationship,
|
|
13436
|
+
name: userInfo === null || userInfo === void 0 ? void 0 : userInfo.relationship,
|
|
13437
|
+
i18nKey: "COMMON_MASTERS_OWNERTYPE_" + (userInfo === null || userInfo === void 0 ? void 0 : userInfo.relationship)
|
|
13438
|
+
} : ""
|
|
13439
|
+
});
|
|
13440
|
+
}
|
|
13441
|
+
return [initData];
|
|
13442
|
+
}
|
|
13443
|
+
}),
|
|
13416
13444
|
connectionHolderDetails = _useState[0],
|
|
13417
13445
|
setConnectionHolderDetails = _useState[1];
|
|
13418
13446
|
const _useState2 = React.useState({
|
|
@@ -13477,7 +13505,28 @@ const WSConnectionHolderDetails = _ref => {
|
|
|
13477
13505
|
}, [formData === null || formData === void 0 ? void 0 : (_formData$ConnectionH16 = formData.ConnectionHolderDetails) === null || _formData$ConnectionH16 === void 0 ? void 0 : _formData$ConnectionH16[0], connectionHolderDetails, formData]);
|
|
13478
13506
|
React.useEffect(() => {
|
|
13479
13507
|
if (!(formData !== null && formData !== void 0 && formData.ConnectionHolderDetails)) {
|
|
13480
|
-
|
|
13508
|
+
var _Digit$UserService$ge2;
|
|
13509
|
+
let initData = createConnectionHolderDetails();
|
|
13510
|
+
const userInfo = (_Digit$UserService$ge2 = Digit.UserService.getUser()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.info;
|
|
13511
|
+
if (userInfo && userInfo.type === "CITIZEN" && window.location.href.includes("citizen")) {
|
|
13512
|
+
initData = _extends({}, initData, {
|
|
13513
|
+
name: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.name) || "",
|
|
13514
|
+
mobileNumber: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.mobileNumber) || "",
|
|
13515
|
+
emailId: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.emailId) || "",
|
|
13516
|
+
gender: userInfo !== null && userInfo !== void 0 && userInfo.gender ? {
|
|
13517
|
+
code: userInfo === null || userInfo === void 0 ? void 0 : userInfo.gender,
|
|
13518
|
+
i18nKey: "COMMON_GENDER_" + (userInfo === null || userInfo === void 0 ? void 0 : userInfo.gender),
|
|
13519
|
+
value: userInfo === null || userInfo === void 0 ? void 0 : userInfo.gender
|
|
13520
|
+
} : "",
|
|
13521
|
+
guardian: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.fatherOrHusbandName) || "",
|
|
13522
|
+
relationship: userInfo !== null && userInfo !== void 0 && userInfo.relationship ? {
|
|
13523
|
+
code: userInfo === null || userInfo === void 0 ? void 0 : userInfo.relationship,
|
|
13524
|
+
name: userInfo === null || userInfo === void 0 ? void 0 : userInfo.relationship,
|
|
13525
|
+
i18nKey: "COMMON_MASTERS_OWNERTYPE_" + (userInfo === null || userInfo === void 0 ? void 0 : userInfo.relationship)
|
|
13526
|
+
} : ""
|
|
13527
|
+
});
|
|
13528
|
+
}
|
|
13529
|
+
setConnectionHolderDetails([initData]);
|
|
13481
13530
|
}
|
|
13482
13531
|
}, [formData === null || formData === void 0 ? void 0 : formData.ConnectionHolderDetails]);
|
|
13483
13532
|
const commonProps = {
|
|
@@ -17606,217 +17655,249 @@ const UploadFileDigiLocker = props => {
|
|
|
17606
17655
|
};
|
|
17607
17656
|
const fetchDigiLockerDocuments = function (e) {
|
|
17608
17657
|
try {
|
|
17658
|
+
let _exit = false;
|
|
17609
17659
|
e.preventDefault();
|
|
17610
17660
|
return Promise.resolve(_catch$1(function () {
|
|
17611
|
-
|
|
17612
|
-
|
|
17613
|
-
|
|
17614
|
-
|
|
17615
|
-
label: "Please login to DigiLocker first to fetch documents."
|
|
17616
|
-
});
|
|
17617
|
-
return;
|
|
17618
|
-
}
|
|
17619
|
-
let TokenReq = {
|
|
17620
|
-
authToken: digiLockerToken
|
|
17621
|
-
};
|
|
17622
|
-
const tenantId = Digit.ULBService.getCurrentTenantId() || "dl.djb";
|
|
17623
|
-
return Promise.resolve(Digit.DigiLockerService.issueDoc({
|
|
17624
|
-
TokenReq
|
|
17625
|
-
}, tenantId)).then(function (res1) {
|
|
17626
|
-
if (!res1 || !res1.IssuedDoc) {
|
|
17627
|
-
setShowToast({
|
|
17628
|
-
error: true,
|
|
17629
|
-
label: "Failed to fetch documents from DigiLocker. Please login again."
|
|
17630
|
-
});
|
|
17631
|
-
return;
|
|
17632
|
-
}
|
|
17633
|
-
let doctype = "DRVLC";
|
|
17634
|
-
if (props !== null && props !== void 0 && props.documentType) {
|
|
17635
|
-
const code = props.documentType.toUpperCase();
|
|
17636
|
-
if (code.includes("AADHAAR") || code.includes("AADHAR")) doctype = "ADHAR";else if (code.includes("DRIVING") || code.includes("DRVLC")) doctype = "DRVLC";else if (code.includes("PAN")) doctype = "PANCR";else if (code.includes("VOTER")) doctype = "VOTER";
|
|
17637
|
-
}
|
|
17638
|
-
const DOCTYPE_ALIASES = {
|
|
17639
|
-
ADHAR: ["ADHAR", "AADHAAR", "AADHAR"],
|
|
17640
|
-
DRVLC: ["DRVLC", "DRIVING"],
|
|
17641
|
-
PANCR: ["PANCR", "PANCH", "PAN"],
|
|
17642
|
-
VOTER: ["VOTER", "VOTERID"]
|
|
17661
|
+
function _temp13(_result) {
|
|
17662
|
+
if (_exit) return _result;
|
|
17663
|
+
let TokenReq = {
|
|
17664
|
+
authToken: digiLockerToken
|
|
17643
17665
|
};
|
|
17644
|
-
const
|
|
17645
|
-
|
|
17646
|
-
|
|
17647
|
-
|
|
17648
|
-
|
|
17649
|
-
|
|
17650
|
-
|
|
17651
|
-
|
|
17652
|
-
|
|
17653
|
-
|
|
17654
|
-
|
|
17655
|
-
|
|
17656
|
-
|
|
17657
|
-
|
|
17658
|
-
|
|
17659
|
-
|
|
17660
|
-
|
|
17661
|
-
|
|
17662
|
-
|
|
17663
|
-
|
|
17664
|
-
|
|
17665
|
-
|
|
17666
|
-
|
|
17667
|
-
|
|
17668
|
-
|
|
17669
|
-
|
|
17670
|
-
|
|
17671
|
-
|
|
17672
|
-
|
|
17673
|
-
|
|
17674
|
-
|
|
17675
|
-
|
|
17676
|
-
|
|
17677
|
-
|
|
17678
|
-
|
|
17679
|
-
|
|
17680
|
-
|
|
17681
|
-
|
|
17682
|
-
|
|
17683
|
-
|
|
17684
|
-
|
|
17685
|
-
|
|
17686
|
-
|
|
17687
|
-
|
|
17688
|
-
|
|
17689
|
-
|
|
17690
|
-
|
|
17666
|
+
const tenantId = Digit.ULBService.getCurrentTenantId() || "dl.djb";
|
|
17667
|
+
return Promise.resolve(Digit.DigiLockerService.issueDoc({
|
|
17668
|
+
TokenReq
|
|
17669
|
+
}, tenantId)).then(function (res1) {
|
|
17670
|
+
if (!res1 || !res1.IssuedDoc) {
|
|
17671
|
+
setShowToast({
|
|
17672
|
+
error: true,
|
|
17673
|
+
label: "Failed to fetch documents from DigiLocker. Please login again."
|
|
17674
|
+
});
|
|
17675
|
+
return;
|
|
17676
|
+
}
|
|
17677
|
+
let doctype = "DRVLC";
|
|
17678
|
+
if (props !== null && props !== void 0 && props.documentType) {
|
|
17679
|
+
const code = props.documentType.toUpperCase();
|
|
17680
|
+
if (code.includes("AADHAAR") || code.includes("AADHAR")) doctype = "ADHAR";else if (code.includes("DRIVING") || code.includes("DRVLC")) doctype = "DRVLC";else if (code.includes("PAN")) doctype = "PANCR";else if (code.includes("VOTER")) doctype = "VOTER";
|
|
17681
|
+
}
|
|
17682
|
+
const DOCTYPE_ALIASES = {
|
|
17683
|
+
ADHAR: ["ADHAR", "AADHAAR", "AADHAR"],
|
|
17684
|
+
DRVLC: ["DRVLC", "DRIVING"],
|
|
17685
|
+
PANCR: ["PANCR", "PANCH", "PAN"],
|
|
17686
|
+
VOTER: ["VOTER", "VOTERID"]
|
|
17687
|
+
};
|
|
17688
|
+
const aliases = DOCTYPE_ALIASES[doctype] || [doctype];
|
|
17689
|
+
let uri = res1.IssuedDoc.filter(item => aliases.some(alias => item.doctype === alias));
|
|
17690
|
+
const _temp11 = function () {
|
|
17691
|
+
if ((uri === null || uri === void 0 ? void 0 : uri.length) > 0) {
|
|
17692
|
+
const uriStr = uri[0].uri || "";
|
|
17693
|
+
const parts = uriStr.split("-");
|
|
17694
|
+
const documentNumber = parts.length > 1 ? parts[parts.length - 1] : "";
|
|
17695
|
+
if (documentNumber && props !== null && props !== void 0 && props.onDocumentNumber) {
|
|
17696
|
+
props.onDocumentNumber(documentNumber);
|
|
17697
|
+
}
|
|
17698
|
+
let TokenReqNew = {
|
|
17699
|
+
authToken: digiLockerToken,
|
|
17700
|
+
id: uriStr
|
|
17701
|
+
};
|
|
17702
|
+
const tenantId = Digit.ULBService.getCurrentTenantId() || "dl.djb";
|
|
17703
|
+
return Promise.resolve(Digit.DigiLockerService.uriFile({
|
|
17704
|
+
TokenReq: TokenReqNew
|
|
17705
|
+
}, tenantId)).then(function (res2) {
|
|
17706
|
+
var _res2$headers;
|
|
17707
|
+
console.log("[DigiLocker] uriFile response:", res2);
|
|
17708
|
+
let blobData = null;
|
|
17709
|
+
let contentType = (res2 === null || res2 === void 0 ? void 0 : (_res2$headers = res2.headers) === null || _res2$headers === void 0 ? void 0 : _res2$headers["content-type"]) || "";
|
|
17710
|
+
let isJsonString = contentType.includes("application/json");
|
|
17711
|
+
const _temp10 = function () {
|
|
17712
|
+
if (res2 !== null && res2 !== void 0 && res2.data) {
|
|
17713
|
+
function _temp1() {
|
|
17714
|
+
const filename = doctype + "_" + (uri[0].name || "document") + ".pdf";
|
|
17715
|
+
if (blobData && blobData.size > 0) convertToFile(e, blobData, filename);else setShowToast({
|
|
17716
|
+
error: true,
|
|
17717
|
+
label: "Failed to read document from DigiLocker."
|
|
17718
|
+
});
|
|
17719
|
+
}
|
|
17720
|
+
const _temp0 = function () {
|
|
17721
|
+
if (res2 !== null && res2 !== void 0 && res2.data) {
|
|
17722
|
+
const rawBytes = new Uint8Array(res2.data);
|
|
17723
|
+
const _temp9 = function () {
|
|
17724
|
+
if (rawBytes.length > 5 && rawBytes[0] === 0x22 && rawBytes[1] === 0x25 && rawBytes[2] === 0x50 && rawBytes[3] === 0x44 && rawBytes[4] === 0x46) {
|
|
17725
|
+
console.log("[DigiLocker] Response is a JSON-encoded binary PDF string. Unescaping bytes...");
|
|
17726
|
+
const unescaped = new Uint8Array(rawBytes.length);
|
|
17727
|
+
let outIdx = 0;
|
|
17728
|
+
for (let i = 1; i < rawBytes.length - 1; i++) {
|
|
17729
|
+
if (rawBytes[i] === 0x5c) {
|
|
17730
|
+
i++;
|
|
17731
|
+
const next = rawBytes[i];
|
|
17732
|
+
if (next === 0x6e) unescaped[outIdx++] = 0x0a;else if (next === 0x72) unescaped[outIdx++] = 0x0d;else if (next === 0x74) unescaped[outIdx++] = 0x09;else if (next === 0x22) unescaped[outIdx++] = 0x22;else if (next === 0x5c) unescaped[outIdx++] = 0x5c;else if (next === 0x62) unescaped[outIdx++] = 0x08;else if (next === 0x66) unescaped[outIdx++] = 0x0c;else unescaped[outIdx++] = next;
|
|
17733
|
+
} else {
|
|
17734
|
+
unescaped[outIdx++] = rawBytes[i];
|
|
17735
|
+
}
|
|
17691
17736
|
}
|
|
17692
|
-
|
|
17693
|
-
|
|
17694
|
-
|
|
17695
|
-
}
|
|
17696
|
-
|
|
17697
|
-
|
|
17698
|
-
|
|
17699
|
-
|
|
17700
|
-
|
|
17701
|
-
|
|
17702
|
-
}
|
|
17703
|
-
|
|
17704
|
-
|
|
17705
|
-
|
|
17706
|
-
|
|
17707
|
-
|
|
17708
|
-
|
|
17709
|
-
|
|
17710
|
-
|
|
17711
|
-
|
|
17712
|
-
|
|
17713
|
-
|
|
17714
|
-
|
|
17715
|
-
|
|
17716
|
-
|
|
17717
|
-
|
|
17718
|
-
}
|
|
17719
|
-
|
|
17720
|
-
|
|
17721
|
-
|
|
17722
|
-
|
|
17723
|
-
|
|
17724
|
-
|
|
17725
|
-
|
|
17726
|
-
|
|
17727
|
-
|
|
17728
|
-
}
|
|
17729
|
-
|
|
17730
|
-
|
|
17731
|
-
|
|
17732
|
-
|
|
17733
|
-
|
|
17734
|
-
|
|
17735
|
-
|
|
17736
|
-
|
|
17737
|
-
|
|
17738
|
-
|
|
17739
|
-
|
|
17740
|
-
|
|
17741
|
-
|
|
17742
|
-
|
|
17743
|
-
|
|
17744
|
-
|
|
17745
|
-
|
|
17746
|
-
|
|
17747
|
-
|
|
17748
|
-
|
|
17749
|
-
|
|
17750
|
-
|
|
17751
|
-
|
|
17752
|
-
|
|
17753
|
-
|
|
17754
|
-
|
|
17755
|
-
|
|
17756
|
-
|
|
17757
|
-
|
|
17737
|
+
blobData = new Blob([unescaped.slice(0, outIdx)], {
|
|
17738
|
+
type: "application/pdf"
|
|
17739
|
+
});
|
|
17740
|
+
} else {
|
|
17741
|
+
const _temp8 = function () {
|
|
17742
|
+
if (rawBytes.length > 4 && rawBytes[0] === 0x25 && rawBytes[1] === 0x50 && rawBytes[2] === 0x44 && rawBytes[3] === 0x46) {
|
|
17743
|
+
console.log("[DigiLocker] Response is a raw binary PDF.");
|
|
17744
|
+
blobData = new Blob([res2.data], {
|
|
17745
|
+
type: "application/pdf"
|
|
17746
|
+
});
|
|
17747
|
+
} else {
|
|
17748
|
+
const decoder = new TextDecoder("utf-8");
|
|
17749
|
+
const textStr = decoder.decode(res2.data);
|
|
17750
|
+
let parsedJson = null;
|
|
17751
|
+
try {
|
|
17752
|
+
parsedJson = JSON.parse(textStr);
|
|
17753
|
+
} catch (e) {}
|
|
17754
|
+
const _temp7 = function () {
|
|
17755
|
+
if (parsedJson) {
|
|
17756
|
+
const _temp6 = function () {
|
|
17757
|
+
if (Array.isArray(parsedJson)) {
|
|
17758
|
+
console.log("[DigiLocker] Response is a JSON array of bytes.");
|
|
17759
|
+
const arr = new Uint8Array(parsedJson);
|
|
17760
|
+
blobData = new Blob([arr], {
|
|
17761
|
+
type: "application/pdf"
|
|
17762
|
+
});
|
|
17763
|
+
} else {
|
|
17764
|
+
const _temp5 = function () {
|
|
17765
|
+
if (typeof parsedJson === "string") {
|
|
17766
|
+
console.log("[DigiLocker] Response is a base64 string in JSON.");
|
|
17767
|
+
const dataUri = parsedJson.startsWith("data:") ? parsedJson : "data:application/pdf;base64," + parsedJson;
|
|
17768
|
+
try {
|
|
17769
|
+
blobData = dataURItoBlob(dataUri);
|
|
17770
|
+
} catch (e) {
|
|
17771
|
+
console.error("Failed to parse JSON string as base64", e);
|
|
17772
|
+
}
|
|
17773
|
+
} else {
|
|
17774
|
+
const _temp4 = function () {
|
|
17775
|
+
if (typeof parsedJson === "object") {
|
|
17776
|
+
const findFileStoreId = obj => {
|
|
17777
|
+
if (!obj || typeof obj !== "object") return null;
|
|
17778
|
+
for (let key in obj) {
|
|
17779
|
+
if (key.toLowerCase() === "filestoreid") return obj[key];
|
|
17780
|
+
const found = findFileStoreId(obj[key]);
|
|
17781
|
+
if (found) return found;
|
|
17782
|
+
}
|
|
17783
|
+
return null;
|
|
17784
|
+
};
|
|
17785
|
+
const findBase64 = obj => {
|
|
17786
|
+
if (!obj || typeof obj !== "object") return null;
|
|
17787
|
+
for (let key in obj) {
|
|
17788
|
+
if (["doccontent", "filecontent", "base64"].includes(key.toLowerCase())) return obj[key];
|
|
17789
|
+
const found = findBase64(obj[key]);
|
|
17790
|
+
if (found && typeof found === "string") return found;
|
|
17791
|
+
}
|
|
17792
|
+
return null;
|
|
17793
|
+
};
|
|
17794
|
+
const fsId = findFileStoreId(parsedJson);
|
|
17795
|
+
const _temp3 = function () {
|
|
17796
|
+
if (fsId) {
|
|
17797
|
+
console.log("[DigiLocker] Got fileStoreId from JSON:", fsId);
|
|
17798
|
+
return Promise.resolve(Digit.UploadServices.FileFetchbyid(fsId, Digit.ULBService.getStateId())).then(function (fileRes) {
|
|
17799
|
+
var _fileRes$headers;
|
|
17800
|
+
blobData = (fileRes === null || fileRes === void 0 ? void 0 : fileRes.data) instanceof Blob ? fileRes.data : new Blob([(fileRes === null || fileRes === void 0 ? void 0 : fileRes.data) || ""], {
|
|
17801
|
+
type: (fileRes === null || fileRes === void 0 ? void 0 : (_fileRes$headers = fileRes.headers) === null || _fileRes$headers === void 0 ? void 0 : _fileRes$headers["content-type"]) || "application/pdf"
|
|
17802
|
+
});
|
|
17758
17803
|
});
|
|
17759
|
-
});
|
|
17760
|
-
} else {
|
|
17761
|
-
const b64 = findBase64(parsedJson);
|
|
17762
|
-
if (b64 && typeof b64 === "string") {
|
|
17763
|
-
console.log("[DigiLocker] Got base64 content from JSON field");
|
|
17764
|
-
const dataUri = b64.startsWith("data:") ? b64 : "data:application/pdf;base64," + b64;
|
|
17765
|
-
blobData = dataURItoBlob(dataUri);
|
|
17766
17804
|
} else {
|
|
17767
|
-
|
|
17805
|
+
const b64 = findBase64(parsedJson);
|
|
17806
|
+
if (b64 && typeof b64 === "string") {
|
|
17807
|
+
console.log("[DigiLocker] Got base64 content from JSON field");
|
|
17808
|
+
const dataUri = b64.startsWith("data:") ? b64 : "data:application/pdf;base64," + b64;
|
|
17809
|
+
blobData = dataURItoBlob(dataUri);
|
|
17810
|
+
} else {
|
|
17811
|
+
console.log("[DigiLocker] JSON did not contain filestoreid or base64.");
|
|
17812
|
+
}
|
|
17768
17813
|
}
|
|
17769
|
-
}
|
|
17770
|
-
|
|
17771
|
-
|
|
17772
|
-
}
|
|
17773
|
-
|
|
17774
|
-
|
|
17775
|
-
}
|
|
17776
|
-
|
|
17777
|
-
|
|
17778
|
-
}
|
|
17779
|
-
|
|
17780
|
-
if (_temp4 && _temp4.then) return _temp4.then(function () {});
|
|
17781
|
-
} else {
|
|
17782
|
-
if (textStr.startsWith("JVBERi0x")) {
|
|
17783
|
-
console.log("[DigiLocker] Response is a raw base64 string.");
|
|
17784
|
-
try {
|
|
17785
|
-
blobData = dataURItoBlob("data:application/pdf;base64," + textStr);
|
|
17786
|
-
} catch (e) {
|
|
17787
|
-
console.error("Failed to parse raw text as base64", e);
|
|
17788
|
-
}
|
|
17814
|
+
}();
|
|
17815
|
+
if (_temp3 && _temp3.then) return _temp3.then(function () {});
|
|
17816
|
+
}
|
|
17817
|
+
}();
|
|
17818
|
+
if (_temp4 && _temp4.then) return _temp4.then(function () {});
|
|
17819
|
+
}
|
|
17820
|
+
}();
|
|
17821
|
+
if (_temp5 && _temp5.then) return _temp5.then(function () {});
|
|
17822
|
+
}
|
|
17823
|
+
}();
|
|
17824
|
+
if (_temp6 && _temp6.then) return _temp6.then(function () {});
|
|
17789
17825
|
} else {
|
|
17790
|
-
|
|
17791
|
-
|
|
17792
|
-
|
|
17793
|
-
|
|
17826
|
+
if (textStr.startsWith("JVBERi0x")) {
|
|
17827
|
+
console.log("[DigiLocker] Response is a raw base64 string.");
|
|
17828
|
+
try {
|
|
17829
|
+
blobData = dataURItoBlob("data:application/pdf;base64," + textStr);
|
|
17830
|
+
} catch (e) {
|
|
17831
|
+
console.error("Failed to parse raw text as base64", e);
|
|
17832
|
+
}
|
|
17833
|
+
} else {
|
|
17834
|
+
console.log("[DigiLocker] Response is unknown format, attempting binary PDF fallback.");
|
|
17835
|
+
blobData = new Blob([res2.data], {
|
|
17836
|
+
type: "application/pdf"
|
|
17837
|
+
});
|
|
17838
|
+
}
|
|
17794
17839
|
}
|
|
17795
|
-
}
|
|
17796
|
-
|
|
17797
|
-
|
|
17798
|
-
}
|
|
17799
|
-
|
|
17800
|
-
|
|
17801
|
-
}
|
|
17802
|
-
|
|
17803
|
-
|
|
17804
|
-
}
|
|
17805
|
-
|
|
17806
|
-
|
|
17807
|
-
|
|
17808
|
-
|
|
17809
|
-
|
|
17810
|
-
|
|
17811
|
-
}
|
|
17812
|
-
}
|
|
17813
|
-
|
|
17814
|
-
|
|
17815
|
-
}
|
|
17840
|
+
}();
|
|
17841
|
+
if (_temp7 && _temp7.then) return _temp7.then(function () {});
|
|
17842
|
+
}
|
|
17843
|
+
}();
|
|
17844
|
+
if (_temp8 && _temp8.then) return _temp8.then(function () {});
|
|
17845
|
+
}
|
|
17846
|
+
}();
|
|
17847
|
+
if (_temp9 && _temp9.then) return _temp9.then(function () {});
|
|
17848
|
+
}
|
|
17849
|
+
}();
|
|
17850
|
+
return _temp0 && _temp0.then ? _temp0.then(_temp1) : _temp1(_temp0);
|
|
17851
|
+
} else {
|
|
17852
|
+
setShowToast({
|
|
17853
|
+
error: true,
|
|
17854
|
+
label: "Selected document (" + ((props === null || props === void 0 ? void 0 : props.documentType) || doctype) + ") is not available in your DigiLocker."
|
|
17855
|
+
});
|
|
17856
|
+
}
|
|
17857
|
+
}();
|
|
17858
|
+
if (_temp10 && _temp10.then) return _temp10.then(function () {});
|
|
17859
|
+
});
|
|
17860
|
+
}
|
|
17861
|
+
}();
|
|
17862
|
+
if (_temp11 && _temp11.then) return _temp11.then(function () {});
|
|
17863
|
+
});
|
|
17864
|
+
}
|
|
17865
|
+
const digiLockerToken = sessionStorage.getItem("DigiLocker.token1");
|
|
17866
|
+
const _temp12 = function () {
|
|
17867
|
+
if (!digiLockerToken) {
|
|
17868
|
+
function _temp2() {
|
|
17869
|
+
_exit = true;
|
|
17816
17870
|
}
|
|
17817
|
-
|
|
17818
|
-
|
|
17819
|
-
|
|
17871
|
+
const _temp = _catch$1(function () {
|
|
17872
|
+
const tenantId = Digit.ULBService.getCurrentTenantId() || "dl.djb";
|
|
17873
|
+
return Promise.resolve(Digit.DigiLockerService.authorization({
|
|
17874
|
+
module: "WS",
|
|
17875
|
+
tenantId
|
|
17876
|
+
})).then(function (data) {
|
|
17877
|
+
const redirectUrl = (data === null || data === void 0 ? void 0 : data.redirectURL) || (data === null || data === void 0 ? void 0 : data.redirectUrl);
|
|
17878
|
+
const verifier = (data === null || data === void 0 ? void 0 : data.dlReqRef) || (data === null || data === void 0 ? void 0 : data.codeverifier) || (data === null || data === void 0 ? void 0 : data.codeVerifier) || (data === null || data === void 0 ? void 0 : data.code_verifier);
|
|
17879
|
+
if (verifier) {
|
|
17880
|
+
sessionStorage.setItem("code_verfier_register", verifier);
|
|
17881
|
+
}
|
|
17882
|
+
if (redirectUrl) {
|
|
17883
|
+
window.location.href = redirectUrl;
|
|
17884
|
+
} else {
|
|
17885
|
+
setShowToast({
|
|
17886
|
+
error: true,
|
|
17887
|
+
label: "No redirect URL returned from DigiLocker API."
|
|
17888
|
+
});
|
|
17889
|
+
}
|
|
17890
|
+
});
|
|
17891
|
+
}, function () {
|
|
17892
|
+
setShowToast({
|
|
17893
|
+
error: true,
|
|
17894
|
+
label: "Error fetching DigiLocker authorization URL."
|
|
17895
|
+
});
|
|
17896
|
+
});
|
|
17897
|
+
return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
|
|
17898
|
+
}
|
|
17899
|
+
}();
|
|
17900
|
+
return _temp12 && _temp12.then ? _temp12.then(_temp13) : _temp13(_temp12);
|
|
17820
17901
|
}, function (error) {
|
|
17821
17902
|
console.error("DigiLocker Fetch Error:", error);
|
|
17822
17903
|
setShowToast({
|
|
@@ -23375,7 +23456,11 @@ const WSDjbEmployee = _ref => {
|
|
|
23375
23456
|
const FormContent = /*#__PURE__*/React__default.createElement(digitUiReactComponents.CollapsibleCardPage, {
|
|
23376
23457
|
title: t("WS_DJB_EMPLOYEE"),
|
|
23377
23458
|
defaultOpen: true
|
|
23378
|
-
}, /*#__PURE__*/React__default.createElement("div",
|
|
23459
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
23460
|
+
style: {
|
|
23461
|
+
width: "max-content"
|
|
23462
|
+
}
|
|
23463
|
+
}, /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
23379
23464
|
control: control,
|
|
23380
23465
|
name: "isDjbEmployee",
|
|
23381
23466
|
render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.CheckBox, {
|
|
@@ -32339,31 +32424,31 @@ const checkForNA$1 = value => {
|
|
|
32339
32424
|
return value ? value : "CS_NA";
|
|
32340
32425
|
};
|
|
32341
32426
|
const WSApplicationDetails = () => {
|
|
32342
|
-
var _user$info, _user$info$userName, _user$info2, _user$info3, _Digit$SessionStorage, _user$info4, _data$WaterConnection, _data$WaterConnection2, _data$SewerageConnect, _data$SewerageConnect2, _data$WaterConnection3, _data$WaterConnection4, _data$SewerageConnect3, _data$SewerageConnect4, _data$WaterConnection5, _data$WaterConnection6, _data$WaterConnection7, _data$SewerageConnect5, _data$SewerageConnect6, _data$SewerageConnect7, _data$WaterConnection8, _data$WaterConnection9, _data$SewerageConnect8, _data$SewerageConnect9, _data$WaterConnection0, _data$WaterConnection1, _data$SewerageConnect0, _data$SewerageConnect1, _data$WaterConnection10, _data$WaterConnection11, _data$SewerageConnect10, _data$SewerageConnect11, _data$WaterConnection12, _data$SewerageConnect12, _PTData$Properties, _PTData$Properties$, _data$WaterConnection13, _data$WaterConnection14, _data$WaterConnection15, _data$WaterConnection16, _data$SewerageConnect13, _data$SewerageConnect14, _data$SewerageConnect15, _data$SewerageConnect16, _data$WaterConnection17, _data$WaterConnection18, _data$SewerageConnect17, _data$SewerageConnect18, _appDetailsData$appli, _data$WaterConnection37, _data$WaterConnection38, _data$SewerageConnect33, _data$SewerageConnect34, _data$WaterConnection39, _data$WaterConnection40, _data$SewerageConnect35, _data$SewerageConnect36, _data$WaterConnection41, _data$WaterConnection42, _data$SewerageConnect37, _data$SewerageConnect38, _data$WaterConnection43, _data$WaterConnection44, _data$SewerageConnect39, _data$SewerageConnect40, _data$WaterConnection45, _data$WaterConnection46, _data$SewerageConnect41, _data$WaterConnection47, _data$WaterConnection48, _data$SewerageConnect42, _data$SewerageConnect43, _data$WaterConnection49, _data$WaterConnection50, _data$SewerageConnect44, _data$SewerageConnect45, _data$WaterConnection51, _data$WaterConnection52, _data$SewerageConnect46, _data$SewerageConnect47, _data$WaterConnection53, _data$WaterConnection54, _data$SewerageConnect48, _data$SewerageConnect49, _data$WaterConnection55, _data$WaterConnection56, _data$SewerageConnect50, _data$SewerageConnect51, _data$WaterConnection57, _data$WaterConnection58, _data$SewerageConnect52, _data$SewerageConnect53, _data$WaterConnection59, _data$WaterConnection60, _data$SewerageConnect54, _data$SewerageConnect55, _data$WaterConnection61, _data$WaterConnection62, _data$SewerageConnect56, _data$SewerageConnect57, _data$WaterConnection63, _data$WaterConnection64, _data$SewerageConnect58, _data$SewerageConnect59, _data$WaterConnection65, _data$WaterConnection66, _data$SewerageConnect60, _data$SewerageConnect61, _data$WaterConnection67, _data$WaterConnection68, _data$WaterConnection69, _data$WaterConnection70, _data$SewerageConnect62, _data$SewerageConnect63, _data$SewerageConnect64, _data$SewerageConnect65, _connectionDetails$se, _connectionDetails$se2, _connectionDetails$co, _connectionDetails$co2, _connectionDetails$wa, _connectionDetails$wa2, _connectionDetails$ap, _connectionDetails$ap2, _connectionDetails$do, _connectionDetails$do2, _connectionDetails$do3, _connectionDetails$de, _connectionDetails$de2, _data$WaterConnection71, _data$WaterConnection72, _data$WaterConnection73, _data$SewerageConnect66, _data$SewerageConnect67, _data$SewerageConnect68, _data$WaterConnection74, _data$WaterConnection75, _data$WaterConnection76, _data$WaterConnection77, _data$SewerageConnect69, _data$SewerageConnect70, _data$SewerageConnect71, _data$SewerageConnect72, _data$WaterConnection78, _data$WaterConnection79, _data$WaterConnection80, _data$WaterConnection81, _data$SewerageConnect73, _data$SewerageConnect74, _data$SewerageConnect75, _data$SewerageConnect76, _data$WaterConnection82, _data$WaterConnection83, _data$WaterConnection84, _data$WaterConnection85, _data$SewerageConnect77, _data$SewerageConnect78, _data$SewerageConnect79, _data$SewerageConnect80, _data$WaterConnection86, _data$WaterConnection87, _data$WaterConnection88, _data$WaterConnection89, _data$SewerageConnect81, _data$SewerageConnect82, _data$SewerageConnect83, _data$SewerageConnect84, _data$WaterConnection90, _data$WaterConnection91, _data$WaterConnection92, _data$WaterConnection93, _data$SewerageConnect85, _data$SewerageConnect86, _data$SewerageConnect87, _data$SewerageConnect88, _data$WaterConnection94, _data$WaterConnection95, _data$WaterConnection96, _data$WaterConnection97, _data$SewerageConnect89, _data$SewerageConnect90, _data$SewerageConnect91, _data$SewerageConnect92, _data$WaterConnection98, _data$WaterConnection99, _data$WaterConnection100, _data$WaterConnection101, _data$SewerageConnect93, _data$SewerageConnect94, _data$SewerageConnect95, _data$SewerageConnect96, _data$WaterConnection102, _data$WaterConnection103, _data$WaterConnection104, _data$WaterConnection105, _data$SewerageConnect97, _data$SewerageConnect98, _data$SewerageConnect99, _data$SewerageConnect100, _data$WaterConnection106, _data$WaterConnection107, _data$WaterConnection108, _data$WaterConnection109, _data$SewerageConnect101, _data$SewerageConnect102, _data$SewerageConnect103, _data$SewerageConnect104, _data$WaterConnection110, _data$WaterConnection111, _data$WaterConnection112, _data$WaterConnection113, _data$SewerageConnect105, _data$SewerageConnect106, _data$SewerageConnect107, _data$SewerageConnect108, _data$WaterConnection114, _data$WaterConnection115, _data$WaterConnection116, _data$WaterConnection117, _data$SewerageConnect109, _data$SewerageConnect110, _data$SewerageConnect111, _data$SewerageConnect112, _data$WaterConnection118, _data$WaterConnection119, _data$WaterConnection120, _data$WaterConnection121, _data$SewerageConnect113, _data$SewerageConnect114, _data$SewerageConnect115, _data$SewerageConnect116, _data$WaterConnection122, _data$WaterConnection123, _data$WaterConnection124, _data$WaterConnection125, _data$SewerageConnect117, _data$SewerageConnect118, _data$SewerageConnect119, _data$SewerageConnect120, _data$WaterConnection126, _data$WaterConnection127, _data$SewerageConnect121, _data$SewerageConnect122, _PTData$Properties4, _PTData$Properties4$, _PTData$Properties4$$, _PTData$Properties4$$2, _PTData$Properties5, _PTData$Properties5$, _PTData$Properties6, _PTData$Properties6$, _PTData$Properties6$$, _PTData$Properties6$$2, _PTData$Properties7, _PTData$Properties7$, _data$WaterConnection128, _data$WaterConnection129, _data$SewerageConnect123, _data$SewerageConnect124, _data$WaterConnection130, _data$WaterConnection131, _data$SewerageConnect125, _data$SewerageConnect126, _propertyAddress$city, _propertyAddress$city2, _propertyAddress$loca, _propertyAddress$loca2, _propertyAddress$subL, _propertyAddress$subL2, _propertyAddress$asse, _propertyAddress$asse2, _propertyAddress$bloc, _propertyAddress$bloc2, _propertyAddress$ward, _propertyAddress$ward2, _propertyAddress$zone, _propertyAddress$zone2, _propertyAddress$zone3, _propertyAddress$zone4, _useDetails$categoryT, _useDetails$categoryT2, _useDetails$propertyC, _useDetails$propertyC2, _useDetails$propertyT, _useDetails$propertyT2, _useDetails$WaterConn, _useDetails$WaterConn2, _useDetails$waterConn, _useDetails$waterConn2, _useDetails$noOfFloor, _useDetails$noOfFloor2, _useDetails$SelectYea, _useDetails$SelectYea2, _useDetails$SelectYea3, _useDetails$construct, _useDetails$construct2, _data$WaterConnection132, _data$WaterConnection133, _data$WaterConnection134, _data$WaterConnection135, _data$SewerageConnect127, _data$SewerageConnect128, _data$SewerageConnect129, _data$SewerageConnect130, _data$WaterConnection140, _data$WaterConnection141, _data$WaterConnection142, _data$WaterConnection143, _data$
|
|
32427
|
+
var _user$info, _user$info$userName, _user$info2, _user$info3, _Digit$SessionStorage, _user$info4, _data$WaterConnection, _data$WaterConnection2, _data$SewerageConnect, _data$SewerageConnect2, _data$WaterConnection3, _data$WaterConnection4, _data$SewerageConnect3, _data$SewerageConnect4, _data$WaterConnection5, _data$WaterConnection6, _data$WaterConnection7, _data$SewerageConnect5, _data$SewerageConnect6, _data$SewerageConnect7, _data$WaterConnection8, _data$WaterConnection9, _data$SewerageConnect8, _data$SewerageConnect9, _data$WaterConnection0, _data$WaterConnection1, _data$SewerageConnect0, _data$SewerageConnect1, _data$WaterConnection10, _data$WaterConnection11, _data$SewerageConnect10, _data$SewerageConnect11, _data$WaterConnection12, _data$SewerageConnect12, _PTData$Properties, _PTData$Properties$, _data$WaterConnection13, _data$WaterConnection14, _data$WaterConnection15, _data$WaterConnection16, _data$SewerageConnect13, _data$SewerageConnect14, _data$SewerageConnect15, _data$SewerageConnect16, _data$WaterConnection17, _data$WaterConnection18, _data$SewerageConnect17, _data$SewerageConnect18, _appDetailsData$appli, _data$WaterConnection37, _data$WaterConnection38, _data$SewerageConnect33, _data$SewerageConnect34, _data$WaterConnection39, _data$WaterConnection40, _data$SewerageConnect35, _data$SewerageConnect36, _data$WaterConnection41, _data$WaterConnection42, _data$SewerageConnect37, _data$SewerageConnect38, _data$WaterConnection43, _data$WaterConnection44, _data$SewerageConnect39, _data$SewerageConnect40, _data$WaterConnection45, _data$WaterConnection46, _data$SewerageConnect41, _data$WaterConnection47, _data$WaterConnection48, _data$SewerageConnect42, _data$SewerageConnect43, _data$WaterConnection49, _data$WaterConnection50, _data$SewerageConnect44, _data$SewerageConnect45, _data$WaterConnection51, _data$WaterConnection52, _data$SewerageConnect46, _data$SewerageConnect47, _data$WaterConnection53, _data$WaterConnection54, _data$SewerageConnect48, _data$SewerageConnect49, _data$WaterConnection55, _data$WaterConnection56, _data$SewerageConnect50, _data$SewerageConnect51, _data$WaterConnection57, _data$WaterConnection58, _data$SewerageConnect52, _data$SewerageConnect53, _data$WaterConnection59, _data$WaterConnection60, _data$SewerageConnect54, _data$SewerageConnect55, _data$WaterConnection61, _data$WaterConnection62, _data$SewerageConnect56, _data$SewerageConnect57, _data$WaterConnection63, _data$WaterConnection64, _data$SewerageConnect58, _data$SewerageConnect59, _data$WaterConnection65, _data$WaterConnection66, _data$SewerageConnect60, _data$SewerageConnect61, _data$WaterConnection67, _data$WaterConnection68, _data$WaterConnection69, _data$WaterConnection70, _data$SewerageConnect62, _data$SewerageConnect63, _data$SewerageConnect64, _data$SewerageConnect65, _connectionDetails$se, _connectionDetails$se2, _connectionDetails$co, _connectionDetails$co2, _connectionDetails$wa, _connectionDetails$wa2, _connectionDetails$ap, _connectionDetails$ap2, _connectionDetails$do, _connectionDetails$do2, _connectionDetails$do3, _connectionDetails$de, _connectionDetails$de2, _data$WaterConnection71, _data$WaterConnection72, _data$WaterConnection73, _data$SewerageConnect66, _data$SewerageConnect67, _data$SewerageConnect68, _data$WaterConnection74, _data$WaterConnection75, _data$WaterConnection76, _data$WaterConnection77, _data$SewerageConnect69, _data$SewerageConnect70, _data$SewerageConnect71, _data$SewerageConnect72, _data$WaterConnection78, _data$WaterConnection79, _data$WaterConnection80, _data$WaterConnection81, _data$SewerageConnect73, _data$SewerageConnect74, _data$SewerageConnect75, _data$SewerageConnect76, _data$WaterConnection82, _data$WaterConnection83, _data$WaterConnection84, _data$WaterConnection85, _data$SewerageConnect77, _data$SewerageConnect78, _data$SewerageConnect79, _data$SewerageConnect80, _data$WaterConnection86, _data$WaterConnection87, _data$WaterConnection88, _data$WaterConnection89, _data$SewerageConnect81, _data$SewerageConnect82, _data$SewerageConnect83, _data$SewerageConnect84, _data$WaterConnection90, _data$WaterConnection91, _data$WaterConnection92, _data$WaterConnection93, _data$SewerageConnect85, _data$SewerageConnect86, _data$SewerageConnect87, _data$SewerageConnect88, _data$WaterConnection94, _data$WaterConnection95, _data$WaterConnection96, _data$WaterConnection97, _data$SewerageConnect89, _data$SewerageConnect90, _data$SewerageConnect91, _data$SewerageConnect92, _data$WaterConnection98, _data$WaterConnection99, _data$WaterConnection100, _data$WaterConnection101, _data$SewerageConnect93, _data$SewerageConnect94, _data$SewerageConnect95, _data$SewerageConnect96, _data$WaterConnection102, _data$WaterConnection103, _data$WaterConnection104, _data$WaterConnection105, _data$SewerageConnect97, _data$SewerageConnect98, _data$SewerageConnect99, _data$SewerageConnect100, _data$WaterConnection106, _data$WaterConnection107, _data$WaterConnection108, _data$WaterConnection109, _data$SewerageConnect101, _data$SewerageConnect102, _data$SewerageConnect103, _data$SewerageConnect104, _data$WaterConnection110, _data$WaterConnection111, _data$WaterConnection112, _data$WaterConnection113, _data$SewerageConnect105, _data$SewerageConnect106, _data$SewerageConnect107, _data$SewerageConnect108, _data$WaterConnection114, _data$WaterConnection115, _data$WaterConnection116, _data$WaterConnection117, _data$SewerageConnect109, _data$SewerageConnect110, _data$SewerageConnect111, _data$SewerageConnect112, _data$WaterConnection118, _data$WaterConnection119, _data$WaterConnection120, _data$WaterConnection121, _data$SewerageConnect113, _data$SewerageConnect114, _data$SewerageConnect115, _data$SewerageConnect116, _data$WaterConnection122, _data$WaterConnection123, _data$WaterConnection124, _data$WaterConnection125, _data$SewerageConnect117, _data$SewerageConnect118, _data$SewerageConnect119, _data$SewerageConnect120, _data$WaterConnection126, _data$WaterConnection127, _data$SewerageConnect121, _data$SewerageConnect122, _PTData$Properties4, _PTData$Properties4$, _PTData$Properties4$$, _PTData$Properties4$$2, _PTData$Properties5, _PTData$Properties5$, _PTData$Properties6, _PTData$Properties6$, _PTData$Properties6$$, _PTData$Properties6$$2, _PTData$Properties7, _PTData$Properties7$, _data$WaterConnection128, _data$WaterConnection129, _data$SewerageConnect123, _data$SewerageConnect124, _data$WaterConnection130, _data$WaterConnection131, _data$SewerageConnect125, _data$SewerageConnect126, _propertyAddress$city, _propertyAddress$city2, _propertyAddress$loca, _propertyAddress$loca2, _propertyAddress$subL, _propertyAddress$subL2, _propertyAddress$asse, _propertyAddress$asse2, _propertyAddress$bloc, _propertyAddress$bloc2, _propertyAddress$ward, _propertyAddress$ward2, _propertyAddress$zone, _propertyAddress$zone2, _propertyAddress$zone3, _propertyAddress$zone4, _useDetails$categoryT, _useDetails$categoryT2, _useDetails$propertyC, _useDetails$propertyC2, _useDetails$propertyT, _useDetails$propertyT2, _useDetails$WaterConn, _useDetails$WaterConn2, _useDetails$waterConn, _useDetails$waterConn2, _useDetails$noOfFloor, _useDetails$noOfFloor2, _useDetails$SelectYea, _useDetails$SelectYea2, _useDetails$SelectYea3, _useDetails$construct, _useDetails$construct2, _data$WaterConnection132, _data$WaterConnection133, _data$WaterConnection134, _data$WaterConnection135, _data$SewerageConnect127, _data$SewerageConnect128, _data$SewerageConnect129, _data$SewerageConnect130, _data$WaterConnection138, _data$WaterConnection139, _data$WaterConnection140, _data$WaterConnection141, _data$WaterConnection142, _data$WaterConnection143, _data$SewerageConnect133, _data$SewerageConnect134, _data$SewerageConnect135, _data$SewerageConnect136, _data$SewerageConnect137, _data$SewerageConnect138, _paymentDetails$data, _paymentDetails$data$, _paymentDetails$data$2, _paymentDetails$data2, _paymentDetails$data3, _paymentDetails$data4, _data$WaterConnection144, _data$WaterConnection145, _data$SewerageConnect139, _data$SewerageConnect140, _data$WaterConnection146, _data$WaterConnection147, _data$WaterConnection148, _data$SewerageConnect141, _data$SewerageConnect142, _data$SewerageConnect143, _PTData$Properties8, _PTData$Properties8$, _PTData$Properties8$$, _paymentDetails$data5, _paymentDetails$data6, _paymentDetails$data7, _data$WaterConnection149, _data$WaterConnection150, _data$WaterConnection151, _data$WaterConnection152, _data$SewerageConnect144, _data$SewerageConnect145, _data$SewerageConnect146, _data$SewerageConnect147, _data$WaterConnection153, _data$WaterConnection154, _data$SewerageConnect148, _data$SewerageConnect149, _data$WaterConnection155, _data$WaterConnection156, _data$SewerageConnect150, _data$SewerageConnect151, _data$WaterConnection157, _data$WaterConnection158, _data$SewerageConnect152, _data$SewerageConnect153, _data$WaterConnection159, _data$WaterConnection160, _data$WaterConnection161, _data$SewerageConnect154, _data$SewerageConnect155, _data$WaterConnection162, _data$WaterConnection163, _data$SewerageConnect156, _data$SewerageConnect157, _data$WaterConnection164, _data$WaterConnection165, _data$WaterConnection166, _data$WaterConnection167, _data$SewerageConnect158, _data$SewerageConnect159, _data$SewerageConnect160, _data$SewerageConnect161, _data$WaterConnection168, _data$WaterConnection169, _data$SewerageConnect162, _data$SewerageConnect163, _data$SewerageConnect164, _data$SewerageConnect165, _data$SewerageConnect166, _data$SewerageConnect167, _data$SewerageConnect168, _data$SewerageConnect169, _data$SewerageConnect170, _data$SewerageConnect171, _data$SewerageConnect172, _data$WaterConnection170, _data$WaterConnection171, _data$WaterConnection172, _data$WaterConnection173, _data$WaterConnection174, _data$WaterConnection175, _data$WaterConnection176, _data$WaterConnection177, _data$WaterConnection178;
|
|
32343
32428
|
const getDisconnectionNoticeSearch = function () {
|
|
32344
32429
|
try {
|
|
32345
|
-
var _data$
|
|
32430
|
+
var _data$WaterConnection180, _data$WaterConnection181, _data$SewerageConnect174, _data$SewerageConnect175;
|
|
32346
32431
|
let key = "ws-waterdisconnectionnotice";
|
|
32347
32432
|
let details = {};
|
|
32348
32433
|
if (applicationNobyData !== null && applicationNobyData !== void 0 && applicationNobyData.includes("WS")) {
|
|
32349
|
-
var _data$
|
|
32434
|
+
var _data$WaterConnection179, _PTData$Properties9;
|
|
32350
32435
|
details = {
|
|
32351
|
-
WaterConnection: [_extends({}, data === null || data === void 0 ? void 0 : (_data$
|
|
32436
|
+
WaterConnection: [_extends({}, data === null || data === void 0 ? void 0 : (_data$WaterConnection179 = data.WaterConnection) === null || _data$WaterConnection179 === void 0 ? void 0 : _data$WaterConnection179[0], {
|
|
32352
32437
|
property: PTData === null || PTData === void 0 ? void 0 : (_PTData$Properties9 = PTData.Properties) === null || _PTData$Properties9 === void 0 ? void 0 : _PTData$Properties9[0]
|
|
32353
32438
|
})]
|
|
32354
32439
|
};
|
|
32355
32440
|
} else {
|
|
32356
|
-
var _data$
|
|
32441
|
+
var _data$SewerageConnect173, _PTData$Properties0;
|
|
32357
32442
|
key = "ws-seweragedisconnectionnotice";
|
|
32358
32443
|
details = {
|
|
32359
|
-
SewerageConnection: [_extends({}, data === null || data === void 0 ? void 0 : (_data$
|
|
32444
|
+
SewerageConnection: [_extends({}, data === null || data === void 0 ? void 0 : (_data$SewerageConnect173 = data.SewerageConnections) === null || _data$SewerageConnect173 === void 0 ? void 0 : _data$SewerageConnect173[0], {
|
|
32360
32445
|
property: PTData === null || PTData === void 0 ? void 0 : (_PTData$Properties0 = PTData.Properties) === null || _PTData$Properties0 === void 0 ? void 0 : _PTData$Properties0[0]
|
|
32361
32446
|
})]
|
|
32362
32447
|
};
|
|
32363
32448
|
}
|
|
32364
|
-
return Promise.resolve(Digit.WSService.WSDisconnectionNotice((data === null || data === void 0 ? void 0 : (_data$
|
|
32365
|
-
var _data$
|
|
32366
|
-
return Promise.resolve(Digit.PaymentService.printReciept((data === null || data === void 0 ? void 0 : (_data$
|
|
32449
|
+
return Promise.resolve(Digit.WSService.WSDisconnectionNotice((data === null || data === void 0 ? void 0 : (_data$WaterConnection180 = data.WaterConnection) === null || _data$WaterConnection180 === void 0 ? void 0 : (_data$WaterConnection181 = _data$WaterConnection180[0]) === null || _data$WaterConnection181 === void 0 ? void 0 : _data$WaterConnection181.tenantId) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect174 = data.SewerageConnections) === null || _data$SewerageConnect174 === void 0 ? void 0 : (_data$SewerageConnect175 = _data$SewerageConnect174[0]) === null || _data$SewerageConnect175 === void 0 ? void 0 : _data$SewerageConnect175.tenantId), details, key)).then(function (response) {
|
|
32450
|
+
var _data$WaterConnection182, _data$WaterConnection183, _data$SewerageConnect176, _data$SewerageConnect177;
|
|
32451
|
+
return Promise.resolve(Digit.PaymentService.printReciept((data === null || data === void 0 ? void 0 : (_data$WaterConnection182 = data.WaterConnection) === null || _data$WaterConnection182 === void 0 ? void 0 : (_data$WaterConnection183 = _data$WaterConnection182[0]) === null || _data$WaterConnection183 === void 0 ? void 0 : _data$WaterConnection183.tenantId) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect176 = data.SewerageConnections) === null || _data$SewerageConnect176 === void 0 ? void 0 : (_data$SewerageConnect177 = _data$SewerageConnect176[0]) === null || _data$SewerageConnect177 === void 0 ? void 0 : _data$SewerageConnect177.tenantId), {
|
|
32367
32452
|
fileStoreIds: response.filestoreIds[0]
|
|
32368
32453
|
})).then(function (fileStore) {
|
|
32369
32454
|
window.open(fileStore[response === null || response === void 0 ? void 0 : response.filestoreIds[0]], "_blank");
|
|
@@ -33076,15 +33161,22 @@ const WSApplicationDetails = () => {
|
|
|
33076
33161
|
styles: {
|
|
33077
33162
|
fontSize: "28px"
|
|
33078
33163
|
}
|
|
33079
|
-
}, t("WS_COMMON_DOCUMENT_DETAILS")), (data === null || data === void 0 ? void 0 : (_data$WaterConnection132 = data.WaterConnection) === null || _data$WaterConnection132 === void 0 ? void 0 : (_data$WaterConnection133 = _data$WaterConnection132[0]) === null || _data$WaterConnection133 === void 0 ? void 0 : _data$WaterConnection133.documents) && (data === null || data === void 0 ? void 0 : (_data$WaterConnection134 = data.WaterConnection) === null || _data$WaterConnection134 === void 0 ? void 0 : (_data$WaterConnection135 = _data$WaterConnection134[0]) === null || _data$WaterConnection135 === void 0 ? void 0 : _data$WaterConnection135.documents.
|
|
33080
|
-
|
|
33164
|
+
}, t("WS_COMMON_DOCUMENT_DETAILS")), (data === null || data === void 0 ? void 0 : (_data$WaterConnection132 = data.WaterConnection) === null || _data$WaterConnection132 === void 0 ? void 0 : (_data$WaterConnection133 = _data$WaterConnection132[0]) === null || _data$WaterConnection133 === void 0 ? void 0 : _data$WaterConnection133.documents) && (data === null || data === void 0 ? void 0 : (_data$WaterConnection134 = data.WaterConnection) === null || _data$WaterConnection134 === void 0 ? void 0 : (_data$WaterConnection135 = _data$WaterConnection134[0]) === null || _data$WaterConnection135 === void 0 ? void 0 : _data$WaterConnection135.documents.reduce((acc, current) => {
|
|
33165
|
+
const x = acc.find(item => item.documentType === current.documentType);
|
|
33166
|
+
if (!x) {
|
|
33167
|
+
return acc.concat([current]);
|
|
33168
|
+
} else {
|
|
33169
|
+
return acc;
|
|
33170
|
+
}
|
|
33171
|
+
}, []).map((doc, index, array) => {
|
|
33172
|
+
var _doc$documentType, _data$WaterConnection136, _data$WaterConnection137;
|
|
33081
33173
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
33082
33174
|
key: "doc-" + index
|
|
33083
33175
|
}, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, null, t(doc === null || doc === void 0 ? void 0 : (_doc$documentType = doc.documentType) === null || _doc$documentType === void 0 ? void 0 : _doc$documentType.split(".").slice(0, 2).join("_"))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.StatusTable, null, /*#__PURE__*/React__default.createElement(WSDocument, {
|
|
33084
33176
|
value: data === null || data === void 0 ? void 0 : (_data$WaterConnection136 = data.WaterConnection) === null || _data$WaterConnection136 === void 0 ? void 0 : (_data$WaterConnection137 = _data$WaterConnection136[0]) === null || _data$WaterConnection137 === void 0 ? void 0 : _data$WaterConnection137.documents,
|
|
33085
33177
|
Code: doc === null || doc === void 0 ? void 0 : doc.documentType,
|
|
33086
33178
|
index: index
|
|
33087
|
-
}),
|
|
33179
|
+
}), array.length != index + 1 ? /*#__PURE__*/React__default.createElement("hr", {
|
|
33088
33180
|
style: {
|
|
33089
33181
|
color: "#cccccc",
|
|
33090
33182
|
backgroundColor: "#cccccc",
|
|
@@ -33093,15 +33185,22 @@ const WSApplicationDetails = () => {
|
|
|
33093
33185
|
marginBottom: "20px"
|
|
33094
33186
|
}
|
|
33095
33187
|
}) : null)));
|
|
33096
|
-
})), (data === null || data === void 0 ? void 0 : (_data$SewerageConnect127 = data.SewerageConnections) === null || _data$SewerageConnect127 === void 0 ? void 0 : (_data$SewerageConnect128 = _data$SewerageConnect127[0]) === null || _data$SewerageConnect128 === void 0 ? void 0 : _data$SewerageConnect128.documents) && (data === null || data === void 0 ? void 0 : (_data$SewerageConnect129 = data.SewerageConnections) === null || _data$SewerageConnect129 === void 0 ? void 0 : (_data$SewerageConnect130 = _data$SewerageConnect129[0]) === null || _data$SewerageConnect130 === void 0 ? void 0 : _data$SewerageConnect130.documents.
|
|
33097
|
-
|
|
33188
|
+
})), (data === null || data === void 0 ? void 0 : (_data$SewerageConnect127 = data.SewerageConnections) === null || _data$SewerageConnect127 === void 0 ? void 0 : (_data$SewerageConnect128 = _data$SewerageConnect127[0]) === null || _data$SewerageConnect128 === void 0 ? void 0 : _data$SewerageConnect128.documents) && (data === null || data === void 0 ? void 0 : (_data$SewerageConnect129 = data.SewerageConnections) === null || _data$SewerageConnect129 === void 0 ? void 0 : (_data$SewerageConnect130 = _data$SewerageConnect129[0]) === null || _data$SewerageConnect130 === void 0 ? void 0 : _data$SewerageConnect130.documents.reduce((acc, current) => {
|
|
33189
|
+
const x = acc.find(item => item.documentType === current.documentType);
|
|
33190
|
+
if (!x) {
|
|
33191
|
+
return acc.concat([current]);
|
|
33192
|
+
} else {
|
|
33193
|
+
return acc;
|
|
33194
|
+
}
|
|
33195
|
+
}, []).map((doc, index, array) => {
|
|
33196
|
+
var _doc$documentType2, _data$SewerageConnect131, _data$SewerageConnect132;
|
|
33098
33197
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
33099
33198
|
key: "doc-" + index
|
|
33100
33199
|
}, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, null, t(doc === null || doc === void 0 ? void 0 : (_doc$documentType2 = doc.documentType) === null || _doc$documentType2 === void 0 ? void 0 : _doc$documentType2.split(".").slice(0, 2).join("_"))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.StatusTable, null, /*#__PURE__*/React__default.createElement(WSDocument, {
|
|
33101
33200
|
value: data === null || data === void 0 ? void 0 : (_data$SewerageConnect131 = data.SewerageConnections) === null || _data$SewerageConnect131 === void 0 ? void 0 : (_data$SewerageConnect132 = _data$SewerageConnect131[0]) === null || _data$SewerageConnect132 === void 0 ? void 0 : _data$SewerageConnect132.documents,
|
|
33102
33201
|
Code: doc === null || doc === void 0 ? void 0 : doc.documentType,
|
|
33103
33202
|
index: index
|
|
33104
|
-
}),
|
|
33203
|
+
}), array.length != index + 1 ? /*#__PURE__*/React__default.createElement("hr", {
|
|
33105
33204
|
style: {
|
|
33106
33205
|
color: "white",
|
|
33107
33206
|
backgroundColor: "white",
|
|
@@ -33110,40 +33209,40 @@ const WSApplicationDetails = () => {
|
|
|
33110
33209
|
marginBottom: "20px"
|
|
33111
33210
|
}
|
|
33112
33211
|
}) : null)));
|
|
33113
|
-
})), (data === null || data === void 0 ? void 0 : (_data$
|
|
33212
|
+
})), (data === null || data === void 0 ? void 0 : (_data$WaterConnection138 = data.WaterConnection) === null || _data$WaterConnection138 === void 0 ? void 0 : (_data$WaterConnection139 = _data$WaterConnection138[0]) === null || _data$WaterConnection139 === void 0 ? void 0 : _data$WaterConnection139.applicationStatus) === "PENDING_FOR_PAYMENT" || (data === null || data === void 0 ? void 0 : (_data$WaterConnection140 = data.WaterConnection) === null || _data$WaterConnection140 === void 0 ? void 0 : (_data$WaterConnection141 = _data$WaterConnection140[0]) === null || _data$WaterConnection141 === void 0 ? void 0 : _data$WaterConnection141.applicationStatus) === "PENDING_FOR_FINAL_PAYMENT" || (data === null || data === void 0 ? void 0 : (_data$WaterConnection142 = data.WaterConnection) === null || _data$WaterConnection142 === void 0 ? void 0 : (_data$WaterConnection143 = _data$WaterConnection142[0]) === null || _data$WaterConnection143 === void 0 ? void 0 : _data$WaterConnection143.applicationStatus) === "PENDING_FOR_ADDITIONAL_PAYMENT" || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect133 = data.SewerageConnections) === null || _data$SewerageConnect133 === void 0 ? void 0 : (_data$SewerageConnect134 = _data$SewerageConnect133[0]) === null || _data$SewerageConnect134 === void 0 ? void 0 : _data$SewerageConnect134.applicationStatus) === "PENDING_FOR_PAYMENT" || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect135 = data.SewerageConnections) === null || _data$SewerageConnect135 === void 0 ? void 0 : (_data$SewerageConnect136 = _data$SewerageConnect135[0]) === null || _data$SewerageConnect136 === void 0 ? void 0 : _data$SewerageConnect136.applicationStatus) === "PENDING_FOR_FINAL_PAYMENT" || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect137 = data.SewerageConnections) === null || _data$SewerageConnect137 === void 0 ? void 0 : (_data$SewerageConnect138 = _data$SewerageConnect137[0]) === null || _data$SewerageConnect138 === void 0 ? void 0 : _data$SewerageConnect138.applicationStatus) === "PENDING_FOR_ADDITIONAL_PAYMENT" ? /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
|
|
33114
33213
|
to: {
|
|
33115
33214
|
pathname: "/digit-ui/citizen/payment/my-bills/" + (paymentDetails === null || paymentDetails === void 0 ? void 0 : (_paymentDetails$data = paymentDetails.data) === null || _paymentDetails$data === void 0 ? void 0 : (_paymentDetails$data$ = _paymentDetails$data.Bill) === null || _paymentDetails$data$ === void 0 ? void 0 : (_paymentDetails$data$2 = _paymentDetails$data$[0]) === null || _paymentDetails$data$2 === void 0 ? void 0 : _paymentDetails$data$2.businessService) + "/" + stringReplaceAll(paymentDetails === null || paymentDetails === void 0 ? void 0 : (_paymentDetails$data2 = paymentDetails.data) === null || _paymentDetails$data2 === void 0 ? void 0 : (_paymentDetails$data3 = _paymentDetails$data2.Bill) === null || _paymentDetails$data3 === void 0 ? void 0 : (_paymentDetails$data4 = _paymentDetails$data3[0]) === null || _paymentDetails$data4 === void 0 ? void 0 : _paymentDetails$data4.consumerCode, "/", "+"),
|
|
33116
|
-
search: "?workflow=WNS&tenantId=" + ((data === null || data === void 0 ? void 0 : (_data$
|
|
33215
|
+
search: "?workflow=WNS&tenantId=" + ((data === null || data === void 0 ? void 0 : (_data$WaterConnection144 = data.WaterConnection) === null || _data$WaterConnection144 === void 0 ? void 0 : (_data$WaterConnection145 = _data$WaterConnection144[0]) === null || _data$WaterConnection145 === void 0 ? void 0 : _data$WaterConnection145.tenantId) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect139 = data.SewerageConnections) === null || _data$SewerageConnect139 === void 0 ? void 0 : (_data$SewerageConnect140 = _data$SewerageConnect139[0]) === null || _data$SewerageConnect140 === void 0 ? void 0 : _data$SewerageConnect140.tenantId)) + "&ConsumerName=" + ((data === null || data === void 0 ? void 0 : (_data$WaterConnection146 = data.WaterConnection) === null || _data$WaterConnection146 === void 0 ? void 0 : (_data$WaterConnection147 = _data$WaterConnection146[0]) === null || _data$WaterConnection147 === void 0 ? void 0 : (_data$WaterConnection148 = _data$WaterConnection147.connectionHolders) === null || _data$WaterConnection148 === void 0 ? void 0 : _data$WaterConnection148.map(owner => owner.name).join(",")) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect141 = data.SewerageConnections) === null || _data$SewerageConnect141 === void 0 ? void 0 : (_data$SewerageConnect142 = _data$SewerageConnect141[0]) === null || _data$SewerageConnect142 === void 0 ? void 0 : (_data$SewerageConnect143 = _data$SewerageConnect142.connectionHolders) === null || _data$SewerageConnect143 === void 0 ? void 0 : _data$SewerageConnect143.map(owner => owner.name).join(",")) || (PTData === null || PTData === void 0 ? void 0 : (_PTData$Properties8 = PTData.Properties) === null || _PTData$Properties8 === void 0 ? void 0 : (_PTData$Properties8$ = _PTData$Properties8[0]) === null || _PTData$Properties8$ === void 0 ? void 0 : (_PTData$Properties8$$ = _PTData$Properties8$.owners) === null || _PTData$Properties8$$ === void 0 ? void 0 : _PTData$Properties8$$.map(owner => owner.name).join(","))) + "&isDisoconnectFlow=" + (applicationNobyData !== null && applicationNobyData !== void 0 && applicationNobyData.includes("DC") ? true : false) + "&consumerCode=" + (paymentDetails === null || paymentDetails === void 0 ? void 0 : (_paymentDetails$data5 = paymentDetails.data) === null || _paymentDetails$data5 === void 0 ? void 0 : (_paymentDetails$data6 = _paymentDetails$data5.Bill) === null || _paymentDetails$data6 === void 0 ? void 0 : (_paymentDetails$data7 = _paymentDetails$data6[0]) === null || _paymentDetails$data7 === void 0 ? void 0 : _paymentDetails$data7.consumerCode),
|
|
33117
33216
|
state: {
|
|
33118
33217
|
fromApplicationDetails: true
|
|
33119
33218
|
}
|
|
33120
33219
|
}
|
|
33121
33220
|
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
|
|
33122
33221
|
label: t("MAKE_PAYMENT")
|
|
33123
|
-
})) : null, !(data !== null && data !== void 0 && (_data$
|
|
33222
|
+
})) : null, !(data !== null && data !== void 0 && (_data$WaterConnection149 = data.WaterConnection) !== null && _data$WaterConnection149 !== void 0 && (_data$WaterConnection150 = _data$WaterConnection149[0]) !== null && _data$WaterConnection150 !== void 0 && _data$WaterConnection150.applicationType.includes("DISCONNECT")) && data !== null && data !== void 0 && (_data$WaterConnection151 = data.WaterConnection) !== null && _data$WaterConnection151 !== void 0 && (_data$WaterConnection152 = _data$WaterConnection151[0]) !== null && _data$WaterConnection152 !== void 0 && _data$WaterConnection152.applicationStatus.includes("PENDING_FOR_CITIZEN_ACTION") || !(data !== null && data !== void 0 && (_data$SewerageConnect144 = data.SewerageConnections) !== null && _data$SewerageConnect144 !== void 0 && (_data$SewerageConnect145 = _data$SewerageConnect144[0]) !== null && _data$SewerageConnect145 !== void 0 && _data$SewerageConnect145.applicationType.includes("DISCONNECT")) && data !== null && data !== void 0 && (_data$SewerageConnect146 = data.SewerageConnections) !== null && _data$SewerageConnect146 !== void 0 && (_data$SewerageConnect147 = _data$SewerageConnect146[0]) !== null && _data$SewerageConnect147 !== void 0 && _data$SewerageConnect147.applicationStatus.includes("PENDING_FOR_CITIZEN_ACTION") ? /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
|
|
33124
33223
|
to: {
|
|
33125
|
-
pathname: isMutation ? "/digit-ui/citizen/ws/mutation-application" : "/digit-ui/citizen/ws/edit-application/" + ((data === null || data === void 0 ? void 0 : (_data$
|
|
33126
|
-
search: isMutation ? "?applicationNumber=" + ((data === null || data === void 0 ? void 0 : (_data$
|
|
33224
|
+
pathname: isMutation ? "/digit-ui/citizen/ws/mutation-application" : "/digit-ui/citizen/ws/edit-application/" + ((data === null || data === void 0 ? void 0 : (_data$WaterConnection153 = data.WaterConnection) === null || _data$WaterConnection153 === void 0 ? void 0 : (_data$WaterConnection154 = _data$WaterConnection153[0]) === null || _data$WaterConnection154 === void 0 ? void 0 : _data$WaterConnection154.tenantId) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect148 = data.SewerageConnections) === null || _data$SewerageConnect148 === void 0 ? void 0 : (_data$SewerageConnect149 = _data$SewerageConnect148[0]) === null || _data$SewerageConnect149 === void 0 ? void 0 : _data$SewerageConnect149.tenantId)),
|
|
33225
|
+
search: isMutation ? "?applicationNumber=" + ((data === null || data === void 0 ? void 0 : (_data$WaterConnection155 = data.WaterConnection) === null || _data$WaterConnection155 === void 0 ? void 0 : (_data$WaterConnection156 = _data$WaterConnection155[0]) === null || _data$WaterConnection156 === void 0 ? void 0 : _data$WaterConnection156.applicationNo) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect150 = data.SewerageConnections) === null || _data$SewerageConnect150 === void 0 ? void 0 : (_data$SewerageConnect151 = _data$SewerageConnect150[0]) === null || _data$SewerageConnect151 === void 0 ? void 0 : _data$SewerageConnect151.applicationNo)) + "&tenantId=" + ((data === null || data === void 0 ? void 0 : (_data$WaterConnection157 = data.WaterConnection) === null || _data$WaterConnection157 === void 0 ? void 0 : (_data$WaterConnection158 = _data$WaterConnection157[0]) === null || _data$WaterConnection158 === void 0 ? void 0 : _data$WaterConnection158.tenantId) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect152 = data.SewerageConnections) === null || _data$SewerageConnect152 === void 0 ? void 0 : (_data$SewerageConnect153 = _data$SewerageConnect152[0]) === null || _data$SewerageConnect153 === void 0 ? void 0 : _data$SewerageConnect153.tenantId)) + "&service=" + (data !== null && data !== void 0 && (_data$WaterConnection159 = data.WaterConnection) !== null && _data$WaterConnection159 !== void 0 && _data$WaterConnection159[0] ? "WATER" : "SEWERAGE") + "&propertyId=" + ((data === null || data === void 0 ? void 0 : (_data$WaterConnection160 = data.WaterConnection) === null || _data$WaterConnection160 === void 0 ? void 0 : (_data$WaterConnection161 = _data$WaterConnection160[0]) === null || _data$WaterConnection161 === void 0 ? void 0 : _data$WaterConnection161.propertyId) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect154 = data.SewerageConnections) === null || _data$SewerageConnect154 === void 0 ? void 0 : (_data$SewerageConnect155 = _data$SewerageConnect154[0]) === null || _data$SewerageConnect155 === void 0 ? void 0 : _data$SewerageConnect155.propertyId)) : "",
|
|
33127
33226
|
state: {
|
|
33128
|
-
id: "" + ((data === null || data === void 0 ? void 0 : (_data$
|
|
33227
|
+
id: "" + ((data === null || data === void 0 ? void 0 : (_data$WaterConnection162 = data.WaterConnection) === null || _data$WaterConnection162 === void 0 ? void 0 : (_data$WaterConnection163 = _data$WaterConnection162[0]) === null || _data$WaterConnection163 === void 0 ? void 0 : _data$WaterConnection163.applicationNo) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect156 = data.SewerageConnections) === null || _data$SewerageConnect156 === void 0 ? void 0 : (_data$SewerageConnect157 = _data$SewerageConnect156[0]) === null || _data$SewerageConnect157 === void 0 ? void 0 : _data$SewerageConnect157.applicationNo))
|
|
33129
33228
|
}
|
|
33130
33229
|
}
|
|
33131
33230
|
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
|
|
33132
33231
|
label: t("COMMON_EDIT")
|
|
33133
|
-
})) : null, data !== null && data !== void 0 && (_data$
|
|
33232
|
+
})) : null, data !== null && data !== void 0 && (_data$WaterConnection164 = data.WaterConnection) !== null && _data$WaterConnection164 !== void 0 && (_data$WaterConnection165 = _data$WaterConnection164[0]) !== null && _data$WaterConnection165 !== void 0 && _data$WaterConnection165.applicationType.includes("DISCONNECT") && data !== null && data !== void 0 && (_data$WaterConnection166 = data.WaterConnection) !== null && _data$WaterConnection166 !== void 0 && (_data$WaterConnection167 = _data$WaterConnection166[0]) !== null && _data$WaterConnection167 !== void 0 && _data$WaterConnection167.applicationStatus.includes("PENDING_FOR_CITIZEN_ACTION") || data !== null && data !== void 0 && (_data$SewerageConnect158 = data.SewerageConnections) !== null && _data$SewerageConnect158 !== void 0 && (_data$SewerageConnect159 = _data$SewerageConnect158[0]) !== null && _data$SewerageConnect159 !== void 0 && _data$SewerageConnect159.applicationType.includes("DISCONNECT") && data !== null && data !== void 0 && (_data$SewerageConnect160 = data.SewerageConnections) !== null && _data$SewerageConnect160 !== void 0 && (_data$SewerageConnect161 = _data$SewerageConnect160[0]) !== null && _data$SewerageConnect161 !== void 0 && _data$SewerageConnect161.applicationStatus.includes("PENDING_FOR_CITIZEN_ACTION") ? /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
|
|
33134
33233
|
to: {
|
|
33135
33234
|
pathname: "/digit-ui/citizen/ws/resubmit-disconnect-application",
|
|
33136
33235
|
state: {
|
|
33137
|
-
id: "" + ((data === null || data === void 0 ? void 0 : (_data$
|
|
33236
|
+
id: "" + ((data === null || data === void 0 ? void 0 : (_data$WaterConnection168 = data.WaterConnection) === null || _data$WaterConnection168 === void 0 ? void 0 : (_data$WaterConnection169 = _data$WaterConnection168[0]) === null || _data$WaterConnection169 === void 0 ? void 0 : _data$WaterConnection169.applicationNo) || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect162 = data.SewerageConnections) === null || _data$SewerageConnect162 === void 0 ? void 0 : (_data$SewerageConnect163 = _data$SewerageConnect162[0]) === null || _data$SewerageConnect163 === void 0 ? void 0 : _data$SewerageConnect163.applicationNo))
|
|
33138
33237
|
}
|
|
33139
33238
|
}
|
|
33140
33239
|
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
|
|
33141
33240
|
label: t("RESUBMIT_APPLICATION"),
|
|
33142
33241
|
onSubmit: Digit.SessionStorage.set("WS_DISCONNECTION", applicationNobyData !== null && applicationNobyData !== void 0 && applicationNobyData.includes("SW") ? {
|
|
33143
|
-
applicationData: data === null || data === void 0 ? void 0 : (_data$
|
|
33242
|
+
applicationData: data === null || data === void 0 ? void 0 : (_data$SewerageConnect164 = data.SewerageConnections) === null || _data$SewerageConnect164 === void 0 ? void 0 : _data$SewerageConnect164[0],
|
|
33144
33243
|
serviceType: "SEWERAGE",
|
|
33145
33244
|
WSDisconnectionForm: {
|
|
33146
|
-
type: data !== null && data !== void 0 && (_data$
|
|
33245
|
+
type: data !== null && data !== void 0 && (_data$SewerageConnect165 = data.SewerageConnections) !== null && _data$SewerageConnect165 !== void 0 && (_data$SewerageConnect166 = _data$SewerageConnect165[0]) !== null && _data$SewerageConnect166 !== void 0 && _data$SewerageConnect166.isDisconnectionTemporary ? {
|
|
33147
33246
|
code: "type",
|
|
33148
33247
|
value: {
|
|
33149
33248
|
name: "Temporary",
|
|
@@ -33160,18 +33259,18 @@ const WSApplicationDetails = () => {
|
|
|
33160
33259
|
code: "Permanent"
|
|
33161
33260
|
}
|
|
33162
33261
|
},
|
|
33163
|
-
date: convertEpochToDateDMY(data === null || data === void 0 ? void 0 : (_data$
|
|
33262
|
+
date: convertEpochToDateDMY(data === null || data === void 0 ? void 0 : (_data$SewerageConnect167 = data.SewerageConnections) === null || _data$SewerageConnect167 === void 0 ? void 0 : (_data$SewerageConnect168 = _data$SewerageConnect167[0]) === null || _data$SewerageConnect168 === void 0 ? void 0 : _data$SewerageConnect168.dateEffectiveFrom, true),
|
|
33164
33263
|
reason: {
|
|
33165
33264
|
code: "reason",
|
|
33166
|
-
value: data === null || data === void 0 ? void 0 : (_data$
|
|
33265
|
+
value: data === null || data === void 0 ? void 0 : (_data$SewerageConnect169 = data.SewerageConnections) === null || _data$SewerageConnect169 === void 0 ? void 0 : (_data$SewerageConnect170 = _data$SewerageConnect169[0]) === null || _data$SewerageConnect170 === void 0 ? void 0 : _data$SewerageConnect170.disconnectionReason
|
|
33167
33266
|
},
|
|
33168
|
-
documents: data === null || data === void 0 ? void 0 : (_data$
|
|
33267
|
+
documents: data === null || data === void 0 ? void 0 : (_data$SewerageConnect171 = data.SewerageConnections) === null || _data$SewerageConnect171 === void 0 ? void 0 : (_data$SewerageConnect172 = _data$SewerageConnect171[0]) === null || _data$SewerageConnect172 === void 0 ? void 0 : _data$SewerageConnect172.documents
|
|
33169
33268
|
}
|
|
33170
33269
|
} : {
|
|
33171
|
-
applicationData: data === null || data === void 0 ? void 0 : (_data$
|
|
33270
|
+
applicationData: data === null || data === void 0 ? void 0 : (_data$WaterConnection170 = data.WaterConnection) === null || _data$WaterConnection170 === void 0 ? void 0 : _data$WaterConnection170[0],
|
|
33172
33271
|
serviceType: "WATER",
|
|
33173
33272
|
WSDisconnectionForm: {
|
|
33174
|
-
type: data !== null && data !== void 0 && (_data$
|
|
33273
|
+
type: data !== null && data !== void 0 && (_data$WaterConnection171 = data.WaterConnection) !== null && _data$WaterConnection171 !== void 0 && (_data$WaterConnection172 = _data$WaterConnection171[0]) !== null && _data$WaterConnection172 !== void 0 && _data$WaterConnection172.isDisconnectionTemporary ? {
|
|
33175
33274
|
code: "type",
|
|
33176
33275
|
value: {
|
|
33177
33276
|
name: "Temporary",
|
|
@@ -33188,12 +33287,12 @@ const WSApplicationDetails = () => {
|
|
|
33188
33287
|
code: "Permanent"
|
|
33189
33288
|
}
|
|
33190
33289
|
},
|
|
33191
|
-
date: convertEpochToDateDMY(data === null || data === void 0 ? void 0 : (_data$
|
|
33290
|
+
date: convertEpochToDateDMY(data === null || data === void 0 ? void 0 : (_data$WaterConnection173 = data.WaterConnection) === null || _data$WaterConnection173 === void 0 ? void 0 : (_data$WaterConnection174 = _data$WaterConnection173[0]) === null || _data$WaterConnection174 === void 0 ? void 0 : _data$WaterConnection174.dateEffectiveFrom, true),
|
|
33192
33291
|
reason: {
|
|
33193
33292
|
code: "reason",
|
|
33194
|
-
value: data === null || data === void 0 ? void 0 : (_data$
|
|
33293
|
+
value: data === null || data === void 0 ? void 0 : (_data$WaterConnection175 = data.WaterConnection) === null || _data$WaterConnection175 === void 0 ? void 0 : (_data$WaterConnection176 = _data$WaterConnection175[0]) === null || _data$WaterConnection176 === void 0 ? void 0 : _data$WaterConnection176.disconnectionReason
|
|
33195
33294
|
},
|
|
33196
|
-
documents: data === null || data === void 0 ? void 0 : (_data$
|
|
33295
|
+
documents: data === null || data === void 0 ? void 0 : (_data$WaterConnection177 = data.WaterConnection) === null || _data$WaterConnection177 === void 0 ? void 0 : (_data$WaterConnection178 = _data$WaterConnection177[0]) === null || _data$WaterConnection178 === void 0 ? void 0 : _data$WaterConnection178.documents
|
|
33197
33296
|
}
|
|
33198
33297
|
})
|
|
33199
33298
|
})) : null)))));
|
|
@@ -36800,6 +36899,10 @@ const BillSearchResults = () => {
|
|
|
36800
36899
|
})));
|
|
36801
36900
|
};
|
|
36802
36901
|
|
|
36902
|
+
const getMaskedPhone = phone => {
|
|
36903
|
+
if (!phone || phone.length < 10) return "NA";
|
|
36904
|
+
return "******" + phone.slice(-4);
|
|
36905
|
+
};
|
|
36803
36906
|
const getAddress$1 = (address, t) => {
|
|
36804
36907
|
return (address !== null && address !== void 0 && address.doorNo ? (address === null || address === void 0 ? void 0 : address.doorNo) + ", " : "") + " " + (address !== null && address !== void 0 && address.street ? (address === null || address === void 0 ? void 0 : address.street) + ", " : "") + (address !== null && address !== void 0 && address.landmark ? (address === null || address === void 0 ? void 0 : address.landmark) + ", " : "") + t(Digit.Utils.pt.getMohallaLocale(address === null || address === void 0 ? void 0 : address.locality.code, address === null || address === void 0 ? void 0 : address.tenantId)) + ", " + t(Digit.Utils.pt.getCityLocale(address === null || address === void 0 ? void 0 : address.tenantId)) + (address !== null && address !== void 0 && address.pincode && t(address === null || address === void 0 ? void 0 : address.pincode) ? ", " + address.pincode : " ");
|
|
36805
36908
|
};
|
|
@@ -36820,6 +36923,21 @@ const WSInfoPage = () => {
|
|
|
36820
36923
|
const _useState3 = React.useState(""),
|
|
36821
36924
|
searchMobileNumber = _useState3[0],
|
|
36822
36925
|
setSearchMobileNumber = _useState3[1];
|
|
36926
|
+
const _useState4 = React.useState(false),
|
|
36927
|
+
showOtpVerification = _useState4[0],
|
|
36928
|
+
setShowOtpVerification = _useState4[1];
|
|
36929
|
+
const _useState5 = React.useState(""),
|
|
36930
|
+
otp = _useState5[0],
|
|
36931
|
+
setOtp = _useState5[1];
|
|
36932
|
+
const _useState6 = React.useState(false),
|
|
36933
|
+
isOtpSending = _useState6[0],
|
|
36934
|
+
setIsOtpSending = _useState6[1];
|
|
36935
|
+
const _useState7 = React.useState(false),
|
|
36936
|
+
isOtpVerifying = _useState7[0],
|
|
36937
|
+
setIsOtpVerifying = _useState7[1];
|
|
36938
|
+
const _useState8 = React.useState(null),
|
|
36939
|
+
showToast = _useState8[0],
|
|
36940
|
+
setShowToast = _useState8[1];
|
|
36823
36941
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
36824
36942
|
const userMobileNumber = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : (_Digit$UserService$ge2 = _Digit$UserService$ge.info) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.mobileNumber;
|
|
36825
36943
|
const mobileNumberToSearch = isEmployee ? searchMobileNumber : userMobileNumber;
|
|
@@ -36844,15 +36962,171 @@ const WSInfoPage = () => {
|
|
|
36844
36962
|
code: "NO",
|
|
36845
36963
|
i18nKey: "TL_COMMON_NO"
|
|
36846
36964
|
}];
|
|
36847
|
-
const
|
|
36965
|
+
const proceedToNext = () => {
|
|
36848
36966
|
const isEmployee = window.location.href.includes("/employee");
|
|
36849
36967
|
const baseUrl = isEmployee ? "/digit-ui/employee/ws" : "/digit-ui/citizen/ws";
|
|
36850
36968
|
if ((hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && selectedProperty) {
|
|
36851
36969
|
history.push(baseUrl + "/old-application?propertyId=" + selectedProperty.propertyId);
|
|
36970
|
+
} else {
|
|
36971
|
+
history.push(baseUrl + "/old-application");
|
|
36972
|
+
}
|
|
36973
|
+
};
|
|
36974
|
+
const handleSendOtp = function (e) {
|
|
36975
|
+
try {
|
|
36976
|
+
if (e) {
|
|
36977
|
+
if (e.preventDefault) e.preventDefault();
|
|
36978
|
+
if (e.stopPropagation) e.stopPropagation();
|
|
36979
|
+
}
|
|
36980
|
+
setIsOtpSending(true);
|
|
36981
|
+
return Promise.resolve(_catch(function () {
|
|
36982
|
+
const payload = {
|
|
36983
|
+
otp: {
|
|
36984
|
+
mobileNumber: mobileNumberToSearch,
|
|
36985
|
+
tenantId: "dl",
|
|
36986
|
+
type: "register",
|
|
36987
|
+
userType: isEmployee ? "EMPLOYEE" : "CITIZEN"
|
|
36988
|
+
}
|
|
36989
|
+
};
|
|
36990
|
+
return Promise.resolve(Digit.UserService.sendOtp(payload, "dl")).then(function (response) {
|
|
36991
|
+
var _response$data, _response$data3;
|
|
36992
|
+
if (!response) {
|
|
36993
|
+
setIsOtpSending(false);
|
|
36994
|
+
setShowToast({
|
|
36995
|
+
key: "error",
|
|
36996
|
+
message: "Failed to send OTP (No response)"
|
|
36997
|
+
});
|
|
36998
|
+
return;
|
|
36999
|
+
}
|
|
37000
|
+
if (response !== null && response !== void 0 && response.error || response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.error) {
|
|
37001
|
+
var _response$data2, _errObj$fields, _errObj$fields$;
|
|
37002
|
+
const errObj = (response === null || response === void 0 ? void 0 : response.error) || (response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.error);
|
|
37003
|
+
setIsOtpSending(false);
|
|
37004
|
+
setShowToast({
|
|
37005
|
+
key: "error",
|
|
37006
|
+
message: (errObj === null || errObj === void 0 ? void 0 : (_errObj$fields = errObj.fields) === null || _errObj$fields === void 0 ? void 0 : (_errObj$fields$ = _errObj$fields[0]) === null || _errObj$fields$ === void 0 ? void 0 : _errObj$fields$.message) || (errObj === null || errObj === void 0 ? void 0 : errObj.message) || "Failed to send OTP"
|
|
37007
|
+
});
|
|
37008
|
+
return;
|
|
37009
|
+
}
|
|
37010
|
+
if (response !== null && response !== void 0 && response.Errors || response !== null && response !== void 0 && (_response$data3 = response.data) !== null && _response$data3 !== void 0 && _response$data3.Errors) {
|
|
37011
|
+
var _response$data4, _errObj$;
|
|
37012
|
+
const errObj = (response === null || response === void 0 ? void 0 : response.Errors) || (response === null || response === void 0 ? void 0 : (_response$data4 = response.data) === null || _response$data4 === void 0 ? void 0 : _response$data4.Errors);
|
|
37013
|
+
setIsOtpSending(false);
|
|
37014
|
+
setShowToast({
|
|
37015
|
+
key: "error",
|
|
37016
|
+
message: (errObj === null || errObj === void 0 ? void 0 : (_errObj$ = errObj[0]) === null || _errObj$ === void 0 ? void 0 : _errObj$.message) || "Failed to send OTP"
|
|
37017
|
+
});
|
|
37018
|
+
return;
|
|
37019
|
+
}
|
|
37020
|
+
setIsOtpSending(false);
|
|
37021
|
+
setShowOtpVerification(true);
|
|
37022
|
+
setShowToast({
|
|
37023
|
+
key: "success",
|
|
37024
|
+
message: "OTP sent successfully!"
|
|
37025
|
+
});
|
|
37026
|
+
});
|
|
37027
|
+
}, function (err) {
|
|
37028
|
+
var _err$response, _err$response$data, _err$response2, _err$response2$data;
|
|
37029
|
+
setIsOtpSending(false);
|
|
37030
|
+
let errMsg = "Failed to send OTP";
|
|
37031
|
+
if (err !== null && err !== void 0 && (_err$response = err.response) !== null && _err$response !== void 0 && (_err$response$data = _err$response.data) !== null && _err$response$data !== void 0 && _err$response$data.error) {
|
|
37032
|
+
var _err$response$data$er, _err$response$data$er2, _err$response$data$er3, _err$response$data$er4;
|
|
37033
|
+
errMsg = ((_err$response$data$er = err.response.data.error) === null || _err$response$data$er === void 0 ? void 0 : (_err$response$data$er2 = _err$response$data$er.fields) === null || _err$response$data$er2 === void 0 ? void 0 : (_err$response$data$er3 = _err$response$data$er2[0]) === null || _err$response$data$er3 === void 0 ? void 0 : _err$response$data$er3.message) || ((_err$response$data$er4 = err.response.data.error) === null || _err$response$data$er4 === void 0 ? void 0 : _err$response$data$er4.message) || errMsg;
|
|
37034
|
+
} else if (err !== null && err !== void 0 && (_err$response2 = err.response) !== null && _err$response2 !== void 0 && (_err$response2$data = _err$response2.data) !== null && _err$response2$data !== void 0 && _err$response2$data.Errors) {
|
|
37035
|
+
var _err$response$data$Er, _err$response$data$Er2;
|
|
37036
|
+
errMsg = ((_err$response$data$Er = err.response.data.Errors) === null || _err$response$data$Er === void 0 ? void 0 : (_err$response$data$Er2 = _err$response$data$Er[0]) === null || _err$response$data$Er2 === void 0 ? void 0 : _err$response$data$Er2.message) || errMsg;
|
|
37037
|
+
} else if (err.message) {
|
|
37038
|
+
errMsg = err.message;
|
|
37039
|
+
}
|
|
37040
|
+
setShowToast({
|
|
37041
|
+
key: "error",
|
|
37042
|
+
message: errMsg
|
|
37043
|
+
});
|
|
37044
|
+
}));
|
|
37045
|
+
} catch (e) {
|
|
37046
|
+
return Promise.reject(e);
|
|
37047
|
+
}
|
|
37048
|
+
};
|
|
37049
|
+
const handleVerifyOtp = function (e) {
|
|
37050
|
+
try {
|
|
37051
|
+
if (e) {
|
|
37052
|
+
if (e.preventDefault) e.preventDefault();
|
|
37053
|
+
if (e.stopPropagation) e.stopPropagation();
|
|
37054
|
+
}
|
|
37055
|
+
if (!otp || otp.length < 6) {
|
|
37056
|
+
setShowToast({
|
|
37057
|
+
key: "warning",
|
|
37058
|
+
message: "Please enter a valid 6-digit OTP"
|
|
37059
|
+
});
|
|
37060
|
+
return Promise.resolve();
|
|
37061
|
+
}
|
|
37062
|
+
setIsOtpVerifying(true);
|
|
37063
|
+
return Promise.resolve(_catch(function () {
|
|
37064
|
+
const payload = {
|
|
37065
|
+
otp: {
|
|
37066
|
+
otp: otp,
|
|
37067
|
+
identity: mobileNumberToSearch,
|
|
37068
|
+
tenantId: "dl"
|
|
37069
|
+
}
|
|
37070
|
+
};
|
|
37071
|
+
return Promise.resolve(Digit.UserService.validateOtp(payload)).then(function (response) {
|
|
37072
|
+
var _response$data5, _response$data7;
|
|
37073
|
+
if (!response || typeof response === "object" && Object.keys(response).length === 0) {
|
|
37074
|
+
throw new Error("OTP validation unsuccessful");
|
|
37075
|
+
}
|
|
37076
|
+
if (response !== null && response !== void 0 && response.error || response !== null && response !== void 0 && (_response$data5 = response.data) !== null && _response$data5 !== void 0 && _response$data5.error) {
|
|
37077
|
+
var _response$data6, _errObj$fields2, _errObj$fields2$;
|
|
37078
|
+
const errObj = (response === null || response === void 0 ? void 0 : response.error) || (response === null || response === void 0 ? void 0 : (_response$data6 = response.data) === null || _response$data6 === void 0 ? void 0 : _response$data6.error);
|
|
37079
|
+
throw new Error((errObj === null || errObj === void 0 ? void 0 : (_errObj$fields2 = errObj.fields) === null || _errObj$fields2 === void 0 ? void 0 : (_errObj$fields2$ = _errObj$fields2[0]) === null || _errObj$fields2$ === void 0 ? void 0 : _errObj$fields2$.message) || (errObj === null || errObj === void 0 ? void 0 : errObj.message) || "Failed to verify OTP");
|
|
37080
|
+
}
|
|
37081
|
+
if (response !== null && response !== void 0 && response.Errors || response !== null && response !== void 0 && (_response$data7 = response.data) !== null && _response$data7 !== void 0 && _response$data7.Errors) {
|
|
37082
|
+
var _response$data8, _errObj$2;
|
|
37083
|
+
const errObj = (response === null || response === void 0 ? void 0 : response.Errors) || (response === null || response === void 0 ? void 0 : (_response$data8 = response.data) === null || _response$data8 === void 0 ? void 0 : _response$data8.Errors);
|
|
37084
|
+
throw new Error((errObj === null || errObj === void 0 ? void 0 : (_errObj$2 = errObj[0]) === null || _errObj$2 === void 0 ? void 0 : _errObj$2.message) || "Failed to verify OTP");
|
|
37085
|
+
}
|
|
37086
|
+
setIsOtpVerifying(false);
|
|
37087
|
+
setShowToast({
|
|
37088
|
+
key: "success",
|
|
37089
|
+
message: "OTP verified successfully!"
|
|
37090
|
+
});
|
|
37091
|
+
proceedToNext();
|
|
37092
|
+
});
|
|
37093
|
+
}, function (err) {
|
|
37094
|
+
var _err$response3, _err$response3$data, _err$response4, _err$response4$data;
|
|
37095
|
+
setIsOtpVerifying(false);
|
|
37096
|
+
let errMsg = err.message || "Failed to verify OTP";
|
|
37097
|
+
if (err !== null && err !== void 0 && (_err$response3 = err.response) !== null && _err$response3 !== void 0 && (_err$response3$data = _err$response3.data) !== null && _err$response3$data !== void 0 && _err$response3$data.error) {
|
|
37098
|
+
var _err$response$data$er5, _err$response$data$er6, _err$response$data$er7, _err$response$data$er8;
|
|
37099
|
+
errMsg = ((_err$response$data$er5 = err.response.data.error) === null || _err$response$data$er5 === void 0 ? void 0 : (_err$response$data$er6 = _err$response$data$er5.fields) === null || _err$response$data$er6 === void 0 ? void 0 : (_err$response$data$er7 = _err$response$data$er6[0]) === null || _err$response$data$er7 === void 0 ? void 0 : _err$response$data$er7.message) || ((_err$response$data$er8 = err.response.data.error) === null || _err$response$data$er8 === void 0 ? void 0 : _err$response$data$er8.message) || errMsg;
|
|
37100
|
+
} else if (err !== null && err !== void 0 && (_err$response4 = err.response) !== null && _err$response4 !== void 0 && (_err$response4$data = _err$response4.data) !== null && _err$response4$data !== void 0 && _err$response4$data.Errors) {
|
|
37101
|
+
var _err$response$data$Er3, _err$response$data$Er4;
|
|
37102
|
+
errMsg = ((_err$response$data$Er3 = err.response.data.Errors) === null || _err$response$data$Er3 === void 0 ? void 0 : (_err$response$data$Er4 = _err$response$data$Er3[0]) === null || _err$response$data$Er4 === void 0 ? void 0 : _err$response$data$Er4.message) || errMsg;
|
|
37103
|
+
} else if (err.message) {
|
|
37104
|
+
errMsg = err.message;
|
|
37105
|
+
}
|
|
37106
|
+
setShowToast({
|
|
37107
|
+
key: "error",
|
|
37108
|
+
message: errMsg
|
|
37109
|
+
});
|
|
37110
|
+
}));
|
|
37111
|
+
} catch (e) {
|
|
37112
|
+
return Promise.reject(e);
|
|
37113
|
+
}
|
|
37114
|
+
};
|
|
37115
|
+
const handleNext = e => {
|
|
37116
|
+
if (e) {
|
|
37117
|
+
if (e.preventDefault) e.preventDefault();
|
|
37118
|
+
if (e.stopPropagation) e.stopPropagation();
|
|
37119
|
+
}
|
|
37120
|
+
if ((hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && selectedProperty) {
|
|
37121
|
+
if (!isEmployee) {
|
|
37122
|
+
proceedToNext();
|
|
37123
|
+
} else {
|
|
37124
|
+
handleSendOtp(e);
|
|
37125
|
+
}
|
|
36852
37126
|
} else if ((hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && !selectedProperty) {
|
|
36853
37127
|
return;
|
|
36854
37128
|
} else {
|
|
36855
|
-
|
|
37129
|
+
proceedToNext();
|
|
36856
37130
|
}
|
|
36857
37131
|
};
|
|
36858
37132
|
const handleCreateProperty = () => {
|
|
@@ -36862,6 +37136,66 @@ const WSInfoPage = () => {
|
|
|
36862
37136
|
const propertyOptions = (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop.map(prop => _extends({}, prop, {
|
|
36863
37137
|
displayName: prop.propertyId + " - " + getAddress$1(prop.address, t)
|
|
36864
37138
|
}))) || [];
|
|
37139
|
+
if (showOtpVerification) {
|
|
37140
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, /*#__PURE__*/React__default.createElement("form", {
|
|
37141
|
+
onSubmit: handleVerifyOtp
|
|
37142
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardHeader, null, t("WS_VERIFY_OTP_HEADER") || "Verify OTP"), /*#__PURE__*/React__default.createElement("div", {
|
|
37143
|
+
style: {
|
|
37144
|
+
marginBottom: "24px"
|
|
37145
|
+
}
|
|
37146
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Label, null, t("WS_ENTER_OTP_SENT_TO") || "Enter OTP sent to", " +91 ", getMaskedPhone(mobileNumberToSearch), " *"), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
37147
|
+
t: t,
|
|
37148
|
+
type: "number",
|
|
37149
|
+
isMandatory: false,
|
|
37150
|
+
value: otp,
|
|
37151
|
+
onChange: e => setOtp(e.target.value.replace(/\D/g, '').slice(0, 6)),
|
|
37152
|
+
placeholder: t("WS_ENTER_6_DIGIT_OTP") || "Enter 6-digit OTP",
|
|
37153
|
+
style: {
|
|
37154
|
+
width: "100%",
|
|
37155
|
+
maxWidth: "300px"
|
|
37156
|
+
}
|
|
37157
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
37158
|
+
style: {
|
|
37159
|
+
display: "flex",
|
|
37160
|
+
gap: "16px",
|
|
37161
|
+
marginBottom: "24px"
|
|
37162
|
+
}
|
|
37163
|
+
}, /*#__PURE__*/React__default.createElement("button", {
|
|
37164
|
+
type: "button",
|
|
37165
|
+
onClick: handleSendOtp,
|
|
37166
|
+
disabled: isOtpSending,
|
|
37167
|
+
style: {
|
|
37168
|
+
color: "#f47738",
|
|
37169
|
+
background: "none",
|
|
37170
|
+
border: "none",
|
|
37171
|
+
cursor: "pointer",
|
|
37172
|
+
fontWeight: "bold",
|
|
37173
|
+
textDecoration: "underline"
|
|
37174
|
+
}
|
|
37175
|
+
}, isOtpSending ? t("WS_SENDING_OTP") || "Sending..." : t("WS_RESEND_OTP") || "Resend OTP"), /*#__PURE__*/React__default.createElement("button", {
|
|
37176
|
+
type: "button",
|
|
37177
|
+
onClick: () => setShowOtpVerification(false),
|
|
37178
|
+
style: {
|
|
37179
|
+
color: "#f47738",
|
|
37180
|
+
background: "none",
|
|
37181
|
+
border: "none",
|
|
37182
|
+
cursor: "pointer",
|
|
37183
|
+
fontWeight: "bold",
|
|
37184
|
+
textDecoration: "underline"
|
|
37185
|
+
}
|
|
37186
|
+
}, t("CS_COMMON_CANCEL") || "Cancel")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
|
|
37187
|
+
label: t("WS_VERIFY_OTP_AND_PROCEED") || "Verify & Proceed",
|
|
37188
|
+
onSubmit: handleVerifyOtp,
|
|
37189
|
+
disabled: otp.length < 6 || isOtpVerifying,
|
|
37190
|
+
submit: true
|
|
37191
|
+
}))), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
37192
|
+
error: showToast.key === "error",
|
|
37193
|
+
warning: showToast.key === "warning",
|
|
37194
|
+
label: t(showToast.message),
|
|
37195
|
+
onClose: () => setShowToast(null),
|
|
37196
|
+
isDleteBtn: true
|
|
37197
|
+
}));
|
|
37198
|
+
}
|
|
36865
37199
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardHeader, null, t("WS_COMMON_APPL_NEW_CONNECTION")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CitizenInfoLabel, {
|
|
36866
37200
|
style: {
|
|
36867
37201
|
margin: "0px",
|
|
@@ -36886,6 +37220,8 @@ const WSInfoPage = () => {
|
|
|
36886
37220
|
onSelect: val => {
|
|
36887
37221
|
setHasProperty(val);
|
|
36888
37222
|
setSelectedProperty(null);
|
|
37223
|
+
setShowOtpVerification(false);
|
|
37224
|
+
setOtp("");
|
|
36889
37225
|
},
|
|
36890
37226
|
style: {
|
|
36891
37227
|
display: "flex",
|
|
@@ -36896,10 +37232,16 @@ const WSInfoPage = () => {
|
|
|
36896
37232
|
marginBottom: "24px"
|
|
36897
37233
|
}
|
|
36898
37234
|
}, isEmployee && /*#__PURE__*/React__default.createElement("div", {
|
|
37235
|
+
style: {
|
|
37236
|
+
display: "flex",
|
|
37237
|
+
flexDirection: "column",
|
|
37238
|
+
gap: "16px",
|
|
37239
|
+
marginBottom: "16px"
|
|
37240
|
+
}
|
|
37241
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
36899
37242
|
style: {
|
|
36900
37243
|
display: "flex",
|
|
36901
37244
|
gap: "24px",
|
|
36902
|
-
marginBottom: "16px",
|
|
36903
37245
|
alignItems: "flex-end"
|
|
36904
37246
|
}
|
|
36905
37247
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -36917,6 +37259,8 @@ const WSInfoPage = () => {
|
|
|
36917
37259
|
if (val.length <= 10) {
|
|
36918
37260
|
setSearchMobileNumber(val);
|
|
36919
37261
|
setSelectedProperty(null);
|
|
37262
|
+
setShowOtpVerification(false);
|
|
37263
|
+
setOtp("");
|
|
36920
37264
|
}
|
|
36921
37265
|
},
|
|
36922
37266
|
placeholder: t("Enter mobile number"),
|
|
@@ -36933,11 +37277,35 @@ const WSInfoPage = () => {
|
|
|
36933
37277
|
optionKey: "displayName",
|
|
36934
37278
|
id: "propertyId",
|
|
36935
37279
|
selected: selectedProperty,
|
|
36936
|
-
select:
|
|
37280
|
+
select: val => {
|
|
37281
|
+
setSelectedProperty(val);
|
|
37282
|
+
setShowOtpVerification(false);
|
|
37283
|
+
setOtp("");
|
|
37284
|
+
},
|
|
36937
37285
|
t: t,
|
|
36938
37286
|
placeholder: t("PT_SELECT_PROPERTY"),
|
|
36939
37287
|
disable: isLoading || propertyOptions.length === 0
|
|
36940
|
-
})))),
|
|
37288
|
+
})))), (searchMobileNumber === null || searchMobileNumber === void 0 ? void 0 : searchMobileNumber.length) === 10 && !isLoading && propertyOptions.length === 0 && /*#__PURE__*/React__default.createElement("div", {
|
|
37289
|
+
style: {
|
|
37290
|
+
display: "flex",
|
|
37291
|
+
flexDirection: "column",
|
|
37292
|
+
gap: "16px"
|
|
37293
|
+
}
|
|
37294
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
37295
|
+
style: {
|
|
37296
|
+
color: "#d63031",
|
|
37297
|
+
fontWeight: "bold"
|
|
37298
|
+
}
|
|
37299
|
+
}, t("WS_NO_PROPERTY_FOUND_ON_THIS_NUMBER") || "No property found on this number, please create the property first."), /*#__PURE__*/React__default.createElement("span", {
|
|
37300
|
+
onClick: handleCreateProperty
|
|
37301
|
+
}, /*#__PURE__*/React__default.createElement("button", {
|
|
37302
|
+
className: "submit-bar",
|
|
37303
|
+
type: "button",
|
|
37304
|
+
style: {
|
|
37305
|
+
color: "white",
|
|
37306
|
+
margin: 0
|
|
37307
|
+
}
|
|
37308
|
+
}, t("CPT_CREATE_PROPERTY"))))), !isEmployee && (isLoading || propertyOptions.length > 0) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Label, null, t("WS_SELECT_EXISTING_PROPERTY")), isLoading && !isEmployee ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null) : !isEmployee ? propertyOptions.length > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
36941
37309
|
style: {
|
|
36942
37310
|
display: "flex",
|
|
36943
37311
|
flexDirection: "column",
|
|
@@ -36948,7 +37316,11 @@ const WSInfoPage = () => {
|
|
|
36948
37316
|
optionKey: "displayName",
|
|
36949
37317
|
id: "propertyId",
|
|
36950
37318
|
selected: selectedProperty,
|
|
36951
|
-
select:
|
|
37319
|
+
select: val => {
|
|
37320
|
+
setSelectedProperty(val);
|
|
37321
|
+
setShowOtpVerification(false);
|
|
37322
|
+
setOtp("");
|
|
37323
|
+
},
|
|
36952
37324
|
t: t,
|
|
36953
37325
|
placeholder: t("PT_SELECT_PROPERTY")
|
|
36954
37326
|
}), /*#__PURE__*/React__default.createElement("span", {
|
|
@@ -36956,7 +37328,28 @@ const WSInfoPage = () => {
|
|
|
36956
37328
|
fontSize: "14px",
|
|
36957
37329
|
color: "#505A5F"
|
|
36958
37330
|
}
|
|
36959
|
-
}, t("WS_PROPERTY_AUTOFILL_MSG")))
|
|
37331
|
+
}, t("WS_PROPERTY_AUTOFILL_MSG"))) : /*#__PURE__*/React__default.createElement("div", {
|
|
37332
|
+
style: {
|
|
37333
|
+
display: "flex",
|
|
37334
|
+
flexDirection: "column",
|
|
37335
|
+
gap: "16px",
|
|
37336
|
+
marginTop: "16px"
|
|
37337
|
+
}
|
|
37338
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
37339
|
+
style: {
|
|
37340
|
+
color: "#d63031",
|
|
37341
|
+
fontWeight: "bold"
|
|
37342
|
+
}
|
|
37343
|
+
}, t("WS_NO_PROPERTY_FOUND_ON_THIS_NUMBER") || "No property found on this number, please create the property first."), /*#__PURE__*/React__default.createElement("span", {
|
|
37344
|
+
onClick: handleCreateProperty
|
|
37345
|
+
}, /*#__PURE__*/React__default.createElement("button", {
|
|
37346
|
+
className: "submit-bar",
|
|
37347
|
+
type: "button",
|
|
37348
|
+
style: {
|
|
37349
|
+
color: "white",
|
|
37350
|
+
margin: 0
|
|
37351
|
+
}
|
|
37352
|
+
}, t("CPT_CREATE_PROPERTY")))) : null), (hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "NO" && /*#__PURE__*/React__default.createElement("div", {
|
|
36960
37353
|
style: {
|
|
36961
37354
|
marginBottom: "24px",
|
|
36962
37355
|
display: "flex",
|
|
@@ -37107,7 +37500,13 @@ const WSInfoPage = () => {
|
|
|
37107
37500
|
return Promise.reject(e);
|
|
37108
37501
|
}
|
|
37109
37502
|
}
|
|
37110
|
-
})))
|
|
37503
|
+
}))), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
37504
|
+
error: showToast.key === "error",
|
|
37505
|
+
warning: showToast.key === "warning",
|
|
37506
|
+
label: t(showToast.message),
|
|
37507
|
+
onClose: () => setShowToast(null),
|
|
37508
|
+
isDleteBtn: true
|
|
37509
|
+
}));
|
|
37111
37510
|
};
|
|
37112
37511
|
|
|
37113
37512
|
const WSPropertyLocationDetails = props => {
|
|
@@ -41517,9 +41916,7 @@ const configWSApproverApplication = _ref => {
|
|
|
41517
41916
|
error = _ref.error,
|
|
41518
41917
|
isReasonRequiredAction = _ref.isReasonRequiredAction,
|
|
41519
41918
|
selectedReason = _ref.selectedReason,
|
|
41520
|
-
setSelectedReason = _ref.setSelectedReason
|
|
41521
|
-
otherReasonText = _ref.otherReasonText,
|
|
41522
|
-
setOtherReasonText = _ref.setOtherReasonText;
|
|
41919
|
+
setSelectedReason = _ref.setSelectedReason;
|
|
41523
41920
|
if (action !== null && action !== void 0 && (_action$action = action.action) !== null && _action$action !== void 0 && _action$action.includes("SEND_BACK") || (action === null || action === void 0 ? void 0 : action.action) == "APPROVE_FOR_CONNECTION") ;
|
|
41524
41921
|
const reasonOptions = [{
|
|
41525
41922
|
code: "INCOMPLETE_DOCUMENTS",
|
|
@@ -41540,7 +41937,7 @@ const configWSApproverApplication = _ref => {
|
|
|
41540
41937
|
}];
|
|
41541
41938
|
const commentsField = isReasonRequiredAction ? [{
|
|
41542
41939
|
label: t("WF_REASON_LABEL") || t("Reason"),
|
|
41543
|
-
isMandatory:
|
|
41940
|
+
isMandatory: false,
|
|
41544
41941
|
populators: /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
41545
41942
|
option: reasonOptions,
|
|
41546
41943
|
autoComplete: "off",
|
|
@@ -41548,30 +41945,18 @@ const configWSApproverApplication = _ref => {
|
|
|
41548
41945
|
id: "mutationActionReason",
|
|
41549
41946
|
select: val => {
|
|
41550
41947
|
setSelectedReason(val);
|
|
41551
|
-
if ((val === null || val === void 0 ? void 0 : val.code) !== "OTHER") {
|
|
41552
|
-
setOtherReasonText("");
|
|
41553
|
-
}
|
|
41554
41948
|
},
|
|
41555
41949
|
selected: selectedReason,
|
|
41556
41950
|
t: t,
|
|
41557
41951
|
placeholder: t("WF_SELECT_REASON_PLACEHOLDER") || "Select Reason"
|
|
41558
41952
|
})
|
|
41559
|
-
},
|
|
41560
|
-
label: t("
|
|
41561
|
-
|
|
41562
|
-
populators:
|
|
41563
|
-
|
|
41564
|
-
|
|
41565
|
-
|
|
41566
|
-
height: "80px",
|
|
41567
|
-
resize: "vertical",
|
|
41568
|
-
marginTop: "4px"
|
|
41569
|
-
},
|
|
41570
|
-
value: otherReasonText,
|
|
41571
|
-
onChange: e => setOtherReasonText(e.target.value),
|
|
41572
|
-
placeholder: t("WF_ENTER_OTHER_REASON_PLACEHOLDER") || "Enter reason details..."
|
|
41573
|
-
})
|
|
41574
|
-
}] : [])] : [{
|
|
41953
|
+
}, {
|
|
41954
|
+
label: t("WF_COMMON_COMMENTS"),
|
|
41955
|
+
type: "textarea",
|
|
41956
|
+
populators: {
|
|
41957
|
+
name: "comments"
|
|
41958
|
+
}
|
|
41959
|
+
}] : [{
|
|
41575
41960
|
label: t("WF_COMMON_COMMENTS"),
|
|
41576
41961
|
type: "textarea",
|
|
41577
41962
|
populators: {
|
|
@@ -43139,7 +43524,7 @@ const ActionModal$5 = _ref => {
|
|
|
43139
43524
|
otherReasonText = _useState9[0],
|
|
43140
43525
|
setOtherReasonText = _useState9[1];
|
|
43141
43526
|
const isMutationApp = ((_applicationData = applicationData) === null || _applicationData === void 0 ? void 0 : (_applicationData$appl = _applicationData.applicationType) === null || _applicationData$appl === void 0 ? void 0 : _applicationData$appl.includes("MUTATION")) || ((_applicationData2 = applicationData) === null || _applicationData2 === void 0 ? void 0 : (_applicationData2$bus = _applicationData2.businessService) === null || _applicationData2$bus === void 0 ? void 0 : _applicationData2$bus.includes("MUTATION")) || (businessService === null || businessService === void 0 ? void 0 : businessService.includes("MUTATION")) || ((_applicationData3 = applicationData) === null || _applicationData3 === void 0 ? void 0 : (_applicationData3$app = _applicationData3.applicationNo) === null || _applicationData3$app === void 0 ? void 0 : _applicationData3$app.includes("MUT"));
|
|
43142
|
-
const isReasonRequiredAction =
|
|
43527
|
+
const isReasonRequiredAction = (action === null || action === void 0 ? void 0 : (_action$action = action.action) === null || _action$action === void 0 ? void 0 : _action$action.includes("SEND_BACK")) || (action === null || action === void 0 ? void 0 : (_action$action2 = action.action) === null || _action$action2 === void 0 ? void 0 : _action$action2.includes("REJECT"));
|
|
43143
43528
|
const isMobile = window.Digit.Utils.browser.isMobile();
|
|
43144
43529
|
const isEmployee = window.location.href.includes("/employee");
|
|
43145
43530
|
React.useEffect(() => {
|
|
@@ -43203,18 +43588,14 @@ const ActionModal$5 = _ref => {
|
|
|
43203
43588
|
var _applicationData4, _applicationData0, _applicationData1, _applicationData1$app, _applicationData10, _applicationData10$pr, _applicationData11, _applicationData11$pr, _applicationData13, _applicationData14;
|
|
43204
43589
|
let commentValue = (data === null || data === void 0 ? void 0 : data.comments) || "";
|
|
43205
43590
|
if (isReasonRequiredAction) {
|
|
43206
|
-
|
|
43207
|
-
|
|
43591
|
+
var _commentValue;
|
|
43592
|
+
if (!selectedReason && !((_commentValue = commentValue) !== null && _commentValue !== void 0 && _commentValue.trim())) {
|
|
43593
|
+
setError(t("PLEASE_PROVIDE_REASON_OR_COMMENT") || "Please provide a reason or comment");
|
|
43208
43594
|
return;
|
|
43209
43595
|
}
|
|
43210
|
-
if (
|
|
43211
|
-
|
|
43212
|
-
|
|
43213
|
-
return;
|
|
43214
|
-
}
|
|
43215
|
-
commentValue = otherReasonText.trim();
|
|
43216
|
-
} else {
|
|
43217
|
-
commentValue = (selectedReason === null || selectedReason === void 0 ? void 0 : selectedReason.name) || (selectedReason !== null && selectedReason !== void 0 && selectedReason.i18nKey ? t(selectedReason === null || selectedReason === void 0 ? void 0 : selectedReason.i18nKey) : selectedReason === null || selectedReason === void 0 ? void 0 : selectedReason.code);
|
|
43596
|
+
if (selectedReason) {
|
|
43597
|
+
const reasonValue = (selectedReason === null || selectedReason === void 0 ? void 0 : selectedReason.name) || (selectedReason !== null && selectedReason !== void 0 && selectedReason.i18nKey ? t(selectedReason === null || selectedReason === void 0 ? void 0 : selectedReason.i18nKey) : selectedReason === null || selectedReason === void 0 ? void 0 : selectedReason.code);
|
|
43598
|
+
commentValue = commentValue ? reasonValue + "\n" + commentValue : reasonValue;
|
|
43218
43599
|
}
|
|
43219
43600
|
}
|
|
43220
43601
|
if ((_applicationData4 = applicationData) !== null && _applicationData4 !== void 0 && _applicationData4.isBillAmend) {
|
|
@@ -50976,7 +51357,8 @@ const EditModifyApplication = () => {
|
|
|
50976
51357
|
|
|
50977
51358
|
const Step1_SearchConnection = _ref => {
|
|
50978
51359
|
let defaultKNumber = _ref.defaultKNumber,
|
|
50979
|
-
onNext = _ref.onNext
|
|
51360
|
+
onNext = _ref.onNext,
|
|
51361
|
+
isEditFlow = _ref.isEditFlow;
|
|
50980
51362
|
const _useState = React.useState(defaultKNumber || ""),
|
|
50981
51363
|
kNumber = _useState[0],
|
|
50982
51364
|
setKNumber = _useState[1];
|
|
@@ -51015,7 +51397,7 @@ const Step1_SearchConnection = _ref => {
|
|
|
51015
51397
|
setIsLoading(false);
|
|
51016
51398
|
setShowToast({
|
|
51017
51399
|
key: "error",
|
|
51018
|
-
message: "
|
|
51400
|
+
message: "Active connection not found for the given K Number"
|
|
51019
51401
|
});
|
|
51020
51402
|
return;
|
|
51021
51403
|
}
|
|
@@ -51042,11 +51424,12 @@ const Step1_SearchConnection = _ref => {
|
|
|
51042
51424
|
onNext({
|
|
51043
51425
|
kNumber,
|
|
51044
51426
|
mobileNumber: fetchedMobileNumber,
|
|
51045
|
-
serviceType: detectedServiceType
|
|
51427
|
+
serviceType: detectedServiceType,
|
|
51428
|
+
activeConnection: connection
|
|
51046
51429
|
});
|
|
51047
51430
|
});
|
|
51048
51431
|
}
|
|
51049
|
-
let connection = wsResponse === null || wsResponse === void 0 ? void 0 : (_wsResponse$WaterConn = wsResponse.WaterConnection) === null || _wsResponse$WaterConn === void 0 ? void 0 : _wsResponse$WaterConn
|
|
51432
|
+
let connection = wsResponse === null || wsResponse === void 0 ? void 0 : (_wsResponse$WaterConn = wsResponse.WaterConnection) === null || _wsResponse$WaterConn === void 0 ? void 0 : _wsResponse$WaterConn.find(c => c.applicationStatus === 'CONNECTION_ACTIVATED');
|
|
51050
51433
|
const _temp = function () {
|
|
51051
51434
|
if (!connection) {
|
|
51052
51435
|
return Promise.resolve(Digit.WSService.search({
|
|
@@ -51055,7 +51438,7 @@ const Step1_SearchConnection = _ref => {
|
|
|
51055
51438
|
businessService: "SW"
|
|
51056
51439
|
}).catch(() => null)).then(function (swResponse) {
|
|
51057
51440
|
var _swResponse$SewerageC;
|
|
51058
|
-
connection = swResponse === null || swResponse === void 0 ? void 0 : (_swResponse$SewerageC = swResponse.SewerageConnections) === null || _swResponse$SewerageC === void 0 ? void 0 : _swResponse$SewerageC
|
|
51441
|
+
connection = swResponse === null || swResponse === void 0 ? void 0 : (_swResponse$SewerageC = swResponse.SewerageConnections) === null || _swResponse$SewerageC === void 0 ? void 0 : _swResponse$SewerageC.find(c => c.applicationStatus === 'CONNECTION_ACTIVATED');
|
|
51059
51442
|
if (connection) detectedServiceType = "SEWERAGE";
|
|
51060
51443
|
});
|
|
51061
51444
|
}
|
|
@@ -51127,7 +51510,8 @@ const Step1_SearchConnection = _ref => {
|
|
|
51127
51510
|
placeholder: "Enter K Number",
|
|
51128
51511
|
style: {
|
|
51129
51512
|
width: "100%"
|
|
51130
|
-
}
|
|
51513
|
+
},
|
|
51514
|
+
disabled: isEditFlow
|
|
51131
51515
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
51132
51516
|
style: {
|
|
51133
51517
|
display: "flex",
|
|
@@ -51939,6 +52323,12 @@ const Step3_UploadDocuments = _ref => {
|
|
|
51939
52323
|
const _useState9 = React.useState(false),
|
|
51940
52324
|
hasAttemptedSubmit = _useState9[0],
|
|
51941
52325
|
setHasAttemptedSubmit = _useState9[1];
|
|
52326
|
+
const _useState0 = React.useState(false),
|
|
52327
|
+
digiLockerUpload = _useState0[0],
|
|
52328
|
+
setDigilockerUpload = _useState0[1];
|
|
52329
|
+
const _useState1 = React.useState(false),
|
|
52330
|
+
isDocumentUidLocked = _useState1[0],
|
|
52331
|
+
setIsDocumentUidLocked = _useState1[1];
|
|
51942
52332
|
const identityOptions = [{
|
|
51943
52333
|
code: "AADHAAR",
|
|
51944
52334
|
i18nKey: "Aadhaar Card"
|
|
@@ -52054,24 +52444,30 @@ const Step3_UploadDocuments = _ref => {
|
|
|
52054
52444
|
return Promise.reject(e);
|
|
52055
52445
|
}
|
|
52056
52446
|
};
|
|
52447
|
+
React.useEffect(() => {
|
|
52448
|
+
const DIGILOCKER_SUPPORTED_CODES = ["AADHAAR", "AADHAR", "DRIVING", "DRVLC", "PAN"];
|
|
52449
|
+
const upper = ((identityProofType === null || identityProofType === void 0 ? void 0 : identityProofType.code) || "").toUpperCase();
|
|
52450
|
+
const eligible = DIGILOCKER_SUPPORTED_CODES.some(keyword => upper.includes(keyword));
|
|
52451
|
+
setDigilockerUpload(eligible);
|
|
52452
|
+
}, [identityProofType]);
|
|
52057
52453
|
React.useEffect(() => {
|
|
52058
52454
|
if (rawFiles.identity) handleFileUpload(rawFiles.identity, "identity");
|
|
52059
52455
|
}, [rawFiles.identity]);
|
|
52060
52456
|
React.useEffect(() => {
|
|
52061
52457
|
if (rawFiles.mutation) handleFileUpload(rawFiles.mutation, "mutation");
|
|
52062
52458
|
}, [rawFiles.mutation]);
|
|
52063
|
-
const _useState0 = React.useState(""),
|
|
52064
|
-
identityFileName = _useState0[0],
|
|
52065
|
-
setIdentityFileName = _useState0[1];
|
|
52066
|
-
const _useState1 = React.useState(""),
|
|
52067
|
-
mutationFileName = _useState1[0],
|
|
52068
|
-
setMutationFileName = _useState1[1];
|
|
52069
52459
|
const _useState10 = React.useState(""),
|
|
52070
|
-
|
|
52071
|
-
|
|
52460
|
+
identityFileName = _useState10[0],
|
|
52461
|
+
setIdentityFileName = _useState10[1];
|
|
52072
52462
|
const _useState11 = React.useState(""),
|
|
52073
|
-
|
|
52074
|
-
|
|
52463
|
+
mutationFileName = _useState11[0],
|
|
52464
|
+
setMutationFileName = _useState11[1];
|
|
52465
|
+
const _useState12 = React.useState(""),
|
|
52466
|
+
identityFileUrl = _useState12[0],
|
|
52467
|
+
setIdentityFileUrl = _useState12[1];
|
|
52468
|
+
const _useState13 = React.useState(""),
|
|
52469
|
+
mutationFileUrl = _useState13[0],
|
|
52470
|
+
setMutationFileUrl = _useState13[1];
|
|
52075
52471
|
React.useEffect(() => {
|
|
52076
52472
|
const fetchFileDetails = function () {
|
|
52077
52473
|
try {
|
|
@@ -52261,6 +52657,14 @@ const Step3_UploadDocuments = _ref => {
|
|
|
52261
52657
|
selected: identityProofType,
|
|
52262
52658
|
option: identityOptions,
|
|
52263
52659
|
select: val => {
|
|
52660
|
+
if (val.code !== (identityProofType === null || identityProofType === void 0 ? void 0 : identityProofType.code)) {
|
|
52661
|
+
setIdentityProofFile(null);
|
|
52662
|
+
setRawFiles(prev => _extends({}, prev, {
|
|
52663
|
+
identity: null
|
|
52664
|
+
}));
|
|
52665
|
+
setDocumentNumber("");
|
|
52666
|
+
setIsDocumentUidLocked(false);
|
|
52667
|
+
}
|
|
52264
52668
|
setIdentityProofType(val);
|
|
52265
52669
|
setFieldErrors(prev => _extends({}, prev, {
|
|
52266
52670
|
identityType: null
|
|
@@ -52282,10 +52686,12 @@ const Step3_UploadDocuments = _ref => {
|
|
|
52282
52686
|
}, "Document Number ", mandatoryIndicator), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
52283
52687
|
value: documentNumber,
|
|
52284
52688
|
onChange: e => {
|
|
52285
|
-
|
|
52286
|
-
|
|
52287
|
-
|
|
52288
|
-
|
|
52689
|
+
if (!isDocumentUidLocked) {
|
|
52690
|
+
setDocumentNumber(e.target.value);
|
|
52691
|
+
setFieldErrors(prev => _extends({}, prev, {
|
|
52692
|
+
documentNumber: null
|
|
52693
|
+
}));
|
|
52694
|
+
}
|
|
52289
52695
|
},
|
|
52290
52696
|
onBlur: () => {
|
|
52291
52697
|
if (hasAttemptedSubmit) {
|
|
@@ -52296,10 +52702,15 @@ const Step3_UploadDocuments = _ref => {
|
|
|
52296
52702
|
}
|
|
52297
52703
|
},
|
|
52298
52704
|
placeholder: (identityProofType === null || identityProofType === void 0 ? void 0 : identityProofType.code) === "AADHAAR" ? "Enter 12-digit Aadhaar number" : (identityProofType === null || identityProofType === void 0 ? void 0 : identityProofType.code) === "PAN" ? "Enter PAN (e.g. ABCDE1234F)" : "Enter Document Number",
|
|
52705
|
+
disabled: isDocumentUidLocked,
|
|
52299
52706
|
style: _extends({
|
|
52300
52707
|
marginBottom: "4px"
|
|
52301
52708
|
}, fieldErrors.documentNumber ? {
|
|
52302
52709
|
border: "1px solid #d32f2f"
|
|
52710
|
+
} : {}, isDocumentUidLocked ? {
|
|
52711
|
+
backgroundColor: "#f0f0f0",
|
|
52712
|
+
cursor: "not-allowed",
|
|
52713
|
+
color: "#555"
|
|
52303
52714
|
} : {})
|
|
52304
52715
|
}), fieldErrors.documentNumber && /*#__PURE__*/React__default.createElement("div", {
|
|
52305
52716
|
style: errorTextStyle
|
|
@@ -52315,7 +52726,49 @@ const Step3_UploadDocuments = _ref => {
|
|
|
52315
52726
|
}
|
|
52316
52727
|
}, "Format: ABCDE1234F"), /*#__PURE__*/React__default.createElement("div", {
|
|
52317
52728
|
style: uploadBoxStyle(!!fieldErrors.identityFile, !!identityProofFile)
|
|
52318
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
52729
|
+
}, digiLockerUpload ? /*#__PURE__*/React__default.createElement(UploadFileDigiLocker, {
|
|
52730
|
+
id: "identity-upload",
|
|
52731
|
+
onUpload: (e, newFile) => {
|
|
52732
|
+
if (newFile) {
|
|
52733
|
+
setRawFiles(prev => _extends({}, prev, {
|
|
52734
|
+
identity: newFile
|
|
52735
|
+
}));
|
|
52736
|
+
} else {
|
|
52737
|
+
setRawFiles(prev => _extends({}, prev, {
|
|
52738
|
+
identity: e.target.files[0]
|
|
52739
|
+
}));
|
|
52740
|
+
}
|
|
52741
|
+
},
|
|
52742
|
+
onDelete: () => {
|
|
52743
|
+
setIdentityProofFile(null);
|
|
52744
|
+
setRawFiles(prev => _extends({}, prev, {
|
|
52745
|
+
identity: null
|
|
52746
|
+
}));
|
|
52747
|
+
setDocumentNumber("");
|
|
52748
|
+
setIsDocumentUidLocked(false);
|
|
52749
|
+
},
|
|
52750
|
+
message: identityProofFile ? "Uploaded" : "Click to Choose File",
|
|
52751
|
+
accept: "image/*, .pdf, .png, .jpeg, .jpg",
|
|
52752
|
+
uploadedFiles: identityProofFile && !rawFiles.identity ? [["Document", {
|
|
52753
|
+
fileStoreId: identityProofFile
|
|
52754
|
+
}]] : undefined,
|
|
52755
|
+
removeTargetedFile: () => {
|
|
52756
|
+
setIdentityProofFile(null);
|
|
52757
|
+
setRawFiles(prev => _extends({}, prev, {
|
|
52758
|
+
identity: null
|
|
52759
|
+
}));
|
|
52760
|
+
setDocumentNumber("");
|
|
52761
|
+
setIsDocumentUidLocked(false);
|
|
52762
|
+
},
|
|
52763
|
+
documentType: identityProofType === null || identityProofType === void 0 ? void 0 : identityProofType.code,
|
|
52764
|
+
onDocumentNumber: num => {
|
|
52765
|
+
setDocumentNumber(num);
|
|
52766
|
+
setIsDocumentUidLocked(true);
|
|
52767
|
+
setFieldErrors(prev => _extends({}, prev, {
|
|
52768
|
+
documentNumber: null
|
|
52769
|
+
}));
|
|
52770
|
+
}
|
|
52771
|
+
}) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.UploadFile, {
|
|
52319
52772
|
id: "identity-upload",
|
|
52320
52773
|
onUpload: e => setRawFiles(prev => _extends({}, prev, {
|
|
52321
52774
|
identity: e.target.files[0]
|
|
@@ -53021,45 +53474,54 @@ const MutationApplication = () => {
|
|
|
53021
53474
|
var _Digit$SessionStorage, _user$info, _state, _user$info2, _user$info2$userName, _user$info3, _user$info4, _details$applicationD, _applicationDetails$a, _applicationDetails$a2, _applicationDetails$a4, _applicationDetails$a8, _applicationDetails$a9;
|
|
53022
53475
|
const _useTranslation = reactI18next.useTranslation(),
|
|
53023
53476
|
t = _useTranslation.t;
|
|
53024
|
-
|
|
53025
|
-
|
|
53477
|
+
const _useRouteMatch = reactRouterDom.useRouteMatch(),
|
|
53478
|
+
path = _useRouteMatch.path;
|
|
53479
|
+
const location = reactRouterDom.useLocation();
|
|
53480
|
+
let state = location.state;
|
|
53026
53481
|
state = state ? typeof state === "string" ? JSON.parse(state) : state : {};
|
|
53027
53482
|
const history = reactRouterDom.useHistory();
|
|
53028
53483
|
let filters = getQueryStringParams(location.search);
|
|
53029
|
-
const
|
|
53030
|
-
|
|
53031
|
-
|
|
53032
|
-
|
|
53033
|
-
|
|
53034
|
-
|
|
53035
|
-
|
|
53036
|
-
|
|
53037
|
-
|
|
53038
|
-
|
|
53039
|
-
|
|
53040
|
-
|
|
53041
|
-
|
|
53042
|
-
|
|
53043
|
-
|
|
53044
|
-
|
|
53045
|
-
|
|
53046
|
-
const
|
|
53047
|
-
isMobile =
|
|
53048
|
-
setIsMobile =
|
|
53484
|
+
const currentStep = location.pathname.includes("/search-connection") ? 1 : location.pathname.includes("/existing-connection") ? 2 : location.pathname.includes("/consumer-details") ? 3 : location.pathname.includes("/document") ? 4 : location.pathname.includes("/preview") ? 5 : location.pathname.includes("/submission") ? 6 : 1;
|
|
53485
|
+
const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("MUTATION_APP_FORM_DATA", {}),
|
|
53486
|
+
formData = _Digit$Hooks$useSessi[0],
|
|
53487
|
+
setFormData = _Digit$Hooks$useSessi[1],
|
|
53488
|
+
clearFormData = _Digit$Hooks$useSessi[2];
|
|
53489
|
+
const _useState = React.useState(null),
|
|
53490
|
+
showToast = _useState[0],
|
|
53491
|
+
setShowToast = _useState[1];
|
|
53492
|
+
const _useState2 = React.useState(null),
|
|
53493
|
+
generatedAppNo = _useState2[0],
|
|
53494
|
+
setGeneratedAppNo = _useState2[1];
|
|
53495
|
+
const _useState3 = React.useState(false),
|
|
53496
|
+
isSubmitting = _useState3[0],
|
|
53497
|
+
setIsSubmitting = _useState3[1];
|
|
53498
|
+
const _Digit$Hooks$useSessi2 = Digit.Hooks.useSessionStorage("MUTATION_APP_COMPLETED_STEPS", []),
|
|
53499
|
+
setCompletedSteps = _Digit$Hooks$useSessi2[1],
|
|
53500
|
+
clearCompletedSteps = _Digit$Hooks$useSessi2[2];
|
|
53501
|
+
const _useState4 = React.useState(window.innerWidth < 768),
|
|
53502
|
+
isMobile = _useState4[0],
|
|
53503
|
+
setIsMobile = _useState4[1];
|
|
53049
53504
|
React.useEffect(() => {
|
|
53050
53505
|
const handleResize = () => setIsMobile(window.innerWidth < 768);
|
|
53051
53506
|
window.addEventListener("resize", handleResize);
|
|
53052
53507
|
return () => window.removeEventListener("resize", handleResize);
|
|
53053
53508
|
}, []);
|
|
53054
|
-
const
|
|
53055
|
-
authKNumber =
|
|
53056
|
-
setAuthKNumber =
|
|
53057
|
-
|
|
53058
|
-
|
|
53059
|
-
|
|
53060
|
-
|
|
53061
|
-
|
|
53062
|
-
|
|
53509
|
+
const _Digit$Hooks$useSessi3 = Digit.Hooks.useSessionStorage("MUTATION_APP_K_NUMBER", ""),
|
|
53510
|
+
authKNumber = _Digit$Hooks$useSessi3[0],
|
|
53511
|
+
setAuthKNumber = _Digit$Hooks$useSessi3[1],
|
|
53512
|
+
clearAuthKNumber = _Digit$Hooks$useSessi3[2];
|
|
53513
|
+
const _Digit$Hooks$useSessi4 = Digit.Hooks.useSessionStorage("MUTATION_APP_MOBILE", ""),
|
|
53514
|
+
authMobileNumber = _Digit$Hooks$useSessi4[0],
|
|
53515
|
+
setAuthMobileNumber = _Digit$Hooks$useSessi4[1],
|
|
53516
|
+
clearAuthMobileNumber = _Digit$Hooks$useSessi4[2];
|
|
53517
|
+
const _Digit$Hooks$useSessi5 = Digit.Hooks.useSessionStorage("MUTATION_APP_SERVICE", ""),
|
|
53518
|
+
authServiceType = _Digit$Hooks$useSessi5[0],
|
|
53519
|
+
setAuthServiceType = _Digit$Hooks$useSessi5[1],
|
|
53520
|
+
clearAuthServiceType = _Digit$Hooks$useSessi5[2];
|
|
53521
|
+
const _Digit$Hooks$useSessi6 = Digit.Hooks.useSessionStorage("MUTATION_APP_ACTIVE_CONN", null),
|
|
53522
|
+
authActiveConnection = _Digit$Hooks$useSessi6[0],
|
|
53523
|
+
setAuthActiveConnection = _Digit$Hooks$useSessi6[1],
|
|
53524
|
+
clearAuthActiveConnection = _Digit$Hooks$useSessi6[2];
|
|
53063
53525
|
const user = Digit.UserService.getUser();
|
|
53064
53526
|
let tenantId = (filters === null || filters === void 0 ? void 0 : filters.tenantId) || ((_Digit$SessionStorage = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.code) || (user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.permanentCity) || Digit.ULBService.getCurrentTenantId();
|
|
53065
53527
|
const applicationNumber = filters === null || filters === void 0 ? void 0 : filters.applicationNumber;
|
|
@@ -53094,7 +53556,7 @@ const MutationApplication = () => {
|
|
|
53094
53556
|
applicationNumber: querySearchParam
|
|
53095
53557
|
} : {
|
|
53096
53558
|
connectionNumber: querySearchParam,
|
|
53097
|
-
|
|
53559
|
+
searchType: 'CONNECTION'
|
|
53098
53560
|
};
|
|
53099
53561
|
Object.keys(params).forEach(k => params[k] == null && delete params[k]);
|
|
53100
53562
|
return Promise.resolve(Digit.WSService.search({
|
|
@@ -53102,8 +53564,14 @@ const MutationApplication = () => {
|
|
|
53102
53564
|
filters: params,
|
|
53103
53565
|
businessService
|
|
53104
53566
|
})).then(function (rawData) {
|
|
53105
|
-
|
|
53106
|
-
|
|
53567
|
+
let wsData;
|
|
53568
|
+
if (businessService === "WS") {
|
|
53569
|
+
var _rawData$WaterConnect, _rawData$WaterConnect2;
|
|
53570
|
+
wsData = (rawData === null || rawData === void 0 ? void 0 : (_rawData$WaterConnect = rawData.WaterConnection) === null || _rawData$WaterConnect === void 0 ? void 0 : _rawData$WaterConnect.find(c => c.applicationStatus === 'CONNECTION_ACTIVATED')) || (rawData === null || rawData === void 0 ? void 0 : (_rawData$WaterConnect2 = rawData.WaterConnection) === null || _rawData$WaterConnect2 === void 0 ? void 0 : _rawData$WaterConnect2[0]);
|
|
53571
|
+
} else {
|
|
53572
|
+
var _rawData$SewerageConn, _rawData$SewerageConn2;
|
|
53573
|
+
wsData = (rawData === null || rawData === void 0 ? void 0 : (_rawData$SewerageConn = rawData.SewerageConnections) === null || _rawData$SewerageConn === void 0 ? void 0 : _rawData$SewerageConn.find(c => c.applicationStatus === 'CONNECTION_ACTIVATED')) || (rawData === null || rawData === void 0 ? void 0 : (_rawData$SewerageConn2 = rawData.SewerageConnections) === null || _rawData$SewerageConn2 === void 0 ? void 0 : _rawData$SewerageConn2[0]);
|
|
53574
|
+
}
|
|
53107
53575
|
return wsData ? {
|
|
53108
53576
|
applicationData: wsData,
|
|
53109
53577
|
WaterConnection: rawData === null || rawData === void 0 ? void 0 : rawData.WaterConnection,
|
|
@@ -53122,8 +53590,8 @@ const MutationApplication = () => {
|
|
|
53122
53590
|
fetchedApplicationDetails = _useQuery2.data;
|
|
53123
53591
|
const applicationDetails = hasStateData ? details : fetchedApplicationDetails;
|
|
53124
53592
|
const resolvedServiceType = serviceType || authServiceType || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a = applicationDetails.applicationData) === null || _applicationDetails$a === void 0 ? void 0 : _applicationDetails$a.serviceType) || "WATER";
|
|
53125
|
-
const
|
|
53126
|
-
propertyId =
|
|
53593
|
+
const _useState5 = React.useState(new URLSearchParams(reactRouterDom.useLocation().search).get("propertyId") || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a2 = applicationDetails.applicationData) === null || _applicationDetails$a2 === void 0 ? void 0 : _applicationDetails$a2.propertyId)),
|
|
53594
|
+
propertyId = _useState5[0];
|
|
53127
53595
|
const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertySearch({
|
|
53128
53596
|
filters: {
|
|
53129
53597
|
propertyIds: propertyId
|
|
@@ -53138,10 +53606,10 @@ const MutationApplication = () => {
|
|
|
53138
53606
|
}),
|
|
53139
53607
|
propertyDetails = _Digit$Hooks$pt$usePr.data,
|
|
53140
53608
|
isPropertyLoading = _Digit$Hooks$pt$usePr.isLoading;
|
|
53141
|
-
const _Digit$Hooks$
|
|
53142
|
-
sessionFormData = _Digit$Hooks$
|
|
53143
|
-
setSessionFormData = _Digit$Hooks$
|
|
53144
|
-
clearSessionFormData = _Digit$Hooks$
|
|
53609
|
+
const _Digit$Hooks$useSessi7 = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}),
|
|
53610
|
+
sessionFormData = _Digit$Hooks$useSessi7[0],
|
|
53611
|
+
setSessionFormData = _Digit$Hooks$useSessi7[1],
|
|
53612
|
+
clearSessionFormData = _Digit$Hooks$useSessi7[2];
|
|
53145
53613
|
React.useEffect(() => {
|
|
53146
53614
|
var _applicationDetails$a3;
|
|
53147
53615
|
const fetchAppData = function () {
|
|
@@ -53256,16 +53724,6 @@ const MutationApplication = () => {
|
|
|
53256
53724
|
waterUpdateMutation = _Digit$Hooks$ws$useWS.mutate;
|
|
53257
53725
|
const _Digit$Hooks$ws$useWS2 = Digit.Hooks.ws.useWSApplicationActions("SEWERAGE"),
|
|
53258
53726
|
sewerageUpdateMutation = _Digit$Hooks$ws$useWS2.mutate;
|
|
53259
|
-
const handleNextStep2 = data => {
|
|
53260
|
-
setFormData(prev => _extends({}, prev, data));
|
|
53261
|
-
setCompletedSteps(prev => new Set([...prev, 3]));
|
|
53262
|
-
setCurrentStep(4);
|
|
53263
|
-
};
|
|
53264
|
-
const handleNextStep3 = data => {
|
|
53265
|
-
setFormData(prev => _extends({}, prev, data));
|
|
53266
|
-
setCompletedSteps(prev => new Set([...prev, 4]));
|
|
53267
|
-
setCurrentStep(5);
|
|
53268
|
-
};
|
|
53269
53727
|
const submitApplication = function () {
|
|
53270
53728
|
try {
|
|
53271
53729
|
setIsSubmitting(true);
|
|
@@ -53303,7 +53761,6 @@ const MutationApplication = () => {
|
|
|
53303
53761
|
const sessionDetails = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {};
|
|
53304
53762
|
const existingDocs = (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a5 = applicationDetails.applicationData) === null || _applicationDetails$a5 === void 0 ? void 0 : _applicationDetails$a5.documents) || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$W = applicationDetails.WaterConnection) === null || _applicationDetails$W === void 0 ? void 0 : (_applicationDetails$W2 = _applicationDetails$W[0]) === null || _applicationDetails$W2 === void 0 ? void 0 : _applicationDetails$W2.documents) || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$S = applicationDetails.SewerageConnections) === null || _applicationDetails$S === void 0 ? void 0 : (_applicationDetails$S2 = _applicationDetails$S[0]) === null || _applicationDetails$S2 === void 0 ? void 0 : _applicationDetails$S2.documents) || (applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.documents) || (details === null || details === void 0 ? void 0 : (_details$applicationD2 = details.applicationData) === null || _details$applicationD2 === void 0 ? void 0 : _details$applicationD2.documents) || (details === null || details === void 0 ? void 0 : details.documents) || [];
|
|
53305
53763
|
return Promise.resolve(convertModifyApplicationDetails(finalData, sessionDetails, "INITIATE")).then(function (convertAppData) {
|
|
53306
|
-
var _convertAppData$docum;
|
|
53307
53764
|
if (!convertAppData.dateEffectiveFrom) {
|
|
53308
53765
|
convertAppData.dateEffectiveFrom = Date.now() + 86400000;
|
|
53309
53766
|
}
|
|
@@ -53344,9 +53801,6 @@ const MutationApplication = () => {
|
|
|
53344
53801
|
convertAppData.additionalDetails.identityProofDocumentId = mutDetails.identityProofDocumentId || "";
|
|
53345
53802
|
}
|
|
53346
53803
|
}
|
|
53347
|
-
if ((convertAppData === null || convertAppData === void 0 ? void 0 : (_convertAppData$docum = convertAppData.documents) === null || _convertAppData$docum === void 0 ? void 0 : _convertAppData$docum.length) > 0 && existingDocs.length > 0) {
|
|
53348
|
-
convertAppData.documents = mapExistingDocIdsToPayload(convertAppData.documents, existingDocs);
|
|
53349
|
-
}
|
|
53350
53804
|
convertAppData.applicationType = resolvedServiceType === "WATER" ? "MUTATION_WATER_CONNECTION" : "MUTATION_SEWERAGE_CONNECTION";
|
|
53351
53805
|
if (isEditFlow) {
|
|
53352
53806
|
var _applicationDetails$a6, _applicationDetails$a7, _updatePayload, _updatePayload$docume, _Digit, _Digit$Customizations, _Digit$Customizations2;
|
|
@@ -53358,7 +53812,33 @@ const MutationApplication = () => {
|
|
|
53358
53812
|
})
|
|
53359
53813
|
});
|
|
53360
53814
|
if (((_updatePayload = updatePayload) === null || _updatePayload === void 0 ? void 0 : (_updatePayload$docume = _updatePayload.documents) === null || _updatePayload$docume === void 0 ? void 0 : _updatePayload$docume.length) > 0 && existingDocs.length > 0) {
|
|
53361
|
-
|
|
53815
|
+
const activePayloadDocs = updatePayload.documents;
|
|
53816
|
+
let finalDocs = [];
|
|
53817
|
+
activePayloadDocs.forEach(newDoc => {
|
|
53818
|
+
const oldDoc = existingDocs.find(d => d.documentType === newDoc.documentType);
|
|
53819
|
+
if (oldDoc) {
|
|
53820
|
+
if (oldDoc.fileStoreId === newDoc.fileStoreId) {
|
|
53821
|
+
finalDocs.push(_extends({}, newDoc, {
|
|
53822
|
+
id: oldDoc.id
|
|
53823
|
+
}));
|
|
53824
|
+
} else {
|
|
53825
|
+
finalDocs.push(newDoc);
|
|
53826
|
+
finalDocs.push(_extends({}, oldDoc, {
|
|
53827
|
+
status: "INACTIVE"
|
|
53828
|
+
}));
|
|
53829
|
+
}
|
|
53830
|
+
} else {
|
|
53831
|
+
finalDocs.push(newDoc);
|
|
53832
|
+
}
|
|
53833
|
+
});
|
|
53834
|
+
existingDocs.forEach(oldDoc => {
|
|
53835
|
+
if (!activePayloadDocs.find(d => d.documentType === oldDoc.documentType)) {
|
|
53836
|
+
finalDocs.push(_extends({}, oldDoc, {
|
|
53837
|
+
status: "INACTIVE"
|
|
53838
|
+
}));
|
|
53839
|
+
}
|
|
53840
|
+
});
|
|
53841
|
+
updatePayload.documents = finalDocs;
|
|
53362
53842
|
}
|
|
53363
53843
|
if ((_Digit = Digit) !== null && _Digit !== void 0 && (_Digit$Customizations = _Digit.Customizations) !== null && _Digit$Customizations !== void 0 && (_Digit$Customizations2 = _Digit$Customizations.WS) !== null && _Digit$Customizations2 !== void 0 && _Digit$Customizations2.customiseUpdatePayloadOfWS) {
|
|
53364
53844
|
updatePayload = Digit.Customizations.WS.customiseUpdatePayloadOfWS((applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.applicationData) || {}, updatePayload, resolvedServiceType);
|
|
@@ -53403,9 +53883,15 @@ const MutationApplication = () => {
|
|
|
53403
53883
|
return;
|
|
53404
53884
|
}
|
|
53405
53885
|
clearSessionFormData();
|
|
53886
|
+
clearFormData();
|
|
53887
|
+
clearCompletedSteps();
|
|
53888
|
+
clearAuthKNumber();
|
|
53889
|
+
clearAuthMobileNumber();
|
|
53890
|
+
clearAuthServiceType();
|
|
53891
|
+
clearAuthActiveConnection();
|
|
53406
53892
|
const newAppNo = resolvedServiceType === "WATER" ? updateData === null || updateData === void 0 ? void 0 : (_updateData$WaterConn = updateData.WaterConnection) === null || _updateData$WaterConn === void 0 ? void 0 : (_updateData$WaterConn2 = _updateData$WaterConn[0]) === null || _updateData$WaterConn2 === void 0 ? void 0 : _updateData$WaterConn2.applicationNo : updateData === null || updateData === void 0 ? void 0 : (_updateData$SewerageC = updateData.SewerageConnections) === null || _updateData$SewerageC === void 0 ? void 0 : (_updateData$SewerageC2 = _updateData$SewerageC[0]) === null || _updateData$SewerageC2 === void 0 ? void 0 : _updateData$SewerageC2.applicationNo;
|
|
53407
53893
|
setGeneratedAppNo(newAppNo);
|
|
53408
|
-
|
|
53894
|
+
history.push(path + "/submission");
|
|
53409
53895
|
}
|
|
53410
53896
|
});
|
|
53411
53897
|
return;
|
|
@@ -53504,9 +53990,15 @@ const MutationApplication = () => {
|
|
|
53504
53990
|
return;
|
|
53505
53991
|
}
|
|
53506
53992
|
clearSessionFormData();
|
|
53993
|
+
clearFormData();
|
|
53994
|
+
clearCompletedSteps();
|
|
53995
|
+
clearAuthKNumber();
|
|
53996
|
+
clearAuthMobileNumber();
|
|
53997
|
+
clearAuthServiceType();
|
|
53998
|
+
clearAuthActiveConnection();
|
|
53507
53999
|
const newAppNo = resolvedServiceType === "WATER" ? updateData === null || updateData === void 0 ? void 0 : (_updateData$WaterConn3 = updateData.WaterConnection) === null || _updateData$WaterConn3 === void 0 ? void 0 : (_updateData$WaterConn4 = _updateData$WaterConn3[0]) === null || _updateData$WaterConn4 === void 0 ? void 0 : _updateData$WaterConn4.applicationNo : updateData === null || updateData === void 0 ? void 0 : (_updateData$SewerageC3 = updateData.SewerageConnections) === null || _updateData$SewerageC3 === void 0 ? void 0 : (_updateData$SewerageC4 = _updateData$SewerageC3[0]) === null || _updateData$SewerageC4 === void 0 ? void 0 : _updateData$SewerageC4.applicationNo;
|
|
53508
54000
|
setGeneratedAppNo(newAppNo);
|
|
53509
|
-
|
|
54001
|
+
history.push(path + "/submission");
|
|
53510
54002
|
}
|
|
53511
54003
|
});
|
|
53512
54004
|
}
|
|
@@ -53528,11 +54020,8 @@ const MutationApplication = () => {
|
|
|
53528
54020
|
const handleTimelineSelect = (route, index) => {
|
|
53529
54021
|
const targetStep = index + 1;
|
|
53530
54022
|
if (targetStep < currentStep) {
|
|
53531
|
-
|
|
53532
|
-
|
|
53533
|
-
}
|
|
53534
|
-
if (targetStep === currentStep) return;
|
|
53535
|
-
if (targetStep > currentStep) {
|
|
54023
|
+
if (targetStep === 1) history.push(path + "/search-connection");else if (targetStep === 2) history.push(path + "/existing-connection");else if (targetStep === 3) history.push(path + "/consumer-details");else if (targetStep === 4) history.push(path + "/document");else if (targetStep === 5) history.push(path + "/preview");
|
|
54024
|
+
} else if (targetStep > currentStep) {
|
|
53536
54025
|
setShowToast({
|
|
53537
54026
|
key: "warning",
|
|
53538
54027
|
message: "Please complete Step " + currentStep + " before proceeding to Step " + targetStep + "."
|
|
@@ -53581,51 +54070,83 @@ const MutationApplication = () => {
|
|
|
53581
54070
|
overflowY: "auto",
|
|
53582
54071
|
minWidth: 0
|
|
53583
54072
|
}
|
|
53584
|
-
},
|
|
54073
|
+
}, /*#__PURE__*/React__default.createElement(reactRouterDom.Switch, null, /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
|
|
54074
|
+
path: path + "/search-connection"
|
|
54075
|
+
}, /*#__PURE__*/React__default.createElement(Step1_SearchConnection, {
|
|
53585
54076
|
t: t,
|
|
53586
54077
|
defaultKNumber: isEditFlow ? applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a8 = applicationDetails.applicationData) === null || _applicationDetails$a8 === void 0 ? void 0 : _applicationDetails$a8.connectionNo : "",
|
|
54078
|
+
isEditFlow: isEditFlow,
|
|
53587
54079
|
onNext: _ref => {
|
|
53588
54080
|
let kNumber = _ref.kNumber,
|
|
53589
54081
|
mobileNumber = _ref.mobileNumber,
|
|
53590
|
-
detectedServiceType = _ref.serviceType
|
|
54082
|
+
detectedServiceType = _ref.serviceType,
|
|
54083
|
+
activeConnection = _ref.activeConnection;
|
|
53591
54084
|
setAuthKNumber(kNumber);
|
|
53592
54085
|
setAuthMobileNumber(mobileNumber);
|
|
53593
54086
|
if (detectedServiceType) setAuthServiceType(detectedServiceType);
|
|
53594
|
-
|
|
53595
|
-
|
|
54087
|
+
if (activeConnection) setAuthActiveConnection(activeConnection);
|
|
54088
|
+
setCompletedSteps(prev => [...new Set([...prev, 1])]);
|
|
54089
|
+
history.push(path + "/existing-connection");
|
|
53596
54090
|
}
|
|
53597
|
-
}),
|
|
54091
|
+
})), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
|
|
54092
|
+
path: path + "/existing-connection"
|
|
54093
|
+
}, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(Step1_ExistingConnection, {
|
|
53598
54094
|
t: t,
|
|
53599
|
-
applicationDetails:
|
|
53600
|
-
|
|
54095
|
+
applicationDetails: authActiveConnection ? {
|
|
54096
|
+
applicationData: authActiveConnection
|
|
54097
|
+
} : applicationDetails,
|
|
54098
|
+
propertyId: (authActiveConnection === null || authActiveConnection === void 0 ? void 0 : authActiveConnection.propertyId) || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a9 = applicationDetails.applicationData) === null || _applicationDetails$a9 === void 0 ? void 0 : _applicationDetails$a9.propertyId),
|
|
53601
54099
|
mobileNumber: authMobileNumber,
|
|
53602
54100
|
onVerify: () => {
|
|
53603
|
-
setCompletedSteps(prev => new Set([...prev, 2]));
|
|
53604
|
-
|
|
54101
|
+
setCompletedSteps(prev => [...new Set([...prev, 2])]);
|
|
54102
|
+
history.push(path + "/consumer-details");
|
|
53605
54103
|
}
|
|
53606
|
-
})),
|
|
54104
|
+
}))), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
|
|
54105
|
+
path: path + "/consumer-details"
|
|
54106
|
+
}, /*#__PURE__*/React__default.createElement(Step2_NewConsumerDetails, {
|
|
53607
54107
|
t: t,
|
|
53608
54108
|
defaultValues: formData,
|
|
53609
|
-
onNext:
|
|
53610
|
-
|
|
53611
|
-
|
|
54109
|
+
onNext: data => {
|
|
54110
|
+
setFormData(prev => _extends({}, prev, data));
|
|
54111
|
+
setCompletedSteps(prev => [...new Set([...prev, 3])]);
|
|
54112
|
+
history.push(path + "/document");
|
|
54113
|
+
},
|
|
54114
|
+
onBack: () => history.push(path + "/existing-connection")
|
|
54115
|
+
})), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
|
|
54116
|
+
path: path + "/document"
|
|
54117
|
+
}, /*#__PURE__*/React__default.createElement(Step3_UploadDocuments, {
|
|
53612
54118
|
t: t,
|
|
53613
54119
|
defaultValues: formData,
|
|
53614
|
-
onNext:
|
|
53615
|
-
|
|
53616
|
-
|
|
54120
|
+
onNext: data => {
|
|
54121
|
+
setFormData(prev => _extends({}, prev, data));
|
|
54122
|
+
setCompletedSteps(prev => [...new Set([...prev, 4])]);
|
|
54123
|
+
history.push(path + "/preview");
|
|
54124
|
+
},
|
|
54125
|
+
onBack: () => history.push(path + "/consumer-details")
|
|
54126
|
+
})), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
|
|
54127
|
+
path: path + "/preview"
|
|
54128
|
+
}, /*#__PURE__*/React__default.createElement(Step4_Preview, {
|
|
53617
54129
|
t: t,
|
|
53618
54130
|
formData: formData,
|
|
53619
|
-
applicationDetails:
|
|
54131
|
+
applicationDetails: authActiveConnection ? {
|
|
54132
|
+
applicationData: authActiveConnection
|
|
54133
|
+
} : applicationDetails,
|
|
53620
54134
|
resolvedServiceType: resolvedServiceType,
|
|
53621
|
-
onBack: () =>
|
|
54135
|
+
onBack: () => history.push(path + "/document"),
|
|
53622
54136
|
onSubmit: submitApplication,
|
|
53623
54137
|
isLoading: isSubmitting
|
|
53624
|
-
}),
|
|
54138
|
+
})), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
|
|
54139
|
+
path: path + "/submission"
|
|
54140
|
+
}, /*#__PURE__*/React__default.createElement(Step5_Submission, {
|
|
53625
54141
|
t: t,
|
|
53626
54142
|
applicationNumber: generatedAppNo,
|
|
53627
54143
|
serviceType: resolvedServiceType
|
|
53628
|
-
}),
|
|
54144
|
+
})), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
|
|
54145
|
+
exact: true,
|
|
54146
|
+
path: path
|
|
54147
|
+
}, /*#__PURE__*/React__default.createElement(reactRouterDom.Redirect, {
|
|
54148
|
+
to: path + "/search-connection"
|
|
54149
|
+
}))), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
53629
54150
|
error: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "error",
|
|
53630
54151
|
warning: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "warning",
|
|
53631
54152
|
label: t(showToast === null || showToast === void 0 ? void 0 : showToast.message),
|