@djb25/digit-ui-module-wt 1.0.38 → 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.
@@ -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(), /*#__PURE__*/React.createElement("div", {
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
- if (!vendorOptions || !vendorOptions.length) return [];
5243
- if (!selectedFillingPoint) return vendorOptions;
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$fillingPoint2, _vendor$drivers2;
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);
@@ -6154,6 +6141,9 @@ const AddFixFillAddress = ({
6154
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) || "");
6155
6142
  const [selectedAddress, setSelectedAddress] = useState("");
6156
6143
  const [showPincodeSuggestions, setShowPincodeSuggestions] = useState(false);
6144
+ const [loading, setLoading] = useState(false);
6145
+ const [error, setError] = useState(null);
6146
+ const [geocodedAddress, setGeocodedAddress] = useState(null);
6157
6147
  const isInitialized = useRef(!isEdit);
6158
6148
  const lastSyncedAddress = useRef(null);
6159
6149
  const lastBookingId = useRef(null);
@@ -6276,8 +6266,8 @@ const AddFixFillAddress = ({
6276
6266
  setAddressLine2(addressData.addressLine2 || "");
6277
6267
  setAddressType(allOptions.find(a => a.code === addressData.addressType) || addressData.addressType || allOptions.find(a => a.code === "PERMANENT"));
6278
6268
  setZone(addressData.zone || "");
6279
- setBlock(addressData.block || "");
6280
- setAssembly(addressData.assembly || "");
6269
+ setBlock(addressData.block || addressData.ward || "");
6270
+ setAssembly(addressData.assembly || addressData.constituency || "");
6281
6271
  setLatitude(addressData.latitude || "");
6282
6272
  setLongitude(addressData.longitude || "");
6283
6273
  if ((structuredLocality === null || structuredLocality === void 0 ? void 0 : structuredLocality.length) > 0 || !addressData.cityCode) {
@@ -6318,6 +6308,38 @@ const AddFixFillAddress = ({
6318
6308
  setAddressType(allOptions.find(a => a.code === selectedAddress.addressType));
6319
6309
  }
6320
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]);
6321
6343
  useEffect(() => {
6322
6344
  if (!onSelect || !isInitialized.current) return;
6323
6345
  const currentAddress = {
@@ -6365,9 +6387,7 @@ const AddFixFillAddress = ({
6365
6387
  style: {
6366
6388
  width: "100%"
6367
6389
  }
6368
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("CITY"), " ", /*#__PURE__*/React.createElement("span", {
6369
- className: "astericColor"
6370
- }, "*")), /*#__PURE__*/React.createElement(Dropdown, {
6390
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("CITY")), /*#__PURE__*/React.createElement(Dropdown, {
6371
6391
  selected: city,
6372
6392
  select: setCity,
6373
6393
  option: allCities || [],
@@ -6378,9 +6398,7 @@ const AddFixFillAddress = ({
6378
6398
  style: {
6379
6399
  position: "relative"
6380
6400
  }
6381
- }, /*#__PURE__*/React.createElement(CardLabel, null, t("PINCODE"), " ", /*#__PURE__*/React.createElement("span", {
6382
- className: "astericColor"
6383
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6401
+ }, /*#__PURE__*/React.createElement(CardLabel, null, t("PINCODE")), /*#__PURE__*/React.createElement(TextInput, {
6384
6402
  value: pincode,
6385
6403
  onChange: e => {
6386
6404
  const newPin = e.target.value.replace(/\D/g, "").slice(0, 6);
@@ -6427,9 +6445,7 @@ const AddFixFillAddress = ({
6427
6445
  setPincode(p.code);
6428
6446
  setShowPincodeSuggestions(false);
6429
6447
  }
6430
- }, p.code)))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LOCALITY"), " ", /*#__PURE__*/React.createElement("span", {
6431
- className: "astericColor"
6432
- }, "*")), /*#__PURE__*/React.createElement(Dropdown, {
6448
+ }, p.code)))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LOCALITY")), /*#__PURE__*/React.createElement(Dropdown, {
6433
6449
  selected: locality,
6434
6450
  select: val => {
6435
6451
  setLocality(val);
@@ -6446,84 +6462,63 @@ const AddFixFillAddress = ({
6446
6462
  t: t,
6447
6463
  style: {
6448
6464
  width: "100%"
6449
- }
6450
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("HOUSE_NO"), /*#__PURE__*/React.createElement("span", {
6451
- className: "astericColor"
6452
- }, "*")), /*#__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, {
6453
6468
  value: houseNo,
6454
6469
  onChange: e => setHouseNo(e.target.value),
6455
6470
  style: {
6456
6471
  width: "100%"
6457
6472
  }
6458
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("STREET_NAME"), " ", /*#__PURE__*/React.createElement("span", {
6459
- className: "astericColor"
6460
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6473
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("STREET_NAME")), /*#__PURE__*/React.createElement(TextInput, {
6461
6474
  value: streetName,
6462
6475
  onChange: e => setStreetName(e.target.value),
6463
6476
  style: {
6464
6477
  width: "100%"
6465
6478
  }
6466
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ADDRESS_LINE1"), " ", /*#__PURE__*/React.createElement("span", {
6467
- className: "astericColor"
6468
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6479
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ADDRESS_LINE1")), /*#__PURE__*/React.createElement(TextInput, {
6469
6480
  value: addressLine1,
6470
6481
  onChange: e => setAddressLine1(e.target.value),
6471
6482
  style: {
6472
6483
  width: "100%"
6473
6484
  }
6474
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ADDRESS_LINE2"), " ", /*#__PURE__*/React.createElement("span", {
6475
- className: "astericColor"
6476
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6485
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ADDRESS_LINE2")), /*#__PURE__*/React.createElement(TextInput, {
6477
6486
  value: addressLine2,
6478
6487
  onChange: e => setAddressLine2(e.target.value),
6479
6488
  style: {
6480
6489
  width: "100%"
6481
6490
  }
6482
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("BLOCK"), " ", /*#__PURE__*/React.createElement("span", {
6483
- className: "astericColor"
6484
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6491
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("BLOCK")), /*#__PURE__*/React.createElement(TextInput, {
6485
6492
  value: block,
6486
6493
  onChange: e => setBlock(e.target.value),
6487
6494
  style: {
6488
6495
  width: "100%"
6489
6496
  }
6490
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ZONE"), " ", /*#__PURE__*/React.createElement("span", {
6491
- className: "astericColor"
6492
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6497
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ZONE")), /*#__PURE__*/React.createElement(TextInput, {
6493
6498
  value: zone,
6494
6499
  onChange: e => setZone(e.target.value),
6495
6500
  style: {
6496
6501
  width: "100%"
6497
6502
  }
6498
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ASSEMBLY_CONSTITUENCY"), " ", /*#__PURE__*/React.createElement("span", {
6499
- className: "astericColor"
6500
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6501
- value: assembly,
6502
- onChange: e => setAssembly(e.target.value),
6503
- style: {
6504
- width: "100%"
6505
- }
6506
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LATITUDE"), " ", /*#__PURE__*/React.createElement("span", {
6507
- className: "astericColor"
6508
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6503
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LATITUDE")), /*#__PURE__*/React.createElement(TextInput, {
6509
6504
  value: latitude,
6510
6505
  onChange: e => setLatitude(e.target.value),
6511
6506
  style: {
6512
6507
  width: "100%"
6513
6508
  }
6514
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LONGITUDE"), " ", /*#__PURE__*/React.createElement("span", {
6515
- className: "astericColor"
6516
- }, "*")), /*#__PURE__*/React.createElement(TextInput, {
6509
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LONGITUDE")), /*#__PURE__*/React.createElement(TextInput, {
6517
6510
  value: longitude,
6518
6511
  onChange: e => setLongitude(e.target.value),
6519
6512
  style: {
6520
6513
  width: "100%"
6521
6514
  }
6522
- })), /*#__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),
6523
6518
  style: {
6524
- gridColumn: "span 2"
6519
+ width: "100%"
6525
6520
  }
6526
- }, /*#__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, {
6527
6522
  value: landmark,
6528
6523
  onChange: e => setLandmark(e.target.value),
6529
6524
  style: {
@@ -6533,7 +6528,7 @@ const AddFixFillAddress = ({
6533
6528
  };
6534
6529
 
6535
6530
  const AddFillingPointAddress = () => {
6536
- 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, _formData$address8, _formData$address9;
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;
6537
6532
  const {
6538
6533
  t
6539
6534
  } = useTranslation();
@@ -6636,14 +6631,14 @@ const AddFillingPointAddress = () => {
6636
6631
  });
6637
6632
  };
6638
6633
  const isMobile = window.Digit.Utils.browser.isMobile();
6639
- 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.houseNo) || !(formData !== null && formData !== void 0 && (_formData$address2 = formData.address) !== null && _formData$address2 !== void 0 && _formData$address2.streetName) || !(formData !== null && formData !== void 0 && (_formData$address3 = formData.address) !== null && _formData$address3 !== void 0 && _formData$address3.addressLine1) || !(formData !== null && formData !== void 0 && (_formData$address4 = formData.address) !== null && _formData$address4 !== void 0 && _formData$address4.addressLine2) || !(formData !== null && formData !== void 0 && (_formData$address5 = formData.address) !== null && _formData$address5 !== void 0 && _formData$address5.city) || !(formData !== null && formData !== void 0 && (_formData$address6 = formData.address) !== null && _formData$address6 !== void 0 && _formData$address6.locality) || !(formData !== null && formData !== void 0 && (_formData$address7 = formData.address) !== null && _formData$address7 !== void 0 && _formData$address7.latitude) || !(formData !== null && formData !== void 0 && (_formData$address8 = formData.address) !== null && _formData$address8 !== void 0 && _formData$address8.longitude) || !(formData !== null && formData !== void 0 && (_formData$address9 = formData.address) !== null && _formData$address9 !== void 0 && _formData$address9.pincode);
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);
6640
6635
  if (isEditLoading) return /*#__PURE__*/React.createElement(Loader, null);
6641
6636
  return /*#__PURE__*/React.createElement("div", {
6642
6637
  className: "employee-form-section-wrapper"
6643
6638
  }, /*#__PURE__*/React.createElement(VerticalTimeline, {
6644
6639
  config: [{
6645
6640
  timeLine: [{
6646
- actions: "Add Filling Point",
6641
+ actions: editId ? "Update Filling Point" : "Add Filling Point",
6647
6642
  currentStep: 1
6648
6643
  }]
6649
6644
  }],
@@ -6720,7 +6715,7 @@ const AddFixPointAddress = () => {
6720
6715
  return ((_item$applicantDetail = item.applicantDetail) === null || _item$applicantDetail === void 0 ? void 0 : _item$applicantDetail.applicantId) === editId;
6721
6716
  });
6722
6717
  if (data) {
6723
- 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;
6724
6719
  setFormData({
6725
6720
  owner: {
6726
6721
  name: (_data$applicantDetail = data.applicantDetail) === null || _data$applicantDetail === void 0 ? void 0 : _data$applicantDetail.name,
@@ -6732,7 +6727,9 @@ const AddFixPointAddress = () => {
6732
6727
  address: {
6733
6728
  ...data.address,
6734
6729
  addressId: (_data$address = data.address) === null || _data$address === void 0 ? void 0 : _data$address.addressId,
6735
- 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)
6736
6733
  },
6737
6734
  bookingId: data.bookingId,
6738
6735
  bookingNo: data.bookingNo,
@@ -6795,7 +6792,7 @@ const AddFixPointAddress = () => {
6795
6792
  }, /*#__PURE__*/React.createElement(VerticalTimeline, {
6796
6793
  config: [{
6797
6794
  timeLine: [{
6798
- actions: "Add Fixed Point",
6795
+ actions: editId ? "Update Fixed Point" : "Add Fixed Point",
6799
6796
  currentStep: 1
6800
6797
  }]
6801
6798
  }],
@@ -7104,6 +7101,7 @@ const SearchFillingPointAddress = () => {
7104
7101
  const [fixedPointStatus, setFixedPointStatus] = useState(null);
7105
7102
  const [appliedFixedPointStatus, setAppliedFixedPointStatus] = useState(null);
7106
7103
  const [searchParams, setSearchParams] = useState({});
7104
+ const [selectedFillingPoint, setSelectedFillingPoint] = useState(null);
7107
7105
  const [toast, setToast] = useState(null);
7108
7106
  const [showLocalityModal, setShowLocalityModal] = useState(false);
7109
7107
  const [selectedLocalityRow, setSelectedLocalityRow] = useState(null);
@@ -7208,6 +7206,7 @@ const SearchFillingPointAddress = () => {
7208
7206
  setStatus(null);
7209
7207
  setFixedPointStatus(null);
7210
7208
  setAppliedFixedPointStatus(null);
7209
+ setSelectedFillingPoint(null);
7211
7210
  setSearchParams({});
7212
7211
  };
7213
7212
  const onTabChange = tab => {
@@ -7235,7 +7234,8 @@ const SearchFillingPointAddress = () => {
7235
7234
  name: searchValue
7236
7235
  }),
7237
7236
  mobileNumber: mobileNumber,
7238
- 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)
7239
7239
  };
7240
7240
  setAppliedFixedPointStatus(fixedPointStatus);
7241
7241
  setSearchParams(filters);
@@ -7553,8 +7553,15 @@ const SearchFillingPointAddress = () => {
7553
7553
  }, {
7554
7554
  Header: t("WT_FILLING_POINT"),
7555
7555
  exportAccessor: row => {
7556
- var _row$fillingpointmeta2, _row$fillingPoint, _row$fillingPointDeta, _row$fillingPointDeta2;
7557
- return (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) || "NA";
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";
7558
7565
  }
7559
7566
  }];
7560
7567
  }
@@ -7636,6 +7643,15 @@ const SearchFillingPointAddress = () => {
7636
7643
  selected: fixedPointStatus,
7637
7644
  select: setFixedPointStatus,
7638
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")
7639
7655
  })), selectedTab === "FILLING_POINT" && /*#__PURE__*/React.createElement("div", {
7640
7656
  className: "finance-mainlayout-col1"
7641
7657
  }, /*#__PURE__*/React.createElement(Label, null, t("WT_FILLING_POINT_DESIGNATION")), /*#__PURE__*/React.createElement(Dropdown, {
@@ -7643,7 +7659,8 @@ const SearchFillingPointAddress = () => {
7643
7659
  optionKey: "i18nKey",
7644
7660
  selected: status,
7645
7661
  select: setStatus,
7646
- t: t
7662
+ t: t,
7663
+ placeholder: t("ES_COMMON_STATUS")
7647
7664
  })), /*#__PURE__*/React.createElement("div", {
7648
7665
  className: "finance-mainlayout-col1"
7649
7666
  }, /*#__PURE__*/React.createElement(Label, null, "\xA0"), /*#__PURE__*/React.createElement("span", {