@djb25/digit-ui-module-wt 1.0.23 → 1.0.25
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 +527 -415
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -944,13 +944,11 @@ const WTSearchApplication = ({
|
|
|
944
944
|
marginTop: "16px"
|
|
945
945
|
}
|
|
946
946
|
}, /*#__PURE__*/React.createElement("span", {
|
|
947
|
-
className: "clear-search
|
|
947
|
+
className: "generic-button clear-search",
|
|
948
948
|
onClick: handleClearSearch,
|
|
949
949
|
style: {
|
|
950
|
-
color: "#f47738",
|
|
951
950
|
cursor: "pointer",
|
|
952
|
-
alignSelf: "center"
|
|
953
|
-
textDecoration: "underline"
|
|
951
|
+
alignSelf: "center"
|
|
954
952
|
}
|
|
955
953
|
}, t("ES_COMMON_CLEAR_ALL")), /*#__PURE__*/React.createElement("div", {
|
|
956
954
|
style: {
|
|
@@ -2301,14 +2299,12 @@ const WTCard = () => {
|
|
|
2301
2299
|
const {
|
|
2302
2300
|
t
|
|
2303
2301
|
} = useTranslation();
|
|
2304
|
-
const
|
|
2302
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
2305
2303
|
const {
|
|
2306
|
-
data,
|
|
2307
|
-
isLoading
|
|
2308
|
-
isFetching,
|
|
2309
|
-
isSuccess
|
|
2304
|
+
data: citizenInboxData,
|
|
2305
|
+
isLoading: isCitizenInboxLoading
|
|
2310
2306
|
} = Digit.Hooks.useNewInboxGeneral({
|
|
2311
|
-
tenantId
|
|
2307
|
+
tenantId,
|
|
2312
2308
|
ModuleCode: "WT",
|
|
2313
2309
|
filters: {
|
|
2314
2310
|
limit: 10,
|
|
@@ -2325,13 +2321,39 @@ const WTCard = () => {
|
|
|
2325
2321
|
enabled: Digit.Utils.wtAccess()
|
|
2326
2322
|
}
|
|
2327
2323
|
});
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2324
|
+
const {
|
|
2325
|
+
data: fixedPointInboxData,
|
|
2326
|
+
isLoading: isFixedPointInboxLoading
|
|
2327
|
+
} = Digit.Hooks.useNewInboxGeneral({
|
|
2328
|
+
tenantId,
|
|
2329
|
+
ModuleCode: "WT",
|
|
2330
|
+
filters: {
|
|
2331
|
+
limit: 10,
|
|
2332
|
+
offset: 0,
|
|
2333
|
+
services: ["watertanker-fixedpoint"]
|
|
2334
|
+
},
|
|
2335
|
+
config: {
|
|
2336
|
+
select: data => {
|
|
2337
|
+
return {
|
|
2338
|
+
totalCount: data === null || data === void 0 ? void 0 : data.totalCount,
|
|
2339
|
+
nearingSlaCount: data === null || data === void 0 ? void 0 : data.nearingSlaCount
|
|
2340
|
+
} || "-";
|
|
2341
|
+
},
|
|
2342
|
+
enabled: Digit.Utils.wtAccess()
|
|
2343
|
+
}
|
|
2344
|
+
});
|
|
2345
|
+
const citizenInboxCount = isCitizenInboxLoading ? "-" : (citizenInboxData === null || citizenInboxData === void 0 ? void 0 : citizenInboxData.totalCount) ?? 0;
|
|
2346
|
+
const fixedPointInboxCount = isFixedPointInboxLoading ? "-" : (fixedPointInboxData === null || fixedPointInboxData === void 0 ? void 0 : fixedPointInboxData.totalCount) ?? 0;
|
|
2331
2347
|
const links = [{
|
|
2332
|
-
count:
|
|
2348
|
+
count: citizenInboxCount,
|
|
2333
2349
|
label: t("ES_COMMON_INBOX"),
|
|
2350
|
+
subLabel: "citizen",
|
|
2334
2351
|
link: `${APPLICATION_PATH}/employee/wt/inbox`
|
|
2352
|
+
}, {
|
|
2353
|
+
count: fixedPointInboxCount,
|
|
2354
|
+
label: t("ES_COMMON_INBOX"),
|
|
2355
|
+
subLabel: "Fixed Point",
|
|
2356
|
+
link: `${APPLICATION_PATH}/employee/wt/fixed-point/inbox`
|
|
2335
2357
|
}, {
|
|
2336
2358
|
label: t("ES_COMMON_APPLICATION_SEARCH"),
|
|
2337
2359
|
link: `${APPLICATION_PATH}/employee/wt/my-bookings`
|
|
@@ -2356,7 +2378,7 @@ const WTCard = () => {
|
|
|
2356
2378
|
Icon: /*#__PURE__*/React.createElement(CHBIcon, null),
|
|
2357
2379
|
moduleName: t("WT_MODULE_NAME"),
|
|
2358
2380
|
kpis: [{
|
|
2359
|
-
count:
|
|
2381
|
+
count: citizenInboxCount,
|
|
2360
2382
|
label: t("ES_TITLE_INBOX"),
|
|
2361
2383
|
link: `${APPLICATION_PATH}/employee/wt/inbox`
|
|
2362
2384
|
}],
|
|
@@ -3066,6 +3088,7 @@ const Inbox = ({
|
|
|
3066
3088
|
useNewInboxAPI,
|
|
3067
3089
|
parentRoute,
|
|
3068
3090
|
moduleCode,
|
|
3091
|
+
detailRoute,
|
|
3069
3092
|
initialStates: _initialStates = {},
|
|
3070
3093
|
filterComponent,
|
|
3071
3094
|
isInbox,
|
|
@@ -3292,6 +3315,7 @@ const Inbox = ({
|
|
|
3292
3315
|
}
|
|
3293
3316
|
}, /*#__PURE__*/React.createElement(WTDesktopInbox, {
|
|
3294
3317
|
moduleCode: moduleCode,
|
|
3318
|
+
detailRoute: detailRoute,
|
|
3295
3319
|
data: data,
|
|
3296
3320
|
tableConfig: TableConfig(t)[moduleCode],
|
|
3297
3321
|
isLoading: hookLoading,
|
|
@@ -3904,11 +3928,11 @@ const FixedPointScheduleManagement = ({
|
|
|
3904
3928
|
}
|
|
3905
3929
|
}, [pageOffset, pageSize]);
|
|
3906
3930
|
const columns = React.useMemo(() => [{
|
|
3907
|
-
Header: t("WT_FIXED_POINT_NAME"),
|
|
3908
|
-
accessor: "fixedPointName"
|
|
3909
|
-
}, {
|
|
3910
3931
|
Header: t("WT_FIXED_POINT_CODE"),
|
|
3911
3932
|
accessor: "fixedPoint"
|
|
3933
|
+
}, {
|
|
3934
|
+
Header: t("WT_FIXED_POINT_NAME"),
|
|
3935
|
+
accessor: "fixedPointName"
|
|
3912
3936
|
}, {
|
|
3913
3937
|
Header: t("WT_DAY"),
|
|
3914
3938
|
accessor: "day"
|
|
@@ -4159,22 +4183,16 @@ const FixedPointScheduleManagement = ({
|
|
|
4159
4183
|
},
|
|
4160
4184
|
placeholder: "All Status"
|
|
4161
4185
|
})), /*#__PURE__*/React.createElement("div", {
|
|
4162
|
-
className: "finance-mainlayout-col1"
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
}
|
|
4166
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
4167
|
-
className: "clear-search",
|
|
4186
|
+
className: "finance-mainlayout-col1"
|
|
4187
|
+
}, /*#__PURE__*/React.createElement(Label, null, "\xA0"), /*#__PURE__*/React.createElement("span", {
|
|
4188
|
+
className: "generic-button clear-search",
|
|
4168
4189
|
onClick: clearSearch,
|
|
4169
4190
|
style: {
|
|
4170
4191
|
alignSelf: "center"
|
|
4171
4192
|
}
|
|
4172
4193
|
}, t("ES_COMMON_CLEAR_SEARCH"))), /*#__PURE__*/React.createElement("div", {
|
|
4173
|
-
className: "finance-mainlayout-col1"
|
|
4174
|
-
|
|
4175
|
-
alignSelf: "flex-end"
|
|
4176
|
-
}
|
|
4177
|
-
}, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
4194
|
+
className: "finance-mainlayout-col1"
|
|
4195
|
+
}, /*#__PURE__*/React.createElement(Label, null, "\xA0"), /*#__PURE__*/React.createElement(SubmitBar, {
|
|
4178
4196
|
label: t("ES_COMMON_SEARCH"),
|
|
4179
4197
|
onSubmit: () => handleSearch()
|
|
4180
4198
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
@@ -4452,7 +4470,7 @@ const destinationIcon = new L.Icon({
|
|
|
4452
4470
|
const Address = ({
|
|
4453
4471
|
lat,
|
|
4454
4472
|
lng,
|
|
4455
|
-
fallback: _fallback = "Resolving area
|
|
4473
|
+
fallback: _fallback = "Resolving area"
|
|
4456
4474
|
}) => {
|
|
4457
4475
|
const [address, setAddress] = useState(_fallback);
|
|
4458
4476
|
useEffect(() => {
|
|
@@ -4470,17 +4488,32 @@ const Address = ({
|
|
|
4470
4488
|
};
|
|
4471
4489
|
const SOCKET_URL = "https://dev-djb.nitcon.in";
|
|
4472
4490
|
const MapController = ({
|
|
4473
|
-
selectedDriver
|
|
4491
|
+
selectedDriver,
|
|
4492
|
+
mapZoom,
|
|
4493
|
+
mapCenter
|
|
4474
4494
|
}) => {
|
|
4475
4495
|
const map = useMap();
|
|
4476
4496
|
useEffect(() => {
|
|
4477
4497
|
if (selectedDriver !== null && selectedDriver !== void 0 && selectedDriver.lat && selectedDriver !== null && selectedDriver !== void 0 && selectedDriver.lng) {
|
|
4478
|
-
map.setView([selectedDriver.lat, selectedDriver.lng], 15, {
|
|
4498
|
+
map.setView([selectedDriver.lat, selectedDriver.lng], mapZoom || 15, {
|
|
4479
4499
|
animate: true,
|
|
4480
4500
|
duration: 1
|
|
4481
4501
|
});
|
|
4482
4502
|
}
|
|
4483
4503
|
}, [selectedDriver, map]);
|
|
4504
|
+
useEffect(() => {
|
|
4505
|
+
if (Array.isArray(mapCenter) && mapCenter.length === 2) {
|
|
4506
|
+
map.setView(mapCenter, mapZoom || 15, {
|
|
4507
|
+
animate: true,
|
|
4508
|
+
duration: 1
|
|
4509
|
+
});
|
|
4510
|
+
}
|
|
4511
|
+
}, [mapCenter, map]);
|
|
4512
|
+
useEffect(() => {
|
|
4513
|
+
if (mapZoom) {
|
|
4514
|
+
map.setZoom(mapZoom);
|
|
4515
|
+
}
|
|
4516
|
+
}, [mapZoom, map]);
|
|
4484
4517
|
return null;
|
|
4485
4518
|
};
|
|
4486
4519
|
const useRoute = (start, end) => {
|
|
@@ -4493,7 +4526,7 @@ const useRoute = (start, end) => {
|
|
|
4493
4526
|
setLoading(true);
|
|
4494
4527
|
try {
|
|
4495
4528
|
const response = await fetch(`https://router.project-osrm.org/route/v1/driving/${start.lng},${start.lat};${end.lng},${end.lat}?overview=full&geometries=geojson&steps=true`);
|
|
4496
|
-
if (!response.ok) throw new Error("
|
|
4529
|
+
if (!response.ok) throw new Error(t("FAILED_TO_FETCH_ROUTE"));
|
|
4497
4530
|
const data = await response.json();
|
|
4498
4531
|
if (data.routes && data.routes[0]) {
|
|
4499
4532
|
const route = data.routes[0];
|
|
@@ -4506,7 +4539,7 @@ const useRoute = (start, end) => {
|
|
|
4506
4539
|
});
|
|
4507
4540
|
}
|
|
4508
4541
|
} catch (err) {
|
|
4509
|
-
console.error("Error fetching route:", err);
|
|
4542
|
+
console.error(t("Error fetching route:"), err);
|
|
4510
4543
|
setError(err.message);
|
|
4511
4544
|
} finally {
|
|
4512
4545
|
setLoading(false);
|
|
@@ -4545,7 +4578,7 @@ const RouteLayer = ({
|
|
|
4545
4578
|
boxShadow: "0 2px 4px rgba(0,0,0,0.1)",
|
|
4546
4579
|
zIndex: 1000
|
|
4547
4580
|
}
|
|
4548
|
-
}, "
|
|
4581
|
+
}, t("LOADING_ROUTE"));
|
|
4549
4582
|
}
|
|
4550
4583
|
if (error) {
|
|
4551
4584
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -4560,7 +4593,7 @@ const RouteLayer = ({
|
|
|
4560
4593
|
boxShadow: "0 2px 4px rgba(0,0,0,0.1)",
|
|
4561
4594
|
zIndex: 1000
|
|
4562
4595
|
}
|
|
4563
|
-
}, "
|
|
4596
|
+
}, t("ERROR_LOADING_ROUTE"), error);
|
|
4564
4597
|
}
|
|
4565
4598
|
if (!routeData) return null;
|
|
4566
4599
|
const renderRouteSegments = () => {
|
|
@@ -4652,7 +4685,7 @@ const RouteLayer = ({
|
|
|
4652
4685
|
margin: 0,
|
|
4653
4686
|
color: "#667eea"
|
|
4654
4687
|
}
|
|
4655
|
-
}, "
|
|
4688
|
+
}, t("ROUTE_INFORMATION")), /*#__PURE__*/React.createElement("button", {
|
|
4656
4689
|
onClick: () => setShowSteps(false),
|
|
4657
4690
|
style: {
|
|
4658
4691
|
background: "none",
|
|
@@ -4666,14 +4699,14 @@ const RouteLayer = ({
|
|
|
4666
4699
|
style: {
|
|
4667
4700
|
marginBottom: "12px"
|
|
4668
4701
|
}
|
|
4669
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, "
|
|
4702
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, t("TOTAL_DISTANCE"), ":"), " ", (routeData.distance / 1000).toFixed(2), " km"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, t("ESTIMATED_TIME"), ":"), " ", Math.round(routeData.duration / 60), " minutes")), selectedStep && /*#__PURE__*/React.createElement("div", {
|
|
4670
4703
|
style: {
|
|
4671
4704
|
padding: "8px",
|
|
4672
4705
|
background: "#f5f5f5",
|
|
4673
4706
|
borderRadius: "4px",
|
|
4674
4707
|
marginBottom: "8px"
|
|
4675
4708
|
}
|
|
4676
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, "
|
|
4709
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, t("CURRENT_STEP"), ":"), " ", selectedStep.maneuver.type), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, t("INSTRUCTION"), ":"), " ", selectedStep.maneuver.instruction || selectedStep.name), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, t("DISTANCE"), ":"), " ", (selectedStep.distance / 1000).toFixed(2), " km"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, t("DURATION"), ":"), " ", Math.round(selectedStep.duration / 60), " min")), showSteps && routeData.legs && /*#__PURE__*/React.createElement("div", {
|
|
4677
4710
|
style: {
|
|
4678
4711
|
maxHeight: "200px",
|
|
4679
4712
|
overflowY: "auto"
|
|
@@ -4683,7 +4716,7 @@ const RouteLayer = ({
|
|
|
4683
4716
|
margin: "8px 0",
|
|
4684
4717
|
color: "#666"
|
|
4685
4718
|
}
|
|
4686
|
-
}, "
|
|
4719
|
+
}, t("TURN_BY_TURN_DIRECTIONS"), ":"), routeData.legs[0].steps.map((step, idx) => /*#__PURE__*/React.createElement("div", {
|
|
4687
4720
|
key: idx,
|
|
4688
4721
|
style: {
|
|
4689
4722
|
padding: "8px",
|
|
@@ -4788,6 +4821,9 @@ const DriverCard = ({
|
|
|
4788
4821
|
onClick,
|
|
4789
4822
|
vendorList
|
|
4790
4823
|
}) => {
|
|
4824
|
+
const {
|
|
4825
|
+
t
|
|
4826
|
+
} = useTranslation();
|
|
4791
4827
|
const [currentAddress, setCurrentAddress] = useState("Resolving area...");
|
|
4792
4828
|
const [deliveryAddress, setDeliveryAddress] = useState("Resolving area...");
|
|
4793
4829
|
const lastResolvedPos = useRef({
|
|
@@ -4830,190 +4866,128 @@ const DriverCard = ({
|
|
|
4830
4866
|
};
|
|
4831
4867
|
resolveDest();
|
|
4832
4868
|
}, [driver.deliveryLat, driver.deliveryLng]);
|
|
4833
|
-
const
|
|
4834
|
-
if (!vendorList || !vendorList.length) return
|
|
4869
|
+
const driverDetails = useMemo(() => {
|
|
4870
|
+
if (!vendorList || !vendorList.length) return {
|
|
4871
|
+
name: "Unknown",
|
|
4872
|
+
vehicle: "N/A"
|
|
4873
|
+
};
|
|
4835
4874
|
for (const vendor of vendorList) {
|
|
4836
|
-
|
|
4837
|
-
const
|
|
4838
|
-
var _d$owner, _d$owner2
|
|
4839
|
-
return
|
|
4875
|
+
var _vendor$drivers;
|
|
4876
|
+
const match = (_vendor$drivers = vendor.drivers) === null || _vendor$drivers === void 0 ? void 0 : _vendor$drivers.find(d => {
|
|
4877
|
+
var _d$owner, _d$owner2;
|
|
4878
|
+
return d.id === driver.driverId || ((_d$owner = d.owner) === null || _d$owner === void 0 ? void 0 : _d$owner.mobileNumber) === driver.driverId || ((_d$owner2 = d.owner) === null || _d$owner2 === void 0 ? void 0 : _d$owner2.uuid) === driver.driverId;
|
|
4840
4879
|
});
|
|
4841
|
-
if (
|
|
4842
|
-
var _vendor$vehicles
|
|
4843
|
-
return
|
|
4880
|
+
if (match) {
|
|
4881
|
+
var _match$owner, _vendor$vehicles, _vendor$vehicles$;
|
|
4882
|
+
return {
|
|
4883
|
+
name: ((_match$owner = match.owner) === null || _match$owner === void 0 ? void 0 : _match$owner.name) || "Unknown",
|
|
4884
|
+
vehicle: ((_vendor$vehicles = vendor.vehicles) === null || _vendor$vehicles === void 0 ? void 0 : (_vendor$vehicles$ = _vendor$vehicles[0]) === null || _vendor$vehicles$ === void 0 ? void 0 : _vendor$vehicles$.registrationNumber) || "N/A"
|
|
4885
|
+
};
|
|
4844
4886
|
}
|
|
4845
4887
|
}
|
|
4846
|
-
return
|
|
4888
|
+
return {
|
|
4889
|
+
name: "Unknown",
|
|
4890
|
+
vehicle: "N/A"
|
|
4891
|
+
};
|
|
4847
4892
|
}, [vendorList, driver.driverId]);
|
|
4848
|
-
const calculateETA = () => {
|
|
4849
|
-
if (!driver.lat || !driver.lng || !driver.deliveryLat || !driver.deliveryLng) return null;
|
|
4850
|
-
const distance = calculateDistance$1(driver.lat, driver.lng, driver.deliveryLat, driver.deliveryLng);
|
|
4851
|
-
const minutes = Math.round(distance / 30 * 60);
|
|
4852
|
-
return minutes;
|
|
4853
|
-
};
|
|
4854
|
-
const eta = calculateETA();
|
|
4855
4893
|
return /*#__PURE__*/React.createElement("div", {
|
|
4856
4894
|
onClick: onClick,
|
|
4857
4895
|
style: {
|
|
4858
4896
|
padding: "16px",
|
|
4859
|
-
marginBottom: "12px",
|
|
4860
4897
|
borderRadius: "12px",
|
|
4861
|
-
background: isSelected ? "#
|
|
4862
|
-
border: `2px solid ${isSelected ? "#
|
|
4863
|
-
boxShadow: isSelected ? "0 4px 12px rgba(33, 150, 243, 0.2)" : "0 2px 8px rgba(0, 0, 0, 0.05)",
|
|
4898
|
+
background: isSelected ? "#f0f4ff" : "white",
|
|
4899
|
+
border: `2px solid ${isSelected ? "#667eea" : "#f0f0f0"}`,
|
|
4864
4900
|
cursor: "pointer",
|
|
4865
|
-
transition: "all 0.2s ease",
|
|
4866
4901
|
position: "relative",
|
|
4867
|
-
|
|
4902
|
+
transition: "all 0.2s ease"
|
|
4868
4903
|
}
|
|
4869
4904
|
}, /*#__PURE__*/React.createElement("div", {
|
|
4870
|
-
style: {
|
|
4871
|
-
position: "absolute",
|
|
4872
|
-
top: 0,
|
|
4873
|
-
left: 0,
|
|
4874
|
-
right: 0,
|
|
4875
|
-
height: "4px",
|
|
4876
|
-
background: driver.isOnline ? "linear-gradient(90deg, #4caf50, #81c784)" : "linear-gradient(90deg, #f44336, #e57373)"
|
|
4877
|
-
}
|
|
4878
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
4879
4905
|
style: {
|
|
4880
4906
|
display: "flex",
|
|
4881
|
-
|
|
4907
|
+
gap: "12px",
|
|
4882
4908
|
marginBottom: "12px"
|
|
4883
4909
|
}
|
|
4884
4910
|
}, /*#__PURE__*/React.createElement("div", {
|
|
4885
4911
|
style: {
|
|
4886
4912
|
width: "40px",
|
|
4887
4913
|
height: "40px",
|
|
4888
|
-
borderRadius: "
|
|
4889
|
-
background:
|
|
4914
|
+
borderRadius: "8px",
|
|
4915
|
+
background: "#f0f2f5",
|
|
4890
4916
|
display: "flex",
|
|
4891
4917
|
alignItems: "center",
|
|
4892
4918
|
justifyContent: "center",
|
|
4893
|
-
|
|
4894
|
-
fontWeight: "bold",
|
|
4895
|
-
fontSize: "16px",
|
|
4896
|
-
marginRight: "12px",
|
|
4897
|
-
flexShrink: 0
|
|
4898
|
-
}
|
|
4899
|
-
}, driver.driverId.charAt(0).toUpperCase()), /*#__PURE__*/React.createElement("div", {
|
|
4900
|
-
style: {
|
|
4901
|
-
flex: 1,
|
|
4902
|
-
minWidth: 0
|
|
4903
|
-
}
|
|
4904
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
4905
|
-
style: {
|
|
4906
|
-
fontWeight: "600",
|
|
4907
|
-
fontSize: "16px",
|
|
4908
|
-
color: "#667eea",
|
|
4909
|
-
marginBottom: "4px",
|
|
4910
|
-
overflow: "hidden",
|
|
4911
|
-
textOverflow: "ellipsis",
|
|
4912
|
-
whiteSpace: "nowrap"
|
|
4919
|
+
fontSize: "20px"
|
|
4913
4920
|
}
|
|
4914
|
-
}, "
|
|
4915
|
-
isOnline: driver.isOnline
|
|
4916
|
-
}))), driver.lat && driver.lng && /*#__PURE__*/React.createElement("div", {
|
|
4921
|
+
}, "\uD83D\uDC64"), /*#__PURE__*/React.createElement("div", {
|
|
4917
4922
|
style: {
|
|
4918
|
-
|
|
4923
|
+
flex: 1
|
|
4919
4924
|
}
|
|
4920
4925
|
}, /*#__PURE__*/React.createElement("div", {
|
|
4921
4926
|
style: {
|
|
4922
|
-
fontSize: "12px",
|
|
4923
|
-
color: "#666",
|
|
4924
|
-
marginBottom: "4px"
|
|
4925
|
-
}
|
|
4926
|
-
}, "Current Location"), /*#__PURE__*/React.createElement("div", {
|
|
4927
|
-
style: {
|
|
4928
|
-
fontSize: "13px",
|
|
4929
|
-
fontWeight: "500",
|
|
4930
|
-
color: "#333",
|
|
4931
4927
|
display: "flex",
|
|
4932
|
-
|
|
4933
|
-
|
|
4928
|
+
justifyContent: "space-between",
|
|
4929
|
+
alignItems: "flex-start"
|
|
4934
4930
|
}
|
|
4935
|
-
}, /*#__PURE__*/React.createElement("
|
|
4936
|
-
title: `${driver.lat.toFixed(6)}, ${driver.lng.toFixed(6)}`
|
|
4937
|
-
}, currentAddress))), driver.deliveryLat && driver.deliveryLng && /*#__PURE__*/React.createElement("div", {
|
|
4931
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
4938
4932
|
style: {
|
|
4939
|
-
|
|
4933
|
+
fontWeight: "700",
|
|
4934
|
+
fontSize: "14px",
|
|
4935
|
+
color: "#0d47a1"
|
|
4940
4936
|
}
|
|
4941
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
4937
|
+
}, "DRV-", driver.driverId.substring(0, 4).toUpperCase()), /*#__PURE__*/React.createElement("div", {
|
|
4942
4938
|
style: {
|
|
4943
|
-
fontSize: "
|
|
4944
|
-
color: "#666"
|
|
4945
|
-
marginBottom: "4px"
|
|
4939
|
+
fontSize: "11px",
|
|
4940
|
+
color: "#666"
|
|
4946
4941
|
}
|
|
4947
|
-
}, "
|
|
4942
|
+
}, driverDetails.name, " \u2022 ", driverDetails.vehicle)), /*#__PURE__*/React.createElement("div", {
|
|
4948
4943
|
style: {
|
|
4949
|
-
fontSize: "
|
|
4950
|
-
fontWeight: "
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4944
|
+
fontSize: "10px",
|
|
4945
|
+
fontWeight: "700",
|
|
4946
|
+
padding: "2px 8px",
|
|
4947
|
+
borderRadius: "4px",
|
|
4948
|
+
background: driver.isOnline ? "#e8f5e9" : "#ffebee",
|
|
4949
|
+
color: driver.isOnline ? "#2e7d32" : "#c62828"
|
|
4955
4950
|
}
|
|
4956
|
-
}, /*#__PURE__*/React.createElement("
|
|
4957
|
-
title: `${driver.deliveryLat.toFixed(6)}, ${driver.deliveryLng.toFixed(6)}`
|
|
4958
|
-
}, deliveryAddress))), eta !== null && /*#__PURE__*/React.createElement("div", {
|
|
4951
|
+
}, driver.isOnline ? "ONLINE" : "OFFLINE")))), /*#__PURE__*/React.createElement("div", {
|
|
4959
4952
|
style: {
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
borderRadius: "6px",
|
|
4964
|
-
display: "flex",
|
|
4965
|
-
justifyContent: "space-between",
|
|
4966
|
-
alignItems: "center",
|
|
4967
|
-
flexWrap: "wrap",
|
|
4968
|
-
gap: "8px"
|
|
4953
|
+
display: "grid",
|
|
4954
|
+
gridTemplateColumns: "1fr 1fr",
|
|
4955
|
+
gap: "12px"
|
|
4969
4956
|
}
|
|
4970
4957
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
4971
4958
|
style: {
|
|
4972
|
-
fontSize: "
|
|
4973
|
-
color: "#666"
|
|
4974
|
-
}
|
|
4975
|
-
}, "Est. Arrival"), /*#__PURE__*/React.createElement("div", {
|
|
4976
|
-
style: {
|
|
4977
|
-
fontSize: "14px",
|
|
4959
|
+
fontSize: "10px",
|
|
4978
4960
|
fontWeight: "600",
|
|
4979
|
-
color: "#
|
|
4961
|
+
color: "#aaa",
|
|
4962
|
+
marginBottom: "2px"
|
|
4980
4963
|
}
|
|
4981
|
-
},
|
|
4964
|
+
}, t("CURRENT_LOCATION")), /*#__PURE__*/React.createElement("div", {
|
|
4982
4965
|
style: {
|
|
4983
4966
|
fontSize: "11px",
|
|
4984
|
-
|
|
4967
|
+
fontWeight: "700",
|
|
4968
|
+
color: "#333",
|
|
4969
|
+
whiteSpace: "nowrap",
|
|
4970
|
+
overflow: "hidden",
|
|
4971
|
+
textOverflow: "ellipsis"
|
|
4985
4972
|
}
|
|
4986
|
-
}, "
|
|
4973
|
+
}, currentAddress))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
4987
4974
|
style: {
|
|
4988
|
-
fontSize: "
|
|
4975
|
+
fontSize: "10px",
|
|
4989
4976
|
fontWeight: "600",
|
|
4990
|
-
color: "#
|
|
4977
|
+
color: "#aaa",
|
|
4978
|
+
marginBottom: "2px"
|
|
4991
4979
|
}
|
|
4992
|
-
},
|
|
4980
|
+
}, t("DESTINATION")), /*#__PURE__*/React.createElement("div", {
|
|
4993
4981
|
style: {
|
|
4994
|
-
marginTop: "12px",
|
|
4995
4982
|
fontSize: "11px",
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
gap: "4px"
|
|
5002
|
-
}
|
|
5003
|
-
}, vehicleNumber && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
5004
|
-
style: {
|
|
5005
|
-
color: "#555"
|
|
5006
|
-
}
|
|
5007
|
-
}, "Vehicle"), /*#__PURE__*/React.createElement("span", {
|
|
5008
|
-
style: {
|
|
5009
|
-
fontWeight: "600",
|
|
5010
|
-
color: "#667eea"
|
|
4983
|
+
fontWeight: "700",
|
|
4984
|
+
color: "#333",
|
|
4985
|
+
whiteSpace: "nowrap",
|
|
4986
|
+
overflow: "hidden",
|
|
4987
|
+
textOverflow: "ellipsis"
|
|
5011
4988
|
}
|
|
5012
|
-
},
|
|
4989
|
+
}, deliveryAddress))));
|
|
5013
4990
|
};
|
|
5014
|
-
function calculateDistance$1(lat1, lon1, lat2, lon2) {
|
|
5015
|
-
return calculateDistance(lat1, lon1, lat2, lon2);
|
|
5016
|
-
}
|
|
5017
4991
|
function LiveTrackingSystem() {
|
|
5018
4992
|
const {
|
|
5019
4993
|
t
|
|
@@ -5067,11 +5041,11 @@ function LiveTrackingSystem() {
|
|
|
5067
5041
|
console.log("=== VENDOR DEBUG ===");
|
|
5068
5042
|
console.log("Vendor[0] vehicles:", (_vendorOptions$ = vendorOptions[0]) === null || _vendorOptions$ === void 0 ? void 0 : _vendorOptions$.vehicles);
|
|
5069
5043
|
console.log("Vendor[0] drivers:", (_vendorOptions$2 = vendorOptions[0]) === null || _vendorOptions$2 === void 0 ? void 0 : (_vendorOptions$2$driv = _vendorOptions$2.drivers) === null || _vendorOptions$2$driv === void 0 ? void 0 : _vendorOptions$2$driv.map(d => {
|
|
5070
|
-
var _d$
|
|
5044
|
+
var _d$owner3, _d$owner4;
|
|
5071
5045
|
return {
|
|
5072
5046
|
id: d.id,
|
|
5073
|
-
mobile: (_d$
|
|
5074
|
-
uuid: (_d$
|
|
5047
|
+
mobile: (_d$owner3 = d.owner) === null || _d$owner3 === void 0 ? void 0 : _d$owner3.mobileNumber,
|
|
5048
|
+
uuid: (_d$owner4 = d.owner) === null || _d$owner4 === void 0 ? void 0 : _d$owner4.uuid
|
|
5075
5049
|
};
|
|
5076
5050
|
}));
|
|
5077
5051
|
console.log("Socket driverId example:", Object.keys(drivers)[0]);
|
|
@@ -5169,18 +5143,18 @@ function LiveTrackingSystem() {
|
|
|
5169
5143
|
const matchesFillingPoint = !selectedFillingPoint || (() => {
|
|
5170
5144
|
if (!vendorOptions || !vendorOptions.length) return false;
|
|
5171
5145
|
return vendorOptions.some(vendor => {
|
|
5172
|
-
var _vendor$fillingPoint2, _vendor$
|
|
5146
|
+
var _vendor$fillingPoint2, _vendor$drivers2;
|
|
5173
5147
|
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;
|
|
5174
|
-
return (_vendor$
|
|
5175
|
-
var _d$
|
|
5176
|
-
return ((_d$
|
|
5148
|
+
return (_vendor$drivers2 = vendor.drivers) === null || _vendor$drivers2 === void 0 ? void 0 : _vendor$drivers2.some(d => {
|
|
5149
|
+
var _d$owner5, _d$owner6, _d$owner7, _d$owner8;
|
|
5150
|
+
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);
|
|
5177
5151
|
});
|
|
5178
5152
|
});
|
|
5179
5153
|
})();
|
|
5180
5154
|
const matchesVendor = !selectedVendor || (_selectedVendor$drive => {
|
|
5181
5155
|
const vendorDriverIds = ((_selectedVendor$drive = selectedVendor.drivers) === null || _selectedVendor$drive === void 0 ? void 0 : _selectedVendor$drive.map(d => {
|
|
5182
|
-
var _d$
|
|
5183
|
-
return [(_d$
|
|
5156
|
+
var _d$owner9, _d$owner0, _d$owner1, _d$owner10;
|
|
5157
|
+
return [(_d$owner9 = d.owner) === null || _d$owner9 === void 0 ? void 0 : _d$owner9.mobileNumber, (_d$owner0 = d.owner) === null || _d$owner0 === void 0 ? void 0 : _d$owner0.uuid, d.id, String((_d$owner1 = d.owner) === null || _d$owner1 === void 0 ? void 0 : _d$owner1.mobileNumber), String((_d$owner10 = d.owner) === null || _d$owner10 === void 0 ? void 0 : _d$owner10.uuid)];
|
|
5184
5158
|
}).flat().filter(Boolean)) || [];
|
|
5185
5159
|
return vendorDriverIds.some(id => driver.driverId === id);
|
|
5186
5160
|
})();
|
|
@@ -5195,188 +5169,218 @@ function LiveTrackingSystem() {
|
|
|
5195
5169
|
return /*#__PURE__*/React.createElement("div", {
|
|
5196
5170
|
style: {
|
|
5197
5171
|
display: "flex",
|
|
5172
|
+
flexDirection: "column",
|
|
5198
5173
|
height: "100vh",
|
|
5199
5174
|
width: "100%",
|
|
5200
5175
|
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, sans-serif",
|
|
5201
|
-
|
|
5202
|
-
|
|
5176
|
+
background: "#f0f2f5",
|
|
5177
|
+
padding: "16px",
|
|
5178
|
+
boxSizing: "border-box"
|
|
5203
5179
|
}
|
|
5204
|
-
},
|
|
5205
|
-
onClick: toggleSidebar,
|
|
5180
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5206
5181
|
style: {
|
|
5207
|
-
position: "absolute",
|
|
5208
|
-
top: "10px",
|
|
5209
|
-
left: "10px",
|
|
5210
|
-
zIndex: 2000,
|
|
5211
|
-
background: "#667eea",
|
|
5212
|
-
color: "white",
|
|
5213
|
-
border: "none",
|
|
5214
|
-
borderRadius: "8px",
|
|
5215
|
-
padding: "10px 16px",
|
|
5216
|
-
fontSize: "14px",
|
|
5217
|
-
fontWeight: "500",
|
|
5218
|
-
cursor: "pointer",
|
|
5219
|
-
boxShadow: "0 2px 8px rgba(0,0,0,0.2)",
|
|
5220
5182
|
display: "flex",
|
|
5183
|
+
justifyContent: "space-between",
|
|
5221
5184
|
alignItems: "center",
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5185
|
+
marginBottom: "16px",
|
|
5186
|
+
background: "white",
|
|
5187
|
+
padding: "16px 24px",
|
|
5188
|
+
borderRadius: "12px",
|
|
5189
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.05)",
|
|
5190
|
+
border: "2px solid #667eea44"
|
|
5227
5191
|
}
|
|
5228
|
-
},
|
|
5192
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5229
5193
|
style: {
|
|
5230
|
-
width: isMobile ? showSidebar ? "100%" : "0" : "380px",
|
|
5231
|
-
height: "100%",
|
|
5232
|
-
borderRight: isMobile ? "none" : "1px solid #e0e0e0",
|
|
5233
5194
|
display: "flex",
|
|
5234
|
-
flexDirection: "column"
|
|
5235
|
-
background: "#ffffff",
|
|
5236
|
-
boxShadow: isMobile ? showSidebar ? "0 0 20px rgba(0,0,0,0.2)" : "none" : "2px 0 8px rgba(0, 0, 0, 0.05)",
|
|
5237
|
-
position: isMobile ? "absolute" : "relative",
|
|
5238
|
-
top: 0,
|
|
5239
|
-
left: 0,
|
|
5240
|
-
zIndex: 1500,
|
|
5241
|
-
transition: "all 0.3s ease-in-out",
|
|
5242
|
-
overflow: showSidebar ? "visible" : "hidden",
|
|
5243
|
-
...(isMobile && !showSidebar && {
|
|
5244
|
-
width: "0",
|
|
5245
|
-
opacity: 0,
|
|
5246
|
-
pointerEvents: "none"
|
|
5247
|
-
})
|
|
5248
|
-
}
|
|
5249
|
-
}, showSidebar && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
5250
|
-
style: {
|
|
5251
|
-
padding: isMobile ? "16px" : "24px",
|
|
5252
|
-
background: "linear-gradient(135deg, #667eea, #0d47a1)",
|
|
5253
|
-
color: "white"
|
|
5195
|
+
flexDirection: "column"
|
|
5254
5196
|
}
|
|
5255
|
-
},
|
|
5256
|
-
onClick: toggleSidebar,
|
|
5197
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5257
5198
|
style: {
|
|
5258
|
-
position: "absolute",
|
|
5259
|
-
top: "10px",
|
|
5260
|
-
right: "10px",
|
|
5261
|
-
background: "rgba(255,255,255,0.2)",
|
|
5262
|
-
border: "none",
|
|
5263
|
-
color: "white",
|
|
5264
|
-
fontSize: "20px",
|
|
5265
|
-
cursor: "pointer",
|
|
5266
|
-
width: "30px",
|
|
5267
|
-
height: "30px",
|
|
5268
|
-
borderRadius: "4px",
|
|
5269
5199
|
display: "flex",
|
|
5270
5200
|
alignItems: "center",
|
|
5271
|
-
|
|
5201
|
+
gap: "12px"
|
|
5272
5202
|
}
|
|
5273
|
-
},
|
|
5203
|
+
}, /*#__PURE__*/React.createElement("h1", {
|
|
5274
5204
|
style: {
|
|
5275
|
-
margin:
|
|
5276
|
-
fontSize:
|
|
5277
|
-
fontWeight: "
|
|
5278
|
-
|
|
5205
|
+
margin: 0,
|
|
5206
|
+
fontSize: "24px",
|
|
5207
|
+
fontWeight: "700",
|
|
5208
|
+
color: "#0d47a1"
|
|
5279
5209
|
}
|
|
5280
|
-
}, "
|
|
5210
|
+
}, t("WT_LIVE_DRIVER_TRACKING")), /*#__PURE__*/React.createElement("div", {
|
|
5281
5211
|
style: {
|
|
5282
5212
|
display: "flex",
|
|
5283
5213
|
alignItems: "center",
|
|
5284
|
-
gap: "
|
|
5285
|
-
|
|
5286
|
-
|
|
5214
|
+
gap: "6px",
|
|
5215
|
+
background: "#e8f5e9",
|
|
5216
|
+
color: "#2e7d32",
|
|
5217
|
+
padding: "4px 12px",
|
|
5218
|
+
borderRadius: "20px",
|
|
5219
|
+
fontSize: "12px",
|
|
5220
|
+
fontWeight: "700",
|
|
5221
|
+
border: "1px solid #c8e6c9"
|
|
5287
5222
|
}
|
|
5288
5223
|
}, /*#__PURE__*/React.createElement("span", {
|
|
5289
5224
|
style: {
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
height: "10px",
|
|
5225
|
+
width: "8px",
|
|
5226
|
+
height: "8px",
|
|
5293
5227
|
borderRadius: "50%",
|
|
5294
5228
|
backgroundColor: isConnected ? "#4caf50" : "#f44336",
|
|
5295
|
-
|
|
5229
|
+
boxShadow: isConnected ? "0 0 8px #4caf50" : "none"
|
|
5296
5230
|
}
|
|
5297
|
-
}),
|
|
5231
|
+
}), isConnected ? "CONNECTED" : "DISCONNECTED")), /*#__PURE__*/React.createElement("p", {
|
|
5298
5232
|
style: {
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
gap: isMobile ? "4px" : "8px",
|
|
5302
|
-
padding: isMobile ? "12px" : "16px",
|
|
5303
|
-
background: "#f5f5f5",
|
|
5304
|
-
borderBottom: "1px solid #e0e0e0"
|
|
5305
|
-
}
|
|
5306
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
5307
|
-
style: {
|
|
5308
|
-
textAlign: "center"
|
|
5309
|
-
}
|
|
5310
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
5311
|
-
style: {
|
|
5312
|
-
fontSize: isMobile ? "10px" : "11px",
|
|
5233
|
+
margin: "4px 0 0 0",
|
|
5234
|
+
fontSize: "14px",
|
|
5313
5235
|
color: "#666"
|
|
5314
5236
|
}
|
|
5315
|
-
}, "
|
|
5237
|
+
}, t("REAL_TIME_TELEMETRY_AND_FLEET_COORDINATION"))), /*#__PURE__*/React.createElement("div", {
|
|
5316
5238
|
style: {
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
color: "#667eea"
|
|
5239
|
+
display: "flex",
|
|
5240
|
+
gap: "12px"
|
|
5320
5241
|
}
|
|
5321
|
-
},
|
|
5242
|
+
}, [{
|
|
5243
|
+
label: t("TOTAL_FLEET"),
|
|
5244
|
+
value: Object.keys(drivers).length,
|
|
5245
|
+
color: "#0d47a1"
|
|
5246
|
+
}, {
|
|
5247
|
+
label: t("ONLINE"),
|
|
5248
|
+
value: onlineCount,
|
|
5249
|
+
color: "#2e7d32"
|
|
5250
|
+
}, {
|
|
5251
|
+
label: t("OFFLINE"),
|
|
5252
|
+
value: offlineCount,
|
|
5253
|
+
color: "#c62828"
|
|
5254
|
+
}, {
|
|
5255
|
+
label: t("ACTIVE"),
|
|
5256
|
+
value: activeDeliveries,
|
|
5257
|
+
color: "#0d47a1"
|
|
5258
|
+
}].map((stat, idx) => /*#__PURE__*/React.createElement("div", {
|
|
5259
|
+
key: idx,
|
|
5322
5260
|
style: {
|
|
5323
|
-
|
|
5261
|
+
background: "#f8f9fa",
|
|
5262
|
+
padding: "8px 16px",
|
|
5263
|
+
borderRadius: "8px",
|
|
5264
|
+
minWidth: "100px",
|
|
5265
|
+
display: "flex",
|
|
5266
|
+
flexDirection: "column",
|
|
5267
|
+
border: "1px solid #e0e0e0"
|
|
5324
5268
|
}
|
|
5325
5269
|
}, /*#__PURE__*/React.createElement("div", {
|
|
5326
5270
|
style: {
|
|
5327
|
-
fontSize:
|
|
5328
|
-
|
|
5271
|
+
fontSize: "10px",
|
|
5272
|
+
fontWeight: "600",
|
|
5273
|
+
color: "#888",
|
|
5274
|
+
marginBottom: "4px"
|
|
5329
5275
|
}
|
|
5330
|
-
},
|
|
5276
|
+
}, stat.label), /*#__PURE__*/React.createElement("div", {
|
|
5331
5277
|
style: {
|
|
5332
|
-
fontSize:
|
|
5333
|
-
fontWeight: "
|
|
5334
|
-
color:
|
|
5278
|
+
fontSize: "20px",
|
|
5279
|
+
fontWeight: "700",
|
|
5280
|
+
color: stat.color
|
|
5335
5281
|
}
|
|
5336
|
-
},
|
|
5282
|
+
}, stat.value))))), /*#__PURE__*/React.createElement("div", {
|
|
5337
5283
|
style: {
|
|
5338
|
-
|
|
5284
|
+
display: "flex",
|
|
5285
|
+
flex: 1,
|
|
5286
|
+
gap: "16px",
|
|
5287
|
+
overflow: "hidden"
|
|
5339
5288
|
}
|
|
5340
|
-
}, /*#__PURE__*/React.createElement("
|
|
5289
|
+
}, isMobile && /*#__PURE__*/React.createElement("button", {
|
|
5290
|
+
onClick: toggleSidebar,
|
|
5341
5291
|
style: {
|
|
5342
|
-
|
|
5343
|
-
|
|
5292
|
+
position: "absolute",
|
|
5293
|
+
top: "80px",
|
|
5294
|
+
left: "20px",
|
|
5295
|
+
zIndex: 2000,
|
|
5296
|
+
background: "#667eea",
|
|
5297
|
+
color: "white",
|
|
5298
|
+
border: "none",
|
|
5299
|
+
borderRadius: "8px",
|
|
5300
|
+
padding: "8px 12px",
|
|
5301
|
+
fontSize: "12px",
|
|
5302
|
+
cursor: "pointer",
|
|
5303
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.2)"
|
|
5344
5304
|
}
|
|
5345
|
-
}, "
|
|
5305
|
+
}, showSidebar ? "Close" : "Menu"), /*#__PURE__*/React.createElement("div", {
|
|
5346
5306
|
style: {
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5307
|
+
width: isMobile ? showSidebar ? "100%" : "0" : "360px",
|
|
5308
|
+
height: "100%",
|
|
5309
|
+
display: "flex",
|
|
5310
|
+
flexDirection: "column",
|
|
5311
|
+
background: "transparent",
|
|
5312
|
+
position: isMobile ? "absolute" : "relative",
|
|
5313
|
+
top: 0,
|
|
5314
|
+
left: 0,
|
|
5315
|
+
zIndex: 1500,
|
|
5316
|
+
transition: "all 0.3s ease-in-out",
|
|
5317
|
+
...(isMobile && !showSidebar && {
|
|
5318
|
+
width: "0",
|
|
5319
|
+
opacity: 0,
|
|
5320
|
+
pointerEvents: "none"
|
|
5321
|
+
})
|
|
5350
5322
|
}
|
|
5351
|
-
},
|
|
5323
|
+
}, showSidebar && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
5352
5324
|
style: {
|
|
5353
|
-
|
|
5325
|
+
padding: "20px",
|
|
5326
|
+
background: "white",
|
|
5327
|
+
borderRadius: "12px",
|
|
5328
|
+
display: "flex",
|
|
5329
|
+
flexDirection: "column",
|
|
5330
|
+
height: "100%",
|
|
5331
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.05)",
|
|
5332
|
+
border: "1px solid #e0e0e0"
|
|
5354
5333
|
}
|
|
5355
5334
|
}, /*#__PURE__*/React.createElement("div", {
|
|
5356
5335
|
style: {
|
|
5357
|
-
|
|
5358
|
-
|
|
5336
|
+
display: "flex",
|
|
5337
|
+
justifyContent: "space-between",
|
|
5338
|
+
alignItems: "center",
|
|
5339
|
+
marginBottom: "16px"
|
|
5359
5340
|
}
|
|
5360
|
-
},
|
|
5341
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
5361
5342
|
style: {
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5343
|
+
margin: 0,
|
|
5344
|
+
fontSize: "14px",
|
|
5345
|
+
fontWeight: "700",
|
|
5346
|
+
color: "#888",
|
|
5347
|
+
letterSpacing: "1px"
|
|
5365
5348
|
}
|
|
5366
|
-
},
|
|
5349
|
+
}, t("WT_FILTER_FLEET")), /*#__PURE__*/React.createElement("button", {
|
|
5350
|
+
onClick: () => {
|
|
5351
|
+
setSelectedFillingPoint(null);
|
|
5352
|
+
setSelectedVendor(null);
|
|
5353
|
+
setSearchTerm("");
|
|
5354
|
+
setFilterOnline("all");
|
|
5355
|
+
},
|
|
5367
5356
|
style: {
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5357
|
+
background: "none",
|
|
5358
|
+
border: "none",
|
|
5359
|
+
color: "#667eea",
|
|
5360
|
+
fontSize: "12px",
|
|
5361
|
+
fontWeight: "700",
|
|
5362
|
+
cursor: "pointer"
|
|
5363
|
+
}
|
|
5364
|
+
}, t("WT_RESET_ALL"))), /*#__PURE__*/React.createElement("div", {
|
|
5365
|
+
style: {
|
|
5366
|
+
display: "flex",
|
|
5367
|
+
flexDirection: "column",
|
|
5368
|
+
gap: "16px",
|
|
5369
|
+
marginBottom: "20px"
|
|
5371
5370
|
}
|
|
5372
5371
|
}, /*#__PURE__*/React.createElement("div", {
|
|
5373
5372
|
style: {
|
|
5374
5373
|
display: "flex",
|
|
5375
5374
|
flexDirection: "column",
|
|
5376
|
-
gap: "
|
|
5377
|
-
marginBottom: "12px"
|
|
5375
|
+
gap: "6px"
|
|
5378
5376
|
}
|
|
5379
|
-
}, /*#__PURE__*/React.createElement(
|
|
5377
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
5378
|
+
style: {
|
|
5379
|
+
fontSize: "12px",
|
|
5380
|
+
fontWeight: "700",
|
|
5381
|
+
color: "#888"
|
|
5382
|
+
}
|
|
5383
|
+
}, t("WT_SELECT_FILLING_POINT")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
5380
5384
|
t: t,
|
|
5381
5385
|
option: fillingPointOptions,
|
|
5382
5386
|
optionKey: "fillingPointName",
|
|
@@ -5385,10 +5389,21 @@ function LiveTrackingSystem() {
|
|
|
5385
5389
|
placeholder: t("WT_SELECT_FILLING_POINT"),
|
|
5386
5390
|
style: {
|
|
5387
5391
|
width: "100%",
|
|
5388
|
-
margin: 0
|
|
5389
|
-
|
|
5392
|
+
margin: 0
|
|
5393
|
+
}
|
|
5394
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
5395
|
+
style: {
|
|
5396
|
+
display: "flex",
|
|
5397
|
+
flexDirection: "column",
|
|
5398
|
+
gap: "6px"
|
|
5390
5399
|
}
|
|
5391
|
-
}
|
|
5400
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
5401
|
+
style: {
|
|
5402
|
+
fontSize: "12px",
|
|
5403
|
+
fontWeight: "700",
|
|
5404
|
+
color: "#888"
|
|
5405
|
+
}
|
|
5406
|
+
}, t("WT_SELECT_VENDOR")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
5392
5407
|
t: t,
|
|
5393
5408
|
option: filteredVendorOptions,
|
|
5394
5409
|
optionKey: "name",
|
|
@@ -5397,55 +5412,78 @@ function LiveTrackingSystem() {
|
|
|
5397
5412
|
placeholder: t("WT_SELECT_VENDOR"),
|
|
5398
5413
|
style: {
|
|
5399
5414
|
width: "100%",
|
|
5400
|
-
margin: 0
|
|
5401
|
-
padding: 0
|
|
5415
|
+
margin: 0
|
|
5402
5416
|
}
|
|
5403
|
-
})), /*#__PURE__*/React.createElement("
|
|
5417
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
5418
|
+
style: {
|
|
5419
|
+
display: "flex",
|
|
5420
|
+
flexDirection: "column",
|
|
5421
|
+
gap: "6px"
|
|
5422
|
+
}
|
|
5423
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
5424
|
+
style: {
|
|
5425
|
+
fontSize: "10px",
|
|
5426
|
+
fontWeight: "700",
|
|
5427
|
+
color: "#888"
|
|
5428
|
+
}
|
|
5429
|
+
}, t("WT_SEARCH_DRIVER_BY_ID")), /*#__PURE__*/React.createElement("div", {
|
|
5430
|
+
style: {
|
|
5431
|
+
position: "relative"
|
|
5432
|
+
}
|
|
5433
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
5434
|
+
style: {
|
|
5435
|
+
position: "absolute",
|
|
5436
|
+
left: "12px",
|
|
5437
|
+
top: "50%",
|
|
5438
|
+
transform: "translateY(-50%)",
|
|
5439
|
+
color: "#888"
|
|
5440
|
+
}
|
|
5441
|
+
}, "\uD83D\uDD0D"), /*#__PURE__*/React.createElement("input", {
|
|
5404
5442
|
type: "text",
|
|
5405
|
-
placeholder: "
|
|
5443
|
+
placeholder: t("WT_SEARCH_DRIVER_BY_ID"),
|
|
5406
5444
|
value: searchTerm,
|
|
5407
5445
|
onChange: e => setSearchTerm(e.target.value),
|
|
5408
5446
|
style: {
|
|
5409
5447
|
width: "100%",
|
|
5410
|
-
padding:
|
|
5448
|
+
padding: "10px 10px 10px 36px",
|
|
5411
5449
|
border: "1px solid #e0e0e0",
|
|
5412
5450
|
borderRadius: "8px",
|
|
5413
|
-
fontSize:
|
|
5414
|
-
marginBottom: "12px",
|
|
5451
|
+
fontSize: "12px",
|
|
5415
5452
|
outline: "none",
|
|
5416
|
-
|
|
5453
|
+
background: "#f8f9fa",
|
|
5417
5454
|
boxSizing: "border-box"
|
|
5418
|
-
}
|
|
5419
|
-
|
|
5420
|
-
onBlur: e => e.target.style.borderColor = "#e0e0e0"
|
|
5421
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
5455
|
+
}
|
|
5456
|
+
})))), /*#__PURE__*/React.createElement("div", {
|
|
5422
5457
|
style: {
|
|
5423
5458
|
display: "flex",
|
|
5424
|
-
|
|
5425
|
-
|
|
5459
|
+
justifyContent: "space-between",
|
|
5460
|
+
alignItems: "center",
|
|
5461
|
+
marginBottom: "12px"
|
|
5462
|
+
}
|
|
5463
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5464
|
+
style: {
|
|
5465
|
+
display: "flex",
|
|
5466
|
+
gap: "8px"
|
|
5426
5467
|
}
|
|
5427
5468
|
}, ["all", "online", "offline"].map(filter => /*#__PURE__*/React.createElement("button", {
|
|
5428
5469
|
key: filter,
|
|
5429
5470
|
onClick: () => setFilterOnline(filter),
|
|
5430
5471
|
style: {
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
color: filterOnline === filter ? "white" : "#333",
|
|
5472
|
+
padding: "4px 12px",
|
|
5473
|
+
borderRadius: "4px",
|
|
5474
|
+
background: filterOnline === filter ? "#667eea" : "transparent",
|
|
5475
|
+
color: filterOnline === filter ? "white" : "#666",
|
|
5476
|
+
border: filterOnline === filter ? "none" : "1px solid #e0e0e0",
|
|
5437
5477
|
cursor: "pointer",
|
|
5438
|
-
fontSize:
|
|
5439
|
-
fontWeight: "
|
|
5440
|
-
textTransform: "capitalize"
|
|
5441
|
-
transition: "all 0.2s"
|
|
5478
|
+
fontSize: "12px",
|
|
5479
|
+
fontWeight: "600",
|
|
5480
|
+
textTransform: "capitalize"
|
|
5442
5481
|
}
|
|
5443
5482
|
}, filter))), /*#__PURE__*/React.createElement("div", {
|
|
5444
5483
|
style: {
|
|
5445
5484
|
display: "flex",
|
|
5446
5485
|
alignItems: "center",
|
|
5447
|
-
gap: "
|
|
5448
|
-
marginTop: "8px"
|
|
5486
|
+
gap: "6px"
|
|
5449
5487
|
}
|
|
5450
5488
|
}, /*#__PURE__*/React.createElement("input", {
|
|
5451
5489
|
type: "checkbox",
|
|
@@ -5453,59 +5491,49 @@ function LiveTrackingSystem() {
|
|
|
5453
5491
|
checked: showRoutes,
|
|
5454
5492
|
onChange: e => setShowRoutes(e.target.checked),
|
|
5455
5493
|
style: {
|
|
5456
|
-
cursor: "pointer"
|
|
5457
|
-
width: "16px",
|
|
5458
|
-
height: "16px"
|
|
5494
|
+
cursor: "pointer"
|
|
5459
5495
|
}
|
|
5460
5496
|
}), /*#__PURE__*/React.createElement("label", {
|
|
5461
5497
|
htmlFor: "showRoutes",
|
|
5462
5498
|
style: {
|
|
5463
|
-
fontSize:
|
|
5464
|
-
color: "#
|
|
5499
|
+
fontSize: "12px",
|
|
5500
|
+
color: "#666",
|
|
5465
5501
|
cursor: "pointer"
|
|
5466
5502
|
}
|
|
5467
|
-
}, "
|
|
5503
|
+
}, "Routes"))), /*#__PURE__*/React.createElement("div", {
|
|
5468
5504
|
style: {
|
|
5469
5505
|
flex: 1,
|
|
5470
5506
|
overflowY: "auto",
|
|
5471
|
-
padding:
|
|
5472
|
-
|
|
5507
|
+
padding: "4px",
|
|
5508
|
+
marginTop: "8px",
|
|
5509
|
+
display: "flex",
|
|
5510
|
+
flexDirection: "column",
|
|
5511
|
+
gap: "12px"
|
|
5473
5512
|
}
|
|
5474
5513
|
}, filteredDrivers.length === 0 ? /*#__PURE__*/React.createElement("div", {
|
|
5475
5514
|
style: {
|
|
5476
5515
|
textAlign: "center",
|
|
5477
|
-
padding:
|
|
5478
|
-
color: "#999"
|
|
5479
|
-
background: "white",
|
|
5480
|
-
borderRadius: "12px"
|
|
5481
|
-
}
|
|
5482
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
5483
|
-
style: {
|
|
5484
|
-
fontSize: isMobile ? "36px" : "48px",
|
|
5485
|
-
marginBottom: "16px"
|
|
5516
|
+
padding: "40px 20px",
|
|
5517
|
+
color: "#999"
|
|
5486
5518
|
}
|
|
5487
|
-
}, "
|
|
5488
|
-
style: {
|
|
5489
|
-
fontSize: isMobile ? "14px" : "16px",
|
|
5490
|
-
margin: 0
|
|
5491
|
-
}
|
|
5492
|
-
}, Object.keys(drivers).length === 0 ? "No drivers available" : "No drivers match your filters")) : filteredDrivers.map(driver => /*#__PURE__*/React.createElement(DriverCard, {
|
|
5519
|
+
}, /*#__PURE__*/React.createElement("p", null, t("WT_NO_DRIVERS_FOUND"))) : filteredDrivers.map(driver => /*#__PURE__*/React.createElement(DriverCard, {
|
|
5493
5520
|
key: driver.driverId,
|
|
5494
5521
|
driver: driver,
|
|
5495
5522
|
isSelected: (selectedDriver === null || selectedDriver === void 0 ? void 0 : selectedDriver.driverId) === driver.driverId,
|
|
5496
5523
|
vendorList: vendorOptions,
|
|
5497
5524
|
onClick: () => {
|
|
5498
5525
|
setSelectedDriver(driver);
|
|
5499
|
-
if (isMobile)
|
|
5500
|
-
setShowSidebar(false);
|
|
5501
|
-
}
|
|
5526
|
+
if (isMobile) setShowSidebar(false);
|
|
5502
5527
|
}
|
|
5503
|
-
}))))), /*#__PURE__*/React.createElement("div", {
|
|
5528
|
+
})))))), /*#__PURE__*/React.createElement("div", {
|
|
5504
5529
|
style: {
|
|
5505
5530
|
flex: 1,
|
|
5506
5531
|
position: "relative",
|
|
5507
|
-
|
|
5508
|
-
|
|
5532
|
+
background: "white",
|
|
5533
|
+
borderRadius: "12px",
|
|
5534
|
+
overflow: "hidden",
|
|
5535
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.05)",
|
|
5536
|
+
border: "1px solid #e0e0e0"
|
|
5509
5537
|
}
|
|
5510
5538
|
}, /*#__PURE__*/React.createElement(MapContainer, {
|
|
5511
5539
|
center: mapCenter,
|
|
@@ -5519,8 +5547,19 @@ function LiveTrackingSystem() {
|
|
|
5519
5547
|
url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
|
|
5520
5548
|
attribution: "\xA9 <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a>"
|
|
5521
5549
|
}), /*#__PURE__*/React.createElement(MapController, {
|
|
5522
|
-
selectedDriver: selectedDriver
|
|
5523
|
-
|
|
5550
|
+
selectedDriver: selectedDriver,
|
|
5551
|
+
mapZoom: mapZoom,
|
|
5552
|
+
mapCenter: mapCenter
|
|
5553
|
+
}), filteredDrivers.filter(d => d.driverId !== (selectedDriver === null || selectedDriver === void 0 ? void 0 : selectedDriver.driverId)).map(driver => /*#__PURE__*/React.createElement(Marker, {
|
|
5554
|
+
key: driver.driverId,
|
|
5555
|
+
position: [Number(driver.lat), Number(driver.lng)],
|
|
5556
|
+
icon: driver.isOnline ? onlineIcon : offlineIcon,
|
|
5557
|
+
eventHandlers: {
|
|
5558
|
+
click: () => {
|
|
5559
|
+
setSelectedDriver(driver);
|
|
5560
|
+
}
|
|
5561
|
+
}
|
|
5562
|
+
})), selectedDriver && selectedDriver.lat != null && selectedDriver.lng != null && /*#__PURE__*/React.createElement(Marker, {
|
|
5524
5563
|
key: selectedDriver.driverId,
|
|
5525
5564
|
position: [Number(selectedDriver.lat), Number(selectedDriver.lng)],
|
|
5526
5565
|
icon: selectedDriver.isOnline ? onlineIcon : offlineIcon
|
|
@@ -5552,14 +5591,14 @@ function LiveTrackingSystem() {
|
|
|
5552
5591
|
style: {
|
|
5553
5592
|
marginBottom: "8px"
|
|
5554
5593
|
}
|
|
5555
|
-
}, /*#__PURE__*/React.createElement("strong", null, "
|
|
5594
|
+
}, /*#__PURE__*/React.createElement("strong", null, "Current Location"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Address, {
|
|
5556
5595
|
lat: selectedDriver.lat,
|
|
5557
5596
|
lng: selectedDriver.lng
|
|
5558
5597
|
}))), selectedDriver.deliveryLat && selectedDriver.deliveryLng && /*#__PURE__*/React.createElement("div", {
|
|
5559
5598
|
style: {
|
|
5560
5599
|
marginBottom: "8px"
|
|
5561
5600
|
}
|
|
5562
|
-
}, /*#__PURE__*/React.createElement("strong", null, "
|
|
5601
|
+
}, /*#__PURE__*/React.createElement("strong", null, t("DELIVERY_DESTINATION")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Address, {
|
|
5563
5602
|
lat: selectedDriver.deliveryLat,
|
|
5564
5603
|
lng: selectedDriver.deliveryLng
|
|
5565
5604
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
@@ -5572,26 +5611,17 @@ function LiveTrackingSystem() {
|
|
|
5572
5611
|
borderRadius: "4px",
|
|
5573
5612
|
marginTop: "8px"
|
|
5574
5613
|
}
|
|
5575
|
-
}, selectedDriver.speed && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, "
|
|
5614
|
+
}, selectedDriver.speed && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, t("WT_SPEED"), ":"), /*#__PURE__*/React.createElement("span", null, (selectedDriver.speed * 3.6).toFixed(1), " ", t("WT_KM_PER_HOUR"))), selectedDriver.heading && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, t("WT_HEADING"), ":"), /*#__PURE__*/React.createElement("span", null, Math.round(selectedDriver.heading), "\xB0")), selectedDriver.accuracy && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, t("WT_ACCURACY"), ":"), /*#__PURE__*/React.createElement("span", null, Math.round(selectedDriver.accuracy), "m"))), selectedDriver.lastUpdate && /*#__PURE__*/React.createElement("div", {
|
|
5576
5615
|
style: {
|
|
5577
5616
|
marginTop: "8px",
|
|
5578
5617
|
color: "#666",
|
|
5579
5618
|
fontSize: "10px"
|
|
5580
5619
|
}
|
|
5581
|
-
}, "
|
|
5620
|
+
}, t("WT_LAST_UPDATE"), ": ", new Date(selectedDriver.lastUpdate).toLocaleString()))))), selectedDriver && selectedDriver.deliveryLat != null && selectedDriver.deliveryLng != null && /*#__PURE__*/React.createElement(Marker, {
|
|
5582
5621
|
key: `dest-${selectedDriver.driverId}`,
|
|
5583
5622
|
position: [Number(selectedDriver.deliveryLat), Number(selectedDriver.deliveryLng)],
|
|
5584
5623
|
icon: destinationIcon
|
|
5585
|
-
},
|
|
5586
|
-
lat: selectedDriver.deliveryLat,
|
|
5587
|
-
lng: selectedDriver.deliveryLng
|
|
5588
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
5589
|
-
style: {
|
|
5590
|
-
fontSize: "11px",
|
|
5591
|
-
color: "#666",
|
|
5592
|
-
marginTop: "4px"
|
|
5593
|
-
}
|
|
5594
|
-
}, "Driver: #", selectedDriver.driverId.substring(0, 8), "...")))), showRoutes && selectedDriver && selectedDriver.lat && selectedDriver.lng && selectedDriver.deliveryLat && selectedDriver.deliveryLng && /*#__PURE__*/React.createElement(RouteLayer, {
|
|
5624
|
+
}), showRoutes && selectedDriver && selectedDriver.lat && selectedDriver.lng && selectedDriver.deliveryLat && selectedDriver.deliveryLng && /*#__PURE__*/React.createElement(RouteLayer, {
|
|
5595
5625
|
start: {
|
|
5596
5626
|
lat: selectedDriver.lat,
|
|
5597
5627
|
lng: selectedDriver.lng
|
|
@@ -5619,7 +5649,8 @@ function LiveTrackingSystem() {
|
|
|
5619
5649
|
}, selectedDriver && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
|
|
5620
5650
|
onClick: () => {
|
|
5621
5651
|
if (selectedDriver !== null && selectedDriver !== void 0 && selectedDriver.lat && selectedDriver !== null && selectedDriver !== void 0 && selectedDriver.lng) {
|
|
5622
|
-
|
|
5652
|
+
const center = [Number(selectedDriver.lat), Number(selectedDriver.lng)];
|
|
5653
|
+
setMapCenter(center);
|
|
5623
5654
|
setMapZoom(15);
|
|
5624
5655
|
}
|
|
5625
5656
|
},
|
|
@@ -5634,7 +5665,7 @@ function LiveTrackingSystem() {
|
|
|
5634
5665
|
fontWeight: "500",
|
|
5635
5666
|
whiteSpace: "nowrap"
|
|
5636
5667
|
}
|
|
5637
|
-
}, "
|
|
5668
|
+
}, t("WT_CENTER")), /*#__PURE__*/React.createElement("button", {
|
|
5638
5669
|
onClick: () => setSelectedDriver(null),
|
|
5639
5670
|
style: {
|
|
5640
5671
|
padding: isMobile ? "10px 12px" : "8px 16px",
|
|
@@ -5647,7 +5678,7 @@ function LiveTrackingSystem() {
|
|
|
5647
5678
|
fontWeight: "500",
|
|
5648
5679
|
whiteSpace: "nowrap"
|
|
5649
5680
|
}
|
|
5650
|
-
}, "
|
|
5681
|
+
}, t("WT_CLEAR"))), !selectedDriver && /*#__PURE__*/React.createElement("div", {
|
|
5651
5682
|
style: {
|
|
5652
5683
|
padding: isMobile ? "10px 12px" : "8px 16px",
|
|
5653
5684
|
background: "#f5f5f5",
|
|
@@ -5682,23 +5713,61 @@ function LiveTrackingSystem() {
|
|
|
5682
5713
|
color: "#667eea",
|
|
5683
5714
|
fontSize: isMobile ? "14px" : "16px"
|
|
5684
5715
|
}
|
|
5685
|
-
}, "
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
color: "white",
|
|
5689
|
-
padding: "2px 8px",
|
|
5690
|
-
borderRadius: "12px",
|
|
5691
|
-
fontSize: isMobile ? "10px" : "11px",
|
|
5692
|
-
fontWeight: "bold"
|
|
5693
|
-
}
|
|
5694
|
-
}, selectedDriver.isOnline ? "ONLINE" : "OFFLINE")), /*#__PURE__*/React.createElement("div", {
|
|
5716
|
+
}, t("WT_SELECTED_DRIVER")), /*#__PURE__*/React.createElement(StatusBadge, {
|
|
5717
|
+
isOnline: selectedDriver.isOnline
|
|
5718
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
5695
5719
|
style: {
|
|
5696
5720
|
fontSize: isMobile ? "12px" : "13px"
|
|
5697
5721
|
}
|
|
5698
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, "
|
|
5722
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, t("WT_ID"), ":"), " ", selectedDriver.driverId.substring(0, 6).toUpperCase(), "..."), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, t("WT_LOCATION"), ":"), " ", /*#__PURE__*/React.createElement(Address, {
|
|
5699
5723
|
lat: selectedDriver.lat,
|
|
5700
5724
|
lng: selectedDriver.lng
|
|
5701
|
-
})), selectedDriver.speed && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, "
|
|
5725
|
+
})), selectedDriver.speed && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, t("WT_SPEED"), ":"), " ", Math.round(selectedDriver.speed * 3.6), " ", t("km/h")), selectedDriver.lastSeen && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, t("WT_LAST_SEEN"), ":"), " ", new Date(selectedDriver.lastSeen).toLocaleTimeString()))), /*#__PURE__*/React.createElement("div", {
|
|
5726
|
+
style: {
|
|
5727
|
+
position: "absolute",
|
|
5728
|
+
top: "20px",
|
|
5729
|
+
left: "20px",
|
|
5730
|
+
zIndex: 1000,
|
|
5731
|
+
display: "flex",
|
|
5732
|
+
flexDirection: "column",
|
|
5733
|
+
gap: "8px"
|
|
5734
|
+
}
|
|
5735
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
5736
|
+
onClick: () => setMapZoom(prev => prev + 1),
|
|
5737
|
+
style: {
|
|
5738
|
+
width: "32px",
|
|
5739
|
+
height: "32px",
|
|
5740
|
+
background: "white",
|
|
5741
|
+
border: "1px solid #e0e0e0",
|
|
5742
|
+
borderRadius: "4px",
|
|
5743
|
+
fontSize: "18px",
|
|
5744
|
+
fontWeight: "700",
|
|
5745
|
+
cursor: "pointer",
|
|
5746
|
+
boxShadow: "0 2px 4px rgba(0,0,0,0.1)"
|
|
5747
|
+
}
|
|
5748
|
+
}, "+"), /*#__PURE__*/React.createElement("button", {
|
|
5749
|
+
onClick: () => setMapZoom(prev => prev - 1),
|
|
5750
|
+
style: {
|
|
5751
|
+
width: "32px",
|
|
5752
|
+
height: "32px",
|
|
5753
|
+
background: "white",
|
|
5754
|
+
border: "1px solid #e0e0e0",
|
|
5755
|
+
borderRadius: "4px",
|
|
5756
|
+
fontSize: "18px",
|
|
5757
|
+
fontWeight: "700",
|
|
5758
|
+
cursor: "pointer",
|
|
5759
|
+
boxShadow: "0 2px 4px rgba(0,0,0,0.1)"
|
|
5760
|
+
}
|
|
5761
|
+
}, "\u2212")), /*#__PURE__*/React.createElement("div", {
|
|
5762
|
+
style: {
|
|
5763
|
+
position: "absolute",
|
|
5764
|
+
top: "20px",
|
|
5765
|
+
right: "20px",
|
|
5766
|
+
zIndex: 1000,
|
|
5767
|
+
display: "flex",
|
|
5768
|
+
gap: "12px"
|
|
5769
|
+
}
|
|
5770
|
+
}))));
|
|
5702
5771
|
}
|
|
5703
5772
|
|
|
5704
5773
|
const AddFillingPointMetaData = ({
|
|
@@ -6234,7 +6303,7 @@ const AddFixPointAddress = () => {
|
|
|
6234
6303
|
const searchFilters = React.useMemo(() => ({
|
|
6235
6304
|
tenantId,
|
|
6236
6305
|
filters: {
|
|
6237
|
-
|
|
6306
|
+
id: editId
|
|
6238
6307
|
}
|
|
6239
6308
|
}), [tenantId, editId]);
|
|
6240
6309
|
const searchConfig = React.useMemo(() => ({
|
|
@@ -6247,7 +6316,10 @@ const AddFixPointAddress = () => {
|
|
|
6247
6316
|
const [isDataFetched, setIsDataFetched] = useState(false);
|
|
6248
6317
|
useEffect(() => {
|
|
6249
6318
|
if (editId && editData !== null && editData !== void 0 && editData.waterTankerBookingDetail && !isDataFetched) {
|
|
6250
|
-
const data = editData.waterTankerBookingDetail.find(item =>
|
|
6319
|
+
const data = editData.waterTankerBookingDetail.find(item => {
|
|
6320
|
+
var _item$applicantDetail;
|
|
6321
|
+
return ((_item$applicantDetail = item.applicantDetail) === null || _item$applicantDetail === void 0 ? void 0 : _item$applicantDetail.applicantId) === editId;
|
|
6322
|
+
});
|
|
6251
6323
|
if (data) {
|
|
6252
6324
|
var _data$applicantDetail, _data$applicantDetail2, _data$applicantDetail3, _data$applicantDetail4, _data$applicantDetail5, _data$address, _data$address2;
|
|
6253
6325
|
setFormData({
|
|
@@ -6643,7 +6715,6 @@ const LocalityModal = ({
|
|
|
6643
6715
|
};
|
|
6644
6716
|
|
|
6645
6717
|
const SearchFillingPointAddress = () => {
|
|
6646
|
-
var _fixedPointData$water, _fillingPointData$fil;
|
|
6647
6718
|
const {
|
|
6648
6719
|
t
|
|
6649
6720
|
} = useTranslation();
|
|
@@ -6660,7 +6731,7 @@ const SearchFillingPointAddress = () => {
|
|
|
6660
6731
|
const [showLocalityModal, setShowLocalityModal] = useState(false);
|
|
6661
6732
|
const [selectedLocalityRow, setSelectedLocalityRow] = useState(null);
|
|
6662
6733
|
const [modalMode, setModalMode] = useState("ADD");
|
|
6663
|
-
const [pageSize, setPageSize] = useState(
|
|
6734
|
+
const [pageSize, setPageSize] = useState(50);
|
|
6664
6735
|
const [pageOffset, setPageOffset] = useState(0);
|
|
6665
6736
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
6666
6737
|
const closeToast = () => {
|
|
@@ -6876,12 +6947,12 @@ const SearchFillingPointAddress = () => {
|
|
|
6876
6947
|
Cell: ({
|
|
6877
6948
|
row
|
|
6878
6949
|
}) => {
|
|
6879
|
-
var _row$original$applica2;
|
|
6950
|
+
var _row$original$applica2, _row$original$applica3;
|
|
6880
6951
|
return /*#__PURE__*/React.createElement("span", {
|
|
6881
6952
|
className: "link"
|
|
6882
6953
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
6883
|
-
to: `/digit-ui/employee/wt/add-fix-point-address?id=${row.original.
|
|
6884
|
-
}, ((_row$original$
|
|
6954
|
+
to: `/digit-ui/employee/wt/add-fix-point-address?id=${(_row$original$applica2 = row.original.applicantDetail) === null || _row$original$applica2 === void 0 ? void 0 : _row$original$applica2.applicantId}`
|
|
6955
|
+
}, ((_row$original$applica3 = row.original.applicantDetail) === null || _row$original$applica3 === void 0 ? void 0 : _row$original$applica3.name) || "NA"));
|
|
6885
6956
|
}
|
|
6886
6957
|
}, {
|
|
6887
6958
|
Header: t("WT_MOBILE_NUMBER"),
|
|
@@ -7036,8 +7107,7 @@ const SearchFillingPointAddress = () => {
|
|
|
7036
7107
|
const handlePageSizeChange = e => {
|
|
7037
7108
|
setPageSize(Number(e.target.value));
|
|
7038
7109
|
};
|
|
7039
|
-
const
|
|
7040
|
-
const fillingLength = (fillingPointData === null || fillingPointData === void 0 ? void 0 : (_fillingPointData$fil = fillingPointData.fillingPoints) === null || _fillingPointData$fil === void 0 ? void 0 : _fillingPointData$fil.length) || 0;
|
|
7110
|
+
const totalCount = Number(selectedTab === "FIXED_POINT" ? (fixedPointData === null || fixedPointData === void 0 ? void 0 : fixedPointData.Count) ?? (fixedPointData === null || fixedPointData === void 0 ? void 0 : fixedPointData.count) ?? (fixedPointData === null || fixedPointData === void 0 ? void 0 : fixedPointData.totalCount) ?? 0 : (fillingPointData === null || fillingPointData === void 0 ? void 0 : fillingPointData.Count) ?? (fillingPointData === null || fillingPointData === void 0 ? void 0 : fillingPointData.count) ?? (fillingPointData === null || fillingPointData === void 0 ? void 0 : fillingPointData.totalCount) ?? 0);
|
|
7041
7111
|
const applyFixedPointMappedFilter = React.useCallback((rows = []) => {
|
|
7042
7112
|
if (selectedTab !== "FIXED_POINT" || !(appliedFixedPointStatus !== null && appliedFixedPointStatus !== void 0 && appliedFixedPointStatus.code)) return rows;
|
|
7043
7113
|
return rows.filter(item => {
|
|
@@ -7195,20 +7265,16 @@ const SearchFillingPointAddress = () => {
|
|
|
7195
7265
|
select: setStatus,
|
|
7196
7266
|
t: t
|
|
7197
7267
|
})), /*#__PURE__*/React.createElement("div", {
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
justifyContent: isMobile ? "center" : "flex-end",
|
|
7202
|
-
flexDirection: isMobile ? "column-reverse" : "row",
|
|
7203
|
-
gap: "16px"
|
|
7204
|
-
}
|
|
7205
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
7206
|
-
className: "clear-search",
|
|
7268
|
+
className: "finance-mainlayout-col1"
|
|
7269
|
+
}, /*#__PURE__*/React.createElement(Label, null, "\xA0"), /*#__PURE__*/React.createElement("span", {
|
|
7270
|
+
className: "generic-button clear-search",
|
|
7207
7271
|
onClick: clearSearch,
|
|
7208
7272
|
style: {
|
|
7209
7273
|
alignSelf: "center"
|
|
7210
7274
|
}
|
|
7211
|
-
}, t("ES_COMMON_CLEAR_SEARCH")), /*#__PURE__*/React.createElement(
|
|
7275
|
+
}, t("ES_COMMON_CLEAR_SEARCH"))), /*#__PURE__*/React.createElement("div", {
|
|
7276
|
+
className: "finance-mainlayout-col1"
|
|
7277
|
+
}, /*#__PURE__*/React.createElement(Label, null, "\xA0"), /*#__PURE__*/React.createElement(SubmitBar, {
|
|
7212
7278
|
label: t("ES_COMMON_SEARCH"),
|
|
7213
7279
|
onSubmit: onSearch
|
|
7214
7280
|
})))), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(ApplicationTable, {
|
|
@@ -7235,7 +7301,8 @@ const SearchFillingPointAddress = () => {
|
|
|
7235
7301
|
onNextPage: fetchNextPage,
|
|
7236
7302
|
onPrevPage: fetchPrevPage,
|
|
7237
7303
|
pageSizeLimit: pageSize,
|
|
7238
|
-
totalRecords:
|
|
7304
|
+
totalRecords: totalCount,
|
|
7305
|
+
isPaginationRequired: true,
|
|
7239
7306
|
showPagination: true,
|
|
7240
7307
|
showPageSizeOptions: true,
|
|
7241
7308
|
isSearchRequired: false,
|
|
@@ -7311,7 +7378,7 @@ const SelectServiceType = ({
|
|
|
7311
7378
|
return /*#__PURE__*/React.createElement(Loader, null);
|
|
7312
7379
|
}
|
|
7313
7380
|
if ((userType === null || userType === void 0 ? void 0 : userType.toLowerCase()) === "employee") {
|
|
7314
|
-
return /*#__PURE__*/React.createElement(
|
|
7381
|
+
return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, config.label), /*#__PURE__*/React.createElement(Dropdown, {
|
|
7315
7382
|
className: "payment-form-text-input-correction",
|
|
7316
7383
|
isMandatory: config.isMandatory,
|
|
7317
7384
|
selected: serviceTypes,
|
|
@@ -7333,6 +7400,7 @@ const VendorAssign = ({
|
|
|
7333
7400
|
const {
|
|
7334
7401
|
t
|
|
7335
7402
|
} = useTranslation();
|
|
7403
|
+
const history = useHistory();
|
|
7336
7404
|
const [showToast, setShowToast] = useState(null);
|
|
7337
7405
|
const [vendor, setVendor] = useState(null);
|
|
7338
7406
|
const [validFrom, setValidFrom] = useState("");
|
|
@@ -7399,6 +7467,9 @@ const VendorAssign = ({
|
|
|
7399
7467
|
isError: false,
|
|
7400
7468
|
label: t("ES_COMMON_SAVE_SUCCESS")
|
|
7401
7469
|
});
|
|
7470
|
+
setTimeout(() => {
|
|
7471
|
+
history.push("/digit-ui/employee/vendor/search-vendor");
|
|
7472
|
+
}, 3000);
|
|
7402
7473
|
},
|
|
7403
7474
|
onError: err => {
|
|
7404
7475
|
var _err$response, _err$response$data, _err$response$data$Er, _err$response$data$Er2;
|
|
@@ -7529,6 +7600,7 @@ const EmployeeApp = ({
|
|
|
7529
7600
|
t
|
|
7530
7601
|
} = useTranslation();
|
|
7531
7602
|
const location = useLocation();
|
|
7603
|
+
const fixedPointInboxLabel = t("WT_FIXED_POINT") !== "WT_FIXED_POINT" ? `${t("WT_FIXED_POINT")} ${t("ES_COMMON_INBOX")}` : "Fixed Point Inbox";
|
|
7532
7604
|
sessionStorage.removeItem("revalidateddone");
|
|
7533
7605
|
const getDynamicBreadcrumbs = () => {
|
|
7534
7606
|
const pathname = location.pathname;
|
|
@@ -7542,7 +7614,11 @@ const EmployeeApp = ({
|
|
|
7542
7614
|
label: t("WT_MODULE_NAME"),
|
|
7543
7615
|
path: `/digit-ui/employee/module/details?moduleName=${moduleName}`
|
|
7544
7616
|
}];
|
|
7545
|
-
if (pathname.includes("/inbox")) {
|
|
7617
|
+
if (pathname.includes("/fixed-point/inbox")) {
|
|
7618
|
+
crumbs.push({
|
|
7619
|
+
label: fixedPointInboxLabel
|
|
7620
|
+
});
|
|
7621
|
+
} else if (pathname.includes("/inbox")) {
|
|
7546
7622
|
let label = "ES_COMMON_INBOX";
|
|
7547
7623
|
if (pathname.includes("/tp/inbox")) label = "TP_INBOX";
|
|
7548
7624
|
crumbs.push({
|
|
@@ -7559,6 +7635,14 @@ const EmployeeApp = ({
|
|
|
7559
7635
|
crumbs.push({
|
|
7560
7636
|
label: t("WT_REQUEST_SERVICE")
|
|
7561
7637
|
});
|
|
7638
|
+
} else if (pathname.includes("/fixed-point/booking-details")) {
|
|
7639
|
+
crumbs.push({
|
|
7640
|
+
label: fixedPointInboxLabel,
|
|
7641
|
+
path: `${path}/fixed-point/inbox`
|
|
7642
|
+
});
|
|
7643
|
+
crumbs.push({
|
|
7644
|
+
label: t("WT_BOOKING_DETAILS")
|
|
7645
|
+
});
|
|
7562
7646
|
} else if (pathname.includes("/booking-details") || pathname.includes("/bookingsearch/booking-details")) {
|
|
7563
7647
|
const isSearch = pathname.includes("/bookingsearch");
|
|
7564
7648
|
if (isSearch) {
|
|
@@ -7635,6 +7719,17 @@ const EmployeeApp = ({
|
|
|
7635
7719
|
locality: []
|
|
7636
7720
|
}
|
|
7637
7721
|
};
|
|
7722
|
+
const inboxInitialStateFixedPoint = {
|
|
7723
|
+
searchParams: {
|
|
7724
|
+
uuid: {
|
|
7725
|
+
code: "ASSIGNED_TO_ALL",
|
|
7726
|
+
name: "ES_INBOX_ASSIGNED_TO_ALL"
|
|
7727
|
+
},
|
|
7728
|
+
services: ["watertanker-fixedpoint"],
|
|
7729
|
+
applicationStatus: [],
|
|
7730
|
+
locality: []
|
|
7731
|
+
}
|
|
7732
|
+
};
|
|
7638
7733
|
const ApplicationDetails = (_Digit = Digit) === null || _Digit === void 0 ? void 0 : (_Digit$ComponentRegis = _Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("ApplicationDetails");
|
|
7639
7734
|
const WTCreate = (_Digit2 = Digit) === null || _Digit2 === void 0 ? void 0 : (_Digit2$ComponentRegi = _Digit2.ComponentRegistryService) === null || _Digit2$ComponentRegi === void 0 ? void 0 : _Digit2$ComponentRegi.getComponent("WTCreate");
|
|
7640
7735
|
return /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -7660,6 +7755,18 @@ const EmployeeApp = ({
|
|
|
7660
7755
|
initialStates: inboxInitialState,
|
|
7661
7756
|
isInbox: true
|
|
7662
7757
|
}))
|
|
7758
|
+
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
7759
|
+
path: `${path}/fixed-point/inbox`,
|
|
7760
|
+
component: props => /*#__PURE__*/React.createElement(Inbox, Object.assign({}, props, {
|
|
7761
|
+
useNewInboxAPI: true,
|
|
7762
|
+
parentRoute: path,
|
|
7763
|
+
businessService: "watertanker-fixedpoint",
|
|
7764
|
+
detailRoute: `${path}/fixed-point/booking-details`,
|
|
7765
|
+
moduleCode: "WT",
|
|
7766
|
+
filterComponent: "WT_INBOX_FILTER",
|
|
7767
|
+
initialStates: inboxInitialStateFixedPoint,
|
|
7768
|
+
isInbox: true
|
|
7769
|
+
}))
|
|
7663
7770
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
7664
7771
|
path: `${path}/mt/inbox`,
|
|
7665
7772
|
component: props => /*#__PURE__*/React.createElement(Inbox, Object.assign({}, props, {
|
|
@@ -7691,6 +7798,11 @@ const EmployeeApp = ({
|
|
|
7691
7798
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
7692
7799
|
path: `${path}/tp/request-service`,
|
|
7693
7800
|
component: WTCreate
|
|
7801
|
+
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
7802
|
+
path: `${path}/fixed-point/booking-details/:id`,
|
|
7803
|
+
component: props => /*#__PURE__*/React.createElement(ApplicationDetails, Object.assign({}, props, {
|
|
7804
|
+
parentRoute: path
|
|
7805
|
+
}))
|
|
7694
7806
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
7695
7807
|
path: `${path}/booking-details/:id`,
|
|
7696
7808
|
component: props => /*#__PURE__*/React.createElement(ApplicationDetails, Object.assign({}, props, {
|
|
@@ -14733,7 +14845,7 @@ const TableConfig = t => ({
|
|
|
14733
14845
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
|
|
14734
14846
|
className: "link"
|
|
14735
14847
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
14736
|
-
to: `${props.parentRoute}/booking-details
|
|
14848
|
+
to: `${props.detailRoute || `${props.parentRoute}/booking-details`}/${row === null || row === void 0 ? void 0 : (_row$original = row.original) === null || _row$original === void 0 ? void 0 : (_row$original$searchD = _row$original.searchData) === null || _row$original$searchD === void 0 ? void 0 : _row$original$searchD["bookingNo"]}`
|
|
14737
14849
|
}, (_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : (_row$original2$search = _row$original2.searchData) === null || _row$original2$search === void 0 ? void 0 : _row$original2$search["bookingNo"])));
|
|
14738
14850
|
},
|
|
14739
14851
|
mobileCell: original => {
|