@djb25/digit-ui-module-ws 1.0.81 → 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 +140 -28
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +140 -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
|
};
|
|
@@ -43648,6 +43648,7 @@ const ActionModal$5 = _ref => {
|
|
|
43648
43648
|
}
|
|
43649
43649
|
applicationData = _extends({}, applicationData, {
|
|
43650
43650
|
action: action === null || action === void 0 ? void 0 : action.action,
|
|
43651
|
+
oldApplication: isMutationApp ? (action === null || action === void 0 ? void 0 : action.action) === "REJECT" : false,
|
|
43651
43652
|
comment: commentValue,
|
|
43652
43653
|
assignee: !(selectedApprover !== null && selectedApprover !== void 0 && selectedApprover.uuid) ? [] : [selectedApprover === null || selectedApprover === void 0 ? void 0 : selectedApprover.uuid],
|
|
43653
43654
|
assignes: !(selectedApprover !== null && selectedApprover !== void 0 && selectedApprover.uuid) ? [] : [{
|
|
@@ -51356,7 +51357,8 @@ const EditModifyApplication = () => {
|
|
|
51356
51357
|
};
|
|
51357
51358
|
|
|
51358
51359
|
const Step1_SearchConnection = _ref => {
|
|
51359
|
-
let
|
|
51360
|
+
let t = _ref.t,
|
|
51361
|
+
defaultKNumber = _ref.defaultKNumber,
|
|
51360
51362
|
onNext = _ref.onNext,
|
|
51361
51363
|
isEditFlow = _ref.isEditFlow;
|
|
51362
51364
|
const _useState = React.useState(defaultKNumber || ""),
|
|
@@ -51365,9 +51367,55 @@ const Step1_SearchConnection = _ref => {
|
|
|
51365
51367
|
const _useState2 = React.useState(false),
|
|
51366
51368
|
isLoading = _useState2[0],
|
|
51367
51369
|
setIsLoading = _useState2[1];
|
|
51368
|
-
const _useState3 = React.useState(
|
|
51369
|
-
|
|
51370
|
-
|
|
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
|
+
};
|
|
51371
51419
|
const handleSendOtp = function () {
|
|
51372
51420
|
try {
|
|
51373
51421
|
if (!kNumber) {
|
|
@@ -51391,7 +51439,7 @@ const Step1_SearchConnection = _ref => {
|
|
|
51391
51439
|
businessService: "WS"
|
|
51392
51440
|
}).catch(() => null)).then(function (wsResponse) {
|
|
51393
51441
|
var _wsResponse$WaterConn;
|
|
51394
|
-
function
|
|
51442
|
+
function _temp3() {
|
|
51395
51443
|
var _connection, _connection$connectio, _connection$connectio2, _connection2;
|
|
51396
51444
|
if (!connection) {
|
|
51397
51445
|
setIsLoading(false);
|
|
@@ -51410,6 +51458,16 @@ const Step1_SearchConnection = _ref => {
|
|
|
51410
51458
|
});
|
|
51411
51459
|
return;
|
|
51412
51460
|
}
|
|
51461
|
+
if (isEditFlow) {
|
|
51462
|
+
setIsLoading(false);
|
|
51463
|
+
onNext({
|
|
51464
|
+
kNumber,
|
|
51465
|
+
mobileNumber: fetchedMobileNumber,
|
|
51466
|
+
serviceType: detectedServiceType,
|
|
51467
|
+
activeConnection: connection
|
|
51468
|
+
});
|
|
51469
|
+
return;
|
|
51470
|
+
}
|
|
51413
51471
|
const userType = Digit.UserService.getType().toUpperCase();
|
|
51414
51472
|
const payload = {
|
|
51415
51473
|
otp: {
|
|
@@ -51430,7 +51488,7 @@ const Step1_SearchConnection = _ref => {
|
|
|
51430
51488
|
});
|
|
51431
51489
|
}
|
|
51432
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');
|
|
51433
|
-
const
|
|
51491
|
+
const _temp2 = function () {
|
|
51434
51492
|
if (!connection) {
|
|
51435
51493
|
return Promise.resolve(Digit.WSService.search({
|
|
51436
51494
|
tenantId,
|
|
@@ -51443,14 +51501,14 @@ const Step1_SearchConnection = _ref => {
|
|
|
51443
51501
|
});
|
|
51444
51502
|
}
|
|
51445
51503
|
}();
|
|
51446
|
-
return
|
|
51504
|
+
return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
|
|
51447
51505
|
});
|
|
51448
51506
|
}, function (err) {
|
|
51449
|
-
var _err$
|
|
51507
|
+
var _err$response2, _err$response2$data, _err$response2$data$E, _err$response2$data$E2;
|
|
51450
51508
|
setIsLoading(false);
|
|
51451
51509
|
setShowToast({
|
|
51452
51510
|
key: "error",
|
|
51453
|
-
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"
|
|
51454
51512
|
});
|
|
51455
51513
|
}));
|
|
51456
51514
|
} catch (e) {
|
|
@@ -51485,7 +51543,7 @@ const Step1_SearchConnection = _ref => {
|
|
|
51485
51543
|
style: {
|
|
51486
51544
|
fontSize: isMobileView ? "13px" : undefined
|
|
51487
51545
|
}
|
|
51488
|
-
}, "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", {
|
|
51489
51547
|
style: {
|
|
51490
51548
|
marginBottom: "24px",
|
|
51491
51549
|
marginTop: "16px",
|
|
@@ -51512,6 +51570,11 @@ const Step1_SearchConnection = _ref => {
|
|
|
51512
51570
|
width: "100%"
|
|
51513
51571
|
},
|
|
51514
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
|
|
51515
51578
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
51516
51579
|
style: {
|
|
51517
51580
|
display: "flex",
|
|
@@ -51533,7 +51596,7 @@ const Step1_SearchConnection = _ref => {
|
|
|
51533
51596
|
maxWidth: isMobileView ? "100%" : "200px",
|
|
51534
51597
|
fontSize: isMobileView ? "14px" : undefined
|
|
51535
51598
|
}
|
|
51536
|
-
}, 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, {
|
|
51537
51600
|
error: showToast.key === "error",
|
|
51538
51601
|
warning: showToast.key === "warning",
|
|
51539
51602
|
label: showToast.message,
|
|
@@ -53471,7 +53534,7 @@ const Step5_Submission = _ref => {
|
|
|
53471
53534
|
};
|
|
53472
53535
|
|
|
53473
53536
|
const MutationApplication = () => {
|
|
53474
|
-
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;
|
|
53475
53538
|
const _useTranslation = reactI18next.useTranslation(),
|
|
53476
53539
|
t = _useTranslation.t;
|
|
53477
53540
|
const _useRouteMatch = reactRouterDom.useRouteMatch(),
|
|
@@ -53522,14 +53585,45 @@ const MutationApplication = () => {
|
|
|
53522
53585
|
authActiveConnection = _Digit$Hooks$useSessi6[0],
|
|
53523
53586
|
setAuthActiveConnection = _Digit$Hooks$useSessi6[1],
|
|
53524
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];
|
|
53525
53591
|
const user = Digit.UserService.getUser();
|
|
53526
|
-
|
|
53527
|
-
const
|
|
53528
|
-
const
|
|
53529
|
-
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);
|
|
53530
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;
|
|
53531
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]);
|
|
53532
53625
|
const editApplicationNumber = (details === null || details === void 0 ? void 0 : details.applicationNo) || applicationNumber;
|
|
53626
|
+
console.log(editApplicationNumber, "editApplicationNumber");
|
|
53533
53627
|
const _useQuery = reactQuery.useQuery(["WORKFLOW_SEARCH", editApplicationNumber, tenantId], function () {
|
|
53534
53628
|
try {
|
|
53535
53629
|
return Promise.resolve(Digit.WorkflowService.getByBusinessId(tenantId, editApplicationNumber)).then(function (res) {
|
|
@@ -53544,8 +53638,9 @@ const MutationApplication = () => {
|
|
|
53544
53638
|
}),
|
|
53545
53639
|
isWorkflowLoading = _useQuery.isLoading,
|
|
53546
53640
|
workflowData = _useQuery.data;
|
|
53641
|
+
console.log(workflowData, "workflowData");
|
|
53547
53642
|
const isEmployee = window.location.href.includes("/employee/");
|
|
53548
|
-
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");
|
|
53549
53644
|
const querySearchParam = isEditFlow ? editApplicationNumber : authKNumber;
|
|
53550
53645
|
const fallbackServiceType = serviceType || authServiceType;
|
|
53551
53646
|
const businessService = (fallbackServiceType === null || fallbackServiceType === void 0 ? void 0 : fallbackServiceType.toUpperCase()) === "SEWERAGE" ? "SW" : "WS";
|
|
@@ -53574,8 +53669,8 @@ const MutationApplication = () => {
|
|
|
53574
53669
|
}
|
|
53575
53670
|
return wsData ? {
|
|
53576
53671
|
applicationData: wsData,
|
|
53577
|
-
WaterConnection:
|
|
53578
|
-
SewerageConnections:
|
|
53672
|
+
WaterConnection: [wsData],
|
|
53673
|
+
SewerageConnections: [wsData],
|
|
53579
53674
|
propertyDetails: null,
|
|
53580
53675
|
processInstancesDetails: []
|
|
53581
53676
|
} : null;
|
|
@@ -53606,10 +53701,10 @@ const MutationApplication = () => {
|
|
|
53606
53701
|
}),
|
|
53607
53702
|
propertyDetails = _Digit$Hooks$pt$usePr.data,
|
|
53608
53703
|
isPropertyLoading = _Digit$Hooks$pt$usePr.isLoading;
|
|
53609
|
-
const _Digit$Hooks$
|
|
53610
|
-
sessionFormData = _Digit$Hooks$
|
|
53611
|
-
setSessionFormData = _Digit$Hooks$
|
|
53612
|
-
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];
|
|
53613
53708
|
React.useEffect(() => {
|
|
53614
53709
|
var _applicationDetails$a3;
|
|
53615
53710
|
const fetchAppData = function () {
|
|
@@ -53807,6 +53902,7 @@ const MutationApplication = () => {
|
|
|
53807
53902
|
let updatePayload = _extends({}, convertAppData, {
|
|
53808
53903
|
id: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a6 = applicationDetails.applicationData) === null || _applicationDetails$a6 === void 0 ? void 0 : _applicationDetails$a6.id,
|
|
53809
53904
|
applicationNo: editApplicationNumber,
|
|
53905
|
+
action: "RESUBMIT_APPLICATION",
|
|
53810
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, {
|
|
53811
53907
|
action: "RESUBMIT_APPLICATION"
|
|
53812
53908
|
})
|
|
@@ -54072,7 +54168,13 @@ const MutationApplication = () => {
|
|
|
54072
54168
|
}
|
|
54073
54169
|
}, /*#__PURE__*/React__default.createElement(reactRouterDom.Switch, null, /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
|
|
54074
54170
|
path: path + "/search-connection"
|
|
54075
|
-
}, /*#__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, {
|
|
54076
54178
|
t: t,
|
|
54077
54179
|
defaultKNumber: isEditFlow ? applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a8 = applicationDetails.applicationData) === null || _applicationDetails$a8 === void 0 ? void 0 : _applicationDetails$a8.connectionNo : "",
|
|
54078
54180
|
isEditFlow: isEditFlow,
|
|
@@ -54090,7 +54192,13 @@ const MutationApplication = () => {
|
|
|
54090
54192
|
}
|
|
54091
54193
|
})), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
|
|
54092
54194
|
path: path + "/existing-connection"
|
|
54093
|
-
},
|
|
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, {
|
|
54094
54202
|
t: t,
|
|
54095
54203
|
applicationDetails: authActiveConnection ? {
|
|
54096
54204
|
applicationData: authActiveConnection
|
|
@@ -54145,7 +54253,11 @@ const MutationApplication = () => {
|
|
|
54145
54253
|
exact: true,
|
|
54146
54254
|
path: path
|
|
54147
54255
|
}, /*#__PURE__*/React__default.createElement(reactRouterDom.Redirect, {
|
|
54148
|
-
to:
|
|
54256
|
+
to: {
|
|
54257
|
+
pathname: isEditFlow ? path + "/consumer-details" : path + "/search-connection",
|
|
54258
|
+
search: location.search,
|
|
54259
|
+
state: location.state
|
|
54260
|
+
}
|
|
54149
54261
|
}))), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
54150
54262
|
error: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "error",
|
|
54151
54263
|
warning: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "warning",
|