@burdenoff/microfe-movethewheels 2026.1101.4 → 2026.1102.1
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/components/CustomerDeliveryUpdatesFields.js +57 -0
- package/dist/components/CustomerNotificationSettingsCard.js +368 -0
- package/dist/generated/tracking-quality-operations.d.ts +275 -0
- package/dist/hooks/useCustomers.js +9 -3
- package/dist/movethewheels/components/CustomerDeliveryUpdatesFields.d.ts +12 -0
- package/dist/movethewheels/components/CustomerNotificationSettingsCard.d.ts +3 -0
- package/dist/movethewheels/types/index.d.ts +4 -0
- package/dist/movethewheels/utils/customerNotifications.d.ts +66 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/bell-ring.js +22 -0
- package/dist/pages/CustomerDetailsPage.js +279 -231
- package/dist/pages/SettingsPage.js +242 -238
- package/dist/utils/customerNotifications.js +83 -0
- package/package.json +3 -2
- package/src/generated/tracking-quality-operations.ts +304 -0
- package/src/movethewheels/components/CustomerDeliveryUpdatesFields.tsx +67 -0
- package/src/movethewheels/components/CustomerNotificationSettingsCard.tsx +465 -0
- package/src/movethewheels/hooks/useCustomers.ts +17 -0
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +39 -0
- package/src/movethewheels/pages/SettingsPage.tsx +221 -208
- package/src/movethewheels/types/index.ts +4 -0
- package/src/movethewheels/utils/customerNotifications.ts +209 -0
|
@@ -9,14 +9,15 @@ import { Save as te } from "../node_modules/lucide-react/dist/esm/icons/save.js"
|
|
|
9
9
|
import { Settings as o } from "../node_modules/lucide-react/dist/esm/icons/settings.js";
|
|
10
10
|
import { joinPath as s } from "../utils/navigation.js";
|
|
11
11
|
import { useMoveTheWheels as c } from "../providers/MoveTheWheelsProvider.js";
|
|
12
|
-
import { formatCurrency as ne, formatDateTime as l, formatDistance as re, formatWeight as
|
|
13
|
-
import { DISTANCE_UNIT_OPTIONS as
|
|
14
|
-
import { useModuleSettings as
|
|
15
|
-
import { Badge as
|
|
12
|
+
import { formatCurrency as ne, formatDateTime as l, formatDistance as re, formatWeight as u } from "../utils/formatters.js";
|
|
13
|
+
import { DISTANCE_UNIT_OPTIONS as d, ORDER_PRIORITY_OPTIONS as f, WEIGHT_UNIT_OPTIONS as p, browserTimeZone as ie, changedSettings as ae, currencyLabel as oe, currencyOptions as se, deliveryWindowError as ce, timeZoneOptions as le } from "../utils/moduleSettings.js";
|
|
14
|
+
import { useModuleSettings as ue } from "../providers/ModuleSettingsProvider.js";
|
|
15
|
+
import { Badge as de, Button as m, Card as h, CardContent as g, CardDescription as _, CardHeader as v, CardTitle as y, Input as fe, Label as b, Select as x, SelectContent as S, SelectItem as C, SelectTrigger as w, SelectValue as T, Skeleton as E } from "../components/ui.js";
|
|
16
16
|
import { PageLayout as pe } from "../components/PageLayout.js";
|
|
17
17
|
import { FormError as D } from "../components/FormError.js";
|
|
18
18
|
import { Notice as me, useNotice as he } from "../components/Notice.js";
|
|
19
|
-
import {
|
|
19
|
+
import { CustomerNotificationSettingsCard as O } from "../components/CustomerNotificationSettingsCard.js";
|
|
20
|
+
import { useEffect as ge, useMemo as k, useState as A } from "react";
|
|
20
21
|
import { jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
21
22
|
import { EmphasisPanel as N, PagePurpose as P } from "@burdenoff/fe-libs/ui";
|
|
22
23
|
import { PermissionProvider as F, usePermissions as I } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
@@ -32,7 +33,7 @@ function R(e) {
|
|
|
32
33
|
defaultDeliveryWindowHours: String(e.defaultDeliveryWindowHours)
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
|
-
var
|
|
36
|
+
var _e = [
|
|
36
37
|
{
|
|
37
38
|
id: "company",
|
|
38
39
|
title: "Company profile",
|
|
@@ -71,11 +72,11 @@ function z() {
|
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
74
|
function B() {
|
|
74
|
-
let { navigate: e, basePath: t, workspaceId: r, currentUser: F } = c(), { settings: z, isLoaded: B, error: V, save:
|
|
75
|
-
|
|
75
|
+
let { navigate: e, basePath: t, workspaceId: r, currentUser: F } = c(), { settings: z, isLoaded: B, error: V, save: ve, reload: ye } = ue(), H = I(), [U, W] = A(() => R(z)), [G, K] = A(!1), [be, q] = A(null), { message: xe, notify: Se } = he();
|
|
76
|
+
ge(() => {
|
|
76
77
|
W(R(z));
|
|
77
78
|
}, [z]);
|
|
78
|
-
let J = !!(r && F?.id && H.scopeId === r && !H.isLoading && !H.error) && !H.isSuperAdmin && !H.hasPermission("mtw-settings:update"), Y =
|
|
79
|
+
let J = !!(r && F?.id && H.scopeId === r && !H.isLoading && !H.error) && !H.isSuperAdmin && !H.hasPermission("mtw-settings:update"), Y = ce(U.defaultDeliveryWindowHours), X = k(() => ae(z, {
|
|
79
80
|
defaultCurrency: U.defaultCurrency,
|
|
80
81
|
distanceUnit: U.distanceUnit,
|
|
81
82
|
weightUnit: U.weightUnit,
|
|
@@ -86,26 +87,26 @@ function B() {
|
|
|
86
87
|
z,
|
|
87
88
|
U,
|
|
88
89
|
Y
|
|
89
|
-
]), Z = Object.keys(X).length > 0, Q = B && !J && !G && Z && !Y,
|
|
90
|
+
]), Z = Object.keys(X).length > 0, Q = B && !J && !G && Z && !Y, Ce = k(() => se(U.defaultCurrency), [U.defaultCurrency]), we = k(() => le(z.timezone), [z.timezone]), Te = k(() => ie(), []), $ = (e, t) => {
|
|
90
91
|
q(null), W((n) => ({
|
|
91
92
|
...n,
|
|
92
93
|
[e]: t
|
|
93
94
|
}));
|
|
94
|
-
},
|
|
95
|
+
}, Ee = async (e) => {
|
|
95
96
|
if (e.preventDefault(), Q) {
|
|
96
97
|
K(!0), q(null);
|
|
97
98
|
try {
|
|
98
|
-
await
|
|
99
|
+
await ve(X), Se("Settings saved. MoveTheWheels now uses these defaults everywhere.");
|
|
99
100
|
} catch (e) {
|
|
100
101
|
q(e instanceof Error ? e.message : "Could not save the settings");
|
|
101
102
|
} finally {
|
|
102
103
|
K(!1);
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
|
-
},
|
|
106
|
+
}, De = /* @__PURE__ */ new Date("2026-03-14T15:30:00Z");
|
|
106
107
|
return /* @__PURE__ */ M(pe, {
|
|
107
108
|
title: "Settings",
|
|
108
|
-
subtitle: "Workspace defaults
|
|
109
|
+
subtitle: "Workspace defaults, new-order defaults and customer delivery notifications",
|
|
109
110
|
icon: /* @__PURE__ */ j(o, { size: 24 }),
|
|
110
111
|
maxWidth: "xl",
|
|
111
112
|
children: [
|
|
@@ -114,252 +115,255 @@ function B() {
|
|
|
114
115
|
children: "Set how MoveTheWheels shows money, distances, weights and times for everyone in this workspace, and what new orders start with. Changes apply to every MoveTheWheels screen as soon as you save."
|
|
115
116
|
}),
|
|
116
117
|
V && /* @__PURE__ */ j(D, { message: `Could not load this workspace's settings (${V.message}). Showing the platform defaults.` }),
|
|
117
|
-
/* @__PURE__ */ j(me, { message:
|
|
118
|
+
/* @__PURE__ */ j(me, { message: xe }),
|
|
118
119
|
/* @__PURE__ */ M("div", {
|
|
119
120
|
className: "grid grid-cols-1 gap-6 xl:grid-cols-3",
|
|
120
|
-
children: [/* @__PURE__ */ M(
|
|
121
|
-
className: "space-y-6 xl:col-span-2",
|
|
122
|
-
children: [/* @__PURE__ */ M(
|
|
123
|
-
className: "flex flex-wrap items-center justify-between gap-3",
|
|
124
|
-
children: [/* @__PURE__ */ j("h2", {
|
|
125
|
-
className: "text-base font-semibold text-text-primary",
|
|
126
|
-
children: "Operational defaults"
|
|
127
|
-
}), B && /* @__PURE__ */ j(fe, {
|
|
128
|
-
variant: z.isCustomized ? "default" : "outline",
|
|
129
|
-
children: z.isCustomized ? "Customized for this workspace" : "Platform defaults"
|
|
130
|
-
})]
|
|
131
|
-
}), B ? /* @__PURE__ */ M("form", {
|
|
121
|
+
children: [/* @__PURE__ */ M("div", {
|
|
122
|
+
className: "min-w-0 space-y-6 xl:col-span-2",
|
|
123
|
+
children: [/* @__PURE__ */ M(N, {
|
|
132
124
|
className: "space-y-6",
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
125
|
+
children: [/* @__PURE__ */ M("div", {
|
|
126
|
+
className: "flex flex-wrap items-center justify-between gap-3",
|
|
127
|
+
children: [/* @__PURE__ */ j("h2", {
|
|
128
|
+
className: "text-base font-semibold text-text-primary",
|
|
129
|
+
children: "Operational defaults"
|
|
130
|
+
}), B && /* @__PURE__ */ j(de, {
|
|
131
|
+
variant: z.isCustomized ? "default" : "outline",
|
|
132
|
+
children: z.isCustomized ? "Customized for this workspace" : "Platform defaults"
|
|
133
|
+
})]
|
|
134
|
+
}), B ? /* @__PURE__ */ M("form", {
|
|
135
|
+
className: "space-y-6",
|
|
136
|
+
onSubmit: (e) => void Ee(e),
|
|
137
|
+
"aria-label": "MoveTheWheels settings",
|
|
138
|
+
children: [
|
|
139
|
+
J && /* @__PURE__ */ j("p", {
|
|
140
|
+
className: "rounded-lg border border-border-default bg-surface-secondary px-4 py-3 text-sm text-text-secondary",
|
|
141
|
+
children: "You can view these settings. Ask a workspace admin or the Logistics Director to change them."
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ M("fieldset", {
|
|
144
|
+
className: "space-y-4",
|
|
145
|
+
disabled: J || G,
|
|
146
|
+
children: [/* @__PURE__ */ j("legend", {
|
|
147
|
+
className: "text-sm font-semibold text-text-primary",
|
|
148
|
+
children: "Display"
|
|
149
|
+
}), /* @__PURE__ */ M("div", {
|
|
150
|
+
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
151
|
+
children: [
|
|
152
|
+
/* @__PURE__ */ M("div", {
|
|
153
|
+
className: "min-w-0 space-y-2",
|
|
154
|
+
children: [
|
|
155
|
+
/* @__PURE__ */ j(b, {
|
|
156
|
+
htmlFor: "mtw-settings-currency",
|
|
157
|
+
children: "Default currency"
|
|
158
|
+
}),
|
|
159
|
+
/* @__PURE__ */ M(x, {
|
|
160
|
+
value: U.defaultCurrency,
|
|
161
|
+
onValueChange: (e) => $("defaultCurrency", e),
|
|
162
|
+
disabled: J || G,
|
|
163
|
+
children: [/* @__PURE__ */ j(w, {
|
|
164
|
+
id: "mtw-settings-currency",
|
|
165
|
+
"aria-label": "Default currency",
|
|
166
|
+
children: /* @__PURE__ */ j(T, {})
|
|
167
|
+
}), /* @__PURE__ */ j(S, {
|
|
168
|
+
className: "max-h-72",
|
|
169
|
+
children: Ce.map((e) => /* @__PURE__ */ j(C, {
|
|
170
|
+
value: e,
|
|
171
|
+
children: oe(e)
|
|
172
|
+
}, e))
|
|
173
|
+
})]
|
|
174
|
+
}),
|
|
175
|
+
/* @__PURE__ */ j("p", {
|
|
176
|
+
className: "text-xs text-text-secondary",
|
|
177
|
+
children: "Used for order totals, revenue and costs that have no currency of their own."
|
|
178
|
+
})
|
|
179
|
+
]
|
|
180
|
+
}),
|
|
181
|
+
/* @__PURE__ */ M("div", {
|
|
182
|
+
className: "min-w-0 space-y-2",
|
|
183
|
+
children: [
|
|
184
|
+
/* @__PURE__ */ j(b, {
|
|
185
|
+
htmlFor: "mtw-settings-timezone",
|
|
186
|
+
children: "Time zone"
|
|
187
|
+
}),
|
|
188
|
+
/* @__PURE__ */ M(x, {
|
|
189
|
+
value: U.timezone,
|
|
190
|
+
onValueChange: (e) => $("timezone", e),
|
|
191
|
+
disabled: J || G,
|
|
192
|
+
children: [/* @__PURE__ */ j(w, {
|
|
193
|
+
id: "mtw-settings-timezone",
|
|
194
|
+
"aria-label": "Time zone",
|
|
195
|
+
children: /* @__PURE__ */ j(T, {})
|
|
196
|
+
}), /* @__PURE__ */ M(S, {
|
|
197
|
+
className: "max-h-72",
|
|
198
|
+
children: [/* @__PURE__ */ j(C, {
|
|
199
|
+
value: L,
|
|
200
|
+
children: `Each viewer's local time (yours: ${Te})`
|
|
201
|
+
}), we.map((e) => /* @__PURE__ */ j(C, {
|
|
202
|
+
value: e,
|
|
203
|
+
children: e.replace(/_/g, " ")
|
|
204
|
+
}, e))]
|
|
205
|
+
})]
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ j("p", {
|
|
208
|
+
className: "text-xs text-text-secondary",
|
|
209
|
+
children: "Dates and times on every MoveTheWheels screen are shown in this zone."
|
|
210
|
+
})
|
|
211
|
+
]
|
|
212
|
+
}),
|
|
213
|
+
/* @__PURE__ */ M("div", {
|
|
214
|
+
className: "min-w-0 space-y-2",
|
|
215
|
+
children: [/* @__PURE__ */ j(b, {
|
|
216
|
+
htmlFor: "mtw-settings-distance",
|
|
217
|
+
children: "Distance unit"
|
|
218
|
+
}), /* @__PURE__ */ M(x, {
|
|
219
|
+
value: U.distanceUnit,
|
|
220
|
+
onValueChange: (e) => {
|
|
221
|
+
let t = d.find((t) => t.value === e);
|
|
222
|
+
t && $("distanceUnit", t.value);
|
|
223
|
+
},
|
|
224
|
+
disabled: J || G,
|
|
225
|
+
children: [/* @__PURE__ */ j(w, {
|
|
226
|
+
id: "mtw-settings-distance",
|
|
227
|
+
"aria-label": "Distance unit",
|
|
228
|
+
children: /* @__PURE__ */ j(T, {})
|
|
229
|
+
}), /* @__PURE__ */ j(S, { children: d.map((e) => /* @__PURE__ */ j(C, {
|
|
230
|
+
value: e.value,
|
|
231
|
+
children: e.label
|
|
232
|
+
}, e.value)) })]
|
|
233
|
+
})]
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ M("div", {
|
|
236
|
+
className: "min-w-0 space-y-2",
|
|
237
|
+
children: [/* @__PURE__ */ j(b, {
|
|
238
|
+
htmlFor: "mtw-settings-weight",
|
|
239
|
+
children: "Weight unit"
|
|
240
|
+
}), /* @__PURE__ */ M(x, {
|
|
241
|
+
value: U.weightUnit,
|
|
242
|
+
onValueChange: (e) => {
|
|
243
|
+
let t = p.find((t) => t.value === e);
|
|
244
|
+
t && $("weightUnit", t.value);
|
|
245
|
+
},
|
|
246
|
+
disabled: J || G,
|
|
247
|
+
children: [/* @__PURE__ */ j(w, {
|
|
248
|
+
id: "mtw-settings-weight",
|
|
249
|
+
"aria-label": "Weight unit",
|
|
250
|
+
children: /* @__PURE__ */ j(T, {})
|
|
251
|
+
}), /* @__PURE__ */ j(S, { children: p.map((e) => /* @__PURE__ */ j(C, {
|
|
252
|
+
value: e.value,
|
|
253
|
+
children: e.label
|
|
254
|
+
}, e.value)) })]
|
|
255
|
+
})]
|
|
256
|
+
})
|
|
257
|
+
]
|
|
258
|
+
})]
|
|
259
|
+
}),
|
|
260
|
+
/* @__PURE__ */ M("fieldset", {
|
|
261
|
+
className: "space-y-4",
|
|
262
|
+
disabled: J || G,
|
|
263
|
+
children: [/* @__PURE__ */ j("legend", {
|
|
264
|
+
className: "text-sm font-semibold text-text-primary",
|
|
265
|
+
children: "New orders"
|
|
266
|
+
}), /* @__PURE__ */ M("div", {
|
|
267
|
+
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
268
|
+
children: [/* @__PURE__ */ M("div", {
|
|
150
269
|
className: "min-w-0 space-y-2",
|
|
151
270
|
children: [
|
|
152
271
|
/* @__PURE__ */ j(b, {
|
|
153
|
-
htmlFor: "mtw-settings-
|
|
154
|
-
children: "Default
|
|
272
|
+
htmlFor: "mtw-settings-priority",
|
|
273
|
+
children: "Default priority"
|
|
155
274
|
}),
|
|
156
275
|
/* @__PURE__ */ M(x, {
|
|
157
|
-
value: U.
|
|
158
|
-
onValueChange: (e) =>
|
|
276
|
+
value: U.defaultOrderPriority,
|
|
277
|
+
onValueChange: (e) => {
|
|
278
|
+
let t = f.find((t) => t.value === e);
|
|
279
|
+
t && $("defaultOrderPriority", t.value);
|
|
280
|
+
},
|
|
159
281
|
disabled: J || G,
|
|
160
282
|
children: [/* @__PURE__ */ j(w, {
|
|
161
|
-
id: "mtw-settings-
|
|
162
|
-
"aria-label": "Default
|
|
283
|
+
id: "mtw-settings-priority",
|
|
284
|
+
"aria-label": "Default priority",
|
|
163
285
|
children: /* @__PURE__ */ j(T, {})
|
|
164
|
-
}), /* @__PURE__ */ j(S, {
|
|
165
|
-
|
|
166
|
-
children:
|
|
167
|
-
|
|
168
|
-
children: se(e)
|
|
169
|
-
}, e))
|
|
170
|
-
})]
|
|
286
|
+
}), /* @__PURE__ */ j(S, { children: f.map((e) => /* @__PURE__ */ j(C, {
|
|
287
|
+
value: e.value,
|
|
288
|
+
children: e.label
|
|
289
|
+
}, e.value)) })]
|
|
171
290
|
}),
|
|
172
291
|
/* @__PURE__ */ j("p", {
|
|
173
292
|
className: "text-xs text-text-secondary",
|
|
174
|
-
children: "
|
|
293
|
+
children: "New orders start with this priority."
|
|
175
294
|
})
|
|
176
295
|
]
|
|
177
|
-
}),
|
|
178
|
-
/* @__PURE__ */ M("div", {
|
|
296
|
+
}), /* @__PURE__ */ M("div", {
|
|
179
297
|
className: "min-w-0 space-y-2",
|
|
180
298
|
children: [
|
|
181
299
|
/* @__PURE__ */ j(b, {
|
|
182
|
-
htmlFor: "mtw-settings-
|
|
183
|
-
children: "
|
|
300
|
+
htmlFor: "mtw-settings-window",
|
|
301
|
+
children: "Default delivery window (hours)"
|
|
184
302
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
value: L,
|
|
197
|
-
children: `Each viewer's local time (yours: ${we})`
|
|
198
|
-
}), Ce.map((e) => /* @__PURE__ */ j(C, {
|
|
199
|
-
value: e,
|
|
200
|
-
children: e.replace(/_/g, " ")
|
|
201
|
-
}, e))]
|
|
202
|
-
})]
|
|
303
|
+
/* @__PURE__ */ j(fe, {
|
|
304
|
+
id: "mtw-settings-window",
|
|
305
|
+
type: "number",
|
|
306
|
+
inputMode: "numeric",
|
|
307
|
+
min: 1,
|
|
308
|
+
max: 720,
|
|
309
|
+
step: 1,
|
|
310
|
+
value: U.defaultDeliveryWindowHours,
|
|
311
|
+
"aria-invalid": Y ? !0 : void 0,
|
|
312
|
+
"aria-describedby": "mtw-settings-window-help",
|
|
313
|
+
onChange: (e) => $("defaultDeliveryWindowHours", e.target.value)
|
|
203
314
|
}),
|
|
204
315
|
/* @__PURE__ */ j("p", {
|
|
205
|
-
|
|
206
|
-
|
|
316
|
+
id: "mtw-settings-window-help",
|
|
317
|
+
className: Y ? "text-xs text-status-error-text" : "text-xs text-text-secondary",
|
|
318
|
+
children: Y ?? "The order form suggests a scheduled delivery this many hours ahead."
|
|
207
319
|
})
|
|
208
320
|
]
|
|
209
|
-
})
|
|
210
|
-
/* @__PURE__ */ M("div", {
|
|
211
|
-
className: "min-w-0 space-y-2",
|
|
212
|
-
children: [/* @__PURE__ */ j(b, {
|
|
213
|
-
htmlFor: "mtw-settings-distance",
|
|
214
|
-
children: "Distance unit"
|
|
215
|
-
}), /* @__PURE__ */ M(x, {
|
|
216
|
-
value: U.distanceUnit,
|
|
217
|
-
onValueChange: (e) => {
|
|
218
|
-
let t = u.find((t) => t.value === e);
|
|
219
|
-
t && $("distanceUnit", t.value);
|
|
220
|
-
},
|
|
221
|
-
disabled: J || G,
|
|
222
|
-
children: [/* @__PURE__ */ j(w, {
|
|
223
|
-
id: "mtw-settings-distance",
|
|
224
|
-
"aria-label": "Distance unit",
|
|
225
|
-
children: /* @__PURE__ */ j(T, {})
|
|
226
|
-
}), /* @__PURE__ */ j(S, { children: u.map((e) => /* @__PURE__ */ j(C, {
|
|
227
|
-
value: e.value,
|
|
228
|
-
children: e.label
|
|
229
|
-
}, e.value)) })]
|
|
230
|
-
})]
|
|
231
|
-
}),
|
|
232
|
-
/* @__PURE__ */ M("div", {
|
|
233
|
-
className: "min-w-0 space-y-2",
|
|
234
|
-
children: [/* @__PURE__ */ j(b, {
|
|
235
|
-
htmlFor: "mtw-settings-weight",
|
|
236
|
-
children: "Weight unit"
|
|
237
|
-
}), /* @__PURE__ */ M(x, {
|
|
238
|
-
value: U.weightUnit,
|
|
239
|
-
onValueChange: (e) => {
|
|
240
|
-
let t = f.find((t) => t.value === e);
|
|
241
|
-
t && $("weightUnit", t.value);
|
|
242
|
-
},
|
|
243
|
-
disabled: J || G,
|
|
244
|
-
children: [/* @__PURE__ */ j(w, {
|
|
245
|
-
id: "mtw-settings-weight",
|
|
246
|
-
"aria-label": "Weight unit",
|
|
247
|
-
children: /* @__PURE__ */ j(T, {})
|
|
248
|
-
}), /* @__PURE__ */ j(S, { children: f.map((e) => /* @__PURE__ */ j(C, {
|
|
249
|
-
value: e.value,
|
|
250
|
-
children: e.label
|
|
251
|
-
}, e.value)) })]
|
|
252
|
-
})]
|
|
253
|
-
})
|
|
254
|
-
]
|
|
255
|
-
})]
|
|
256
|
-
}),
|
|
257
|
-
/* @__PURE__ */ M("fieldset", {
|
|
258
|
-
className: "space-y-4",
|
|
259
|
-
disabled: J || G,
|
|
260
|
-
children: [/* @__PURE__ */ j("legend", {
|
|
261
|
-
className: "text-sm font-semibold text-text-primary",
|
|
262
|
-
children: "New orders"
|
|
263
|
-
}), /* @__PURE__ */ M("div", {
|
|
264
|
-
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
265
|
-
children: [/* @__PURE__ */ M("div", {
|
|
266
|
-
className: "min-w-0 space-y-2",
|
|
267
|
-
children: [
|
|
268
|
-
/* @__PURE__ */ j(b, {
|
|
269
|
-
htmlFor: "mtw-settings-priority",
|
|
270
|
-
children: "Default priority"
|
|
271
|
-
}),
|
|
272
|
-
/* @__PURE__ */ M(x, {
|
|
273
|
-
value: U.defaultOrderPriority,
|
|
274
|
-
onValueChange: (e) => {
|
|
275
|
-
let t = d.find((t) => t.value === e);
|
|
276
|
-
t && $("defaultOrderPriority", t.value);
|
|
277
|
-
},
|
|
278
|
-
disabled: J || G,
|
|
279
|
-
children: [/* @__PURE__ */ j(w, {
|
|
280
|
-
id: "mtw-settings-priority",
|
|
281
|
-
"aria-label": "Default priority",
|
|
282
|
-
children: /* @__PURE__ */ j(T, {})
|
|
283
|
-
}), /* @__PURE__ */ j(S, { children: d.map((e) => /* @__PURE__ */ j(C, {
|
|
284
|
-
value: e.value,
|
|
285
|
-
children: e.label
|
|
286
|
-
}, e.value)) })]
|
|
287
|
-
}),
|
|
288
|
-
/* @__PURE__ */ j("p", {
|
|
289
|
-
className: "text-xs text-text-secondary",
|
|
290
|
-
children: "New orders start with this priority."
|
|
291
|
-
})
|
|
292
|
-
]
|
|
293
|
-
}), /* @__PURE__ */ M("div", {
|
|
294
|
-
className: "min-w-0 space-y-2",
|
|
295
|
-
children: [
|
|
296
|
-
/* @__PURE__ */ j(b, {
|
|
297
|
-
htmlFor: "mtw-settings-window",
|
|
298
|
-
children: "Default delivery window (hours)"
|
|
299
|
-
}),
|
|
300
|
-
/* @__PURE__ */ j(y, {
|
|
301
|
-
id: "mtw-settings-window",
|
|
302
|
-
type: "number",
|
|
303
|
-
inputMode: "numeric",
|
|
304
|
-
min: 1,
|
|
305
|
-
max: 720,
|
|
306
|
-
step: 1,
|
|
307
|
-
value: U.defaultDeliveryWindowHours,
|
|
308
|
-
"aria-invalid": Y ? !0 : void 0,
|
|
309
|
-
"aria-describedby": "mtw-settings-window-help",
|
|
310
|
-
onChange: (e) => $("defaultDeliveryWindowHours", e.target.value)
|
|
311
|
-
}),
|
|
312
|
-
/* @__PURE__ */ j("p", {
|
|
313
|
-
id: "mtw-settings-window-help",
|
|
314
|
-
className: Y ? "text-xs text-status-error-text" : "text-xs text-text-secondary",
|
|
315
|
-
children: Y ?? "The order form suggests a scheduled delivery this many hours ahead."
|
|
316
|
-
})
|
|
317
|
-
]
|
|
321
|
+
})]
|
|
318
322
|
})]
|
|
319
|
-
})
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}),
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
})
|
|
345
|
-
})
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
]
|
|
356
|
-
})]
|
|
323
|
+
}),
|
|
324
|
+
/* @__PURE__ */ j(D, { message: be }),
|
|
325
|
+
/* @__PURE__ */ M("div", {
|
|
326
|
+
className: "flex flex-wrap items-center justify-end gap-3",
|
|
327
|
+
children: [/* @__PURE__ */ M(m, {
|
|
328
|
+
type: "button",
|
|
329
|
+
variant: "outline",
|
|
330
|
+
disabled: !Z || G,
|
|
331
|
+
onClick: () => {
|
|
332
|
+
q(null), W(R(z));
|
|
333
|
+
},
|
|
334
|
+
children: [/* @__PURE__ */ j(ee, {
|
|
335
|
+
size: 16,
|
|
336
|
+
className: "mr-2"
|
|
337
|
+
}), " Discard changes"]
|
|
338
|
+
}), /* @__PURE__ */ M(m, {
|
|
339
|
+
type: "submit",
|
|
340
|
+
disabled: !Q,
|
|
341
|
+
children: [G ? /* @__PURE__ */ j(i, {
|
|
342
|
+
size: 16,
|
|
343
|
+
className: "mr-2 animate-spin"
|
|
344
|
+
}) : /* @__PURE__ */ j(te, {
|
|
345
|
+
size: 16,
|
|
346
|
+
className: "mr-2"
|
|
347
|
+
}), "Save settings"]
|
|
348
|
+
})]
|
|
349
|
+
})
|
|
350
|
+
]
|
|
351
|
+
}) : /* @__PURE__ */ M("div", {
|
|
352
|
+
className: "space-y-4",
|
|
353
|
+
"aria-busy": "true",
|
|
354
|
+
children: [
|
|
355
|
+
/* @__PURE__ */ j(E, { className: "h-10 w-full" }),
|
|
356
|
+
/* @__PURE__ */ j(E, { className: "h-10 w-full" }),
|
|
357
|
+
/* @__PURE__ */ j(E, { className: "h-10 w-full" })
|
|
358
|
+
]
|
|
359
|
+
})]
|
|
360
|
+
}), /* @__PURE__ */ j(O, { readOnly: J }, r ?? "none")]
|
|
357
361
|
}), /* @__PURE__ */ M("div", {
|
|
358
362
|
className: "space-y-6",
|
|
359
|
-
children: [/* @__PURE__ */ M(
|
|
363
|
+
children: [/* @__PURE__ */ M(h, { children: [/* @__PURE__ */ M(v, { children: [/* @__PURE__ */ j(y, {
|
|
360
364
|
className: "text-base",
|
|
361
365
|
children: "How it looks now"
|
|
362
|
-
}), /* @__PURE__ */ j(
|
|
366
|
+
}), /* @__PURE__ */ j(_, { children: "Examples using the saved settings." })] }), /* @__PURE__ */ M(g, { children: [
|
|
363
367
|
/* @__PURE__ */ M("dl", {
|
|
364
368
|
className: "space-y-2 text-sm",
|
|
365
369
|
"data-testid": "mtw-settings-preview",
|
|
@@ -391,7 +395,7 @@ function B() {
|
|
|
391
395
|
children: "Weight"
|
|
392
396
|
}), /* @__PURE__ */ j("dd", {
|
|
393
397
|
className: "font-medium text-text-primary",
|
|
394
|
-
children:
|
|
398
|
+
children: u(750)
|
|
395
399
|
})]
|
|
396
400
|
}),
|
|
397
401
|
/* @__PURE__ */ M("div", {
|
|
@@ -401,7 +405,7 @@ function B() {
|
|
|
401
405
|
children: "Date and time"
|
|
402
406
|
}), /* @__PURE__ */ j("dd", {
|
|
403
407
|
className: "text-right font-medium text-text-primary",
|
|
404
|
-
children: l(
|
|
408
|
+
children: l(De)
|
|
405
409
|
})]
|
|
406
410
|
})
|
|
407
411
|
]
|
|
@@ -410,17 +414,17 @@ function B() {
|
|
|
410
414
|
className: "mt-4 text-xs text-text-secondary",
|
|
411
415
|
children: ["Last saved ", l(z.updatedAt)]
|
|
412
416
|
}),
|
|
413
|
-
V && /* @__PURE__ */ j(
|
|
417
|
+
V && /* @__PURE__ */ j(m, {
|
|
414
418
|
variant: "outline",
|
|
415
419
|
size: "sm",
|
|
416
420
|
className: "mt-4",
|
|
417
|
-
onClick:
|
|
421
|
+
onClick: ye,
|
|
418
422
|
children: "Try loading again"
|
|
419
423
|
})
|
|
420
|
-
] })] }), /* @__PURE__ */ M(
|
|
424
|
+
] })] }), /* @__PURE__ */ M(h, { children: [/* @__PURE__ */ M(v, { children: [/* @__PURE__ */ j(y, {
|
|
421
425
|
className: "text-base",
|
|
422
426
|
children: "Other settings"
|
|
423
|
-
}), /* @__PURE__ */ j(
|
|
427
|
+
}), /* @__PURE__ */ j(_, { children: "These are managed by the platform for every product." })] }), /* @__PURE__ */ M(g, {
|
|
424
428
|
className: "space-y-2",
|
|
425
429
|
children: [/* @__PURE__ */ M("button", {
|
|
426
430
|
type: "button",
|
|
@@ -439,7 +443,7 @@ function B() {
|
|
|
439
443
|
children: "Carrier, ELD and GPS feeds that update shipments automatically"
|
|
440
444
|
})]
|
|
441
445
|
})]
|
|
442
|
-
}),
|
|
446
|
+
}), _e.map((t) => {
|
|
443
447
|
let r = t.icon;
|
|
444
448
|
return /* @__PURE__ */ M("button", {
|
|
445
449
|
type: "button",
|