@djb25/digit-ui-module-ws 1.0.82 → 1.0.83
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 +139 -28
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +139 -28
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33635,7 +33635,7 @@ const getConnectionDetailsPDF = function (application, property, tenantInfo, t)
|
|
|
33635
33635
|
};
|
|
33636
33636
|
|
|
33637
33637
|
const ConnectionDetails$5 = () => {
|
|
33638
|
-
var _Digit$SessionStorage, _user$info, _data$SewerageConnect, _data$SewerageConnect2, _data$WaterConnection, _data$WaterConnection2, _Object$keys, _connectionData$Water, _connectionData$Sewer, _data$WaterConnection3, _data$WaterConnection4, _data$WaterConnection5, _data$WaterConnection6, _data$WaterConnection7, _data$WaterConnection8, _data$WaterConnection9, _data$WaterConnection0, _data$SewerageConnect3, _data$SewerageConnect4, _data$SewerageConnect5, _data$SewerageConnect6, _state, _state$applicationNo, _state2, _state3, _state4, _state4$applicationTy, _state5, _state6, _state7, _state8, _state8$applicationTy, _state9, _state0, _state1, _state10, _state10$applicationT, _state11, _state12, _state13, _state14, _state15, _state15$applicationT, _state16, _state16$waterSource, _state16$waterSource$, _state17, _state18, _state18$waterSource, _state18$waterSource$, _state19, _state20, _state21, _state22, _state22$additionalDe, _state23, _state23$applicationT, _state24, _state24$additionalDe, _state24$additionalDe2, _state25, _state25$additionalDe, _state25$additionalDe2, _state26, _state26$additionalDe, _state27, _state27$additionalDe, _state28, _state28$additionalDe, _state28$additionalDe2, _state29, _state29$additionalDe, _state30, _state31, _state32, _state33, _state33$property, _state33$property$own, _PTData$Properties2, _PTData$Properties2$, _PTData$Properties3, _PTData$Properties3$, _PTData$Properties3$$, _PTData$Properties3$$2, _PTData$Properties4, _PTData$Properties4$, _user$info2, _user$info2$userName, _user$info3, _user$info4, _state34, _state34$additionalDe, _state34$additionalDe2, _state35, _state35$additionalDe, _state35$additionalDe2, _state36, _state36$additionalDe, _state37, _state37$additionalDe, _state38, _state38$additionalDe, _state39, _state39$additionalDe, _state40, _state40$additionalDe, _state41, _state42, _state43, _state44, _state44$connectionHo, _state44$connectionHo2, _data$WaterConnection16, _data$WaterConnection17, _data$WaterConnection18, _data$WaterConnection19, _data$SewerageConnect0, _data$SewerageConnect1, _data$SewerageConnect10, _data$SewerageConnect11, _data$WaterConnection20, _data$WaterConnection21, _data$WaterConnection22, _data$WaterConnection23, _data$SewerageConnect12, _data$SewerageConnect13, _data$SewerageConnect14, _data$SewerageConnect15, _data$WaterConnection24, _data$WaterConnection25, _data$WaterConnection26, _data$WaterConnection27, _data$SewerageConnect16, _data$SewerageConnect17, _data$SewerageConnect18, _data$SewerageConnect19, _data$WaterConnection28, _data$WaterConnection29, _data$WaterConnection30, _data$WaterConnection31, _data$SewerageConnect20, _data$SewerageConnect21, _data$SewerageConnect22, _data$SewerageConnect23, _data$WaterConnection32, _data$WaterConnection33, _data$WaterConnection34, _data$WaterConnection35, _data$SewerageConnect24, _data$SewerageConnect25, _data$SewerageConnect26, _data$SewerageConnect27, _data$WaterConnection36, _data$WaterConnection37, _data$WaterConnection38, _data$WaterConnection39, _data$SewerageConnect28, _data$SewerageConnect29, _data$SewerageConnect30, _data$SewerageConnect31, _data$WaterConnection40, _data$WaterConnection41, _data$WaterConnection42, _data$WaterConnection43, _data$SewerageConnect32, _data$SewerageConnect33, _data$SewerageConnect34, _data$SewerageConnect35, _data$WaterConnection44, _data$WaterConnection45, _data$WaterConnection46, _data$WaterConnection47, _data$SewerageConnect36, _data$SewerageConnect37, _data$SewerageConnect38, _data$SewerageConnect39, _data$WaterConnection48, _data$WaterConnection49, _data$WaterConnection50, _data$WaterConnection51, _data$SewerageConnect40, _data$SewerageConnect41, _data$SewerageConnect42, _data$SewerageConnect43, _data$WaterConnection52, _data$WaterConnection53, _data$WaterConnection54, _data$WaterConnection55, _data$SewerageConnect44, _data$SewerageConnect45, _data$SewerageConnect46, _data$SewerageConnect47, _state45, _state45$additionalDe, _state46, _state46$additionalDe, _state47, _state47$additionalDe, _state48, _state48$additionalDe, _state49, _state49$additionalDe, _state50, _state51, _state54, _state55, _state56, _state57, _state58, _state59, _paymentDetails$data17, _paymentDetails$data18;
|
|
33638
|
+
var _Digit$SessionStorage, _user$info, _data$SewerageConnect, _data$SewerageConnect2, _data$WaterConnection, _data$WaterConnection2, _Object$keys, _connectionData$Water, _connectionData$Water2, _connectionData$Sewer, _connectionData$Sewer2, _data$WaterConnection3, _data$WaterConnection4, _data$WaterConnection5, _data$WaterConnection6, _data$WaterConnection7, _data$WaterConnection8, _data$WaterConnection9, _data$WaterConnection0, _data$SewerageConnect3, _data$SewerageConnect4, _data$SewerageConnect5, _data$SewerageConnect6, _state, _state$applicationNo, _state2, _state3, _state4, _state4$applicationTy, _state5, _state6, _state7, _state8, _state8$applicationTy, _state9, _state0, _state1, _state10, _state10$applicationT, _state11, _state12, _state13, _state14, _state15, _state15$applicationT, _state16, _state16$waterSource, _state16$waterSource$, _state17, _state18, _state18$waterSource, _state18$waterSource$, _state19, _state20, _state21, _state22, _state22$additionalDe, _state23, _state23$applicationT, _state24, _state24$additionalDe, _state24$additionalDe2, _state25, _state25$additionalDe, _state25$additionalDe2, _state26, _state26$additionalDe, _state27, _state27$additionalDe, _state28, _state28$additionalDe, _state28$additionalDe2, _state29, _state29$additionalDe, _state30, _state31, _state32, _state33, _state33$property, _state33$property$own, _PTData$Properties2, _PTData$Properties2$, _PTData$Properties3, _PTData$Properties3$, _PTData$Properties3$$, _PTData$Properties3$$2, _PTData$Properties4, _PTData$Properties4$, _user$info2, _user$info2$userName, _user$info3, _user$info4, _state34, _state34$additionalDe, _state34$additionalDe2, _state35, _state35$additionalDe, _state35$additionalDe2, _state36, _state36$additionalDe, _state37, _state37$additionalDe, _state38, _state38$additionalDe, _state39, _state39$additionalDe, _state40, _state40$additionalDe, _state41, _state42, _state43, _state44, _state44$connectionHo, _state44$connectionHo2, _data$WaterConnection16, _data$WaterConnection17, _data$WaterConnection18, _data$WaterConnection19, _data$SewerageConnect0, _data$SewerageConnect1, _data$SewerageConnect10, _data$SewerageConnect11, _data$WaterConnection20, _data$WaterConnection21, _data$WaterConnection22, _data$WaterConnection23, _data$SewerageConnect12, _data$SewerageConnect13, _data$SewerageConnect14, _data$SewerageConnect15, _data$WaterConnection24, _data$WaterConnection25, _data$WaterConnection26, _data$WaterConnection27, _data$SewerageConnect16, _data$SewerageConnect17, _data$SewerageConnect18, _data$SewerageConnect19, _data$WaterConnection28, _data$WaterConnection29, _data$WaterConnection30, _data$WaterConnection31, _data$SewerageConnect20, _data$SewerageConnect21, _data$SewerageConnect22, _data$SewerageConnect23, _data$WaterConnection32, _data$WaterConnection33, _data$WaterConnection34, _data$WaterConnection35, _data$SewerageConnect24, _data$SewerageConnect25, _data$SewerageConnect26, _data$SewerageConnect27, _data$WaterConnection36, _data$WaterConnection37, _data$WaterConnection38, _data$WaterConnection39, _data$SewerageConnect28, _data$SewerageConnect29, _data$SewerageConnect30, _data$SewerageConnect31, _data$WaterConnection40, _data$WaterConnection41, _data$WaterConnection42, _data$WaterConnection43, _data$SewerageConnect32, _data$SewerageConnect33, _data$SewerageConnect34, _data$SewerageConnect35, _data$WaterConnection44, _data$WaterConnection45, _data$WaterConnection46, _data$WaterConnection47, _data$SewerageConnect36, _data$SewerageConnect37, _data$SewerageConnect38, _data$SewerageConnect39, _data$WaterConnection48, _data$WaterConnection49, _data$WaterConnection50, _data$WaterConnection51, _data$SewerageConnect40, _data$SewerageConnect41, _data$SewerageConnect42, _data$SewerageConnect43, _data$WaterConnection52, _data$WaterConnection53, _data$WaterConnection54, _data$WaterConnection55, _data$SewerageConnect44, _data$SewerageConnect45, _data$SewerageConnect46, _data$SewerageConnect47, _state45, _state45$additionalDe, _state46, _state46$additionalDe, _state47, _state47$additionalDe, _state48, _state48$additionalDe, _state49, _state49$additionalDe, _state50, _state51, _state54, _state55, _state56, _state57, _state58, _state59, _paymentDetails$data17, _paymentDetails$data18;
|
|
33639
33639
|
const _useTranslation = reactI18next.useTranslation(),
|
|
33640
33640
|
t = _useTranslation.t;
|
|
33641
33641
|
const menuRef = React.useRef();
|
|
@@ -33686,7 +33686,7 @@ const ConnectionDetails$5 = () => {
|
|
|
33686
33686
|
enabled: filter2 !== null && filter2 !== void 0 && filter2.connectionNumber ? true : false
|
|
33687
33687
|
}, true),
|
|
33688
33688
|
connectionData = _Digit$Hooks$ws$useMy2.data;
|
|
33689
|
-
state = ((_Object$keys = Object.keys(state)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0 ? state : applicationNobyData !== null && applicationNobyData !== void 0 && applicationNobyData.includes("WS") ? connectionData === null || connectionData === void 0 ? void 0 : (_connectionData$Water = connectionData.WaterConnection) === null || _connectionData$Water === void 0 ? void 0 : _connectionData$Water[0] : connectionData === null || connectionData === void 0 ? void 0 : (_connectionData$Sewer = connectionData.SewerageConnections) === null || _connectionData$Sewer === void 0 ? void 0 : _connectionData$Sewer[0];
|
|
33689
|
+
state = ((_Object$keys = Object.keys(state)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0 ? state : applicationNobyData !== null && applicationNobyData !== void 0 && applicationNobyData.includes("WS") ? (connectionData === null || connectionData === void 0 ? void 0 : (_connectionData$Water = connectionData.WaterConnection) === null || _connectionData$Water === void 0 ? void 0 : _connectionData$Water.find(c => c.applicationStatus === "CONNECTION_ACTIVATED")) || (connectionData === null || connectionData === void 0 ? void 0 : (_connectionData$Water2 = connectionData.WaterConnection) === null || _connectionData$Water2 === void 0 ? void 0 : _connectionData$Water2[0]) : (connectionData === null || connectionData === void 0 ? void 0 : (_connectionData$Sewer = connectionData.SewerageConnections) === null || _connectionData$Sewer === void 0 ? void 0 : _connectionData$Sewer.find(c => c.applicationStatus === "CONNECTION_ACTIVATED")) || (connectionData === null || connectionData === void 0 ? void 0 : (_connectionData$Sewer2 = connectionData.SewerageConnections) === null || _connectionData$Sewer2 === void 0 ? void 0 : _connectionData$Sewer2[0]);
|
|
33690
33690
|
const closeModal = () => {
|
|
33691
33691
|
setShowOptions(false);
|
|
33692
33692
|
};
|
|
@@ -51357,7 +51357,8 @@ const EditModifyApplication = () => {
|
|
|
51357
51357
|
};
|
|
51358
51358
|
|
|
51359
51359
|
const Step1_SearchConnection = _ref => {
|
|
51360
|
-
let
|
|
51360
|
+
let t = _ref.t,
|
|
51361
|
+
defaultKNumber = _ref.defaultKNumber,
|
|
51361
51362
|
onNext = _ref.onNext,
|
|
51362
51363
|
isEditFlow = _ref.isEditFlow;
|
|
51363
51364
|
const _useState = React.useState(defaultKNumber || ""),
|
|
@@ -51366,9 +51367,55 @@ const Step1_SearchConnection = _ref => {
|
|
|
51366
51367
|
const _useState2 = React.useState(false),
|
|
51367
51368
|
isLoading = _useState2[0],
|
|
51368
51369
|
setIsLoading = _useState2[1];
|
|
51369
|
-
const _useState3 = React.useState(
|
|
51370
|
-
|
|
51371
|
-
|
|
51370
|
+
const _useState3 = React.useState(false),
|
|
51371
|
+
isConsenting = _useState3[0],
|
|
51372
|
+
setIsConsenting = _useState3[1];
|
|
51373
|
+
const _useState4 = React.useState(null),
|
|
51374
|
+
showToast = _useState4[0],
|
|
51375
|
+
setShowToast = _useState4[1];
|
|
51376
|
+
const handleDigiLockerConsent = function (e) {
|
|
51377
|
+
try {
|
|
51378
|
+
if (e !== null && e !== void 0 && e.preventDefault) e.preventDefault();
|
|
51379
|
+
if (e !== null && e !== void 0 && e.stopPropagation) e.stopPropagation();
|
|
51380
|
+
setIsConsenting(true);
|
|
51381
|
+
const _temp = _finallyRethrows(function () {
|
|
51382
|
+
return _catch(function () {
|
|
51383
|
+
const tenantId = Digit.ULBService.getCurrentTenantId() || "dl";
|
|
51384
|
+
return Promise.resolve(Digit.DigiLockerService.authorization({
|
|
51385
|
+
module: "WS",
|
|
51386
|
+
tenantId
|
|
51387
|
+
})).then(function (data) {
|
|
51388
|
+
const redirectUrl = (data === null || data === void 0 ? void 0 : data.redirectURL) || (data === null || data === void 0 ? void 0 : data.redirectUrl);
|
|
51389
|
+
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);
|
|
51390
|
+
if (verifier) {
|
|
51391
|
+
sessionStorage.setItem("code_verfier_register", verifier);
|
|
51392
|
+
}
|
|
51393
|
+
if (redirectUrl) {
|
|
51394
|
+
window.location.href = redirectUrl;
|
|
51395
|
+
} else {
|
|
51396
|
+
setShowToast({
|
|
51397
|
+
key: "error",
|
|
51398
|
+
message: "No redirect URL returned from DigiLocker API"
|
|
51399
|
+
});
|
|
51400
|
+
}
|
|
51401
|
+
});
|
|
51402
|
+
}, function (err) {
|
|
51403
|
+
var _err$response, _err$response$data, _err$response$data$Er, _err$response$data$Er2;
|
|
51404
|
+
setShowToast({
|
|
51405
|
+
key: "error",
|
|
51406
|
+
message: (err === null || err === void 0 ? void 0 : (_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : (_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) || (err === null || err === void 0 ? void 0 : err.message) || "Error fetching DigiLocker authorization URL"
|
|
51407
|
+
});
|
|
51408
|
+
});
|
|
51409
|
+
}, function (_wasThrown, _result) {
|
|
51410
|
+
setIsConsenting(false);
|
|
51411
|
+
if (_wasThrown) throw _result;
|
|
51412
|
+
return _result;
|
|
51413
|
+
});
|
|
51414
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
51415
|
+
} catch (e) {
|
|
51416
|
+
return Promise.reject(e);
|
|
51417
|
+
}
|
|
51418
|
+
};
|
|
51372
51419
|
const handleSendOtp = function () {
|
|
51373
51420
|
try {
|
|
51374
51421
|
if (!kNumber) {
|
|
@@ -51392,7 +51439,7 @@ const Step1_SearchConnection = _ref => {
|
|
|
51392
51439
|
businessService: "WS"
|
|
51393
51440
|
}).catch(() => null)).then(function (wsResponse) {
|
|
51394
51441
|
var _wsResponse$WaterConn;
|
|
51395
|
-
function
|
|
51442
|
+
function _temp3() {
|
|
51396
51443
|
var _connection, _connection$connectio, _connection$connectio2, _connection2;
|
|
51397
51444
|
if (!connection) {
|
|
51398
51445
|
setIsLoading(false);
|
|
@@ -51411,6 +51458,16 @@ const Step1_SearchConnection = _ref => {
|
|
|
51411
51458
|
});
|
|
51412
51459
|
return;
|
|
51413
51460
|
}
|
|
51461
|
+
if (isEditFlow) {
|
|
51462
|
+
setIsLoading(false);
|
|
51463
|
+
onNext({
|
|
51464
|
+
kNumber,
|
|
51465
|
+
mobileNumber: fetchedMobileNumber,
|
|
51466
|
+
serviceType: detectedServiceType,
|
|
51467
|
+
activeConnection: connection
|
|
51468
|
+
});
|
|
51469
|
+
return;
|
|
51470
|
+
}
|
|
51414
51471
|
const userType = Digit.UserService.getType().toUpperCase();
|
|
51415
51472
|
const payload = {
|
|
51416
51473
|
otp: {
|
|
@@ -51431,7 +51488,7 @@ const Step1_SearchConnection = _ref => {
|
|
|
51431
51488
|
});
|
|
51432
51489
|
}
|
|
51433
51490
|
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');
|
|
51434
|
-
const
|
|
51491
|
+
const _temp2 = function () {
|
|
51435
51492
|
if (!connection) {
|
|
51436
51493
|
return Promise.resolve(Digit.WSService.search({
|
|
51437
51494
|
tenantId,
|
|
@@ -51444,14 +51501,14 @@ const Step1_SearchConnection = _ref => {
|
|
|
51444
51501
|
});
|
|
51445
51502
|
}
|
|
51446
51503
|
}();
|
|
51447
|
-
return
|
|
51504
|
+
return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
|
|
51448
51505
|
});
|
|
51449
51506
|
}, function (err) {
|
|
51450
|
-
var _err$
|
|
51507
|
+
var _err$response2, _err$response2$data, _err$response2$data$E, _err$response2$data$E2;
|
|
51451
51508
|
setIsLoading(false);
|
|
51452
51509
|
setShowToast({
|
|
51453
51510
|
key: "error",
|
|
51454
|
-
message: (err === null || err === void 0 ? void 0 : (_err$
|
|
51511
|
+
message: (err === null || err === void 0 ? void 0 : (_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : (_err$response2$data = _err$response2.data) === null || _err$response2$data === void 0 ? void 0 : (_err$response2$data$E = _err$response2$data.Errors) === null || _err$response2$data$E === void 0 ? void 0 : (_err$response2$data$E2 = _err$response2$data$E[0]) === null || _err$response2$data$E2 === void 0 ? void 0 : _err$response2$data$E2.message) || "Failed to send OTP"
|
|
51455
51512
|
});
|
|
51456
51513
|
}));
|
|
51457
51514
|
} catch (e) {
|
|
@@ -51486,7 +51543,7 @@ const Step1_SearchConnection = _ref => {
|
|
|
51486
51543
|
style: {
|
|
51487
51544
|
fontSize: isMobileView ? "13px" : undefined
|
|
51488
51545
|
}
|
|
51489
|
-
}, "Please enter your K Number to proceed with the mutation application. An OTP will be sent to the registered mobile number."), /*#__PURE__*/React__default.createElement("div", {
|
|
51546
|
+
}, isEditFlow ? "Please verify the K Number to proceed with the mutation edit." : "Please enter your K Number to proceed with the mutation application. An OTP will be sent to the registered mobile number."), /*#__PURE__*/React__default.createElement("div", {
|
|
51490
51547
|
style: {
|
|
51491
51548
|
marginBottom: "24px",
|
|
51492
51549
|
marginTop: "16px",
|
|
@@ -51513,6 +51570,11 @@ const Step1_SearchConnection = _ref => {
|
|
|
51513
51570
|
width: "100%"
|
|
51514
51571
|
},
|
|
51515
51572
|
disabled: isEditFlow
|
|
51573
|
+
})), !isEditFlow && /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
|
|
51574
|
+
label: t("WS_LOGIN_WITH_DIGILOCKER") || "Login with DigiLocker",
|
|
51575
|
+
onSubmit: handleDigiLockerConsent,
|
|
51576
|
+
disabled: isConsenting,
|
|
51577
|
+
submit: true
|
|
51516
51578
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
51517
51579
|
style: {
|
|
51518
51580
|
display: "flex",
|
|
@@ -51534,7 +51596,7 @@ const Step1_SearchConnection = _ref => {
|
|
|
51534
51596
|
maxWidth: isMobileView ? "100%" : "200px",
|
|
51535
51597
|
fontSize: isMobileView ? "14px" : undefined
|
|
51536
51598
|
}
|
|
51537
|
-
}, isLoading ? "Sending OTP..." : "Send OTP →"))), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
51599
|
+
}, isLoading ? isEditFlow ? "Proceeding..." : "Sending OTP..." : isEditFlow ? "Proceed →" : "Send OTP →"))), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
51538
51600
|
error: showToast.key === "error",
|
|
51539
51601
|
warning: showToast.key === "warning",
|
|
51540
51602
|
label: showToast.message,
|
|
@@ -53472,7 +53534,7 @@ const Step5_Submission = _ref => {
|
|
|
53472
53534
|
};
|
|
53473
53535
|
|
|
53474
53536
|
const MutationApplication = () => {
|
|
53475
|
-
var _Digit$SessionStorage, _user$info,
|
|
53537
|
+
var _state, _state2, _state3, _Digit$SessionStorage, _user$info, _state4, _user$info2, _user$info2$userName, _user$info3, _user$info4, _details$applicationD, _applicationDetails$a, _applicationDetails$a2, _applicationDetails$a4, _applicationDetails$a8, _applicationDetails$a9;
|
|
53476
53538
|
const _useTranslation = reactI18next.useTranslation(),
|
|
53477
53539
|
t = _useTranslation.t;
|
|
53478
53540
|
const _useRouteMatch = reactRouterDom.useRouteMatch(),
|
|
@@ -53523,14 +53585,45 @@ const MutationApplication = () => {
|
|
|
53523
53585
|
authActiveConnection = _Digit$Hooks$useSessi6[0],
|
|
53524
53586
|
setAuthActiveConnection = _Digit$Hooks$useSessi6[1],
|
|
53525
53587
|
clearAuthActiveConnection = _Digit$Hooks$useSessi6[2];
|
|
53588
|
+
const _Digit$Hooks$useSessi7 = Digit.Hooks.useSessionStorage("MUTATION_EDIT_PARAMS", {}),
|
|
53589
|
+
persistedEditParams = _Digit$Hooks$useSessi7[0],
|
|
53590
|
+
setPersistedEditParams = _Digit$Hooks$useSessi7[1];
|
|
53526
53591
|
const user = Digit.UserService.getUser();
|
|
53527
|
-
|
|
53528
|
-
const
|
|
53529
|
-
const
|
|
53530
|
-
const
|
|
53592
|
+
const urlParams = new URLSearchParams(location.search);
|
|
53593
|
+
const urlAppNo = (filters === null || filters === void 0 ? void 0 : filters.applicationNumber) || urlParams.get("applicationNumber") || ((_state = state) === null || _state === void 0 ? void 0 : _state.id);
|
|
53594
|
+
const urlTenantId = (filters === null || filters === void 0 ? void 0 : filters.tenantId) || urlParams.get("tenantId") || ((_state2 = state) === null || _state2 === void 0 ? void 0 : _state2.tenantId);
|
|
53595
|
+
const urlService = (filters === null || filters === void 0 ? void 0 : filters.service) || urlParams.get("service") || ((_state3 = state) === null || _state3 === void 0 ? void 0 : _state3.service);
|
|
53596
|
+
React.useEffect(() => {
|
|
53597
|
+
if (location.pathname.endsWith("/search-connection") && !urlAppNo) {
|
|
53598
|
+
setPersistedEditParams({});
|
|
53599
|
+
} else if (urlAppNo || urlTenantId || urlService) {
|
|
53600
|
+
setPersistedEditParams({
|
|
53601
|
+
applicationNumber: urlAppNo || (persistedEditParams === null || persistedEditParams === void 0 ? void 0 : persistedEditParams.applicationNumber),
|
|
53602
|
+
tenantId: urlTenantId || (persistedEditParams === null || persistedEditParams === void 0 ? void 0 : persistedEditParams.tenantId),
|
|
53603
|
+
service: urlService || (persistedEditParams === null || persistedEditParams === void 0 ? void 0 : persistedEditParams.service)
|
|
53604
|
+
});
|
|
53605
|
+
}
|
|
53606
|
+
}, [urlAppNo, urlTenantId, urlService, location.pathname]);
|
|
53607
|
+
const applicationNumber = urlAppNo || (persistedEditParams === null || persistedEditParams === void 0 ? void 0 : persistedEditParams.applicationNumber);
|
|
53608
|
+
const serviceType = urlService || (persistedEditParams === null || persistedEditParams === void 0 ? void 0 : persistedEditParams.service);
|
|
53609
|
+
let tenantId = urlTenantId || (persistedEditParams === null || persistedEditParams === void 0 ? void 0 : persistedEditParams.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();
|
|
53610
|
+
const details = cloneDeep_1((_state4 = state) === null || _state4 === void 0 ? void 0 : _state4.data);
|
|
53531
53611
|
const mobileNumber = user !== null && user !== void 0 && (_user$info2 = user.info) !== null && _user$info2 !== void 0 && (_user$info2$userName = _user$info2.userName) !== null && _user$info2$userName !== void 0 && _user$info2$userName.match(/^[0-9]{10}$/) ? user === null || user === void 0 ? void 0 : (_user$info3 = user.info) === null || _user$info3 === void 0 ? void 0 : _user$info3.userName : user === null || user === void 0 ? void 0 : (_user$info4 = user.info) === null || _user$info4 === void 0 ? void 0 : _user$info4.mobileNumber;
|
|
53532
53612
|
const hasStateData = !!(details !== null && details !== void 0 && (_details$applicationD = details.applicationData) !== null && _details$applicationD !== void 0 && _details$applicationD.id);
|
|
53613
|
+
React.useEffect(() => {
|
|
53614
|
+
if (location.pathname === path) {
|
|
53615
|
+
if (typeof clearFormData === "function") clearFormData();
|
|
53616
|
+
if (typeof clearSessionFormData === "function") clearSessionFormData();
|
|
53617
|
+
if (typeof clearCompletedSteps === "function") clearCompletedSteps();
|
|
53618
|
+
if (typeof clearAuthKNumber === "function") clearAuthKNumber();
|
|
53619
|
+
if (typeof clearAuthMobileNumber === "function") clearAuthMobileNumber();
|
|
53620
|
+
if (typeof clearAuthServiceType === "function") clearAuthServiceType();
|
|
53621
|
+
if (typeof clearAuthActiveConnection === "function") clearAuthActiveConnection();
|
|
53622
|
+
if (typeof setPersistedEditParams === "function") setPersistedEditParams({});
|
|
53623
|
+
}
|
|
53624
|
+
}, [location.pathname, path]);
|
|
53533
53625
|
const editApplicationNumber = (details === null || details === void 0 ? void 0 : details.applicationNo) || applicationNumber;
|
|
53626
|
+
console.log(editApplicationNumber, "editApplicationNumber");
|
|
53534
53627
|
const _useQuery = reactQuery.useQuery(["WORKFLOW_SEARCH", editApplicationNumber, tenantId], function () {
|
|
53535
53628
|
try {
|
|
53536
53629
|
return Promise.resolve(Digit.WorkflowService.getByBusinessId(tenantId, editApplicationNumber)).then(function (res) {
|
|
@@ -53545,8 +53638,9 @@ const MutationApplication = () => {
|
|
|
53545
53638
|
}),
|
|
53546
53639
|
isWorkflowLoading = _useQuery.isLoading,
|
|
53547
53640
|
workflowData = _useQuery.data;
|
|
53641
|
+
console.log(workflowData, "workflowData");
|
|
53548
53642
|
const isEmployee = window.location.href.includes("/employee/");
|
|
53549
|
-
const isEditFlow = !!editApplicationNumber && (
|
|
53643
|
+
const isEditFlow = !!editApplicationNumber && (!!urlAppNo || (workflowData === null || workflowData === void 0 ? void 0 : workflowData.businessService) === "mutationWSConnection" || (workflowData === null || workflowData === void 0 ? void 0 : workflowData.action) === "SEND_BACK_TO_CITIZEN");
|
|
53550
53644
|
const querySearchParam = isEditFlow ? editApplicationNumber : authKNumber;
|
|
53551
53645
|
const fallbackServiceType = serviceType || authServiceType;
|
|
53552
53646
|
const businessService = (fallbackServiceType === null || fallbackServiceType === void 0 ? void 0 : fallbackServiceType.toUpperCase()) === "SEWERAGE" ? "SW" : "WS";
|
|
@@ -53575,8 +53669,8 @@ const MutationApplication = () => {
|
|
|
53575
53669
|
}
|
|
53576
53670
|
return wsData ? {
|
|
53577
53671
|
applicationData: wsData,
|
|
53578
|
-
WaterConnection:
|
|
53579
|
-
SewerageConnections:
|
|
53672
|
+
WaterConnection: [wsData],
|
|
53673
|
+
SewerageConnections: [wsData],
|
|
53580
53674
|
propertyDetails: null,
|
|
53581
53675
|
processInstancesDetails: []
|
|
53582
53676
|
} : null;
|
|
@@ -53607,10 +53701,10 @@ const MutationApplication = () => {
|
|
|
53607
53701
|
}),
|
|
53608
53702
|
propertyDetails = _Digit$Hooks$pt$usePr.data,
|
|
53609
53703
|
isPropertyLoading = _Digit$Hooks$pt$usePr.isLoading;
|
|
53610
|
-
const _Digit$Hooks$
|
|
53611
|
-
sessionFormData = _Digit$Hooks$
|
|
53612
|
-
setSessionFormData = _Digit$Hooks$
|
|
53613
|
-
clearSessionFormData = _Digit$Hooks$
|
|
53704
|
+
const _Digit$Hooks$useSessi8 = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}),
|
|
53705
|
+
sessionFormData = _Digit$Hooks$useSessi8[0],
|
|
53706
|
+
setSessionFormData = _Digit$Hooks$useSessi8[1],
|
|
53707
|
+
clearSessionFormData = _Digit$Hooks$useSessi8[2];
|
|
53614
53708
|
React.useEffect(() => {
|
|
53615
53709
|
var _applicationDetails$a3;
|
|
53616
53710
|
const fetchAppData = function () {
|
|
@@ -53808,6 +53902,7 @@ const MutationApplication = () => {
|
|
|
53808
53902
|
let updatePayload = _extends({}, convertAppData, {
|
|
53809
53903
|
id: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a6 = applicationDetails.applicationData) === null || _applicationDetails$a6 === void 0 ? void 0 : _applicationDetails$a6.id,
|
|
53810
53904
|
applicationNo: editApplicationNumber,
|
|
53905
|
+
action: "RESUBMIT_APPLICATION",
|
|
53811
53906
|
processInstance: _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a7 = applicationDetails.applicationData) === null || _applicationDetails$a7 === void 0 ? void 0 : _applicationDetails$a7.processInstance, convertAppData === null || convertAppData === void 0 ? void 0 : convertAppData.processInstance, {
|
|
53812
53907
|
action: "RESUBMIT_APPLICATION"
|
|
53813
53908
|
})
|
|
@@ -54073,7 +54168,13 @@ const MutationApplication = () => {
|
|
|
54073
54168
|
}
|
|
54074
54169
|
}, /*#__PURE__*/React__default.createElement(reactRouterDom.Switch, null, /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
|
|
54075
54170
|
path: path + "/search-connection"
|
|
54076
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
54171
|
+
}, isEditFlow ? /*#__PURE__*/React__default.createElement(reactRouterDom.Redirect, {
|
|
54172
|
+
to: {
|
|
54173
|
+
pathname: path + "/consumer-details",
|
|
54174
|
+
search: location.search,
|
|
54175
|
+
state: location.state
|
|
54176
|
+
}
|
|
54177
|
+
}) : /*#__PURE__*/React__default.createElement(Step1_SearchConnection, {
|
|
54077
54178
|
t: t,
|
|
54078
54179
|
defaultKNumber: isEditFlow ? applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a8 = applicationDetails.applicationData) === null || _applicationDetails$a8 === void 0 ? void 0 : _applicationDetails$a8.connectionNo : "",
|
|
54079
54180
|
isEditFlow: isEditFlow,
|
|
@@ -54091,7 +54192,13 @@ const MutationApplication = () => {
|
|
|
54091
54192
|
}
|
|
54092
54193
|
})), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
|
|
54093
54194
|
path: path + "/existing-connection"
|
|
54094
|
-
},
|
|
54195
|
+
}, isEditFlow ? /*#__PURE__*/React__default.createElement(reactRouterDom.Redirect, {
|
|
54196
|
+
to: {
|
|
54197
|
+
pathname: path + "/consumer-details",
|
|
54198
|
+
search: location.search,
|
|
54199
|
+
state: location.state
|
|
54200
|
+
}
|
|
54201
|
+
}) : /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(Step1_ExistingConnection, {
|
|
54095
54202
|
t: t,
|
|
54096
54203
|
applicationDetails: authActiveConnection ? {
|
|
54097
54204
|
applicationData: authActiveConnection
|
|
@@ -54146,7 +54253,11 @@ const MutationApplication = () => {
|
|
|
54146
54253
|
exact: true,
|
|
54147
54254
|
path: path
|
|
54148
54255
|
}, /*#__PURE__*/React__default.createElement(reactRouterDom.Redirect, {
|
|
54149
|
-
to:
|
|
54256
|
+
to: {
|
|
54257
|
+
pathname: isEditFlow ? path + "/consumer-details" : path + "/search-connection",
|
|
54258
|
+
search: location.search,
|
|
54259
|
+
state: location.state
|
|
54260
|
+
}
|
|
54150
54261
|
}))), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
54151
54262
|
error: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "error",
|
|
54152
54263
|
warning: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "warning",
|