@mseva/digit-ui-module-ptr 1.3.4-dev.2.7 → 1.3.4-dev.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +33 -71
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -7684,18 +7684,9 @@ const PTRCitizenPet = ({
|
|
|
7684
7684
|
return gt.name === (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$3 = apiDataCheck[0]) === null || _apiDataCheck$3 === void 0 ? void 0 : (_apiDataCheck$3$petDe = _apiDataCheck$3.petDetails) === null || _apiDataCheck$3$petDe === void 0 ? void 0 : _apiDataCheck$3$petDe.petGender);
|
|
7685
7685
|
})) || null;
|
|
7686
7686
|
const pathParts = window.location.pathname.split("/");
|
|
7687
|
-
const
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
const nextPart = pathParts[startIndex + 1];
|
|
7691
|
-
if (nextPart !== null && nextPart !== void 0 && nextPart.startsWith("PB-PTR-")) {
|
|
7692
|
-
id = nextPart;
|
|
7693
|
-
} else if (nextPart === "PL") {
|
|
7694
|
-
id = pathParts.slice(startIndex + 1, startIndex + 5).join("/");
|
|
7695
|
-
}
|
|
7696
|
-
}
|
|
7697
|
-
id = id ? decodeURIComponent(id) : null;
|
|
7698
|
-
const checkForRenew = window.location.pathname.includes("renew-application");
|
|
7687
|
+
const id = pathParts[pathParts.length - 1];
|
|
7688
|
+
const checkNumber = pathParts[pathParts.length - 2];
|
|
7689
|
+
const checkForRenew = id == "renew-application";
|
|
7699
7690
|
const today = new Date();
|
|
7700
7691
|
const todayStr = today.toISOString().split("T")[0];
|
|
7701
7692
|
const minVaccineDate = new Date();
|
|
@@ -7721,7 +7712,7 @@ const PTRCitizenPet = ({
|
|
|
7721
7712
|
return new Date(dateStr).getTime();
|
|
7722
7713
|
}
|
|
7723
7714
|
const onSubmit = async data => {
|
|
7724
|
-
var _currentStepData$Crea, _currentStepData$appl, _data$petType, _data$breedType, _data$petGender,
|
|
7715
|
+
var _currentStepData$Crea, _currentStepData$appl, _data$petType, _data$breedType, _data$petGender, _currentStepData$resp;
|
|
7725
7716
|
if (validateStep) {
|
|
7726
7717
|
const validationErrors = validateStep(data);
|
|
7727
7718
|
if (Object.keys(validationErrors).length > 0) return;
|
|
@@ -7759,9 +7750,9 @@ const PTRCitizenPet = ({
|
|
|
7759
7750
|
},
|
|
7760
7751
|
address: {
|
|
7761
7752
|
pincode,
|
|
7762
|
-
addressId:
|
|
7753
|
+
addressId: currentStepData.ownerDetails.address
|
|
7763
7754
|
},
|
|
7764
|
-
previousApplicationNumber:
|
|
7755
|
+
previousApplicationNumber: checkNumber ? checkNumber : null,
|
|
7765
7756
|
applicationType: checkForRenew ? "RENEWAPPLICATION" : "NEWAPPLICATION",
|
|
7766
7757
|
ownerName: name,
|
|
7767
7758
|
fatherName: filteredOwnerDetails === null || filteredOwnerDetails === void 0 ? void 0 : filteredOwnerDetails.fatherOrHusbandName,
|
|
@@ -7772,8 +7763,6 @@ const PTRCitizenPet = ({
|
|
|
7772
7763
|
status: "INITIATED"
|
|
7773
7764
|
}
|
|
7774
7765
|
};
|
|
7775
|
-
console.log("formData", formData);
|
|
7776
|
-
console.log("apiDataCheck check", apiDataCheck);
|
|
7777
7766
|
const pick = (newV, oldV) => newV !== undefined && newV !== null && newV !== "" ? newV : oldV;
|
|
7778
7767
|
const existing = (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : apiDataCheck[0]) || (currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$resp = currentStepData.responseData) === null || _currentStepData$resp === void 0 ? void 0 : _currentStepData$resp[0]) || {};
|
|
7779
7768
|
if (existing !== null && existing !== void 0 && existing.applicationNumber && !checkForRenew) {
|
|
@@ -7850,11 +7839,11 @@ const PTRCitizenPet = ({
|
|
|
7850
7839
|
}
|
|
7851
7840
|
};
|
|
7852
7841
|
useEffect(() => {
|
|
7853
|
-
var _apiDataCheck$
|
|
7854
|
-
if (apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$
|
|
7855
|
-
var _apiDataCheck$
|
|
7842
|
+
var _apiDataCheck$4;
|
|
7843
|
+
if (apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$4 = apiDataCheck[0]) !== null && _apiDataCheck$4 !== void 0 && _apiDataCheck$4.petDetails) {
|
|
7844
|
+
var _apiDataCheck$5, _apiDataCheck$5$audit;
|
|
7856
7845
|
console.log("apiDataCheck?.[0]?.petDetails", apiDataCheck === null || apiDataCheck === void 0 ? void 0 : apiDataCheck[0]);
|
|
7857
|
-
const createdTime = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$
|
|
7846
|
+
const createdTime = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$5 = apiDataCheck[0]) === null || _apiDataCheck$5 === void 0 ? void 0 : (_apiDataCheck$5$audit = _apiDataCheck$5.auditDetails) === null || _apiDataCheck$5$audit === void 0 ? void 0 : _apiDataCheck$5$audit.createdTime;
|
|
7858
7847
|
const createdDate = new Date(Number(createdTime));
|
|
7859
7848
|
const currentDate = new Date();
|
|
7860
7849
|
const monthsDiff = (currentDate.getFullYear() - createdDate.getFullYear()) * 12 + (currentDate.getMonth() - createdDate.getMonth());
|
|
@@ -7921,7 +7910,7 @@ const PTRCitizenPet = ({
|
|
|
7921
7910
|
totalYears: years + months / 12
|
|
7922
7911
|
};
|
|
7923
7912
|
};
|
|
7924
|
-
const AGE_REGEX = /^(?:(?:[1-9]|[1-3][0-9])(?:\.(?:
|
|
7913
|
+
const AGE_REGEX = /^(?:(?:[1-9]|[1-3][0-9])(?:\.(?:[1-9]|1[01]))?|40(?:\.0?)?|0?\.(?:[1-9]|1[01]))$/;
|
|
7925
7914
|
const petAgeVal = watch("petAge");
|
|
7926
7915
|
useEffect(() => {
|
|
7927
7916
|
if (!petAgeVal) return;
|
|
@@ -15380,12 +15369,12 @@ const PTRCitizenDetails = ({
|
|
|
15380
15369
|
var _apiDataCheck$;
|
|
15381
15370
|
const formattedData = (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$ = apiDataCheck[0]) === null || _apiDataCheck$ === void 0 ? void 0 : _apiDataCheck$.owner) || (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.ownerDetails);
|
|
15382
15371
|
if (formattedData) {
|
|
15383
|
-
var _apiDataCheck$2, _apiDataCheck$2$addre,
|
|
15372
|
+
var _apiDataCheck$2, _apiDataCheck$2$addre, _currentStepData$owne, _apiDataCheck$3, _apiDataCheck$3$addre, _currentStepData$owne2;
|
|
15384
15373
|
Object.entries(formattedData).forEach(([key, value]) => {
|
|
15385
15374
|
setValue(key, value);
|
|
15386
15375
|
});
|
|
15387
|
-
setValue("address", (apiDataCheck
|
|
15388
|
-
setValue("pincode", (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$
|
|
15376
|
+
setValue("address", (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$2 = apiDataCheck[0]) === null || _apiDataCheck$2 === void 0 ? void 0 : (_apiDataCheck$2$addre = _apiDataCheck$2.address) === null || _apiDataCheck$2$addre === void 0 ? void 0 : _apiDataCheck$2$addre.addressId) || (currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$owne = currentStepData.ownerDetails) === null || _currentStepData$owne === void 0 ? void 0 : _currentStepData$owne.address) || "");
|
|
15377
|
+
setValue("pincode", (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$3 = apiDataCheck[0]) === null || _apiDataCheck$3 === void 0 ? void 0 : (_apiDataCheck$3$addre = _apiDataCheck$3.address) === null || _apiDataCheck$3$addre === void 0 ? void 0 : _apiDataCheck$3$addre.pincode) || (currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$owne2 = currentStepData.ownerDetails) === null || _currentStepData$owne2 === void 0 ? void 0 : _currentStepData$owne2.pincode) || "");
|
|
15389
15378
|
}
|
|
15390
15379
|
}, [apiDataCheck, currentStepData, setValue]);
|
|
15391
15380
|
const getErrorMessage = fieldName => {
|
|
@@ -17043,7 +17032,7 @@ function NewApplicationTimeline({
|
|
|
17043
17032
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
17044
17033
|
className: "custom-timeline-entries"
|
|
17045
17034
|
}, sortedData === null || sortedData === void 0 ? void 0 : sortedData.map((item, index) => {
|
|
17046
|
-
var _item$auditDetails, _item$auditDetails2, _item$assigner2, _item$assigner3, _item$assigner4, _item$wfComment, _item$wfComment2, _item$wfComment3, _item$assignes, _item$assignes$, _item$assignes$2, _item$assignes$3, _item$wfDocuments, _item$wfDocuments2;
|
|
17035
|
+
var _item$auditDetails, _item$auditDetails2, _item$assigner2, _item$assigner3, _item$assigner4, _item$assigner5, _item$assigner6, _item$wfComment, _item$wfComment2, _item$wfComment3, _item$assignes, _item$assignes$, _item$assignes$2, _item$assignes$3, _item$wfDocuments, _item$wfDocuments2;
|
|
17047
17036
|
return /*#__PURE__*/React.createElement("div", {
|
|
17048
17037
|
key: index,
|
|
17049
17038
|
className: "custom-timeline-entry"
|
|
@@ -17080,9 +17069,13 @@ function NewApplicationTimeline({
|
|
|
17080
17069
|
className: "custom-officer-info"
|
|
17081
17070
|
}, /*#__PURE__*/React.createElement("div", {
|
|
17082
17071
|
className: "custom-officer-name"
|
|
17083
|
-
}, (item === null || item === void 0 ? void 0 : (_item$assigner2 = item.assigner) === null || _item$assigner2 === void 0 ? void 0 : _item$assigner2.name) || t("CS_COMMON_NA")
|
|
17072
|
+
}, (item === null || item === void 0 ? void 0 : (_item$assigner2 = item.assigner) === null || _item$assigner2 === void 0 ? void 0 : _item$assigner2.name) || t("CS_COMMON_NA"), deptMap[item === null || item === void 0 ? void 0 : (_item$assigner3 = item.assigner) === null || _item$assigner3 === void 0 ? void 0 : _item$assigner3.userName] && /*#__PURE__*/React.createElement("span", {
|
|
17084
17073
|
className: "custom-officer-name"
|
|
17085
|
-
}, t(deptMap[item === null || item === void 0 ? void 0 : (_item$assigner4 = item.assigner) === null || _item$assigner4 === void 0 ? void 0 : _item$assigner4.userName])))
|
|
17074
|
+
}, "- ", t(deptMap[item === null || item === void 0 ? void 0 : (_item$assigner4 = item.assigner) === null || _item$assigner4 === void 0 ? void 0 : _item$assigner4.userName]))), (item === null || item === void 0 ? void 0 : (_item$assigner5 = item.assigner) === null || _item$assigner5 === void 0 ? void 0 : _item$assigner5.emailId) && /*#__PURE__*/React.createElement("div", {
|
|
17075
|
+
className: "custom-officer-email"
|
|
17076
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
17077
|
+
className: "custom-email-label"
|
|
17078
|
+
}, t("Email")), " ", item === null || item === void 0 ? void 0 : (_item$assigner6 = item.assigner) === null || _item$assigner6 === void 0 ? void 0 : _item$assigner6.emailId))), /*#__PURE__*/React.createElement("div", {
|
|
17086
17079
|
className: "custom-card-column custom-card-column-mid"
|
|
17087
17080
|
}, (item === null || item === void 0 ? void 0 : item.sla) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h3", {
|
|
17088
17081
|
className: "custom-action-title"
|
|
@@ -17136,7 +17129,7 @@ function NewApplicationTimeline({
|
|
|
17136
17129
|
}
|
|
17137
17130
|
|
|
17138
17131
|
const PTRWFApplicationTimeline = props => {
|
|
17139
|
-
var _props$application2, _props$application3, _props$application4,
|
|
17132
|
+
var _props$application2, _props$application3, _props$application4, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _user$info, _user$info$roles, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data0, _props$application0, _props$application1, _actions$, _props$application10, _props$application11, _props$application13, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11;
|
|
17140
17133
|
const {
|
|
17141
17134
|
t
|
|
17142
17135
|
} = useTranslation();
|
|
@@ -17156,14 +17149,6 @@ const PTRWFApplicationTimeline = props => {
|
|
|
17156
17149
|
role: "EMPLOYEE"
|
|
17157
17150
|
});
|
|
17158
17151
|
console.log("workflowDetails", workflowDetails);
|
|
17159
|
-
const {
|
|
17160
|
-
data,
|
|
17161
|
-
isLoading: isMDMSLoading
|
|
17162
|
-
} = Digit.Hooks.useCustomMDMS(tenantId, "PetService", [{
|
|
17163
|
-
name: "ApplicationType"
|
|
17164
|
-
}]);
|
|
17165
|
-
const checkRenewTime = data === null || data === void 0 ? void 0 : (_data$PetService = data.PetService) === null || _data$PetService === void 0 ? void 0 : (_data$PetService$Appl = _data$PetService.ApplicationType) === null || _data$PetService$Appl === void 0 ? void 0 : _data$PetService$Appl.filter(item => item.code == "RENEWAPPLICATION");
|
|
17166
|
-
const checkTimeRenew = (checkRenewTime === null || checkRenewTime === void 0 ? void 0 : (_checkRenewTime$ = checkRenewTime[0]) === null || _checkRenewTime$ === void 0 ? void 0 : _checkRenewTime$.renewalPeriod) * 1000;
|
|
17167
17152
|
if (workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data = workflowDetails.data) !== null && _workflowDetails$data !== void 0 && (_workflowDetails$data2 = _workflowDetails$data.actionState) !== null && _workflowDetails$data2 !== void 0 && _workflowDetails$data2.nextActions && !workflowDetails.isLoading) workflowDetails.data.actionState.nextActions = [...(workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data3 = workflowDetails.data) === null || _workflowDetails$data3 === void 0 ? void 0 : _workflowDetails$data3.nextActions)];
|
|
17168
17153
|
if (workflowDetails && workflowDetails.data && !workflowDetails.isLoading) {
|
|
17169
17154
|
var _workflowDetails$data4, _workflowDetails$data5;
|
|
@@ -17334,16 +17319,10 @@ const PTRWFApplicationTimeline = props => {
|
|
|
17334
17319
|
fetchWorkflowService();
|
|
17335
17320
|
}
|
|
17336
17321
|
}, [tenantId]);
|
|
17337
|
-
const validToObj = (_props$application0 = props.application) === null || _props$application0 === void 0 ? void 0 : _props$application0.validityDate;
|
|
17338
|
-
const validToMillis = validToObj ? validToObj * 1000 : null;
|
|
17339
|
-
const currentDateObj = Date.now();
|
|
17340
|
-
const duration = validToObj && currentDateObj ? validToMillis - currentDateObj : null;
|
|
17341
|
-
const checkDuration = duration !== null && duration <= checkTimeRenew;
|
|
17342
|
-
const checkRenewal = ((_props$application1 = props.application) === null || _props$application1 === void 0 ? void 0 : _props$application1.status) == "APPROVED" || ((_props$application10 = props.application) === null || _props$application10 === void 0 ? void 0 : _props$application10.status) == "EXPIRED";
|
|
17343
17322
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(NewApplicationTimeline, {
|
|
17344
17323
|
workflowDetails: workflowDetails,
|
|
17345
17324
|
t: t
|
|
17346
|
-
}), (((_props$
|
|
17325
|
+
}), (((_props$application0 = props.application) === null || _props$application0 === void 0 ? void 0 : _props$application0.status) != "CITIZENACTIONREQUIRED" || ((_props$application1 = props.application) === null || _props$application1 === void 0 ? void 0 : _props$application1.status) != "INITIATED") && actions && ((_actions$ = actions[0]) === null || _actions$ === void 0 ? void 0 : _actions$.action) != "PAY" && !isCitizen && /*#__PURE__*/React.createElement(ActionBar, null, displayMenu ? /*#__PURE__*/React.createElement(Menu, {
|
|
17347
17326
|
localeKeyPrefix: `WF_EMPLOYEE_${"PTR"}`,
|
|
17348
17327
|
options: actions,
|
|
17349
17328
|
optionKey: "action",
|
|
@@ -17353,24 +17332,18 @@ const PTRWFApplicationTimeline = props => {
|
|
|
17353
17332
|
ref: menuRef,
|
|
17354
17333
|
label: t("WF_TAKE_ACTION"),
|
|
17355
17334
|
onSubmit: () => setDisplayMenu(!displayMenu)
|
|
17356
|
-
})), (((_props$
|
|
17335
|
+
})), (((_props$application10 = props.application) === null || _props$application10 === void 0 ? void 0 : _props$application10.status) == "CITIZENACTIONREQUIRED" || ((_props$application11 = props.application) === null || _props$application11 === void 0 ? void 0 : _props$application11.status) == "INITIATED") && !isCitizen && /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
17357
17336
|
label: t("COMMON_EDIT"),
|
|
17358
17337
|
onSubmit: () => {
|
|
17359
|
-
var _props$
|
|
17360
|
-
history.push(`/digit-ui/employee/ptr/petservice/new-application/${(_props$
|
|
17361
|
-
}
|
|
17362
|
-
})), checkRenewal && checkDuration && ((_props$application16 = props.application) === null || _props$application16 === void 0 ? void 0 : _props$application16.status) == "APPROVED" && !isCitizen && /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
17363
|
-
label: t("PT_RENEW_HEADER"),
|
|
17364
|
-
onSubmit: () => {
|
|
17365
|
-
var _props$application17;
|
|
17366
|
-
history.push(`/digit-ui/employee/ptr/petservice/new-application/${props === null || props === void 0 ? void 0 : (_props$application17 = props.application) === null || _props$application17 === void 0 ? void 0 : _props$application17.applicationNumber}/renew-application`);
|
|
17338
|
+
var _props$application12;
|
|
17339
|
+
history.push(`/digit-ui/employee/ptr/petservice/new-application/${(_props$application12 = props.application) === null || _props$application12 === void 0 ? void 0 : _props$application12.applicationNumber}`);
|
|
17367
17340
|
}
|
|
17368
17341
|
})), showModal ? /*#__PURE__*/React.createElement(PTRModal, {
|
|
17369
17342
|
t: t,
|
|
17370
17343
|
action: selectedAction,
|
|
17371
17344
|
tenantId: tenantId,
|
|
17372
17345
|
state: state,
|
|
17373
|
-
id: (_props$
|
|
17346
|
+
id: (_props$application13 = props.application) === null || _props$application13 === void 0 ? void 0 : _props$application13.applicationNumber,
|
|
17374
17347
|
applicationDetails: props.application,
|
|
17375
17348
|
closeModal: closeModal,
|
|
17376
17349
|
submitAction: submitAction,
|
|
@@ -22702,7 +22675,7 @@ const NewApplication = () => {
|
|
|
22702
22675
|
};
|
|
22703
22676
|
|
|
22704
22677
|
const ApplicationDetails = () => {
|
|
22705
|
-
var _tenantInfo$city, _tenantInfo$city2, _pet_details$addition, _user$info,
|
|
22678
|
+
var _tenantInfo$city, _tenantInfo$city2, _pet_details$addition, _user$info, _reciept_data$Payment7, _reciept_data$Payment8, _pet_details$owner, _pet_details$owner2, _pet_details$owner3, _pet_details$owner4, _pet_details$owner5, _pet_details$address, _pet_details$address2, _pet_details$petDetai, _pet_details$petDetai2, _pet_details$petDetai3, _pet_details$petDetai4, _pet_details$petDetai5, _pet_details$petDetai6, _pet_details$petDetai8, _pet_details$petDetai9, _pet_details$petDetai0;
|
|
22706
22679
|
const {
|
|
22707
22680
|
t
|
|
22708
22681
|
} = useTranslation();
|
|
@@ -23419,7 +23392,7 @@ const ApplicationDetails = () => {
|
|
|
23419
23392
|
}
|
|
23420
23393
|
let dowloadOptions = [];
|
|
23421
23394
|
let user = Digit.UserService.getUser();
|
|
23422
|
-
const isCemp = user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 :
|
|
23395
|
+
const isCemp = user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.roles.filter(role => role.code === "CEMP");
|
|
23423
23396
|
dowloadOptions.push({
|
|
23424
23397
|
label: t("PTR_PET_DOWNLOAD_ACK_FORM"),
|
|
23425
23398
|
onClick: () => downloadAcknowledgement()
|
|
@@ -23478,7 +23451,7 @@ const ApplicationDetails = () => {
|
|
|
23478
23451
|
styles: {
|
|
23479
23452
|
fontSize: "32px"
|
|
23480
23453
|
}
|
|
23481
|
-
}, t("CS_APPLICATION_DETAILS")), isCemp &&
|
|
23454
|
+
}, t("CS_APPLICATION_DETAILS")), isCemp && dowloadOptions && dowloadOptions.length > 0 && /*#__PURE__*/React.createElement(MultiLink, {
|
|
23482
23455
|
className: "multilinkWrapper",
|
|
23483
23456
|
onHeadClick: () => setShowOptions(!showOptions),
|
|
23484
23457
|
displayOptions: showOptions,
|
|
@@ -24475,19 +24448,9 @@ const NewPTRStepperForm = () => {
|
|
|
24475
24448
|
const step = formState.step;
|
|
24476
24449
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
24477
24450
|
const pathParts = window.location.pathname.split("/");
|
|
24478
|
-
const
|
|
24479
|
-
|
|
24480
|
-
|
|
24481
|
-
const nextPart = pathParts[startIndex + 1];
|
|
24482
|
-
if (nextPart !== null && nextPart !== void 0 && nextPart.startsWith("PB-PTR-")) {
|
|
24483
|
-
id = nextPart;
|
|
24484
|
-
} else if (nextPart === "PL") {
|
|
24485
|
-
id = pathParts.slice(startIndex + 1, startIndex + 5).join("/");
|
|
24486
|
-
}
|
|
24487
|
-
}
|
|
24488
|
-
id = id ? decodeURIComponent(id) : null;
|
|
24489
|
-
console.log("id:", id);
|
|
24490
|
-
const shouldEnableSearch = Boolean(id);
|
|
24451
|
+
const id = pathParts.find(part => part.startsWith("PB-PTR-"));
|
|
24452
|
+
console.log("id", id);
|
|
24453
|
+
const shouldEnableSearch = Boolean(id && id.startsWith("PB-PTR-"));
|
|
24491
24454
|
console.log("shouldEnableSearch", shouldEnableSearch);
|
|
24492
24455
|
const {
|
|
24493
24456
|
isLoading,
|
|
@@ -24502,7 +24465,6 @@ const NewPTRStepperForm = () => {
|
|
|
24502
24465
|
useEffect(() => {
|
|
24503
24466
|
var _applicationData$PetR;
|
|
24504
24467
|
console.log("applicationData for hereee:>> ", applicationData);
|
|
24505
|
-
console.log("id", id);
|
|
24506
24468
|
if (id && applicationData !== null && applicationData !== void 0 && (_applicationData$PetR = applicationData.PetRegistrationApplications) !== null && _applicationData$PetR !== void 0 && _applicationData$PetR.length) {
|
|
24507
24469
|
dispatch(UPDATE_PTRNewApplication_FORM("responseData", applicationData.PetRegistrationApplications));
|
|
24508
24470
|
}
|