@nerdjs/sales-kit 2.0.81 → 2.0.83
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/hooks/load/loadTrips.js +0 -1
- package/dist/hooks/load/loadTrips.js.map +1 -1
- package/dist/hooks/load/loadsSearchInput.js +17 -12
- package/dist/hooks/load/loadsSearchInput.js.map +1 -1
- package/dist/hooks/load/tripPanel.js +3 -3
- package/dist/hooks/load/tripPanel.js.map +1 -1
- package/dist/hooks/locationsForm/locationsForm.d.ts +5 -1
- package/dist/hooks/locationsForm/locationsForm.js +14 -16
- package/dist/hooks/locationsForm/locationsForm.js.map +1 -1
- package/dist/hooks/locationsForm/locationsFormSales.d.ts +6 -1
- package/dist/hooks/locationsForm/locationsFormSales.js +71 -48
- package/dist/hooks/locationsForm/locationsFormSales.js.map +1 -1
- package/dist/hooks/quote/form.js +32 -3
- package/dist/hooks/quote/form.js.map +1 -1
- package/dist/hooks/quote/helpers.d.ts +4 -2
- package/dist/hooks/quote/helpers.js +40 -54
- package/dist/hooks/quote/helpers.js.map +1 -1
- package/dist/hooks/quote/result.js +0 -11
- package/dist/hooks/quote/result.js.map +1 -1
- package/dist/hooks/quote/template.d.ts +1 -0
- package/dist/hooks/quote/template.js +28 -4
- package/dist/hooks/quote/template.js.map +1 -1
- package/dist/hooks/tender/form.js +147 -60
- package/dist/hooks/tender/form.js.map +1 -1
- package/dist/hooks/tender/helpers.d.ts +4 -2
- package/dist/hooks/tender/helpers.js +3 -3
- package/dist/hooks/tender/helpers.js.map +1 -1
- package/dist/redux/quote/quoteAction.d.ts +0 -8
- package/dist/redux/quote/quoteAction.js +0 -10
- package/dist/redux/quote/quoteAction.js.map +1 -1
- package/dist/redux/quote/quoteReducer.d.ts +0 -4
- package/dist/redux/quote/quoteReducer.js +1 -7
- package/dist/redux/quote/quoteReducer.js.map +1 -1
- package/dist/redux/quote/quoteSelector.d.ts +0 -11
- package/dist/redux/quote/quoteSelector.js +0 -6
- package/dist/redux/quote/quoteSelector.js.map +1 -1
- package/package.json +2 -2
|
@@ -40,7 +40,6 @@ export function LoadTrips({ load }) {
|
|
|
40
40
|
getTrips(tripIDs);
|
|
41
41
|
}, [tripIDs]);
|
|
42
42
|
return (_jsx(_Fragment, { children: appointmentTrips.map((t) => (_jsx(Grid, { children: _jsx(Card, { sx: {
|
|
43
|
-
width: 500,
|
|
44
43
|
p: 1,
|
|
45
44
|
}, children: _jsx(TripPanel, { appointmentTrip: t, loadID: load.id }) }) }, t.id))) }));
|
|
46
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadTrips.js","sourceRoot":"","sources":["../../../src/hooks/load/loadTrips.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,8BAA8B,GAC/B,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,UAAU,SAAS,CAAC,EAAE,IAAI,EAAyB;IACvD,MAAM,MAAM,GAAG,OAAO,CACpB,GAAG,EAAE,CAAC,CAAC;QACL,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;YACtB;gBACE,IAAI,EAAE,mBAAmB;gBACzB,KAAK,EAAE,IAAI,CAAC,EAAE;gBACd,UAAU,EAAE,IAAI;aACjB;SACF,CAAC;KACH,CAAC,EACF,CAAC,IAAI,CAAC,EAAE,CAAC,CACV,CAAC;IACF,mBAAmB,CAAC,MAAM,EAAE;QAC1B,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE;KACf,CAAC,CAAC;IACH,MAAM,iBAAiB,GAAG,OAAO,CAC/B,GAAG,EAAE,CA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ement as _createElement } from "react";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { Autocomplete, AutocompleteOption, Box, Button, Drawer, Grid, ListItemContent, ListItemDecorator, Typography, } from "@mui/joy";
|
|
3
|
+
import { Autocomplete, AutocompleteOption, Box, Button, Drawer, Grid, IconButton, ListItemContent, ListItemDecorator, Typography, } from "@mui/joy";
|
|
4
4
|
import { getLoadsSelectors, useLazyGetLoadsQuery } from "../../redux";
|
|
5
5
|
import { useMemo, useRef, useState } from "react";
|
|
6
6
|
import { useSelector } from "react-redux";
|
|
@@ -94,18 +94,23 @@ export function LoadSearchInput(props) {
|
|
|
94
94
|
} }), _jsx(Drawer, { open: Boolean(selectedLoad), onClose: () => setSelectedLoad(null), anchor: "right", size: "sm", slotProps: {
|
|
95
95
|
content: {
|
|
96
96
|
sx: {
|
|
97
|
-
width: { xs:
|
|
97
|
+
width: { xs: "100%", sm: 530 },
|
|
98
98
|
},
|
|
99
99
|
},
|
|
100
|
-
}, children:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
100
|
+
}, children: _jsxs(Box, { px: 1, py: 2, children: [_jsx(IconButton, { size: "sm", onClick: () => setSelectedLoad(null), sx: {
|
|
101
|
+
display: { xs: "block", sm: "none" },
|
|
102
|
+
position: "absolute",
|
|
103
|
+
right: "4px",
|
|
104
|
+
top: "8px",
|
|
105
|
+
}, children: _jsx("i", { className: "fa-solid fa-xmark" }) }), selectedLoad ? (_jsxs(Grid, { container: true, gap: 1, children: [_jsx(Grid, { children: _jsx("img", { height: "20", src: new Load(selectedLoad).getServiceLevelIcon(), alt: t("service_level") }) }), selectedLoad.reeferTemp ? (_jsx(Grid, { children: _jsx(Typography, { lineHeight: 1, color: "primary", children: _jsx("i", { className: "fa-solid fa-snowflake" }) }) })) : null, _jsxs(Grid, { xs: true, children: [_jsxs(Typography, { lineHeight: 1, fontWeight: "md", children: ["#", selectedLoad.id] }), _jsxs(Typography, { level: "body-xs", children: ["(", selectedLoad.referenceNumber, ")"] })] }), selectedLoad.status ? (_jsx(Grid, { ml: { xs: undefined, sm: "auto" }, xs: 12, sm: "auto", children: _jsx(StatusStepper, { currentStep: STATUS_MAP[selectedLoad.status], stepsLength: 6 }) })) : null, _jsx(Grid, { xs: 12, children: _jsx(Button, { ref: buttonRef, fullWidth: true, variant: "solid", color: "primary", component: Link, to: getOpenBaseUrl(selectedLoad.id), sx: {
|
|
106
|
+
textDecoration: "none !important",
|
|
107
|
+
}, onClick: () => setSelectedLoad(null), children: t("open") }) }), _jsx(Grid, { xs: 12, children: _jsx(LoadLastLocation, { lastLocation: {
|
|
108
|
+
city: selectedLoad.lastLocCity,
|
|
109
|
+
state: selectedLoad.lastLocState,
|
|
110
|
+
dateLocal: selectedLoad.lastLocTransactionTimeLocal,
|
|
111
|
+
dateUTC: selectedLoad.lastLocTransactionTimeUTC,
|
|
112
|
+
latitude: selectedLoad.lastLocLatitude,
|
|
113
|
+
longitude: selectedLoad.lastLocLongitude,
|
|
114
|
+
} }) }), _jsx(Grid, { xs: 12, children: _jsx(LoadDetailsStatus, { load: selectedLoad }) }), _jsx(Grid, { xs: 12, container: true, gap: 1, children: _jsx(LoadTrips, { load: selectedLoad }) })] })) : null] }) })] }));
|
|
110
115
|
}
|
|
111
116
|
//# sourceMappingURL=loadsSearchInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadsSearchInput.js","sourceRoot":"","sources":["../../../src/hooks/load/loadsSearchInput.tsx"],"names":[],"mappings":";;AAAA,OAAO,EACL,YAAY,EACZ,kBAAkB,EAElB,GAAG,EACH,MAAM,EACN,MAAM,EACN,IAAI,EACJ,eAAe,EACf,iBAAiB,EACjB,UAAU,GACX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,M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,kBAAkB,OAAK,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE;4BACzC,KAAC,iBAAiB,IAChB,EAAE,EAAE;oCACF,EAAE,EAAE,CAAC;iCACN,YAED,cACE,KAAK,EAAC,IAAI,EACV,GAAG,EAAE,IAAI,CAAC,mBAAmB,EAAE,EAC/B,GAAG,EAAC,eAAe,GACnB,GACgB;4BACpB,MAAC,eAAe,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,kBACrD,MAAM,CAAC,EAAE,QAAI,MAAM,CAAC,eAAe,OACrC,KAAC,UAAU,IAAC,KAAK,EAAC,SAAS,YAAE,MAAM,CAAC,QAAQ,GAAc,IAC1C,CACC,CACtB,CAAC;qBACH;;wBACC,OAAO,CACL,eAAC,kBAAkB,OAAK,KAAK,EAAE,GAAG,EAAE,MAAM,IACvC,MAAM,CACY,CACtB,CAAC;gBACN,CAAC,GACD,EACF,KAAC,MAAM,IACL,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,EAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,EACpC,MAAM,EAAC,OAAO,EACd,IAAI,EAAC,IAAI,EACT,SAAS,EAAE;oBACT,OAAO,EAAE;wBACP,EAAE,EAAE;4BACF,KAAK,EAAE,EAAE,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"loadsSearchInput.js","sourceRoot":"","sources":["../../../src/hooks/load/loadsSearchInput.tsx"],"names":[],"mappings":";;AAAA,OAAO,EACL,YAAY,EACZ,kBAAkB,EAElB,GAAG,EACH,MAAM,EACN,MAAM,EACN,IAAI,EACJ,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,UAAU,GACX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAgC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OA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EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,YAEnC,CAAC,CAAC,MAAM,CAAC,GACH,GACJ,EACP,KAAC,IAAI,IAAC,EAAE,EAAE,EAAE,YACV,KAAC,gBAAgB,IACf,YAAY,EAAE;4CACZ,IAAI,EAAE,YAAY,CAAC,WAAW;4CAC9B,KAAK,EAAE,YAAY,CAAC,YAAY;4CAChC,SAAS,EAAE,YAAY,CAAC,2BAA2B;4CACnD,OAAO,EAAE,YAAY,CAAC,yBAAyB;4CAC/C,QAAQ,EAAE,YAAY,CAAC,eAAe;4CACtC,SAAS,EAAE,YAAY,CAAC,gBAAgB;yCACzC,GACD,GACG,EACP,KAAC,IAAI,IAAC,EAAE,EAAE,EAAE,YACV,KAAC,iBAAiB,IAAC,IAAI,EAAE,YAAY,GAAI,GACpC,EACP,KAAC,IAAI,IAAC,EAAE,EAAE,EAAE,EAAE,SAAS,QAAC,GAAG,EAAE,CAAC,YAC5B,KAAC,SAAS,IAAC,IAAI,EAAE,YAAY,GAAI,GAC5B,IACF,CACR,CAAC,CAAC,CAAC,IAAI,IACJ,GACC,IACR,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { Sheet, Grid, Typography } from "@mui/joy";
|
|
|
3
3
|
import { DateTime } from "luxon";
|
|
4
4
|
const DATE_TIME_REGEX = /(\d{4})(-)(\d{2})(-)(\d{2})( )(\d{2})(:)(\d{2})(:)(\d{2})/i;
|
|
5
5
|
export const TripPanel = ({ loadID, appointmentTrip, }) => {
|
|
6
|
-
return (_jsxs(Grid, { container: true,
|
|
6
|
+
return (_jsxs(Grid, { container: true, gap: 1, children: [_jsxs(Grid, { xs: 12, children: [_jsxs(Typography, { display: "inline", level: "h4", children: [appointmentTrip?.carrier_name, " - ", appointmentTrip?.driver_name] }), _jsxs(Typography, { ml: 1, display: "inline", level: "body-sm", children: [appointmentTrip?.ship_cons?.[0]?.stopDate
|
|
7
7
|
? DateTime.fromISO(appointmentTrip.ship_cons[0].stopDate)
|
|
8
8
|
.toUTC()
|
|
9
9
|
.toFormat("LL/dd/yyyy") || ""
|
|
@@ -31,14 +31,14 @@ export const TripPanel = ({ loadID, appointmentTrip, }) => {
|
|
|
31
31
|
}
|
|
32
32
|
return (_jsx(Grid, { xs: 12, order: s.tripOrder, children: _jsx(Sheet, { variant: "soft", color: s.loadID == loadID ? "success" : "neutral", sx: {
|
|
33
33
|
borderRadius: "md",
|
|
34
|
-
}, children: _jsxs(Grid, { container: true, alignItems: "center", children: [_jsxs(Grid, { xs: 2, textAlign: "center", children: [_jsx(Typography, { children: _jsx("i", { className: `fa-regular fa-square${s.eta?.arrived ? "-check" : ""}` }) }), _jsx(Typography, { level: "body-sm", children: s.loadID })] }), _jsxs(Grid, { xs: 6, children: [_jsx(Typography, { level: "body-sm", fontWeight: "md", children: s.name }), _jsx(Typography, { level: "body-sm", children: s.shipConsType
|
|
34
|
+
}, children: _jsxs(Grid, { container: true, alignItems: "center", children: [_jsxs(Grid, { xs: 2, textAlign: "center", children: [_jsx(Typography, { children: _jsx("i", { className: `fa-regular fa-square${s.eta?.arrived ? "-check" : ""}` }) }), _jsx(Typography, { level: "body-sm", children: s.loadID })] }), _jsxs(Grid, { xs: 10, sm: 6, children: [_jsx(Typography, { level: "body-sm", fontWeight: "md", children: s.name }), _jsx(Typography, { level: "body-sm", children: s.shipConsType
|
|
35
35
|
? s.shipConsType[0].toUpperCase() +
|
|
36
36
|
s.shipConsType.substring(1)
|
|
37
37
|
: "" }), _jsxs(Typography, { level: "body-sm", children: [s.city, " ", s.state] }), _jsxs(Typography, { level: "body-sm", children: [s.timeFrom
|
|
38
38
|
? DateTime.fromISO(s.timeFrom).toUTC().toFormat("hh:mm a")
|
|
39
39
|
: "-", " ", "to", " ", s.timeTo
|
|
40
40
|
? DateTime.fromISO(s.timeTo).toUTC().toFormat("hh:mm a")
|
|
41
|
-
: "-"] })] }), arrival ? (_jsxs(Grid, { xs: "auto", children: [_jsxs(Typography, { display: "inline", level: "body-sm", fontWeight: "md", children: ["IN:", " "] }), _jsx(Typography, { display: "inline", level: "body-sm", children: arrival ?? "-" }), _jsx("br", {}), _jsxs(Typography, { display: "inline", level: "body-sm", fontWeight: "md", children: ["OUT:", " "] }), _jsx(Typography, { display: "inline", level: "body-sm", children: depart ?? "-" })] })) : eta ? (_jsxs(Grid, { xs: "auto", children: [_jsxs(Typography, { display: "inline", level: "body-sm", fontWeight: "md", children: ["ETA:", " "] }), _jsx(Typography, { display: "inline", level: "body-sm", children: eta ?? "-" }), " "] })) : (_jsx(Grid, { xs: "auto", children: _jsx(Typography, { level: "body-sm", children: "No Workflow" }) }))] }) }) }, s.id));
|
|
41
|
+
: "-"] })] }), arrival ? (_jsxs(Grid, { xs: "auto", xsOffset: 2, smOffset: 0, children: [_jsxs(Typography, { display: "inline", level: "body-sm", fontWeight: "md", children: ["IN:", " "] }), _jsx(Typography, { display: "inline", level: "body-sm", children: arrival ?? "-" }), _jsx("br", {}), _jsxs(Typography, { display: "inline", level: "body-sm", fontWeight: "md", children: ["OUT:", " "] }), _jsx(Typography, { display: "inline", level: "body-sm", children: depart ?? "-" })] })) : eta ? (_jsxs(Grid, { xs: "auto", children: [_jsxs(Typography, { display: "inline", level: "body-sm", fontWeight: "md", children: ["ETA:", " "] }), _jsx(Typography, { display: "inline", level: "body-sm", children: eta ?? "-" }), " "] })) : (_jsx(Grid, { xs: "auto", children: _jsx(Typography, { level: "body-sm", children: "No Workflow" }) }))] }) }) }, s.id));
|
|
42
42
|
})] }));
|
|
43
43
|
};
|
|
44
44
|
//# sourceMappingURL=tripPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tripPanel.js","sourceRoot":"","sources":["../../../src/hooks/load/tripPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,MAAM,eAA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S,YAC3C,GAAG,IAAI,GAAG,GACA,EAAC,GAAG,IACZ,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,EAAE,EAAE,MAAM,YACd,KAAC,UAAU,IAAC,KAAK,EAAC,SAAS,4BAAyB,GAC/C,CACR,IACI,GACD,IArFC,CAAC,CAAC,EAAE,CAsFR,CACR,CAAC;YACJ,CAAC,CAAC,IACG,CACR,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="google.maps" />
|
|
1
2
|
import { ReactElement } from "react";
|
|
2
3
|
import Location_Entity from "../../entities/location/location";
|
|
3
4
|
/**
|
|
@@ -7,6 +8,9 @@ import Location_Entity from "../../entities/location/location";
|
|
|
7
8
|
* @param {boolean} props.customerPortal is customer portal app
|
|
8
9
|
* @returns {ReactElement} LocationForm
|
|
9
10
|
*/
|
|
10
|
-
export declare function LocationForm({ onConfirm, }: {
|
|
11
|
+
export declare function LocationForm({ onConfirm, open, place, onClose, }: {
|
|
11
12
|
onConfirm?: (_location: Location_Entity) => void;
|
|
13
|
+
open: boolean;
|
|
14
|
+
place: Location_Entity | google.maps.GeocoderResult | undefined;
|
|
15
|
+
onClose: () => void;
|
|
12
16
|
}): ReactElement;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, FormControl, FormLabel, Input, Grid, Modal, ModalDialog, DialogActions, DialogContent, DialogTitle, } from "@mui/joy";
|
|
2
|
+
import { Button, FormControl, FormLabel, Input, Grid, Modal, ModalDialog, DialogActions, DialogContent, DialogTitle, Box, } from "@mui/joy";
|
|
3
3
|
import { NerdPhoneField } from "@nerdjs/nerd-ui";
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
|
-
import { useDispatch, useSelector } from "react-redux";
|
|
7
6
|
import { Location } from "../../entities/location";
|
|
8
7
|
import { locationEntityTypeGuard, } from "../../entities/location/location";
|
|
9
8
|
import { useCreateLocationMutation, useUpdateLocationMutation, } from "../../redux";
|
|
10
|
-
import { locationFormOpenSelector, selectedPlaceSelector, setLocationFormOpen, } from "../../redux/quote";
|
|
11
9
|
/**
|
|
12
10
|
*
|
|
13
11
|
* @param {object} props props
|
|
@@ -15,11 +13,8 @@ import { locationFormOpenSelector, selectedPlaceSelector, setLocationFormOpen, }
|
|
|
15
13
|
* @param {boolean} props.customerPortal is customer portal app
|
|
16
14
|
* @returns {ReactElement} LocationForm
|
|
17
15
|
*/
|
|
18
|
-
export function LocationForm({ onConfirm, }) {
|
|
16
|
+
export function LocationForm({ onConfirm, open, place, onClose, }) {
|
|
19
17
|
const { t } = useTranslation("salesKit");
|
|
20
|
-
const dispatch = useDispatch();
|
|
21
|
-
const open = useSelector(locationFormOpenSelector);
|
|
22
|
-
const place = useSelector(selectedPlaceSelector);
|
|
23
18
|
const [createLocation, { isLoading: createLoactionLoading }] = useCreateLocationMutation();
|
|
24
19
|
const [updateLocation, { isLoading: updateLocationLoading }] = useUpdateLocationMutation();
|
|
25
20
|
const [invalidPhone, setInvalidPhone] = useState(false);
|
|
@@ -126,7 +121,8 @@ export function LocationForm({ onConfirm, }) {
|
|
|
126
121
|
});
|
|
127
122
|
};
|
|
128
123
|
const handleClose = () => {
|
|
129
|
-
|
|
124
|
+
onClose();
|
|
125
|
+
setLocation((l) => ({ ...l, phone: undefined }));
|
|
130
126
|
};
|
|
131
127
|
return (_jsx(Modal, { open: open, onClose: handleClose, children: _jsxs(ModalDialog, { layout: "center", sx: (theme) => ({
|
|
132
128
|
[theme.breakpoints.only("xs")]: {
|
|
@@ -140,14 +136,16 @@ export function LocationForm({ onConfirm, }) {
|
|
|
140
136
|
maxWidth: "initial",
|
|
141
137
|
maxHeight: "initial",
|
|
142
138
|
},
|
|
143
|
-
}), children: [_jsx(DialogTitle, { children: location?.id ? t("Edit Location") : t("New Location") }), _jsx(DialogContent, { children:
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
139
|
+
}), children: [_jsx(DialogTitle, { children: location?.id ? t("Edit Location") : t("New Location") }), _jsx(DialogContent, { children: _jsx(Box, { children: _jsxs(Grid, { container: true, rowGap: 1, children: [_jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("Name") }), _jsx(Input, { fullWidth: true, onChange: (e) => setLocation((l) => ({ ...l, name: e.target.value })), size: "sm", value: location?.name ?? "", placeholder: t("Facility's name") })] }) }), _jsx(Grid, { xs: 6, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("Contact") }), _jsx(Input, { fullWidth: true, size: "sm", onChange: (e) => setLocation((l) => ({ ...l, contact: e.target.value })), value: location?.contact ?? "", placeholder: t("Contact") })] }) }), _jsx(Grid, { xs: 6, pl: 1, children: _jsx(NerdPhoneField, { onAccept: (phone) => {
|
|
140
|
+
setInvalidPhone(false);
|
|
141
|
+
setLocation((l) => ({ ...l, phone }));
|
|
142
|
+
}, onError: () => setInvalidPhone(true), value: location.phone, label: t("Phone"), inputProps: {
|
|
143
|
+
placeholder: t("Phone"),
|
|
144
|
+
size: "sm",
|
|
145
|
+
fullWidth: true,
|
|
146
|
+
} }) }), _jsxs(Grid, { xs: 12, container: true, gap: 1, children: [_jsxs(Button, { onClick: handleAccessorialSelect("liftgate"), variant: accessorialIsSelected("liftgate") ? "solid" : "soft", color: accessorialIsSelected("liftgate") ? "primary" : "neutral", children: [_jsx("i", { className: "fa-solid fa-truck-ramp pright" }), t("Lift gate required")] }), _jsxs(Button, { onClick: handleAccessorialSelect("grocery"), variant: accessorialIsSelected("grocery") ? "solid" : "soft", color: accessorialIsSelected("grocery") ? "primary" : "neutral", children: [_jsx("i", { className: "fa-solid fa-carrot pright" }), t("Grocery Warehouse")] }), _jsxs(Button, { onClick: handleAccessorialSelect("liquor_permit"), variant: accessorialIsSelected("liquor_permit") ? "solid" : "soft", color: accessorialIsSelected("liquor_permit")
|
|
147
|
+
? "primary"
|
|
148
|
+
: "neutral", children: [_jsx("i", { className: "fa-solid fa-martini-glass-citrus pright" }), t("Liquor Permit")] })] })] }) }) }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "soft", onClick: () => {
|
|
151
149
|
location.id ? handleSaveLocation() : handleCreateLocation();
|
|
152
150
|
}, loading: createLoactionLoading || updateLocationLoading, disabled: !location.name ||
|
|
153
151
|
!location.phone ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locationsForm.js","sourceRoot":"","sources":["../../../src/hooks/locationsForm/locationsForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,EACN,WAAW,EACX,SAAS,EACT,KAAK,EACL,IAAI,EACJ,KAAK,EACL,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,
|
|
1
|
+
{"version":3,"file":"locationsForm.js","sourceRoot":"","sources":["../../../src/hooks/locationsForm/locationsForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,EACN,WAAW,EACX,SAAS,EACT,KAAK,EACL,IAAI,EACJ,KAAK,EACL,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,GAAG,GACJ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAgB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAwB,EACtB,uBAAuB,GACxB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAErB;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,SAAS,EACT,IAAI,EACJ,KAAK,EACL,OAAO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M,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAC/B,EACT,KAAC,MAAM,IACL,OAAO,EAAC,MAAM,EACd,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,GAAG,EAAE;gCACZ,WAAW,EAAE,CAAC;4BAChB,CAAC,YAEA,CAAC,CAAC,QAAQ,CAAC,GACL,IACK,IACJ,GACR,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/// <reference types="google.maps" />
|
|
1
2
|
import { ReactElement } from "react";
|
|
3
|
+
import Location_Entity from "../../entities/location/location";
|
|
2
4
|
import { LocationV1_Entity } from "../../entities/locationV1";
|
|
3
5
|
export interface AppConfigApiType {
|
|
4
6
|
endpoint: string;
|
|
@@ -11,6 +13,9 @@ export interface AppConfigApiType {
|
|
|
11
13
|
}
|
|
12
14
|
interface LocationFormSalesProps {
|
|
13
15
|
onCreateLocation: (location: LocationV1_Entity) => void;
|
|
16
|
+
open: boolean;
|
|
17
|
+
place: Location_Entity | google.maps.GeocoderResult | undefined;
|
|
18
|
+
onClose: () => void;
|
|
14
19
|
onSaveLocation?: () => void;
|
|
15
20
|
}
|
|
16
21
|
/**
|
|
@@ -18,5 +23,5 @@ interface LocationFormSalesProps {
|
|
|
18
23
|
* @param {LocationFormSalesProps} props props
|
|
19
24
|
* @returns {ReactElement} LocationForm
|
|
20
25
|
*/
|
|
21
|
-
export declare function LocationFormSales({ onCreateLocation, onSaveLocation, }: LocationFormSalesProps): ReactElement;
|
|
26
|
+
export declare function LocationFormSales({ onCreateLocation, onSaveLocation, open, place, onClose, }: LocationFormSalesProps): ReactElement;
|
|
22
27
|
export {};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, FormControl, FormLabel, Input, Typography, Grid, Checkbox, CircularProgress, Select, Option, FormHelperText, Modal, ModalDialog, Textarea, Tabs, TabList, tabClasses, Tab, TabPanel, Box, Autocomplete, } from "@mui/joy";
|
|
3
|
-
import { NerdClickToCopy, NerdCurrencyFieldDataGridAdapter, NerdDatePicker, NerdFileUpload, NerdPhoneField, NerdTimePicker, showNotification, useNerdConfirm, } from "@nerdjs/nerd-ui";
|
|
4
|
-
import { useEffect, useMemo, useState } from "react";
|
|
2
|
+
import { Button, FormControl, FormLabel, Input, Typography, Grid, Checkbox, CircularProgress, Select, Option, FormHelperText, Modal, ModalDialog, Textarea, Tabs, TabList, tabClasses, Tab, TabPanel, Box, Autocomplete, useTheme, } from "@mui/joy";
|
|
3
|
+
import { NerdClickToCopy, NerdCurrencyFieldDataGridAdapter, NerdDatePicker, NerdDraggableDialog, NerdFileUpload, NerdPhoneField, NerdTimePicker, showNotification, useNerdConfirm, } from "@nerdjs/nerd-ui";
|
|
4
|
+
import { useEffect, useMemo, useState, } from "react";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
|
-
import { useDispatch
|
|
7
|
-
import { locationEntityTypeGuard } from "../../entities/location/location";
|
|
8
|
-
import { locationFormOpenSelector, selectedPlaceSelector, setLocationFormOpen, } from "../../redux/quote";
|
|
6
|
+
import { useDispatch } from "react-redux";
|
|
7
|
+
import { locationEntityTypeGuard, } from "../../entities/location/location";
|
|
9
8
|
import { useCreateLocationAccessorialV1Mutation, useCreateLocationV1Mutation, useDeleteLocationAccessorialsV1Mutation, useGetAccessorialsV1Query, useGetLocationAccessorialsV1Query, useGetLocationV1Query, useUpdateLocationAccessorialsV1Mutation, useUpdateLocationV1Mutation, } from "../../redux/locationV1";
|
|
10
9
|
import { DateTime } from "luxon";
|
|
11
10
|
import { DataGridPremium, GridActionsCellItem, GridRowEditStopReasons, GridRowModes, } from "@mui/x-data-grid-premium";
|
|
@@ -13,16 +12,14 @@ import { useDeleteArcherFileMutation, useShareArcherFileMutation, useUploadArche
|
|
|
13
12
|
import { Person } from "../../entities";
|
|
14
13
|
import { usdFormatter } from "../quote/constants";
|
|
15
14
|
import { useGetLocationFilesQuery, useGetPeopleQuery } from "../../redux";
|
|
15
|
+
import { useMediaQuery } from "@mui/system";
|
|
16
16
|
/**
|
|
17
17
|
*
|
|
18
18
|
* @param {LocationFormSalesProps} props props
|
|
19
19
|
* @returns {ReactElement} LocationForm
|
|
20
20
|
*/
|
|
21
|
-
export function LocationFormSales({ onCreateLocation, onSaveLocation, }) {
|
|
21
|
+
export function LocationFormSales({ onCreateLocation, onSaveLocation, open, place, onClose, }) {
|
|
22
22
|
const { t } = useTranslation("salesKit");
|
|
23
|
-
const dispatch = useDispatch();
|
|
24
|
-
const open = useSelector(locationFormOpenSelector);
|
|
25
|
-
const place = useSelector(selectedPlaceSelector);
|
|
26
23
|
const [createLocation] = useCreateLocationV1Mutation();
|
|
27
24
|
const [updateLocation] = useUpdateLocationV1Mutation();
|
|
28
25
|
const [validationObject, setValidationObject] = useState({
|
|
@@ -159,7 +156,7 @@ export function LocationFormSales({ onCreateLocation, onSaveLocation, }) {
|
|
|
159
156
|
setValue(null);
|
|
160
157
|
setBody({});
|
|
161
158
|
setLocation({});
|
|
162
|
-
|
|
159
|
+
onClose();
|
|
163
160
|
};
|
|
164
161
|
const getGoogleAddresses = (searchText, init) => {
|
|
165
162
|
if (init)
|
|
@@ -175,23 +172,16 @@ export function LocationFormSales({ onCreateLocation, onSaveLocation, }) {
|
|
|
175
172
|
setLoadingMapsLocations(false);
|
|
176
173
|
});
|
|
177
174
|
};
|
|
178
|
-
return (_jsx(
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
maxHeight: "initial",
|
|
189
|
-
},
|
|
190
|
-
}), "aria-labelledby": "edit-location-modal-dialog-title", children: loading ? (_jsx(Box, { sx: {
|
|
191
|
-
display: "flex",
|
|
192
|
-
justifyContent: "center",
|
|
193
|
-
alignItems: "center",
|
|
194
|
-
}, children: _jsx(CircularProgress, {}) })) : (_jsxs(_Fragment, { children: [_jsx(Typography, { id: "edit-location-modal-dialog-title", level: "h4", children: location?.id ? t("Edit Location") : t("New Location") }), _jsxs(Tabs, { defaultValue: 0, sx: {
|
|
175
|
+
return (_jsx(Wrapper, { handleClose: handleClose, open: open, children: loading ? (_jsx(Box, { sx: {
|
|
176
|
+
display: "flex",
|
|
177
|
+
justifyContent: "center",
|
|
178
|
+
alignItems: "center",
|
|
179
|
+
height: { xs: "100%", sm: "none" },
|
|
180
|
+
}, children: _jsx(CircularProgress, {}) })) : (_jsxs(Box, { display: "flex", flexDirection: "column", height: "100%", children: [_jsx(Typography, { id: "draggable-title", level: "h4", sx: {
|
|
181
|
+
cursor: "move",
|
|
182
|
+
}, children: location?.id ? t("Edit Location") : t("New Location") }), _jsx(Box, { id: "draggable-content", sx: {
|
|
183
|
+
overflow: "auto",
|
|
184
|
+
}, children: _jsxs(Tabs, { defaultValue: 0, sx: {
|
|
195
185
|
bgcolor: "transparent",
|
|
196
186
|
overflowY: "auto",
|
|
197
187
|
overflowX: "hidden",
|
|
@@ -205,14 +195,25 @@ export function LocationFormSales({ onCreateLocation, onSaveLocation, }) {
|
|
|
205
195
|
bgcolor: "background.surface",
|
|
206
196
|
},
|
|
207
197
|
}, children: [_jsx(Tab, { disableIndicator: true, children: "Main" }), location.id ? (_jsxs(_Fragment, { children: [_jsx(Tab, { disableIndicator: true, children: "Accessorials" }), _jsx(Tab, { disableIndicator: true, children: "Documents" })] })) : null] }), _jsx(TabPanel, { value: 0, sx: {
|
|
208
|
-
|
|
209
|
-
overflowX: "hidden",
|
|
198
|
+
overflow: "auto",
|
|
210
199
|
}, children: _jsxs(Grid, { container: true, spacing: 0.5, children: [_jsx(Grid, { xs: 12, children: _jsx(Typography, { level: "h4", color: "neutral", children: _jsx("i", { className: "fa-solid fa-location-dot" }) }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("Name") }), _jsx(Input, { fullWidth: true, onChange: (e) => {
|
|
211
|
-
setLocation((l) => ({
|
|
212
|
-
|
|
200
|
+
setLocation((l) => ({
|
|
201
|
+
...l,
|
|
202
|
+
name: e.target.value,
|
|
203
|
+
}));
|
|
204
|
+
setBody((l) => ({
|
|
205
|
+
...l,
|
|
206
|
+
name: e.target.value,
|
|
207
|
+
}));
|
|
213
208
|
}, size: "sm", value: location?.name ?? "", placeholder: t("Facility's name") })] }) }), _jsx(Grid, { xs: 8, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Line 1" }), _jsx(Input, { fullWidth: true, readOnly: true, size: "sm", value: location?.line1 ?? "", placeholder: t("Line 1") })] }) }), _jsx(Grid, { xs: 4, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "#" }), _jsx(Input, { fullWidth: true, size: "sm", value: location?.line2 ?? "", onChange: (e) => {
|
|
214
|
-
setLocation((l) => ({
|
|
215
|
-
|
|
209
|
+
setLocation((l) => ({
|
|
210
|
+
...l,
|
|
211
|
+
line2: e.target.value,
|
|
212
|
+
}));
|
|
213
|
+
setBody((l) => ({
|
|
214
|
+
...l,
|
|
215
|
+
line2: e.target.value,
|
|
216
|
+
}));
|
|
216
217
|
} })] }) }), _jsx(Grid, { xs: 6, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "City" }), _jsx(Input, { fullWidth: true, readOnly: true, size: "sm", value: location?.city ?? "", placeholder: t("City") })] }) }), _jsx(Grid, { xs: 3, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "State" }), _jsx(Input, { fullWidth: true, readOnly: true, size: "sm", value: location?.state ?? "", placeholder: t("State") })] }) }), _jsx(Grid, { xs: 3, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "ZIP" }), _jsx(Input, { fullWidth: true, readOnly: true, size: "sm", value: location?.zip ?? "", placeholder: t("ZIP") })] }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Address" }), _jsx(Autocomplete, { value: value, options: googleMapsPredictions || [], onInputChange: (_e, v) => {
|
|
217
218
|
getGoogleAddresses(v, false);
|
|
218
219
|
}, onChange: (_e, v) => setValue(v), getOptionLabel: (option) => `${option.structured_formatting.main_text}, ${option.structured_formatting.secondary_text}`, isOptionEqualToValue: (o, v) => o.place_id === v.place_id })] }) }), _jsx(Grid, { xs: 12, mt: 1, children: _jsx(Typography, { level: "h4", color: "neutral", children: _jsx("i", { className: "fa-solid fa-address-card" }) }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Emails" }), _jsx(Input, { fullWidth: true, onChange: (e) => {
|
|
@@ -244,7 +245,10 @@ export function LocationFormSales({ onCreateLocation, onSaveLocation, }) {
|
|
|
244
245
|
...validationObject,
|
|
245
246
|
phone: true,
|
|
246
247
|
});
|
|
247
|
-
setLocation((l) => ({
|
|
248
|
+
setLocation((l) => ({
|
|
249
|
+
...l,
|
|
250
|
+
phone: value,
|
|
251
|
+
}));
|
|
248
252
|
setBody((l) => ({ ...l, phone: value }));
|
|
249
253
|
}, onError: () => {
|
|
250
254
|
setValidationObject({
|
|
@@ -420,7 +424,9 @@ export function LocationFormSales({ onCreateLocation, onSaveLocation, }) {
|
|
|
420
424
|
}));
|
|
421
425
|
}, slotProps: {
|
|
422
426
|
listbox: {
|
|
423
|
-
sx: {
|
|
427
|
+
sx: {
|
|
428
|
+
zIndex: (theme) => theme.zIndex.modal,
|
|
429
|
+
},
|
|
424
430
|
},
|
|
425
431
|
}, children: [_jsx(Option, { value: 0, children: "None" }, 0), [1, 2, 3, 4, 5].map((v) => (_jsx(Option, { value: v, children: v }, v))), _jsx(Option, { value: 14, children: "ASAP" }, 14)] })] }) }), _jsx(Grid, { xs: 4, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Channel" }), _jsx(Select, { size: "sm", defaultValue: location.scheduling_channel, onChange: (_e, value) => {
|
|
426
432
|
setLocation((l) => ({
|
|
@@ -433,7 +439,9 @@ export function LocationFormSales({ onCreateLocation, onSaveLocation, }) {
|
|
|
433
439
|
}));
|
|
434
440
|
}, slotProps: {
|
|
435
441
|
listbox: {
|
|
436
|
-
sx: {
|
|
442
|
+
sx: {
|
|
443
|
+
zIndex: (theme) => theme.zIndex.modal,
|
|
444
|
+
},
|
|
437
445
|
},
|
|
438
446
|
}, children: [
|
|
439
447
|
{ label: "None", value: "" },
|
|
@@ -569,18 +577,33 @@ export function LocationFormSales({ onCreateLocation, onSaveLocation, }) {
|
|
|
569
577
|
}, children: _jsx(Box, { sx: {
|
|
570
578
|
width: { xs: "85vw", lg: "40vw" },
|
|
571
579
|
height: { xs: "55vh", lg: "70vh" },
|
|
572
|
-
}, children: _jsx(DocumentsList, { locationID: location.id }) }) })) : null] }), _jsxs(Box, { sx: {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
580
|
+
}, children: _jsx(DocumentsList, { locationID: location.id }) }) })) : null] }) }), _jsxs(Box, { sx: {
|
|
581
|
+
display: "flex",
|
|
582
|
+
pt: 2,
|
|
583
|
+
gap: 1,
|
|
584
|
+
justifyContent: "flex-end",
|
|
585
|
+
}, children: [_jsx(Button, { variant: "soft", color: "neutral", onClick: () => {
|
|
586
|
+
handleClose();
|
|
587
|
+
}, children: t("Cancel") }), _jsx(Button, { variant: "soft", onClick: () => {
|
|
588
|
+
handleSaveLocation();
|
|
589
|
+
handleClose();
|
|
590
|
+
}, disabled: Object.values(validationObject).every(Boolean) ? false : true, children: location.id ? t("Save") : t("Create") })] })] })) }));
|
|
583
591
|
}
|
|
592
|
+
const Wrapper = ({ children, open, handleClose, }) => {
|
|
593
|
+
const theme = useTheme();
|
|
594
|
+
const matches = useMediaQuery(theme.breakpoints.down("sm"));
|
|
595
|
+
if (matches)
|
|
596
|
+
return (_jsx(Modal, { open: open, onClose: handleClose, children: _jsx(ModalDialog, { layout: "fullscreen", children: children }) }));
|
|
597
|
+
else if (open)
|
|
598
|
+
return (_jsx(NerdDraggableDialog, { draggableProps: {
|
|
599
|
+
handle: "#draggable-title",
|
|
600
|
+
cancel: "#draggable-content",
|
|
601
|
+
}, resizable: true, initialHeight: 600, initialWidth: 700, resizableProps: {
|
|
602
|
+
minConstraints: [300, 300],
|
|
603
|
+
}, children: children }));
|
|
604
|
+
else
|
|
605
|
+
return _jsx(_Fragment, {});
|
|
606
|
+
};
|
|
584
607
|
/**
|
|
585
608
|
*
|
|
586
609
|
* @param root0
|