@djb25/digit-ui-module-wt 1.0.24 → 1.0.26
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 +906 -628
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TickMark, ArrowDown, MobileNumber, CardLabelError, TextInput, Dropdown, DatePicker, SubmitBar, Card, Table, Loader, Toast, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, HomeIcon, KeyNote, Modal, CardHeader, FormStep, CardLabel, RadioButtons, UploadFile, TextArea, CheckBox, CardSubHeader, StatusTable, Row, GenericFileIcon, LinkButton, EditIcon, Banner, CHBIcon, EmployeeModuleCard, CloseSvg, Label, LinkLabel, ActionBar, DetailsCard, SearchAction, FilterAction, PopUp, ShippingTruck, CustomNameDropdown, MultiSelectDropdown, LabelFieldPair, AddIcon, Menu, Header, TelePhone, DisplayPhotos, CardSectionHeader, CheckPoint, ConnectingCheckPoints, MultiLink, Localities, RemoveableTag, FormComposer, PDFSvg, MultiUploadWrapper, Close as Close$g, BreakLine, InfoBannerIcon, ViewsIcon, ButtonSelector, LocationIcon, CitizenHomeCard, PTIcon, ApplicantDetails, AddressDetails } from '@djb25/digit-ui-react-components';
|
|
2
|
-
import React, { useState, useMemo, useCallback,
|
|
1
|
+
import { TickMark, ArrowDown, MobileNumber, CardLabelError, TextInput, Dropdown, DatePicker, SubmitBar, Card, Table, Loader, Toast, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, HomeIcon, KeyNote, Modal, CardHeader, FormStep, CardLabel, RadioButtons, UploadFile, TextArea, CheckBox, CardSubHeader, StatusTable, Row, GenericFileIcon, LinkButton, EditIcon, Banner, CHBIcon, EmployeeModuleCard, CloseSvg, Label, LinkLabel, ActionBar, DetailsCard, SearchAction, FilterAction, PopUp, ShippingTruck, CustomNameDropdown, MultiSelectDropdown, CollapsibleCardPage as CollapsibleCardPage$1, LabelFieldPair, AddIcon, Menu, Header, TelePhone, DisplayPhotos, CardSectionHeader, CheckPoint, ConnectingCheckPoints, MultiLink, Localities, RemoveableTag, FormComposer, PDFSvg, MultiUploadWrapper, Close as Close$g, BreakLine, InfoBannerIcon, ViewsIcon, ButtonSelector, LocationIcon, CitizenHomeCard, PTIcon, ApplicantDetails, AddressDetails } from '@djb25/digit-ui-react-components';
|
|
2
|
+
import React, { useRef, useEffect, useState, useMemo, useCallback, Fragment } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { useLocation, useRouteMatch, useHistory, Switch, Route, Redirect, Link, useParams } from 'react-router-dom';
|
|
5
5
|
import { useQueryClient } from 'react-query';
|
|
@@ -355,6 +355,20 @@ const WTCreate = () => {
|
|
|
355
355
|
const WTAcknowledgement = (_Digit2 = Digit) === null || _Digit2 === void 0 ? void 0 : (_Digit2$ComponentRegi = _Digit2.ComponentRegistryService) === null || _Digit2$ComponentRegi === void 0 ? void 0 : _Digit2$ComponentRegi.getComponent("WTAcknowledgement");
|
|
356
356
|
const MTAcknowledgement = (_Digit3 = Digit) === null || _Digit3 === void 0 ? void 0 : (_Digit3$ComponentRegi = _Digit3.ComponentRegistryService) === null || _Digit3$ComponentRegi === void 0 ? void 0 : _Digit3$ComponentRegi.getComponent("MTAcknowledgement");
|
|
357
357
|
const TPAcknowledgement = (_Digit4 = Digit) === null || _Digit4 === void 0 ? void 0 : (_Digit4$ComponentRegi = _Digit4.ComponentRegistryService) === null || _Digit4$ComponentRegi === void 0 ? void 0 : _Digit4$ComponentRegi.getComponent("TPAcknowledgement");
|
|
358
|
+
const formStepRoutes = ["applicant-details", "address-details", "request-details", "toiletRequest-details", "treePruningRequest-details"];
|
|
359
|
+
const isFormStep = formStepRoutes.some(route => pathname.includes(route));
|
|
360
|
+
const sectionRefs = useRef({});
|
|
361
|
+
useEffect(() => {
|
|
362
|
+
if (isFormStep) {
|
|
363
|
+
const currentRoute = pathname.split("/").pop();
|
|
364
|
+
if (sectionRefs.current[currentRoute]) {
|
|
365
|
+
sectionRefs.current[currentRoute].scrollIntoView({
|
|
366
|
+
behavior: "smooth",
|
|
367
|
+
block: "start"
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}, [pathname, isFormStep]);
|
|
358
372
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
359
373
|
className: "employee-form-section-wrapper"
|
|
360
374
|
}, !pathname.includes("/info") && /*#__PURE__*/React.createElement(VerticalTimeline, {
|
|
@@ -362,32 +376,7 @@ const WTCreate = () => {
|
|
|
362
376
|
showFinalStep: true
|
|
363
377
|
}), /*#__PURE__*/React.createElement("div", {
|
|
364
378
|
className: "employee-form-section"
|
|
365
|
-
}, /*#__PURE__*/React.createElement(Switch, null,
|
|
366
|
-
var _userDetails$user;
|
|
367
|
-
const {
|
|
368
|
-
component,
|
|
369
|
-
texts,
|
|
370
|
-
inputs,
|
|
371
|
-
key,
|
|
372
|
-
additionaFields
|
|
373
|
-
} = routeObj;
|
|
374
|
-
const Component = typeof component === "string" ? Digit.ComponentRegistryService.getComponent(component) : component;
|
|
375
|
-
return /*#__PURE__*/React.createElement(Route, {
|
|
376
|
-
path: `${match.path}/${routeObj.route}`,
|
|
377
|
-
key: index
|
|
378
|
-
}, /*#__PURE__*/React.createElement(Component, {
|
|
379
|
-
config: {
|
|
380
|
-
texts,
|
|
381
|
-
inputs,
|
|
382
|
-
key,
|
|
383
|
-
additionaFields
|
|
384
|
-
},
|
|
385
|
-
onSelect: handleSelect,
|
|
386
|
-
t: t,
|
|
387
|
-
formData: params,
|
|
388
|
-
userDetails: userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$user = userDetails.user) === null || _userDetails$user === void 0 ? void 0 : _userDetails$user[0]
|
|
389
|
-
}));
|
|
390
|
-
}), /*#__PURE__*/React.createElement(Route, {
|
|
379
|
+
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
|
|
391
380
|
path: `${match.path}/check`
|
|
392
381
|
}, /*#__PURE__*/React.createElement(CheckPage, {
|
|
393
382
|
onSubmit: wt_create,
|
|
@@ -407,7 +396,68 @@ const WTCreate = () => {
|
|
|
407
396
|
}, /*#__PURE__*/React.createElement(TPAcknowledgement, {
|
|
408
397
|
data: params,
|
|
409
398
|
onSuccess: onSuccess
|
|
410
|
-
})),
|
|
399
|
+
})), config.map((routeObj, index) => {
|
|
400
|
+
if (!formStepRoutes.includes(routeObj.route)) {
|
|
401
|
+
var _userDetails$user;
|
|
402
|
+
const {
|
|
403
|
+
component,
|
|
404
|
+
texts,
|
|
405
|
+
inputs,
|
|
406
|
+
key,
|
|
407
|
+
additionaFields
|
|
408
|
+
} = routeObj;
|
|
409
|
+
const Component = typeof component === "string" ? Digit.ComponentRegistryService.getComponent(component) : component;
|
|
410
|
+
return /*#__PURE__*/React.createElement(Route, {
|
|
411
|
+
path: `${match.path}/${routeObj.route}`,
|
|
412
|
+
key: index
|
|
413
|
+
}, /*#__PURE__*/React.createElement(Component, {
|
|
414
|
+
config: {
|
|
415
|
+
texts,
|
|
416
|
+
inputs,
|
|
417
|
+
key,
|
|
418
|
+
additionaFields
|
|
419
|
+
},
|
|
420
|
+
onSelect: handleSelect,
|
|
421
|
+
t: t,
|
|
422
|
+
formData: params,
|
|
423
|
+
userDetails: userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$user = userDetails.user) === null || _userDetails$user === void 0 ? void 0 : _userDetails$user[0]
|
|
424
|
+
}));
|
|
425
|
+
}
|
|
426
|
+
return null;
|
|
427
|
+
}), /*#__PURE__*/React.createElement(Route, {
|
|
428
|
+
path: formStepRoutes.map(route => `${match.path}/${route}`)
|
|
429
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
430
|
+
className: "single-page-form-container"
|
|
431
|
+
}, config.filter(routeObj => formStepRoutes.includes(routeObj.route)).map((routeObj, index) => {
|
|
432
|
+
var _params$serviceType5, _params$serviceType5$, _userDetails$user2;
|
|
433
|
+
const {
|
|
434
|
+
component,
|
|
435
|
+
texts,
|
|
436
|
+
inputs,
|
|
437
|
+
key,
|
|
438
|
+
additionaFields
|
|
439
|
+
} = routeObj;
|
|
440
|
+
const Component = typeof component === "string" ? Digit.ComponentRegistryService.getComponent(component) : component;
|
|
441
|
+
const code = params === null || params === void 0 ? void 0 : (_params$serviceType5 = params.serviceType) === null || _params$serviceType5 === void 0 ? void 0 : (_params$serviceType5$ = _params$serviceType5.serviceType) === null || _params$serviceType5$ === void 0 ? void 0 : _params$serviceType5$.code;
|
|
442
|
+
if (routeObj.route === "request-details" && code !== "WT") return null;
|
|
443
|
+
if (routeObj.route === "toiletRequest-details" && code !== "MobileToilet") return null;
|
|
444
|
+
if (routeObj.route === "treePruningRequest-details" && code !== "TREE_PRUNING") return null;
|
|
445
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
446
|
+
key: index,
|
|
447
|
+
ref: el => sectionRefs.current[routeObj.route] = el,
|
|
448
|
+
className: "form-section-unit"
|
|
449
|
+
}, /*#__PURE__*/React.createElement(Component, {
|
|
450
|
+
config: {
|
|
451
|
+
...routeObj,
|
|
452
|
+
isCollapsible: true,
|
|
453
|
+
defaultOpen: true
|
|
454
|
+
},
|
|
455
|
+
onSelect: handleSelect,
|
|
456
|
+
t: t,
|
|
457
|
+
formData: params,
|
|
458
|
+
userDetails: userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$user2 = userDetails.user) === null || _userDetails$user2 === void 0 ? void 0 : _userDetails$user2[0]
|
|
459
|
+
}));
|
|
460
|
+
}))), /*#__PURE__*/React.createElement(Route, null, /*#__PURE__*/React.createElement(Redirect, {
|
|
411
461
|
to: `${match.path}/${config.indexRoute}`
|
|
412
462
|
}))))));
|
|
413
463
|
};
|
|
@@ -2299,14 +2349,12 @@ const WTCard = () => {
|
|
|
2299
2349
|
const {
|
|
2300
2350
|
t
|
|
2301
2351
|
} = useTranslation();
|
|
2302
|
-
const
|
|
2352
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
2303
2353
|
const {
|
|
2304
|
-
data,
|
|
2305
|
-
isLoading
|
|
2306
|
-
isFetching,
|
|
2307
|
-
isSuccess
|
|
2354
|
+
data: citizenInboxData,
|
|
2355
|
+
isLoading: isCitizenInboxLoading
|
|
2308
2356
|
} = Digit.Hooks.useNewInboxGeneral({
|
|
2309
|
-
tenantId
|
|
2357
|
+
tenantId,
|
|
2310
2358
|
ModuleCode: "WT",
|
|
2311
2359
|
filters: {
|
|
2312
2360
|
limit: 10,
|
|
@@ -2323,13 +2371,39 @@ const WTCard = () => {
|
|
|
2323
2371
|
enabled: Digit.Utils.wtAccess()
|
|
2324
2372
|
}
|
|
2325
2373
|
});
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2374
|
+
const {
|
|
2375
|
+
data: fixedPointInboxData,
|
|
2376
|
+
isLoading: isFixedPointInboxLoading
|
|
2377
|
+
} = Digit.Hooks.useNewInboxGeneral({
|
|
2378
|
+
tenantId,
|
|
2379
|
+
ModuleCode: "WT",
|
|
2380
|
+
filters: {
|
|
2381
|
+
limit: 10,
|
|
2382
|
+
offset: 0,
|
|
2383
|
+
services: ["watertanker-fixedpoint"]
|
|
2384
|
+
},
|
|
2385
|
+
config: {
|
|
2386
|
+
select: data => {
|
|
2387
|
+
return {
|
|
2388
|
+
totalCount: data === null || data === void 0 ? void 0 : data.totalCount,
|
|
2389
|
+
nearingSlaCount: data === null || data === void 0 ? void 0 : data.nearingSlaCount
|
|
2390
|
+
} || "-";
|
|
2391
|
+
},
|
|
2392
|
+
enabled: Digit.Utils.wtAccess()
|
|
2393
|
+
}
|
|
2394
|
+
});
|
|
2395
|
+
const citizenInboxCount = isCitizenInboxLoading ? "-" : (citizenInboxData === null || citizenInboxData === void 0 ? void 0 : citizenInboxData.totalCount) ?? 0;
|
|
2396
|
+
const fixedPointInboxCount = isFixedPointInboxLoading ? "-" : (fixedPointInboxData === null || fixedPointInboxData === void 0 ? void 0 : fixedPointInboxData.totalCount) ?? 0;
|
|
2329
2397
|
const links = [{
|
|
2330
|
-
count:
|
|
2398
|
+
count: citizenInboxCount,
|
|
2331
2399
|
label: t("ES_COMMON_INBOX"),
|
|
2400
|
+
subLabel: t("CITIZEN"),
|
|
2332
2401
|
link: `${APPLICATION_PATH}/employee/wt/inbox`
|
|
2402
|
+
}, {
|
|
2403
|
+
count: fixedPointInboxCount,
|
|
2404
|
+
label: t("ES_COMMON_INBOX"),
|
|
2405
|
+
subLabel: t("FIXED_POINT"),
|
|
2406
|
+
link: `${APPLICATION_PATH}/employee/wt/fixed-point/inbox`
|
|
2333
2407
|
}, {
|
|
2334
2408
|
label: t("ES_COMMON_APPLICATION_SEARCH"),
|
|
2335
2409
|
link: `${APPLICATION_PATH}/employee/wt/my-bookings`
|
|
@@ -2354,7 +2428,7 @@ const WTCard = () => {
|
|
|
2354
2428
|
Icon: /*#__PURE__*/React.createElement(CHBIcon, null),
|
|
2355
2429
|
moduleName: t("WT_MODULE_NAME"),
|
|
2356
2430
|
kpis: [{
|
|
2357
|
-
count:
|
|
2431
|
+
count: citizenInboxCount,
|
|
2358
2432
|
label: t("ES_TITLE_INBOX"),
|
|
2359
2433
|
link: `${APPLICATION_PATH}/employee/wt/inbox`
|
|
2360
2434
|
}],
|
|
@@ -3064,6 +3138,7 @@ const Inbox = ({
|
|
|
3064
3138
|
useNewInboxAPI,
|
|
3065
3139
|
parentRoute,
|
|
3066
3140
|
moduleCode,
|
|
3141
|
+
detailRoute,
|
|
3067
3142
|
initialStates: _initialStates = {},
|
|
3068
3143
|
filterComponent,
|
|
3069
3144
|
isInbox,
|
|
@@ -3290,6 +3365,7 @@ const Inbox = ({
|
|
|
3290
3365
|
}
|
|
3291
3366
|
}, /*#__PURE__*/React.createElement(WTDesktopInbox, {
|
|
3292
3367
|
moduleCode: moduleCode,
|
|
3368
|
+
detailRoute: detailRoute,
|
|
3293
3369
|
data: data,
|
|
3294
3370
|
tableConfig: TableConfig(t)[moduleCode],
|
|
3295
3371
|
isLoading: hookLoading,
|
|
@@ -3335,13 +3411,24 @@ const AddTripModal = ({
|
|
|
3335
3411
|
departureFixedPoint: initialValues.departureFixedPoint || currentTime,
|
|
3336
3412
|
returnFpl: initialValues.returnFpl || currentTime,
|
|
3337
3413
|
frequencyNo: initialValues.frequencyNo,
|
|
3338
|
-
vehicleId: initialValues.vehicleId
|
|
3414
|
+
vehicleId: initialValues.vehicleId,
|
|
3415
|
+
fixedPointCode: initialValues.fixedPointCode,
|
|
3416
|
+
day: initialValues.day || [],
|
|
3417
|
+
volume: initialValues.volume || "",
|
|
3418
|
+
active: initialValues.active || null,
|
|
3419
|
+
remarks: initialValues.remarks || ""
|
|
3339
3420
|
} : {
|
|
3421
|
+
fixedPointCode: "",
|
|
3422
|
+
day: [],
|
|
3340
3423
|
arrivalTimeFpl: currentTime,
|
|
3341
3424
|
departureTimeFpl: currentTime,
|
|
3342
3425
|
arrivalFixedPoint: currentTime,
|
|
3343
3426
|
departureFixedPoint: currentTime,
|
|
3344
|
-
returnFpl: currentTime
|
|
3427
|
+
returnFpl: currentTime,
|
|
3428
|
+
volume: "",
|
|
3429
|
+
active: null,
|
|
3430
|
+
remarks: "",
|
|
3431
|
+
frequencyNo: 1
|
|
3345
3432
|
};
|
|
3346
3433
|
const {
|
|
3347
3434
|
register,
|
|
@@ -3367,13 +3454,13 @@ const AddTripModal = ({
|
|
|
3367
3454
|
});
|
|
3368
3455
|
const fixedPoints = (fixedPointsData === null || fixedPointsData === void 0 ? void 0 : fixedPointsData.waterTankerBookingDetail) || [];
|
|
3369
3456
|
const fixedPointOptions = fixedPoints.map(fp => {
|
|
3370
|
-
var _fp$applicantDetail, _fp$applicantDetail2, _fp$address, _fp$applicantDetail3, _fp$applicantDetail4, _fp$address2, _fp$address3, _fp$address4, _fp$address5, _fp$address6;
|
|
3457
|
+
var _fp$applicantDetail, _fp$applicantDetail2, _fp$address, _fp$applicantDetail3, _fp$applicantDetail4, _fp$address2, _fp$applicantDetail5, _fp$address3, _fp$address4, _fp$address5, _fp$address6;
|
|
3371
3458
|
return {
|
|
3372
3459
|
name: (fp === null || fp === void 0 ? void 0 : (_fp$applicantDetail = fp.applicantDetail) === null || _fp$applicantDetail === void 0 ? void 0 : _fp$applicantDetail.name) || "NA",
|
|
3373
3460
|
mobileNumber: (fp === null || fp === void 0 ? void 0 : (_fp$applicantDetail2 = fp.applicantDetail) === null || _fp$applicantDetail2 === void 0 ? void 0 : _fp$applicantDetail2.mobileNumber) || "NA",
|
|
3374
3461
|
locality: (fp === null || fp === void 0 ? void 0 : (_fp$address = fp.address) === null || _fp$address === void 0 ? void 0 : _fp$address.locality) || "NA",
|
|
3375
3462
|
displayLabel: `${(fp === null || fp === void 0 ? void 0 : (_fp$applicantDetail3 = fp.applicantDetail) === null || _fp$applicantDetail3 === void 0 ? void 0 : _fp$applicantDetail3.name) || "NA"} | ${(fp === null || fp === void 0 ? void 0 : (_fp$applicantDetail4 = fp.applicantDetail) === null || _fp$applicantDetail4 === void 0 ? void 0 : _fp$applicantDetail4.mobileNumber) || "NA"} | ${(fp === null || fp === void 0 ? void 0 : (_fp$address2 = fp.address) === null || _fp$address2 === void 0 ? void 0 : _fp$address2.locality) || "NA"}`,
|
|
3376
|
-
value: fp.bookingId,
|
|
3463
|
+
value: fp.fixedPointCode || (fp === null || fp === void 0 ? void 0 : (_fp$applicantDetail5 = fp.applicantDetail) === null || _fp$applicantDetail5 === void 0 ? void 0 : _fp$applicantDetail5.fixedPointId) || fp.bookingId,
|
|
3377
3464
|
fullAddress: [(fp === null || fp === void 0 ? void 0 : (_fp$address3 = fp.address) === null || _fp$address3 === void 0 ? void 0 : _fp$address3.houseNo) && `${t("WT_HOUSE_NO")} = ${fp.address.houseNo}`, (fp === null || fp === void 0 ? void 0 : (_fp$address4 = fp.address) === null || _fp$address4 === void 0 ? void 0 : _fp$address4.streetName) && `${t("WT_STREET_NAME")} = ${fp.address.streetName}`, (fp === null || fp === void 0 ? void 0 : (_fp$address5 = fp.address) === null || _fp$address5 === void 0 ? void 0 : _fp$address5.landmark) && `${t("WT_LANDMARK")} = ${fp.address.landmark}`, (fp === null || fp === void 0 ? void 0 : (_fp$address6 = fp.address) === null || _fp$address6 === void 0 ? void 0 : _fp$address6.locality) && `${t("WT_LOCALITY")} = ${fp.address.locality}`].filter(Boolean).join(", ")
|
|
3378
3465
|
};
|
|
3379
3466
|
});
|
|
@@ -3409,9 +3496,8 @@ const AddTripModal = ({
|
|
|
3409
3496
|
value: "No"
|
|
3410
3497
|
}];
|
|
3411
3498
|
const formData = watch();
|
|
3412
|
-
const
|
|
3499
|
+
const isFormValid = (formData === null || formData === void 0 ? void 0 : formData.fixedPointCode) && (formData === null || formData === void 0 ? void 0 : formData.day) && Array.isArray(formData === null || formData === void 0 ? void 0 : formData.day) && (formData === null || formData === void 0 ? void 0 : (_formData$day = formData.day) === null || _formData$day === void 0 ? void 0 : _formData$day.length) > 0 && (formData === null || formData === void 0 ? void 0 : formData.arrivalTimeFpl) && (formData === null || formData === void 0 ? void 0 : formData.departureTimeFpl) && (formData === null || formData === void 0 ? void 0 : formData.arrivalFixedPoint) && (formData === null || formData === void 0 ? void 0 : formData.departureFixedPoint) && (formData === null || formData === void 0 ? void 0 : formData.returnFpl) && (formData === null || formData === void 0 ? void 0 : formData.volume) !== "" && (formData === null || formData === void 0 ? void 0 : formData.volume) !== undefined && (formData === null || formData === void 0 ? void 0 : formData.volume) !== null && (formData === null || formData === void 0 ? void 0 : formData.active);
|
|
3413
3500
|
const onFormSubmit = data => {
|
|
3414
|
-
if (isFormDisabled) return;
|
|
3415
3501
|
onSubmit({
|
|
3416
3502
|
...initialValues,
|
|
3417
3503
|
...data
|
|
@@ -3532,6 +3618,7 @@ const AddTripModal = ({
|
|
|
3532
3618
|
}, t("WT_FIXED_POINT_CODE")), isFixedPointLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(Controller, {
|
|
3533
3619
|
control: control,
|
|
3534
3620
|
name: "fixedPointCode",
|
|
3621
|
+
defaultValue: defaultValues.fixedPointCode,
|
|
3535
3622
|
render: props => /*#__PURE__*/React.createElement(CustomNameDropdown, {
|
|
3536
3623
|
option: fixedPointOptions,
|
|
3537
3624
|
optionKey: "displayLabel",
|
|
@@ -3590,7 +3677,7 @@ const AddTripModal = ({
|
|
|
3590
3677
|
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
3591
3678
|
type: "time",
|
|
3592
3679
|
value: props.value,
|
|
3593
|
-
onChange: props.onChange,
|
|
3680
|
+
onChange: e => props.onChange(e.target.value),
|
|
3594
3681
|
onBlur: props.onBlur
|
|
3595
3682
|
})
|
|
3596
3683
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -3607,7 +3694,7 @@ const AddTripModal = ({
|
|
|
3607
3694
|
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
3608
3695
|
type: "time",
|
|
3609
3696
|
value: props.value,
|
|
3610
|
-
onChange: props.onChange,
|
|
3697
|
+
onChange: e => props.onChange(e.target.value),
|
|
3611
3698
|
onBlur: props.onBlur
|
|
3612
3699
|
})
|
|
3613
3700
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -3624,7 +3711,7 @@ const AddTripModal = ({
|
|
|
3624
3711
|
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
3625
3712
|
type: "time",
|
|
3626
3713
|
value: props.value,
|
|
3627
|
-
onChange: props.onChange,
|
|
3714
|
+
onChange: e => props.onChange(e.target.value),
|
|
3628
3715
|
onBlur: props.onBlur
|
|
3629
3716
|
})
|
|
3630
3717
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -3641,7 +3728,7 @@ const AddTripModal = ({
|
|
|
3641
3728
|
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
3642
3729
|
type: "time",
|
|
3643
3730
|
value: props.value,
|
|
3644
|
-
onChange: props.onChange,
|
|
3731
|
+
onChange: e => props.onChange(e.target.value),
|
|
3645
3732
|
onBlur: props.onBlur
|
|
3646
3733
|
})
|
|
3647
3734
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -3658,7 +3745,7 @@ const AddTripModal = ({
|
|
|
3658
3745
|
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
3659
3746
|
type: "time",
|
|
3660
3747
|
value: props.value,
|
|
3661
|
-
onChange: props.onChange,
|
|
3748
|
+
onChange: e => props.onChange(e.target.value),
|
|
3662
3749
|
onBlur: props.onBlur
|
|
3663
3750
|
})
|
|
3664
3751
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -3674,7 +3761,7 @@ const AddTripModal = ({
|
|
|
3674
3761
|
defaultValue: defaultValues.volume,
|
|
3675
3762
|
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
3676
3763
|
value: props.value,
|
|
3677
|
-
onChange: props.onChange,
|
|
3764
|
+
onChange: e => props.onChange(e.target.value),
|
|
3678
3765
|
onBlur: props.onBlur
|
|
3679
3766
|
})
|
|
3680
3767
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -3710,7 +3797,7 @@ const AddTripModal = ({
|
|
|
3710
3797
|
defaultValue: defaultValues.remarks,
|
|
3711
3798
|
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
3712
3799
|
value: props.value,
|
|
3713
|
-
onChange: props.onChange,
|
|
3800
|
+
onChange: e => props.onChange(e.target.value),
|
|
3714
3801
|
onBlur: props.onBlur
|
|
3715
3802
|
})
|
|
3716
3803
|
})))), /*#__PURE__*/React.createElement("div", {
|
|
@@ -3734,16 +3821,16 @@ const AddTripModal = ({
|
|
|
3734
3821
|
}
|
|
3735
3822
|
}, t("CS_COMMON_CANCEL")), /*#__PURE__*/React.createElement("button", {
|
|
3736
3823
|
className: "button-save",
|
|
3737
|
-
disabled:
|
|
3824
|
+
disabled: !isFormValid,
|
|
3738
3825
|
onClick: handleSubmit(onFormSubmit),
|
|
3739
3826
|
style: {
|
|
3740
3827
|
padding: "8px 20px",
|
|
3741
|
-
background:
|
|
3828
|
+
background: !isFormValid ? "#ccc" : "#1D4E7F",
|
|
3742
3829
|
color: "#fff",
|
|
3743
3830
|
border: "none",
|
|
3744
3831
|
borderRadius: "4px",
|
|
3745
|
-
cursor:
|
|
3746
|
-
opacity:
|
|
3832
|
+
cursor: !isFormValid ? "not-allowed" : "pointer",
|
|
3833
|
+
opacity: !isFormValid ? 0.7 : 1
|
|
3747
3834
|
}
|
|
3748
3835
|
}, initialValues ? t("WT_UPDATE") : t("CS_COMMON_SAVE")))));
|
|
3749
3836
|
};
|
|
@@ -3806,10 +3893,10 @@ const FixedPointScheduleManagement = ({
|
|
|
3806
3893
|
const fromScheduleApi = (allSchedulesData === null || allSchedulesData === void 0 ? void 0 : allSchedulesData.fixedPointTimeTableDetails) || [];
|
|
3807
3894
|
const combinedData = [...fromFpApi, ...fromScheduleApi];
|
|
3808
3895
|
const points = combinedData.map(fp => {
|
|
3809
|
-
var _fp$applicantDetail;
|
|
3896
|
+
var _fp$applicantDetail, _fp$applicantDetail2, _fp$applicantDetail3;
|
|
3810
3897
|
return {
|
|
3811
|
-
label: fp.fixedPointCode || fp.name || ((_fp$
|
|
3812
|
-
value: fp.fixedPointCode || fp.bookingId
|
|
3898
|
+
label: fp.fixedPointCode || ((_fp$applicantDetail = fp.applicantDetail) === null || _fp$applicantDetail === void 0 ? void 0 : _fp$applicantDetail.fixedPointId) || fp.name || ((_fp$applicantDetail2 = fp.applicantDetail) === null || _fp$applicantDetail2 === void 0 ? void 0 : _fp$applicantDetail2.name) || fp.bookingId,
|
|
3899
|
+
value: fp.fixedPointCode || ((_fp$applicantDetail3 = fp.applicantDetail) === null || _fp$applicantDetail3 === void 0 ? void 0 : _fp$applicantDetail3.fixedPointId) || fp.bookingId
|
|
3813
3900
|
};
|
|
3814
3901
|
}).filter(p => p.label && p.value);
|
|
3815
3902
|
const uniquePoints = points.filter((v, i, a) => a.findIndex(t => t.value === v.value) === i);
|
|
@@ -3818,6 +3905,8 @@ const FixedPointScheduleManagement = ({
|
|
|
3818
3905
|
value: "all"
|
|
3819
3906
|
}, ...uniquePoints];
|
|
3820
3907
|
}, [fixedPointData, allSchedulesData, t]);
|
|
3908
|
+
console.log(fixedPoints, "fixedPoints");
|
|
3909
|
+
console.log(fixedPointData, "fixedPointData");
|
|
3821
3910
|
const {
|
|
3822
3911
|
mutate: createSchedule
|
|
3823
3912
|
} = Digit.Hooks.wt.useCreateFixedPointSchedule(tenantId);
|
|
@@ -3856,7 +3945,7 @@ const FixedPointScheduleManagement = ({
|
|
|
3856
3945
|
const mapScheduleRows = React.useCallback((rows = []) => rows.map(item => ({
|
|
3857
3946
|
scheduleId: item.systemAssignedScheduleId,
|
|
3858
3947
|
fixedPointName: item.fixedPointName,
|
|
3859
|
-
fixedPoint: item.fixedPointId,
|
|
3948
|
+
fixedPoint: item.fixedPointCode || item.fixedPointId,
|
|
3860
3949
|
day: item.day,
|
|
3861
3950
|
freq: item.tripNo,
|
|
3862
3951
|
arrToFpl: item.arrivalTimeToFpl,
|
|
@@ -4296,13 +4385,13 @@ const FixedPointScheduleManagement = ({
|
|
|
4296
4385
|
var _d$toUpperCase;
|
|
4297
4386
|
return (d === null || d === void 0 ? void 0 : (_d$toUpperCase = d.toUpperCase) === null || _d$toUpperCase === void 0 ? void 0 : _d$toUpperCase.call(d)) || d;
|
|
4298
4387
|
}),
|
|
4299
|
-
trip_no: Number(formData.frequencyNo),
|
|
4388
|
+
trip_no: Number(formData.frequencyNo) || Number(formData.tripNo) || 1,
|
|
4300
4389
|
arrival_time_to_fpl: formData.arrivalTimeFpl,
|
|
4301
4390
|
departure_time_from_fpl: formData.departureTimeFpl,
|
|
4302
4391
|
arrival_time_delivery_point: formData.arrivalFixedPoint,
|
|
4303
4392
|
departure_time_delivery_point: formData.departureFixedPoint,
|
|
4304
4393
|
time_of_arriving_back_fpl_after_delivery: formData.returnFpl,
|
|
4305
|
-
volume_water_tobe_delivery: formData.volume,
|
|
4394
|
+
volume_water_tobe_delivery: formData.volume || "0",
|
|
4306
4395
|
active: ((_formData$active = formData.active) === null || _formData$active === void 0 ? void 0 : _formData$active.value) === "Yes" || formData.active === "Yes",
|
|
4307
4396
|
is_enable: ((_formData$active2 = formData.active) === null || _formData$active2 === void 0 ? void 0 : _formData$active2.value) === "Yes" || formData.active === "Yes",
|
|
4308
4397
|
remarks: formData.remarks,
|
|
@@ -4444,7 +4533,7 @@ const destinationIcon = new L.Icon({
|
|
|
4444
4533
|
const Address = ({
|
|
4445
4534
|
lat,
|
|
4446
4535
|
lng,
|
|
4447
|
-
fallback: _fallback = "Resolving area
|
|
4536
|
+
fallback: _fallback = "Resolving area"
|
|
4448
4537
|
}) => {
|
|
4449
4538
|
const [address, setAddress] = useState(_fallback);
|
|
4450
4539
|
useEffect(() => {
|
|
@@ -4462,17 +4551,32 @@ const Address = ({
|
|
|
4462
4551
|
};
|
|
4463
4552
|
const SOCKET_URL = "https://dev-djb.nitcon.in";
|
|
4464
4553
|
const MapController = ({
|
|
4465
|
-
selectedDriver
|
|
4554
|
+
selectedDriver,
|
|
4555
|
+
mapZoom,
|
|
4556
|
+
mapCenter
|
|
4466
4557
|
}) => {
|
|
4467
4558
|
const map = useMap();
|
|
4468
4559
|
useEffect(() => {
|
|
4469
4560
|
if (selectedDriver !== null && selectedDriver !== void 0 && selectedDriver.lat && selectedDriver !== null && selectedDriver !== void 0 && selectedDriver.lng) {
|
|
4470
|
-
map.setView([selectedDriver.lat, selectedDriver.lng], 15, {
|
|
4561
|
+
map.setView([selectedDriver.lat, selectedDriver.lng], mapZoom || 15, {
|
|
4471
4562
|
animate: true,
|
|
4472
4563
|
duration: 1
|
|
4473
4564
|
});
|
|
4474
4565
|
}
|
|
4475
4566
|
}, [selectedDriver, map]);
|
|
4567
|
+
useEffect(() => {
|
|
4568
|
+
if (Array.isArray(mapCenter) && mapCenter.length === 2) {
|
|
4569
|
+
map.setView(mapCenter, mapZoom || 15, {
|
|
4570
|
+
animate: true,
|
|
4571
|
+
duration: 1
|
|
4572
|
+
});
|
|
4573
|
+
}
|
|
4574
|
+
}, [mapCenter, map]);
|
|
4575
|
+
useEffect(() => {
|
|
4576
|
+
if (mapZoom) {
|
|
4577
|
+
map.setZoom(mapZoom);
|
|
4578
|
+
}
|
|
4579
|
+
}, [mapZoom, map]);
|
|
4476
4580
|
return null;
|
|
4477
4581
|
};
|
|
4478
4582
|
const useRoute = (start, end) => {
|
|
@@ -4485,7 +4589,7 @@ const useRoute = (start, end) => {
|
|
|
4485
4589
|
setLoading(true);
|
|
4486
4590
|
try {
|
|
4487
4591
|
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`);
|
|
4488
|
-
if (!response.ok) throw new Error("
|
|
4592
|
+
if (!response.ok) throw new Error(t("FAILED_TO_FETCH_ROUTE"));
|
|
4489
4593
|
const data = await response.json();
|
|
4490
4594
|
if (data.routes && data.routes[0]) {
|
|
4491
4595
|
const route = data.routes[0];
|
|
@@ -4498,7 +4602,7 @@ const useRoute = (start, end) => {
|
|
|
4498
4602
|
});
|
|
4499
4603
|
}
|
|
4500
4604
|
} catch (err) {
|
|
4501
|
-
console.error("Error fetching route:", err);
|
|
4605
|
+
console.error(t("Error fetching route:"), err);
|
|
4502
4606
|
setError(err.message);
|
|
4503
4607
|
} finally {
|
|
4504
4608
|
setLoading(false);
|
|
@@ -4537,7 +4641,7 @@ const RouteLayer = ({
|
|
|
4537
4641
|
boxShadow: "0 2px 4px rgba(0,0,0,0.1)",
|
|
4538
4642
|
zIndex: 1000
|
|
4539
4643
|
}
|
|
4540
|
-
}, "
|
|
4644
|
+
}, t("LOADING_ROUTE"));
|
|
4541
4645
|
}
|
|
4542
4646
|
if (error) {
|
|
4543
4647
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -4552,7 +4656,7 @@ const RouteLayer = ({
|
|
|
4552
4656
|
boxShadow: "0 2px 4px rgba(0,0,0,0.1)",
|
|
4553
4657
|
zIndex: 1000
|
|
4554
4658
|
}
|
|
4555
|
-
}, "
|
|
4659
|
+
}, t("ERROR_LOADING_ROUTE"), error);
|
|
4556
4660
|
}
|
|
4557
4661
|
if (!routeData) return null;
|
|
4558
4662
|
const renderRouteSegments = () => {
|
|
@@ -4642,9 +4746,9 @@ const RouteLayer = ({
|
|
|
4642
4746
|
}, /*#__PURE__*/React.createElement("h4", {
|
|
4643
4747
|
style: {
|
|
4644
4748
|
margin: 0,
|
|
4645
|
-
color: "#
|
|
4749
|
+
color: "#1F5FA8"
|
|
4646
4750
|
}
|
|
4647
|
-
}, "
|
|
4751
|
+
}, t("ROUTE_INFORMATION")), /*#__PURE__*/React.createElement("button", {
|
|
4648
4752
|
onClick: () => setShowSteps(false),
|
|
4649
4753
|
style: {
|
|
4650
4754
|
background: "none",
|
|
@@ -4658,14 +4762,14 @@ const RouteLayer = ({
|
|
|
4658
4762
|
style: {
|
|
4659
4763
|
marginBottom: "12px"
|
|
4660
4764
|
}
|
|
4661
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, "
|
|
4765
|
+
}, /*#__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", {
|
|
4662
4766
|
style: {
|
|
4663
4767
|
padding: "8px",
|
|
4664
4768
|
background: "#f5f5f5",
|
|
4665
4769
|
borderRadius: "4px",
|
|
4666
4770
|
marginBottom: "8px"
|
|
4667
4771
|
}
|
|
4668
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, "
|
|
4772
|
+
}, /*#__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", {
|
|
4669
4773
|
style: {
|
|
4670
4774
|
maxHeight: "200px",
|
|
4671
4775
|
overflowY: "auto"
|
|
@@ -4675,7 +4779,7 @@ const RouteLayer = ({
|
|
|
4675
4779
|
margin: "8px 0",
|
|
4676
4780
|
color: "#666"
|
|
4677
4781
|
}
|
|
4678
|
-
}, "
|
|
4782
|
+
}, t("TURN_BY_TURN_DIRECTIONS"), ":"), routeData.legs[0].steps.map((step, idx) => /*#__PURE__*/React.createElement("div", {
|
|
4679
4783
|
key: idx,
|
|
4680
4784
|
style: {
|
|
4681
4785
|
padding: "8px",
|
|
@@ -4697,7 +4801,7 @@ const RouteLayer = ({
|
|
|
4697
4801
|
width: "20px",
|
|
4698
4802
|
height: "20px",
|
|
4699
4803
|
borderRadius: "50%",
|
|
4700
|
-
background: "#
|
|
4804
|
+
background: "#1F5FA8",
|
|
4701
4805
|
color: "white",
|
|
4702
4806
|
display: "flex",
|
|
4703
4807
|
alignItems: "center",
|
|
@@ -4735,12 +4839,12 @@ const RouteMarkers = ({
|
|
|
4735
4839
|
className: "distance-marker",
|
|
4736
4840
|
html: `<div style="
|
|
4737
4841
|
background: white;
|
|
4738
|
-
border: 2px solid #
|
|
4842
|
+
border: 2px solid #1F5FA8;
|
|
4739
4843
|
border-radius: 12px;
|
|
4740
4844
|
padding: 2px 6px;
|
|
4741
4845
|
font-size: 10px;
|
|
4742
4846
|
font-weight: bold;
|
|
4743
|
-
color: #
|
|
4847
|
+
color: #1F5FA8;
|
|
4744
4848
|
white-space: nowrap;
|
|
4745
4849
|
">${(i / 1000).toFixed(0)} km</div>`,
|
|
4746
4850
|
iconSize: [40, 20],
|
|
@@ -4780,6 +4884,9 @@ const DriverCard = ({
|
|
|
4780
4884
|
onClick,
|
|
4781
4885
|
vendorList
|
|
4782
4886
|
}) => {
|
|
4887
|
+
const {
|
|
4888
|
+
t
|
|
4889
|
+
} = useTranslation();
|
|
4783
4890
|
const [currentAddress, setCurrentAddress] = useState("Resolving area...");
|
|
4784
4891
|
const [deliveryAddress, setDeliveryAddress] = useState("Resolving area...");
|
|
4785
4892
|
const lastResolvedPos = useRef({
|
|
@@ -4822,190 +4929,128 @@ const DriverCard = ({
|
|
|
4822
4929
|
};
|
|
4823
4930
|
resolveDest();
|
|
4824
4931
|
}, [driver.deliveryLat, driver.deliveryLng]);
|
|
4825
|
-
const
|
|
4826
|
-
if (!vendorList || !vendorList.length) return
|
|
4932
|
+
const driverDetails = useMemo(() => {
|
|
4933
|
+
if (!vendorList || !vendorList.length) return {
|
|
4934
|
+
name: "Unknown",
|
|
4935
|
+
vehicle: "N/A"
|
|
4936
|
+
};
|
|
4827
4937
|
for (const vendor of vendorList) {
|
|
4828
|
-
|
|
4829
|
-
const
|
|
4830
|
-
var _d$owner, _d$owner2
|
|
4831
|
-
return
|
|
4938
|
+
var _vendor$drivers;
|
|
4939
|
+
const match = (_vendor$drivers = vendor.drivers) === null || _vendor$drivers === void 0 ? void 0 : _vendor$drivers.find(d => {
|
|
4940
|
+
var _d$owner, _d$owner2;
|
|
4941
|
+
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;
|
|
4832
4942
|
});
|
|
4833
|
-
if (
|
|
4834
|
-
var _vendor$vehicles
|
|
4835
|
-
return
|
|
4943
|
+
if (match) {
|
|
4944
|
+
var _match$owner, _vendor$vehicles, _vendor$vehicles$;
|
|
4945
|
+
return {
|
|
4946
|
+
name: ((_match$owner = match.owner) === null || _match$owner === void 0 ? void 0 : _match$owner.name) || "Unknown",
|
|
4947
|
+
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"
|
|
4948
|
+
};
|
|
4836
4949
|
}
|
|
4837
4950
|
}
|
|
4838
|
-
return
|
|
4951
|
+
return {
|
|
4952
|
+
name: "Unknown",
|
|
4953
|
+
vehicle: "N/A"
|
|
4954
|
+
};
|
|
4839
4955
|
}, [vendorList, driver.driverId]);
|
|
4840
|
-
const calculateETA = () => {
|
|
4841
|
-
if (!driver.lat || !driver.lng || !driver.deliveryLat || !driver.deliveryLng) return null;
|
|
4842
|
-
const distance = calculateDistance$1(driver.lat, driver.lng, driver.deliveryLat, driver.deliveryLng);
|
|
4843
|
-
const minutes = Math.round(distance / 30 * 60);
|
|
4844
|
-
return minutes;
|
|
4845
|
-
};
|
|
4846
|
-
const eta = calculateETA();
|
|
4847
4956
|
return /*#__PURE__*/React.createElement("div", {
|
|
4848
4957
|
onClick: onClick,
|
|
4849
4958
|
style: {
|
|
4850
4959
|
padding: "16px",
|
|
4851
|
-
marginBottom: "12px",
|
|
4852
4960
|
borderRadius: "12px",
|
|
4853
|
-
background: isSelected ? "#
|
|
4854
|
-
border: `2px solid ${isSelected ? "#
|
|
4855
|
-
boxShadow: isSelected ? "0 4px 12px rgba(33, 150, 243, 0.2)" : "0 2px 8px rgba(0, 0, 0, 0.05)",
|
|
4961
|
+
background: isSelected ? "#f0f4ff" : "white",
|
|
4962
|
+
border: `2px solid ${isSelected ? "#1F5FA8" : "#f0f0f0"}`,
|
|
4856
4963
|
cursor: "pointer",
|
|
4857
|
-
transition: "all 0.2s ease",
|
|
4858
4964
|
position: "relative",
|
|
4859
|
-
|
|
4965
|
+
transition: "all 0.2s ease"
|
|
4860
4966
|
}
|
|
4861
4967
|
}, /*#__PURE__*/React.createElement("div", {
|
|
4862
|
-
style: {
|
|
4863
|
-
position: "absolute",
|
|
4864
|
-
top: 0,
|
|
4865
|
-
left: 0,
|
|
4866
|
-
right: 0,
|
|
4867
|
-
height: "4px",
|
|
4868
|
-
background: driver.isOnline ? "linear-gradient(90deg, #4caf50, #81c784)" : "linear-gradient(90deg, #f44336, #e57373)"
|
|
4869
|
-
}
|
|
4870
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
4871
4968
|
style: {
|
|
4872
4969
|
display: "flex",
|
|
4873
|
-
|
|
4970
|
+
gap: "12px",
|
|
4874
4971
|
marginBottom: "12px"
|
|
4875
4972
|
}
|
|
4876
4973
|
}, /*#__PURE__*/React.createElement("div", {
|
|
4877
4974
|
style: {
|
|
4878
4975
|
width: "40px",
|
|
4879
4976
|
height: "40px",
|
|
4880
|
-
borderRadius: "
|
|
4881
|
-
background:
|
|
4977
|
+
borderRadius: "8px",
|
|
4978
|
+
background: "#f0f2f5",
|
|
4882
4979
|
display: "flex",
|
|
4883
4980
|
alignItems: "center",
|
|
4884
4981
|
justifyContent: "center",
|
|
4885
|
-
|
|
4886
|
-
fontWeight: "bold",
|
|
4887
|
-
fontSize: "16px",
|
|
4888
|
-
marginRight: "12px",
|
|
4889
|
-
flexShrink: 0
|
|
4890
|
-
}
|
|
4891
|
-
}, driver.driverId.charAt(0).toUpperCase()), /*#__PURE__*/React.createElement("div", {
|
|
4892
|
-
style: {
|
|
4893
|
-
flex: 1,
|
|
4894
|
-
minWidth: 0
|
|
4895
|
-
}
|
|
4896
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
4897
|
-
style: {
|
|
4898
|
-
fontWeight: "600",
|
|
4899
|
-
fontSize: "16px",
|
|
4900
|
-
color: "#667eea",
|
|
4901
|
-
marginBottom: "4px",
|
|
4902
|
-
overflow: "hidden",
|
|
4903
|
-
textOverflow: "ellipsis",
|
|
4904
|
-
whiteSpace: "nowrap"
|
|
4982
|
+
fontSize: "20px"
|
|
4905
4983
|
}
|
|
4906
|
-
}, "
|
|
4907
|
-
isOnline: driver.isOnline
|
|
4908
|
-
}))), driver.lat && driver.lng && /*#__PURE__*/React.createElement("div", {
|
|
4984
|
+
}, "\uD83D\uDC64"), /*#__PURE__*/React.createElement("div", {
|
|
4909
4985
|
style: {
|
|
4910
|
-
|
|
4986
|
+
flex: 1
|
|
4911
4987
|
}
|
|
4912
4988
|
}, /*#__PURE__*/React.createElement("div", {
|
|
4913
4989
|
style: {
|
|
4914
|
-
fontSize: "12px",
|
|
4915
|
-
color: "#666",
|
|
4916
|
-
marginBottom: "4px"
|
|
4917
|
-
}
|
|
4918
|
-
}, "Current Location"), /*#__PURE__*/React.createElement("div", {
|
|
4919
|
-
style: {
|
|
4920
|
-
fontSize: "13px",
|
|
4921
|
-
fontWeight: "500",
|
|
4922
|
-
color: "#333",
|
|
4923
4990
|
display: "flex",
|
|
4924
|
-
|
|
4925
|
-
|
|
4991
|
+
justifyContent: "space-between",
|
|
4992
|
+
alignItems: "flex-start"
|
|
4926
4993
|
}
|
|
4927
|
-
}, /*#__PURE__*/React.createElement("
|
|
4928
|
-
title: `${driver.lat.toFixed(6)}, ${driver.lng.toFixed(6)}`
|
|
4929
|
-
}, currentAddress))), driver.deliveryLat && driver.deliveryLng && /*#__PURE__*/React.createElement("div", {
|
|
4994
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
4930
4995
|
style: {
|
|
4931
|
-
|
|
4996
|
+
fontWeight: "700",
|
|
4997
|
+
fontSize: "14px",
|
|
4998
|
+
color: "#0d47a1"
|
|
4932
4999
|
}
|
|
4933
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
5000
|
+
}, "DRV-", driver.driverId.substring(0, 4).toUpperCase()), /*#__PURE__*/React.createElement("div", {
|
|
4934
5001
|
style: {
|
|
4935
|
-
fontSize: "
|
|
4936
|
-
color: "#666"
|
|
4937
|
-
marginBottom: "4px"
|
|
5002
|
+
fontSize: "11px",
|
|
5003
|
+
color: "#666"
|
|
4938
5004
|
}
|
|
4939
|
-
}, "
|
|
5005
|
+
}, driverDetails.name, " \u2022 ", driverDetails.vehicle)), /*#__PURE__*/React.createElement("div", {
|
|
4940
5006
|
style: {
|
|
4941
|
-
fontSize: "
|
|
4942
|
-
fontWeight: "
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
5007
|
+
fontSize: "10px",
|
|
5008
|
+
fontWeight: "700",
|
|
5009
|
+
padding: "2px 8px",
|
|
5010
|
+
borderRadius: "4px",
|
|
5011
|
+
background: driver.isOnline ? "#e8f5e9" : "#ffebee",
|
|
5012
|
+
color: driver.isOnline ? "#2e7d32" : "#c62828"
|
|
4947
5013
|
}
|
|
4948
|
-
}, /*#__PURE__*/React.createElement("
|
|
4949
|
-
title: `${driver.deliveryLat.toFixed(6)}, ${driver.deliveryLng.toFixed(6)}`
|
|
4950
|
-
}, deliveryAddress))), eta !== null && /*#__PURE__*/React.createElement("div", {
|
|
5014
|
+
}, driver.isOnline ? "ONLINE" : "OFFLINE")))), /*#__PURE__*/React.createElement("div", {
|
|
4951
5015
|
style: {
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
borderRadius: "6px",
|
|
4956
|
-
display: "flex",
|
|
4957
|
-
justifyContent: "space-between",
|
|
4958
|
-
alignItems: "center",
|
|
4959
|
-
flexWrap: "wrap",
|
|
4960
|
-
gap: "8px"
|
|
5016
|
+
display: "grid",
|
|
5017
|
+
gridTemplateColumns: "1fr 1fr",
|
|
5018
|
+
gap: "12px"
|
|
4961
5019
|
}
|
|
4962
5020
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
4963
5021
|
style: {
|
|
4964
|
-
fontSize: "
|
|
4965
|
-
color: "#666"
|
|
4966
|
-
}
|
|
4967
|
-
}, "Est. Arrival"), /*#__PURE__*/React.createElement("div", {
|
|
4968
|
-
style: {
|
|
4969
|
-
fontSize: "14px",
|
|
5022
|
+
fontSize: "10px",
|
|
4970
5023
|
fontWeight: "600",
|
|
4971
|
-
color: "#
|
|
5024
|
+
color: "#aaa",
|
|
5025
|
+
marginBottom: "2px"
|
|
4972
5026
|
}
|
|
4973
|
-
},
|
|
5027
|
+
}, t("CURRENT_LOCATION")), /*#__PURE__*/React.createElement("div", {
|
|
4974
5028
|
style: {
|
|
4975
5029
|
fontSize: "11px",
|
|
4976
|
-
|
|
5030
|
+
fontWeight: "700",
|
|
5031
|
+
color: "#333",
|
|
5032
|
+
whiteSpace: "nowrap",
|
|
5033
|
+
overflow: "hidden",
|
|
5034
|
+
textOverflow: "ellipsis"
|
|
4977
5035
|
}
|
|
4978
|
-
}, "
|
|
5036
|
+
}, currentAddress))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
4979
5037
|
style: {
|
|
4980
|
-
fontSize: "
|
|
5038
|
+
fontSize: "10px",
|
|
4981
5039
|
fontWeight: "600",
|
|
4982
|
-
color: "#
|
|
5040
|
+
color: "#aaa",
|
|
5041
|
+
marginBottom: "2px"
|
|
4983
5042
|
}
|
|
4984
|
-
},
|
|
5043
|
+
}, t("DESTINATION")), /*#__PURE__*/React.createElement("div", {
|
|
4985
5044
|
style: {
|
|
4986
|
-
marginTop: "12px",
|
|
4987
5045
|
fontSize: "11px",
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
gap: "4px"
|
|
4994
|
-
}
|
|
4995
|
-
}, vehicleNumber && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
4996
|
-
style: {
|
|
4997
|
-
color: "#555"
|
|
4998
|
-
}
|
|
4999
|
-
}, "Vehicle"), /*#__PURE__*/React.createElement("span", {
|
|
5000
|
-
style: {
|
|
5001
|
-
fontWeight: "600",
|
|
5002
|
-
color: "#667eea"
|
|
5046
|
+
fontWeight: "700",
|
|
5047
|
+
color: "#333",
|
|
5048
|
+
whiteSpace: "nowrap",
|
|
5049
|
+
overflow: "hidden",
|
|
5050
|
+
textOverflow: "ellipsis"
|
|
5003
5051
|
}
|
|
5004
|
-
},
|
|
5052
|
+
}, deliveryAddress))));
|
|
5005
5053
|
};
|
|
5006
|
-
function calculateDistance$1(lat1, lon1, lat2, lon2) {
|
|
5007
|
-
return calculateDistance(lat1, lon1, lat2, lon2);
|
|
5008
|
-
}
|
|
5009
5054
|
function LiveTrackingSystem() {
|
|
5010
5055
|
const {
|
|
5011
5056
|
t
|
|
@@ -5059,11 +5104,11 @@ function LiveTrackingSystem() {
|
|
|
5059
5104
|
console.log("=== VENDOR DEBUG ===");
|
|
5060
5105
|
console.log("Vendor[0] vehicles:", (_vendorOptions$ = vendorOptions[0]) === null || _vendorOptions$ === void 0 ? void 0 : _vendorOptions$.vehicles);
|
|
5061
5106
|
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 => {
|
|
5062
|
-
var _d$
|
|
5107
|
+
var _d$owner3, _d$owner4;
|
|
5063
5108
|
return {
|
|
5064
5109
|
id: d.id,
|
|
5065
|
-
mobile: (_d$
|
|
5066
|
-
uuid: (_d$
|
|
5110
|
+
mobile: (_d$owner3 = d.owner) === null || _d$owner3 === void 0 ? void 0 : _d$owner3.mobileNumber,
|
|
5111
|
+
uuid: (_d$owner4 = d.owner) === null || _d$owner4 === void 0 ? void 0 : _d$owner4.uuid
|
|
5067
5112
|
};
|
|
5068
5113
|
}));
|
|
5069
5114
|
console.log("Socket driverId example:", Object.keys(drivers)[0]);
|
|
@@ -5161,18 +5206,18 @@ function LiveTrackingSystem() {
|
|
|
5161
5206
|
const matchesFillingPoint = !selectedFillingPoint || (() => {
|
|
5162
5207
|
if (!vendorOptions || !vendorOptions.length) return false;
|
|
5163
5208
|
return vendorOptions.some(vendor => {
|
|
5164
|
-
var _vendor$fillingPoint2, _vendor$
|
|
5209
|
+
var _vendor$fillingPoint2, _vendor$drivers2;
|
|
5165
5210
|
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;
|
|
5166
|
-
return (_vendor$
|
|
5167
|
-
var _d$
|
|
5168
|
-
return ((_d$
|
|
5211
|
+
return (_vendor$drivers2 = vendor.drivers) === null || _vendor$drivers2 === void 0 ? void 0 : _vendor$drivers2.some(d => {
|
|
5212
|
+
var _d$owner5, _d$owner6, _d$owner7, _d$owner8;
|
|
5213
|
+
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);
|
|
5169
5214
|
});
|
|
5170
5215
|
});
|
|
5171
5216
|
})();
|
|
5172
5217
|
const matchesVendor = !selectedVendor || (_selectedVendor$drive => {
|
|
5173
5218
|
const vendorDriverIds = ((_selectedVendor$drive = selectedVendor.drivers) === null || _selectedVendor$drive === void 0 ? void 0 : _selectedVendor$drive.map(d => {
|
|
5174
|
-
var _d$
|
|
5175
|
-
return [(_d$
|
|
5219
|
+
var _d$owner9, _d$owner0, _d$owner1, _d$owner10;
|
|
5220
|
+
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)];
|
|
5176
5221
|
}).flat().filter(Boolean)) || [];
|
|
5177
5222
|
return vendorDriverIds.some(id => driver.driverId === id);
|
|
5178
5223
|
})();
|
|
@@ -5187,188 +5232,218 @@ function LiveTrackingSystem() {
|
|
|
5187
5232
|
return /*#__PURE__*/React.createElement("div", {
|
|
5188
5233
|
style: {
|
|
5189
5234
|
display: "flex",
|
|
5235
|
+
flexDirection: "column",
|
|
5190
5236
|
height: "100vh",
|
|
5191
5237
|
width: "100%",
|
|
5192
5238
|
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, sans-serif",
|
|
5193
|
-
|
|
5194
|
-
|
|
5239
|
+
background: "#f0f2f5",
|
|
5240
|
+
padding: "16px",
|
|
5241
|
+
boxSizing: "border-box"
|
|
5195
5242
|
}
|
|
5196
|
-
},
|
|
5197
|
-
onClick: toggleSidebar,
|
|
5243
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5198
5244
|
style: {
|
|
5199
|
-
position: "absolute",
|
|
5200
|
-
top: "10px",
|
|
5201
|
-
left: "10px",
|
|
5202
|
-
zIndex: 2000,
|
|
5203
|
-
background: "#667eea",
|
|
5204
|
-
color: "white",
|
|
5205
|
-
border: "none",
|
|
5206
|
-
borderRadius: "8px",
|
|
5207
|
-
padding: "10px 16px",
|
|
5208
|
-
fontSize: "14px",
|
|
5209
|
-
fontWeight: "500",
|
|
5210
|
-
cursor: "pointer",
|
|
5211
|
-
boxShadow: "0 2px 8px rgba(0,0,0,0.2)",
|
|
5212
5245
|
display: "flex",
|
|
5246
|
+
justifyContent: "space-between",
|
|
5213
5247
|
alignItems: "center",
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5248
|
+
marginBottom: "16px",
|
|
5249
|
+
background: "white",
|
|
5250
|
+
padding: "16px 24px",
|
|
5251
|
+
borderRadius: "12px",
|
|
5252
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.05)",
|
|
5253
|
+
border: "2px solid #1F5FA844"
|
|
5219
5254
|
}
|
|
5220
|
-
},
|
|
5255
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5221
5256
|
style: {
|
|
5222
|
-
width: isMobile ? showSidebar ? "100%" : "0" : "380px",
|
|
5223
|
-
height: "100%",
|
|
5224
|
-
borderRight: isMobile ? "none" : "1px solid #e0e0e0",
|
|
5225
5257
|
display: "flex",
|
|
5226
|
-
flexDirection: "column"
|
|
5227
|
-
background: "#ffffff",
|
|
5228
|
-
boxShadow: isMobile ? showSidebar ? "0 0 20px rgba(0,0,0,0.2)" : "none" : "2px 0 8px rgba(0, 0, 0, 0.05)",
|
|
5229
|
-
position: isMobile ? "absolute" : "relative",
|
|
5230
|
-
top: 0,
|
|
5231
|
-
left: 0,
|
|
5232
|
-
zIndex: 1500,
|
|
5233
|
-
transition: "all 0.3s ease-in-out",
|
|
5234
|
-
overflow: showSidebar ? "visible" : "hidden",
|
|
5235
|
-
...(isMobile && !showSidebar && {
|
|
5236
|
-
width: "0",
|
|
5237
|
-
opacity: 0,
|
|
5238
|
-
pointerEvents: "none"
|
|
5239
|
-
})
|
|
5240
|
-
}
|
|
5241
|
-
}, showSidebar && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
5242
|
-
style: {
|
|
5243
|
-
padding: isMobile ? "16px" : "24px",
|
|
5244
|
-
background: "linear-gradient(135deg, #667eea, #0d47a1)",
|
|
5245
|
-
color: "white"
|
|
5258
|
+
flexDirection: "column"
|
|
5246
5259
|
}
|
|
5247
|
-
},
|
|
5248
|
-
onClick: toggleSidebar,
|
|
5260
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5249
5261
|
style: {
|
|
5250
|
-
position: "absolute",
|
|
5251
|
-
top: "10px",
|
|
5252
|
-
right: "10px",
|
|
5253
|
-
background: "rgba(255,255,255,0.2)",
|
|
5254
|
-
border: "none",
|
|
5255
|
-
color: "white",
|
|
5256
|
-
fontSize: "20px",
|
|
5257
|
-
cursor: "pointer",
|
|
5258
|
-
width: "30px",
|
|
5259
|
-
height: "30px",
|
|
5260
|
-
borderRadius: "4px",
|
|
5261
5262
|
display: "flex",
|
|
5262
5263
|
alignItems: "center",
|
|
5263
|
-
|
|
5264
|
+
gap: "12px"
|
|
5264
5265
|
}
|
|
5265
|
-
},
|
|
5266
|
+
}, /*#__PURE__*/React.createElement("h1", {
|
|
5266
5267
|
style: {
|
|
5267
|
-
margin:
|
|
5268
|
-
fontSize:
|
|
5269
|
-
fontWeight: "
|
|
5270
|
-
|
|
5268
|
+
margin: 0,
|
|
5269
|
+
fontSize: "24px",
|
|
5270
|
+
fontWeight: "700",
|
|
5271
|
+
color: "#0d47a1"
|
|
5271
5272
|
}
|
|
5272
|
-
}, "
|
|
5273
|
+
}, t("WT_LIVE_DRIVER_TRACKING")), /*#__PURE__*/React.createElement("div", {
|
|
5273
5274
|
style: {
|
|
5274
5275
|
display: "flex",
|
|
5275
5276
|
alignItems: "center",
|
|
5276
|
-
gap: "
|
|
5277
|
-
|
|
5278
|
-
|
|
5277
|
+
gap: "6px",
|
|
5278
|
+
background: "#e8f5e9",
|
|
5279
|
+
color: "#2e7d32",
|
|
5280
|
+
padding: "4px 12px",
|
|
5281
|
+
borderRadius: "20px",
|
|
5282
|
+
fontSize: "12px",
|
|
5283
|
+
fontWeight: "700",
|
|
5284
|
+
border: "1px solid #c8e6c9"
|
|
5279
5285
|
}
|
|
5280
5286
|
}, /*#__PURE__*/React.createElement("span", {
|
|
5281
5287
|
style: {
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
height: "10px",
|
|
5288
|
+
width: "8px",
|
|
5289
|
+
height: "8px",
|
|
5285
5290
|
borderRadius: "50%",
|
|
5286
5291
|
backgroundColor: isConnected ? "#4caf50" : "#f44336",
|
|
5287
|
-
|
|
5288
|
-
}
|
|
5289
|
-
}), /*#__PURE__*/React.createElement("span", null, isConnected ? "Connected to server" : "Disconnected"))), /*#__PURE__*/React.createElement("div", {
|
|
5290
|
-
style: {
|
|
5291
|
-
display: "grid",
|
|
5292
|
-
gridTemplateColumns: "1fr 1fr 1fr 1fr",
|
|
5293
|
-
gap: isMobile ? "4px" : "8px",
|
|
5294
|
-
padding: isMobile ? "12px" : "16px",
|
|
5295
|
-
background: "#f5f5f5",
|
|
5296
|
-
borderBottom: "1px solid #e0e0e0"
|
|
5292
|
+
boxShadow: isConnected ? "0 0 8px #4caf50" : "none"
|
|
5297
5293
|
}
|
|
5298
|
-
}, /*#__PURE__*/React.createElement("
|
|
5294
|
+
}), isConnected ? "CONNECTED" : "DISCONNECTED")), /*#__PURE__*/React.createElement("p", {
|
|
5299
5295
|
style: {
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
5303
|
-
style: {
|
|
5304
|
-
fontSize: isMobile ? "10px" : "11px",
|
|
5296
|
+
margin: "4px 0 0 0",
|
|
5297
|
+
fontSize: "14px",
|
|
5305
5298
|
color: "#666"
|
|
5306
5299
|
}
|
|
5307
|
-
}, "
|
|
5300
|
+
}, t("REAL_TIME_TELEMETRY_AND_FLEET_COORDINATION"))), /*#__PURE__*/React.createElement("div", {
|
|
5308
5301
|
style: {
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
color: "#667eea"
|
|
5302
|
+
display: "flex",
|
|
5303
|
+
gap: "12px"
|
|
5312
5304
|
}
|
|
5313
|
-
},
|
|
5305
|
+
}, [{
|
|
5306
|
+
label: t("TOTAL_FLEET"),
|
|
5307
|
+
value: Object.keys(drivers).length,
|
|
5308
|
+
color: "#0d47a1"
|
|
5309
|
+
}, {
|
|
5310
|
+
label: t("ONLINE"),
|
|
5311
|
+
value: onlineCount,
|
|
5312
|
+
color: "#2e7d32"
|
|
5313
|
+
}, {
|
|
5314
|
+
label: t("OFFLINE"),
|
|
5315
|
+
value: offlineCount,
|
|
5316
|
+
color: "#c62828"
|
|
5317
|
+
}, {
|
|
5318
|
+
label: t("ACTIVE"),
|
|
5319
|
+
value: activeDeliveries,
|
|
5320
|
+
color: "#0d47a1"
|
|
5321
|
+
}].map((stat, idx) => /*#__PURE__*/React.createElement("div", {
|
|
5322
|
+
key: idx,
|
|
5314
5323
|
style: {
|
|
5315
|
-
|
|
5324
|
+
background: "#f8f9fa",
|
|
5325
|
+
padding: "8px 16px",
|
|
5326
|
+
borderRadius: "8px",
|
|
5327
|
+
minWidth: "100px",
|
|
5328
|
+
display: "flex",
|
|
5329
|
+
flexDirection: "column",
|
|
5330
|
+
border: "1px solid #e0e0e0"
|
|
5316
5331
|
}
|
|
5317
5332
|
}, /*#__PURE__*/React.createElement("div", {
|
|
5318
5333
|
style: {
|
|
5319
|
-
fontSize:
|
|
5320
|
-
|
|
5334
|
+
fontSize: "10px",
|
|
5335
|
+
fontWeight: "600",
|
|
5336
|
+
color: "#888",
|
|
5337
|
+
marginBottom: "4px"
|
|
5321
5338
|
}
|
|
5322
|
-
},
|
|
5339
|
+
}, stat.label), /*#__PURE__*/React.createElement("div", {
|
|
5323
5340
|
style: {
|
|
5324
|
-
fontSize:
|
|
5325
|
-
fontWeight: "
|
|
5326
|
-
color:
|
|
5341
|
+
fontSize: "20px",
|
|
5342
|
+
fontWeight: "700",
|
|
5343
|
+
color: stat.color
|
|
5327
5344
|
}
|
|
5328
|
-
},
|
|
5345
|
+
}, stat.value))))), /*#__PURE__*/React.createElement("div", {
|
|
5329
5346
|
style: {
|
|
5330
|
-
|
|
5347
|
+
display: "flex",
|
|
5348
|
+
flex: 1,
|
|
5349
|
+
gap: "16px",
|
|
5350
|
+
overflow: "hidden"
|
|
5331
5351
|
}
|
|
5332
|
-
}, /*#__PURE__*/React.createElement("
|
|
5352
|
+
}, isMobile && /*#__PURE__*/React.createElement("button", {
|
|
5353
|
+
onClick: toggleSidebar,
|
|
5333
5354
|
style: {
|
|
5334
|
-
|
|
5335
|
-
|
|
5355
|
+
position: "absolute",
|
|
5356
|
+
top: "80px",
|
|
5357
|
+
left: "20px",
|
|
5358
|
+
zIndex: 2000,
|
|
5359
|
+
background: "#1F5FA8",
|
|
5360
|
+
color: "white",
|
|
5361
|
+
border: "none",
|
|
5362
|
+
borderRadius: "8px",
|
|
5363
|
+
padding: "8px 12px",
|
|
5364
|
+
fontSize: "12px",
|
|
5365
|
+
cursor: "pointer",
|
|
5366
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.2)"
|
|
5336
5367
|
}
|
|
5337
|
-
}, "
|
|
5368
|
+
}, showSidebar ? "Close" : "Menu"), /*#__PURE__*/React.createElement("div", {
|
|
5338
5369
|
style: {
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5370
|
+
width: isMobile ? showSidebar ? "100%" : "0" : "360px",
|
|
5371
|
+
height: "100%",
|
|
5372
|
+
display: "flex",
|
|
5373
|
+
flexDirection: "column",
|
|
5374
|
+
background: "transparent",
|
|
5375
|
+
position: isMobile ? "absolute" : "relative",
|
|
5376
|
+
top: 0,
|
|
5377
|
+
left: 0,
|
|
5378
|
+
zIndex: 1500,
|
|
5379
|
+
transition: "all 0.3s ease-in-out",
|
|
5380
|
+
...(isMobile && !showSidebar && {
|
|
5381
|
+
width: "0",
|
|
5382
|
+
opacity: 0,
|
|
5383
|
+
pointerEvents: "none"
|
|
5384
|
+
})
|
|
5342
5385
|
}
|
|
5343
|
-
},
|
|
5386
|
+
}, showSidebar && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
5344
5387
|
style: {
|
|
5345
|
-
|
|
5388
|
+
padding: "20px",
|
|
5389
|
+
background: "white",
|
|
5390
|
+
borderRadius: "12px",
|
|
5391
|
+
display: "flex",
|
|
5392
|
+
flexDirection: "column",
|
|
5393
|
+
height: "100%",
|
|
5394
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.05)",
|
|
5395
|
+
border: "1px solid #e0e0e0"
|
|
5346
5396
|
}
|
|
5347
5397
|
}, /*#__PURE__*/React.createElement("div", {
|
|
5348
5398
|
style: {
|
|
5349
|
-
|
|
5350
|
-
|
|
5399
|
+
display: "flex",
|
|
5400
|
+
justifyContent: "space-between",
|
|
5401
|
+
alignItems: "center",
|
|
5402
|
+
marginBottom: "16px"
|
|
5351
5403
|
}
|
|
5352
|
-
},
|
|
5404
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
5353
5405
|
style: {
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5406
|
+
margin: 0,
|
|
5407
|
+
fontSize: "14px",
|
|
5408
|
+
fontWeight: "700",
|
|
5409
|
+
color: "#888",
|
|
5410
|
+
letterSpacing: "1px"
|
|
5357
5411
|
}
|
|
5358
|
-
},
|
|
5412
|
+
}, t("WT_FILTER_FLEET")), /*#__PURE__*/React.createElement("button", {
|
|
5413
|
+
onClick: () => {
|
|
5414
|
+
setSelectedFillingPoint(null);
|
|
5415
|
+
setSelectedVendor(null);
|
|
5416
|
+
setSearchTerm("");
|
|
5417
|
+
setFilterOnline("all");
|
|
5418
|
+
},
|
|
5359
5419
|
style: {
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5420
|
+
background: "none",
|
|
5421
|
+
border: "none",
|
|
5422
|
+
color: "#1F5FA8",
|
|
5423
|
+
fontSize: "12px",
|
|
5424
|
+
fontWeight: "700",
|
|
5425
|
+
cursor: "pointer"
|
|
5426
|
+
}
|
|
5427
|
+
}, t("WT_RESET_ALL"))), /*#__PURE__*/React.createElement("div", {
|
|
5428
|
+
style: {
|
|
5429
|
+
display: "flex",
|
|
5430
|
+
flexDirection: "column",
|
|
5431
|
+
gap: "16px",
|
|
5432
|
+
marginBottom: "20px"
|
|
5363
5433
|
}
|
|
5364
5434
|
}, /*#__PURE__*/React.createElement("div", {
|
|
5365
5435
|
style: {
|
|
5366
5436
|
display: "flex",
|
|
5367
5437
|
flexDirection: "column",
|
|
5368
|
-
gap: "
|
|
5369
|
-
marginBottom: "12px"
|
|
5438
|
+
gap: "6px"
|
|
5370
5439
|
}
|
|
5371
|
-
}, /*#__PURE__*/React.createElement(
|
|
5440
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
5441
|
+
style: {
|
|
5442
|
+
fontSize: "12px",
|
|
5443
|
+
fontWeight: "700",
|
|
5444
|
+
color: "#888"
|
|
5445
|
+
}
|
|
5446
|
+
}, t("WT_SELECT_FILLING_POINT")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
5372
5447
|
t: t,
|
|
5373
5448
|
option: fillingPointOptions,
|
|
5374
5449
|
optionKey: "fillingPointName",
|
|
@@ -5377,10 +5452,21 @@ function LiveTrackingSystem() {
|
|
|
5377
5452
|
placeholder: t("WT_SELECT_FILLING_POINT"),
|
|
5378
5453
|
style: {
|
|
5379
5454
|
width: "100%",
|
|
5380
|
-
margin: 0
|
|
5381
|
-
padding: 0
|
|
5455
|
+
margin: 0
|
|
5382
5456
|
}
|
|
5383
|
-
}), /*#__PURE__*/React.createElement(
|
|
5457
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
5458
|
+
style: {
|
|
5459
|
+
display: "flex",
|
|
5460
|
+
flexDirection: "column",
|
|
5461
|
+
gap: "6px"
|
|
5462
|
+
}
|
|
5463
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
5464
|
+
style: {
|
|
5465
|
+
fontSize: "12px",
|
|
5466
|
+
fontWeight: "700",
|
|
5467
|
+
color: "#888"
|
|
5468
|
+
}
|
|
5469
|
+
}, t("WT_SELECT_VENDOR")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
5384
5470
|
t: t,
|
|
5385
5471
|
option: filteredVendorOptions,
|
|
5386
5472
|
optionKey: "name",
|
|
@@ -5389,55 +5475,78 @@ function LiveTrackingSystem() {
|
|
|
5389
5475
|
placeholder: t("WT_SELECT_VENDOR"),
|
|
5390
5476
|
style: {
|
|
5391
5477
|
width: "100%",
|
|
5392
|
-
margin: 0
|
|
5393
|
-
|
|
5478
|
+
margin: 0
|
|
5479
|
+
}
|
|
5480
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
5481
|
+
style: {
|
|
5482
|
+
display: "flex",
|
|
5483
|
+
flexDirection: "column",
|
|
5484
|
+
gap: "6px"
|
|
5485
|
+
}
|
|
5486
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
5487
|
+
style: {
|
|
5488
|
+
fontSize: "10px",
|
|
5489
|
+
fontWeight: "700",
|
|
5490
|
+
color: "#888"
|
|
5491
|
+
}
|
|
5492
|
+
}, t("WT_SEARCH_DRIVER_BY_ID")), /*#__PURE__*/React.createElement("div", {
|
|
5493
|
+
style: {
|
|
5494
|
+
position: "relative"
|
|
5495
|
+
}
|
|
5496
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
5497
|
+
style: {
|
|
5498
|
+
position: "absolute",
|
|
5499
|
+
left: "12px",
|
|
5500
|
+
top: "50%",
|
|
5501
|
+
transform: "translateY(-50%)",
|
|
5502
|
+
color: "#888"
|
|
5394
5503
|
}
|
|
5395
|
-
})
|
|
5504
|
+
}, "\uD83D\uDD0D"), /*#__PURE__*/React.createElement("input", {
|
|
5396
5505
|
type: "text",
|
|
5397
|
-
placeholder: "
|
|
5506
|
+
placeholder: t("WT_SEARCH_DRIVER_BY_ID"),
|
|
5398
5507
|
value: searchTerm,
|
|
5399
5508
|
onChange: e => setSearchTerm(e.target.value),
|
|
5400
5509
|
style: {
|
|
5401
5510
|
width: "100%",
|
|
5402
|
-
padding:
|
|
5511
|
+
padding: "10px 10px 10px 36px",
|
|
5403
5512
|
border: "1px solid #e0e0e0",
|
|
5404
5513
|
borderRadius: "8px",
|
|
5405
|
-
fontSize:
|
|
5406
|
-
marginBottom: "12px",
|
|
5514
|
+
fontSize: "12px",
|
|
5407
5515
|
outline: "none",
|
|
5408
|
-
|
|
5516
|
+
background: "#f8f9fa",
|
|
5409
5517
|
boxSizing: "border-box"
|
|
5410
|
-
}
|
|
5411
|
-
|
|
5412
|
-
onBlur: e => e.target.style.borderColor = "#e0e0e0"
|
|
5413
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
5518
|
+
}
|
|
5519
|
+
})))), /*#__PURE__*/React.createElement("div", {
|
|
5414
5520
|
style: {
|
|
5415
5521
|
display: "flex",
|
|
5416
|
-
|
|
5417
|
-
|
|
5522
|
+
justifyContent: "space-between",
|
|
5523
|
+
alignItems: "center",
|
|
5524
|
+
marginBottom: "12px"
|
|
5525
|
+
}
|
|
5526
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5527
|
+
style: {
|
|
5528
|
+
display: "flex",
|
|
5529
|
+
gap: "8px"
|
|
5418
5530
|
}
|
|
5419
5531
|
}, ["all", "online", "offline"].map(filter => /*#__PURE__*/React.createElement("button", {
|
|
5420
5532
|
key: filter,
|
|
5421
5533
|
onClick: () => setFilterOnline(filter),
|
|
5422
5534
|
style: {
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
color: filterOnline === filter ? "white" : "#333",
|
|
5535
|
+
padding: "4px 12px",
|
|
5536
|
+
borderRadius: "4px",
|
|
5537
|
+
background: filterOnline === filter ? "#1F5FA8" : "transparent",
|
|
5538
|
+
color: filterOnline === filter ? "white" : "#666",
|
|
5539
|
+
border: filterOnline === filter ? "none" : "1px solid #e0e0e0",
|
|
5429
5540
|
cursor: "pointer",
|
|
5430
|
-
fontSize:
|
|
5431
|
-
fontWeight: "
|
|
5432
|
-
textTransform: "capitalize"
|
|
5433
|
-
transition: "all 0.2s"
|
|
5541
|
+
fontSize: "12px",
|
|
5542
|
+
fontWeight: "600",
|
|
5543
|
+
textTransform: "capitalize"
|
|
5434
5544
|
}
|
|
5435
5545
|
}, filter))), /*#__PURE__*/React.createElement("div", {
|
|
5436
5546
|
style: {
|
|
5437
5547
|
display: "flex",
|
|
5438
5548
|
alignItems: "center",
|
|
5439
|
-
gap: "
|
|
5440
|
-
marginTop: "8px"
|
|
5549
|
+
gap: "6px"
|
|
5441
5550
|
}
|
|
5442
5551
|
}, /*#__PURE__*/React.createElement("input", {
|
|
5443
5552
|
type: "checkbox",
|
|
@@ -5445,59 +5554,49 @@ function LiveTrackingSystem() {
|
|
|
5445
5554
|
checked: showRoutes,
|
|
5446
5555
|
onChange: e => setShowRoutes(e.target.checked),
|
|
5447
5556
|
style: {
|
|
5448
|
-
cursor: "pointer"
|
|
5449
|
-
width: "16px",
|
|
5450
|
-
height: "16px"
|
|
5557
|
+
cursor: "pointer"
|
|
5451
5558
|
}
|
|
5452
5559
|
}), /*#__PURE__*/React.createElement("label", {
|
|
5453
5560
|
htmlFor: "showRoutes",
|
|
5454
5561
|
style: {
|
|
5455
|
-
fontSize:
|
|
5456
|
-
color: "#
|
|
5562
|
+
fontSize: "12px",
|
|
5563
|
+
color: "#666",
|
|
5457
5564
|
cursor: "pointer"
|
|
5458
5565
|
}
|
|
5459
|
-
}, "
|
|
5566
|
+
}, "Routes"))), /*#__PURE__*/React.createElement("div", {
|
|
5460
5567
|
style: {
|
|
5461
5568
|
flex: 1,
|
|
5462
5569
|
overflowY: "auto",
|
|
5463
|
-
padding:
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
textAlign: "center",
|
|
5469
|
-
padding: isMobile ? "20px" : "40px 20px",
|
|
5470
|
-
color: "#999",
|
|
5471
|
-
background: "white",
|
|
5472
|
-
borderRadius: "12px"
|
|
5473
|
-
}
|
|
5474
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
5475
|
-
style: {
|
|
5476
|
-
fontSize: isMobile ? "36px" : "48px",
|
|
5477
|
-
marginBottom: "16px"
|
|
5570
|
+
padding: "4px",
|
|
5571
|
+
marginTop: "8px",
|
|
5572
|
+
display: "flex",
|
|
5573
|
+
flexDirection: "column",
|
|
5574
|
+
gap: "12px"
|
|
5478
5575
|
}
|
|
5479
|
-
},
|
|
5576
|
+
}, filteredDrivers.length === 0 ? /*#__PURE__*/React.createElement("div", {
|
|
5480
5577
|
style: {
|
|
5481
|
-
|
|
5482
|
-
|
|
5578
|
+
textAlign: "center",
|
|
5579
|
+
padding: "40px 20px",
|
|
5580
|
+
color: "#999"
|
|
5483
5581
|
}
|
|
5484
|
-
},
|
|
5582
|
+
}, /*#__PURE__*/React.createElement("p", null, t("WT_NO_DRIVERS_FOUND"))) : filteredDrivers.map(driver => /*#__PURE__*/React.createElement(DriverCard, {
|
|
5485
5583
|
key: driver.driverId,
|
|
5486
5584
|
driver: driver,
|
|
5487
5585
|
isSelected: (selectedDriver === null || selectedDriver === void 0 ? void 0 : selectedDriver.driverId) === driver.driverId,
|
|
5488
5586
|
vendorList: vendorOptions,
|
|
5489
5587
|
onClick: () => {
|
|
5490
5588
|
setSelectedDriver(driver);
|
|
5491
|
-
if (isMobile)
|
|
5492
|
-
setShowSidebar(false);
|
|
5493
|
-
}
|
|
5589
|
+
if (isMobile) setShowSidebar(false);
|
|
5494
5590
|
}
|
|
5495
|
-
}))))), /*#__PURE__*/React.createElement("div", {
|
|
5591
|
+
})))))), /*#__PURE__*/React.createElement("div", {
|
|
5496
5592
|
style: {
|
|
5497
5593
|
flex: 1,
|
|
5498
5594
|
position: "relative",
|
|
5499
|
-
|
|
5500
|
-
|
|
5595
|
+
background: "white",
|
|
5596
|
+
borderRadius: "12px",
|
|
5597
|
+
overflow: "hidden",
|
|
5598
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.05)",
|
|
5599
|
+
border: "1px solid #e0e0e0"
|
|
5501
5600
|
}
|
|
5502
5601
|
}, /*#__PURE__*/React.createElement(MapContainer, {
|
|
5503
5602
|
center: mapCenter,
|
|
@@ -5511,8 +5610,19 @@ function LiveTrackingSystem() {
|
|
|
5511
5610
|
url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
|
|
5512
5611
|
attribution: "\xA9 <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a>"
|
|
5513
5612
|
}), /*#__PURE__*/React.createElement(MapController, {
|
|
5514
|
-
selectedDriver: selectedDriver
|
|
5515
|
-
|
|
5613
|
+
selectedDriver: selectedDriver,
|
|
5614
|
+
mapZoom: mapZoom,
|
|
5615
|
+
mapCenter: mapCenter
|
|
5616
|
+
}), filteredDrivers.filter(d => d.driverId !== (selectedDriver === null || selectedDriver === void 0 ? void 0 : selectedDriver.driverId)).map(driver => /*#__PURE__*/React.createElement(Marker, {
|
|
5617
|
+
key: driver.driverId,
|
|
5618
|
+
position: [Number(driver.lat), Number(driver.lng)],
|
|
5619
|
+
icon: driver.isOnline ? onlineIcon : offlineIcon,
|
|
5620
|
+
eventHandlers: {
|
|
5621
|
+
click: () => {
|
|
5622
|
+
setSelectedDriver(driver);
|
|
5623
|
+
}
|
|
5624
|
+
}
|
|
5625
|
+
})), selectedDriver && selectedDriver.lat != null && selectedDriver.lng != null && /*#__PURE__*/React.createElement(Marker, {
|
|
5516
5626
|
key: selectedDriver.driverId,
|
|
5517
5627
|
position: [Number(selectedDriver.lat), Number(selectedDriver.lng)],
|
|
5518
5628
|
icon: selectedDriver.isOnline ? onlineIcon : offlineIcon
|
|
@@ -5525,7 +5635,7 @@ function LiveTrackingSystem() {
|
|
|
5525
5635
|
style: {
|
|
5526
5636
|
fontWeight: "bold",
|
|
5527
5637
|
fontSize: isMobile ? "14px" : "16px",
|
|
5528
|
-
color: "#
|
|
5638
|
+
color: "#1F5FA8",
|
|
5529
5639
|
marginBottom: "8px",
|
|
5530
5640
|
borderBottom: "1px solid #eee",
|
|
5531
5641
|
paddingBottom: "4px"
|
|
@@ -5544,14 +5654,14 @@ function LiveTrackingSystem() {
|
|
|
5544
5654
|
style: {
|
|
5545
5655
|
marginBottom: "8px"
|
|
5546
5656
|
}
|
|
5547
|
-
}, /*#__PURE__*/React.createElement("strong", null, "
|
|
5657
|
+
}, /*#__PURE__*/React.createElement("strong", null, "Current Location"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Address, {
|
|
5548
5658
|
lat: selectedDriver.lat,
|
|
5549
5659
|
lng: selectedDriver.lng
|
|
5550
5660
|
}))), selectedDriver.deliveryLat && selectedDriver.deliveryLng && /*#__PURE__*/React.createElement("div", {
|
|
5551
5661
|
style: {
|
|
5552
5662
|
marginBottom: "8px"
|
|
5553
5663
|
}
|
|
5554
|
-
}, /*#__PURE__*/React.createElement("strong", null, "
|
|
5664
|
+
}, /*#__PURE__*/React.createElement("strong", null, t("DELIVERY_DESTINATION")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Address, {
|
|
5555
5665
|
lat: selectedDriver.deliveryLat,
|
|
5556
5666
|
lng: selectedDriver.deliveryLng
|
|
5557
5667
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
@@ -5564,26 +5674,17 @@ function LiveTrackingSystem() {
|
|
|
5564
5674
|
borderRadius: "4px",
|
|
5565
5675
|
marginTop: "8px"
|
|
5566
5676
|
}
|
|
5567
|
-
}, selectedDriver.speed && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, "
|
|
5677
|
+
}, 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", {
|
|
5568
5678
|
style: {
|
|
5569
5679
|
marginTop: "8px",
|
|
5570
5680
|
color: "#666",
|
|
5571
5681
|
fontSize: "10px"
|
|
5572
5682
|
}
|
|
5573
|
-
}, "
|
|
5683
|
+
}, t("WT_LAST_UPDATE"), ": ", new Date(selectedDriver.lastUpdate).toLocaleString()))))), selectedDriver && selectedDriver.deliveryLat != null && selectedDriver.deliveryLng != null && /*#__PURE__*/React.createElement(Marker, {
|
|
5574
5684
|
key: `dest-${selectedDriver.driverId}`,
|
|
5575
5685
|
position: [Number(selectedDriver.deliveryLat), Number(selectedDriver.deliveryLng)],
|
|
5576
5686
|
icon: destinationIcon
|
|
5577
|
-
},
|
|
5578
|
-
lat: selectedDriver.deliveryLat,
|
|
5579
|
-
lng: selectedDriver.deliveryLng
|
|
5580
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
5581
|
-
style: {
|
|
5582
|
-
fontSize: "11px",
|
|
5583
|
-
color: "#666",
|
|
5584
|
-
marginTop: "4px"
|
|
5585
|
-
}
|
|
5586
|
-
}, "Driver: #", selectedDriver.driverId.substring(0, 8), "...")))), showRoutes && selectedDriver && selectedDriver.lat && selectedDriver.lng && selectedDriver.deliveryLat && selectedDriver.deliveryLng && /*#__PURE__*/React.createElement(RouteLayer, {
|
|
5687
|
+
}), showRoutes && selectedDriver && selectedDriver.lat && selectedDriver.lng && selectedDriver.deliveryLat && selectedDriver.deliveryLng && /*#__PURE__*/React.createElement(RouteLayer, {
|
|
5587
5688
|
start: {
|
|
5588
5689
|
lat: selectedDriver.lat,
|
|
5589
5690
|
lng: selectedDriver.lng
|
|
@@ -5611,13 +5712,14 @@ function LiveTrackingSystem() {
|
|
|
5611
5712
|
}, selectedDriver && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
|
|
5612
5713
|
onClick: () => {
|
|
5613
5714
|
if (selectedDriver !== null && selectedDriver !== void 0 && selectedDriver.lat && selectedDriver !== null && selectedDriver !== void 0 && selectedDriver.lng) {
|
|
5614
|
-
|
|
5715
|
+
const center = [Number(selectedDriver.lat), Number(selectedDriver.lng)];
|
|
5716
|
+
setMapCenter(center);
|
|
5615
5717
|
setMapZoom(15);
|
|
5616
5718
|
}
|
|
5617
5719
|
},
|
|
5618
5720
|
style: {
|
|
5619
5721
|
padding: isMobile ? "10px 12px" : "8px 16px",
|
|
5620
|
-
background: "#
|
|
5722
|
+
background: "#1F5FA8",
|
|
5621
5723
|
color: "white",
|
|
5622
5724
|
border: "none",
|
|
5623
5725
|
borderRadius: "4px",
|
|
@@ -5626,7 +5728,7 @@ function LiveTrackingSystem() {
|
|
|
5626
5728
|
fontWeight: "500",
|
|
5627
5729
|
whiteSpace: "nowrap"
|
|
5628
5730
|
}
|
|
5629
|
-
}, "
|
|
5731
|
+
}, t("WT_CENTER")), /*#__PURE__*/React.createElement("button", {
|
|
5630
5732
|
onClick: () => setSelectedDriver(null),
|
|
5631
5733
|
style: {
|
|
5632
5734
|
padding: isMobile ? "10px 12px" : "8px 16px",
|
|
@@ -5639,7 +5741,7 @@ function LiveTrackingSystem() {
|
|
|
5639
5741
|
fontWeight: "500",
|
|
5640
5742
|
whiteSpace: "nowrap"
|
|
5641
5743
|
}
|
|
5642
|
-
}, "
|
|
5744
|
+
}, t("WT_CLEAR"))), !selectedDriver && /*#__PURE__*/React.createElement("div", {
|
|
5643
5745
|
style: {
|
|
5644
5746
|
padding: isMobile ? "10px 12px" : "8px 16px",
|
|
5645
5747
|
background: "#f5f5f5",
|
|
@@ -5671,26 +5773,64 @@ function LiveTrackingSystem() {
|
|
|
5671
5773
|
}, /*#__PURE__*/React.createElement("h4", {
|
|
5672
5774
|
style: {
|
|
5673
5775
|
margin: 0,
|
|
5674
|
-
color: "#
|
|
5776
|
+
color: "#1F5FA8",
|
|
5675
5777
|
fontSize: isMobile ? "14px" : "16px"
|
|
5676
5778
|
}
|
|
5677
|
-
}, "
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
color: "white",
|
|
5681
|
-
padding: "2px 8px",
|
|
5682
|
-
borderRadius: "12px",
|
|
5683
|
-
fontSize: isMobile ? "10px" : "11px",
|
|
5684
|
-
fontWeight: "bold"
|
|
5685
|
-
}
|
|
5686
|
-
}, selectedDriver.isOnline ? "ONLINE" : "OFFLINE")), /*#__PURE__*/React.createElement("div", {
|
|
5779
|
+
}, t("WT_SELECTED_DRIVER")), /*#__PURE__*/React.createElement(StatusBadge, {
|
|
5780
|
+
isOnline: selectedDriver.isOnline
|
|
5781
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
5687
5782
|
style: {
|
|
5688
5783
|
fontSize: isMobile ? "12px" : "13px"
|
|
5689
5784
|
}
|
|
5690
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, "
|
|
5785
|
+
}, /*#__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, {
|
|
5691
5786
|
lat: selectedDriver.lat,
|
|
5692
5787
|
lng: selectedDriver.lng
|
|
5693
|
-
})), selectedDriver.speed && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, "
|
|
5788
|
+
})), 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", {
|
|
5789
|
+
style: {
|
|
5790
|
+
position: "absolute",
|
|
5791
|
+
top: "20px",
|
|
5792
|
+
left: "20px",
|
|
5793
|
+
zIndex: 1000,
|
|
5794
|
+
display: "flex",
|
|
5795
|
+
flexDirection: "column",
|
|
5796
|
+
gap: "8px"
|
|
5797
|
+
}
|
|
5798
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
5799
|
+
onClick: () => setMapZoom(prev => prev + 1),
|
|
5800
|
+
style: {
|
|
5801
|
+
width: "32px",
|
|
5802
|
+
height: "32px",
|
|
5803
|
+
background: "white",
|
|
5804
|
+
border: "1px solid #e0e0e0",
|
|
5805
|
+
borderRadius: "4px",
|
|
5806
|
+
fontSize: "18px",
|
|
5807
|
+
fontWeight: "700",
|
|
5808
|
+
cursor: "pointer",
|
|
5809
|
+
boxShadow: "0 2px 4px rgba(0,0,0,0.1)"
|
|
5810
|
+
}
|
|
5811
|
+
}, "+"), /*#__PURE__*/React.createElement("button", {
|
|
5812
|
+
onClick: () => setMapZoom(prev => prev - 1),
|
|
5813
|
+
style: {
|
|
5814
|
+
width: "32px",
|
|
5815
|
+
height: "32px",
|
|
5816
|
+
background: "white",
|
|
5817
|
+
border: "1px solid #e0e0e0",
|
|
5818
|
+
borderRadius: "4px",
|
|
5819
|
+
fontSize: "18px",
|
|
5820
|
+
fontWeight: "700",
|
|
5821
|
+
cursor: "pointer",
|
|
5822
|
+
boxShadow: "0 2px 4px rgba(0,0,0,0.1)"
|
|
5823
|
+
}
|
|
5824
|
+
}, "\u2212")), /*#__PURE__*/React.createElement("div", {
|
|
5825
|
+
style: {
|
|
5826
|
+
position: "absolute",
|
|
5827
|
+
top: "20px",
|
|
5828
|
+
right: "20px",
|
|
5829
|
+
zIndex: 1000,
|
|
5830
|
+
display: "flex",
|
|
5831
|
+
gap: "12px"
|
|
5832
|
+
}
|
|
5833
|
+
}))));
|
|
5694
5834
|
}
|
|
5695
5835
|
|
|
5696
5836
|
const AddFillingPointMetaData = ({
|
|
@@ -5796,15 +5936,12 @@ const AddFillingPointMetaData = ({
|
|
|
5796
5936
|
[name]: newValue
|
|
5797
5937
|
});
|
|
5798
5938
|
};
|
|
5799
|
-
|
|
5800
|
-
|
|
5939
|
+
return /*#__PURE__*/React.createElement(CollapsibleCardPage$1, {
|
|
5940
|
+
title: t("WT_FILLING_POINT_APPLICANT_DETAILS"),
|
|
5941
|
+
defaultOpen: true
|
|
5942
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5801
5943
|
className: "formcomposer-section-grid"
|
|
5802
|
-
},
|
|
5803
|
-
style: {
|
|
5804
|
-
gridColumn: "span 2",
|
|
5805
|
-
marginBottom: isMobile ? "0px" : "10px"
|
|
5806
|
-
}
|
|
5807
|
-
}, t("WT_FILLING_POINT_APPLICANT_DETAILS")), filteredInputs.map(input => {
|
|
5944
|
+
}, filteredInputs.map(input => {
|
|
5808
5945
|
var _formData$sectionKey, _input$validation;
|
|
5809
5946
|
return /*#__PURE__*/React.createElement("div", {
|
|
5810
5947
|
key: input.name
|
|
@@ -5819,7 +5956,7 @@ const AddFillingPointMetaData = ({
|
|
|
5819
5956
|
onChange: e => handleChange(e.target.value, input.name),
|
|
5820
5957
|
maxLength: (_input$validation = input.validation) === null || _input$validation === void 0 ? void 0 : _input$validation.maxLength
|
|
5821
5958
|
}, input.validation)))));
|
|
5822
|
-
}));
|
|
5959
|
+
})));
|
|
5823
5960
|
};
|
|
5824
5961
|
|
|
5825
5962
|
const allOptions = [{
|
|
@@ -5843,14 +5980,12 @@ const AddFixFillAddress = ({
|
|
|
5843
5980
|
isEdit,
|
|
5844
5981
|
userDetails
|
|
5845
5982
|
}) => {
|
|
5846
|
-
var _location$state, _formData$address, _formData$address2, _formData$address3, _formData$address4, _formData$address5, _formData$address6, _formData$address7, _formData$address8, _formData$address9, _formData$address0, _formData$address1, _userDetails$addresse;
|
|
5983
|
+
var _location$state, _formData$address, _formData$address2, _formData$address3, _formData$address4, _formData$address5, _formData$address6, _formData$address7, _formData$address8, _formData$address9, _formData$address0, _formData$address1, _formData$address10, _formData$address11, _userDetails$addresse;
|
|
5847
5984
|
const {
|
|
5848
5985
|
data: allCities
|
|
5849
5986
|
} = Digit.Hooks.useTenants();
|
|
5850
|
-
const {
|
|
5851
|
-
control
|
|
5852
|
-
} = useForm();
|
|
5853
5987
|
const location = useLocation();
|
|
5988
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
5854
5989
|
const usedAddressTypes = ((_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.usedAddressTypes) || [];
|
|
5855
5990
|
const [pincode, setPincode] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address = formData.address) === null || _formData$address === void 0 ? void 0 : _formData$address.pincode) || "");
|
|
5856
5991
|
const [city, setCity] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address2 = formData.address) === null || _formData$address2 === void 0 ? void 0 : _formData$address2.city) || null);
|
|
@@ -5861,8 +5996,10 @@ const AddFixFillAddress = ({
|
|
|
5861
5996
|
const [addressLine1, setAddressLine1] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address7 = formData.address) === null || _formData$address7 === void 0 ? void 0 : _formData$address7.addressLine1) || "");
|
|
5862
5997
|
const [addressLine2, setAddressLine2] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address8 = formData.address) === null || _formData$address8 === void 0 ? void 0 : _formData$address8.addressLine2) || "");
|
|
5863
5998
|
const [addressType, setAddressType] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address9 = formData.address) === null || _formData$address9 === void 0 ? void 0 : _formData$address9.addressType) || null);
|
|
5864
|
-
const [
|
|
5865
|
-
const [
|
|
5999
|
+
const [zone, setZone] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address0 = formData.address) === null || _formData$address0 === void 0 ? void 0 : _formData$address0.zone) || "");
|
|
6000
|
+
const [block, setBlock] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address1 = formData.address) === null || _formData$address1 === void 0 ? void 0 : _formData$address1.block) || "");
|
|
6001
|
+
const [latitude, setLatitude] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address10 = formData.address) === null || _formData$address10 === void 0 ? void 0 : _formData$address10.latitude) || "");
|
|
6002
|
+
const [longitude, setLongitude] = useState((formData === null || formData === void 0 ? void 0 : (_formData$address11 = formData.address) === null || _formData$address11 === void 0 ? void 0 : _formData$address11.longitude) || "");
|
|
5866
6003
|
const [selectedAddress, setSelectedAddress] = useState("");
|
|
5867
6004
|
const isInitialized = useRef(!isEdit);
|
|
5868
6005
|
const lastSyncedAddress = useRef(null);
|
|
@@ -5874,18 +6011,81 @@ const AddFixFillAddress = ({
|
|
|
5874
6011
|
return allOptions.filter(opt => !usedAddressTypes.includes(opt.code));
|
|
5875
6012
|
}, [usedAddressTypes]);
|
|
5876
6013
|
const {
|
|
5877
|
-
data:
|
|
5878
|
-
} = Digit.Hooks.
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
6014
|
+
data: egovLocationData
|
|
6015
|
+
} = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]);
|
|
6016
|
+
useEffect(() => {
|
|
6017
|
+
if (!city && allCities && allCities.length > 0) {
|
|
6018
|
+
const defaultCity = allCities.find(c => c.code === tenantId) || allCities[0];
|
|
6019
|
+
setCity(defaultCity);
|
|
6020
|
+
}
|
|
6021
|
+
}, [allCities, city, tenantId]);
|
|
6022
|
+
const boundaryData = useMemo(() => {
|
|
6023
|
+
var _egovLocationData$ego;
|
|
6024
|
+
const tenantBoundary = (egovLocationData === null || egovLocationData === void 0 ? void 0 : (_egovLocationData$ego = egovLocationData["egov-location"]) === null || _egovLocationData$ego === void 0 ? void 0 : _egovLocationData$ego.TenantBoundary) || [];
|
|
6025
|
+
const revenueData = tenantBoundary.find(item => {
|
|
6026
|
+
var _item$hierarchyType;
|
|
6027
|
+
return (item === null || item === void 0 ? void 0 : (_item$hierarchyType = item.hierarchyType) === null || _item$hierarchyType === void 0 ? void 0 : _item$hierarchyType.code) === "REVENUE";
|
|
6028
|
+
});
|
|
6029
|
+
return (revenueData === null || revenueData === void 0 ? void 0 : revenueData.boundary) || [];
|
|
6030
|
+
}, [egovLocationData]);
|
|
6031
|
+
const structuredLocality = useMemo(() => {
|
|
6032
|
+
let localities = [];
|
|
6033
|
+
const boundaries = Array.isArray(boundaryData) ? boundaryData : boundaryData ? [boundaryData] : [];
|
|
6034
|
+
const extractLocalities = (node, zone = null, ward = null) => {
|
|
6035
|
+
if (!node) return;
|
|
6036
|
+
let currentZone = zone;
|
|
6037
|
+
let currentWard = ward;
|
|
6038
|
+
if (node.label === "Zone" || node.label === "ZONE") {
|
|
6039
|
+
currentZone = node.localname || node.code || node.name;
|
|
6040
|
+
}
|
|
6041
|
+
if (node.label === "Ward" || node.label === "WARD" || node.label === "Block" || node.label === "BLOCK") {
|
|
6042
|
+
currentWard = node.code || node.localname || node.name;
|
|
6043
|
+
}
|
|
6044
|
+
if (node.label === "Locality" || node.label === "LOCALITY") {
|
|
6045
|
+
localities.push({
|
|
6046
|
+
...node,
|
|
6047
|
+
name: node.localname || node.name || node.code,
|
|
6048
|
+
i18nkey: node.i18nkey || `${tenantId.replace(".", "_")}_REVENUE_${node.code}`.toUpperCase(),
|
|
6049
|
+
zone: currentZone,
|
|
6050
|
+
ward: currentWard
|
|
6051
|
+
});
|
|
6052
|
+
}
|
|
6053
|
+
if (node.children && node.children.length > 0) {
|
|
6054
|
+
node.children.forEach(child => extractLocalities(child, currentZone, currentWard));
|
|
6055
|
+
}
|
|
6056
|
+
};
|
|
6057
|
+
boundaries.forEach(rootNode => extractLocalities(rootNode));
|
|
6058
|
+
return localities;
|
|
6059
|
+
}, [boundaryData, tenantId]);
|
|
6060
|
+
const fetchedPincodes = useMemo(() => {
|
|
6061
|
+
const pinSet = new Set();
|
|
6062
|
+
structuredLocality.forEach(loc => {
|
|
6063
|
+
if (loc.pincode) {
|
|
6064
|
+
const pins = Array.isArray(loc.pincode) ? loc.pincode : [loc.pincode];
|
|
6065
|
+
pins.forEach(p => pinSet.add(p.toString()));
|
|
6066
|
+
}
|
|
6067
|
+
});
|
|
6068
|
+
if (pinSet.size === 0 && city !== null && city !== void 0 && city.pincode) {
|
|
6069
|
+
const pins = Array.isArray(city.pincode) ? city.pincode : [city.pincode];
|
|
6070
|
+
pins.forEach(p => pinSet.add(p.toString()));
|
|
6071
|
+
}
|
|
6072
|
+
return Array.from(pinSet).sort().map(pin => ({
|
|
6073
|
+
code: pin,
|
|
6074
|
+
name: pin,
|
|
6075
|
+
i18nKey: pin
|
|
6076
|
+
}));
|
|
6077
|
+
}, [structuredLocality, city]);
|
|
6078
|
+
const filteredLocalities = useMemo(() => {
|
|
6079
|
+
if (!pincode) return structuredLocality;
|
|
6080
|
+
return structuredLocality.filter(loc => {
|
|
6081
|
+
if (!loc.pincode) return false;
|
|
6082
|
+
const pins = Array.isArray(loc.pincode) ? loc.pincode : [loc.pincode];
|
|
6083
|
+
return pins.some(p => p.toString() === pincode);
|
|
6084
|
+
});
|
|
6085
|
+
}, [structuredLocality, pincode]);
|
|
5886
6086
|
useEffect(() => {
|
|
5887
|
-
var _formData$
|
|
5888
|
-
const currentId = (formData === null || formData === void 0 ? void 0 : formData.id) || (formData === null || formData === void 0 ? void 0 : formData.bookingId) || (formData === null || formData === void 0 ? void 0 : (_formData$
|
|
6087
|
+
var _formData$address12;
|
|
6088
|
+
const currentId = (formData === null || formData === void 0 ? void 0 : formData.id) || (formData === null || formData === void 0 ? void 0 : formData.bookingId) || (formData === null || formData === void 0 ? void 0 : (_formData$address12 = formData.address) === null || _formData$address12 === void 0 ? void 0 : _formData$address12.id);
|
|
5889
6089
|
if (currentId && lastBookingId.current !== currentId) {
|
|
5890
6090
|
isInitialized.current = false;
|
|
5891
6091
|
lastBookingId.current = currentId;
|
|
@@ -5903,39 +6103,41 @@ const AddFixFillAddress = ({
|
|
|
5903
6103
|
setAddressLine1(addressData.addressLine1 || "");
|
|
5904
6104
|
setAddressLine2(addressData.addressLine2 || "");
|
|
5905
6105
|
setAddressType(allOptions.find(a => a.code === addressData.addressType) || addressData.addressType || null);
|
|
6106
|
+
setZone(addressData.zone || "");
|
|
6107
|
+
setBlock(addressData.block || "");
|
|
5906
6108
|
setLatitude(addressData.latitude || "");
|
|
5907
6109
|
setLongitude(addressData.longitude || "");
|
|
5908
|
-
if (
|
|
5909
|
-
if (
|
|
5910
|
-
const localityObj =
|
|
6110
|
+
if (boundaryData || !addressData.cityCode) {
|
|
6111
|
+
if (boundaryData) {
|
|
6112
|
+
const localityObj = boundaryData.find(l => l.code === addressData.localityCode || l.code === addressData.locality || l.i18nkey === addressData.locality);
|
|
5911
6113
|
setLocality(localityObj || addressData.locality || null);
|
|
5912
6114
|
} else {
|
|
5913
6115
|
setLocality(addressData.locality || null);
|
|
5914
6116
|
}
|
|
5915
6117
|
isInitialized.current = true;
|
|
5916
6118
|
lastSyncedAddress.current = JSON.stringify(addressData);
|
|
5917
|
-
} else {
|
|
5918
|
-
console.log("AddFixFillAddress: Waiting for localities to load for city:", cityObj === null || cityObj === void 0 ? void 0 : cityObj.code);
|
|
5919
6119
|
}
|
|
5920
6120
|
}
|
|
5921
|
-
}, [formData === null || formData === void 0 ? void 0 : formData.address, city, allCities,
|
|
6121
|
+
}, [formData === null || formData === void 0 ? void 0 : formData.address, city, allCities, boundaryData]);
|
|
5922
6122
|
useEffect(() => {
|
|
5923
6123
|
if (!navigator.geolocation) return;
|
|
5924
6124
|
navigator.geolocation.getCurrentPosition(pos => {
|
|
5925
6125
|
setLatitude(pos.coords.latitude);
|
|
5926
6126
|
setLongitude(pos.coords.longitude);
|
|
5927
|
-
}, () =>
|
|
6127
|
+
}, () => {});
|
|
5928
6128
|
}, []);
|
|
5929
6129
|
useEffect(() => {
|
|
5930
6130
|
if (selectedAddress && Object.keys(selectedAddress).length) {
|
|
5931
6131
|
setPincode(selectedAddress.pinCode);
|
|
5932
6132
|
setCity(allCities === null || allCities === void 0 ? void 0 : allCities.find(c => c.name === selectedAddress.city));
|
|
5933
|
-
setLocality(
|
|
6133
|
+
setLocality(boundaryData === null || boundaryData === void 0 ? void 0 : boundaryData.find(l => l.i18nkey === selectedAddress.locality));
|
|
5934
6134
|
setHouseNo(selectedAddress.houseNumber);
|
|
5935
6135
|
setStreetName(selectedAddress.streetName);
|
|
5936
6136
|
setLandmark(selectedAddress.landmark);
|
|
5937
6137
|
setAddressLine1(selectedAddress.address);
|
|
5938
6138
|
setAddressLine2(selectedAddress.address2);
|
|
6139
|
+
setZone(selectedAddress.zone);
|
|
6140
|
+
setBlock(selectedAddress.block);
|
|
5939
6141
|
setLatitude(selectedAddress.latitude);
|
|
5940
6142
|
setLongitude(selectedAddress.longitude);
|
|
5941
6143
|
setAddressType(allOptions.find(a => a.code === selectedAddress.addressType));
|
|
@@ -5953,6 +6155,8 @@ const AddFixFillAddress = ({
|
|
|
5953
6155
|
addressLine2: addressLine2 || "",
|
|
5954
6156
|
streetName: streetName || "",
|
|
5955
6157
|
addressType: (addressType === null || addressType === void 0 ? void 0 : addressType.code) || addressType || null,
|
|
6158
|
+
zone: zone || "",
|
|
6159
|
+
block: block || "",
|
|
5956
6160
|
latitude: latitude || "",
|
|
5957
6161
|
longitude: longitude || ""
|
|
5958
6162
|
};
|
|
@@ -5961,23 +6165,16 @@ const AddFixFillAddress = ({
|
|
|
5961
6165
|
lastSyncedAddress.current = addressString;
|
|
5962
6166
|
onSelect((config === null || config === void 0 ? void 0 : config.key) || "address", currentAddress);
|
|
5963
6167
|
}
|
|
5964
|
-
}, [pincode, city, locality, houseNo, landmark, addressLine1, addressLine2, streetName, addressType, latitude, longitude]);
|
|
5965
|
-
|
|
5966
|
-
|
|
6168
|
+
}, [pincode, city, locality, houseNo, landmark, addressLine1, addressLine2, streetName, addressType, zone, block, latitude, longitude]);
|
|
6169
|
+
return /*#__PURE__*/React.createElement(CollapsibleCardPage$1, {
|
|
6170
|
+
title: t("WT_ADDRESS_DETAILS"),
|
|
6171
|
+
defaultOpen: true
|
|
6172
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5967
6173
|
className: "formcomposer-section-grid"
|
|
5968
|
-
}, /*#__PURE__*/React.createElement(
|
|
5969
|
-
style: {
|
|
5970
|
-
gridColumn: "span 2",
|
|
5971
|
-
marginBottom: isMobile ? "0px" : "10px"
|
|
5972
|
-
}
|
|
5973
|
-
}, t("WT_ADDRESS_DETAILS")), (userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$addresse = userDetails.addresses) === null || _userDetails$addresse === void 0 ? void 0 : _userDetails$addresse.length) > 0 && /*#__PURE__*/React.createElement("div", {
|
|
5974
|
-
style: {
|
|
5975
|
-
gridColumn: "span 2"
|
|
5976
|
-
}
|
|
5977
|
-
}, /*#__PURE__*/React.createElement(CardLabel, null, t("COMMON_ADDRESS_TYPE")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
6174
|
+
}, (userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$addresse = userDetails.addresses) === null || _userDetails$addresse === void 0 ? void 0 : _userDetails$addresse.length) > 0 && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("COMMON_ADDRESS_TYPE")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
5978
6175
|
selected: selectedAddress,
|
|
5979
6176
|
select: setSelectedAddress,
|
|
5980
|
-
option: userDetails.addresses,
|
|
6177
|
+
option: userDetails.addresses || [],
|
|
5981
6178
|
optionKey: "address",
|
|
5982
6179
|
t: t,
|
|
5983
6180
|
style: {
|
|
@@ -5986,76 +6183,146 @@ const AddFixFillAddress = ({
|
|
|
5986
6183
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("COMMON_ADDRESS_TYPE")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
5987
6184
|
selected: addressType,
|
|
5988
6185
|
select: setAddressType,
|
|
5989
|
-
option: availableAddressTypeOptions,
|
|
6186
|
+
option: availableAddressTypeOptions || [],
|
|
6187
|
+
optionKey: "i18nKey",
|
|
6188
|
+
t: t,
|
|
6189
|
+
style: {
|
|
6190
|
+
width: "100%"
|
|
6191
|
+
}
|
|
6192
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("CITY"), " ", /*#__PURE__*/React.createElement("span", {
|
|
6193
|
+
className: "astericColor"
|
|
6194
|
+
}, "*")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
6195
|
+
selected: city,
|
|
6196
|
+
select: setCity,
|
|
6197
|
+
option: allCities || [],
|
|
6198
|
+
optionKey: "i18nKey",
|
|
6199
|
+
t: t,
|
|
6200
|
+
disable: true
|
|
6201
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("PINCODE"), " ", /*#__PURE__*/React.createElement("span", {
|
|
6202
|
+
className: "astericColor"
|
|
6203
|
+
}, "*")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
6204
|
+
selected: (fetchedPincodes === null || fetchedPincodes === void 0 ? void 0 : fetchedPincodes.find(p => p.code === pincode)) || (pincode ? {
|
|
6205
|
+
code: pincode,
|
|
6206
|
+
name: pincode,
|
|
6207
|
+
i18nKey: pincode
|
|
6208
|
+
} : null),
|
|
6209
|
+
select: val => {
|
|
6210
|
+
const newPin = val === null || val === void 0 ? void 0 : val.code;
|
|
6211
|
+
if (newPin !== pincode) {
|
|
6212
|
+
setLocality(null);
|
|
6213
|
+
setZone("");
|
|
6214
|
+
setBlock("");
|
|
6215
|
+
setLatitude("");
|
|
6216
|
+
setLongitude("");
|
|
6217
|
+
setAddressLine1("");
|
|
6218
|
+
setAddressLine2("");
|
|
6219
|
+
}
|
|
6220
|
+
setPincode(newPin);
|
|
6221
|
+
},
|
|
6222
|
+
option: fetchedPincodes || [],
|
|
5990
6223
|
optionKey: "i18nKey",
|
|
5991
6224
|
t: t,
|
|
5992
6225
|
style: {
|
|
5993
6226
|
width: "100%"
|
|
5994
6227
|
}
|
|
6228
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LOCALITY"), " ", /*#__PURE__*/React.createElement("span", {
|
|
6229
|
+
className: "astericColor"
|
|
6230
|
+
}, "*")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
6231
|
+
selected: locality,
|
|
6232
|
+
select: val => {
|
|
6233
|
+
setLocality(val);
|
|
6234
|
+
if (val !== null && val !== void 0 && val.latitude) setLatitude(val.latitude);
|
|
6235
|
+
if (val !== null && val !== void 0 && val.longitude) setLongitude(val.longitude);
|
|
6236
|
+
if (val !== null && val !== void 0 && val.localname) setAddressLine1(val.localname);
|
|
6237
|
+
if (val !== null && val !== void 0 && val.name) setAddressLine2(val.name);
|
|
6238
|
+
if (val !== null && val !== void 0 && val.zone) setZone(val.zone);
|
|
6239
|
+
if (val !== null && val !== void 0 && val.ward) setBlock(val.ward);
|
|
6240
|
+
if (val !== null && val !== void 0 && val.pincode) {
|
|
6241
|
+
const p = Array.isArray(val.pincode) ? val.pincode[0] : val.pincode;
|
|
6242
|
+
if (p) setPincode(p.toString());
|
|
6243
|
+
}
|
|
6244
|
+
},
|
|
6245
|
+
option: filteredLocalities,
|
|
6246
|
+
optionKey: "i18nkey",
|
|
6247
|
+
t: t,
|
|
6248
|
+
style: {
|
|
6249
|
+
width: "100%"
|
|
6250
|
+
}
|
|
5995
6251
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("HOUSE_NO"), /*#__PURE__*/React.createElement("span", {
|
|
5996
|
-
className: "
|
|
6252
|
+
className: "astericColor"
|
|
5997
6253
|
}, "*")), /*#__PURE__*/React.createElement(TextInput, {
|
|
5998
6254
|
value: houseNo,
|
|
5999
|
-
onChange: e => setHouseNo(e.target.value)
|
|
6255
|
+
onChange: e => setHouseNo(e.target.value),
|
|
6256
|
+
style: {
|
|
6257
|
+
width: "100%"
|
|
6258
|
+
}
|
|
6000
6259
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("STREET_NAME"), " ", /*#__PURE__*/React.createElement("span", {
|
|
6001
|
-
className: "
|
|
6260
|
+
className: "astericColor"
|
|
6002
6261
|
}, "*")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6003
6262
|
value: streetName,
|
|
6004
|
-
onChange: e => setStreetName(e.target.value)
|
|
6263
|
+
onChange: e => setStreetName(e.target.value),
|
|
6264
|
+
style: {
|
|
6265
|
+
width: "100%"
|
|
6266
|
+
}
|
|
6005
6267
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ADDRESS_LINE1"), " ", /*#__PURE__*/React.createElement("span", {
|
|
6006
|
-
className: "
|
|
6268
|
+
className: "astericColor"
|
|
6007
6269
|
}, "*")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6008
6270
|
value: addressLine1,
|
|
6009
|
-
onChange: e => setAddressLine1(e.target.value)
|
|
6271
|
+
onChange: e => setAddressLine1(e.target.value),
|
|
6272
|
+
style: {
|
|
6273
|
+
width: "100%"
|
|
6274
|
+
}
|
|
6010
6275
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ADDRESS_LINE2"), " ", /*#__PURE__*/React.createElement("span", {
|
|
6011
|
-
className: "
|
|
6276
|
+
className: "astericColor"
|
|
6012
6277
|
}, "*")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6013
6278
|
value: addressLine2,
|
|
6014
|
-
onChange: e => setAddressLine2(e.target.value)
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("
|
|
6019
|
-
className: "
|
|
6020
|
-
}, "*")), /*#__PURE__*/React.createElement(
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
name: "locality",
|
|
6035
|
-
render: () => /*#__PURE__*/React.createElement(Dropdown, {
|
|
6036
|
-
selected: locality,
|
|
6037
|
-
select: setLocality,
|
|
6038
|
-
option: structuredLocality,
|
|
6039
|
-
optionKey: "i18nKey",
|
|
6040
|
-
t: t
|
|
6041
|
-
})
|
|
6279
|
+
onChange: e => setAddressLine2(e.target.value),
|
|
6280
|
+
style: {
|
|
6281
|
+
width: "100%"
|
|
6282
|
+
}
|
|
6283
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("BLOCK"), " ", /*#__PURE__*/React.createElement("span", {
|
|
6284
|
+
className: "astericColor"
|
|
6285
|
+
}, "*")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6286
|
+
value: block,
|
|
6287
|
+
onChange: e => setBlock(e.target.value),
|
|
6288
|
+
style: {
|
|
6289
|
+
width: "100%"
|
|
6290
|
+
}
|
|
6291
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("ZONE"), " ", /*#__PURE__*/React.createElement("span", {
|
|
6292
|
+
className: "astericColor"
|
|
6293
|
+
}, "*")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6294
|
+
value: zone,
|
|
6295
|
+
onChange: e => setZone(e.target.value),
|
|
6296
|
+
style: {
|
|
6297
|
+
width: "100%"
|
|
6298
|
+
}
|
|
6042
6299
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LATITUDE"), " ", /*#__PURE__*/React.createElement("span", {
|
|
6043
|
-
className: "
|
|
6300
|
+
className: "astericColor"
|
|
6044
6301
|
}, "*")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6045
6302
|
value: latitude,
|
|
6046
|
-
onChange: e => setLatitude(e.target.value)
|
|
6303
|
+
onChange: e => setLatitude(e.target.value),
|
|
6304
|
+
style: {
|
|
6305
|
+
width: "100%"
|
|
6306
|
+
}
|
|
6047
6307
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("LONGITUDE"), " ", /*#__PURE__*/React.createElement("span", {
|
|
6048
|
-
className: "
|
|
6308
|
+
className: "astericColor"
|
|
6049
6309
|
}, "*")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6050
6310
|
value: longitude,
|
|
6051
|
-
onChange: e => setLongitude(e.target.value)
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6311
|
+
onChange: e => setLongitude(e.target.value),
|
|
6312
|
+
style: {
|
|
6313
|
+
width: "100%"
|
|
6314
|
+
}
|
|
6315
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
6316
|
+
style: {
|
|
6317
|
+
gridColumn: "span 2"
|
|
6318
|
+
}
|
|
6319
|
+
}, /*#__PURE__*/React.createElement(CardLabel, null, t("LANDMARK")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6320
|
+
value: landmark,
|
|
6321
|
+
onChange: e => setLandmark(e.target.value),
|
|
6322
|
+
style: {
|
|
6323
|
+
width: "100%"
|
|
6324
|
+
}
|
|
6325
|
+
}))));
|
|
6059
6326
|
};
|
|
6060
6327
|
|
|
6061
6328
|
const AddFillingPointAddress = () => {
|
|
@@ -6226,7 +6493,7 @@ const AddFixPointAddress = () => {
|
|
|
6226
6493
|
const searchFilters = React.useMemo(() => ({
|
|
6227
6494
|
tenantId,
|
|
6228
6495
|
filters: {
|
|
6229
|
-
|
|
6496
|
+
id: editId
|
|
6230
6497
|
}
|
|
6231
6498
|
}), [tenantId, editId]);
|
|
6232
6499
|
const searchConfig = React.useMemo(() => ({
|
|
@@ -6239,7 +6506,10 @@ const AddFixPointAddress = () => {
|
|
|
6239
6506
|
const [isDataFetched, setIsDataFetched] = useState(false);
|
|
6240
6507
|
useEffect(() => {
|
|
6241
6508
|
if (editId && editData !== null && editData !== void 0 && editData.waterTankerBookingDetail && !isDataFetched) {
|
|
6242
|
-
const data = editData.waterTankerBookingDetail.find(item =>
|
|
6509
|
+
const data = editData.waterTankerBookingDetail.find(item => {
|
|
6510
|
+
var _item$applicantDetail;
|
|
6511
|
+
return ((_item$applicantDetail = item.applicantDetail) === null || _item$applicantDetail === void 0 ? void 0 : _item$applicantDetail.applicantId) === editId;
|
|
6512
|
+
});
|
|
6243
6513
|
if (data) {
|
|
6244
6514
|
var _data$applicantDetail, _data$applicantDetail2, _data$applicantDetail3, _data$applicantDetail4, _data$applicantDetail5, _data$address, _data$address2;
|
|
6245
6515
|
setFormData({
|
|
@@ -6282,12 +6552,10 @@ const AddFixPointAddress = () => {
|
|
|
6282
6552
|
mutate: updateFixedPoint
|
|
6283
6553
|
} = Digit.Hooks.wt.useUpdateFixedPoint(tenantId);
|
|
6284
6554
|
const handleSubmit = e => {
|
|
6285
|
-
console.log("Submitting Form Data:", formData);
|
|
6286
6555
|
const payload = fixedPointPayload({
|
|
6287
6556
|
...formData,
|
|
6288
6557
|
tenantId
|
|
6289
6558
|
});
|
|
6290
|
-
console.log("Generated Payload:", payload);
|
|
6291
6559
|
const mutation = editId ? updateFixedPoint : createFixedPoint;
|
|
6292
6560
|
mutation(payload, {
|
|
6293
6561
|
onSuccess: () => {
|
|
@@ -6302,7 +6570,6 @@ const AddFixPointAddress = () => {
|
|
|
6302
6570
|
},
|
|
6303
6571
|
onError: error => {
|
|
6304
6572
|
var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
|
|
6305
|
-
console.error("Mutation Error:", error);
|
|
6306
6573
|
setShowToast({
|
|
6307
6574
|
label: (error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : (_error$response$data$2 = _error$response$data$[0]) === null || _error$response$data$2 === void 0 ? void 0 : _error$response$data$2.message) || (editId ? t("WT_FILLING_POINT_UPDATED_ERROR") : t("WT_FILLING_POINT_CREATED_ERROR")),
|
|
6308
6575
|
isError: true
|
|
@@ -6331,14 +6598,12 @@ const AddFixPointAddress = () => {
|
|
|
6331
6598
|
flexDirection: "column",
|
|
6332
6599
|
gap: "16px"
|
|
6333
6600
|
}
|
|
6334
|
-
}, /*#__PURE__*/React.createElement(
|
|
6601
|
+
}, /*#__PURE__*/React.createElement(CollapsibleCardPage$1, {
|
|
6602
|
+
title: t("WT_FIXING_POINT_APPLICANT_DETAILS"),
|
|
6603
|
+
defaultOpen: true
|
|
6604
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
6335
6605
|
className: "formcomposer-section-grid"
|
|
6336
|
-
}, /*#__PURE__*/React.createElement(
|
|
6337
|
-
style: {
|
|
6338
|
-
gridColumn: "span 2",
|
|
6339
|
-
marginBottom: isMobile ? "0px" : "10px"
|
|
6340
|
-
}
|
|
6341
|
-
}, t("WT_FIXING_POINT_APPLICANT_DETAILS")), /*#__PURE__*/React.createElement("div", {
|
|
6606
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
6342
6607
|
style: {
|
|
6343
6608
|
display: "flex",
|
|
6344
6609
|
flexDirection: "column"
|
|
@@ -6404,7 +6669,7 @@ const AddFixPointAddress = () => {
|
|
|
6404
6669
|
style: {
|
|
6405
6670
|
width: "100%"
|
|
6406
6671
|
}
|
|
6407
|
-
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(AddFixFillAddress, {
|
|
6672
|
+
})))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(AddFixFillAddress, {
|
|
6408
6673
|
t: t,
|
|
6409
6674
|
config: addressConfig,
|
|
6410
6675
|
onSelect: handleSelect,
|
|
@@ -6635,7 +6900,6 @@ const LocalityModal = ({
|
|
|
6635
6900
|
};
|
|
6636
6901
|
|
|
6637
6902
|
const SearchFillingPointAddress = () => {
|
|
6638
|
-
var _fixedPointData$water, _fillingPointData$fil;
|
|
6639
6903
|
const {
|
|
6640
6904
|
t
|
|
6641
6905
|
} = useTranslation();
|
|
@@ -6652,7 +6916,7 @@ const SearchFillingPointAddress = () => {
|
|
|
6652
6916
|
const [showLocalityModal, setShowLocalityModal] = useState(false);
|
|
6653
6917
|
const [selectedLocalityRow, setSelectedLocalityRow] = useState(null);
|
|
6654
6918
|
const [modalMode, setModalMode] = useState("ADD");
|
|
6655
|
-
const [pageSize, setPageSize] = useState(
|
|
6919
|
+
const [pageSize, setPageSize] = useState(50);
|
|
6656
6920
|
const [pageOffset, setPageOffset] = useState(0);
|
|
6657
6921
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
6658
6922
|
const closeToast = () => {
|
|
@@ -6868,12 +7132,12 @@ const SearchFillingPointAddress = () => {
|
|
|
6868
7132
|
Cell: ({
|
|
6869
7133
|
row
|
|
6870
7134
|
}) => {
|
|
6871
|
-
var _row$original$applica2;
|
|
7135
|
+
var _row$original$applica2, _row$original$applica3;
|
|
6872
7136
|
return /*#__PURE__*/React.createElement("span", {
|
|
6873
7137
|
className: "link"
|
|
6874
7138
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
6875
|
-
to: `/digit-ui/employee/wt/add-fix-point-address?id=${row.original.
|
|
6876
|
-
}, ((_row$original$
|
|
7139
|
+
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}`
|
|
7140
|
+
}, ((_row$original$applica3 = row.original.applicantDetail) === null || _row$original$applica3 === void 0 ? void 0 : _row$original$applica3.name) || "NA"));
|
|
6877
7141
|
}
|
|
6878
7142
|
}, {
|
|
6879
7143
|
Header: t("WT_MOBILE_NUMBER"),
|
|
@@ -7028,8 +7292,7 @@ const SearchFillingPointAddress = () => {
|
|
|
7028
7292
|
const handlePageSizeChange = e => {
|
|
7029
7293
|
setPageSize(Number(e.target.value));
|
|
7030
7294
|
};
|
|
7031
|
-
const
|
|
7032
|
-
const fillingLength = (fillingPointData === null || fillingPointData === void 0 ? void 0 : (_fillingPointData$fil = fillingPointData.fillingPoints) === null || _fillingPointData$fil === void 0 ? void 0 : _fillingPointData$fil.length) || 0;
|
|
7295
|
+
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);
|
|
7033
7296
|
const applyFixedPointMappedFilter = React.useCallback((rows = []) => {
|
|
7034
7297
|
if (selectedTab !== "FIXED_POINT" || !(appliedFixedPointStatus !== null && appliedFixedPointStatus !== void 0 && appliedFixedPointStatus.code)) return rows;
|
|
7035
7298
|
return rows.filter(item => {
|
|
@@ -7223,7 +7486,8 @@ const SearchFillingPointAddress = () => {
|
|
|
7223
7486
|
onNextPage: fetchNextPage,
|
|
7224
7487
|
onPrevPage: fetchPrevPage,
|
|
7225
7488
|
pageSizeLimit: pageSize,
|
|
7226
|
-
totalRecords:
|
|
7489
|
+
totalRecords: totalCount,
|
|
7490
|
+
isPaginationRequired: true,
|
|
7227
7491
|
showPagination: true,
|
|
7228
7492
|
showPageSizeOptions: true,
|
|
7229
7493
|
isSearchRequired: false,
|
|
@@ -7299,7 +7563,7 @@ const SelectServiceType = ({
|
|
|
7299
7563
|
return /*#__PURE__*/React.createElement(Loader, null);
|
|
7300
7564
|
}
|
|
7301
7565
|
if ((userType === null || userType === void 0 ? void 0 : userType.toLowerCase()) === "employee") {
|
|
7302
|
-
return /*#__PURE__*/React.createElement(
|
|
7566
|
+
return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, config.label), /*#__PURE__*/React.createElement(Dropdown, {
|
|
7303
7567
|
className: "payment-form-text-input-correction",
|
|
7304
7568
|
isMandatory: config.isMandatory,
|
|
7305
7569
|
selected: serviceTypes,
|
|
@@ -7422,14 +7686,12 @@ const VendorAssign = ({
|
|
|
7422
7686
|
style: {
|
|
7423
7687
|
flex: 1
|
|
7424
7688
|
}
|
|
7425
|
-
}, /*#__PURE__*/React.createElement(
|
|
7689
|
+
}, /*#__PURE__*/React.createElement(CollapsibleCardPage$1, {
|
|
7690
|
+
title: t("WT_VENDOR_ASSIGN"),
|
|
7691
|
+
defaultOpen: true
|
|
7692
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7426
7693
|
className: "formcomposer-section-grid"
|
|
7427
|
-
}, /*#__PURE__*/React.createElement(
|
|
7428
|
-
style: {
|
|
7429
|
-
marginBottom: "10px",
|
|
7430
|
-
gridColumn: "span 2"
|
|
7431
|
-
}
|
|
7432
|
-
}, t("WT_VENDOR_ASSIGN")), /*#__PURE__*/React.createElement("div", {
|
|
7694
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7433
7695
|
style: {
|
|
7434
7696
|
display: "flex",
|
|
7435
7697
|
flexDirection: "column"
|
|
@@ -7496,7 +7758,7 @@ const VendorAssign = ({
|
|
|
7496
7758
|
formData: {
|
|
7497
7759
|
serviceType: selectedServiceType
|
|
7498
7760
|
}
|
|
7499
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
7761
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
7500
7762
|
style: {
|
|
7501
7763
|
display: "flex",
|
|
7502
7764
|
marginTop: "24px",
|
|
@@ -7521,6 +7783,7 @@ const EmployeeApp = ({
|
|
|
7521
7783
|
t
|
|
7522
7784
|
} = useTranslation();
|
|
7523
7785
|
const location = useLocation();
|
|
7786
|
+
const fixedPointInboxLabel = t("WT_FIXED_POINT") !== "WT_FIXED_POINT" ? `${t("WT_FIXED_POINT")} ${t("ES_COMMON_INBOX")}` : "Fixed Point Inbox";
|
|
7524
7787
|
sessionStorage.removeItem("revalidateddone");
|
|
7525
7788
|
const getDynamicBreadcrumbs = () => {
|
|
7526
7789
|
const pathname = location.pathname;
|
|
@@ -7534,7 +7797,11 @@ const EmployeeApp = ({
|
|
|
7534
7797
|
label: t("WT_MODULE_NAME"),
|
|
7535
7798
|
path: `/digit-ui/employee/module/details?moduleName=${moduleName}`
|
|
7536
7799
|
}];
|
|
7537
|
-
if (pathname.includes("/inbox")) {
|
|
7800
|
+
if (pathname.includes("/fixed-point/inbox")) {
|
|
7801
|
+
crumbs.push({
|
|
7802
|
+
label: fixedPointInboxLabel
|
|
7803
|
+
});
|
|
7804
|
+
} else if (pathname.includes("/inbox")) {
|
|
7538
7805
|
let label = "ES_COMMON_INBOX";
|
|
7539
7806
|
if (pathname.includes("/tp/inbox")) label = "TP_INBOX";
|
|
7540
7807
|
crumbs.push({
|
|
@@ -7551,6 +7818,14 @@ const EmployeeApp = ({
|
|
|
7551
7818
|
crumbs.push({
|
|
7552
7819
|
label: t("WT_REQUEST_SERVICE")
|
|
7553
7820
|
});
|
|
7821
|
+
} else if (pathname.includes("/fixed-point/booking-details")) {
|
|
7822
|
+
crumbs.push({
|
|
7823
|
+
label: fixedPointInboxLabel,
|
|
7824
|
+
path: `${path}/fixed-point/inbox`
|
|
7825
|
+
});
|
|
7826
|
+
crumbs.push({
|
|
7827
|
+
label: t("WT_BOOKING_DETAILS")
|
|
7828
|
+
});
|
|
7554
7829
|
} else if (pathname.includes("/booking-details") || pathname.includes("/bookingsearch/booking-details")) {
|
|
7555
7830
|
const isSearch = pathname.includes("/bookingsearch");
|
|
7556
7831
|
if (isSearch) {
|
|
@@ -7627,6 +7902,17 @@ const EmployeeApp = ({
|
|
|
7627
7902
|
locality: []
|
|
7628
7903
|
}
|
|
7629
7904
|
};
|
|
7905
|
+
const inboxInitialStateFixedPoint = {
|
|
7906
|
+
searchParams: {
|
|
7907
|
+
uuid: {
|
|
7908
|
+
code: "ASSIGNED_TO_ALL",
|
|
7909
|
+
name: "ES_INBOX_ASSIGNED_TO_ALL"
|
|
7910
|
+
},
|
|
7911
|
+
services: ["watertanker-fixedpoint"],
|
|
7912
|
+
applicationStatus: [],
|
|
7913
|
+
locality: []
|
|
7914
|
+
}
|
|
7915
|
+
};
|
|
7630
7916
|
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");
|
|
7631
7917
|
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");
|
|
7632
7918
|
return /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -7652,6 +7938,18 @@ const EmployeeApp = ({
|
|
|
7652
7938
|
initialStates: inboxInitialState,
|
|
7653
7939
|
isInbox: true
|
|
7654
7940
|
}))
|
|
7941
|
+
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
7942
|
+
path: `${path}/fixed-point/inbox`,
|
|
7943
|
+
component: props => /*#__PURE__*/React.createElement(Inbox, Object.assign({}, props, {
|
|
7944
|
+
useNewInboxAPI: true,
|
|
7945
|
+
parentRoute: path,
|
|
7946
|
+
businessService: "watertanker-fixedpoint",
|
|
7947
|
+
detailRoute: `${path}/fixed-point/booking-details`,
|
|
7948
|
+
moduleCode: "WT",
|
|
7949
|
+
filterComponent: "WT_INBOX_FILTER",
|
|
7950
|
+
initialStates: inboxInitialStateFixedPoint,
|
|
7951
|
+
isInbox: true
|
|
7952
|
+
}))
|
|
7655
7953
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
7656
7954
|
path: `${path}/mt/inbox`,
|
|
7657
7955
|
component: props => /*#__PURE__*/React.createElement(Inbox, Object.assign({}, props, {
|
|
@@ -7683,6 +7981,11 @@ const EmployeeApp = ({
|
|
|
7683
7981
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
7684
7982
|
path: `${path}/tp/request-service`,
|
|
7685
7983
|
component: WTCreate
|
|
7984
|
+
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
7985
|
+
path: `${path}/fixed-point/booking-details/:id`,
|
|
7986
|
+
component: props => /*#__PURE__*/React.createElement(ApplicationDetails, Object.assign({}, props, {
|
|
7987
|
+
parentRoute: path
|
|
7988
|
+
}))
|
|
7686
7989
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
7687
7990
|
path: `${path}/booking-details/:id`,
|
|
7688
7991
|
component: props => /*#__PURE__*/React.createElement(ApplicationDetails, Object.assign({}, props, {
|
|
@@ -14725,7 +15028,7 @@ const TableConfig = t => ({
|
|
|
14725
15028
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
|
|
14726
15029
|
className: "link"
|
|
14727
15030
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
14728
|
-
to: `${props.parentRoute}/booking-details
|
|
15031
|
+
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"]}`
|
|
14729
15032
|
}, (_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"])));
|
|
14730
15033
|
},
|
|
14731
15034
|
mobileCell: original => {
|
|
@@ -17322,8 +17625,8 @@ var _DataView = DataView;
|
|
|
17322
17625
|
var Promise$1 = _getNative(_root, 'Promise');
|
|
17323
17626
|
var _Promise = Promise$1;
|
|
17324
17627
|
|
|
17325
|
-
var Set = _getNative(_root, 'Set');
|
|
17326
|
-
var _Set = Set;
|
|
17628
|
+
var Set$1 = _getNative(_root, 'Set');
|
|
17629
|
+
var _Set = Set$1;
|
|
17327
17630
|
|
|
17328
17631
|
var WeakMap = _getNative(_root, 'WeakMap');
|
|
17329
17632
|
var _WeakMap = WeakMap;
|
|
@@ -19630,7 +19933,7 @@ const NOCDocuments = ({
|
|
|
19630
19933
|
}
|
|
19631
19934
|
}, [nocDocs, commonDocMaping]);
|
|
19632
19935
|
useEffect(() => {
|
|
19633
|
-
if (bpaApplicationStatus ===
|
|
19936
|
+
if (bpaApplicationStatus === "NOC_VERIFICATION_INPROGRESS" && (actions === null || actions === void 0 ? void 0 : actions.length) > 0) setCheckEnablingDocs(true);else setCheckEnablingDocs(false);
|
|
19634
19937
|
}, [applicationData, bpaActionsDetails]);
|
|
19635
19938
|
return /*#__PURE__*/React.createElement("div", {
|
|
19636
19939
|
style: {
|
|
@@ -19655,9 +19958,9 @@ const NOCDocuments = ({
|
|
|
19655
19958
|
label: isEmployee ? `${t(noc === null || noc === void 0 ? void 0 : noc.title)}` : t(noc === null || noc === void 0 ? void 0 : noc.title),
|
|
19656
19959
|
text: noc !== null && noc !== void 0 && noc.value ? t(noc === null || noc === void 0 ? void 0 : noc.value) : t("CS_NA"),
|
|
19657
19960
|
textStyle: (noc === null || noc === void 0 ? void 0 : noc.value) == "APPROVED" || (noc === null || noc === void 0 ? void 0 : noc.value) == "AUTO_APPROVED" ? {
|
|
19658
|
-
color: "#
|
|
19961
|
+
color: "#2E9E8F"
|
|
19659
19962
|
} : {
|
|
19660
|
-
color: "#
|
|
19963
|
+
color: "#D83A2F"
|
|
19661
19964
|
}
|
|
19662
19965
|
});
|
|
19663
19966
|
} else {
|
|
@@ -20209,7 +20512,7 @@ const ScruntinyDetails = ({
|
|
|
20209
20512
|
const getTextValues = data => {
|
|
20210
20513
|
if (data !== null && data !== void 0 && data.value && data !== null && data !== void 0 && data.isTransLate) return /*#__PURE__*/React.createElement("span", {
|
|
20211
20514
|
style: {
|
|
20212
|
-
color: "#
|
|
20515
|
+
color: "#2E9E8F"
|
|
20213
20516
|
}
|
|
20214
20517
|
}, t(data === null || data === void 0 ? void 0 : data.value));else if (data !== null && data !== void 0 && data.value && data !== null && data !== void 0 && data.isTransLate) return t(data === null || data === void 0 ? void 0 : data.value);else if (data !== null && data !== void 0 && data.value) return data === null || data === void 0 ? void 0 : data.value;else t("NA");
|
|
20215
20518
|
};
|
|
@@ -20889,7 +21192,7 @@ const WSFeeEstimation = ({
|
|
|
20889
21192
|
var _result$Calculation2, _result$Calculation2$, _result$Calculation2$2;
|
|
20890
21193
|
result === null || result === void 0 ? void 0 : (_result$Calculation2 = result.Calculation) === null || _result$Calculation2 === void 0 ? void 0 : (_result$Calculation2$ = _result$Calculation2[0]) === null || _result$Calculation2$ === void 0 ? void 0 : (_result$Calculation2$2 = _result$Calculation2$.taxHeadEstimates) === null || _result$Calculation2$2 === void 0 ? void 0 : _result$Calculation2$2.forEach(data => data.amount = data.estimateAmount);
|
|
20891
21194
|
}
|
|
20892
|
-
result.Calculation[0].billSlabData = _.groupBy(result === null || result === void 0 ? void 0 : (_result$Calculation3 = result.Calculation) === null || _result$Calculation3 === void 0 ? void 0 : (_result$Calculation3$ = _result$Calculation3[0]) === null || _result$Calculation3$ === void 0 ? void 0 : _result$Calculation3$.taxHeadEstimates,
|
|
21195
|
+
result.Calculation[0].billSlabData = _.groupBy(result === null || result === void 0 ? void 0 : (_result$Calculation3 = result.Calculation) === null || _result$Calculation3 === void 0 ? void 0 : (_result$Calculation3$ = _result$Calculation3[0]) === null || _result$Calculation3$ === void 0 ? void 0 : _result$Calculation3$.taxHeadEstimates, "category");
|
|
20893
21196
|
const values = [{
|
|
20894
21197
|
title: "WS_APPLICATION_FEE_HEADER",
|
|
20895
21198
|
value: (_result$Calculation4 = result.Calculation) === null || _result$Calculation4 === void 0 ? void 0 : (_result$Calculation4$ = _result$Calculation4[0]) === null || _result$Calculation4$ === void 0 ? void 0 : _result$Calculation4$.fee
|
|
@@ -20935,7 +21238,7 @@ const WSFeeEstimation = ({
|
|
|
20935
21238
|
if (targetValueSign == 1) {
|
|
20936
21239
|
values[value] = e.target.value;
|
|
20937
21240
|
} else {
|
|
20938
|
-
values[value] =
|
|
21241
|
+
values[value] = "";
|
|
20939
21242
|
}
|
|
20940
21243
|
} else if (isDropDownValue) {
|
|
20941
21244
|
values[`${value}_data`] = e;
|
|
@@ -20950,7 +21253,7 @@ const WSFeeEstimation = ({
|
|
|
20950
21253
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
20951
21254
|
style: {
|
|
20952
21255
|
lineHeight: "19px",
|
|
20953
|
-
maxWidth: "
|
|
21256
|
+
maxWidth: "100%",
|
|
20954
21257
|
minWidth: "280px"
|
|
20955
21258
|
}
|
|
20956
21259
|
}, values && /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement("div", null, values === null || values === void 0 ? void 0 : values.map((value, index) => {
|
|
@@ -20981,15 +21284,16 @@ const WSFeeEstimation = ({
|
|
|
20981
21284
|
label: `${t(`CS_INBOX_STATUS_FILTER`)}`,
|
|
20982
21285
|
text: isPaid ? t("WS_COMMON_PAID_LABEL") : t("WS_COMMON_NOT_PAID"),
|
|
20983
21286
|
textStyle: !isPaid ? {
|
|
20984
|
-
color: "#
|
|
21287
|
+
color: "#D83A2F"
|
|
20985
21288
|
} : {
|
|
20986
|
-
color: "#
|
|
21289
|
+
color: "#2E9E8F"
|
|
20987
21290
|
}
|
|
20988
21291
|
}))), wsAdditionalDetails !== null && wsAdditionalDetails !== void 0 && (_wsAdditionalDetails$18 = wsAdditionalDetails.additionalDetails) !== null && _wsAdditionalDetails$18 !== void 0 && _wsAdditionalDetails$18.isAdhocRebate ? /*#__PURE__*/React.createElement("div", {
|
|
20989
21292
|
onClick: e => {
|
|
20990
21293
|
showPopUp(true);
|
|
20991
21294
|
}
|
|
20992
21295
|
}, /*#__PURE__*/React.createElement("span", {
|
|
21296
|
+
className: "add-details-link hover-button",
|
|
20993
21297
|
style: {
|
|
20994
21298
|
cursor: "pointer",
|
|
20995
21299
|
color: "#a82227"
|
|
@@ -21013,14 +21317,16 @@ const WSFeeEstimation = ({
|
|
|
21013
21317
|
actionSaveOnSubmit: e => addAdhocRebatePenality(),
|
|
21014
21318
|
hideSubmit: false,
|
|
21015
21319
|
popupStyles: {
|
|
21016
|
-
overflowY: "auto"
|
|
21320
|
+
overflowY: "auto",
|
|
21321
|
+
background: "#f0f3f7"
|
|
21017
21322
|
}
|
|
21018
|
-
}, /*#__PURE__*/React.createElement("div",
|
|
21323
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
21019
21324
|
style: {
|
|
21020
|
-
|
|
21021
|
-
|
|
21325
|
+
display: "flex",
|
|
21326
|
+
flexDirection: "column",
|
|
21327
|
+
gap: "16px"
|
|
21022
21328
|
}
|
|
21023
|
-
}, /*#__PURE__*/React.createElement(CardSectionHeader, {
|
|
21329
|
+
}, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSectionHeader, {
|
|
21024
21330
|
style: {
|
|
21025
21331
|
fontSize: "16px",
|
|
21026
21332
|
fontWeight: "700",
|
|
@@ -21028,7 +21334,7 @@ const WSFeeEstimation = ({
|
|
|
21028
21334
|
padding: "0px",
|
|
21029
21335
|
margin: "0px 0px 10px 0px"
|
|
21030
21336
|
}
|
|
21031
|
-
}, t("PT_AD_PENALTY")), /*#__PURE__*/React.createElement(CardLabel, null, t("PT_TX_HEADS")), /*#__PURE__*/React.createElement("div", {
|
|
21337
|
+
}, t("PT_AD_PENALTY")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_TX_HEADS")), /*#__PURE__*/React.createElement("div", {
|
|
21032
21338
|
className: "field"
|
|
21033
21339
|
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
21034
21340
|
isMandatory: true,
|
|
@@ -21039,9 +21345,7 @@ const WSFeeEstimation = ({
|
|
|
21039
21345
|
isPropertyAssess: true,
|
|
21040
21346
|
name: "adhocPenaltyReason_data",
|
|
21041
21347
|
t: t
|
|
21042
|
-
})), (fields === null || fields === void 0 ? void 0 : (_fields$adhocPenaltyR = fields.adhocPenaltyReason_data) === null || _fields$adhocPenaltyR === void 0 ? void 0 : _fields$adhocPenaltyR.title) === "PT_OTHERS" && /*#__PURE__*/React.createElement("div", {
|
|
21043
|
-
className: "field"
|
|
21044
|
-
}, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_REASON")), /*#__PURE__*/React.createElement("div", {
|
|
21348
|
+
}))), (fields === null || fields === void 0 ? void 0 : (_fields$adhocPenaltyR = fields.adhocPenaltyReason_data) === null || _fields$adhocPenaltyR === void 0 ? void 0 : _fields$adhocPenaltyR.title) === "PT_OTHERS" && /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_REASON")), /*#__PURE__*/React.createElement("div", {
|
|
21045
21349
|
className: "field"
|
|
21046
21350
|
}, /*#__PURE__*/React.createElement(TextInput, Object.assign({
|
|
21047
21351
|
style: {
|
|
@@ -21058,7 +21362,7 @@ const WSFeeEstimation = ({
|
|
|
21058
21362
|
pattern: "^[a-zA-Z ]*$",
|
|
21059
21363
|
type: "text",
|
|
21060
21364
|
title: t("TL_NAME_ERROR_MESSAGE")
|
|
21061
|
-
})))), /*#__PURE__*/React.createElement(CardLabel, null, t("PT_HEAD_AMT")), /*#__PURE__*/React.createElement("div", {
|
|
21365
|
+
})))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_HEAD_AMT")), /*#__PURE__*/React.createElement("div", {
|
|
21062
21366
|
className: "field"
|
|
21063
21367
|
}, /*#__PURE__*/React.createElement(TextInput, Object.assign({
|
|
21064
21368
|
style: {
|
|
@@ -21074,12 +21378,7 @@ const WSFeeEstimation = ({
|
|
|
21074
21378
|
isRequired: true,
|
|
21075
21379
|
pattern: "^[1-9]+[0-9]*$",
|
|
21076
21380
|
title: t("ERR_DEFAULT_INPUT_FIELD_MSG")
|
|
21077
|
-
})))), /*#__PURE__*/React.createElement(Card, {
|
|
21078
|
-
style: {
|
|
21079
|
-
padding: "10px 10px 1px 10px",
|
|
21080
|
-
margin: "0px 0px 15px 0px"
|
|
21081
|
-
}
|
|
21082
|
-
}, /*#__PURE__*/React.createElement(CardSectionHeader, {
|
|
21381
|
+
}))))), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSectionHeader, {
|
|
21083
21382
|
style: {
|
|
21084
21383
|
fontSize: "16px",
|
|
21085
21384
|
fontWeight: "700",
|
|
@@ -21087,7 +21386,7 @@ const WSFeeEstimation = ({
|
|
|
21087
21386
|
padding: "0px",
|
|
21088
21387
|
margin: "0px 0px 10px 0px"
|
|
21089
21388
|
}
|
|
21090
|
-
}, t("PT_AD_REBATE")), /*#__PURE__*/React.createElement(CardLabel, null, t("PT_TX_HEADS")), /*#__PURE__*/React.createElement("div", {
|
|
21389
|
+
}, t("PT_AD_REBATE")), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_TX_HEADS")), /*#__PURE__*/React.createElement("div", {
|
|
21091
21390
|
className: "field"
|
|
21092
21391
|
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
21093
21392
|
isMandatory: true,
|
|
@@ -21098,9 +21397,7 @@ const WSFeeEstimation = ({
|
|
|
21098
21397
|
name: "adhocRebateReason_data",
|
|
21099
21398
|
isPropertyAssess: true,
|
|
21100
21399
|
t: t
|
|
21101
|
-
})), (fields === null || fields === void 0 ? void 0 : (_fields$adhocRebateRe = fields.adhocRebateReason_data) === null || _fields$adhocRebateRe === void 0 ? void 0 : _fields$adhocRebateRe.title) === "PT_OTHERS" && /*#__PURE__*/React.createElement("
|
|
21102
|
-
className: "field"
|
|
21103
|
-
}, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_REASON")), /*#__PURE__*/React.createElement(TextInput, Object.assign({
|
|
21400
|
+
}))), (fields === null || fields === void 0 ? void 0 : (_fields$adhocRebateRe = fields.adhocRebateReason_data) === null || _fields$adhocRebateRe === void 0 ? void 0 : _fields$adhocRebateRe.title) === "PT_OTHERS" && /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_REASON")), /*#__PURE__*/React.createElement(TextInput, Object.assign({
|
|
21104
21401
|
style: {
|
|
21105
21402
|
background: "#FAFAFA"
|
|
21106
21403
|
},
|
|
@@ -21115,7 +21412,7 @@ const WSFeeEstimation = ({
|
|
|
21115
21412
|
pattern: "^[a-zA-Z ]*$",
|
|
21116
21413
|
type: "text",
|
|
21117
21414
|
title: t("TL_NAME_ERROR_MESSAGE")
|
|
21118
|
-
}))), /*#__PURE__*/React.createElement(CardLabel, null, t("PT_HEAD_AMT")), /*#__PURE__*/React.createElement("div", {
|
|
21415
|
+
}))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PT_HEAD_AMT")), /*#__PURE__*/React.createElement("div", {
|
|
21119
21416
|
className: "field"
|
|
21120
21417
|
}, /*#__PURE__*/React.createElement(TextInput, Object.assign({
|
|
21121
21418
|
style: {
|
|
@@ -21131,7 +21428,7 @@ const WSFeeEstimation = ({
|
|
|
21131
21428
|
isRequired: true,
|
|
21132
21429
|
pattern: "^[1-9]+[0-9]*$",
|
|
21133
21430
|
title: t("ERR_DEFAULT_INPUT_FIELD_MSG")
|
|
21134
|
-
})))))
|
|
21431
|
+
}))))))), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
21135
21432
|
style: {
|
|
21136
21433
|
zIndex: "10000"
|
|
21137
21434
|
},
|
|
@@ -21245,10 +21542,7 @@ const ViewBreakup = ({
|
|
|
21245
21542
|
marginTop: "12px"
|
|
21246
21543
|
}
|
|
21247
21544
|
}, /*#__PURE__*/React.createElement("span", {
|
|
21248
|
-
|
|
21249
|
-
cursor: "pointer",
|
|
21250
|
-
color: "#a82227"
|
|
21251
|
-
}
|
|
21545
|
+
className: "add-details-link hover-button"
|
|
21252
21546
|
}, t("WS_PAYMENT_VIEW_BREAKUP"))) : null, popup && /*#__PURE__*/React.createElement(Modal, {
|
|
21253
21547
|
headerBarMain: /*#__PURE__*/React.createElement(Heading, {
|
|
21254
21548
|
label: t("WS_CALCULATION_BREAKUP")
|
|
@@ -21690,15 +21984,11 @@ function ApplicationDetailsContent({
|
|
|
21690
21984
|
oldValue,
|
|
21691
21985
|
isInfoLabel = false
|
|
21692
21986
|
}) {
|
|
21693
|
-
var _applicationDetails$
|
|
21987
|
+
var _applicationDetails$a, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data0, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data19, _workflowDetails$data20;
|
|
21694
21988
|
const {
|
|
21695
21989
|
t
|
|
21696
21990
|
} = useTranslation();
|
|
21697
|
-
const history = useHistory();
|
|
21698
|
-
const location = useLocation();
|
|
21699
21991
|
const [showPopup, setShowPopup] = useState(false);
|
|
21700
|
-
const [selectedData, setSelectedData] = useState(null);
|
|
21701
|
-
const searchParams = new URLSearchParams(location.search);
|
|
21702
21992
|
let {
|
|
21703
21993
|
id: applicationNo
|
|
21704
21994
|
} = useParams();
|
|
@@ -21734,7 +22024,7 @@ function ApplicationDetailsContent({
|
|
|
21734
22024
|
loaded: false,
|
|
21735
22025
|
canLoad: false
|
|
21736
22026
|
});
|
|
21737
|
-
if ((applicationData === null || applicationData === void 0 ? void 0 : applicationData.status)
|
|
22027
|
+
if ((applicationData === null || applicationData === void 0 ? void 0 : applicationData.status) === "ACTIVE" && !billData.loading && !billData.loaded && !billData.canLoad) {
|
|
21738
22028
|
updateCanFetchBillData({
|
|
21739
22029
|
loading: false,
|
|
21740
22030
|
loaded: false,
|
|
@@ -21750,7 +22040,7 @@ function ApplicationDetailsContent({
|
|
|
21750
22040
|
setBillData((applicationData === null || applicationData === void 0 ? void 0 : applicationData.tenantId) || tenantId, applicationData === null || applicationData === void 0 ? void 0 : applicationData.propertyId, updatefetchBillData, updateCanFetchBillData);
|
|
21751
22041
|
}
|
|
21752
22042
|
const convertEpochToDateDMY = dateEpoch => {
|
|
21753
|
-
if (dateEpoch == null || dateEpoch
|
|
22043
|
+
if (dateEpoch == null || dateEpoch === undefined || dateEpoch === "") {
|
|
21754
22044
|
return "NA";
|
|
21755
22045
|
}
|
|
21756
22046
|
const dateFromApi = new Date(dateEpoch);
|
|
@@ -21834,7 +22124,6 @@ function ApplicationDetailsContent({
|
|
|
21834
22124
|
const checkLocation = window.location.href.includes("employee/tl") || window.location.href.includes("employee/obps") || window.location.href.includes("employee/noc");
|
|
21835
22125
|
const isNocLocation = window.location.href.includes("employee/noc");
|
|
21836
22126
|
const isBPALocation = window.location.href.includes("employee/obps");
|
|
21837
|
-
const isWS = window.location.href.includes("employee/ws");
|
|
21838
22127
|
const getRowStyles = () => {
|
|
21839
22128
|
if (window.location.href.includes("employee/obps") || window.location.href.includes("employee/noc")) {
|
|
21840
22129
|
return {
|
|
@@ -21873,13 +22162,13 @@ function ApplicationDetailsContent({
|
|
|
21873
22162
|
if (window.location.href.includes("employee/obps") || window.location.href.includes("employee/noc") || window.location.href.includes("employee/ws")) {
|
|
21874
22163
|
return {
|
|
21875
22164
|
lineHeight: "19px",
|
|
21876
|
-
maxWidth: "
|
|
22165
|
+
maxWidth: "100%",
|
|
21877
22166
|
minWidth: "280px"
|
|
21878
22167
|
};
|
|
21879
22168
|
} else if (checkLocation) {
|
|
21880
22169
|
return {
|
|
21881
22170
|
lineHeight: "19px",
|
|
21882
|
-
maxWidth: "
|
|
22171
|
+
maxWidth: "100%",
|
|
21883
22172
|
minWidth: "280px"
|
|
21884
22173
|
};
|
|
21885
22174
|
} else {
|
|
@@ -21927,7 +22216,6 @@ function ApplicationDetailsContent({
|
|
|
21927
22216
|
});
|
|
21928
22217
|
};
|
|
21929
22218
|
const handleViewClick = data => {
|
|
21930
|
-
setSelectedData(data);
|
|
21931
22219
|
setShowPopup(true);
|
|
21932
22220
|
};
|
|
21933
22221
|
return /*#__PURE__*/React.createElement(Card, {
|
|
@@ -21942,8 +22230,8 @@ function ApplicationDetailsContent({
|
|
|
21942
22230
|
infoClickLable: "WS_CLICK_ON_LABEL",
|
|
21943
22231
|
infoClickInfoLabel: getClickInfoDetails(),
|
|
21944
22232
|
infoClickInfoLabel1: getClickInfoDetails1()
|
|
21945
|
-
}) : null, applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$
|
|
21946
|
-
var _detail$title, _detail$values, _detail$additionalDet, _applicationDetails$
|
|
22233
|
+
}) : null, applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a = applicationDetails.applicationDetails) === null || _applicationDetails$a === void 0 ? void 0 : _applicationDetails$a.map((detail, index) => {
|
|
22234
|
+
var _detail$title, _detail$values, _detail$additionalDet, _applicationDetails$a2, _applicationDetails$a3, _applicationDetails$a4, _detail$additionalDet2, _applicationDetails$a5, _applicationDetails$a6, _detail$additionalDet3, _detail$additionalDet4, _detail$additionalDet5, _detail$additionalDet6, _detail$additionalDet7, _detail$additionalDet8, _detail$additionalDet9, _detail$additionalDet0, _detail$additionalDet1, _workflowDetails$data, _workflowDetails$data2, _detail$additionalDet10, _detail$additionalDet11, _detail$additionalDet12, _detail$additionalDet13, _detail$additionalDet14, _detail$additionalDet15, _detail$additionalDet16, _detail$additionalDet17, _detail$additionalDet18, _detail$additionalDet19, _detail$additionalDet20, _detail$additionalDet21, _detail$additionalDet22, _detail$additionalDet23, _detail$additionalDet24, _detail$additionalDet25, _detail$additionalDet26, _detail$additionalDet27, _detail$additionalDet28, _detail$additionalDet29;
|
|
21947
22235
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
21948
22236
|
key: index
|
|
21949
22237
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -22036,7 +22324,7 @@ function ApplicationDetailsContent({
|
|
|
22036
22324
|
}
|
|
22037
22325
|
}, /*#__PURE__*/React.createElement("button", null, " ", /*#__PURE__*/React.createElement(EditIcon, null), " ")), /*#__PURE__*/React.createElement("div", {
|
|
22038
22326
|
key: index,
|
|
22039
|
-
onClick: () => handleViewClick(
|
|
22327
|
+
onClick: () => handleViewClick(),
|
|
22040
22328
|
style: {
|
|
22041
22329
|
cursor: "pointer"
|
|
22042
22330
|
}
|
|
@@ -22137,8 +22425,8 @@ function ApplicationDetailsContent({
|
|
|
22137
22425
|
})))), (detail === null || detail === void 0 ? void 0 : detail.belowComponent) && /*#__PURE__*/React.createElement(detail.belowComponent, null), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet = detail.additionalDetails) === null || _detail$additionalDet === void 0 ? void 0 : _detail$additionalDet.inspectionReport) && /*#__PURE__*/React.createElement(ScruntinyDetails, {
|
|
22138
22426
|
scrutinyDetails: detail === null || detail === void 0 ? void 0 : detail.additionalDetails,
|
|
22139
22427
|
paymentsList: paymentsList
|
|
22140
|
-
}), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$
|
|
22141
|
-
fiReport: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$
|
|
22428
|
+
}), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a2 = applicationDetails.applicationData) === null || _applicationDetails$a2 === void 0 ? void 0 : (_applicationDetails$a3 = _applicationDetails$a2.additionalDetails) === null || _applicationDetails$a3 === void 0 ? void 0 : (_applicationDetails$a4 = _applicationDetails$a3.fieldinspection_pending) === null || _applicationDetails$a4 === void 0 ? void 0 : _applicationDetails$a4.length) > 0 && (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet2 = detail.additionalDetails) === null || _detail$additionalDet2 === void 0 ? void 0 : _detail$additionalDet2.fiReport) && /*#__PURE__*/React.createElement(InspectionReport, {
|
|
22429
|
+
fiReport: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a5 = applicationDetails.applicationData) === null || _applicationDetails$a5 === void 0 ? void 0 : (_applicationDetails$a6 = _applicationDetails$a5.additionalDetails) === null || _applicationDetails$a6 === void 0 ? void 0 : _applicationDetails$a6.fieldinspection_pending
|
|
22142
22430
|
}), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet3 = detail.additionalDetails) === null || _detail$additionalDet3 === void 0 ? void 0 : _detail$additionalDet3.floors) && /*#__PURE__*/React.createElement(PropertyFloors, {
|
|
22143
22431
|
floors: detail === null || detail === void 0 ? void 0 : (_detail$additionalDet4 = detail.additionalDetails) === null || _detail$additionalDet4 === void 0 ? void 0 : _detail$additionalDet4.floors
|
|
22144
22432
|
}), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet5 = detail.additionalDetails) === null || _detail$additionalDet5 === void 0 ? void 0 : _detail$additionalDet5.owners) && /*#__PURE__*/React.createElement(PropertyOwners, {
|
|
@@ -22180,21 +22468,11 @@ function ApplicationDetailsContent({
|
|
|
22180
22468
|
}), (detail === null || detail === void 0 ? void 0 : detail.isWaterConnectionDetails) && /*#__PURE__*/React.createElement(WSAdditonalDetails, {
|
|
22181
22469
|
wsAdditionalDetails: detail,
|
|
22182
22470
|
oldValue: oldValue
|
|
22183
|
-
}), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet23 = detail.additionalDetails) === null || _detail$additionalDet23 === void 0 ? void 0 : _detail$additionalDet23.redirectUrl) && /*#__PURE__*/React.createElement(
|
|
22184
|
-
style: {
|
|
22185
|
-
fontSize: "16px",
|
|
22186
|
-
lineHeight: "24px",
|
|
22187
|
-
fontWeight: "400",
|
|
22188
|
-
padding: "10px 0px"
|
|
22189
|
-
}
|
|
22190
|
-
}, /*#__PURE__*/React.createElement(Link, {
|
|
22471
|
+
}), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet23 = detail.additionalDetails) === null || _detail$additionalDet23 === void 0 ? void 0 : _detail$additionalDet23.redirectUrl) && /*#__PURE__*/React.createElement(Link, {
|
|
22191
22472
|
to: detail === null || detail === void 0 ? void 0 : (_detail$additionalDet24 = detail.additionalDetails) === null || _detail$additionalDet24 === void 0 ? void 0 : (_detail$additionalDet25 = _detail$additionalDet24.redirectUrl) === null || _detail$additionalDet25 === void 0 ? void 0 : _detail$additionalDet25.url
|
|
22192
22473
|
}, /*#__PURE__*/React.createElement("span", {
|
|
22193
|
-
className: "link"
|
|
22194
|
-
|
|
22195
|
-
color: "#a82227"
|
|
22196
|
-
}
|
|
22197
|
-
}, detail === null || detail === void 0 ? void 0 : (_detail$additionalDet26 = detail.additionalDetails) === null || _detail$additionalDet26 === void 0 ? void 0 : (_detail$additionalDet27 = _detail$additionalDet26.redirectUrl) === null || _detail$additionalDet27 === void 0 ? void 0 : _detail$additionalDet27.title))), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet28 = detail.additionalDetails) === null || _detail$additionalDet28 === void 0 ? void 0 : _detail$additionalDet28.estimationDetails) && /*#__PURE__*/React.createElement(WSFeeEstimation, {
|
|
22474
|
+
className: "add-details-link hover-button"
|
|
22475
|
+
}, detail === null || detail === void 0 ? void 0 : (_detail$additionalDet26 = detail.additionalDetails) === null || _detail$additionalDet26 === void 0 ? void 0 : (_detail$additionalDet27 = _detail$additionalDet26.redirectUrl) === null || _detail$additionalDet27 === void 0 ? void 0 : _detail$additionalDet27.title)), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet28 = detail.additionalDetails) === null || _detail$additionalDet28 === void 0 ? void 0 : _detail$additionalDet28.estimationDetails) && /*#__PURE__*/React.createElement(WSFeeEstimation, {
|
|
22198
22476
|
wsAdditionalDetails: detail,
|
|
22199
22477
|
workflowDetails: workflowDetails
|
|
22200
22478
|
}), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet29 = detail.additionalDetails) === null || _detail$additionalDet29 === void 0 ? void 0 : _detail$additionalDet29.estimationDetails) && /*#__PURE__*/React.createElement(ViewBreakup, {
|