@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.modern.js
CHANGED
|
@@ -33632,7 +33632,7 @@ const getConnectionDetailsPDF = function (application, property, tenantInfo, t)
|
|
|
33632
33632
|
};
|
|
33633
33633
|
|
|
33634
33634
|
const ConnectionDetails$5 = () => {
|
|
33635
|
-
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;
|
|
33635
|
+
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;
|
|
33636
33636
|
const _useTranslation = useTranslation(),
|
|
33637
33637
|
t = _useTranslation.t;
|
|
33638
33638
|
const menuRef = useRef();
|
|
@@ -33683,7 +33683,7 @@ const ConnectionDetails$5 = () => {
|
|
|
33683
33683
|
enabled: filter2 !== null && filter2 !== void 0 && filter2.connectionNumber ? true : false
|
|
33684
33684
|
}, true),
|
|
33685
33685
|
connectionData = _Digit$Hooks$ws$useMy2.data;
|
|
33686
|
-
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];
|
|
33686
|
+
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]);
|
|
33687
33687
|
const closeModal = () => {
|
|
33688
33688
|
setShowOptions(false);
|
|
33689
33689
|
};
|
|
@@ -43645,6 +43645,7 @@ const ActionModal$5 = _ref => {
|
|
|
43645
43645
|
}
|
|
43646
43646
|
applicationData = _extends({}, applicationData, {
|
|
43647
43647
|
action: action === null || action === void 0 ? void 0 : action.action,
|
|
43648
|
+
oldApplication: isMutationApp ? (action === null || action === void 0 ? void 0 : action.action) === "REJECT" : false,
|
|
43648
43649
|
comment: commentValue,
|
|
43649
43650
|
assignee: !(selectedApprover !== null && selectedApprover !== void 0 && selectedApprover.uuid) ? [] : [selectedApprover === null || selectedApprover === void 0 ? void 0 : selectedApprover.uuid],
|
|
43650
43651
|
assignes: !(selectedApprover !== null && selectedApprover !== void 0 && selectedApprover.uuid) ? [] : [{
|
|
@@ -51353,7 +51354,8 @@ const EditModifyApplication = () => {
|
|
|
51353
51354
|
};
|
|
51354
51355
|
|
|
51355
51356
|
const Step1_SearchConnection = _ref => {
|
|
51356
|
-
let
|
|
51357
|
+
let t = _ref.t,
|
|
51358
|
+
defaultKNumber = _ref.defaultKNumber,
|
|
51357
51359
|
onNext = _ref.onNext,
|
|
51358
51360
|
isEditFlow = _ref.isEditFlow;
|
|
51359
51361
|
const _useState = useState(defaultKNumber || ""),
|
|
@@ -51362,9 +51364,55 @@ const Step1_SearchConnection = _ref => {
|
|
|
51362
51364
|
const _useState2 = useState(false),
|
|
51363
51365
|
isLoading = _useState2[0],
|
|
51364
51366
|
setIsLoading = _useState2[1];
|
|
51365
|
-
const _useState3 = useState(
|
|
51366
|
-
|
|
51367
|
-
|
|
51367
|
+
const _useState3 = useState(false),
|
|
51368
|
+
isConsenting = _useState3[0],
|
|
51369
|
+
setIsConsenting = _useState3[1];
|
|
51370
|
+
const _useState4 = useState(null),
|
|
51371
|
+
showToast = _useState4[0],
|
|
51372
|
+
setShowToast = _useState4[1];
|
|
51373
|
+
const handleDigiLockerConsent = function (e) {
|
|
51374
|
+
try {
|
|
51375
|
+
if (e !== null && e !== void 0 && e.preventDefault) e.preventDefault();
|
|
51376
|
+
if (e !== null && e !== void 0 && e.stopPropagation) e.stopPropagation();
|
|
51377
|
+
setIsConsenting(true);
|
|
51378
|
+
const _temp = _finallyRethrows(function () {
|
|
51379
|
+
return _catch(function () {
|
|
51380
|
+
const tenantId = Digit.ULBService.getCurrentTenantId() || "dl";
|
|
51381
|
+
return Promise.resolve(Digit.DigiLockerService.authorization({
|
|
51382
|
+
module: "WS",
|
|
51383
|
+
tenantId
|
|
51384
|
+
})).then(function (data) {
|
|
51385
|
+
const redirectUrl = (data === null || data === void 0 ? void 0 : data.redirectURL) || (data === null || data === void 0 ? void 0 : data.redirectUrl);
|
|
51386
|
+
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);
|
|
51387
|
+
if (verifier) {
|
|
51388
|
+
sessionStorage.setItem("code_verfier_register", verifier);
|
|
51389
|
+
}
|
|
51390
|
+
if (redirectUrl) {
|
|
51391
|
+
window.location.href = redirectUrl;
|
|
51392
|
+
} else {
|
|
51393
|
+
setShowToast({
|
|
51394
|
+
key: "error",
|
|
51395
|
+
message: "No redirect URL returned from DigiLocker API"
|
|
51396
|
+
});
|
|
51397
|
+
}
|
|
51398
|
+
});
|
|
51399
|
+
}, function (err) {
|
|
51400
|
+
var _err$response, _err$response$data, _err$response$data$Er, _err$response$data$Er2;
|
|
51401
|
+
setShowToast({
|
|
51402
|
+
key: "error",
|
|
51403
|
+
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"
|
|
51404
|
+
});
|
|
51405
|
+
});
|
|
51406
|
+
}, function (_wasThrown, _result) {
|
|
51407
|
+
setIsConsenting(false);
|
|
51408
|
+
if (_wasThrown) throw _result;
|
|
51409
|
+
return _result;
|
|
51410
|
+
});
|
|
51411
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
51412
|
+
} catch (e) {
|
|
51413
|
+
return Promise.reject(e);
|
|
51414
|
+
}
|
|
51415
|
+
};
|
|
51368
51416
|
const handleSendOtp = function () {
|
|
51369
51417
|
try {
|
|
51370
51418
|
if (!kNumber) {
|
|
@@ -51388,7 +51436,7 @@ const Step1_SearchConnection = _ref => {
|
|
|
51388
51436
|
businessService: "WS"
|
|
51389
51437
|
}).catch(() => null)).then(function (wsResponse) {
|
|
51390
51438
|
var _wsResponse$WaterConn;
|
|
51391
|
-
function
|
|
51439
|
+
function _temp3() {
|
|
51392
51440
|
var _connection, _connection$connectio, _connection$connectio2, _connection2;
|
|
51393
51441
|
if (!connection) {
|
|
51394
51442
|
setIsLoading(false);
|
|
@@ -51407,6 +51455,16 @@ const Step1_SearchConnection = _ref => {
|
|
|
51407
51455
|
});
|
|
51408
51456
|
return;
|
|
51409
51457
|
}
|
|
51458
|
+
if (isEditFlow) {
|
|
51459
|
+
setIsLoading(false);
|
|
51460
|
+
onNext({
|
|
51461
|
+
kNumber,
|
|
51462
|
+
mobileNumber: fetchedMobileNumber,
|
|
51463
|
+
serviceType: detectedServiceType,
|
|
51464
|
+
activeConnection: connection
|
|
51465
|
+
});
|
|
51466
|
+
return;
|
|
51467
|
+
}
|
|
51410
51468
|
const userType = Digit.UserService.getType().toUpperCase();
|
|
51411
51469
|
const payload = {
|
|
51412
51470
|
otp: {
|
|
@@ -51427,7 +51485,7 @@ const Step1_SearchConnection = _ref => {
|
|
|
51427
51485
|
});
|
|
51428
51486
|
}
|
|
51429
51487
|
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');
|
|
51430
|
-
const
|
|
51488
|
+
const _temp2 = function () {
|
|
51431
51489
|
if (!connection) {
|
|
51432
51490
|
return Promise.resolve(Digit.WSService.search({
|
|
51433
51491
|
tenantId,
|
|
@@ -51440,14 +51498,14 @@ const Step1_SearchConnection = _ref => {
|
|
|
51440
51498
|
});
|
|
51441
51499
|
}
|
|
51442
51500
|
}();
|
|
51443
|
-
return
|
|
51501
|
+
return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
|
|
51444
51502
|
});
|
|
51445
51503
|
}, function (err) {
|
|
51446
|
-
var _err$
|
|
51504
|
+
var _err$response2, _err$response2$data, _err$response2$data$E, _err$response2$data$E2;
|
|
51447
51505
|
setIsLoading(false);
|
|
51448
51506
|
setShowToast({
|
|
51449
51507
|
key: "error",
|
|
51450
|
-
message: (err === null || err === void 0 ? void 0 : (_err$
|
|
51508
|
+
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"
|
|
51451
51509
|
});
|
|
51452
51510
|
}));
|
|
51453
51511
|
} catch (e) {
|
|
@@ -51482,7 +51540,7 @@ const Step1_SearchConnection = _ref => {
|
|
|
51482
51540
|
style: {
|
|
51483
51541
|
fontSize: isMobileView ? "13px" : undefined
|
|
51484
51542
|
}
|
|
51485
|
-
}, "Please enter your K Number to proceed with the mutation application. An OTP will be sent to the registered mobile number."), /*#__PURE__*/React.createElement("div", {
|
|
51543
|
+
}, 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.createElement("div", {
|
|
51486
51544
|
style: {
|
|
51487
51545
|
marginBottom: "24px",
|
|
51488
51546
|
marginTop: "16px",
|
|
@@ -51509,6 +51567,11 @@ const Step1_SearchConnection = _ref => {
|
|
|
51509
51567
|
width: "100%"
|
|
51510
51568
|
},
|
|
51511
51569
|
disabled: isEditFlow
|
|
51570
|
+
})), !isEditFlow && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
51571
|
+
label: t("WS_LOGIN_WITH_DIGILOCKER") || "Login with DigiLocker",
|
|
51572
|
+
onSubmit: handleDigiLockerConsent,
|
|
51573
|
+
disabled: isConsenting,
|
|
51574
|
+
submit: true
|
|
51512
51575
|
})), /*#__PURE__*/React.createElement("div", {
|
|
51513
51576
|
style: {
|
|
51514
51577
|
display: "flex",
|
|
@@ -51530,7 +51593,7 @@ const Step1_SearchConnection = _ref => {
|
|
|
51530
51593
|
maxWidth: isMobileView ? "100%" : "200px",
|
|
51531
51594
|
fontSize: isMobileView ? "14px" : undefined
|
|
51532
51595
|
}
|
|
51533
|
-
}, isLoading ? "Sending OTP..." : "Send OTP →"))), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
51596
|
+
}, isLoading ? isEditFlow ? "Proceeding..." : "Sending OTP..." : isEditFlow ? "Proceed →" : "Send OTP →"))), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
51534
51597
|
error: showToast.key === "error",
|
|
51535
51598
|
warning: showToast.key === "warning",
|
|
51536
51599
|
label: showToast.message,
|
|
@@ -53468,7 +53531,7 @@ const Step5_Submission = _ref => {
|
|
|
53468
53531
|
};
|
|
53469
53532
|
|
|
53470
53533
|
const MutationApplication = () => {
|
|
53471
|
-
var _Digit$SessionStorage, _user$info,
|
|
53534
|
+
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;
|
|
53472
53535
|
const _useTranslation = useTranslation(),
|
|
53473
53536
|
t = _useTranslation.t;
|
|
53474
53537
|
const _useRouteMatch = useRouteMatch(),
|
|
@@ -53519,14 +53582,45 @@ const MutationApplication = () => {
|
|
|
53519
53582
|
authActiveConnection = _Digit$Hooks$useSessi6[0],
|
|
53520
53583
|
setAuthActiveConnection = _Digit$Hooks$useSessi6[1],
|
|
53521
53584
|
clearAuthActiveConnection = _Digit$Hooks$useSessi6[2];
|
|
53585
|
+
const _Digit$Hooks$useSessi7 = Digit.Hooks.useSessionStorage("MUTATION_EDIT_PARAMS", {}),
|
|
53586
|
+
persistedEditParams = _Digit$Hooks$useSessi7[0],
|
|
53587
|
+
setPersistedEditParams = _Digit$Hooks$useSessi7[1];
|
|
53522
53588
|
const user = Digit.UserService.getUser();
|
|
53523
|
-
|
|
53524
|
-
const
|
|
53525
|
-
const
|
|
53526
|
-
const
|
|
53589
|
+
const urlParams = new URLSearchParams(location.search);
|
|
53590
|
+
const urlAppNo = (filters === null || filters === void 0 ? void 0 : filters.applicationNumber) || urlParams.get("applicationNumber") || ((_state = state) === null || _state === void 0 ? void 0 : _state.id);
|
|
53591
|
+
const urlTenantId = (filters === null || filters === void 0 ? void 0 : filters.tenantId) || urlParams.get("tenantId") || ((_state2 = state) === null || _state2 === void 0 ? void 0 : _state2.tenantId);
|
|
53592
|
+
const urlService = (filters === null || filters === void 0 ? void 0 : filters.service) || urlParams.get("service") || ((_state3 = state) === null || _state3 === void 0 ? void 0 : _state3.service);
|
|
53593
|
+
useEffect(() => {
|
|
53594
|
+
if (location.pathname.endsWith("/search-connection") && !urlAppNo) {
|
|
53595
|
+
setPersistedEditParams({});
|
|
53596
|
+
} else if (urlAppNo || urlTenantId || urlService) {
|
|
53597
|
+
setPersistedEditParams({
|
|
53598
|
+
applicationNumber: urlAppNo || (persistedEditParams === null || persistedEditParams === void 0 ? void 0 : persistedEditParams.applicationNumber),
|
|
53599
|
+
tenantId: urlTenantId || (persistedEditParams === null || persistedEditParams === void 0 ? void 0 : persistedEditParams.tenantId),
|
|
53600
|
+
service: urlService || (persistedEditParams === null || persistedEditParams === void 0 ? void 0 : persistedEditParams.service)
|
|
53601
|
+
});
|
|
53602
|
+
}
|
|
53603
|
+
}, [urlAppNo, urlTenantId, urlService, location.pathname]);
|
|
53604
|
+
const applicationNumber = urlAppNo || (persistedEditParams === null || persistedEditParams === void 0 ? void 0 : persistedEditParams.applicationNumber);
|
|
53605
|
+
const serviceType = urlService || (persistedEditParams === null || persistedEditParams === void 0 ? void 0 : persistedEditParams.service);
|
|
53606
|
+
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();
|
|
53607
|
+
const details = cloneDeep_1((_state4 = state) === null || _state4 === void 0 ? void 0 : _state4.data);
|
|
53527
53608
|
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;
|
|
53528
53609
|
const hasStateData = !!(details !== null && details !== void 0 && (_details$applicationD = details.applicationData) !== null && _details$applicationD !== void 0 && _details$applicationD.id);
|
|
53610
|
+
useEffect(() => {
|
|
53611
|
+
if (location.pathname === path) {
|
|
53612
|
+
if (typeof clearFormData === "function") clearFormData();
|
|
53613
|
+
if (typeof clearSessionFormData === "function") clearSessionFormData();
|
|
53614
|
+
if (typeof clearCompletedSteps === "function") clearCompletedSteps();
|
|
53615
|
+
if (typeof clearAuthKNumber === "function") clearAuthKNumber();
|
|
53616
|
+
if (typeof clearAuthMobileNumber === "function") clearAuthMobileNumber();
|
|
53617
|
+
if (typeof clearAuthServiceType === "function") clearAuthServiceType();
|
|
53618
|
+
if (typeof clearAuthActiveConnection === "function") clearAuthActiveConnection();
|
|
53619
|
+
if (typeof setPersistedEditParams === "function") setPersistedEditParams({});
|
|
53620
|
+
}
|
|
53621
|
+
}, [location.pathname, path]);
|
|
53529
53622
|
const editApplicationNumber = (details === null || details === void 0 ? void 0 : details.applicationNo) || applicationNumber;
|
|
53623
|
+
console.log(editApplicationNumber, "editApplicationNumber");
|
|
53530
53624
|
const _useQuery = useQuery(["WORKFLOW_SEARCH", editApplicationNumber, tenantId], function () {
|
|
53531
53625
|
try {
|
|
53532
53626
|
return Promise.resolve(Digit.WorkflowService.getByBusinessId(tenantId, editApplicationNumber)).then(function (res) {
|
|
@@ -53541,8 +53635,9 @@ const MutationApplication = () => {
|
|
|
53541
53635
|
}),
|
|
53542
53636
|
isWorkflowLoading = _useQuery.isLoading,
|
|
53543
53637
|
workflowData = _useQuery.data;
|
|
53638
|
+
console.log(workflowData, "workflowData");
|
|
53544
53639
|
const isEmployee = window.location.href.includes("/employee/");
|
|
53545
|
-
const isEditFlow = !!editApplicationNumber && (
|
|
53640
|
+
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");
|
|
53546
53641
|
const querySearchParam = isEditFlow ? editApplicationNumber : authKNumber;
|
|
53547
53642
|
const fallbackServiceType = serviceType || authServiceType;
|
|
53548
53643
|
const businessService = (fallbackServiceType === null || fallbackServiceType === void 0 ? void 0 : fallbackServiceType.toUpperCase()) === "SEWERAGE" ? "SW" : "WS";
|
|
@@ -53571,8 +53666,8 @@ const MutationApplication = () => {
|
|
|
53571
53666
|
}
|
|
53572
53667
|
return wsData ? {
|
|
53573
53668
|
applicationData: wsData,
|
|
53574
|
-
WaterConnection:
|
|
53575
|
-
SewerageConnections:
|
|
53669
|
+
WaterConnection: [wsData],
|
|
53670
|
+
SewerageConnections: [wsData],
|
|
53576
53671
|
propertyDetails: null,
|
|
53577
53672
|
processInstancesDetails: []
|
|
53578
53673
|
} : null;
|
|
@@ -53603,10 +53698,10 @@ const MutationApplication = () => {
|
|
|
53603
53698
|
}),
|
|
53604
53699
|
propertyDetails = _Digit$Hooks$pt$usePr.data,
|
|
53605
53700
|
isPropertyLoading = _Digit$Hooks$pt$usePr.isLoading;
|
|
53606
|
-
const _Digit$Hooks$
|
|
53607
|
-
sessionFormData = _Digit$Hooks$
|
|
53608
|
-
setSessionFormData = _Digit$Hooks$
|
|
53609
|
-
clearSessionFormData = _Digit$Hooks$
|
|
53701
|
+
const _Digit$Hooks$useSessi8 = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}),
|
|
53702
|
+
sessionFormData = _Digit$Hooks$useSessi8[0],
|
|
53703
|
+
setSessionFormData = _Digit$Hooks$useSessi8[1],
|
|
53704
|
+
clearSessionFormData = _Digit$Hooks$useSessi8[2];
|
|
53610
53705
|
useEffect(() => {
|
|
53611
53706
|
var _applicationDetails$a3;
|
|
53612
53707
|
const fetchAppData = function () {
|
|
@@ -53804,6 +53899,7 @@ const MutationApplication = () => {
|
|
|
53804
53899
|
let updatePayload = _extends({}, convertAppData, {
|
|
53805
53900
|
id: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a6 = applicationDetails.applicationData) === null || _applicationDetails$a6 === void 0 ? void 0 : _applicationDetails$a6.id,
|
|
53806
53901
|
applicationNo: editApplicationNumber,
|
|
53902
|
+
action: "RESUBMIT_APPLICATION",
|
|
53807
53903
|
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, {
|
|
53808
53904
|
action: "RESUBMIT_APPLICATION"
|
|
53809
53905
|
})
|
|
@@ -54069,7 +54165,13 @@ const MutationApplication = () => {
|
|
|
54069
54165
|
}
|
|
54070
54166
|
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
|
|
54071
54167
|
path: path + "/search-connection"
|
|
54072
|
-
}, /*#__PURE__*/React.createElement(
|
|
54168
|
+
}, isEditFlow ? /*#__PURE__*/React.createElement(Redirect, {
|
|
54169
|
+
to: {
|
|
54170
|
+
pathname: path + "/consumer-details",
|
|
54171
|
+
search: location.search,
|
|
54172
|
+
state: location.state
|
|
54173
|
+
}
|
|
54174
|
+
}) : /*#__PURE__*/React.createElement(Step1_SearchConnection, {
|
|
54073
54175
|
t: t,
|
|
54074
54176
|
defaultKNumber: isEditFlow ? applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a8 = applicationDetails.applicationData) === null || _applicationDetails$a8 === void 0 ? void 0 : _applicationDetails$a8.connectionNo : "",
|
|
54075
54177
|
isEditFlow: isEditFlow,
|
|
@@ -54087,7 +54189,13 @@ const MutationApplication = () => {
|
|
|
54087
54189
|
}
|
|
54088
54190
|
})), /*#__PURE__*/React.createElement(Route, {
|
|
54089
54191
|
path: path + "/existing-connection"
|
|
54090
|
-
},
|
|
54192
|
+
}, isEditFlow ? /*#__PURE__*/React.createElement(Redirect, {
|
|
54193
|
+
to: {
|
|
54194
|
+
pathname: path + "/consumer-details",
|
|
54195
|
+
search: location.search,
|
|
54196
|
+
state: location.state
|
|
54197
|
+
}
|
|
54198
|
+
}) : /*#__PURE__*/React.createElement(Fragment$2, null, /*#__PURE__*/React.createElement(Step1_ExistingConnection, {
|
|
54091
54199
|
t: t,
|
|
54092
54200
|
applicationDetails: authActiveConnection ? {
|
|
54093
54201
|
applicationData: authActiveConnection
|
|
@@ -54142,7 +54250,11 @@ const MutationApplication = () => {
|
|
|
54142
54250
|
exact: true,
|
|
54143
54251
|
path: path
|
|
54144
54252
|
}, /*#__PURE__*/React.createElement(Redirect, {
|
|
54145
|
-
to:
|
|
54253
|
+
to: {
|
|
54254
|
+
pathname: isEditFlow ? path + "/consumer-details" : path + "/search-connection",
|
|
54255
|
+
search: location.search,
|
|
54256
|
+
state: location.state
|
|
54257
|
+
}
|
|
54146
54258
|
}))), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
54147
54259
|
error: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "error",
|
|
54148
54260
|
warning: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "warning",
|