@djb25/digit-ui-module-wt 1.0.46 → 1.0.47

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.
@@ -5,7 +5,7 @@ import { useLocation, useRouteMatch, useHistory, Switch, Route, Redirect, Link,
5
5
  import { useQueryClient } from 'react-query';
6
6
  import { useForm, Controller } from 'react-hook-form';
7
7
  import { io } from 'socket.io-client';
8
- import { MapContainer, TileLayer, Marker, Popup, useMap, Polyline } from 'react-leaflet';
8
+ import { MapContainer, TileLayer, Marker, Popup, useMap, Polyline, Circle } from 'react-leaflet';
9
9
  import L from 'leaflet';
10
10
  import 'leaflet/dist/leaflet.css';
11
11
 
@@ -465,7 +465,7 @@ const WTCreate = () => {
465
465
  };
466
466
 
467
467
  const checkForNotNull = (value = "") => {
468
- return value && value != null && value != undefined && value != "" ? true : false;
468
+ return value && value != null && value !== undefined && value !== "" ? true : false;
469
469
  };
470
470
  const checkForNA = (value = "") => {
471
471
  return checkForNotNull(value) ? value : "NA";
@@ -816,6 +816,10 @@ const WTSearchApplication = ({
816
816
  moduleCode,
817
817
  isFixedPoint
818
818
  }) => {
819
+ console.log("WTSearchApplication Rendered", {
820
+ moduleCode,
821
+ isFixedPoint
822
+ });
819
823
  const isMobile = window.Digit.Utils.browser.isMobile();
820
824
  const user = Digit.UserService.getUser().info;
821
825
  const [showImageModal, setShowImageModal] = useState(false);
@@ -1092,7 +1096,13 @@ const WTSearchApplication = ({
1092
1096
  }),
1093
1097
  type: "number",
1094
1098
  maxlength: 10
1095
- }), /*#__PURE__*/React.createElement(CardLabelError, null, formState === null || formState === void 0 ? void 0 : (_formState$errors = formState.errors) === null || _formState$errors === void 0 ? void 0 : (_formState$errors$mob = _formState$errors["mobileNumber"]) === null || _formState$errors$mob === void 0 ? void 0 : _formState$errors$mob.message))), activeTab === t("WT_ADVANCED_SEARCH") && /*#__PURE__*/React.createElement("div", {
1099
+ }), /*#__PURE__*/React.createElement(CardLabelError, null, formState === null || formState === void 0 ? void 0 : (_formState$errors = formState.errors) === null || _formState$errors === void 0 ? void 0 : (_formState$errors$mob = _formState$errors["mobileNumber"]) === null || _formState$errors$mob === void 0 ? void 0 : _formState$errors$mob.message)), /*#__PURE__*/React.createElement("div", {
1100
+ className: "search-field-wrapper"
1101
+ }, /*#__PURE__*/React.createElement("label", null, t("WT_BOOKING_NO")), /*#__PURE__*/React.createElement(TextInput, {
1102
+ name: "bookingNo",
1103
+ inputRef: register({}),
1104
+ id: "wt-booking-no-input"
1105
+ }))), activeTab === t("WT_ADVANCED_SEARCH") && /*#__PURE__*/React.createElement("div", {
1096
1106
  className: "formcomposer-section-grid"
1097
1107
  }, /*#__PURE__*/React.createElement("div", {
1098
1108
  className: "search-field-wrapper"
@@ -1401,11 +1411,8 @@ const App = () => {
1401
1411
  t
1402
1412
  } = useTranslation();
1403
1413
  const location = useLocation();
1404
- const history = useHistory();
1405
1414
  const {
1406
- path,
1407
- url,
1408
- ...match
1415
+ path
1409
1416
  } = useRouteMatch();
1410
1417
  const WTCreate = (_Digit = Digit) === null || _Digit === void 0 ? void 0 : (_Digit$ComponentRegis = _Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("WTCreate");
1411
1418
  const WTApplicationDetails = (_Digit2 = Digit) === null || _Digit2 === void 0 ? void 0 : (_Digit2$ComponentRegi = _Digit2.ComponentRegistryService) === null || _Digit2$ComponentRegi === void 0 ? void 0 : _Digit2$ComponentRegi.getComponent("WTApplicationDetails");
@@ -1416,8 +1423,6 @@ const App = () => {
1416
1423
  const ApplicationDetails = (_Digit6 = Digit) === null || _Digit6 === void 0 ? void 0 : (_Digit6$ComponentRegi = _Digit6.ComponentRegistryService) === null || _Digit6$ComponentRegi === void 0 ? void 0 : _Digit6$ComponentRegi.getComponent("ApplicationDetails");
1417
1424
  const getDynamicBreadcrumbs = () => {
1418
1425
  const pathname = location.pathname;
1419
- if (pathname.includes("/mt/")) ;
1420
- if (pathname.includes("/tp/")) ;
1421
1426
  let crumbs = [{
1422
1427
  icon: HomeIcon,
1423
1428
  path: "/digit-ui/citizen"
@@ -1486,7 +1491,7 @@ const App = () => {
1486
1491
  onLeftClick: () => window.history.back(),
1487
1492
  breadcrumbs: getDynamicBreadcrumbs()
1488
1493
  }), /*#__PURE__*/React.createElement("div", {
1489
- className: "employee-form-content"
1494
+ className: "employee-form-content abcd"
1490
1495
  }, /*#__PURE__*/React.createElement(PrivateRoute, {
1491
1496
  path: `${path}/inbox`,
1492
1497
  component: () => /*#__PURE__*/React.createElement(Inbox, {
@@ -1535,7 +1540,7 @@ const App = () => {
1535
1540
  parentRoute: path
1536
1541
  })
1537
1542
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
1538
- path: `${path}/wt-Vendor`,
1543
+ path: `${path}/vendor`,
1539
1544
  component: () => Digit.UserService.hasAccess(["WT_VENDOR"]) ? /*#__PURE__*/React.createElement("div", {
1540
1545
  style: {
1541
1546
  display: "flex",
@@ -7286,6 +7291,477 @@ const LocalityModal = ({
7286
7291
  }, t("CS_COMMON_SAVE")))));
7287
7292
  };
7288
7293
 
7294
+ delete L.Icon.Default.prototype._getIconUrl;
7295
+ L.Icon.Default.mergeOptions({
7296
+ iconRetinaUrl: "https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",
7297
+ iconUrl: "https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",
7298
+ shadowUrl: "https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png"
7299
+ });
7300
+ const fillingPointIcon = new L.Icon({
7301
+ iconUrl: "https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-blue.png",
7302
+ shadowUrl: "https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",
7303
+ iconSize: [25, 41],
7304
+ iconAnchor: [12, 41],
7305
+ popupAnchor: [1, -34],
7306
+ shadowSize: [41, 41]
7307
+ });
7308
+ const fixedPointIcon = new L.Icon({
7309
+ iconUrl: "https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png",
7310
+ shadowUrl: "https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",
7311
+ iconSize: [25, 41],
7312
+ iconAnchor: [12.5, 41],
7313
+ popupAnchor: [1, -34],
7314
+ shadowSize: [41, 41]
7315
+ });
7316
+ const enlargedFixedPointIcon = new L.Icon({
7317
+ iconUrl: "https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png",
7318
+ shadowUrl: "https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",
7319
+ iconSize: [35, 57],
7320
+ iconAnchor: [17.5, 57],
7321
+ popupAnchor: [1, -45],
7322
+ shadowSize: [50, 50],
7323
+ className: "bouncing-marker"
7324
+ });
7325
+ const bounceStyles = `
7326
+ @keyframes marker-bounce {
7327
+ 0%, 100% { margin-top: 0px; }
7328
+ 50% { margin-top: -15px; }
7329
+ }
7330
+ .bouncing-marker {
7331
+ animation: marker-bounce 0.6s infinite ease-in-out !important;
7332
+ }
7333
+ `;
7334
+ const ChangeView = ({
7335
+ bounds,
7336
+ center,
7337
+ zoom
7338
+ }) => {
7339
+ const map = useMap();
7340
+ useEffect(() => {
7341
+ if (center) {
7342
+ map.setView(center, zoom || 15, {
7343
+ animate: true
7344
+ });
7345
+ } else if (bounds && bounds.length > 0) {
7346
+ map.fitBounds(bounds);
7347
+ }
7348
+ }, [bounds, center, zoom, map]);
7349
+ return null;
7350
+ };
7351
+ const PointAddressMap = ({
7352
+ fillingPoints: _fillingPoints = [],
7353
+ fixedPoints: _fixedPoints = [],
7354
+ isLoading,
7355
+ t
7356
+ }) => {
7357
+ var _selectedFillingPoint;
7358
+ const [selectedFillingPoint, setSelectedFillingPoint] = useState(null);
7359
+ const [selectedFixedPoint, setSelectedFixedPoint] = useState(null);
7360
+ const [hoveredFixedPointId, setHoveredFixedPointId] = useState(null);
7361
+ const [mapCenter, setMapCenter] = useState(null);
7362
+ const [mapZoom, setMapZoom] = useState(11);
7363
+ const defaultCenter = [28.6139, 77.209];
7364
+ const getFpId = fp => {
7365
+ var _fp$fillingpointmetad;
7366
+ return (fp === null || fp === void 0 ? void 0 : fp.id) || (fp === null || fp === void 0 ? void 0 : fp.bookingId) || (fp === null || fp === void 0 ? void 0 : fp.fillingPointId) || (fp === null || fp === void 0 ? void 0 : fp.uuid) || (fp === null || fp === void 0 ? void 0 : (_fp$fillingpointmetad = fp.fillingpointmetadata) === null || _fp$fillingpointmetad === void 0 ? void 0 : _fp$fillingpointmetad.fillingPointId);
7367
+ };
7368
+ const {
7369
+ isLoading: isRelatedLoading,
7370
+ data: relatedFixedPointsData
7371
+ } = Digit.Hooks.wt.useFixedPointSearchAPI({
7372
+ tenantId: Digit.ULBService.getCurrentTenantId(),
7373
+ filters: {
7374
+ fillingPointId: getFpId(selectedFillingPoint),
7375
+ limit: 1000
7376
+ }
7377
+ }, {
7378
+ enabled: !!selectedFillingPoint
7379
+ });
7380
+ const relatedFixedPoints = useMemo(() => {
7381
+ if (!selectedFillingPoint) return [];
7382
+ return (relatedFixedPointsData === null || relatedFixedPointsData === void 0 ? void 0 : relatedFixedPointsData.waterTankerBookingDetail) || [];
7383
+ }, [selectedFillingPoint, relatedFixedPointsData]);
7384
+ const displayFillingPoints = useMemo(() => {
7385
+ if (selectedFillingPoint) {
7386
+ return [selectedFillingPoint].filter(fp => {
7387
+ var _fp$address, _fp$address2;
7388
+ return ((_fp$address = fp.address) === null || _fp$address === void 0 ? void 0 : _fp$address.latitude) && ((_fp$address2 = fp.address) === null || _fp$address2 === void 0 ? void 0 : _fp$address2.longitude);
7389
+ });
7390
+ }
7391
+ return (_fillingPoints === null || _fillingPoints === void 0 ? void 0 : _fillingPoints.filter(fp => {
7392
+ var _fp$address3, _fp$address4;
7393
+ return ((_fp$address3 = fp.address) === null || _fp$address3 === void 0 ? void 0 : _fp$address3.latitude) && ((_fp$address4 = fp.address) === null || _fp$address4 === void 0 ? void 0 : _fp$address4.longitude);
7394
+ })) || [];
7395
+ }, [_fillingPoints, selectedFillingPoint]);
7396
+ const displayFixedPoints = useMemo(() => {
7397
+ if (selectedFixedPoint) {
7398
+ return [selectedFixedPoint].filter(fx => {
7399
+ var _fx$address, _fx$address2;
7400
+ return ((_fx$address = fx.address) === null || _fx$address === void 0 ? void 0 : _fx$address.latitude) && ((_fx$address2 = fx.address) === null || _fx$address2 === void 0 ? void 0 : _fx$address2.longitude);
7401
+ });
7402
+ }
7403
+ return relatedFixedPoints.filter(fx => {
7404
+ var _fx$address3, _fx$address4;
7405
+ return ((_fx$address3 = fx.address) === null || _fx$address3 === void 0 ? void 0 : _fx$address3.latitude) && ((_fx$address4 = fx.address) === null || _fx$address4 === void 0 ? void 0 : _fx$address4.longitude);
7406
+ });
7407
+ }, [relatedFixedPoints, selectedFixedPoint]);
7408
+ const bounds = useMemo(() => {
7409
+ const allPoints = [...displayFillingPoints.map(p => [parseFloat(p.address.latitude), parseFloat(p.address.longitude)]), ...displayFixedPoints.map(p => [parseFloat(p.address.latitude), parseFloat(p.address.longitude)])];
7410
+ if (allPoints.length === 0) return null;
7411
+ return allPoints;
7412
+ }, [displayFillingPoints, displayFixedPoints]);
7413
+ const handleFillingPointSelect = val => {
7414
+ setSelectedFillingPoint(val);
7415
+ setSelectedFixedPoint(null);
7416
+ setMapCenter(null);
7417
+ };
7418
+ const handleFixedPointSelect = val => {
7419
+ var _val$address, _val$address2;
7420
+ setSelectedFixedPoint(val);
7421
+ if (val !== null && val !== void 0 && (_val$address = val.address) !== null && _val$address !== void 0 && _val$address.latitude && val !== null && val !== void 0 && (_val$address2 = val.address) !== null && _val$address2 !== void 0 && _val$address2.longitude) {
7422
+ setMapCenter([parseFloat(val.address.latitude), parseFloat(val.address.longitude)]);
7423
+ setMapZoom(16);
7424
+ }
7425
+ };
7426
+ const fixedPointOptions = useMemo(() => {
7427
+ return relatedFixedPoints.map(fx => {
7428
+ var _fx$applicantDetail;
7429
+ return {
7430
+ ...fx,
7431
+ displayName: (fx === null || fx === void 0 ? void 0 : (_fx$applicantDetail = fx.applicantDetail) === null || _fx$applicantDetail === void 0 ? void 0 : _fx$applicantDetail.name) || (fx === null || fx === void 0 ? void 0 : fx.name) || "NA"
7432
+ };
7433
+ });
7434
+ }, [relatedFixedPoints]);
7435
+ const handleClear = () => {
7436
+ setSelectedFillingPoint(null);
7437
+ setSelectedFixedPoint(null);
7438
+ setMapCenter(null);
7439
+ setMapZoom(11);
7440
+ };
7441
+ if (isLoading || isRelatedLoading) return /*#__PURE__*/React.createElement(Loader, null);
7442
+ return /*#__PURE__*/React.createElement("div", {
7443
+ style: {
7444
+ display: "flex",
7445
+ flexDirection: window.innerWidth < 768 ? "column" : "row",
7446
+ height: "700px",
7447
+ width: "100%",
7448
+ borderRadius: "12px",
7449
+ overflow: "hidden",
7450
+ border: "1px solid #ddd",
7451
+ marginTop: "20px",
7452
+ boxShadow: "0 8px 24px rgba(0,0,0,0.12)",
7453
+ background: "#fff"
7454
+ }
7455
+ }, /*#__PURE__*/React.createElement("style", null, bounceStyles), /*#__PURE__*/React.createElement("div", {
7456
+ style: {
7457
+ width: window.innerWidth < 768 ? "100%" : "320px",
7458
+ padding: "24px",
7459
+ borderRight: "1px solid #eee",
7460
+ display: "flex",
7461
+ flexDirection: "column",
7462
+ gap: "20px",
7463
+ background: "#f9f9f9",
7464
+ zIndex: 10
7465
+ }
7466
+ }, /*#__PURE__*/React.createElement("h3", {
7467
+ style: {
7468
+ margin: "0 0 8px 0",
7469
+ color: "#1D4E7F",
7470
+ fontSize: "20px",
7471
+ fontWeight: "600"
7472
+ }
7473
+ }, t("WT_MAP_FILTERS")), /*#__PURE__*/React.createElement("div", {
7474
+ className: "filter-item"
7475
+ }, /*#__PURE__*/React.createElement("label", {
7476
+ style: {
7477
+ display: "block",
7478
+ marginBottom: "8px",
7479
+ fontSize: "14px",
7480
+ fontWeight: "500",
7481
+ color: "#666"
7482
+ }
7483
+ }, t("WT_FILLING_POINT")), /*#__PURE__*/React.createElement(Dropdown, {
7484
+ option: _fillingPoints,
7485
+ optionKey: "fillingPointName",
7486
+ selected: selectedFillingPoint,
7487
+ select: handleFillingPointSelect,
7488
+ t: t,
7489
+ placeholder: t("WT_SELECT_FILLING_POINT")
7490
+ })), selectedFillingPoint && /*#__PURE__*/React.createElement("div", {
7491
+ className: "filter-item",
7492
+ style: {
7493
+ flex: 1,
7494
+ display: "flex",
7495
+ flexDirection: "column"
7496
+ }
7497
+ }, /*#__PURE__*/React.createElement("label", {
7498
+ style: {
7499
+ display: "block",
7500
+ marginBottom: "12px",
7501
+ fontSize: "14px",
7502
+ fontWeight: "600",
7503
+ color: "#1D4E7F"
7504
+ }
7505
+ }, t("WT_MAPPED_FIXED_POINTS"), " (", relatedFixedPoints.length, ")"), /*#__PURE__*/React.createElement("div", {
7506
+ style: {
7507
+ maxHeight: "350px",
7508
+ overflowY: "auto",
7509
+ paddingRight: "8px",
7510
+ display: "flex",
7511
+ flexDirection: "column",
7512
+ gap: "8px"
7513
+ }
7514
+ }, relatedFixedPoints.length > 0 ? relatedFixedPoints.map((fx, idx) => {
7515
+ var _fx$applicantDetail2, _selectedFixedPoint$a, _fx$applicantDetail3, _fx$applicantDetail5, _fx$applicantDetail6, _fx$applicantDetail7, _fx$applicantDetail8;
7516
+ const isSelected = (selectedFixedPoint === null || selectedFixedPoint === void 0 ? void 0 : selectedFixedPoint.id) === fx.id || ((_fx$applicantDetail2 = fx.applicantDetail) === null || _fx$applicantDetail2 === void 0 ? void 0 : _fx$applicantDetail2.applicantId) && (selectedFixedPoint === null || selectedFixedPoint === void 0 ? void 0 : (_selectedFixedPoint$a = selectedFixedPoint.applicantDetail) === null || _selectedFixedPoint$a === void 0 ? void 0 : _selectedFixedPoint$a.applicantId) === ((_fx$applicantDetail3 = fx.applicantDetail) === null || _fx$applicantDetail3 === void 0 ? void 0 : _fx$applicantDetail3.applicantId);
7517
+ return /*#__PURE__*/React.createElement("div", {
7518
+ key: idx,
7519
+ onClick: () => handleFixedPointSelect(fx),
7520
+ onMouseEnter: () => {
7521
+ var _fx$applicantDetail4, _fx$address5, _fx$address6;
7522
+ setHoveredFixedPointId(fx.id || ((_fx$applicantDetail4 = fx.applicantDetail) === null || _fx$applicantDetail4 === void 0 ? void 0 : _fx$applicantDetail4.applicantId) || idx);
7523
+ if (fx !== null && fx !== void 0 && (_fx$address5 = fx.address) !== null && _fx$address5 !== void 0 && _fx$address5.latitude && fx !== null && fx !== void 0 && (_fx$address6 = fx.address) !== null && _fx$address6 !== void 0 && _fx$address6.longitude) {
7524
+ setMapCenter([parseFloat(fx.address.latitude), parseFloat(fx.address.longitude)]);
7525
+ setMapZoom(16);
7526
+ }
7527
+ },
7528
+ onMouseLeave: () => setHoveredFixedPointId(null),
7529
+ style: {
7530
+ padding: "12px",
7531
+ background: isSelected ? "#E6EEF5" : "#fff",
7532
+ border: isSelected ? "1.5px solid #1D4E7F" : "1px solid #e0e0e0",
7533
+ borderRadius: "8px",
7534
+ cursor: "pointer",
7535
+ transition: "all 0.2s ease",
7536
+ fontSize: "13px",
7537
+ color: isSelected ? "#1D4E7F" : "#333",
7538
+ fontWeight: isSelected ? "600" : "400",
7539
+ display: "flex",
7540
+ alignItems: "center",
7541
+ gap: "10px",
7542
+ boxShadow: isSelected ? "0 2px 8px rgba(29, 78, 127, 0.15)" : hoveredFixedPointId === (fx.id || ((_fx$applicantDetail5 = fx.applicantDetail) === null || _fx$applicantDetail5 === void 0 ? void 0 : _fx$applicantDetail5.applicantId) || idx) ? "0 4px 12px rgba(0,0,0,0.1)" : "none",
7543
+ transform: hoveredFixedPointId === (fx.id || ((_fx$applicantDetail6 = fx.applicantDetail) === null || _fx$applicantDetail6 === void 0 ? void 0 : _fx$applicantDetail6.applicantId) || idx) ? "translateX(4px)" : "none"
7544
+ }
7545
+ }, /*#__PURE__*/React.createElement("div", {
7546
+ style: {
7547
+ width: "10px",
7548
+ height: "10px",
7549
+ borderRadius: "50%",
7550
+ background: "#417505",
7551
+ boxShadow: "0 0 4px rgba(65, 117, 5, 0.4)"
7552
+ }
7553
+ }), /*#__PURE__*/React.createElement("div", {
7554
+ style: {
7555
+ display: "flex",
7556
+ flexDirection: "column"
7557
+ }
7558
+ }, /*#__PURE__*/React.createElement("span", null, (fx === null || fx === void 0 ? void 0 : (_fx$applicantDetail7 = fx.applicantDetail) === null || _fx$applicantDetail7 === void 0 ? void 0 : _fx$applicantDetail7.name) || (fx === null || fx === void 0 ? void 0 : fx.name) || "NA"), /*#__PURE__*/React.createElement("span", {
7559
+ style: {
7560
+ fontSize: "11px",
7561
+ color: "#888",
7562
+ fontWeight: "400"
7563
+ }
7564
+ }, fx === null || fx === void 0 ? void 0 : (_fx$applicantDetail8 = fx.applicantDetail) === null || _fx$applicantDetail8 === void 0 ? void 0 : _fx$applicantDetail8.fixedPointId)));
7565
+ }) : /*#__PURE__*/React.createElement("div", {
7566
+ style: {
7567
+ textAlign: "center",
7568
+ padding: "20px",
7569
+ color: "#999",
7570
+ fontSize: "13px",
7571
+ border: "1px dashed #ccc",
7572
+ borderRadius: "8px"
7573
+ }
7574
+ }, t("WT_NO_MAPPED_POINTS")))), /*#__PURE__*/React.createElement("button", {
7575
+ onClick: handleClear,
7576
+ style: {
7577
+ marginTop: "auto",
7578
+ padding: "12px",
7579
+ background: "#fff",
7580
+ border: "1px solid #1D4E7F",
7581
+ color: "#1D4E7F",
7582
+ borderRadius: "6px",
7583
+ cursor: "pointer",
7584
+ fontWeight: "600",
7585
+ transition: "all 0.2s"
7586
+ },
7587
+ onMouseOver: e => {
7588
+ e.target.style.background = "#1D4E7F";
7589
+ e.target.style.color = "#fff";
7590
+ },
7591
+ onMouseOut: e => {
7592
+ e.target.style.background = "#fff";
7593
+ e.target.style.color = "#1D4E7F";
7594
+ }
7595
+ }, t("ES_COMMON_CLEAR_ALL")), selectedFillingPoint && /*#__PURE__*/React.createElement("div", {
7596
+ style: {
7597
+ marginTop: "20px",
7598
+ padding: "16px",
7599
+ background: "#fff",
7600
+ borderRadius: "8px",
7601
+ border: "1px solid #e0e0e0"
7602
+ }
7603
+ }, /*#__PURE__*/React.createElement("h4", {
7604
+ style: {
7605
+ margin: "0 0 12px 0",
7606
+ fontSize: "14px",
7607
+ color: "#333",
7608
+ borderBottom: "1px solid #f0f0f0",
7609
+ paddingBottom: "8px"
7610
+ }
7611
+ }, t("WT_SUMMARY")), /*#__PURE__*/React.createElement("div", {
7612
+ style: {
7613
+ fontSize: "13px",
7614
+ display: "flex",
7615
+ flexDirection: "column",
7616
+ gap: "8px"
7617
+ }
7618
+ }, /*#__PURE__*/React.createElement("div", {
7619
+ style: {
7620
+ display: "flex",
7621
+ justifyContent: "space-between"
7622
+ }
7623
+ }, /*#__PURE__*/React.createElement("span", {
7624
+ style: {
7625
+ color: "#777"
7626
+ }
7627
+ }, t("WT_FIXED_POINTS"), ":"), /*#__PURE__*/React.createElement("span", {
7628
+ style: {
7629
+ fontWeight: "600"
7630
+ }
7631
+ }, relatedFixedPoints.length)), /*#__PURE__*/React.createElement("div", {
7632
+ style: {
7633
+ display: "flex",
7634
+ justifyContent: "space-between"
7635
+ }
7636
+ }, /*#__PURE__*/React.createElement("span", {
7637
+ style: {
7638
+ color: "#777"
7639
+ }
7640
+ }, t("WT_LOCALITY"), ":"), /*#__PURE__*/React.createElement("span", {
7641
+ style: {
7642
+ fontWeight: "600"
7643
+ }
7644
+ }, ((_selectedFillingPoint = selectedFillingPoint.address) === null || _selectedFillingPoint === void 0 ? void 0 : _selectedFillingPoint.locality) || "NA"))))), /*#__PURE__*/React.createElement("div", {
7645
+ style: {
7646
+ flex: 1,
7647
+ position: "relative"
7648
+ }
7649
+ }, /*#__PURE__*/React.createElement(MapContainer, {
7650
+ center: defaultCenter,
7651
+ zoom: 11,
7652
+ style: {
7653
+ height: "100%",
7654
+ width: "100%"
7655
+ },
7656
+ scrollWheelZoom: true
7657
+ }, /*#__PURE__*/React.createElement(TileLayer, {
7658
+ attribution: "\xA9 <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors",
7659
+ url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
7660
+ }), /*#__PURE__*/React.createElement(ChangeView, {
7661
+ bounds: bounds,
7662
+ center: mapCenter,
7663
+ zoom: mapZoom
7664
+ }), displayFillingPoints.map((fp, index) => {
7665
+ var _fp$address5;
7666
+ return /*#__PURE__*/React.createElement(React.Fragment, {
7667
+ key: `fp-group-${fp.id || index}`
7668
+ }, /*#__PURE__*/React.createElement(Circle, {
7669
+ center: [parseFloat(fp.address.latitude), parseFloat(fp.address.longitude)],
7670
+ radius: 5000,
7671
+ pathOptions: {
7672
+ color: "#0d2745ff",
7673
+ fillColor: "#041a34ff",
7674
+ fillOpacity: 0.1,
7675
+ weight: 1,
7676
+ dashArray: "5, 5"
7677
+ }
7678
+ }), /*#__PURE__*/React.createElement(Marker, {
7679
+ key: `fp-${fp.id || index}`,
7680
+ position: [parseFloat(fp.address.latitude), parseFloat(fp.address.longitude)],
7681
+ icon: fillingPointIcon
7682
+ }, /*#__PURE__*/React.createElement(Popup, null, /*#__PURE__*/React.createElement("div", {
7683
+ style: {
7684
+ padding: "8px",
7685
+ minWidth: "200px"
7686
+ }
7687
+ }, /*#__PURE__*/React.createElement("h4", {
7688
+ style: {
7689
+ margin: "0 0 8px 0",
7690
+ color: "#1F5FA8",
7691
+ fontSize: "16px",
7692
+ borderBottom: "1px solid #eee",
7693
+ paddingBottom: "4px"
7694
+ }
7695
+ }, fp.fillingPointName, " (Filling Point)"), /*#__PURE__*/React.createElement("div", {
7696
+ style: {
7697
+ display: "flex",
7698
+ flexDirection: "column",
7699
+ gap: "4px"
7700
+ }
7701
+ }, /*#__PURE__*/React.createElement("p", {
7702
+ style: {
7703
+ margin: 0,
7704
+ fontSize: "12px"
7705
+ }
7706
+ }, /*#__PURE__*/React.createElement("strong", null, t("WT_FILLING_POINT_CODE"), ":"), " ", fp.fillingPointId), /*#__PURE__*/React.createElement("p", {
7707
+ style: {
7708
+ margin: 0,
7709
+ fontSize: "12px"
7710
+ }
7711
+ }, /*#__PURE__*/React.createElement("strong", null, t("WT_LOCALITY"), ":"), " ", ((_fp$address5 = fp.address) === null || _fp$address5 === void 0 ? void 0 : _fp$address5.locality) || "NA"), /*#__PURE__*/React.createElement("p", {
7712
+ style: {
7713
+ margin: 0,
7714
+ fontSize: "12px",
7715
+ color: "#1F5FA8"
7716
+ }
7717
+ }, /*#__PURE__*/React.createElement("strong", null, "Coverage:"), " 5 KM Radius"))))));
7718
+ }), displayFixedPoints.map((fx, index) => {
7719
+ var _fx$applicantDetail9, _fx$applicantDetail0, _fx$applicantDetail1, _fx$applicantDetail10, _fx$address7;
7720
+ const fxId = fx.id || ((_fx$applicantDetail9 = fx.applicantDetail) === null || _fx$applicantDetail9 === void 0 ? void 0 : _fx$applicantDetail9.applicantId) || index;
7721
+ const isHovered = hoveredFixedPointId === fxId;
7722
+ return /*#__PURE__*/React.createElement(Marker, {
7723
+ key: `fx-${fxId}`,
7724
+ position: [parseFloat(fx.address.latitude), parseFloat(fx.address.longitude)],
7725
+ icon: isHovered ? enlargedFixedPointIcon : fixedPointIcon,
7726
+ zIndexOffset: isHovered ? 1000 : 0
7727
+ }, /*#__PURE__*/React.createElement(Popup, null, /*#__PURE__*/React.createElement("div", {
7728
+ style: {
7729
+ padding: "8px",
7730
+ minWidth: "200px"
7731
+ }
7732
+ }, /*#__PURE__*/React.createElement("h4", {
7733
+ style: {
7734
+ margin: "0 0 8px 0",
7735
+ color: "#417505",
7736
+ fontSize: "16px",
7737
+ borderBottom: "1px solid #eee",
7738
+ paddingBottom: "4px"
7739
+ }
7740
+ }, (fx === null || fx === void 0 ? void 0 : (_fx$applicantDetail0 = fx.applicantDetail) === null || _fx$applicantDetail0 === void 0 ? void 0 : _fx$applicantDetail0.name) || (fx === null || fx === void 0 ? void 0 : fx.name) || "NA", " (Fixed Point)"), /*#__PURE__*/React.createElement("div", {
7741
+ style: {
7742
+ display: "flex",
7743
+ flexDirection: "column",
7744
+ gap: "4px"
7745
+ }
7746
+ }, /*#__PURE__*/React.createElement("p", {
7747
+ style: {
7748
+ margin: 0,
7749
+ fontSize: "12px"
7750
+ }
7751
+ }, /*#__PURE__*/React.createElement("strong", null, t("WT_FIXED_POINT_CODE"), ":"), " ", (fx === null || fx === void 0 ? void 0 : (_fx$applicantDetail1 = fx.applicantDetail) === null || _fx$applicantDetail1 === void 0 ? void 0 : _fx$applicantDetail1.fixedPointId) || "NA"), /*#__PURE__*/React.createElement("p", {
7752
+ style: {
7753
+ margin: 0,
7754
+ fontSize: "12px"
7755
+ }
7756
+ }, /*#__PURE__*/React.createElement("strong", null, t("WT_MOBILE_NUMBER"), ":"), " ", (fx === null || fx === void 0 ? void 0 : (_fx$applicantDetail10 = fx.applicantDetail) === null || _fx$applicantDetail10 === void 0 ? void 0 : _fx$applicantDetail10.mobileNumber) || "NA"), /*#__PURE__*/React.createElement("p", {
7757
+ style: {
7758
+ margin: 0,
7759
+ fontSize: "12px"
7760
+ }
7761
+ }, /*#__PURE__*/React.createElement("strong", null, t("WT_LOCALITY"), ":"), " ", (fx === null || fx === void 0 ? void 0 : (_fx$address7 = fx.address) === null || _fx$address7 === void 0 ? void 0 : _fx$address7.locality) || "NA")))));
7762
+ }))));
7763
+ };
7764
+
7289
7765
  const SearchFillingPointAddress = () => {
7290
7766
  const {
7291
7767
  t
@@ -7350,6 +7826,18 @@ const SearchFillingPointAddress = () => {
7350
7826
  enabled: true
7351
7827
  });
7352
7828
  const allFillingPoints = (allFillingPointsData === null || allFillingPointsData === void 0 ? void 0 : allFillingPointsData.fillingPoints) || [];
7829
+ const {
7830
+ isLoading: isAllFixedPointsLoading,
7831
+ data: allFixedPointsData
7832
+ } = Digit.Hooks.wt.useFixedPointSearchAPI({
7833
+ tenantId,
7834
+ filters: {
7835
+ limit: 1000
7836
+ }
7837
+ }, {
7838
+ enabled: true
7839
+ });
7840
+ const allFixedPoints = (allFixedPointsData === null || allFixedPointsData === void 0 ? void 0 : allFixedPointsData.waterTankerBookingDetail) || [];
7353
7841
  const {
7354
7842
  mutate: mapFixedFilling
7355
7843
  } = Digit.Hooks.wt.useVendorFillingMapping(tenantId);
@@ -7375,6 +7863,10 @@ const SearchFillingPointAddress = () => {
7375
7863
  FILLING_POINT: {
7376
7864
  label: "WT_FILLING_POINT_NAME",
7377
7865
  placeholder: "WT_ENTER_FILLING_POINT_NAME"
7866
+ },
7867
+ VIEW_ON_MAP: {
7868
+ label: "WT_VIEW_ON_MAP",
7869
+ placeholder: ""
7378
7870
  }
7379
7871
  };
7380
7872
  const statusOptions = [{
@@ -7801,7 +8293,13 @@ const SearchFillingPointAddress = () => {
7801
8293
  style: {
7802
8294
  width: isMobile ? "50%" : "auto"
7803
8295
  }
7804
- }, t("WT_FILLING_POINT"))), /*#__PURE__*/React.createElement("div", {
8296
+ }, t("WT_FILLING_POINT")), /*#__PURE__*/React.createElement("button", {
8297
+ className: selectedTab === "VIEW_ON_MAP" ? "search-tab-head-selected" : "search-tab-head",
8298
+ onClick: () => onTabChange("VIEW_ON_MAP"),
8299
+ style: {
8300
+ width: isMobile ? "50%" : "auto"
8301
+ }
8302
+ }, t("WT_VIEW_ON_MAP"))), /*#__PURE__*/React.createElement("div", {
7805
8303
  className: "action-bar-wrap-registry",
7806
8304
  style: {
7807
8305
  alignSelf: isMobile ? "flex-end" : "auto"
@@ -7816,7 +8314,7 @@ const SearchFillingPointAddress = () => {
7816
8314
  options: ["FIXED_POINT", "FILLING_POINT"],
7817
8315
  t: t,
7818
8316
  onSelect: onActionSelect
7819
- }))), /*#__PURE__*/React.createElement("div", {
8317
+ }))), selectedTab !== "VIEW_ON_MAP" && /*#__PURE__*/React.createElement("div", {
7820
8318
  className: "finance-mainlayout"
7821
8319
  }, /*#__PURE__*/React.createElement("div", {
7822
8320
  className: "finance-mainlayout-col1"
@@ -7872,7 +8370,12 @@ const SearchFillingPointAddress = () => {
7872
8370
  }, /*#__PURE__*/React.createElement(Label, null, "\xA0"), /*#__PURE__*/React.createElement(SubmitBar, {
7873
8371
  label: t("ES_COMMON_SEARCH"),
7874
8372
  onSubmit: onSearch
7875
- })))), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(ApplicationTable, {
8373
+ })))), selectedTab === "VIEW_ON_MAP" ? /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(PointAddressMap, {
8374
+ fillingPoints: allFillingPoints,
8375
+ fixedPoints: allFixedPoints,
8376
+ isLoading: isAllFillingPointsLoading || isAllFixedPointsLoading,
8377
+ t: t
8378
+ })) : /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(ApplicationTable, {
7876
8379
  key: (allFillingPoints === null || allFillingPoints === void 0 ? void 0 : allFillingPoints.length) > 0 ? "loaded" : "loading",
7877
8380
  data: tableData,
7878
8381
  columns: columns,
@@ -24978,10 +25481,10 @@ const ApplicationDetails$1 = () => {
24978
25481
  applicationData: appDetailsToShow === null || appDetailsToShow === void 0 ? void 0 : (_appDetailsToShow$app = appDetailsToShow.applicationData) === null || _appDetailsToShow$app === void 0 ? void 0 : _appDetailsToShow$app.applicationData,
24979
25482
  closeModal: () => setShowEditModal(false)
24980
25483
  }), /*#__PURE__*/React.createElement("div", {
24981
- className: `workflow-timeline-wrapper ${hideTimeline ? "hide-workflow" : ""}`,
25484
+ className: `workflow-timeline-wrapper no-scrollbar ${hideTimeline ? "hide-workflow" : ""}`,
24982
25485
  style: {
24983
25486
  flex: "1 1 300px",
24984
- maxWidth: hideTimeline ? "0px" : "400px",
25487
+ maxWidth: hideTimeline ? "fit-content" : "400px",
24985
25488
  transition: "max-width 0.3s"
24986
25489
  }
24987
25490
  }, /*#__PURE__*/React.createElement(WorkflowTimeline, {
@@ -28114,16 +28617,6 @@ const WTModule = ({
28114
28617
  path,
28115
28618
  url
28116
28619
  } = useRouteMatch();
28117
- const moduleCode = "WT";
28118
- const language = Digit.StoreData.getCurrentLanguage();
28119
- const {
28120
- isLoading,
28121
- data: store
28122
- } = Digit.Services.useStore({
28123
- stateCode,
28124
- moduleCode,
28125
- language
28126
- });
28127
28620
  Digit.SessionStorage.set("WT_TENANTS", tenants);
28128
28621
  useEffect(() => userType === "employee" && Digit.LocalizationService.getLocale({
28129
28622
  modules: [`rainmaker-${Digit.ULBService.getCurrentTenantId()}`],
@@ -28145,7 +28638,7 @@ const WTLinks = ({
28145
28638
  const {
28146
28639
  t
28147
28640
  } = useTranslation();
28148
- const [params, setParams, clearParams] = Digit.Hooks.useSessionStorage("WT", {});
28641
+ const [,, clearParams] = Digit.Hooks.useSessionStorage("WT", {});
28149
28642
  useEffect(() => {
28150
28643
  clearParams();
28151
28644
  }, []);