@bjsdistribution/dms-client-return 0.1.77-prod → 0.1.78-prod
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/common/utils.js +8 -7
- package/dist/common/utils.js.map +1 -1
- package/dist/components/client-portal/OutstandingTable.js +122 -116
- package/dist/components/client-portal/OutstandingTable.js.map +1 -1
- package/dist/components/fakeData.js.map +1 -1
- package/dist/components/order-daily-overview/common/fakedata.js.map +1 -1
- package/dist/components/order-daily-overview/header-filters/overViewFilter.js +7 -11
- package/dist/components/order-daily-overview/header-filters/overViewFilter.js.map +1 -1
- package/dist/components/order-daily-overview/return-after-table/table/OrderTable.js +32 -30
- package/dist/components/order-daily-overview/return-after-table/table/OrderTable.js.map +1 -1
- package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.js +58 -54
- package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.js.map +1 -1
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js +157 -151
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js.map +1 -1
- package/dist/components/order-view/details-filters/left-side-filters/dropdowns/OptionsDropDown.js.map +1 -1
- package/dist/components/order-view/fakedata.js.map +1 -1
- package/dist/components/order-view/general-information/dropdowns/Print.js +11 -11
- package/dist/components/order-view/general-information/dropdowns/Print.js.map +1 -1
- package/dist/components/order-view/index.js +154 -133
- package/dist/components/order-view/index.js.map +1 -1
- package/dist/components/order-view/order-actions/Dropdown.js +3 -3
- package/dist/components/order-view/order-actions/Dropdown.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.js +47 -45
- package/dist/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/cancel-order/ReturnReason.js +36 -23
- package/dist/components/order-view/order-actions/actions/cancel-order/ReturnReason.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/cancel-order/index.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.js +25 -23
- package/dist/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.js +90 -88
- package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.js +16 -16
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.js +24 -22
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.js +56 -51
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.js +26 -24
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.js +30 -29
- package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/split-order/SplitOrderTable.js +25 -23
- package/dist/components/order-view/order-actions/actions/split-order/SplitOrderTable.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js +37 -35
- package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/services-section/OrderServices.js +20 -18
- package/dist/components/order-view/order-details/expanded-content/services-section/OrderServices.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js +27 -22
- package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js.map +1 -1
- package/dist/components/order-view/order-details/helper.js.map +1 -1
- package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js +179 -151
- package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js.map +1 -1
- package/dist/components/order-view/store.js +160 -144
- package/dist/components/order-view/store.js.map +1 -1
- package/dist/components/order-view/toolbox-resources/collapsed-content/index.js +16 -0
- package/dist/components/order-view/toolbox-resources/collapsed-content/index.js.map +1 -0
- package/dist/components/order-view/toolbox-resources/expanded-content/index.js +534 -0
- package/dist/components/order-view/toolbox-resources/expanded-content/index.js.map +1 -0
- package/dist/components/utils.js +5 -4
- package/dist/components/utils.js.map +1 -1
- package/dist/types/common/utils.d.ts +1 -0
- package/dist/types/components/order-view/order-actions/Dropdown.d.ts +1 -0
- package/dist/types/components/order-view/store.d.ts +6 -0
- package/dist/types/components/order-view/toolbox-resources/collapsed-content/index.d.ts +2 -0
- package/dist/types/components/order-view/toolbox-resources/expanded-content/index.d.ts +2 -0
- package/dist/types/components/utils.d.ts +1 -0
- package/package.json +2 -3
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
import { jsxs as v, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as Z, useEffect as o, useRef as Ut } from "react";
|
|
3
3
|
import p from "styled-components";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { useAxios as
|
|
11
|
-
import { useOrderId as
|
|
12
|
-
import { useLocation as
|
|
13
|
-
import { notification as
|
|
14
|
-
import
|
|
15
|
-
import { useSubContracterData as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { useAllOrderStatus as
|
|
19
|
-
import { POSTCODE_LABEL as
|
|
20
|
-
import { getEnvironment as
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
|
|
4
|
+
import Nt from "./order-details/index.js";
|
|
5
|
+
import kt from "./notes/index.js";
|
|
6
|
+
import Ht from "./system-event-logs/expanded-content/index.js";
|
|
7
|
+
import Ft from "./general-information/index.js";
|
|
8
|
+
import Kt from "./products-info/index.js";
|
|
9
|
+
import Vt from "./order-actions/index.js";
|
|
10
|
+
import { useAxios as u, useApiHook as i, DocumentTitle as jt } from "@bjsdistribution/dms-component-library";
|
|
11
|
+
import { useOrderId as qt, useGsitOrderId as zt, useOrderDetails as Jt, usePrevOrderDetails as Yt, useStatusDetails as Zt, useDepotOptions as Qt, useCustomerInfo as Bt, useLocationOptions as Mt, useOrderProductsResources as Wt, useGsitCUstomerId as Xt, useOrderProductId as te, useCUstomerId as ee, useRouteId as oe, useLiveRecalling as se, useGlobalStateHitOrder as re, usegetClientData as ae, useGlobalEscData as ne, useEpodImages as ie, skeletonTomTom as de, useOrderProductSystemLogs as ce } from "./store.js";
|
|
12
|
+
import { useLocation as le } from "react-router-dom";
|
|
13
|
+
import { notification as ue, message as Q } from "antd";
|
|
14
|
+
import fe from "./details-filters/DetailsFilters.js";
|
|
15
|
+
import { useSubContracterData as me, useIsShowNorthSouth as pe, useClientPortal as ge } from "../store.js";
|
|
16
|
+
import he from "./notification/index.js";
|
|
17
|
+
import De from "./order-resources/expanded-content/index.js";
|
|
18
|
+
import { useAllOrderStatus as _e, setResourcesCall as Se } from "./order-actions/store.js";
|
|
19
|
+
import { POSTCODE_LABEL as Ie } from "../../common/utils.js";
|
|
20
|
+
import { getEnvironment as Oe } from "./utils.js";
|
|
21
|
+
import Pe from "./toolbox-resources/expanded-content/index.js";
|
|
22
|
+
import { useAtom as B } from "jotai";
|
|
23
|
+
function Qe({ locationloading: M }) {
|
|
24
|
+
ue.config({
|
|
24
25
|
top: 150
|
|
25
26
|
});
|
|
26
|
-
const [s, y] =
|
|
27
|
+
const [s, y] = qt(), [W, G] = zt(), [a, X] = Jt(), [, tt] = Yt(), [, g] = Z(!1), [, et] = Zt(), [, x] = Qt(), [R, ot] = Bt(), [, st] = Mt(), [rt, b] = Wt(), [h, at] = Xt(), [, nt] = te(), [, it] = ee(), [, dt] = oe(), [$] = se(), [, ct] = me(), [w] = re(), [, lt] = _e(), U = a?.id, [N] = B(Se), [, ut] = ae(), [, k] = ne(), [, ft] = pe(), [, mt] = ie(), [, pt] = B(de), [gt] = ge();
|
|
27
28
|
o(() => {
|
|
28
|
-
|
|
29
|
-
}, [
|
|
29
|
+
lt(a?.status_value);
|
|
30
|
+
}, [a?.status_value]);
|
|
30
31
|
const {
|
|
31
32
|
data: D,
|
|
32
|
-
fetchData:
|
|
33
|
+
fetchData: ht,
|
|
33
34
|
loading: H
|
|
34
|
-
} =
|
|
35
|
+
} = u({
|
|
35
36
|
endpoint: "/events/get/event/",
|
|
36
37
|
method: "GET",
|
|
37
38
|
pagination: { page: 1, per_page: 100 },
|
|
@@ -43,10 +44,10 @@ function He({ locationloading: Y }) {
|
|
|
43
44
|
}
|
|
44
45
|
],
|
|
45
46
|
showLoader: !1
|
|
46
|
-
}),
|
|
47
|
-
data:
|
|
48
|
-
loading:
|
|
49
|
-
setShouldPerformAction:
|
|
47
|
+
}), _ = le(), [F, Dt] = Z([]), {
|
|
48
|
+
data: _t,
|
|
49
|
+
loading: St,
|
|
50
|
+
setShouldPerformAction: It
|
|
50
51
|
} = i({
|
|
51
52
|
endpoint: "orders/",
|
|
52
53
|
method: "GET",
|
|
@@ -54,42 +55,42 @@ function He({ locationloading: Y }) {
|
|
|
54
55
|
performAction: !1
|
|
55
56
|
});
|
|
56
57
|
o(() => {
|
|
57
|
-
const t = new URLSearchParams(
|
|
58
|
+
const t = new URLSearchParams(_.search);
|
|
58
59
|
if (t?.toString()) {
|
|
59
60
|
const e = [];
|
|
60
|
-
t?.forEach((
|
|
61
|
-
|
|
61
|
+
t?.forEach((n, m) => {
|
|
62
|
+
m === "order" ? e.push({
|
|
62
63
|
field: "gsit_order_id",
|
|
63
64
|
op: "=",
|
|
64
|
-
value:
|
|
65
|
+
value: n
|
|
65
66
|
}) : e.push({
|
|
66
|
-
field:
|
|
67
|
+
field: m,
|
|
67
68
|
op: "=",
|
|
68
|
-
value:
|
|
69
|
+
value: n
|
|
69
70
|
});
|
|
70
|
-
}),
|
|
71
|
+
}), Dt(e), F && (It(!0), y(_t?.data[0]?.id));
|
|
71
72
|
} else {
|
|
72
|
-
const e =
|
|
73
|
+
const e = _.pathname.split("/");
|
|
73
74
|
y(e[e?.length - 1]);
|
|
74
75
|
}
|
|
75
|
-
}, [
|
|
76
|
+
}, [_.search, St]);
|
|
76
77
|
const {
|
|
77
78
|
data: c,
|
|
78
|
-
loading:
|
|
79
|
-
setShouldPerformAction:
|
|
79
|
+
loading: S,
|
|
80
|
+
setShouldPerformAction: Ot
|
|
80
81
|
} = i({
|
|
81
82
|
endpoint: `orders/${s}`,
|
|
82
83
|
method: "GET",
|
|
83
84
|
performAction: !1
|
|
84
85
|
}), {
|
|
85
|
-
data:
|
|
86
|
+
data: f,
|
|
86
87
|
loading: I,
|
|
87
|
-
setShouldPerformAction:
|
|
88
|
+
setShouldPerformAction: K
|
|
88
89
|
} = i({
|
|
89
90
|
endpoint: `/orders/get_live_status/${s}`,
|
|
90
91
|
method: "GET",
|
|
91
92
|
performAction: !1
|
|
92
|
-
}), { data: O, loading:
|
|
93
|
+
}), { data: O, loading: P } = i({
|
|
93
94
|
endpoint: "/depot/",
|
|
94
95
|
method: "GET",
|
|
95
96
|
filters: [{ field: "visibility", op: "=", value: !0 }],
|
|
@@ -97,15 +98,15 @@ function He({ locationloading: Y }) {
|
|
|
97
98
|
pagination: { is_pagination: !1 }
|
|
98
99
|
});
|
|
99
100
|
o(() => {
|
|
100
|
-
s && (
|
|
101
|
-
}, [s,
|
|
102
|
-
if (g(
|
|
101
|
+
s && (Ot(w), K(!$));
|
|
102
|
+
}, [s, $, w]), o(() => {
|
|
103
|
+
if (g(S), c && c.data) {
|
|
103
104
|
const t = c?.data;
|
|
104
|
-
|
|
105
|
+
X(t[0]), it(t[0]?.customer_id), dt(t[0]?.order_routes?.route_id), G(t[0]?.gsit_order_id), nt(t[0]?.id), ot({
|
|
105
106
|
recipient_name: t[0]?.order_recipient?.recipient_name ?? null,
|
|
106
107
|
postcode: t[0]?.order_recipient?.postcode ?? null,
|
|
107
108
|
return_action: t[0]?.return_action ?? null
|
|
108
|
-
}),
|
|
109
|
+
}), tt(t[0]), c?.data[0]?.gsit_order_id ? localStorage.setItem(
|
|
109
110
|
"dbSyncAPICall",
|
|
110
111
|
JSON.stringify({
|
|
111
112
|
status: !0,
|
|
@@ -116,44 +117,44 @@ function He({ locationloading: Y }) {
|
|
|
116
117
|
return () => {
|
|
117
118
|
localStorage.removeItem("dbSyncAPICall");
|
|
118
119
|
};
|
|
119
|
-
}, [
|
|
120
|
-
if (g(I),
|
|
121
|
-
const t =
|
|
122
|
-
t &&
|
|
120
|
+
}, [S]), o(() => {
|
|
121
|
+
if (g(I), f && f.data) {
|
|
122
|
+
const t = f?.data;
|
|
123
|
+
t && et(t);
|
|
123
124
|
}
|
|
124
|
-
}, [I,
|
|
125
|
+
}, [I, f]);
|
|
125
126
|
const {
|
|
126
|
-
fetchData:
|
|
127
|
-
loading:
|
|
128
|
-
data:
|
|
129
|
-
} =
|
|
127
|
+
fetchData: Pt,
|
|
128
|
+
loading: Et,
|
|
129
|
+
data: E
|
|
130
|
+
} = u({
|
|
130
131
|
endpoint: "/v1/client/list",
|
|
131
132
|
method: "GET"
|
|
132
133
|
});
|
|
133
134
|
o(() => {
|
|
134
|
-
s && (
|
|
135
|
+
s && (Pt(), yt());
|
|
135
136
|
}, [s]), o(() => {
|
|
136
|
-
if (
|
|
137
|
-
const t =
|
|
138
|
-
|
|
137
|
+
if (E && E?.data) {
|
|
138
|
+
const t = E?.data;
|
|
139
|
+
ut(t);
|
|
139
140
|
}
|
|
140
|
-
}, [
|
|
141
|
-
if (g(
|
|
141
|
+
}, [Et]), o(() => {
|
|
142
|
+
if (g(P), O && O.data) {
|
|
142
143
|
const t = O?.data;
|
|
143
144
|
if (t.length > 0) {
|
|
144
|
-
const e = t?.map((
|
|
145
|
-
label:
|
|
146
|
-
value:
|
|
145
|
+
const e = t?.map((n) => ({
|
|
146
|
+
label: n.name,
|
|
147
|
+
value: n.id
|
|
147
148
|
}));
|
|
148
|
-
|
|
149
|
+
x(e);
|
|
149
150
|
} else
|
|
150
|
-
|
|
151
|
+
x([]);
|
|
151
152
|
}
|
|
152
|
-
}, [
|
|
153
|
+
}, [P]);
|
|
153
154
|
const {
|
|
154
|
-
data:
|
|
155
|
+
data: V,
|
|
155
156
|
setShouldPerformAction: d,
|
|
156
|
-
loading:
|
|
157
|
+
loading: At
|
|
157
158
|
} = i({
|
|
158
159
|
endpoint: `/orders/${s}/order_resources/`,
|
|
159
160
|
method: "GET",
|
|
@@ -161,44 +162,63 @@ function He({ locationloading: Y }) {
|
|
|
161
162
|
showLoader: !1
|
|
162
163
|
});
|
|
163
164
|
o(() => {
|
|
164
|
-
s && (
|
|
165
|
+
s && (N ? (d(!1), setTimeout(() => {
|
|
165
166
|
d(!0);
|
|
166
167
|
}, 200)) : d(!0));
|
|
167
|
-
}, [s, d,
|
|
168
|
+
}, [s, d, N]), o(() => {
|
|
168
169
|
s && d(!0);
|
|
169
170
|
}, [s, d]), o(() => {
|
|
170
|
-
s &&
|
|
171
|
-
}, [
|
|
172
|
-
|
|
171
|
+
s && b(V);
|
|
172
|
+
}, [V, rt, b]);
|
|
173
|
+
const {
|
|
174
|
+
data: A,
|
|
175
|
+
loading: j,
|
|
176
|
+
fetchData: Lt
|
|
177
|
+
} = u({
|
|
178
|
+
endpoint: `orders/${s}/epod_resources/?finance=false`,
|
|
179
|
+
method: "GET"
|
|
180
|
+
});
|
|
181
|
+
o(() => {
|
|
182
|
+
s && (Lt(), a?.order_recipient?.postcode != null && J({
|
|
183
|
+
endPointQuery: `?postcode=${a?.order_recipient?.postcode}`
|
|
184
|
+
}));
|
|
185
|
+
}, [s]), o(() => {
|
|
186
|
+
if (A && A?.data) {
|
|
187
|
+
const t = A?.data?.resources;
|
|
188
|
+
mt(t);
|
|
189
|
+
}
|
|
190
|
+
pt(j);
|
|
191
|
+
}, [j]), o(() => () => {
|
|
192
|
+
at((t) => ({ ...t, id: void 0 }));
|
|
173
193
|
}, []);
|
|
174
194
|
const {
|
|
175
|
-
data:
|
|
176
|
-
loading:
|
|
177
|
-
setShouldPerformAction:
|
|
195
|
+
data: L,
|
|
196
|
+
loading: Ct,
|
|
197
|
+
setShouldPerformAction: q
|
|
178
198
|
} = i({
|
|
179
199
|
endpoint: `/return_locations/?customer_id=${h?.id}`,
|
|
180
200
|
method: "GET",
|
|
181
201
|
performAction: !1
|
|
182
202
|
});
|
|
183
203
|
o(() => {
|
|
184
|
-
h?.id ?
|
|
204
|
+
h?.id ? q(!0) : q(!1);
|
|
185
205
|
}, [h]), o(() => {
|
|
186
|
-
if (
|
|
187
|
-
const t =
|
|
206
|
+
if (L && L?.data) {
|
|
207
|
+
const t = L?.data?.map((e) => ({
|
|
188
208
|
label: e?.location_name + ", " + e?.postcode,
|
|
189
209
|
value: e?.token,
|
|
190
210
|
is_default: e?.is_default === "True"
|
|
191
211
|
}));
|
|
192
|
-
|
|
212
|
+
st(t);
|
|
193
213
|
}
|
|
194
|
-
}, [
|
|
195
|
-
const [,
|
|
214
|
+
}, [Ct]);
|
|
215
|
+
const [, Tt] = ce();
|
|
196
216
|
o(() => {
|
|
197
|
-
D && D?.data &&
|
|
198
|
-
}, [H]), o(() => (
|
|
217
|
+
D && D?.data && Tt(D?.data);
|
|
218
|
+
}, [H]), o(() => (W && ht(), () => {
|
|
199
219
|
G(void 0);
|
|
200
220
|
}), [U]);
|
|
201
|
-
const { data: l, loading:
|
|
221
|
+
const { data: l, loading: vt } = i({
|
|
202
222
|
endpoint: "/sub-contractor/sub_contractor/get/",
|
|
203
223
|
method: "GET"
|
|
204
224
|
});
|
|
@@ -210,99 +230,100 @@ function He({ locationloading: Y }) {
|
|
|
210
230
|
name: e.name
|
|
211
231
|
})
|
|
212
232
|
);
|
|
213
|
-
|
|
233
|
+
ct(t);
|
|
214
234
|
}
|
|
215
|
-
}, [l, l,
|
|
235
|
+
}, [l, l, vt]);
|
|
216
236
|
const {
|
|
217
|
-
data:
|
|
218
|
-
fetchData:
|
|
219
|
-
loading:
|
|
220
|
-
} =
|
|
237
|
+
data: z,
|
|
238
|
+
fetchData: yt,
|
|
239
|
+
loading: Gt
|
|
240
|
+
} = u({
|
|
221
241
|
endpoint: `/orders/escalations/${s}`,
|
|
222
242
|
method: "GET"
|
|
223
243
|
});
|
|
224
244
|
o(() => {
|
|
225
|
-
if (
|
|
226
|
-
const e =
|
|
227
|
-
(
|
|
228
|
-
),
|
|
229
|
-
|
|
245
|
+
if (z?.data) {
|
|
246
|
+
const e = z?.data?.sort(
|
|
247
|
+
(m, wt) => new Date(wt?.created_at).getTime() - new Date(m?.created_at).getTime()
|
|
248
|
+
), n = e != null && e.length > 0;
|
|
249
|
+
k(n ? e : []);
|
|
230
250
|
}
|
|
231
|
-
}, [
|
|
232
|
-
const
|
|
251
|
+
}, [Gt]);
|
|
252
|
+
const xt = `${R?.recipient_name}, ${R?.postcode}`, C = Oe(), { fetchData: J } = u({
|
|
233
253
|
endpoint: "v1/orders/customs/postcode/check/",
|
|
234
254
|
method: "GET"
|
|
235
|
-
}),
|
|
255
|
+
}), Rt = async () => {
|
|
236
256
|
try {
|
|
237
|
-
const t = await
|
|
238
|
-
endPointQuery: `?postcode=${
|
|
257
|
+
const t = await J({
|
|
258
|
+
endPointQuery: `?postcode=${a?.order_recipient?.postcode}`
|
|
239
259
|
});
|
|
240
260
|
if (t?.code === 200) {
|
|
241
261
|
const e = t?.data?.order_customs_postcodes;
|
|
242
|
-
|
|
262
|
+
ft(e);
|
|
243
263
|
} else
|
|
244
|
-
|
|
264
|
+
Q.open({
|
|
245
265
|
type: "error",
|
|
246
266
|
//@ts-ignore
|
|
247
267
|
content: t?.error || "Something went wrong"
|
|
248
268
|
});
|
|
249
269
|
} catch {
|
|
250
|
-
|
|
270
|
+
Q.open({
|
|
251
271
|
type: "error",
|
|
252
|
-
content: `Failed to check ${
|
|
272
|
+
content: `Failed to check ${Ie.toLowerCase()}. Please try again.`
|
|
253
273
|
});
|
|
254
274
|
}
|
|
255
|
-
},
|
|
275
|
+
}, T = {
|
|
256
276
|
UK: /\b(?:[A-Za-z][A-HJ-Ya-hj-y]?[0-9][0-9A-Za-z]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})\b/,
|
|
257
277
|
IRISH: /^(?:^[AC-FHKNPRTV-Y][0-9]{2}|D6W)[ -]?[0-9AC-FHKNPRTV-Y]{4}$/,
|
|
258
278
|
US: /^\d{5}(-\d{4})?$/
|
|
259
|
-
},
|
|
279
|
+
}, bt = C === "development" || C === "staging" || C === "release_uk", $t = (t) => bt ? T.UK.test(t) || T.IRISH.test(t) : T.US.test(t), Y = Ut(!1);
|
|
260
280
|
return o(() => {
|
|
261
|
-
const t =
|
|
262
|
-
t &&
|
|
263
|
-
}, [
|
|
264
|
-
/* @__PURE__ */ r(
|
|
265
|
-
/* @__PURE__ */ r(
|
|
266
|
-
/* @__PURE__ */ r(
|
|
267
|
-
/* @__PURE__ */ r(
|
|
281
|
+
const t = a?.order_recipient?.postcode?.trim();
|
|
282
|
+
t && $t(t) && !Y.current && (Y.current = !0, Rt());
|
|
283
|
+
}, [a?.order_recipient?.postcode]), /* @__PURE__ */ v(Ee, { children: [
|
|
284
|
+
/* @__PURE__ */ r(jt, { title: xt }),
|
|
285
|
+
/* @__PURE__ */ r(Ft, { statusDataLoading: I }),
|
|
286
|
+
/* @__PURE__ */ r(fe, {}),
|
|
287
|
+
/* @__PURE__ */ r(he, {}),
|
|
268
288
|
/* @__PURE__ */ r(
|
|
269
|
-
|
|
289
|
+
Nt,
|
|
270
290
|
{
|
|
271
|
-
orderLoading:
|
|
272
|
-
depotDataLoading:
|
|
291
|
+
orderLoading: S,
|
|
292
|
+
depotDataLoading: P
|
|
273
293
|
}
|
|
274
294
|
),
|
|
275
|
-
/* @__PURE__ */ r(
|
|
276
|
-
/* @__PURE__ */ v(
|
|
277
|
-
/* @__PURE__ */ r(
|
|
278
|
-
/* @__PURE__ */ v(
|
|
279
|
-
/* @__PURE__ */ r(
|
|
280
|
-
/* @__PURE__ */ r(
|
|
295
|
+
/* @__PURE__ */ r(Kt, { locationloading: M }),
|
|
296
|
+
/* @__PURE__ */ v(Ae, { children: [
|
|
297
|
+
/* @__PURE__ */ r(Le, { children: /* @__PURE__ */ r(kt, {}) }),
|
|
298
|
+
/* @__PURE__ */ v(Ce, { children: [
|
|
299
|
+
/* @__PURE__ */ r(De, { loading: At }),
|
|
300
|
+
!gt && /* @__PURE__ */ r(Pe, {}),
|
|
301
|
+
/* @__PURE__ */ r(Ht, { loading: H })
|
|
281
302
|
] })
|
|
282
303
|
] }),
|
|
283
|
-
/* @__PURE__ */ r(
|
|
304
|
+
/* @__PURE__ */ r(Vt, {})
|
|
284
305
|
] });
|
|
285
306
|
}
|
|
286
|
-
const
|
|
307
|
+
const Ee = p.div`
|
|
287
308
|
display: flex;
|
|
288
309
|
flex-direction: column;
|
|
289
310
|
gap: 10px;
|
|
290
311
|
padding-bottom: 30px;
|
|
291
|
-
`,
|
|
312
|
+
`, Ae = p.div`
|
|
292
313
|
display: flex;
|
|
293
314
|
gap: 15px;
|
|
294
315
|
@media (max-width: 1024px) {
|
|
295
316
|
display: contents;
|
|
296
317
|
}
|
|
297
|
-
`,
|
|
318
|
+
`, Le = p.div`
|
|
298
319
|
flex: 1;
|
|
299
|
-
`,
|
|
320
|
+
`, Ce = p.div`
|
|
300
321
|
flex: 1;
|
|
301
322
|
display: flex;
|
|
302
323
|
flex-direction: column;
|
|
303
324
|
gap: 15px;
|
|
304
325
|
`;
|
|
305
326
|
export {
|
|
306
|
-
|
|
327
|
+
Qe as default
|
|
307
328
|
};
|
|
308
329
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/order-view/index.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport OrderDetails from './order-details';\nimport Notes from './notes';\nimport SystemLogs from './system-event-logs/expanded-content';\nimport GeneralHeader from './general-information';\nimport ProductsInfo from './products-info';\nimport OrderActions from './order-actions';\nimport {\n DocumentTitle,\n useApiHook,\n useAxios,\n} from '@bjsdistribution/dms-component-library';\nimport {\n useOrderDetails,\n // useOrderStaticData,\n useStatusDetails,\n useOrderId,\n useDepotOptions,\n usePrevOrderDetails,\n useOrderProductsResources,\n useCustomerInfo,\n useLocationOptions,\n useOrderProductSystemLogs,\n useGsitCUstomerId,\n useCUstomerId,\n useRouteId,\n useGsitOrderId,\n useOrderProductId,\n useLiveRecalling,\n useGlobalStateHitOrder,\n useAtom,\n usegetClientData,\n useGlobalEscData,\n} from './store';\nimport { OrdersType } from './types';\nimport { useLocation } from 'react-router-dom';\nimport { message, notification } from 'antd';\nimport DetailsFilters from './details-filters/DetailsFilters';\nimport { useIsShowNorthSouth, useSubContracterData } from '../store';\nimport Notification from './notification';\nimport Order from './order-resources/expanded-content';\nimport { setResourcesCall, useAllOrderStatus } from './order-actions/store';\nimport { ClientType } from '../order-daily-overview/common/interface';\nimport { POSTCODE_LABEL } from '../../common/utils';\nimport { getEnvironment } from './utils';\n\ninterface ApiResponse {\n message: string;\n code: number;\n error: string | null;\n error_traceback: string | null;\n data: [];\n setShouldPerformAction: boolean;\n}\n\nfunction OrderView({ locationloading }: any) {\n notification.config({\n top: 150,\n });\n const [orderId, setOrderId] = useOrderId();\n const [gsitOrderId, setGsitOrderId] = useGsitOrderId();\n // For API Call\n const [orderDetails, setOrderDetails] = useOrderDetails();\n const [, setPrevOrderDetails] = usePrevOrderDetails();\n const [, setLoading] = useState<boolean>(false);\n const [, setOrderStatus] = useStatusDetails();\n const [, setDepotOptions] = useDepotOptions();\n const [customerInfo, setCustomerInfo] = useCustomerInfo();\n const [, setLocationOptions] = useLocationOptions();\n const [orderResources, setOrderResources] = useOrderProductsResources();\n const [GsitCUstomerId, setGsitCUstomerId] = useGsitCUstomerId();\n const [, setOrderProductId] = useOrderProductId();\n const [, setCUstomerId] = useCUstomerId();\n const [, setRouteId] = useRouteId();\n const [liveRecalling] = useLiveRecalling();\n const [, setSubContracterData] = useSubContracterData();\n const [recallOrders] = useGlobalStateHitOrder();\n const [, setStatusVal] = useAllOrderStatus();\n const order_id = orderDetails?.id;\n const [getResources] = useAtom(setResourcesCall);\n const [, setClientData] = usegetClientData();\n const [, setGlobalEscData] = useGlobalEscData();\n const [, setIsNorthSouth] = useIsShowNorthSouth();\n\n useEffect(() => {\n setStatusVal(orderDetails?.status_value);\n }, [orderDetails?.status_value]);\n\n //get system event logs\n const {\n data: fetchedSystemLogsData,\n fetchData: callSystemLogsAPI,\n loading: logsLoading,\n } = useAxios<{\n data: any[];\n }>({\n endpoint: `/events/get/event/`,\n method: 'GET',\n pagination: { page: 1, per_page: 100 },\n filters: [\n {\n field: 'order_id',\n op: '=',\n value: `${order_id}`,\n },\n ],\n showLoader: false,\n });\n\n // query param\n const location = useLocation();\n const [filters, setFilters] = useState<\n Array<{ field: string; op: string; value: string | null }>\n >([]);\n\n // for third party apps\n const {\n data: fetchedDataExternal,\n loading: loadingExternal,\n setShouldPerformAction: setShouldPerformExternal,\n } = useApiHook<{\n data: any[];\n }>({\n endpoint: `orders/`,\n method: 'GET',\n filters: filters,\n performAction: false,\n });\n\n useEffect(() => {\n const searchParams = new URLSearchParams(location.search);\n if (searchParams?.toString()) {\n const dynamicFilters: Array<{\n field: string;\n op: string;\n value: string | null;\n }> = [];\n searchParams?.forEach((value, key) => {\n if (key === 'order') {\n dynamicFilters.push({\n field: 'gsit_order_id',\n op: '=',\n value: value,\n });\n } else {\n dynamicFilters.push({\n field: key,\n op: '=',\n value: value,\n });\n }\n });\n setFilters(dynamicFilters);\n if (filters) {\n setShouldPerformExternal(true);\n setOrderId(fetchedDataExternal?.data[0]?.id);\n }\n } else {\n const paths = location.pathname.split('/');\n setOrderId(paths[paths?.length - 1]);\n }\n }, [location.search, loadingExternal]);\n\n const {\n data: fetchedData,\n loading,\n setShouldPerformAction: orderUpdate,\n } = useApiHook<{\n data: OrdersType[];\n }>({\n endpoint: `orders/${orderId}`,\n method: 'GET',\n performAction: false,\n });\n\n //Order status api\n const {\n data: fetchedStatusData,\n loading: statusDataLoading,\n setShouldPerformAction: setLivePerformAction,\n } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/orders/get_live_status/${orderId}`,\n method: 'GET',\n performAction: false,\n });\n const { data: fetchedDepotData, loading: depotDataLoading } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/depot/`,\n method: 'GET',\n filters: [{ field: 'visibility', op: '=', value: true }],\n //@ts-ignore\n pagination: { is_pagination: false },\n });\n useEffect(() => {\n if (orderId) {\n orderUpdate(recallOrders);\n liveRecalling ? setLivePerformAction(false) : setLivePerformAction(true);\n }\n }, [orderId, liveRecalling, recallOrders]);\n\n useEffect(() => {\n setLoading(loading);\n if (fetchedData && fetchedData.data) {\n const requiredData = fetchedData?.data;\n setOrderDetails(requiredData[0]);\n //@ts-ignore\n setCUstomerId(requiredData[0]?.customer_id);\n setRouteId(requiredData[0]?.order_routes?.route_id);\n //@ts-ignore\n setGsitOrderId(requiredData[0]?.gsit_order_id);\n //@ts-ignore\n setOrderProductId(requiredData[0]?.id);\n setCustomerInfo({\n recipient_name:\n requiredData[0]?.order_recipient?.recipient_name ?? null,\n postcode: requiredData[0]?.order_recipient?.postcode ?? null,\n return_action: requiredData[0]?.return_action ?? null,\n });\n\n setPrevOrderDetails(requiredData[0]);\n\n //dbSync Api call\n if (fetchedData?.data[0]?.gsit_order_id) {\n localStorage.setItem(\n 'dbSyncAPICall',\n JSON.stringify({\n status: true,\n gsit_orderId: fetchedData?.data[0]?.gsit_order_id,\n })\n );\n } else {\n localStorage.setItem('dbSyncAPICall', JSON.stringify({}));\n }\n }\n return () => {\n localStorage.removeItem('dbSyncAPICall');\n };\n }, [loading]);\n\n useEffect(() => {\n setLoading(statusDataLoading);\n if (fetchedStatusData && fetchedStatusData.data) {\n const requiredData = fetchedStatusData?.data;\n if (requiredData) {\n setOrderStatus(requiredData);\n } else {\n // setOrderStatus(null);\n }\n }\n }, [statusDataLoading, fetchedStatusData]);\n\n const {\n fetchData: callCLientApi,\n loading: clientLoading,\n data: clientData,\n } = useAxios<{\n data: ClientType[];\n }>({\n endpoint: `/v1/client/list`,\n method: 'GET',\n });\n\n useEffect(() => {\n if (orderId) {\n callCLientApi();\n callEscalationApi();\n }\n }, [orderId]);\n\n useEffect(() => {\n if (clientData && clientData?.data) {\n const res = clientData?.data;\n setClientData(res);\n }\n }, [clientLoading]);\n\n useEffect(() => {\n setLoading(depotDataLoading);\n if (fetchedDepotData && fetchedDepotData.data) {\n const requiredData = fetchedDepotData?.data;\n if (requiredData.length > 0) {\n const options = requiredData?.map((x: any) => {\n return {\n label: x.name,\n value: x.id,\n };\n });\n setDepotOptions(options);\n } else {\n setDepotOptions([]);\n }\n }\n }, [depotDataLoading]);\n\n // Order resources\n const {\n data: fetchedResourcesData,\n setShouldPerformAction: setActions,\n loading: loadingResources,\n } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/orders/${orderId}/order_resources/`,\n method: 'GET',\n performAction: false,\n showLoader: false,\n });\n\n useEffect(() => {\n if (orderId) {\n if (getResources) {\n setActions(false);\n setTimeout(() => {\n setActions(true);\n }, 200);\n } else {\n setActions(true);\n }\n }\n }, [orderId, setActions, getResources]);\n\n useEffect(() => {\n if (orderId) {\n setActions(true);\n }\n }, [orderId, setActions]);\n\n useEffect(() => {\n if (orderId) {\n setOrderResources(fetchedResourcesData);\n }\n }, [fetchedResourcesData, orderResources, setOrderResources]);\n\n // // Toolbox resources\n // const {\n // data: fetchedToolboxData,\n // setShouldPerformAction: setAction,\n // } = useApiHook<{\n // data: ApiResponse[];\n // }>({\n // endpoint: `/orders/${orderId}/toolbox_resources/`,\n // method: 'GET',\n // performAction: false,\n // });\n\n // useEffect(() => {\n // if (orderId) {\n // setAction(true);\n // }\n // }, [orderId, setAction]);\n\n // useEffect(() => {\n // if (orderId) {\n // setOrderToolbox(fetchedToolboxData);\n // }\n // }, [fetchedToolboxData, orderToolbox, setOrderToolbox]);\n\n useEffect(() => {\n return () => {\n setGsitCUstomerId((prev: any) => ({ ...prev, id: undefined }));\n };\n }, []);\n\n const {\n data: fetchedLocationData,\n loading: dataLoading,\n setShouldPerformAction: shouldFetch,\n } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/return_locations/?customer_id=${GsitCUstomerId?.id}`,\n method: 'GET',\n performAction: false,\n });\n\n useEffect(() => {\n if (GsitCUstomerId?.id) {\n shouldFetch(true);\n } else {\n shouldFetch(false);\n }\n }, [GsitCUstomerId]);\n\n useEffect(() => {\n if (fetchedLocationData && fetchedLocationData?.data) {\n const locationOptions = fetchedLocationData?.data?.map((item: any) => {\n return {\n label: item?.location_name + ', ' + item?.postcode,\n value: item?.token,\n is_default: item?.is_default === 'True' ? true : false,\n };\n });\n setLocationOptions(locationOptions);\n }\n }, [dataLoading]);\n const [, setSystemLogsEvents] = useOrderProductSystemLogs();\n\n useEffect(() => {\n if (fetchedSystemLogsData && fetchedSystemLogsData?.data) {\n setSystemLogsEvents(fetchedSystemLogsData?.data);\n }\n }, [logsLoading]);\n\n useEffect(() => {\n if (gsitOrderId) {\n callSystemLogsAPI();\n }\n return () => {\n setGsitOrderId(undefined);\n };\n }, [order_id]);\n\n const { data: fetchedSubcontractotData, loading: apiLoading } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/sub-contractor/sub_contractor/get/`,\n method: 'GET',\n });\n\n useEffect(() => {\n if (fetchedSubcontractotData && fetchedSubcontractotData?.data) {\n const formattedData = fetchedSubcontractotData?.data?.map(\n (item: any) => ({\n id: item.id,\n name: item.name,\n })\n );\n setSubContracterData(formattedData);\n }\n }, [fetchedSubcontractotData, fetchedSubcontractotData, apiLoading]);\n\n // ESCALATIONS API\n\n const {\n data: fetchedEscalationData,\n fetchData: callEscalationApi,\n loading: escalationDataLoading,\n } = useAxios<{\n data: any;\n }>({\n endpoint: `/orders/escalations/${orderId}`,\n method: 'GET',\n });\n\n useEffect(() => {\n if (fetchedEscalationData?.data) {\n const escalationData = fetchedEscalationData?.data;\n const sortedEscData = escalationData?.sort(\n (a: any, b: any) =>\n new Date(b?.created_at).getTime() - new Date(a?.created_at).getTime()\n );\n const showEsc = sortedEscData != null && sortedEscData.length > 0;\n showEsc ? setGlobalEscData(sortedEscData) : setGlobalEscData([]);\n }\n }, [escalationDataLoading]);\n\n const docTitle = `${customerInfo?.recipient_name}, ${customerInfo?.postcode}`;\n const environment = getEnvironment();\n const { fetchData: callCheckPostcode } = useAxios<{\n data: ApiResponse[];\n }>({\n endpoint: `v1/orders/customs/postcode/check/`,\n method: 'GET',\n });\n\n //northern southern\n const callCheckPostcodeAPI = async () => {\n try {\n const response = await callCheckPostcode({\n endPointQuery: `?postcode=${orderDetails?.order_recipient?.postcode}`,\n });\n //@ts-ignore\n if (response?.code === 200) {\n //@ts-ignore\n const isNorthSouth = response?.data?.order_customs_postcodes;\n setIsNorthSouth(isNorthSouth);\n } else {\n message.open({\n type: 'error',\n //@ts-ignore\n content: response?.error || 'Something went wrong',\n });\n }\n } catch (err) {\n message.open({\n type: 'error',\n content: `Failed to check ${POSTCODE_LABEL.toLowerCase()}. Please try again.`,\n });\n }\n };\n const POSTCODE_REGEX = {\n UK: /\\b(?:[A-Za-z][A-HJ-Ya-hj-y]?[0-9][0-9A-Za-z]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})\\b/,\n IRISH: /^(?:^[AC-FHKNPRTV-Y][0-9]{2}|D6W)[ -]?[0-9AC-FHKNPRTV-Y]{4}$/,\n US: /^\\d{5}(-\\d{4})?$/,\n };\n const isDevelopmentOrStagingOrReleaseUK =\n environment === 'development' ||\n environment === 'staging' ||\n environment === 'release_uk';\n const isValidPostcode = (val: any) => {\n if (isDevelopmentOrStagingOrReleaseUK) {\n return POSTCODE_REGEX.UK.test(val) || POSTCODE_REGEX.IRISH.test(val);\n } else {\n return POSTCODE_REGEX.US.test(val);\n }\n };\n const hasCalledInitialAPI = useRef(false);\n\n useEffect(() => {\n const currentPostcode = orderDetails?.order_recipient?.postcode?.trim();\n\n if (\n currentPostcode &&\n isValidPostcode(currentPostcode) &&\n !hasCalledInitialAPI.current\n ) {\n hasCalledInitialAPI.current = true;\n callCheckPostcodeAPI();\n }\n }, [orderDetails?.order_recipient?.postcode]);\n return (\n <MainContainer>\n <DocumentTitle title={docTitle} />\n <GeneralHeader statusDataLoading={statusDataLoading} />\n\n <DetailsFilters />\n <Notification />\n <OrderDetails\n orderLoading={loading}\n depotDataLoading={depotDataLoading}\n />\n <ProductsInfo locationloading={locationloading} />\n <SplitLayout>\n <NotesContainer>\n <Notes />\n </NotesContainer>\n <TablesContainer>\n <Order loading={loadingResources} />\n <SystemLogs loading={logsLoading} />\n </TablesContainer>\n </SplitLayout>\n <OrderActions />\n </MainContainer>\n );\n}\n\nconst MainContainer = styled.div`\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding-bottom: 30px;\n`;\n\nconst SplitLayout = styled.div`\n display: flex;\n gap: 15px;\n @media (max-width: 1024px) {\n display: contents;\n }\n`;\n\nconst NotesContainer = styled.div`\n flex: 1;\n`;\n\nconst TablesContainer = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 15px;\n`;\n\nexport default OrderView;\n"],"names":["OrderView","locationloading","notification","orderId","setOrderId","useOrderId","gsitOrderId","setGsitOrderId","useGsitOrderId","orderDetails","setOrderDetails","useOrderDetails","setPrevOrderDetails","usePrevOrderDetails","setLoading","useState","setOrderStatus","useStatusDetails","setDepotOptions","useDepotOptions","customerInfo","setCustomerInfo","useCustomerInfo","setLocationOptions","useLocationOptions","orderResources","setOrderResources","useOrderProductsResources","GsitCUstomerId","setGsitCUstomerId","useGsitCUstomerId","setOrderProductId","useOrderProductId","setCUstomerId","useCUstomerId","setRouteId","useRouteId","liveRecalling","useLiveRecalling","setSubContracterData","useSubContracterData","recallOrders","useGlobalStateHitOrder","setStatusVal","useAllOrderStatus","order_id","getResources","useAtom","setResourcesCall","setClientData","usegetClientData","setGlobalEscData","useGlobalEscData","setIsNorthSouth","useIsShowNorthSouth","useEffect","fetchedSystemLogsData","callSystemLogsAPI","logsLoading","useAxios","location","useLocation","filters","setFilters","fetchedDataExternal","loadingExternal","setShouldPerformExternal","useApiHook","searchParams","dynamicFilters","value","key","paths","fetchedData","loading","orderUpdate","fetchedStatusData","statusDataLoading","setLivePerformAction","fetchedDepotData","depotDataLoading","requiredData","callCLientApi","clientLoading","clientData","callEscalationApi","res","options","x","fetchedResourcesData","setActions","loadingResources","prev","fetchedLocationData","dataLoading","shouldFetch","locationOptions","item","setSystemLogsEvents","useOrderProductSystemLogs","fetchedSubcontractotData","apiLoading","formattedData","fetchedEscalationData","escalationDataLoading","sortedEscData","a","b","showEsc","docTitle","environment","getEnvironment","callCheckPostcode","callCheckPostcodeAPI","response","isNorthSouth","message","POSTCODE_LABEL","POSTCODE_REGEX","isDevelopmentOrStagingOrReleaseUK","isValidPostcode","val","hasCalledInitialAPI","useRef","currentPostcode","MainContainer","jsx","DocumentTitle","GeneralHeader","DetailsFilters","Notification","OrderDetails","ProductsInfo","SplitLayout","NotesContainer","Notes","TablesContainer","Order","SystemLogs","OrderActions","styled"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwDA,SAASA,GAAU,EAAE,iBAAAC,KAAwB;AAC3C,EAAAC,GAAa,OAAO;AAAA,IAClB,KAAK;AAAA,EAAA,CACN;AACD,QAAM,CAACC,GAASC,CAAU,IAAIC,GAAA,GACxB,CAACC,GAAaC,CAAc,IAAIC,GAAA,GAEhC,CAACC,GAAcC,CAAe,IAAIC,GAAA,GAClC,CAAA,EAAGC,CAAmB,IAAIC,GAAA,GAC1B,GAAGC,CAAU,IAAIC,EAAkB,EAAK,GACxC,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A,sBAC/CoI,IAAA,EACC,UAAA;AAAA,MAAA,gBAAAP,EAACQ,IAAA,EACC,UAAA,gBAAAR,EAACS,IAAA,CAAA,CAAM,GACT;AAAA,wBACCC,IAAA,EACC,UAAA;AAAA,QAAA,gBAAAV,EAACW,IAAA,EAAM,SAAS9C,GAAA,CAAkB;AAAA,QAClC,gBAAAmC,EAACY,IAAA,EAAW,SAAShF,EAAA,CAAa;AAAA,MAAA,EAAA,CACpC;AAAA,IAAA,GACF;AAAA,sBACCiF,IAAA,CAAA,CAAa;AAAA,EAAA,GAChB;AAEJ;AAEA,MAAMd,KAAgBe,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOvBP,KAAcO,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQrBN,KAAiBM,EAAO;AAAA;AAAA,GAIxBJ,KAAkBI,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/order-view/index.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport OrderDetails from './order-details';\nimport Notes from './notes';\nimport SystemLogs from './system-event-logs/expanded-content';\nimport GeneralHeader from './general-information';\nimport ProductsInfo from './products-info';\nimport OrderActions from './order-actions';\nimport {\n DocumentTitle,\n useApiHook,\n useAxios,\n} from '@bjsdistribution/dms-component-library';\nimport {\n useOrderDetails,\n // useOrderStaticData,\n useStatusDetails,\n useOrderId,\n useDepotOptions,\n usePrevOrderDetails,\n useOrderProductsResources,\n useCustomerInfo,\n useLocationOptions,\n useOrderProductSystemLogs,\n useGsitCUstomerId,\n useCUstomerId,\n useRouteId,\n useGsitOrderId,\n useOrderProductId,\n useLiveRecalling,\n useGlobalStateHitOrder,\n useAtom,\n usegetClientData,\n useGlobalEscData,\n useEpodImages,\n skeletonTomTom,\n} from './store';\nimport { OrdersType } from './types';\nimport { useLocation } from 'react-router-dom';\nimport { message, notification } from 'antd';\nimport DetailsFilters from './details-filters/DetailsFilters';\nimport {\n useClientPortal,\n useIsShowNorthSouth,\n useSubContracterData,\n} from '../store';\nimport Notification from './notification';\nimport Order from './order-resources/expanded-content';\nimport { setResourcesCall, useAllOrderStatus } from './order-actions/store';\nimport { ClientType } from '../order-daily-overview/common/interface';\nimport { POSTCODE_LABEL } from '../../common/utils';\nimport { getEnvironment } from './utils';\nimport Toolbox from './toolbox-resources/expanded-content';\n\ninterface ApiResponse {\n message: string;\n code: number;\n error: string | null;\n error_traceback: string | null;\n data: [];\n setShouldPerformAction: boolean;\n}\n\nfunction OrderView({ locationloading }: any) {\n notification.config({\n top: 150,\n });\n const [orderId, setOrderId] = useOrderId();\n const [gsitOrderId, setGsitOrderId] = useGsitOrderId();\n // For API Call\n const [orderDetails, setOrderDetails] = useOrderDetails();\n const [, setPrevOrderDetails] = usePrevOrderDetails();\n const [, setLoading] = useState<boolean>(false);\n const [, setOrderStatus] = useStatusDetails();\n const [, setDepotOptions] = useDepotOptions();\n const [customerInfo, setCustomerInfo] = useCustomerInfo();\n const [, setLocationOptions] = useLocationOptions();\n const [orderResources, setOrderResources] = useOrderProductsResources();\n const [GsitCUstomerId, setGsitCUstomerId] = useGsitCUstomerId();\n const [, setOrderProductId] = useOrderProductId();\n const [, setCUstomerId] = useCUstomerId();\n const [, setRouteId] = useRouteId();\n const [liveRecalling] = useLiveRecalling();\n const [, setSubContracterData] = useSubContracterData();\n const [recallOrders] = useGlobalStateHitOrder();\n const [, setStatusVal] = useAllOrderStatus();\n const order_id = orderDetails?.id;\n const [getResources] = useAtom(setResourcesCall);\n const [, setClientData] = usegetClientData();\n const [, setGlobalEscData] = useGlobalEscData();\n const [, setIsNorthSouth] = useIsShowNorthSouth();\n const [, setEpodImages] = useEpodImages();\n const [, setSkeletonTomTom] = useAtom(skeletonTomTom);\n const [clientPortal] = useClientPortal();\n\n useEffect(() => {\n setStatusVal(orderDetails?.status_value);\n }, [orderDetails?.status_value]);\n\n //get system event logs\n const {\n data: fetchedSystemLogsData,\n fetchData: callSystemLogsAPI,\n loading: logsLoading,\n } = useAxios<{\n data: any[];\n }>({\n endpoint: `/events/get/event/`,\n method: 'GET',\n pagination: { page: 1, per_page: 100 },\n filters: [\n {\n field: 'order_id',\n op: '=',\n value: `${order_id}`,\n },\n ],\n showLoader: false,\n });\n\n // query param\n const location = useLocation();\n const [filters, setFilters] = useState<\n Array<{ field: string; op: string; value: string | null }>\n >([]);\n\n // for third party apps\n const {\n data: fetchedDataExternal,\n loading: loadingExternal,\n setShouldPerformAction: setShouldPerformExternal,\n } = useApiHook<{\n data: any[];\n }>({\n endpoint: `orders/`,\n method: 'GET',\n filters: filters,\n performAction: false,\n });\n\n useEffect(() => {\n const searchParams = new URLSearchParams(location.search);\n if (searchParams?.toString()) {\n const dynamicFilters: Array<{\n field: string;\n op: string;\n value: string | null;\n }> = [];\n searchParams?.forEach((value, key) => {\n if (key === 'order') {\n dynamicFilters.push({\n field: 'gsit_order_id',\n op: '=',\n value: value,\n });\n } else {\n dynamicFilters.push({\n field: key,\n op: '=',\n value: value,\n });\n }\n });\n setFilters(dynamicFilters);\n if (filters) {\n setShouldPerformExternal(true);\n setOrderId(fetchedDataExternal?.data[0]?.id);\n }\n } else {\n const paths = location.pathname.split('/');\n setOrderId(paths[paths?.length - 1]);\n }\n }, [location.search, loadingExternal]);\n\n const {\n data: fetchedData,\n loading,\n setShouldPerformAction: orderUpdate,\n } = useApiHook<{\n data: OrdersType[];\n }>({\n endpoint: `orders/${orderId}`,\n method: 'GET',\n performAction: false,\n });\n\n //Order status api\n const {\n data: fetchedStatusData,\n loading: statusDataLoading,\n setShouldPerformAction: setLivePerformAction,\n } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/orders/get_live_status/${orderId}`,\n method: 'GET',\n performAction: false,\n });\n const { data: fetchedDepotData, loading: depotDataLoading } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/depot/`,\n method: 'GET',\n filters: [{ field: 'visibility', op: '=', value: true }],\n //@ts-ignore\n pagination: { is_pagination: false },\n });\n useEffect(() => {\n if (orderId) {\n orderUpdate(recallOrders);\n liveRecalling ? setLivePerformAction(false) : setLivePerformAction(true);\n }\n }, [orderId, liveRecalling, recallOrders]);\n\n useEffect(() => {\n setLoading(loading);\n if (fetchedData && fetchedData.data) {\n const requiredData = fetchedData?.data;\n setOrderDetails(requiredData[0]);\n //@ts-ignore\n setCUstomerId(requiredData[0]?.customer_id);\n setRouteId(requiredData[0]?.order_routes?.route_id);\n //@ts-ignore\n setGsitOrderId(requiredData[0]?.gsit_order_id);\n //@ts-ignore\n setOrderProductId(requiredData[0]?.id);\n setCustomerInfo({\n recipient_name:\n requiredData[0]?.order_recipient?.recipient_name ?? null,\n postcode: requiredData[0]?.order_recipient?.postcode ?? null,\n return_action: requiredData[0]?.return_action ?? null,\n });\n\n setPrevOrderDetails(requiredData[0]);\n\n //dbSync Api call\n if (fetchedData?.data[0]?.gsit_order_id) {\n localStorage.setItem(\n 'dbSyncAPICall',\n JSON.stringify({\n status: true,\n gsit_orderId: fetchedData?.data[0]?.gsit_order_id,\n })\n );\n } else {\n localStorage.setItem('dbSyncAPICall', JSON.stringify({}));\n }\n }\n return () => {\n localStorage.removeItem('dbSyncAPICall');\n };\n }, [loading]);\n\n useEffect(() => {\n setLoading(statusDataLoading);\n if (fetchedStatusData && fetchedStatusData.data) {\n const requiredData = fetchedStatusData?.data;\n if (requiredData) {\n setOrderStatus(requiredData);\n } else {\n // setOrderStatus(null);\n }\n }\n }, [statusDataLoading, fetchedStatusData]);\n\n const {\n fetchData: callCLientApi,\n loading: clientLoading,\n data: clientData,\n } = useAxios<{\n data: ClientType[];\n }>({\n endpoint: `/v1/client/list`,\n method: 'GET',\n });\n\n useEffect(() => {\n if (orderId) {\n callCLientApi();\n callEscalationApi();\n }\n }, [orderId]);\n\n useEffect(() => {\n if (clientData && clientData?.data) {\n const res = clientData?.data;\n setClientData(res);\n }\n }, [clientLoading]);\n\n useEffect(() => {\n setLoading(depotDataLoading);\n if (fetchedDepotData && fetchedDepotData.data) {\n const requiredData = fetchedDepotData?.data;\n if (requiredData.length > 0) {\n const options = requiredData?.map((x: any) => {\n return {\n label: x.name,\n value: x.id,\n };\n });\n setDepotOptions(options);\n } else {\n setDepotOptions([]);\n }\n }\n }, [depotDataLoading]);\n\n // Order resources\n const {\n data: fetchedResourcesData,\n setShouldPerformAction: setActions,\n loading: loadingResources,\n } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/orders/${orderId}/order_resources/`,\n method: 'GET',\n performAction: false,\n showLoader: false,\n });\n\n useEffect(() => {\n if (orderId) {\n if (getResources) {\n setActions(false);\n setTimeout(() => {\n setActions(true);\n }, 200);\n } else {\n setActions(true);\n }\n }\n }, [orderId, setActions, getResources]);\n\n useEffect(() => {\n if (orderId) {\n setActions(true);\n }\n }, [orderId, setActions]);\n\n useEffect(() => {\n if (orderId) {\n setOrderResources(fetchedResourcesData);\n }\n }, [fetchedResourcesData, orderResources, setOrderResources]);\n\n //EPOD Images\n const {\n data: fetchedEpodImages,\n loading: epodLoading,\n fetchData: fetchEpodImages,\n } = useAxios<{\n data: ApiResponse[];\n }>({\n endpoint: `orders/${orderId}/epod_resources/?finance=false`,\n method: 'GET',\n });\n\n useEffect(() => {\n if (orderId) {\n fetchEpodImages();\n if (orderDetails?.order_recipient?.postcode != null) {\n callCheckPostcode({\n endPointQuery: `?postcode=${orderDetails?.order_recipient?.postcode}`,\n });\n }\n }\n }, [orderId]);\n\n useEffect(() => {\n if (fetchedEpodImages && fetchedEpodImages?.data) {\n //@ts-ignore\n const result = fetchedEpodImages?.data?.resources;\n setEpodImages(result);\n }\n setSkeletonTomTom(epodLoading);\n }, [epodLoading]);\n\n useEffect(() => {\n return () => {\n setGsitCUstomerId((prev: any) => ({ ...prev, id: undefined }));\n };\n }, []);\n\n const {\n data: fetchedLocationData,\n loading: dataLoading,\n setShouldPerformAction: shouldFetch,\n } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/return_locations/?customer_id=${GsitCUstomerId?.id}`,\n method: 'GET',\n performAction: false,\n });\n\n useEffect(() => {\n if (GsitCUstomerId?.id) {\n shouldFetch(true);\n } else {\n shouldFetch(false);\n }\n }, [GsitCUstomerId]);\n\n useEffect(() => {\n if (fetchedLocationData && fetchedLocationData?.data) {\n const locationOptions = fetchedLocationData?.data?.map((item: any) => {\n return {\n label: item?.location_name + ', ' + item?.postcode,\n value: item?.token,\n is_default: item?.is_default === 'True' ? true : false,\n };\n });\n setLocationOptions(locationOptions);\n }\n }, [dataLoading]);\n const [, setSystemLogsEvents] = useOrderProductSystemLogs();\n\n useEffect(() => {\n if (fetchedSystemLogsData && fetchedSystemLogsData?.data) {\n setSystemLogsEvents(fetchedSystemLogsData?.data);\n }\n }, [logsLoading]);\n\n useEffect(() => {\n if (gsitOrderId) {\n callSystemLogsAPI();\n }\n return () => {\n setGsitOrderId(undefined);\n };\n }, [order_id]);\n\n const { data: fetchedSubcontractotData, loading: apiLoading } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/sub-contractor/sub_contractor/get/`,\n method: 'GET',\n });\n\n useEffect(() => {\n if (fetchedSubcontractotData && fetchedSubcontractotData?.data) {\n const formattedData = fetchedSubcontractotData?.data?.map(\n (item: any) => ({\n id: item.id,\n name: item.name,\n })\n );\n setSubContracterData(formattedData);\n }\n }, [fetchedSubcontractotData, fetchedSubcontractotData, apiLoading]);\n\n // ESCALATIONS API\n\n const {\n data: fetchedEscalationData,\n fetchData: callEscalationApi,\n loading: escalationDataLoading,\n } = useAxios<{\n data: any;\n }>({\n endpoint: `/orders/escalations/${orderId}`,\n method: 'GET',\n });\n\n useEffect(() => {\n if (fetchedEscalationData?.data) {\n const escalationData = fetchedEscalationData?.data;\n const sortedEscData = escalationData?.sort(\n (a: any, b: any) =>\n new Date(b?.created_at).getTime() - new Date(a?.created_at).getTime()\n );\n const showEsc = sortedEscData != null && sortedEscData.length > 0;\n showEsc ? setGlobalEscData(sortedEscData) : setGlobalEscData([]);\n }\n }, [escalationDataLoading]);\n\n const docTitle = `${customerInfo?.recipient_name}, ${customerInfo?.postcode}`;\n const environment = getEnvironment();\n const { fetchData: callCheckPostcode } = useAxios<{\n data: ApiResponse[];\n }>({\n endpoint: `v1/orders/customs/postcode/check/`,\n method: 'GET',\n });\n\n //northern southern\n const callCheckPostcodeAPI = async () => {\n try {\n const response = await callCheckPostcode({\n endPointQuery: `?postcode=${orderDetails?.order_recipient?.postcode}`,\n });\n //@ts-ignore\n if (response?.code === 200) {\n //@ts-ignore\n const isNorthSouth = response?.data?.order_customs_postcodes;\n setIsNorthSouth(isNorthSouth);\n } else {\n message.open({\n type: 'error',\n //@ts-ignore\n content: response?.error || 'Something went wrong',\n });\n }\n } catch (err) {\n message.open({\n type: 'error',\n content: `Failed to check ${POSTCODE_LABEL.toLowerCase()}. Please try again.`,\n });\n }\n };\n const POSTCODE_REGEX = {\n UK: /\\b(?:[A-Za-z][A-HJ-Ya-hj-y]?[0-9][0-9A-Za-z]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})\\b/,\n IRISH: /^(?:^[AC-FHKNPRTV-Y][0-9]{2}|D6W)[ -]?[0-9AC-FHKNPRTV-Y]{4}$/,\n US: /^\\d{5}(-\\d{4})?$/,\n };\n const isDevelopmentOrStagingOrReleaseUK =\n environment === 'development' ||\n environment === 'staging' ||\n environment === 'release_uk';\n const isValidPostcode = (val: any) => {\n if (isDevelopmentOrStagingOrReleaseUK) {\n return POSTCODE_REGEX.UK.test(val) || POSTCODE_REGEX.IRISH.test(val);\n } else {\n return POSTCODE_REGEX.US.test(val);\n }\n };\n const hasCalledInitialAPI = useRef(false);\n\n useEffect(() => {\n const currentPostcode = orderDetails?.order_recipient?.postcode?.trim();\n\n if (\n currentPostcode &&\n isValidPostcode(currentPostcode) &&\n !hasCalledInitialAPI.current\n ) {\n hasCalledInitialAPI.current = true;\n callCheckPostcodeAPI();\n }\n }, [orderDetails?.order_recipient?.postcode]);\n return (\n <MainContainer>\n <DocumentTitle title={docTitle} />\n <GeneralHeader statusDataLoading={statusDataLoading} />\n\n <DetailsFilters />\n <Notification />\n <OrderDetails\n orderLoading={loading}\n depotDataLoading={depotDataLoading}\n />\n <ProductsInfo locationloading={locationloading} />\n <SplitLayout>\n <NotesContainer>\n <Notes />\n </NotesContainer>\n <TablesContainer>\n <Order loading={loadingResources} />\n {!clientPortal && <Toolbox />}\n\n <SystemLogs loading={logsLoading} />\n </TablesContainer>\n </SplitLayout>\n <OrderActions />\n </MainContainer>\n );\n}\n\nconst MainContainer = styled.div`\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding-bottom: 30px;\n`;\n\nconst SplitLayout = styled.div`\n display: flex;\n gap: 15px;\n @media (max-width: 1024px) {\n display: contents;\n }\n`;\n\nconst NotesContainer = styled.div`\n flex: 1;\n`;\n\nconst TablesContainer = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 15px;\n`;\n\nexport default OrderView;\n"],"names":["OrderView","locationloading","notification","orderId","setOrderId","useOrderId","gsitOrderId","setGsitOrderId","useGsitOrderId","orderDetails","setOrderDetails","useOrderDetails","setPrevOrderDetails","usePrevOrderDetails","setLoading","useState","setOrderStatus","useStatusDetails","setDepotOptions","useDepotOptions","customerInfo","setCustomerInfo","useCustomerInfo","setLocationOptions","useLocationOptions","orderResources","setOrderResources","useOrderProductsResources","GsitCUstomerId","setGsitCUstomerId","useGsitCUstomerId","setOrderProductId","useOrderProductId","setCUstomerId","useCUstomerId","setRouteId","useRouteId","liveRecalling","useLiveRecalling","setSubContracterData","useSubContracterData","recallOrders","useGlobalStateHitOrder","setStatusVal","useAllOrderStatus","order_id","getResources","useAtom","setResourcesCall","setClientData","usegetClientData","setGlobalEscData","useGlobalEscData","setIsNorthSouth","useIsShowNorthSouth","setEpodImages","useEpodImages","setSkeletonTomTom","skeletonTomTom","clientPortal","useClientPortal","useEffect","fetchedSystemLogsData","callSystemLogsAPI","logsLoading","useAxios","location","useLocation","filters","setFilters","fetchedDataExternal","loadingExternal","setShouldPerformExternal","useApiHook","searchParams","dynamicFilters","value","key","paths","fetchedData","loading","orderUpdate","fetchedStatusData","statusDataLoading","setLivePerformAction","fetchedDepotData","depotDataLoading","requiredData","callCLientApi","clientLoading","clientData","callEscalationApi","res","options","x","fetchedResourcesData","setActions","loadingResources","fetchedEpodImages","epodLoading","fetchEpodImages","callCheckPostcode","result","prev","fetchedLocationData","dataLoading","shouldFetch","locationOptions","item","setSystemLogsEvents","useOrderProductSystemLogs","fetchedSubcontractotData","apiLoading","formattedData","fetchedEscalationData","escalationDataLoading","sortedEscData","a","b","showEsc","docTitle","environment","getEnvironment","callCheckPostcodeAPI","response","isNorthSouth","message","POSTCODE_LABEL","POSTCODE_REGEX","isDevelopmentOrStagingOrReleaseUK","isValidPostcode","val","hasCalledInitialAPI","useRef","currentPostcode","MainContainer","jsx","DocumentTitle","GeneralHeader","DetailsFilters","Notification","OrderDetails","ProductsInfo","SplitLayout","NotesContainer","Notes","TablesContainer","Order","Toolbox","SystemLogs","OrderActions","styled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+DA,SAASA,GAAU,EAAE,iBAAAC,KAAwB;AAC3C,EAAAC,GAAa,OAAO;AAAA,IAClB,KAAK;AAAA,EAAA,CACN;AACD,QAAM,CAACC,GAASC,CAAU,IAAIC,GAAA,GACxB,CAACC,GAAaC,CAAc,IAAIC,GAAA,GAEhC,CAACC,GAAcC,CAAe,IAAIC,GAAA,GAClC,CAAA,EAAGC,EAAmB,IAAIC,GAAA,GAC1B,GAAGC,CAAU,IAAIC,EAAkB,EAAK,GACxC,CAAA,EAAGC,EAAc,IAAIC,GAAA,GACrB,CAAA,EAAGC,CAAe,IAAIC,GAAA,GACtB,CAACC,GAAcC,EAAe,IAAIC,GAAA,GAClC,CAAA,EAAGC,EAAkB,IAAIC,GAAA,GACzB,CAACC,IAAgBC,CAAiB,IAAIC,GAAA,GACtC,CAACC,GAAgBC,EAAiB,IAAIC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AACF,EAAoB,YAErBA,EAAoB,UAAU,IAC9BT,GAAA;AAAA,EAEJ,GAAG,CAAClH,GAAc,iBAAiB,QAAQ,CAAC,qBAEzC8H,IAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,IAAA,EAAc,OAAOjB,GAAA,CAAU;AAAA,IAChC,gBAAAgB,EAACE,MAAc,mBAAAvD,GAAsC;AAAA,sBAEpDwD,IAAA,EAAe;AAAA,sBACfC,IAAA,EAAa;AAAA,IACd,gBAAAJ;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,cAAc7D;AAAA,QACd,kBAAAM;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,gBAAAkD,EAACM,MAAa,iBAAA7I,GAAkC;AAAA,sBAC/C8I,IAAA,EACC,UAAA;AAAA,MAAA,gBAAAP,EAACQ,IAAA,EACC,UAAA,gBAAAR,EAACS,IAAA,CAAA,CAAM,GACT;AAAA,wBACCC,IAAA,EACC,UAAA;AAAA,QAAA,gBAAAV,EAACW,IAAA,EAAM,SAASlD,GAAA,CAAkB;AAAA,QACjC,CAACtC,MAAgB,gBAAA6E,EAACY,IAAA,EAAQ;AAAA,QAE3B,gBAAAZ,EAACa,IAAA,EAAW,SAASrF,EAAA,CAAa;AAAA,MAAA,EAAA,CACpC;AAAA,IAAA,GACF;AAAA,sBACCsF,IAAA,CAAA,CAAa;AAAA,EAAA,GAChB;AAEJ;AAEA,MAAMf,KAAgBgB,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOvBR,KAAcQ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQrBP,KAAiBO,EAAO;AAAA;AAAA,GAIxBL,KAAkBK,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -2,7 +2,7 @@ import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import l from "styled-components";
|
|
3
3
|
import { AntSelect as t } from "@bjsdistribution/dms-component-library";
|
|
4
4
|
function f(e) {
|
|
5
|
-
return /* @__PURE__ */ a(
|
|
5
|
+
return /* @__PURE__ */ a(s, { className: e.className, children: [
|
|
6
6
|
/* @__PURE__ */ a(r, { children: [
|
|
7
7
|
e.label,
|
|
8
8
|
e.required && /* @__PURE__ */ o(n, { children: "*" })
|
|
@@ -17,7 +17,7 @@ function f(e) {
|
|
|
17
17
|
style: { width: "100%" },
|
|
18
18
|
onSearch: e.onSearch,
|
|
19
19
|
showSearch: !0,
|
|
20
|
-
popupClassName: "dropDownStyle",
|
|
20
|
+
popupClassName: e.popupClassName ? `dropDownStyle ${e.popupClassName}` : "dropDownStyle",
|
|
21
21
|
selectWrapperClass: "rounded",
|
|
22
22
|
defaultValue: e.value
|
|
23
23
|
}
|
|
@@ -33,7 +33,7 @@ const n = l.span`
|
|
|
33
33
|
font-size: 14px;
|
|
34
34
|
font-style: normal;
|
|
35
35
|
font-weight: 500;
|
|
36
|
-
`,
|
|
36
|
+
`, s = l.div`
|
|
37
37
|
display: flex;
|
|
38
38
|
flex-direction: column;
|
|
39
39
|
gap: 6px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sources":["../../../../src/components/order-view/order-actions/Dropdown.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport React from 'react';\nimport {\n AntSelect,\n StandardOptionsType,\n} from '@bjsdistribution/dms-component-library';\n\ninterface ActionsDropdownProps {\n label: string;\n placeholder: string;\n options: StandardOptionsType[];\n onSelect: (value: string) => void;\n onSearch?: () => void;\n className?: string;\n value?: string;\n disabled?: boolean;\n defaultValue?: any;\n onChange?: any;\n required?: boolean;\n}\n\nfunction OrderActionsDropdown(props: ActionsDropdownProps) {\n return (\n <Container className={props.className}>\n <Label>\n {props.label}\n {props.required && <RequiredAsterisk>*</RequiredAsterisk>}\n </Label>\n <AntSelect\n options={props.options}\n placeholder={props.placeholder}\n onChange={props.onSelect}\n disabled={props.disabled}\n style={{ width: '100%' }}\n onSearch={props.onSearch}\n showSearch={true}\n popupClassName={'dropDownStyle'}\n selectWrapperClass={'rounded'}\n defaultValue={props.value}\n />\n </Container>\n );\n}\n\nconst RequiredAsterisk = styled.span`\n color: red;\n margin-left: 2px;\n`;\n\nconst Label = styled.label`\n color: #6a7378;\n font-family: 'Lato', sans-serif;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n`;\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 6px;\n`;\n\nexport default OrderActionsDropdown;\n"],"names":["OrderActionsDropdown","props","jsxs","Container","Label","jsx","RequiredAsterisk","AntSelect","styled"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sources":["../../../../src/components/order-view/order-actions/Dropdown.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport React from 'react';\nimport {\n AntSelect,\n StandardOptionsType,\n} from '@bjsdistribution/dms-component-library';\n\ninterface ActionsDropdownProps {\n label: string;\n placeholder: string;\n options: StandardOptionsType[];\n onSelect: (value: string) => void;\n onSearch?: () => void;\n className?: string;\n popupClassName?: string;\n value?: string;\n disabled?: boolean;\n defaultValue?: any;\n onChange?: any;\n required?: boolean;\n}\n\nfunction OrderActionsDropdown(props: ActionsDropdownProps) {\n return (\n <Container className={props.className}>\n <Label>\n {props.label}\n {props.required && <RequiredAsterisk>*</RequiredAsterisk>}\n </Label>\n <AntSelect\n options={props.options}\n placeholder={props.placeholder}\n onChange={props.onSelect}\n disabled={props.disabled}\n style={{ width: '100%' }}\n onSearch={props.onSearch}\n showSearch={true}\n popupClassName={\n props.popupClassName\n ? `dropDownStyle ${props.popupClassName}`\n : 'dropDownStyle'\n }\n selectWrapperClass={'rounded'}\n defaultValue={props.value}\n />\n </Container>\n );\n}\n\nconst RequiredAsterisk = styled.span`\n color: red;\n margin-left: 2px;\n`;\n\nconst Label = styled.label`\n color: #6a7378;\n font-family: 'Lato', sans-serif;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n`;\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 6px;\n`;\n\nexport default OrderActionsDropdown;\n"],"names":["OrderActionsDropdown","props","jsxs","Container","Label","jsx","RequiredAsterisk","AntSelect","styled"],"mappings":";;;AAsBA,SAASA,EAAqBC,GAA6B;AACzD,SACE,gBAAAC,EAACC,GAAA,EAAU,WAAWF,EAAM,WAC1B,UAAA;AAAA,IAAA,gBAAAC,EAACE,GAAA,EACE,UAAA;AAAA,MAAAH,EAAM;AAAA,MACNA,EAAM,YAAY,gBAAAI,EAACC,GAAA,EAAiB,UAAA,IAAA,CAAC;AAAA,IAAA,GACxC;AAAA,IACA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,SAASN,EAAM;AAAA,QACf,aAAaA,EAAM;AAAA,QACnB,UAAUA,EAAM;AAAA,QAChB,UAAUA,EAAM;AAAA,QAChB,OAAO,EAAE,OAAO,OAAA;AAAA,QAChB,UAAUA,EAAM;AAAA,QAChB,YAAY;AAAA,QACZ,gBACEA,EAAM,iBACF,iBAAiBA,EAAM,cAAc,KACrC;AAAA,QAEN,oBAAoB;AAAA,QACpB,cAAcA,EAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EACtB,GACF;AAEJ;AAEA,MAAMK,IAAmBE,EAAO;AAAA;AAAA;AAAA,GAK1BJ,IAAQI,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQfL,IAAYK,EAAO;AAAA;AAAA;AAAA;AAAA;"}
|