@burdenoff/microfe-movethewheels 2026.1026.2 → 2026.1026.3
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/MoveTheWheelsRoot.js +126 -159
- package/dist/MoveTheWheelsRoutes.js +16 -32
- package/dist/hooks/index.js +0 -3
- package/dist/index.js +27 -30
- package/dist/movethewheels/hooks/index.d.ts +0 -3
- package/package.json +1 -1
- package/src/movethewheels/MoveTheWheelsRoot.tsx +2 -46
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +0 -16
- package/src/movethewheels/hooks/index.ts +0 -9
- package/dist/hooks/useImportExport.js +0 -27
- package/dist/hooks/useReports.js +0 -75
- package/dist/hooks/useSettings.js +0 -67
- package/dist/movethewheels/hooks/useImportExport.d.ts +0 -23
- package/dist/movethewheels/hooks/useReports.d.ts +0 -39
- package/dist/movethewheels/hooks/useSettings.d.ts +0 -17
- package/dist/movethewheels/pages/ImportExportPage.d.ts +0 -8
- package/dist/movethewheels/pages/MarketplacePage.d.ts +0 -12
- package/dist/movethewheels/pages/ReportsPage.d.ts +0 -8
- package/dist/movethewheels/pages/SettingsPage.d.ts +0 -8
- package/dist/node_modules/lucide-react/dist/esm/icons/bell.js +0 -11
- package/dist/node_modules/lucide-react/dist/esm/icons/file-chart-column-increasing.js +0 -26
- package/dist/node_modules/lucide-react/dist/esm/icons/file-spreadsheet.js +0 -30
- package/dist/node_modules/lucide-react/dist/esm/icons/globe.js +0 -20
- package/dist/node_modules/lucide-react/dist/esm/icons/settings.js +0 -13
- package/dist/node_modules/lucide-react/dist/esm/icons/shield.js +0 -8
- package/dist/node_modules/lucide-react/dist/esm/icons/store.js +0 -26
- package/dist/node_modules/lucide-react/dist/esm/icons/webhook.js +0 -18
- package/dist/pages/ImportExportPage.js +0 -245
- package/dist/pages/MarketplacePage.js +0 -23
- package/dist/pages/ReportsPage.js +0 -328
- package/dist/pages/SettingsPage.js +0 -404
- package/dist/utils/download.js +0 -22
- package/src/movethewheels/hooks/useImportExport.ts +0 -65
- package/src/movethewheels/hooks/useReports.ts +0 -154
- package/src/movethewheels/hooks/useSettings.ts +0 -124
- package/src/movethewheels/pages/ImportExportPage.tsx +0 -288
- package/src/movethewheels/pages/MarketplacePage.tsx +0 -36
- package/src/movethewheels/pages/ReportsPage.tsx +0 -379
- package/src/movethewheels/pages/SettingsPage.tsx +0 -548
- package/src/operations/wspace/movethewheels/fragments/core.withdrawn.graphql +0 -59
- package/src/operations/wspace/movethewheels/mutations/marketplace-reports.withdrawn.graphql +0 -93
- package/src/operations/wspace/movethewheels/queries/marketplace-reports.withdrawn.graphql +0 -58
|
@@ -1,404 +0,0 @@
|
|
|
1
|
-
import { Bell as e } from "../node_modules/lucide-react/dist/esm/icons/bell.js";
|
|
2
|
-
import { Globe as t } from "../node_modules/lucide-react/dist/esm/icons/globe.js";
|
|
3
|
-
import { Save as n } from "../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
4
|
-
import { Settings as r } from "../node_modules/lucide-react/dist/esm/icons/settings.js";
|
|
5
|
-
import { Shield as i } from "../node_modules/lucide-react/dist/esm/icons/shield.js";
|
|
6
|
-
import { User as a } from "../node_modules/lucide-react/dist/esm/icons/user.js";
|
|
7
|
-
import { Webhook as o } from "../node_modules/lucide-react/dist/esm/icons/webhook.js";
|
|
8
|
-
import { useTr as s } from "../shared/hooks/useTr.js";
|
|
9
|
-
import { useModuleSettings as c } from "../hooks/useSettings.js";
|
|
10
|
-
import "../hooks/index.js";
|
|
11
|
-
import { Button as l, Card as u, CardContent as d, CardDescription as f, CardHeader as p, CardTitle as m, Input as h, Label as g, Select as _, SelectContent as v, SelectItem as y, SelectTrigger as b, SelectValue as x, Switch as S, Tabs as C, TabsContent as w, TabsList as T, TabsTrigger as E } from "../components/ui.js";
|
|
12
|
-
import { PageLayout as D } from "../components/PageLayout.js";
|
|
13
|
-
import { useEffect as O, useMemo as k, useState as A } from "react";
|
|
14
|
-
import { jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
15
|
-
import { EmphasisPanel as N, NextSteps as P, PagePurpose as F } from "@burdenoff/fe-libs/ui";
|
|
16
|
-
//#region src/movethewheels/pages/SettingsPage.tsx
|
|
17
|
-
function I(e) {
|
|
18
|
-
let t = e.company ?? {}, n = e.localization ?? {}, r = e.notifications ?? {}, i = e.security ?? {}, a = e.integrations ?? {};
|
|
19
|
-
return {
|
|
20
|
-
company: {
|
|
21
|
-
name: t.name ?? "",
|
|
22
|
-
email: t.email ?? "",
|
|
23
|
-
phone: t.phone ?? "",
|
|
24
|
-
website: t.website ?? ""
|
|
25
|
-
},
|
|
26
|
-
localization: {
|
|
27
|
-
timezone: n.timezone ?? "utc",
|
|
28
|
-
currency: n.currency ?? "usd",
|
|
29
|
-
language: n.language ?? "en"
|
|
30
|
-
},
|
|
31
|
-
notifications: {
|
|
32
|
-
orderUpdates: r.orderUpdates ?? !0,
|
|
33
|
-
deliveryAlerts: r.deliveryAlerts ?? !0,
|
|
34
|
-
systemNotifications: r.systemNotifications ?? !0,
|
|
35
|
-
weeklyReports: r.weeklyReports ?? !1
|
|
36
|
-
},
|
|
37
|
-
twoFactorEnabled: i.twoFactorEnabled ?? !1,
|
|
38
|
-
integrations: a
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
function L() {
|
|
42
|
-
let L = s(), { preferences: R, isLoading: z, isSaving: B, error: V, savePreferences: H } = c(), [U, W] = A("general"), [G, K] = A(() => I({})), [q, J] = A(!1), Y = k(() => [
|
|
43
|
-
{
|
|
44
|
-
key: "googleMaps",
|
|
45
|
-
name: L("movethewheels.settings.integrations.googleMaps", "Google Maps")
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
key: "stripe",
|
|
49
|
-
name: L("movethewheels.settings.integrations.stripe", "Stripe")
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
key: "twilio",
|
|
53
|
-
name: L("movethewheels.settings.integrations.twilio", "Twilio")
|
|
54
|
-
}
|
|
55
|
-
], [L]), X = k(() => [
|
|
56
|
-
{
|
|
57
|
-
key: "orderUpdates",
|
|
58
|
-
label: L("movethewheels.settings.notifications.orderUpdates.label", "Order updates"),
|
|
59
|
-
desc: L("movethewheels.settings.notifications.orderUpdates.desc", "Receive notifications for order status changes")
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
key: "deliveryAlerts",
|
|
63
|
-
label: L("movethewheels.settings.notifications.deliveryAlerts.label", "Delivery alerts"),
|
|
64
|
-
desc: L("movethewheels.settings.notifications.deliveryAlerts.desc", "Get notified about delivery issues")
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
key: "systemNotifications",
|
|
68
|
-
label: L("movethewheels.settings.notifications.systemNotifications.label", "System notifications"),
|
|
69
|
-
desc: L("movethewheels.settings.notifications.systemNotifications.desc", "Important system updates and maintenance")
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
key: "weeklyReports",
|
|
73
|
-
label: L("movethewheels.settings.notifications.weeklyReports.label", "Weekly reports"),
|
|
74
|
-
desc: L("movethewheels.settings.notifications.weeklyReports.desc", "Receive weekly performance summary")
|
|
75
|
-
}
|
|
76
|
-
], [L]), Z = k(() => I(R), [R]);
|
|
77
|
-
O(() => {
|
|
78
|
-
K(Z);
|
|
79
|
-
}, [Z]);
|
|
80
|
-
let Q = (e) => K((t) => ({
|
|
81
|
-
...t,
|
|
82
|
-
company: {
|
|
83
|
-
...t.company,
|
|
84
|
-
...e
|
|
85
|
-
}
|
|
86
|
-
})), $ = (e) => K((t) => ({
|
|
87
|
-
...t,
|
|
88
|
-
localization: {
|
|
89
|
-
...t.localization,
|
|
90
|
-
...e
|
|
91
|
-
}
|
|
92
|
-
})), ee = (e, t) => K((n) => ({
|
|
93
|
-
...n,
|
|
94
|
-
notifications: {
|
|
95
|
-
...n.notifications,
|
|
96
|
-
[e]: t
|
|
97
|
-
}
|
|
98
|
-
})), te = async () => {
|
|
99
|
-
J(!1);
|
|
100
|
-
try {
|
|
101
|
-
await H({
|
|
102
|
-
company: G.company,
|
|
103
|
-
localization: G.localization,
|
|
104
|
-
notifications: G.notifications,
|
|
105
|
-
security: { twoFactorEnabled: G.twoFactorEnabled },
|
|
106
|
-
integrations: G.integrations
|
|
107
|
-
}), J(!0);
|
|
108
|
-
} catch {}
|
|
109
|
-
};
|
|
110
|
-
return /* @__PURE__ */ M(D, {
|
|
111
|
-
title: L("movethewheels.settings.title", "Settings"),
|
|
112
|
-
subtitle: L("movethewheels.settings.subtitle", "Manage your account and preferences"),
|
|
113
|
-
icon: /* @__PURE__ */ j(r, { size: 24 }),
|
|
114
|
-
children: [
|
|
115
|
-
/* @__PURE__ */ j(F, {
|
|
116
|
-
icon: /* @__PURE__ */ j(r, { size: 18 }),
|
|
117
|
-
children: L("movethewheels.settings.purpose", "Configure how MoveTheWheels works for your business — company details and localization, which notifications you receive, account security, and the integrations (maps, payments, messaging) that power deliveries. Set these once so the rest of the app behaves the way you expect.")
|
|
118
|
-
}),
|
|
119
|
-
(q || V) && /* @__PURE__ */ j("div", {
|
|
120
|
-
role: "status",
|
|
121
|
-
className: `rounded-lg p-3 text-sm ${V ? "bg-status-error-bg-subtle text-status-error-text" : "bg-status-success-bg-subtle text-status-success-text"}`,
|
|
122
|
-
children: V ? V.message : L("movethewheels.settings.saved", "Settings saved.")
|
|
123
|
-
}),
|
|
124
|
-
/* @__PURE__ */ j(P, {
|
|
125
|
-
storageKey: "movethewheels-settings",
|
|
126
|
-
steps: [
|
|
127
|
-
{
|
|
128
|
-
id: "company",
|
|
129
|
-
label: L("movethewheels.settings.nextSteps.company.label", "Confirm company details & localization"),
|
|
130
|
-
description: L("movethewheels.settings.nextSteps.company.description", "Set your name, contact info, timezone, currency and language."),
|
|
131
|
-
icon: /* @__PURE__ */ j(a, { size: 16 }),
|
|
132
|
-
onClick: () => W("general")
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
id: "notifications",
|
|
136
|
-
label: L("movethewheels.settings.nextSteps.notifications.label", "Choose your notifications"),
|
|
137
|
-
description: L("movethewheels.settings.nextSteps.notifications.description", "Decide which order, delivery and report emails you receive."),
|
|
138
|
-
icon: /* @__PURE__ */ j(e, { size: 16 }),
|
|
139
|
-
onClick: () => W("notifications")
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
id: "security",
|
|
143
|
-
label: L("movethewheels.settings.nextSteps.security.label", "Secure your account"),
|
|
144
|
-
description: L("movethewheels.settings.nextSteps.security.description", "Enable two-factor authentication for an extra layer of security."),
|
|
145
|
-
icon: /* @__PURE__ */ j(i, { size: 16 }),
|
|
146
|
-
onClick: () => W("security")
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
id: "integrations",
|
|
150
|
-
label: L("movethewheels.settings.nextSteps.integrations.label", "Connect your tools"),
|
|
151
|
-
description: L("movethewheels.settings.nextSteps.integrations.description", "Link maps, payments and messaging providers."),
|
|
152
|
-
icon: /* @__PURE__ */ j(o, { size: 16 }),
|
|
153
|
-
onClick: () => W("integrations")
|
|
154
|
-
}
|
|
155
|
-
]
|
|
156
|
-
}),
|
|
157
|
-
/* @__PURE__ */ M(C, {
|
|
158
|
-
value: U,
|
|
159
|
-
onValueChange: W,
|
|
160
|
-
children: [
|
|
161
|
-
/* @__PURE__ */ M(T, {
|
|
162
|
-
className: "mb-6",
|
|
163
|
-
children: [
|
|
164
|
-
/* @__PURE__ */ M(E, {
|
|
165
|
-
value: "general",
|
|
166
|
-
children: [
|
|
167
|
-
/* @__PURE__ */ j(a, { size: 16 }),
|
|
168
|
-
" ",
|
|
169
|
-
L("movethewheels.settings.tabs.general", "General")
|
|
170
|
-
]
|
|
171
|
-
}),
|
|
172
|
-
/* @__PURE__ */ M(E, {
|
|
173
|
-
value: "notifications",
|
|
174
|
-
children: [
|
|
175
|
-
/* @__PURE__ */ j(e, { size: 16 }),
|
|
176
|
-
" ",
|
|
177
|
-
L("movethewheels.settings.tabs.notifications", "Notifications")
|
|
178
|
-
]
|
|
179
|
-
}),
|
|
180
|
-
/* @__PURE__ */ M(E, {
|
|
181
|
-
value: "security",
|
|
182
|
-
children: [
|
|
183
|
-
/* @__PURE__ */ j(i, { size: 16 }),
|
|
184
|
-
" ",
|
|
185
|
-
L("movethewheels.settings.tabs.security", "Security")
|
|
186
|
-
]
|
|
187
|
-
}),
|
|
188
|
-
/* @__PURE__ */ M(E, {
|
|
189
|
-
value: "integrations",
|
|
190
|
-
children: [
|
|
191
|
-
/* @__PURE__ */ j(o, { size: 16 }),
|
|
192
|
-
" ",
|
|
193
|
-
L("movethewheels.settings.tabs.integrations", "Integrations")
|
|
194
|
-
]
|
|
195
|
-
})
|
|
196
|
-
]
|
|
197
|
-
}),
|
|
198
|
-
/* @__PURE__ */ M(w, {
|
|
199
|
-
value: "general",
|
|
200
|
-
className: "space-y-6",
|
|
201
|
-
children: [/* @__PURE__ */ M(N, { children: [
|
|
202
|
-
/* @__PURE__ */ j("h2", {
|
|
203
|
-
className: "text-base font-semibold text-text-primary",
|
|
204
|
-
children: L("movethewheels.settings.company.title", "Company Information")
|
|
205
|
-
}),
|
|
206
|
-
/* @__PURE__ */ j("p", {
|
|
207
|
-
className: "text-sm text-text-secondary mb-4",
|
|
208
|
-
children: L("movethewheels.settings.company.basicDetails", "Basic company details")
|
|
209
|
-
}),
|
|
210
|
-
/* @__PURE__ */ M("div", {
|
|
211
|
-
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
212
|
-
children: [
|
|
213
|
-
/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j(g, { children: L("movethewheels.settings.company.name", "Company Name") }), /* @__PURE__ */ j(h, {
|
|
214
|
-
value: G.company.name,
|
|
215
|
-
placeholder: L("movethewheels.settings.company.placeholders.name", "Your company name"),
|
|
216
|
-
disabled: z,
|
|
217
|
-
onChange: (e) => Q({ name: e.target.value })
|
|
218
|
-
})] }),
|
|
219
|
-
/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j(g, { children: L("movethewheels.settings.company.email", "Contact Email") }), /* @__PURE__ */ j(h, {
|
|
220
|
-
type: "email",
|
|
221
|
-
value: G.company.email,
|
|
222
|
-
placeholder: L("movethewheels.settings.company.placeholders.email", "contact@example.com"),
|
|
223
|
-
disabled: z,
|
|
224
|
-
onChange: (e) => Q({ email: e.target.value })
|
|
225
|
-
})] }),
|
|
226
|
-
/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j(g, { children: L("movethewheels.settings.company.phone", "Phone") }), /* @__PURE__ */ j(h, {
|
|
227
|
-
value: G.company.phone,
|
|
228
|
-
placeholder: L("movethewheels.settings.company.placeholders.phone", "+1-555-0100"),
|
|
229
|
-
disabled: z,
|
|
230
|
-
onChange: (e) => Q({ phone: e.target.value })
|
|
231
|
-
})] }),
|
|
232
|
-
/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j(g, { children: L("movethewheels.settings.company.website", "Website") }), /* @__PURE__ */ j(h, {
|
|
233
|
-
value: G.company.website,
|
|
234
|
-
placeholder: L("movethewheels.settings.company.placeholders.website", "https://example.com"),
|
|
235
|
-
disabled: z,
|
|
236
|
-
onChange: (e) => Q({ website: e.target.value })
|
|
237
|
-
})] })
|
|
238
|
-
]
|
|
239
|
-
})
|
|
240
|
-
] }), /* @__PURE__ */ M(u, { children: [/* @__PURE__ */ j(p, { children: /* @__PURE__ */ M(m, {
|
|
241
|
-
className: "flex items-center gap-2",
|
|
242
|
-
children: [
|
|
243
|
-
/* @__PURE__ */ j(t, { size: 18 }),
|
|
244
|
-
" ",
|
|
245
|
-
L("movethewheels.settings.localization.title", "Localization")
|
|
246
|
-
]
|
|
247
|
-
}) }), /* @__PURE__ */ j(d, {
|
|
248
|
-
className: "space-y-4",
|
|
249
|
-
children: /* @__PURE__ */ M("div", {
|
|
250
|
-
className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
|
|
251
|
-
children: [
|
|
252
|
-
/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j(g, { children: L("movethewheels.settings.localization.timezone", "Timezone") }), /* @__PURE__ */ M(_, {
|
|
253
|
-
value: G.localization.timezone,
|
|
254
|
-
onValueChange: (e) => $({ timezone: e }),
|
|
255
|
-
children: [/* @__PURE__ */ j(b, { children: /* @__PURE__ */ j(x, {}) }), /* @__PURE__ */ M(v, { children: [
|
|
256
|
-
/* @__PURE__ */ j(y, {
|
|
257
|
-
value: "pst",
|
|
258
|
-
children: "Pacific Time (PST)"
|
|
259
|
-
}),
|
|
260
|
-
/* @__PURE__ */ j(y, {
|
|
261
|
-
value: "est",
|
|
262
|
-
children: "Eastern Time (EST)"
|
|
263
|
-
}),
|
|
264
|
-
/* @__PURE__ */ j(y, {
|
|
265
|
-
value: "utc",
|
|
266
|
-
children: "UTC"
|
|
267
|
-
})
|
|
268
|
-
] })]
|
|
269
|
-
})] }),
|
|
270
|
-
/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j(g, { children: L("movethewheels.settings.localization.currency", "Currency") }), /* @__PURE__ */ M(_, {
|
|
271
|
-
value: G.localization.currency,
|
|
272
|
-
onValueChange: (e) => $({ currency: e }),
|
|
273
|
-
children: [/* @__PURE__ */ j(b, { children: /* @__PURE__ */ j(x, {}) }), /* @__PURE__ */ M(v, { children: [
|
|
274
|
-
/* @__PURE__ */ j(y, {
|
|
275
|
-
value: "usd",
|
|
276
|
-
children: "USD ($)"
|
|
277
|
-
}),
|
|
278
|
-
/* @__PURE__ */ j(y, {
|
|
279
|
-
value: "eur",
|
|
280
|
-
children: "EUR (€)"
|
|
281
|
-
}),
|
|
282
|
-
/* @__PURE__ */ j(y, {
|
|
283
|
-
value: "gbp",
|
|
284
|
-
children: "GBP (£)"
|
|
285
|
-
})
|
|
286
|
-
] })]
|
|
287
|
-
})] }),
|
|
288
|
-
/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j(g, { children: L("movethewheels.settings.localization.language", "Language") }), /* @__PURE__ */ M(_, {
|
|
289
|
-
value: G.localization.language,
|
|
290
|
-
onValueChange: (e) => $({ language: e }),
|
|
291
|
-
children: [/* @__PURE__ */ j(b, { children: /* @__PURE__ */ j(x, {}) }), /* @__PURE__ */ M(v, { children: [
|
|
292
|
-
/* @__PURE__ */ j(y, {
|
|
293
|
-
value: "en",
|
|
294
|
-
children: "English"
|
|
295
|
-
}),
|
|
296
|
-
/* @__PURE__ */ j(y, {
|
|
297
|
-
value: "es",
|
|
298
|
-
children: "Spanish"
|
|
299
|
-
}),
|
|
300
|
-
/* @__PURE__ */ j(y, {
|
|
301
|
-
value: "fr",
|
|
302
|
-
children: "French"
|
|
303
|
-
})
|
|
304
|
-
] })]
|
|
305
|
-
})] })
|
|
306
|
-
]
|
|
307
|
-
})
|
|
308
|
-
})] })]
|
|
309
|
-
}),
|
|
310
|
-
/* @__PURE__ */ j(w, {
|
|
311
|
-
value: "notifications",
|
|
312
|
-
className: "space-y-6",
|
|
313
|
-
children: /* @__PURE__ */ M(u, { children: [/* @__PURE__ */ j(p, { children: /* @__PURE__ */ j(m, { children: L("movethewheels.settings.notifications.title", "Email Notifications") }) }), /* @__PURE__ */ j(d, {
|
|
314
|
-
className: "space-y-4",
|
|
315
|
-
children: X.map((e) => /* @__PURE__ */ M("div", {
|
|
316
|
-
className: "flex items-center justify-between",
|
|
317
|
-
children: [/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
|
|
318
|
-
className: "font-medium",
|
|
319
|
-
children: e.label
|
|
320
|
-
}), /* @__PURE__ */ j("p", {
|
|
321
|
-
className: "text-sm text-text-secondary",
|
|
322
|
-
children: e.desc
|
|
323
|
-
})] }), /* @__PURE__ */ j(S, {
|
|
324
|
-
checked: G.notifications[e.key],
|
|
325
|
-
disabled: z,
|
|
326
|
-
onCheckedChange: (t) => ee(e.key, t)
|
|
327
|
-
})]
|
|
328
|
-
}, e.key))
|
|
329
|
-
})] })
|
|
330
|
-
}),
|
|
331
|
-
/* @__PURE__ */ M(w, {
|
|
332
|
-
value: "security",
|
|
333
|
-
className: "space-y-6",
|
|
334
|
-
children: [/* @__PURE__ */ j(u, { children: /* @__PURE__ */ M(p, { children: [/* @__PURE__ */ j(m, { children: L("movethewheels.settings.security.password.title", "Password") }), /* @__PURE__ */ j(f, { children: L("movethewheels.settings.security.password.description", "Your password and sign-in credentials are managed centrally by your workspace identity provider — update them from your account security settings, not here.") })] }) }), /* @__PURE__ */ M(u, { children: [/* @__PURE__ */ M(p, { children: [/* @__PURE__ */ j(m, { children: L("movethewheels.settings.security.twoFactor.title", "Two-Factor Authentication") }), /* @__PURE__ */ j(f, { children: L("movethewheels.settings.security.twoFactor.description", "Add an extra layer of security") })] }), /* @__PURE__ */ j(d, { children: /* @__PURE__ */ M("div", {
|
|
335
|
-
className: "flex items-center justify-between",
|
|
336
|
-
children: [/* @__PURE__ */ M("p", { children: [
|
|
337
|
-
L("movethewheels.settings.security.twoFactor.status", "Status:"),
|
|
338
|
-
" ",
|
|
339
|
-
/* @__PURE__ */ j("span", {
|
|
340
|
-
className: `font-medium ${G.twoFactorEnabled ? "text-status-success-text" : "text-status-warning-text"}`,
|
|
341
|
-
children: G.twoFactorEnabled ? L("movethewheels.settings.security.twoFactor.enabled", "Enabled") : L("movethewheels.settings.security.twoFactor.disabled", "Disabled")
|
|
342
|
-
})
|
|
343
|
-
] }), /* @__PURE__ */ j(l, {
|
|
344
|
-
variant: "outline",
|
|
345
|
-
disabled: B,
|
|
346
|
-
onClick: () => K((e) => ({
|
|
347
|
-
...e,
|
|
348
|
-
twoFactorEnabled: !e.twoFactorEnabled
|
|
349
|
-
})),
|
|
350
|
-
children: G.twoFactorEnabled ? L("movethewheels.settings.security.twoFactor.disable", "Disable 2FA") : L("movethewheels.settings.security.twoFactor.enable", "Enable 2FA")
|
|
351
|
-
})]
|
|
352
|
-
}) })] })]
|
|
353
|
-
}),
|
|
354
|
-
/* @__PURE__ */ j(w, {
|
|
355
|
-
value: "integrations",
|
|
356
|
-
className: "space-y-6",
|
|
357
|
-
children: /* @__PURE__ */ M(u, { children: [/* @__PURE__ */ M(p, { children: [/* @__PURE__ */ j(m, { children: L("movethewheels.settings.integrations.title", "Connected Services") }), /* @__PURE__ */ j(f, { children: L("movethewheels.settings.integrations.description", "Connect the providers that power maps, payments and messaging.") })] }), /* @__PURE__ */ j(d, {
|
|
358
|
-
className: "space-y-3",
|
|
359
|
-
children: Y.map((e) => {
|
|
360
|
-
let t = G.integrations[e.key] === !0;
|
|
361
|
-
return /* @__PURE__ */ M("div", {
|
|
362
|
-
className: "flex items-center justify-between p-3 border rounded-lg",
|
|
363
|
-
children: [/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("span", {
|
|
364
|
-
className: "font-medium",
|
|
365
|
-
children: e.name
|
|
366
|
-
}), /* @__PURE__ */ j("p", {
|
|
367
|
-
className: "text-sm text-text-secondary",
|
|
368
|
-
children: t ? L("movethewheels.settings.integrations.connected", "Connected") : L("movethewheels.settings.integrations.notConfigured", "Not configured")
|
|
369
|
-
})] }), /* @__PURE__ */ j(l, {
|
|
370
|
-
variant: t ? "outline" : "default",
|
|
371
|
-
size: "sm",
|
|
372
|
-
disabled: B,
|
|
373
|
-
onClick: () => K((n) => ({
|
|
374
|
-
...n,
|
|
375
|
-
integrations: {
|
|
376
|
-
...n.integrations,
|
|
377
|
-
[e.key]: !t
|
|
378
|
-
}
|
|
379
|
-
})),
|
|
380
|
-
children: t ? L("movethewheels.settings.integrations.disconnect", "Disconnect") : L("movethewheels.settings.integrations.connect", "Connect")
|
|
381
|
-
})]
|
|
382
|
-
}, e.key);
|
|
383
|
-
})
|
|
384
|
-
})] })
|
|
385
|
-
})
|
|
386
|
-
]
|
|
387
|
-
}),
|
|
388
|
-
/* @__PURE__ */ j("div", {
|
|
389
|
-
className: "flex justify-end",
|
|
390
|
-
children: /* @__PURE__ */ M(l, {
|
|
391
|
-
onClick: () => void te(),
|
|
392
|
-
disabled: B || z,
|
|
393
|
-
children: [
|
|
394
|
-
/* @__PURE__ */ j(n, { size: 16 }),
|
|
395
|
-
" ",
|
|
396
|
-
B ? L("movethewheels.settings.saving", "Saving…") : L("movethewheels.settings.saveChanges", "Save Changes")
|
|
397
|
-
]
|
|
398
|
-
})
|
|
399
|
-
})
|
|
400
|
-
]
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
//#endregion
|
|
404
|
-
export { L as default };
|
package/dist/utils/download.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//#region src/movethewheels/utils/download.ts
|
|
2
|
-
function e(e, t, n) {
|
|
3
|
-
if (typeof document > "u") return;
|
|
4
|
-
let r = new Blob([t], { type: n }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
5
|
-
a.href = i, a.download = e, document.body.appendChild(a), a.click(), a.remove(), URL.revokeObjectURL(i);
|
|
6
|
-
}
|
|
7
|
-
function t(t, n) {
|
|
8
|
-
e(t, JSON.stringify(n, null, 2), "application/json");
|
|
9
|
-
}
|
|
10
|
-
function n(e) {
|
|
11
|
-
if (!e || typeof e != "object") return null;
|
|
12
|
-
let t = Object.entries(e);
|
|
13
|
-
if (t.length === 0) return null;
|
|
14
|
-
let n = (e) => /[",\n]/.test(e) ? `"${e.replace(/"/g, "\"\"")}"` : e, r = (e) => e == null ? "" : typeof e == "object" ? JSON.stringify(e) : String(e), i = ["Field,Value"];
|
|
15
|
-
for (let [e, a] of t) i.push(`${n(e)},${n(r(a))}`);
|
|
16
|
-
return i.join("\n");
|
|
17
|
-
}
|
|
18
|
-
function r(e) {
|
|
19
|
-
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "report";
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
export { e as downloadFile, t as downloadJson, n as recordToCsv, r as slugifyForFilename };
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { useCallback, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
export interface ImportExportResult {
|
|
4
|
-
success: boolean;
|
|
5
|
-
message: string;
|
|
6
|
-
payload?: Record<string, unknown> | null;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface UseImportExportResult {
|
|
10
|
-
exportData: (resource: string, format?: string) => Promise<ImportExportResult>;
|
|
11
|
-
importData: (resource: string, payload: Record<string, unknown>) => Promise<ImportExportResult>;
|
|
12
|
-
isBusy: boolean;
|
|
13
|
-
error: Error | null;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Import/export surface withdrawn from wspace-movethewheels-svc by migration
|
|
18
|
-
* 20260707000001_movethewheels_reuse_cleanup. The service now exposes
|
|
19
|
-
* `exportMtwEntities` (async job, returns MtwExportJob) but no import
|
|
20
|
-
* counterpart, so the old synchronous exportData/importData mutations are no
|
|
21
|
-
* longer resolvable. This hook keeps the same contract for consumers but
|
|
22
|
-
* rejects calls with a clear message until a replacement import/export flow is
|
|
23
|
-
* designed. The original operations are preserved in
|
|
24
|
-
* src/operations/wspace/movethewheels/mutations/marketplace-reports.withdrawn.graphql.
|
|
25
|
-
*/
|
|
26
|
-
export function useImportExport(): UseImportExportResult {
|
|
27
|
-
const [isBusy, setIsBusy] = useState(false);
|
|
28
|
-
const [error, setError] = useState<Error | null>(null);
|
|
29
|
-
|
|
30
|
-
const withBusy = useCallback(async <T>(fn: () => Promise<T>): Promise<T> => {
|
|
31
|
-
setIsBusy(true);
|
|
32
|
-
setError(null);
|
|
33
|
-
try {
|
|
34
|
-
return await fn();
|
|
35
|
-
} catch (err) {
|
|
36
|
-
const normalized = err instanceof Error ? err : new Error('Import/export failed');
|
|
37
|
-
setError(normalized);
|
|
38
|
-
throw normalized;
|
|
39
|
-
} finally {
|
|
40
|
-
setIsBusy(false);
|
|
41
|
-
}
|
|
42
|
-
}, []);
|
|
43
|
-
|
|
44
|
-
const exportData = useCallback(
|
|
45
|
-
async (resource: string, _format?: string): Promise<ImportExportResult> =>
|
|
46
|
-
withBusy(async () => {
|
|
47
|
-
throw new Error(
|
|
48
|
-
`Export for "${resource}" is not available: the import/export surface was withdrawn from the service.`
|
|
49
|
-
);
|
|
50
|
-
}),
|
|
51
|
-
[withBusy]
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
const importData = useCallback(
|
|
55
|
-
async (resource: string, _payload: Record<string, unknown>): Promise<ImportExportResult> =>
|
|
56
|
-
withBusy(async () => {
|
|
57
|
-
throw new Error(
|
|
58
|
-
`Import for "${resource}" is not available: the import surface was withdrawn from the service.`
|
|
59
|
-
);
|
|
60
|
-
}),
|
|
61
|
-
[withBusy]
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
return { exportData, importData, isBusy, error };
|
|
65
|
-
}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { useMoveTheWheels } from '../providers/MoveTheWheelsProvider';
|
|
3
|
-
|
|
4
|
-
export interface MovethewheelsReport {
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
description?: string | null;
|
|
8
|
-
type: string;
|
|
9
|
-
status: string;
|
|
10
|
-
schedule?: string | null;
|
|
11
|
-
lastGenerated?: string | null;
|
|
12
|
-
createdAt: string;
|
|
13
|
-
updatedAt: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface GeneratedReport {
|
|
17
|
-
generatedAt: string;
|
|
18
|
-
result?: Record<string, unknown> | null;
|
|
19
|
-
report: MovethewheelsReport;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface CreateReportInput {
|
|
23
|
-
name: string;
|
|
24
|
-
type: string;
|
|
25
|
-
description?: string;
|
|
26
|
-
schedule?: string;
|
|
27
|
-
status?: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
interface UseReportsOptions {
|
|
31
|
-
limit?: number;
|
|
32
|
-
offset?: number;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
interface UseReportsResult {
|
|
36
|
-
reports: MovethewheelsReport[];
|
|
37
|
-
/** True when the last fetch returned a full page (rawCount === limit). */
|
|
38
|
-
hasMore: boolean;
|
|
39
|
-
isLoading: boolean;
|
|
40
|
-
error: Error | null;
|
|
41
|
-
refetch: () => void;
|
|
42
|
-
createReport: (input: CreateReportInput) => Promise<MovethewheelsReport>;
|
|
43
|
-
generateReport: (
|
|
44
|
-
reportId: string,
|
|
45
|
-
parameters?: Record<string, unknown>
|
|
46
|
-
) => Promise<GeneratedReport>;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function newId(): string {
|
|
50
|
-
if (typeof crypto !== 'undefined' && 'randomUUID' in crypto) {
|
|
51
|
-
return crypto.randomUUID();
|
|
52
|
-
}
|
|
53
|
-
return `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function storageKey(workspaceId: string | undefined): string {
|
|
57
|
-
return `movethewheels:reports:${workspaceId ?? 'default'}`;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function readReports(workspaceId: string | undefined): MovethewheelsReport[] {
|
|
61
|
-
if (typeof window === 'undefined') return [];
|
|
62
|
-
try {
|
|
63
|
-
const raw = window.localStorage.getItem(storageKey(workspaceId));
|
|
64
|
-
if (!raw) return [];
|
|
65
|
-
const parsed = JSON.parse(raw) as MovethewheelsReport[];
|
|
66
|
-
return Array.isArray(parsed) ? parsed : [];
|
|
67
|
-
} catch {
|
|
68
|
-
return [];
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function writeReports(workspaceId: string | undefined, reports: MovethewheelsReport[]): void {
|
|
73
|
-
if (typeof window === 'undefined') return;
|
|
74
|
-
try {
|
|
75
|
-
window.localStorage.setItem(storageKey(workspaceId), JSON.stringify(reports));
|
|
76
|
-
} catch {
|
|
77
|
-
// Ignore storage errors.
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export function useReports(options: UseReportsOptions = {}): UseReportsResult {
|
|
82
|
-
const { limit = 100, offset = 0 } = options;
|
|
83
|
-
const { workspaceId } = useMoveTheWheels();
|
|
84
|
-
const [reports, setReports] = useState<MovethewheelsReport[]>([]);
|
|
85
|
-
const [hasMore, setHasMore] = useState(false);
|
|
86
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
87
|
-
const [error, setError] = useState<Error | null>(null);
|
|
88
|
-
|
|
89
|
-
const load = useCallback(() => {
|
|
90
|
-
setIsLoading(true);
|
|
91
|
-
setError(null);
|
|
92
|
-
try {
|
|
93
|
-
const all = readReports(workspaceId);
|
|
94
|
-
const page = all.slice(offset, offset + limit);
|
|
95
|
-
setHasMore(page.length === limit);
|
|
96
|
-
setReports(page);
|
|
97
|
-
} catch (loadError) {
|
|
98
|
-
setError(loadError instanceof Error ? loadError : new Error('Failed to load reports'));
|
|
99
|
-
} finally {
|
|
100
|
-
setIsLoading(false);
|
|
101
|
-
}
|
|
102
|
-
}, [workspaceId, limit, offset]);
|
|
103
|
-
|
|
104
|
-
useEffect(() => {
|
|
105
|
-
void load();
|
|
106
|
-
}, [load]);
|
|
107
|
-
|
|
108
|
-
const refetch = useCallback(() => {
|
|
109
|
-
void load();
|
|
110
|
-
}, [load]);
|
|
111
|
-
|
|
112
|
-
const createReport = useCallback(
|
|
113
|
-
async (input: CreateReportInput): Promise<MovethewheelsReport> => {
|
|
114
|
-
const now = new Date().toISOString();
|
|
115
|
-
const created: MovethewheelsReport = {
|
|
116
|
-
id: newId(),
|
|
117
|
-
name: input.name,
|
|
118
|
-
description: input.description ?? null,
|
|
119
|
-
type: input.type,
|
|
120
|
-
status: input.status ?? 'ready',
|
|
121
|
-
schedule: input.schedule ?? null,
|
|
122
|
-
lastGenerated: null,
|
|
123
|
-
createdAt: now,
|
|
124
|
-
updatedAt: now,
|
|
125
|
-
};
|
|
126
|
-
setReports((previous) => {
|
|
127
|
-
const next = [created, ...previous];
|
|
128
|
-
writeReports(workspaceId, next);
|
|
129
|
-
return next;
|
|
130
|
-
});
|
|
131
|
-
return created;
|
|
132
|
-
},
|
|
133
|
-
[workspaceId]
|
|
134
|
-
);
|
|
135
|
-
|
|
136
|
-
const generateReport = useCallback(
|
|
137
|
-
async (_reportId: string, _parameters?: Record<string, unknown>): Promise<GeneratedReport> => {
|
|
138
|
-
throw new Error(
|
|
139
|
-
'Report generation is not available: the movethewheelsReports surface was withdrawn from the service.'
|
|
140
|
-
);
|
|
141
|
-
},
|
|
142
|
-
[]
|
|
143
|
-
);
|
|
144
|
-
|
|
145
|
-
return {
|
|
146
|
-
reports,
|
|
147
|
-
hasMore,
|
|
148
|
-
isLoading,
|
|
149
|
-
error,
|
|
150
|
-
refetch,
|
|
151
|
-
createReport,
|
|
152
|
-
generateReport,
|
|
153
|
-
};
|
|
154
|
-
}
|