@djb25/digit-ui-module-wt 1.0.37 → 1.0.39
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 +185 -128
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -2592,19 +2592,6 @@ const InboxLinks = ({
|
|
|
2592
2592
|
const {
|
|
2593
2593
|
t
|
|
2594
2594
|
} = useTranslation();
|
|
2595
|
-
const allLinks = [];
|
|
2596
|
-
const [links, setLinks] = useState([]);
|
|
2597
|
-
const {
|
|
2598
|
-
roles: userRoles
|
|
2599
|
-
} = Digit.UserService.getUser().info;
|
|
2600
|
-
useEffect(() => {
|
|
2601
|
-
let linksToShow = allLinks.filter(e => e.businessService === businessService).filter(({
|
|
2602
|
-
roles
|
|
2603
|
-
}) => roles.some(e => userRoles.map(({
|
|
2604
|
-
code
|
|
2605
|
-
}) => code).includes(e)) || !(roles !== null && roles !== void 0 && roles.length));
|
|
2606
|
-
setLinks(linksToShow);
|
|
2607
|
-
}, []);
|
|
2608
2595
|
const GetLogo = () => /*#__PURE__*/React.createElement("div", {
|
|
2609
2596
|
className: "header"
|
|
2610
2597
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -2618,23 +2605,7 @@ const InboxLinks = ({
|
|
|
2618
2605
|
className: "filter inboxLinks"
|
|
2619
2606
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2620
2607
|
className: "complaint-links-container"
|
|
2621
|
-
}, Digit.UserService.getUser().info.type !== "CITIZEN" && GetLogo()
|
|
2622
|
-
className: "body"
|
|
2623
|
-
}, links.map(({
|
|
2624
|
-
link,
|
|
2625
|
-
text,
|
|
2626
|
-
hyperlink: _hyperlink = false,
|
|
2627
|
-
roles: _roles = []
|
|
2628
|
-
}, index) => {
|
|
2629
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
2630
|
-
className: "link",
|
|
2631
|
-
key: index
|
|
2632
|
-
}, _hyperlink ? /*#__PURE__*/React.createElement("a", {
|
|
2633
|
-
href: link
|
|
2634
|
-
}, text) : /*#__PURE__*/React.createElement(Link, {
|
|
2635
|
-
to: link
|
|
2636
|
-
}, t(text)));
|
|
2637
|
-
}))))
|
|
2608
|
+
}, Digit.UserService.getUser().info.type !== "CITIZEN" && GetLogo()))
|
|
2638
2609
|
);
|
|
2639
2610
|
};
|
|
2640
2611
|
|
|
@@ -4641,6 +4612,25 @@ const calculateDistance = (lat1, lon1, lat2, lon2) => {
|
|
|
4641
4612
|
function deg2rad(deg) {
|
|
4642
4613
|
return deg * (Math.PI / 180);
|
|
4643
4614
|
}
|
|
4615
|
+
const geocodeAddress = async address => {
|
|
4616
|
+
if (!address || !address.trim()) return null;
|
|
4617
|
+
try {
|
|
4618
|
+
const response = await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(address)}`, {
|
|
4619
|
+
headers: {
|
|
4620
|
+
"Accept-Language": "en",
|
|
4621
|
+
"User-Agent": "Digit-UI-WT-Module"
|
|
4622
|
+
}
|
|
4623
|
+
});
|
|
4624
|
+
if (!response.ok) {
|
|
4625
|
+
throw new Error(`Geocoding failed: ${response.statusText}`);
|
|
4626
|
+
}
|
|
4627
|
+
const data = await response.json();
|
|
4628
|
+
return data;
|
|
4629
|
+
} catch (error) {
|
|
4630
|
+
console.error("Error in geocodeAddress:", error);
|
|
4631
|
+
return null;
|
|
4632
|
+
}
|
|
4633
|
+
};
|
|
4644
4634
|
|
|
4645
4635
|
delete L.Icon.Default.prototype._getIconUrl;
|
|
4646
4636
|
L.Icon.Default.mergeOptions({
|
|
@@ -5232,20 +5222,18 @@ function LiveTrackingSystem() {
|
|
|
5232
5222
|
} = Digit.Hooks.fsm.useVendorSearch({
|
|
5233
5223
|
tenantId,
|
|
5234
5224
|
filters: {
|
|
5235
|
-
status: "ACTIVE"
|
|
5225
|
+
status: "ACTIVE",
|
|
5226
|
+
...(selectedFillingPoint !== null && selectedFillingPoint !== void 0 && selectedFillingPoint.id ? {
|
|
5227
|
+
fillingPointId: selectedFillingPoint === null || selectedFillingPoint === void 0 ? void 0 : selectedFillingPoint.id
|
|
5228
|
+
} : {})
|
|
5236
5229
|
},
|
|
5237
5230
|
config: {
|
|
5238
5231
|
select: data => (data === null || data === void 0 ? void 0 : data.vendor) || []
|
|
5239
5232
|
}
|
|
5240
5233
|
});
|
|
5241
5234
|
const filteredVendorOptions = useMemo(() => {
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
return vendorOptions.filter(vendor => {
|
|
5245
|
-
var _vendor$fillingPoint;
|
|
5246
|
-
return (vendor === null || vendor === void 0 ? void 0 : (_vendor$fillingPoint = vendor.fillingPoint) === null || _vendor$fillingPoint === void 0 ? void 0 : _vendor$fillingPoint.id) === (selectedFillingPoint === null || selectedFillingPoint === void 0 ? void 0 : selectedFillingPoint.id);
|
|
5247
|
-
});
|
|
5248
|
-
}, [vendorOptions, selectedFillingPoint]);
|
|
5235
|
+
return vendorOptions || [];
|
|
5236
|
+
}, [vendorOptions]);
|
|
5249
5237
|
useEffect(() => {
|
|
5250
5238
|
if (vendorOptions !== null && vendorOptions !== void 0 && vendorOptions.length && Object.keys(drivers).length) {
|
|
5251
5239
|
var _vendorOptions$, _vendorOptions$2, _vendorOptions$2$driv;
|
|
@@ -5354,8 +5342,7 @@ function LiveTrackingSystem() {
|
|
|
5354
5342
|
const matchesFillingPoint = !selectedFillingPoint || (() => {
|
|
5355
5343
|
if (!vendorOptions || !vendorOptions.length) return false;
|
|
5356
5344
|
return vendorOptions.some(vendor => {
|
|
5357
|
-
var _vendor$
|
|
5358
|
-
if ((vendor === null || vendor === void 0 ? void 0 : (_vendor$fillingPoint2 = vendor.fillingPoint) === null || _vendor$fillingPoint2 === void 0 ? void 0 : _vendor$fillingPoint2.id) !== (selectedFillingPoint === null || selectedFillingPoint === void 0 ? void 0 : selectedFillingPoint.id)) return false;
|
|
5345
|
+
var _vendor$drivers2;
|
|
5359
5346
|
return (_vendor$drivers2 = vendor.drivers) === null || _vendor$drivers2 === void 0 ? void 0 : _vendor$drivers2.some(d => {
|
|
5360
5347
|
var _d$owner5, _d$owner6, _d$owner7, _d$owner8;
|
|
5361
5348
|
return ((_d$owner5 = d.owner) === null || _d$owner5 === void 0 ? void 0 : _d$owner5.mobileNumber) === driver.driverId || ((_d$owner6 = d.owner) === null || _d$owner6 === void 0 ? void 0 : _d$owner6.uuid) === driver.driverId || d.id === driver.driverId || String((_d$owner7 = d.owner) === null || _d$owner7 === void 0 ? void 0 : _d$owner7.mobileNumber) === String(driver.driverId) || String((_d$owner8 = d.owner) === null || _d$owner8 === void 0 ? void 0 : _d$owner8.uuid) === String(driver.driverId);
|
|
@@ -6131,7 +6118,7 @@ const AddFixFillAddress = ({
|
|
|
6131
6118
|
isEdit,
|
|
6132
6119
|
userDetails
|
|
6133
6120
|
}) => {
|
|
6134
|
-
var _location$state, _formData$address, _formData$address2, _formData$address3, _formData$address4, _formData$address5, _formData$address6, _formData$address7, _formData$address8, _formData$address9, _formData$address0, _formData$address1, _formData$address10, _formData$address11, _userDetails$addresse;
|
|
6121
|
+
var _location$state, _formData$address, _formData$address2, _formData$address3, _formData$address4, _formData$address5, _formData$address6, _formData$address7, _formData$address8, _formData$address9, _formData$address0, _formData$address1, _formData$address10, _formData$address11, _formData$address12, _userDetails$addresse;
|
|
6135
6122
|
const {
|
|
6136
6123
|
data: allCities
|
|
6137
6124
|
} = Digit.Hooks.useTenants();
|
|
@@ -6146,12 +6133,17 @@ const AddFixFillAddress = ({
|
|
|
6146
6133
|
const [landmark, setLandmark] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address6 = formData.address) === null || _formData$address6 === void 0 ? void 0 : _formData$address6.landmark) || "");
|
|
6147
6134
|
const [addressLine1, setAddressLine1] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address7 = formData.address) === null || _formData$address7 === void 0 ? void 0 : _formData$address7.addressLine1) || "");
|
|
6148
6135
|
const [addressLine2, setAddressLine2] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address8 = formData.address) === null || _formData$address8 === void 0 ? void 0 : _formData$address8.addressLine2) || "");
|
|
6149
|
-
const [addressType, setAddressType] = useState(
|
|
6136
|
+
const [addressType, setAddressType] = useState(formData !== null && formData !== void 0 && (_formData$address9 = formData.address) !== null && _formData$address9 !== void 0 && _formData$address9.addressType ? allOptions.find(a => a.code === formData.address.addressType) || formData.address.addressType : allOptions.find(a => a.code === "PERMANENT"));
|
|
6150
6137
|
const [zone, setZone] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address0 = formData.address) === null || _formData$address0 === void 0 ? void 0 : _formData$address0.zone) || "");
|
|
6151
6138
|
const [block, setBlock] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address1 = formData.address) === null || _formData$address1 === void 0 ? void 0 : _formData$address1.block) || "");
|
|
6152
|
-
const [
|
|
6153
|
-
const [
|
|
6139
|
+
const [assembly, setAssembly] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address10 = formData.address) === null || _formData$address10 === void 0 ? void 0 : _formData$address10.assembly) || "");
|
|
6140
|
+
const [latitude, setLatitude] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address11 = formData.address) === null || _formData$address11 === void 0 ? void 0 : _formData$address11.latitude) || "");
|
|
6141
|
+
const [longitude, setLongitude] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address12 = formData.address) === null || _formData$address12 === void 0 ? void 0 : _formData$address12.longitude) || "");
|
|
6154
6142
|
const [selectedAddress, setSelectedAddress] = useState("");
|
|
6143
|
+
const [showPincodeSuggestions, setShowPincodeSuggestions] = useState(false);
|
|
6144
|
+
const [loading, setLoading] = useState(false);
|
|
6145
|
+
const [error, setError] = useState(null);
|
|
6146
|
+
const [geocodedAddress, setGeocodedAddress] = useState(null);
|
|
6155
6147
|
const isInitialized = useRef(!isEdit);
|
|
6156
6148
|
const lastSyncedAddress = useRef(null);
|
|
6157
6149
|
const lastBookingId = useRef(null);
|
|
@@ -6183,27 +6175,32 @@ const AddFixFillAddress = ({
|
|
|
6183
6175
|
const structuredLocality = useMemo(() => {
|
|
6184
6176
|
let localities = [];
|
|
6185
6177
|
const boundaries = Array.isArray(boundaryData) ? boundaryData : boundaryData ? [boundaryData] : [];
|
|
6186
|
-
const extractLocalities = (node, zone = null, ward = null) => {
|
|
6178
|
+
const extractLocalities = (node, zone = null, ward = null, assembly = null) => {
|
|
6187
6179
|
if (!node) return;
|
|
6188
6180
|
let currentZone = zone;
|
|
6189
6181
|
let currentWard = ward;
|
|
6182
|
+
let currentAssembly = assembly;
|
|
6190
6183
|
if (node.label === "Zone" || node.label === "ZONE") {
|
|
6191
6184
|
currentZone = node.localname || node.code || node.name;
|
|
6192
6185
|
}
|
|
6193
6186
|
if (node.label === "Ward" || node.label === "WARD" || node.label === "Block" || node.label === "BLOCK") {
|
|
6194
6187
|
currentWard = node.code || node.localname || node.name;
|
|
6195
6188
|
}
|
|
6189
|
+
if (node.label === "Assembly Constituency" || node.label === "ASSEMBLY_CONSTITUENCY") {
|
|
6190
|
+
currentAssembly = node.code || node.localname || node.name;
|
|
6191
|
+
}
|
|
6196
6192
|
if (node.label === "Locality" || node.label === "LOCALITY") {
|
|
6197
6193
|
localities.push({
|
|
6198
6194
|
...node,
|
|
6199
6195
|
name: node.localname || node.name || node.code,
|
|
6200
6196
|
i18nkey: node.i18nkey || `${tenantId.replace(".", "_")}_REVENUE_${node.code}`.toUpperCase(),
|
|
6201
6197
|
zone: currentZone,
|
|
6202
|
-
ward: currentWard
|
|
6198
|
+
ward: currentWard,
|
|
6199
|
+
assembly: currentAssembly
|
|
6203
6200
|
});
|
|
6204
6201
|
}
|
|
6205
6202
|
if (node.children && node.children.length > 0) {
|
|
6206
|
-
node.children.forEach(child => extractLocalities(child, currentZone, currentWard));
|
|
6203
|
+
node.children.forEach(child => extractLocalities(child, currentZone, currentWard, currentAssembly));
|
|
6207
6204
|
}
|
|
6208
6205
|
};
|
|
6209
6206
|
boundaries.forEach(rootNode => extractLocalities(rootNode));
|
|
@@ -6239,15 +6236,17 @@ const AddFixFillAddress = ({
|
|
|
6239
6236
|
}, [structuredLocality, city]);
|
|
6240
6237
|
const filteredLocalities = useMemo(() => {
|
|
6241
6238
|
if (!pincode) return structuredLocality;
|
|
6239
|
+
const isPincodeInList = fetchedPincodes.some(p => p.code === pincode);
|
|
6240
|
+
if (!isPincodeInList) return structuredLocality;
|
|
6242
6241
|
return structuredLocality.filter(loc => {
|
|
6243
6242
|
if (!loc.pincode) return false;
|
|
6244
6243
|
const pins = Array.isArray(loc.pincode) ? loc.pincode : [loc.pincode];
|
|
6245
6244
|
return pins.some(p => p.toString() === pincode);
|
|
6246
6245
|
});
|
|
6247
|
-
}, [structuredLocality, pincode]);
|
|
6246
|
+
}, [structuredLocality, pincode, fetchedPincodes]);
|
|
6248
6247
|
useEffect(() => {
|
|
6249
|
-
var _formData$
|
|
6250
|
-
const currentId = (formData === null || formData === void 0 ? void 0 : formData.id) || (formData === null || formData === void 0 ? void 0 : formData.bookingId) || (formData === null || formData === void 0 ? void 0 : (_formData$
|
|
6248
|
+
var _formData$address13;
|
|
6249
|
+
const currentId = (formData === null || formData === void 0 ? void 0 : formData.id) || (formData === null || formData === void 0 ? void 0 : formData.bookingId) || (formData === null || formData === void 0 ? void 0 : (_formData$address13 = formData.address) === null || _formData$address13 === void 0 ? void 0 : _formData$address13.id);
|
|
6251
6250
|
if (currentId && lastBookingId.current !== currentId) {
|
|
6252
6251
|
isInitialized.current = false;
|
|
6253
6252
|
lastBookingId.current = currentId;
|
|
@@ -6265,26 +6264,25 @@ const AddFixFillAddress = ({
|
|
|
6265
6264
|
setLandmark(addressData.landmark || "");
|
|
6266
6265
|
setAddressLine1(addressData.addressLine1 || "");
|
|
6267
6266
|
setAddressLine2(addressData.addressLine2 || "");
|
|
6268
|
-
setAddressType(allOptions.find(a => a.code === addressData.addressType) || addressData.addressType ||
|
|
6267
|
+
setAddressType(allOptions.find(a => a.code === addressData.addressType) || addressData.addressType || allOptions.find(a => a.code === "PERMANENT"));
|
|
6269
6268
|
setZone(addressData.zone || "");
|
|
6270
|
-
setBlock(addressData.block || "");
|
|
6269
|
+
setBlock(addressData.block || addressData.ward || "");
|
|
6270
|
+
setAssembly(addressData.assembly || addressData.constituency || "");
|
|
6271
6271
|
setLatitude(addressData.latitude || "");
|
|
6272
6272
|
setLongitude(addressData.longitude || "");
|
|
6273
|
-
if (
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
} else {
|
|
6281
|
-
setLocality(addressData.locality || null);
|
|
6273
|
+
if ((structuredLocality === null || structuredLocality === void 0 ? void 0 : structuredLocality.length) > 0 || !addressData.cityCode) {
|
|
6274
|
+
const localityObj = structuredLocality.find(l => l.code === addressData.localityCode || l.code === addressData.locality || l.i18nkey === addressData.locality);
|
|
6275
|
+
setLocality(localityObj || addressData.locality || null);
|
|
6276
|
+
if (localityObj) {
|
|
6277
|
+
if (!addressData.zone && localityObj.zone) setZone(localityObj.zone);
|
|
6278
|
+
if (!addressData.block && localityObj.ward) setBlock(localityObj.ward);
|
|
6279
|
+
if (!addressData.assembly && localityObj.assembly) setAssembly(localityObj.assembly);
|
|
6282
6280
|
}
|
|
6283
6281
|
isInitialized.current = true;
|
|
6284
6282
|
lastSyncedAddress.current = JSON.stringify(addressData);
|
|
6285
6283
|
}
|
|
6286
6284
|
}
|
|
6287
|
-
}, [formData === null || formData === void 0 ? void 0 : formData.address, city, allCities,
|
|
6285
|
+
}, [formData === null || formData === void 0 ? void 0 : formData.address, city, allCities, structuredLocality]);
|
|
6288
6286
|
useEffect(() => {
|
|
6289
6287
|
if (!navigator.geolocation) return;
|
|
6290
6288
|
navigator.geolocation.getCurrentPosition(pos => {
|
|
@@ -6304,11 +6302,44 @@ const AddFixFillAddress = ({
|
|
|
6304
6302
|
setAddressLine2(selectedAddress.address2);
|
|
6305
6303
|
setZone(selectedAddress.zone);
|
|
6306
6304
|
setBlock(selectedAddress.block);
|
|
6305
|
+
setAssembly(selectedAddress.assembly);
|
|
6307
6306
|
setLatitude(selectedAddress.latitude);
|
|
6308
6307
|
setLongitude(selectedAddress.longitude);
|
|
6309
6308
|
setAddressType(allOptions.find(a => a.code === selectedAddress.addressType));
|
|
6310
6309
|
}
|
|
6311
|
-
}, [selectedAddress]);
|
|
6310
|
+
}, [selectedAddress, structuredLocality]);
|
|
6311
|
+
const getLatLng = async () => {
|
|
6312
|
+
try {
|
|
6313
|
+
setLoading(true);
|
|
6314
|
+
setError(null);
|
|
6315
|
+
const parts = [houseNo, streetName, addressLine1, addressLine2, (locality === null || locality === void 0 ? void 0 : locality.name) || (typeof locality === "string" ? locality : ""), (city === null || city === void 0 ? void 0 : city.name) || (typeof city === "string" ? city : ""), pincode].filter(Boolean);
|
|
6316
|
+
const fullAddress = parts.join(", ");
|
|
6317
|
+
if (!fullAddress.trim()) {
|
|
6318
|
+
setError(t("WT_ENTER_ADDRESS_DETAILS_FIRST"));
|
|
6319
|
+
setLoading(false);
|
|
6320
|
+
return;
|
|
6321
|
+
}
|
|
6322
|
+
const data = await geocodeAddress(fullAddress);
|
|
6323
|
+
if (data && data.length > 0) {
|
|
6324
|
+
setLatitude(data[0].lat);
|
|
6325
|
+
setLongitude(data[0].lon);
|
|
6326
|
+
setGeocodedAddress(data[0].display_name);
|
|
6327
|
+
} else {
|
|
6328
|
+
setError(t("WT_LOCATION_NOT_FOUND"));
|
|
6329
|
+
}
|
|
6330
|
+
} catch (err) {
|
|
6331
|
+
setError(t("WT_GEOCODING_ERROR"));
|
|
6332
|
+
} finally {
|
|
6333
|
+
setLoading(false);
|
|
6334
|
+
}
|
|
6335
|
+
};
|
|
6336
|
+
useEffect(() => {
|
|
6337
|
+
if (!addressLine1 || addressLine1.trim().length < 5) return;
|
|
6338
|
+
const timer = setTimeout(() => {
|
|
6339
|
+
getLatLng();
|
|
6340
|
+
}, 1000);
|
|
6341
|
+
return () => clearTimeout(timer);
|
|
6342
|
+
}, [addressLine1]);
|
|
6312
6343
|
useEffect(() => {
|
|
6313
6344
|
if (!onSelect || !isInitialized.current) return;
|
|
6314
6345
|
const currentAddress = {
|
|
@@ -6323,6 +6354,7 @@ const AddFixFillAddress = ({
|
|
|
6323
6354
|
addressType: (addressType === null || addressType === void 0 ? void 0 : addressType.code) || addressType || null,
|
|
6324
6355
|
zone: zone || "",
|
|
6325
6356
|
block: block || "",
|
|
6357
|
+
assembly: assembly || "",
|
|
6326
6358
|
latitude: latitude || "",
|
|
6327
6359
|
longitude: longitude || ""
|
|
6328
6360
|
};
|
|
@@ -6331,7 +6363,7 @@ const AddFixFillAddress = ({
|
|
|
6331
6363
|
lastSyncedAddress.current = addressString;
|
|
6332
6364
|
onSelect((config === null || config === void 0 ? void 0 : config.key) || "address", currentAddress);
|
|
6333
6365
|
}
|
|
6334
|
-
}, [pincode, city, locality, houseNo, landmark, addressLine1, addressLine2, streetName, addressType, zone, block, latitude, longitude]);
|
|
6366
|
+
}, [pincode, city, locality, houseNo, landmark, addressLine1, addressLine2, streetName, addressType, zone, block, assembly, latitude, longitude]);
|
|
6335
6367
|
return /*#__PURE__*/React.createElement(CollapsibleCardPage$1, {
|
|
6336
6368
|
title: t("WT_ADDRESS_DETAILS"),
|
|
6337
6369
|
defaultOpen: true
|
|
@@ -6355,25 +6387,21 @@ const AddFixFillAddress = ({
|
|
|
6355
6387
|
style: {
|
|
6356
6388
|
width: "100%"
|
|
6357
6389
|
}
|
|
6358
|
-
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("CITY"),
|
|
6359
|
-
className: "astericColor"
|
|
6360
|
-
}, "*")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
6390
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("CITY")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
6361
6391
|
selected: city,
|
|
6362
6392
|
select: setCity,
|
|
6363
6393
|
option: allCities || [],
|
|
6364
6394
|
optionKey: "i18nKey",
|
|
6365
6395
|
t: t,
|
|
6366
6396
|
disable: true
|
|
6367
|
-
})), /*#__PURE__*/React.createElement("div",
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
select: val => {
|
|
6376
|
-
const newPin = val === null || val === void 0 ? void 0 : val.code;
|
|
6397
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
6398
|
+
style: {
|
|
6399
|
+
position: "relative"
|
|
6400
|
+
}
|
|
6401
|
+
}, /*#__PURE__*/React.createElement(CardLabel, null, t("PINCODE")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6402
|
+
value: pincode,
|
|
6403
|
+
onChange: e => {
|
|
6404
|
+
const newPin = e.target.value.replace(/\D/g, "").slice(0, 6);
|
|
6377
6405
|
if (newPin !== pincode) {
|
|
6378
6406
|
setLocality(null);
|
|
6379
6407
|
setZone("");
|
|
@@ -6384,16 +6412,40 @@ const AddFixFillAddress = ({
|
|
|
6384
6412
|
setAddressLine2("");
|
|
6385
6413
|
}
|
|
6386
6414
|
setPincode(newPin);
|
|
6415
|
+
setShowPincodeSuggestions(true);
|
|
6416
|
+
},
|
|
6417
|
+
onFocus: () => setShowPincodeSuggestions(true),
|
|
6418
|
+
onBlur: () => {
|
|
6419
|
+
setTimeout(() => setShowPincodeSuggestions(false), 200);
|
|
6387
6420
|
},
|
|
6388
|
-
option: fetchedPincodes || [],
|
|
6389
|
-
optionKey: "i18nKey",
|
|
6390
|
-
t: t,
|
|
6391
6421
|
style: {
|
|
6392
6422
|
width: "100%"
|
|
6423
|
+
},
|
|
6424
|
+
maxlength: 6
|
|
6425
|
+
}), showPincodeSuggestions && (fetchedPincodes === null || fetchedPincodes === void 0 ? void 0 : fetchedPincodes.length) > 0 && /*#__PURE__*/React.createElement("div", {
|
|
6426
|
+
className: "options-card",
|
|
6427
|
+
style: {
|
|
6428
|
+
position: "absolute",
|
|
6429
|
+
zIndex: 100,
|
|
6430
|
+
width: "100%",
|
|
6431
|
+
maxHeight: "200px",
|
|
6432
|
+
overflowY: "auto",
|
|
6433
|
+
backgroundColor: "white",
|
|
6434
|
+
boxShadow: "0 2px 5px rgba(0,0,0,0.1)"
|
|
6393
6435
|
}
|
|
6394
|
-
}
|
|
6395
|
-
|
|
6396
|
-
|
|
6436
|
+
}, fetchedPincodes.filter(p => !pincode || p.code.toLowerCase().includes(pincode.toLowerCase())).map((p, index) => /*#__PURE__*/React.createElement("div", {
|
|
6437
|
+
key: index,
|
|
6438
|
+
className: "cp profile-dropdown--item",
|
|
6439
|
+
style: {
|
|
6440
|
+
padding: "10px",
|
|
6441
|
+
borderBottom: "1px solid #eee",
|
|
6442
|
+
cursor: "pointer"
|
|
6443
|
+
},
|
|
6444
|
+
onClick: () => {
|
|
6445
|
+
setPincode(p.code);
|
|
6446
|
+
setShowPincodeSuggestions(false);
|
|
6447
|
+
}
|
|
6448
|
+
}, p.code)))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LOCALITY")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
6397
6449
|
selected: locality,
|
|
6398
6450
|
select: val => {
|
|
6399
6451
|
setLocality(val);
|
|
@@ -6403,89 +6455,70 @@ const AddFixFillAddress = ({
|
|
|
6403
6455
|
if (val !== null && val !== void 0 && val.name) setAddressLine2(val.name);
|
|
6404
6456
|
if (val !== null && val !== void 0 && val.zone) setZone(val.zone);
|
|
6405
6457
|
if (val !== null && val !== void 0 && val.ward) setBlock(val.ward);
|
|
6406
|
-
if (val !== null && val !== void 0 && val.
|
|
6407
|
-
const p = Array.isArray(val.pincode) ? val.pincode[0] : val.pincode;
|
|
6408
|
-
if (p) {
|
|
6409
|
-
const sanitizedPin = p.toString().split(".")[0];
|
|
6410
|
-
setPincode(sanitizedPin);
|
|
6411
|
-
}
|
|
6412
|
-
}
|
|
6458
|
+
if (val !== null && val !== void 0 && val.assembly) setAssembly(val.assembly);
|
|
6413
6459
|
},
|
|
6414
6460
|
option: filteredLocalities,
|
|
6415
6461
|
optionKey: "i18nkey",
|
|
6416
6462
|
t: t,
|
|
6417
6463
|
style: {
|
|
6418
6464
|
width: "100%"
|
|
6419
|
-
}
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
}, "*")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6465
|
+
},
|
|
6466
|
+
isSearchable: true
|
|
6467
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("HOUSE_NO")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6423
6468
|
value: houseNo,
|
|
6424
6469
|
onChange: e => setHouseNo(e.target.value),
|
|
6425
6470
|
style: {
|
|
6426
6471
|
width: "100%"
|
|
6427
6472
|
}
|
|
6428
|
-
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("STREET_NAME"),
|
|
6429
|
-
className: "astericColor"
|
|
6430
|
-
}, "*")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6473
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("STREET_NAME")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6431
6474
|
value: streetName,
|
|
6432
6475
|
onChange: e => setStreetName(e.target.value),
|
|
6433
6476
|
style: {
|
|
6434
6477
|
width: "100%"
|
|
6435
6478
|
}
|
|
6436
|
-
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ADDRESS_LINE1"),
|
|
6437
|
-
className: "astericColor"
|
|
6438
|
-
}, "*")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6479
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ADDRESS_LINE1")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6439
6480
|
value: addressLine1,
|
|
6440
6481
|
onChange: e => setAddressLine1(e.target.value),
|
|
6441
6482
|
style: {
|
|
6442
6483
|
width: "100%"
|
|
6443
6484
|
}
|
|
6444
|
-
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ADDRESS_LINE2"),
|
|
6445
|
-
className: "astericColor"
|
|
6446
|
-
}, "*")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6485
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ADDRESS_LINE2")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6447
6486
|
value: addressLine2,
|
|
6448
6487
|
onChange: e => setAddressLine2(e.target.value),
|
|
6449
6488
|
style: {
|
|
6450
6489
|
width: "100%"
|
|
6451
6490
|
}
|
|
6452
|
-
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("BLOCK"),
|
|
6453
|
-
className: "astericColor"
|
|
6454
|
-
}, "*")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6491
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("BLOCK")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6455
6492
|
value: block,
|
|
6456
6493
|
onChange: e => setBlock(e.target.value),
|
|
6457
6494
|
style: {
|
|
6458
6495
|
width: "100%"
|
|
6459
6496
|
}
|
|
6460
|
-
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ZONE"),
|
|
6461
|
-
className: "astericColor"
|
|
6462
|
-
}, "*")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6497
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ZONE")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6463
6498
|
value: zone,
|
|
6464
6499
|
onChange: e => setZone(e.target.value),
|
|
6465
6500
|
style: {
|
|
6466
6501
|
width: "100%"
|
|
6467
6502
|
}
|
|
6468
|
-
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LATITUDE"),
|
|
6469
|
-
className: "astericColor"
|
|
6470
|
-
}, "*")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6503
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LATITUDE")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6471
6504
|
value: latitude,
|
|
6472
6505
|
onChange: e => setLatitude(e.target.value),
|
|
6473
6506
|
style: {
|
|
6474
6507
|
width: "100%"
|
|
6475
6508
|
}
|
|
6476
|
-
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LONGITUDE"),
|
|
6477
|
-
className: "astericColor"
|
|
6478
|
-
}, "*")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6509
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LONGITUDE")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6479
6510
|
value: longitude,
|
|
6480
6511
|
onChange: e => setLongitude(e.target.value),
|
|
6481
6512
|
style: {
|
|
6482
6513
|
width: "100%"
|
|
6483
6514
|
}
|
|
6484
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
6515
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ASSEMBLY_CONSTITUENCY")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6516
|
+
value: assembly,
|
|
6517
|
+
onChange: e => setAssembly(e.target.value),
|
|
6485
6518
|
style: {
|
|
6486
|
-
|
|
6519
|
+
width: "100%"
|
|
6487
6520
|
}
|
|
6488
|
-
}, /*#__PURE__*/React.createElement(CardLabel, null, t("LANDMARK")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6521
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LANDMARK")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6489
6522
|
value: landmark,
|
|
6490
6523
|
onChange: e => setLandmark(e.target.value),
|
|
6491
6524
|
style: {
|
|
@@ -6495,12 +6528,13 @@ const AddFixFillAddress = ({
|
|
|
6495
6528
|
};
|
|
6496
6529
|
|
|
6497
6530
|
const AddFillingPointAddress = () => {
|
|
6498
|
-
var _formData$owner, _formData$owner2, _formData$owner3, _formData$owner4, _formData$owner5, _formData$owner6, _formData$owner7, _formData$owner8, _formData$owner9, _formData$address, _formData$address2, _formData$address3, _formData$address4, _formData$address5, _formData$address6, _formData$address7
|
|
6531
|
+
var _formData$owner, _formData$owner2, _formData$owner3, _formData$owner4, _formData$owner5, _formData$owner6, _formData$owner7, _formData$owner8, _formData$owner9, _formData$address, _formData$address2, _formData$address3, _formData$address4, _formData$address5, _formData$address6, _formData$address7;
|
|
6499
6532
|
const {
|
|
6500
6533
|
t
|
|
6501
6534
|
} = useTranslation();
|
|
6502
6535
|
const location = useLocation();
|
|
6503
6536
|
const history = useHistory();
|
|
6537
|
+
const queryClient = useQueryClient();
|
|
6504
6538
|
const queryParams = new URLSearchParams(location.search);
|
|
6505
6539
|
const editId = queryParams.get("id");
|
|
6506
6540
|
const [formData, setFormData] = useState({});
|
|
@@ -6580,6 +6614,7 @@ const AddFillingPointAddress = () => {
|
|
|
6580
6614
|
setShowToast({
|
|
6581
6615
|
label: editId ? t("WT_FILLING_POINT_UPDATED_SUCCESS") : t("WT_FILLING_POINT_CREATED_SUCCESS")
|
|
6582
6616
|
});
|
|
6617
|
+
queryClient.invalidateQueries("wtFillPointSearchList");
|
|
6583
6618
|
setTimeout(() => {
|
|
6584
6619
|
setShowToast(null);
|
|
6585
6620
|
history.push(`/digit-ui/employee/wt/search-filling-fix-point`);
|
|
@@ -6596,14 +6631,14 @@ const AddFillingPointAddress = () => {
|
|
|
6596
6631
|
});
|
|
6597
6632
|
};
|
|
6598
6633
|
const isMobile = window.Digit.Utils.browser.isMobile();
|
|
6599
|
-
const isFormDisabled = !(formData !== null && formData !== void 0 && (_formData$owner = formData.owner) !== null && _formData$owner !== void 0 && _formData$owner.aeName) || !(formData !== null && formData !== void 0 && (_formData$owner2 = formData.owner) !== null && _formData$owner2 !== void 0 && _formData$owner2.aeMobile) || !(formData !== null && formData !== void 0 && (_formData$owner3 = formData.owner) !== null && _formData$owner3 !== void 0 && _formData$owner3.aeEmail) || !(formData !== null && formData !== void 0 && (_formData$owner4 = formData.owner) !== null && _formData$owner4 !== void 0 && _formData$owner4.jeName) || !(formData !== null && formData !== void 0 && (_formData$owner5 = formData.owner) !== null && _formData$owner5 !== void 0 && _formData$owner5.jeMobile) || !(formData !== null && formData !== void 0 && (_formData$owner6 = formData.owner) !== null && _formData$owner6 !== void 0 && _formData$owner6.jeEmail) || !(formData !== null && formData !== void 0 && (_formData$owner7 = formData.owner) !== null && _formData$owner7 !== void 0 && _formData$owner7.eeName) || !(formData !== null && formData !== void 0 && (_formData$owner8 = formData.owner) !== null && _formData$owner8 !== void 0 && _formData$owner8.eeMobile) || !(formData !== null && formData !== void 0 && (_formData$owner9 = formData.owner) !== null && _formData$owner9 !== void 0 && _formData$owner9.eeEmail) || !(formData !== null && formData !== void 0 && (_formData$address = formData.address) !== null && _formData$address !== void 0 && _formData$address.
|
|
6634
|
+
const isFormDisabled = !(formData !== null && formData !== void 0 && (_formData$owner = formData.owner) !== null && _formData$owner !== void 0 && _formData$owner.aeName) || !(formData !== null && formData !== void 0 && (_formData$owner2 = formData.owner) !== null && _formData$owner2 !== void 0 && _formData$owner2.aeMobile) || !(formData !== null && formData !== void 0 && (_formData$owner3 = formData.owner) !== null && _formData$owner3 !== void 0 && _formData$owner3.aeEmail) || !(formData !== null && formData !== void 0 && (_formData$owner4 = formData.owner) !== null && _formData$owner4 !== void 0 && _formData$owner4.jeName) || !(formData !== null && formData !== void 0 && (_formData$owner5 = formData.owner) !== null && _formData$owner5 !== void 0 && _formData$owner5.jeMobile) || !(formData !== null && formData !== void 0 && (_formData$owner6 = formData.owner) !== null && _formData$owner6 !== void 0 && _formData$owner6.jeEmail) || !(formData !== null && formData !== void 0 && (_formData$owner7 = formData.owner) !== null && _formData$owner7 !== void 0 && _formData$owner7.eeName) || !(formData !== null && formData !== void 0 && (_formData$owner8 = formData.owner) !== null && _formData$owner8 !== void 0 && _formData$owner8.eeMobile) || !(formData !== null && formData !== void 0 && (_formData$owner9 = formData.owner) !== null && _formData$owner9 !== void 0 && _formData$owner9.eeEmail) || !(formData !== null && formData !== void 0 && (_formData$address = formData.address) !== null && _formData$address !== void 0 && _formData$address.addressLine1) || !(formData !== null && formData !== void 0 && (_formData$address2 = formData.address) !== null && _formData$address2 !== void 0 && _formData$address2.addressLine2) || !(formData !== null && formData !== void 0 && (_formData$address3 = formData.address) !== null && _formData$address3 !== void 0 && _formData$address3.city) || !(formData !== null && formData !== void 0 && (_formData$address4 = formData.address) !== null && _formData$address4 !== void 0 && _formData$address4.locality) || !(formData !== null && formData !== void 0 && (_formData$address5 = formData.address) !== null && _formData$address5 !== void 0 && _formData$address5.latitude) || !(formData !== null && formData !== void 0 && (_formData$address6 = formData.address) !== null && _formData$address6 !== void 0 && _formData$address6.longitude) || !(formData !== null && formData !== void 0 && (_formData$address7 = formData.address) !== null && _formData$address7 !== void 0 && _formData$address7.pincode);
|
|
6600
6635
|
if (isEditLoading) return /*#__PURE__*/React.createElement(Loader, null);
|
|
6601
6636
|
return /*#__PURE__*/React.createElement("div", {
|
|
6602
6637
|
className: "employee-form-section-wrapper"
|
|
6603
6638
|
}, /*#__PURE__*/React.createElement(VerticalTimeline, {
|
|
6604
6639
|
config: [{
|
|
6605
6640
|
timeLine: [{
|
|
6606
|
-
actions: "Add Filling Point",
|
|
6641
|
+
actions: editId ? "Update Filling Point" : "Add Filling Point",
|
|
6607
6642
|
currentStep: 1
|
|
6608
6643
|
}]
|
|
6609
6644
|
}],
|
|
@@ -6680,7 +6715,7 @@ const AddFixPointAddress = () => {
|
|
|
6680
6715
|
return ((_item$applicantDetail = item.applicantDetail) === null || _item$applicantDetail === void 0 ? void 0 : _item$applicantDetail.applicantId) === editId;
|
|
6681
6716
|
});
|
|
6682
6717
|
if (data) {
|
|
6683
|
-
var _data$applicantDetail, _data$applicantDetail2, _data$applicantDetail3, _data$applicantDetail4, _data$applicantDetail5, _data$address, _data$address2;
|
|
6718
|
+
var _data$applicantDetail, _data$applicantDetail2, _data$applicantDetail3, _data$applicantDetail4, _data$applicantDetail5, _data$address, _data$address2, _data$address3, _data$address4, _data$address5, _data$address6;
|
|
6684
6719
|
setFormData({
|
|
6685
6720
|
owner: {
|
|
6686
6721
|
name: (_data$applicantDetail = data.applicantDetail) === null || _data$applicantDetail === void 0 ? void 0 : _data$applicantDetail.name,
|
|
@@ -6692,7 +6727,9 @@ const AddFixPointAddress = () => {
|
|
|
6692
6727
|
address: {
|
|
6693
6728
|
...data.address,
|
|
6694
6729
|
addressId: (_data$address = data.address) === null || _data$address === void 0 ? void 0 : _data$address.addressId,
|
|
6695
|
-
applicantId: (_data$address2 = data.address) === null || _data$address2 === void 0 ? void 0 : _data$address2.applicantId
|
|
6730
|
+
applicantId: (_data$address2 = data.address) === null || _data$address2 === void 0 ? void 0 : _data$address2.applicantId,
|
|
6731
|
+
block: ((_data$address3 = data.address) === null || _data$address3 === void 0 ? void 0 : _data$address3.ward) || ((_data$address4 = data.address) === null || _data$address4 === void 0 ? void 0 : _data$address4.block),
|
|
6732
|
+
assembly: ((_data$address5 = data.address) === null || _data$address5 === void 0 ? void 0 : _data$address5.constituency) || ((_data$address6 = data.address) === null || _data$address6 === void 0 ? void 0 : _data$address6.assembly)
|
|
6696
6733
|
},
|
|
6697
6734
|
bookingId: data.bookingId,
|
|
6698
6735
|
bookingNo: data.bookingNo,
|
|
@@ -6755,7 +6792,7 @@ const AddFixPointAddress = () => {
|
|
|
6755
6792
|
}, /*#__PURE__*/React.createElement(VerticalTimeline, {
|
|
6756
6793
|
config: [{
|
|
6757
6794
|
timeLine: [{
|
|
6758
|
-
actions: "Add Fixed Point",
|
|
6795
|
+
actions: editId ? "Update Fixed Point" : "Add Fixed Point",
|
|
6759
6796
|
currentStep: 1
|
|
6760
6797
|
}]
|
|
6761
6798
|
}],
|
|
@@ -7064,6 +7101,7 @@ const SearchFillingPointAddress = () => {
|
|
|
7064
7101
|
const [fixedPointStatus, setFixedPointStatus] = useState(null);
|
|
7065
7102
|
const [appliedFixedPointStatus, setAppliedFixedPointStatus] = useState(null);
|
|
7066
7103
|
const [searchParams, setSearchParams] = useState({});
|
|
7104
|
+
const [selectedFillingPoint, setSelectedFillingPoint] = useState(null);
|
|
7067
7105
|
const [toast, setToast] = useState(null);
|
|
7068
7106
|
const [showLocalityModal, setShowLocalityModal] = useState(false);
|
|
7069
7107
|
const [selectedLocalityRow, setSelectedLocalityRow] = useState(null);
|
|
@@ -7168,6 +7206,7 @@ const SearchFillingPointAddress = () => {
|
|
|
7168
7206
|
setStatus(null);
|
|
7169
7207
|
setFixedPointStatus(null);
|
|
7170
7208
|
setAppliedFixedPointStatus(null);
|
|
7209
|
+
setSelectedFillingPoint(null);
|
|
7171
7210
|
setSearchParams({});
|
|
7172
7211
|
};
|
|
7173
7212
|
const onTabChange = tab => {
|
|
@@ -7195,7 +7234,8 @@ const SearchFillingPointAddress = () => {
|
|
|
7195
7234
|
name: searchValue
|
|
7196
7235
|
}),
|
|
7197
7236
|
mobileNumber: mobileNumber,
|
|
7198
|
-
status: selectedTab === "FILLING_POINT" ? status === null || status === void 0 ? void 0 : status.code : null
|
|
7237
|
+
status: selectedTab === "FILLING_POINT" ? status === null || status === void 0 ? void 0 : status.code : null,
|
|
7238
|
+
fillingPointId: (selectedFillingPoint === null || selectedFillingPoint === void 0 ? void 0 : selectedFillingPoint.id) || (selectedFillingPoint === null || selectedFillingPoint === void 0 ? void 0 : selectedFillingPoint.bookingId) || (selectedFillingPoint === null || selectedFillingPoint === void 0 ? void 0 : selectedFillingPoint.fillingPointId) || (selectedFillingPoint === null || selectedFillingPoint === void 0 ? void 0 : selectedFillingPoint.uuid)
|
|
7199
7239
|
};
|
|
7200
7240
|
setAppliedFixedPointStatus(fixedPointStatus);
|
|
7201
7241
|
setSearchParams(filters);
|
|
@@ -7513,8 +7553,15 @@ const SearchFillingPointAddress = () => {
|
|
|
7513
7553
|
}, {
|
|
7514
7554
|
Header: t("WT_FILLING_POINT"),
|
|
7515
7555
|
exportAccessor: row => {
|
|
7516
|
-
var _row$fillingpointmeta2, _row$fillingPoint, _row$fillingPointDeta, _row$fillingPointDeta2;
|
|
7517
|
-
|
|
7556
|
+
var _row$fillingpointmeta2, _row$fillingPoint, _row$fillingPointDeta, _row$fillingPointDeta2, _row$fillingPoint2, _row$fillingpointmeta3;
|
|
7557
|
+
const rowFpId = String((row === null || row === void 0 ? void 0 : row.fillingPointId) || (row === null || row === void 0 ? void 0 : (_row$fillingpointmeta2 = row.fillingpointmetadata) === null || _row$fillingpointmeta2 === void 0 ? void 0 : _row$fillingpointmeta2.fillingPointId) || (row === null || row === void 0 ? void 0 : row.fillingPtName) || (row === null || row === void 0 ? void 0 : row.filling_pt_name) || (row !== null && row !== void 0 && row.fillingPoint && typeof row.fillingPoint === "object" ? (_row$fillingPoint = row.fillingPoint) === null || _row$fillingPoint === void 0 ? void 0 : _row$fillingPoint.id : row === null || row === void 0 ? void 0 : row.fillingPoint) || (row === null || row === void 0 ? void 0 : (_row$fillingPointDeta = row.fillingPointDetail) === null || _row$fillingPointDeta === void 0 ? void 0 : _row$fillingPointDeta.id) || (row === null || row === void 0 ? void 0 : (_row$fillingPointDeta2 = row.fillingPointDetail) === null || _row$fillingPointDeta2 === void 0 ? void 0 : _row$fillingPointDeta2.bookingId) || "");
|
|
7558
|
+
const found = allFillingPoints === null || allFillingPoints === void 0 ? void 0 : allFillingPoints.find(fp => {
|
|
7559
|
+
var _fp$fillingpointmetad2;
|
|
7560
|
+
const fpId = String(fp.id || fp.bookingId || fp.fillingPointId || fp.uuid || ((_fp$fillingpointmetad2 = fp.fillingpointmetadata) === null || _fp$fillingpointmetad2 === void 0 ? void 0 : _fp$fillingpointmetad2.fillingPointId));
|
|
7561
|
+
return fpId === rowFpId && rowFpId !== "undefined" && rowFpId !== "null" && rowFpId !== "";
|
|
7562
|
+
});
|
|
7563
|
+
const name = (found === null || found === void 0 ? void 0 : found.fillingPointName) || (row === null || row === void 0 ? void 0 : row.fillingPointName) || (row === null || row === void 0 ? void 0 : (_row$fillingPoint2 = row.fillingPoint) === null || _row$fillingPoint2 === void 0 ? void 0 : _row$fillingPoint2.fillingPointName) || (row === null || row === void 0 ? void 0 : (_row$fillingpointmeta3 = row.fillingpointmetadata) === null || _row$fillingpointmeta3 === void 0 ? void 0 : _row$fillingpointmeta3.fillingPointName) || (row === null || row === void 0 ? void 0 : row.fillingPtName) || (row === null || row === void 0 ? void 0 : row.filling_pt_name);
|
|
7564
|
+
return name && name !== "undefined" && name !== "null" ? name : rowFpId && rowFpId !== "undefined" && rowFpId !== "null" ? rowFpId : "NA";
|
|
7518
7565
|
}
|
|
7519
7566
|
}];
|
|
7520
7567
|
}
|
|
@@ -7596,6 +7643,15 @@ const SearchFillingPointAddress = () => {
|
|
|
7596
7643
|
selected: fixedPointStatus,
|
|
7597
7644
|
select: setFixedPointStatus,
|
|
7598
7645
|
t: t
|
|
7646
|
+
})), selectedTab === "FIXED_POINT" && /*#__PURE__*/React.createElement("div", {
|
|
7647
|
+
className: "finance-mainlayout-col1"
|
|
7648
|
+
}, /*#__PURE__*/React.createElement(Label, null, t("WT_FILLING_POINT")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
7649
|
+
option: allFillingPoints,
|
|
7650
|
+
optionKey: "fillingPointName",
|
|
7651
|
+
selected: selectedFillingPoint,
|
|
7652
|
+
select: setSelectedFillingPoint,
|
|
7653
|
+
t: t,
|
|
7654
|
+
placeholder: t("ES_COMMON_STATUS")
|
|
7599
7655
|
})), selectedTab === "FILLING_POINT" && /*#__PURE__*/React.createElement("div", {
|
|
7600
7656
|
className: "finance-mainlayout-col1"
|
|
7601
7657
|
}, /*#__PURE__*/React.createElement(Label, null, t("WT_FILLING_POINT_DESIGNATION")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
@@ -7603,7 +7659,8 @@ const SearchFillingPointAddress = () => {
|
|
|
7603
7659
|
optionKey: "i18nKey",
|
|
7604
7660
|
selected: status,
|
|
7605
7661
|
select: setStatus,
|
|
7606
|
-
t: t
|
|
7662
|
+
t: t,
|
|
7663
|
+
placeholder: t("ES_COMMON_STATUS")
|
|
7607
7664
|
})), /*#__PURE__*/React.createElement("div", {
|
|
7608
7665
|
className: "finance-mainlayout-col1"
|
|
7609
7666
|
}, /*#__PURE__*/React.createElement(Label, null, "\xA0"), /*#__PURE__*/React.createElement("span", {
|