@burdenoff/microfe-export 2026.624.1 → 2026.625.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/export/pages/CreateExportPage.js +256 -249
- package/dist/export/pages/CreateExportPage.js.map +1 -1
- package/dist/export/pages/ExportDashboardPage.js +119 -74
- package/dist/export/pages/ExportDashboardPage.js.map +1 -1
- package/dist/export/pages/ExportDetailPage.js +214 -198
- package/dist/export/pages/ExportDetailPage.js.map +1 -1
- package/dist/export/pages/ExportHistoryPage.js +3 -3
- package/dist/export/pages/ExportHistoryPage.js.map +1 -1
- package/dist/export/pages/ExportTemplatesPage.js +178 -179
- package/dist/export/pages/ExportTemplatesPage.js.map +1 -1
- package/dist/export/pages/TemplateDetailPage.js +127 -116
- package/dist/export/pages/TemplateDetailPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -6,27 +6,28 @@ import { tWithFallback as ee } from "../utils/i18n.js";
|
|
|
6
6
|
import { PageLayout as te } from "../components/PageLayout.js";
|
|
7
7
|
import { isExportEntityDisabled as o } from "../utils/disabledModules.js";
|
|
8
8
|
import { useEffect as ne, useRef as s, useState as c } from "react";
|
|
9
|
-
import { ArrowLeft as l, ArrowRight as u, Building2 as d, CalendarRange as re, CheckCircle2 as f, Download as p, FileJson as m, FileSpreadsheet as h, Loader2 as g, Lock as
|
|
10
|
-
import { usePermission as
|
|
11
|
-
import { useSearchParams as
|
|
12
|
-
import { jsx as
|
|
13
|
-
import { useI18n as
|
|
9
|
+
import { ArrowLeft as l, ArrowRight as u, Building2 as d, CalendarRange as re, CheckCircle2 as f, Download as p, FileJson as m, FileSpreadsheet as h, Loader2 as g, Lock as ie, Package as ae, User as _, Users as v } from "lucide-react";
|
|
10
|
+
import { usePermission as y } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
11
|
+
import { useSearchParams as oe } from "react-router-dom";
|
|
12
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
13
|
+
import { useI18n as se } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
14
|
+
import { EmphasisPanel as S, ShowMore as C } from "@burdenoff/fe-libs/ui";
|
|
14
15
|
//#region src/export/pages/CreateExportPage.tsx
|
|
15
|
-
var
|
|
16
|
+
var w = ["CSV", "JSON"], ce = {
|
|
16
17
|
CSV: h,
|
|
17
18
|
JSON: m
|
|
18
|
-
},
|
|
19
|
+
}, le = [
|
|
19
20
|
{
|
|
20
21
|
value: "INDIVIDUAL",
|
|
21
22
|
label: "My Data Only",
|
|
22
23
|
description: "Export data you personally created across selected modules.",
|
|
23
|
-
Icon:
|
|
24
|
+
Icon: _
|
|
24
25
|
},
|
|
25
26
|
{
|
|
26
27
|
value: "WORKSPACE_ADMIN",
|
|
27
28
|
label: "All Workspace Data",
|
|
28
29
|
description: "Export all data in this workspace regardless of who created it. Requires workspace admin access.",
|
|
29
|
-
Icon:
|
|
30
|
+
Icon: v
|
|
30
31
|
},
|
|
31
32
|
{
|
|
32
33
|
value: "ORG_ADMIN",
|
|
@@ -36,35 +37,35 @@ var C = ["CSV", "JSON"], se = {
|
|
|
36
37
|
}
|
|
37
38
|
];
|
|
38
39
|
function T() {
|
|
39
|
-
let { basePath: d = "/", navigate: m, organizationId: h } = e(), { t:
|
|
40
|
+
let { basePath: d = "/", navigate: m, organizationId: h } = e(), { t: _ } = se(), v = (e, t, n) => ee(_, e, t, n), { createJob: T, isPending: E } = n(), { data: D } = t(), { data: O } = r(), [k] = oe(), ue = y("export:workspace:admin"), de = y("export:org:admin"), [A, j] = c("entities"), [M, N] = c([]), [P, F] = c(""), [I, L] = c("CSV"), [R, z] = c("INDIVIDUAL"), [B, V] = c(k.get("templateId") ?? void 0), [H, fe] = c(""), [U, pe] = c(""), [W, G] = c(null), K = s(null);
|
|
40
41
|
ne(() => {
|
|
41
|
-
let e =
|
|
42
|
-
if (!e || !
|
|
43
|
-
let t =
|
|
42
|
+
let e = k.get("templateId");
|
|
43
|
+
if (!e || !O?.length || K.current === e) return;
|
|
44
|
+
let t = O.find((t) => t.id === e);
|
|
44
45
|
if (!t) return;
|
|
45
|
-
|
|
46
|
+
K.current = e, V(t.id), N((t.entityTypes ?? []).filter((e) => !o(e)));
|
|
46
47
|
let n = t.format?.toUpperCase();
|
|
47
|
-
n &&
|
|
48
|
-
}, [
|
|
49
|
-
let
|
|
48
|
+
n && w.includes(n) && L(n), t.name && F(t.name);
|
|
49
|
+
}, [k, O]);
|
|
50
|
+
let q = () => {
|
|
50
51
|
A === "options" ? j("entities") : A === "review" ? j("options") : m?.(d);
|
|
51
|
-
},
|
|
52
|
+
}, me = () => {
|
|
52
53
|
if (A === "entities") {
|
|
53
54
|
if (M.length === 0) {
|
|
54
|
-
|
|
55
|
+
G(v("export.create.errors.selectEntity", "Please select at least one entity type to export"));
|
|
55
56
|
return;
|
|
56
57
|
}
|
|
57
|
-
|
|
58
|
+
G(null), j("options");
|
|
58
59
|
} else if (A === "options") {
|
|
59
60
|
if (!P.trim()) {
|
|
60
|
-
|
|
61
|
+
G(v("export.create.errors.exportNameRequired", "Please provide a name for this export"));
|
|
61
62
|
return;
|
|
62
63
|
}
|
|
63
|
-
|
|
64
|
+
G(null), j("review");
|
|
64
65
|
}
|
|
65
|
-
},
|
|
66
|
+
}, he = async () => {
|
|
66
67
|
try {
|
|
67
|
-
|
|
68
|
+
G(null), await T({
|
|
68
69
|
name: P,
|
|
69
70
|
entityTypes: M,
|
|
70
71
|
format: I,
|
|
@@ -72,181 +73,181 @@ function T() {
|
|
|
72
73
|
organizationId: R === "ORG_ADMIN" ? h : void 0,
|
|
73
74
|
templateId: B,
|
|
74
75
|
dateRangeStart: H ? new Date(H).toISOString() : null,
|
|
75
|
-
dateRangeEnd:
|
|
76
|
+
dateRangeEnd: U ? new Date(U).toISOString() : null
|
|
76
77
|
}), m?.(d);
|
|
77
78
|
} catch (e) {
|
|
78
|
-
|
|
79
|
+
G(e instanceof Error ? e.message : v("export.create.errors.createFailed", "Failed to create export"));
|
|
79
80
|
}
|
|
80
|
-
},
|
|
81
|
+
}, ge = (e) => {
|
|
81
82
|
o(e) || N((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
82
83
|
}, J = (e) => {
|
|
83
84
|
switch (e) {
|
|
84
|
-
case "INDIVIDUAL": return
|
|
85
|
-
case "WORKSPACE_ADMIN": return
|
|
86
|
-
case "ORG_ADMIN": return
|
|
85
|
+
case "INDIVIDUAL": return v("export.create.scope.individual.label", "My Data Only");
|
|
86
|
+
case "WORKSPACE_ADMIN": return v("export.create.scope.workspaceAdmin.label", "All Workspace Data");
|
|
87
|
+
case "ORG_ADMIN": return v("export.create.scope.orgAdmin.label", "All Organization Data");
|
|
87
88
|
default: return e;
|
|
88
89
|
}
|
|
89
|
-
},
|
|
90
|
+
}, _e = (e) => {
|
|
90
91
|
switch (e) {
|
|
91
|
-
case "INDIVIDUAL": return
|
|
92
|
-
case "WORKSPACE_ADMIN": return
|
|
93
|
-
case "ORG_ADMIN": return
|
|
92
|
+
case "INDIVIDUAL": return v("export.create.scope.individual.description", "Export data you personally created across selected modules.");
|
|
93
|
+
case "WORKSPACE_ADMIN": return v("export.create.scope.workspaceAdmin.description", "Export all data in this workspace regardless of who created it. Requires workspace admin access.");
|
|
94
|
+
case "ORG_ADMIN": return v("export.create.scope.orgAdmin.description", "Export data from every workspace in your organization. Requires org-admin access.");
|
|
94
95
|
default: return "";
|
|
95
96
|
}
|
|
96
97
|
}, Y = {
|
|
97
98
|
users: {
|
|
98
|
-
label:
|
|
99
|
-
description:
|
|
99
|
+
label: v("export.create.entities.users.label", "Users"),
|
|
100
|
+
description: v("export.create.entities.users.description", "Workspace members and profiles")
|
|
100
101
|
},
|
|
101
102
|
projects: {
|
|
102
|
-
label:
|
|
103
|
-
description:
|
|
103
|
+
label: v("export.create.entities.projects.label", "Projects"),
|
|
104
|
+
description: v("export.create.entities.projects.description", "Projects and their metadata")
|
|
104
105
|
},
|
|
105
106
|
tasks: {
|
|
106
|
-
label:
|
|
107
|
-
description:
|
|
107
|
+
label: v("export.create.entities.tasks.label", "Tasks"),
|
|
108
|
+
description: v("export.create.entities.tasks.description", "Task items and assignments")
|
|
108
109
|
},
|
|
109
110
|
files: {
|
|
110
|
-
label:
|
|
111
|
-
description:
|
|
111
|
+
label: v("export.create.entities.files.label", "Files"),
|
|
112
|
+
description: v("export.create.entities.files.description", "File metadata and references")
|
|
112
113
|
},
|
|
113
114
|
conversations: {
|
|
114
|
-
label:
|
|
115
|
-
description:
|
|
115
|
+
label: v("export.create.entities.conversations.label", "Conversations"),
|
|
116
|
+
description: v("export.create.entities.conversations.description", "Chat messages and threads")
|
|
116
117
|
},
|
|
117
118
|
tags: {
|
|
118
|
-
label:
|
|
119
|
-
description:
|
|
119
|
+
label: v("export.create.entities.tags.label", "Tags"),
|
|
120
|
+
description: v("export.create.entities.tags.description", "Tags and vocabularies")
|
|
120
121
|
},
|
|
121
122
|
activity: {
|
|
122
|
-
label:
|
|
123
|
-
description:
|
|
123
|
+
label: v("export.create.entities.activity.label", "Activity Logs"),
|
|
124
|
+
description: v("export.create.entities.activity.description", "Audit trail and activity history")
|
|
124
125
|
},
|
|
125
126
|
calendar: {
|
|
126
|
-
label:
|
|
127
|
-
description:
|
|
127
|
+
label: v("export.create.entities.calendar.label", "Calendar Events"),
|
|
128
|
+
description: v("export.create.entities.calendar.description", "Events and bookings")
|
|
128
129
|
}
|
|
129
|
-
}, X =
|
|
130
|
+
}, X = D.filter((e) => e.enabled !== !1), Z = X.filter((e) => !o(e.entityType)), Q = X.filter((e) => o(e.entityType)), $ = (e, t) => {
|
|
130
131
|
let n = !t && M.includes(e.entityType);
|
|
131
|
-
return /* @__PURE__ */
|
|
132
|
+
return /* @__PURE__ */ x("button", {
|
|
132
133
|
type: "button",
|
|
133
|
-
onClick: () =>
|
|
134
|
+
onClick: () => ge(e.entityType),
|
|
134
135
|
disabled: t,
|
|
135
136
|
"aria-disabled": t,
|
|
136
|
-
title: t ?
|
|
137
|
+
title: t ? v("export.create.select.unavailableHint", "Export for this product isn't available yet") : void 0,
|
|
137
138
|
className: i("text-left border-2 rounded-xl p-4 transition-all duration-200", t ? "border-border-subtle/30 opacity-50 cursor-not-allowed" : n ? "border-primary bg-action-primary-bg/5 shadow-md" : "border-border-subtle/50 hover:border-primary/30 hover:shadow-sm"),
|
|
138
139
|
children: [
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ x("div", {
|
|
140
141
|
className: "flex items-center justify-between mb-2 gap-2",
|
|
141
|
-
children: [/* @__PURE__ */
|
|
142
|
+
children: [/* @__PURE__ */ b("h3", {
|
|
142
143
|
className: "font-semibold",
|
|
143
144
|
children: Y[e.entityType]?.label ?? e.displayName
|
|
144
|
-
}), t ? /* @__PURE__ */
|
|
145
|
+
}), t ? /* @__PURE__ */ b("span", {
|
|
145
146
|
className: "shrink-0 text-xs font-medium px-2 py-0.5 rounded-full bg-bg-sunken text-text-secondary",
|
|
146
|
-
children:
|
|
147
|
-
}) : n && /* @__PURE__ */
|
|
147
|
+
children: v("export.create.select.unavailable", "Unavailable")
|
|
148
|
+
}) : n && /* @__PURE__ */ b(f, {
|
|
148
149
|
size: 18,
|
|
149
150
|
className: "text-primary"
|
|
150
151
|
})]
|
|
151
152
|
}),
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ b("p", {
|
|
153
154
|
className: "text-sm text-text-secondary",
|
|
154
155
|
children: Y[e.entityType]?.description ?? e.description
|
|
155
156
|
}),
|
|
156
|
-
e.estimatedSize && /* @__PURE__ */
|
|
157
|
+
e.estimatedSize && /* @__PURE__ */ x("p", {
|
|
157
158
|
className: "text-xs text-text-secondary mt-2",
|
|
158
159
|
children: ["~", e.estimatedSize]
|
|
159
160
|
})
|
|
160
161
|
]
|
|
161
162
|
}, e.entityType);
|
|
162
163
|
};
|
|
163
|
-
return /* @__PURE__ */
|
|
164
|
+
return /* @__PURE__ */ x(te, {
|
|
164
165
|
showHeader: !1,
|
|
165
166
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
className: "relative overflow-hidden rounded-xl bg-
|
|
168
|
-
children: /* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ b("div", {
|
|
168
|
+
className: "relative overflow-hidden rounded-xl bg-accent-wash border border-border-seam p-6 shadow-[var(--shadow-pop)]",
|
|
169
|
+
children: /* @__PURE__ */ x("div", {
|
|
169
170
|
className: "relative z-10 flex items-center gap-4",
|
|
170
|
-
children: [/* @__PURE__ */
|
|
171
|
+
children: [/* @__PURE__ */ b("button", {
|
|
171
172
|
type: "button",
|
|
172
173
|
onClick: () => m?.(d),
|
|
173
|
-
className: "p-2.5 hover:bg-accent rounded-lg transition-
|
|
174
|
-
"aria-label":
|
|
175
|
-
children: /* @__PURE__ */
|
|
176
|
-
}), /* @__PURE__ */
|
|
174
|
+
className: "p-2.5 hover:bg-accent rounded-lg transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",
|
|
175
|
+
"aria-label": v("export.create.actions.backToDashboard", "Back to export dashboard"),
|
|
176
|
+
children: /* @__PURE__ */ b(l, { size: 20 })
|
|
177
|
+
}), /* @__PURE__ */ x("div", {
|
|
177
178
|
className: "flex items-center gap-3",
|
|
178
|
-
children: [/* @__PURE__ */
|
|
179
|
+
children: [/* @__PURE__ */ b("div", {
|
|
179
180
|
className: "p-2.5 rounded-lg bg-action-primary-bg/10 backdrop-blur-sm",
|
|
180
|
-
children: /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ b(p, {
|
|
181
182
|
size: 24,
|
|
182
183
|
className: "text-primary"
|
|
183
184
|
})
|
|
184
|
-
}), /* @__PURE__ */
|
|
185
|
+
}), /* @__PURE__ */ b("h1", {
|
|
185
186
|
className: "text-2xl sm:text-3xl font-bold",
|
|
186
|
-
children:
|
|
187
|
+
children: v("export.create.title", "New Export")
|
|
187
188
|
})]
|
|
188
189
|
})]
|
|
189
190
|
})
|
|
190
191
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ b("div", {
|
|
192
193
|
className: "flex items-center gap-2 justify-center flex-wrap",
|
|
193
194
|
children: [
|
|
194
195
|
"entities",
|
|
195
196
|
"options",
|
|
196
197
|
"review"
|
|
197
|
-
].map((e, t) => /* @__PURE__ */
|
|
198
|
+
].map((e, t) => /* @__PURE__ */ x("div", {
|
|
198
199
|
className: "flex items-center gap-2",
|
|
199
|
-
children: [t > 0 && /* @__PURE__ */
|
|
200
|
+
children: [t > 0 && /* @__PURE__ */ b(u, {
|
|
200
201
|
size: 18,
|
|
201
202
|
className: "text-text-secondary"
|
|
202
|
-
}), /* @__PURE__ */
|
|
203
|
-
className: i("flex items-center gap-2 px-4 py-2.5 rounded-lg text-sm font-medium border-2 transition-all duration-200", A === e ? "bg-action-primary-bg text-action-primary-text border-primary shadow-
|
|
204
|
-
children: [/* @__PURE__ */
|
|
203
|
+
}), /* @__PURE__ */ x("div", {
|
|
204
|
+
className: i("flex items-center gap-2 px-4 py-2.5 rounded-lg text-sm font-medium border-2 transition-all duration-200", A === e ? "bg-action-primary-bg text-action-primary-text border-primary shadow-[var(--shadow-pop)]" : "bg-bg-sunken/50 text-text-secondary border-border-seam"),
|
|
205
|
+
children: [/* @__PURE__ */ b("div", {
|
|
205
206
|
className: "flex items-center justify-center size-6 rounded-full bg-bg-surface/20 font-bold",
|
|
206
207
|
children: t + 1
|
|
207
|
-
}), /* @__PURE__ */
|
|
208
|
+
}), /* @__PURE__ */ b("span", {
|
|
208
209
|
className: "hidden sm:inline capitalize",
|
|
209
|
-
children: e === "entities" ?
|
|
210
|
+
children: e === "entities" ? v("export.create.steps.entities", "Select Data") : e === "options" ? v("export.create.steps.options", "Options") : v("export.create.steps.review", "Review")
|
|
210
211
|
})]
|
|
211
212
|
})]
|
|
212
213
|
}, e))
|
|
213
214
|
}),
|
|
214
|
-
|
|
215
|
+
W && /* @__PURE__ */ b("div", {
|
|
215
216
|
className: "border-2 border-border-default rounded-xl bg-status-error-bg-subtle p-4 text-status-error-text text-sm",
|
|
216
|
-
children:
|
|
217
|
+
children: W
|
|
217
218
|
}),
|
|
218
|
-
A === "entities" && /* @__PURE__ */
|
|
219
|
+
A === "entities" && /* @__PURE__ */ x("div", {
|
|
219
220
|
className: "space-y-4",
|
|
220
221
|
children: [
|
|
221
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ b("h2", {
|
|
222
223
|
className: "text-lg font-bold",
|
|
223
|
-
children:
|
|
224
|
+
children: v("export.create.select.title", "Select data to export")
|
|
224
225
|
}),
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ b("p", {
|
|
226
227
|
className: "text-sm text-text-secondary",
|
|
227
|
-
children:
|
|
228
|
+
children: v("export.create.select.description", "Choose which entity types to include in your export.")
|
|
228
229
|
}),
|
|
229
|
-
X.length === 0 ? /* @__PURE__ */
|
|
230
|
+
X.length === 0 ? /* @__PURE__ */ b("div", {
|
|
230
231
|
className: "border-2 border-border-subtle rounded-xl bg-bg-sunken/30 p-6 text-sm text-text-secondary",
|
|
231
|
-
children:
|
|
232
|
-
}) : /* @__PURE__ */
|
|
232
|
+
children: v("export.create.select.empty", "No exportable entity types are configured for this workspace yet.")
|
|
233
|
+
}) : /* @__PURE__ */ x("div", {
|
|
233
234
|
className: "space-y-6",
|
|
234
|
-
children: [Z.length > 0 && /* @__PURE__ */
|
|
235
|
+
children: [Z.length > 0 && /* @__PURE__ */ b("div", {
|
|
235
236
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",
|
|
236
237
|
children: Z.map((e) => $(e, !1))
|
|
237
|
-
}), Q.length > 0 && /* @__PURE__ */
|
|
238
|
+
}), Q.length > 0 && /* @__PURE__ */ x("div", {
|
|
238
239
|
className: "space-y-3",
|
|
239
|
-
children: [/* @__PURE__ */
|
|
240
|
+
children: [/* @__PURE__ */ x("div", {
|
|
240
241
|
className: "flex items-center gap-3",
|
|
241
242
|
children: [
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ b("div", { className: "h-px flex-1 bg-border/60" }),
|
|
244
|
+
/* @__PURE__ */ b("span", {
|
|
244
245
|
className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
245
|
-
children:
|
|
246
|
+
children: v("export.create.select.unavailableSection", "Not available yet")
|
|
246
247
|
}),
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ b("div", { className: "h-px flex-1 bg-border/60" })
|
|
248
249
|
]
|
|
249
|
-
}), /* @__PURE__ */
|
|
250
|
+
}), /* @__PURE__ */ b("div", {
|
|
250
251
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",
|
|
251
252
|
children: Q.map((e) => $(e, !0))
|
|
252
253
|
})]
|
|
@@ -254,256 +255,262 @@ function T() {
|
|
|
254
255
|
})
|
|
255
256
|
]
|
|
256
257
|
}),
|
|
257
|
-
A === "options" && /* @__PURE__ */
|
|
258
|
+
A === "options" && /* @__PURE__ */ b("div", {
|
|
258
259
|
className: "space-y-6",
|
|
259
|
-
children: /* @__PURE__ */
|
|
260
|
-
className: "border
|
|
260
|
+
children: /* @__PURE__ */ x("div", {
|
|
261
|
+
className: "border border-border-seam rounded-xl p-6 space-y-5 bg-bg-surface",
|
|
261
262
|
children: [
|
|
262
|
-
/* @__PURE__ */
|
|
263
|
+
/* @__PURE__ */ b("h2", {
|
|
263
264
|
className: "text-lg font-bold",
|
|
264
|
-
children:
|
|
265
|
+
children: v("export.create.options.title", "Export Options")
|
|
265
266
|
}),
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
267
268
|
className: "block text-sm font-semibold mb-2",
|
|
268
|
-
children:
|
|
269
|
-
}), /* @__PURE__ */
|
|
269
|
+
children: v("export.create.options.scope", "Export Scope")
|
|
270
|
+
}), /* @__PURE__ */ b("div", {
|
|
270
271
|
className: "grid grid-cols-1 sm:grid-cols-3 gap-3",
|
|
271
|
-
children:
|
|
272
|
-
let n = e === "WORKSPACE_ADMIN" && !
|
|
273
|
-
return /* @__PURE__ */
|
|
272
|
+
children: le.map(({ value: e, Icon: t }) => {
|
|
273
|
+
let n = e === "WORKSPACE_ADMIN" && !ue || e === "ORG_ADMIN" && !de;
|
|
274
|
+
return /* @__PURE__ */ x("button", {
|
|
274
275
|
type: "button",
|
|
275
276
|
onClick: () => !n && z(e),
|
|
276
277
|
disabled: n,
|
|
277
278
|
className: i("text-left border-2 rounded-xl p-4 transition-all duration-200", R === e ? "border-primary bg-action-primary-bg/5 shadow-md" : n ? "border-border-subtle/30 opacity-50 cursor-not-allowed" : "border-border-subtle/50 hover:border-primary/30 hover:shadow-sm"),
|
|
278
279
|
title: n ? e === "WORKSPACE_ADMIN" ? "Workspace admin access required" : "Organization admin access required" : void 0,
|
|
279
280
|
children: [
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ x("div", {
|
|
281
282
|
className: "flex items-center justify-between mb-2",
|
|
282
283
|
children: [
|
|
283
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ b(t, {
|
|
284
285
|
size: 18,
|
|
285
286
|
className: R === e ? "text-primary" : n ? "text-text-secondary/50" : "text-text-secondary"
|
|
286
287
|
}),
|
|
287
|
-
R === e && /* @__PURE__ */
|
|
288
|
+
R === e && /* @__PURE__ */ b(f, {
|
|
288
289
|
size: 16,
|
|
289
290
|
className: "text-primary"
|
|
290
291
|
}),
|
|
291
|
-
n && /* @__PURE__ */
|
|
292
|
+
n && /* @__PURE__ */ b(ie, {
|
|
292
293
|
size: 14,
|
|
293
294
|
className: "text-text-secondary/50"
|
|
294
295
|
})
|
|
295
296
|
]
|
|
296
297
|
}),
|
|
297
|
-
/* @__PURE__ */
|
|
298
|
+
/* @__PURE__ */ b("p", {
|
|
298
299
|
className: "font-semibold text-sm",
|
|
299
300
|
children: J(e)
|
|
300
301
|
}),
|
|
301
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ b("p", {
|
|
302
303
|
className: "text-xs text-text-secondary mt-1",
|
|
303
|
-
children:
|
|
304
|
+
children: _e(e)
|
|
304
305
|
})
|
|
305
306
|
]
|
|
306
307
|
}, e);
|
|
307
308
|
})
|
|
308
309
|
})] }),
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("label", {
|
|
310
311
|
htmlFor: "exportName",
|
|
311
312
|
className: "block text-sm font-semibold mb-2",
|
|
312
313
|
children: [
|
|
313
|
-
|
|
314
|
+
v("export.create.options.name", "Export Name"),
|
|
314
315
|
" ",
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ b("span", {
|
|
316
317
|
className: "text-status-error-text",
|
|
317
318
|
children: "*"
|
|
318
319
|
})
|
|
319
320
|
]
|
|
320
|
-
}), /* @__PURE__ */
|
|
321
|
+
}), /* @__PURE__ */ b("input", {
|
|
321
322
|
type: "text",
|
|
322
323
|
id: "exportName",
|
|
323
|
-
"aria-label":
|
|
324
|
+
"aria-label": v("export.create.options.name", "Export Name"),
|
|
324
325
|
value: P,
|
|
325
326
|
onChange: (e) => F(e.target.value),
|
|
326
327
|
className: "w-full px-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all duration-200",
|
|
327
|
-
placeholder:
|
|
328
|
+
placeholder: v("export.create.options.namePlaceholder", "e.g., Monthly User Export")
|
|
328
329
|
})] }),
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
330
331
|
className: "block text-sm font-semibold mb-2",
|
|
331
|
-
children:
|
|
332
|
-
}), /* @__PURE__ */
|
|
332
|
+
children: v("export.create.options.outputFormat", "Output Format")
|
|
333
|
+
}), /* @__PURE__ */ b("div", {
|
|
333
334
|
className: "grid grid-cols-2 gap-3",
|
|
334
|
-
children:
|
|
335
|
-
let t =
|
|
336
|
-
return /* @__PURE__ */
|
|
335
|
+
children: w.map((e) => {
|
|
336
|
+
let t = ce[e];
|
|
337
|
+
return /* @__PURE__ */ x("button", {
|
|
337
338
|
type: "button",
|
|
338
339
|
onClick: () => L(e),
|
|
339
340
|
className: i("flex items-center gap-3 border-2 rounded-lg p-3 transition-all duration-200", I === e ? "border-primary bg-action-primary-bg/5" : "border-border-subtle/50 hover:border-primary/30"),
|
|
340
|
-
children: [/* @__PURE__ */
|
|
341
|
+
children: [/* @__PURE__ */ b(t, {
|
|
341
342
|
size: 18,
|
|
342
343
|
className: I === e ? "text-primary" : "text-text-secondary"
|
|
343
|
-
}), /* @__PURE__ */
|
|
344
|
+
}), /* @__PURE__ */ b("span", {
|
|
344
345
|
className: "font-medium text-sm",
|
|
345
346
|
children: a(e)
|
|
346
347
|
})]
|
|
347
348
|
}, e);
|
|
348
349
|
})
|
|
349
350
|
})] }),
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ x("div", { children: [
|
|
352
|
+
/* @__PURE__ */ b("label", {
|
|
352
353
|
className: "block text-sm font-semibold mb-2",
|
|
353
|
-
children:
|
|
354
|
+
children: v("export.create.options.archiveFormat", "Archive Format")
|
|
354
355
|
}),
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ b("div", {
|
|
356
357
|
className: "flex gap-3",
|
|
357
|
-
children: /* @__PURE__ */
|
|
358
|
+
children: /* @__PURE__ */ x("div", {
|
|
358
359
|
className: i("flex items-center gap-2 border-2 rounded-lg px-4 py-2 border-primary bg-action-primary-bg/5"),
|
|
359
|
-
children: [/* @__PURE__ */
|
|
360
|
+
children: [/* @__PURE__ */ b(ae, {
|
|
360
361
|
size: 16,
|
|
361
362
|
className: "text-primary"
|
|
362
|
-
}), /* @__PURE__ */
|
|
363
|
+
}), /* @__PURE__ */ b("span", {
|
|
363
364
|
className: "font-medium text-sm",
|
|
364
365
|
children: "ZIP"
|
|
365
366
|
})]
|
|
366
367
|
})
|
|
367
368
|
}),
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ b("p", {
|
|
369
370
|
className: "text-xs text-text-secondary mt-1.5",
|
|
370
|
-
children:
|
|
371
|
+
children: v("export.create.options.archiveDescription", "Exports are packaged as ZIP archives.")
|
|
371
372
|
})
|
|
372
373
|
] }),
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
374
|
+
/* @__PURE__ */ b(C, {
|
|
375
|
+
collapsedHeight: 0,
|
|
376
|
+
label: v("export.create.options.advancedToggle", "Date range & template"),
|
|
377
|
+
children: /* @__PURE__ */ x("div", {
|
|
378
|
+
className: "space-y-5 pt-1",
|
|
379
|
+
children: [/* @__PURE__ */ x("div", { children: [
|
|
380
|
+
/* @__PURE__ */ b("label", {
|
|
381
|
+
className: "block text-sm font-semibold mb-2",
|
|
382
|
+
children: /* @__PURE__ */ x("span", {
|
|
383
|
+
className: "inline-flex items-center gap-1.5",
|
|
384
|
+
children: [
|
|
385
|
+
/* @__PURE__ */ b(re, { size: 15 }),
|
|
386
|
+
v("export.create.options.dateRange", "Date Range"),
|
|
387
|
+
" ",
|
|
388
|
+
/* @__PURE__ */ b("span", {
|
|
389
|
+
className: "font-normal text-text-secondary",
|
|
390
|
+
children: v("export.create.shared.optional", "(optional)")
|
|
391
|
+
})
|
|
392
|
+
]
|
|
393
|
+
})
|
|
394
|
+
}),
|
|
395
|
+
/* @__PURE__ */ x("div", {
|
|
396
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-3",
|
|
397
|
+
children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
398
|
+
htmlFor: "dateFrom",
|
|
399
|
+
className: "block text-xs text-text-secondary mb-1",
|
|
400
|
+
children: v("export.create.options.dateFrom", "From")
|
|
401
|
+
}), /* @__PURE__ */ b("input", {
|
|
402
|
+
type: "date",
|
|
403
|
+
id: "dateFrom",
|
|
404
|
+
"aria-label": v("export.create.options.dateFrom", "From"),
|
|
405
|
+
value: H,
|
|
406
|
+
onChange: (e) => fe(e.target.value),
|
|
407
|
+
className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary text-sm"
|
|
408
|
+
})] }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
409
|
+
htmlFor: "dateTo",
|
|
410
|
+
className: "block text-xs text-text-secondary mb-1",
|
|
411
|
+
children: v("export.create.options.dateTo", "To")
|
|
412
|
+
}), /* @__PURE__ */ b("input", {
|
|
413
|
+
type: "date",
|
|
414
|
+
id: "dateTo",
|
|
415
|
+
"aria-label": v("export.create.options.dateTo", "To"),
|
|
416
|
+
value: U,
|
|
417
|
+
min: H,
|
|
418
|
+
onChange: (e) => pe(e.target.value),
|
|
419
|
+
className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary text-sm"
|
|
420
|
+
})] })]
|
|
421
|
+
}),
|
|
422
|
+
/* @__PURE__ */ b("p", {
|
|
423
|
+
className: "text-xs text-text-secondary mt-1.5",
|
|
424
|
+
children: v("export.create.options.dateRangeDescription", "Leave blank to export all data regardless of date.")
|
|
425
|
+
})
|
|
426
|
+
] }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("label", {
|
|
427
|
+
className: "block text-sm font-semibold mb-2",
|
|
378
428
|
children: [
|
|
379
|
-
|
|
380
|
-
y("export.create.options.dateRange", "Date Range"),
|
|
429
|
+
v("export.create.options.basedOnTemplate", "Based on Template"),
|
|
381
430
|
" ",
|
|
382
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ b("span", {
|
|
383
432
|
className: "font-normal text-text-secondary",
|
|
384
|
-
children:
|
|
433
|
+
children: v("export.create.shared.optional", "(optional)")
|
|
385
434
|
})
|
|
386
435
|
]
|
|
387
|
-
})
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
id
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
onChange: (e) => ue(e.target.value),
|
|
413
|
-
className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary text-sm"
|
|
436
|
+
}), O.length > 0 ? /* @__PURE__ */ x("select", {
|
|
437
|
+
value: B ?? "",
|
|
438
|
+
onChange: (e) => V(e.target.value || void 0),
|
|
439
|
+
className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
|
|
440
|
+
children: [/* @__PURE__ */ b("option", {
|
|
441
|
+
value: "",
|
|
442
|
+
children: v("export.create.options.noTemplate", "No template")
|
|
443
|
+
}), O.map((e) => /* @__PURE__ */ b("option", {
|
|
444
|
+
value: e.id,
|
|
445
|
+
children: e.name
|
|
446
|
+
}, e.id))]
|
|
447
|
+
}) : /* @__PURE__ */ x("p", {
|
|
448
|
+
className: "text-sm text-text-secondary",
|
|
449
|
+
children: [
|
|
450
|
+
v("export.create.options.noTemplates", "No templates yet."),
|
|
451
|
+
" ",
|
|
452
|
+
/* @__PURE__ */ b("button", {
|
|
453
|
+
type: "button",
|
|
454
|
+
onClick: () => m?.(d + "/templates"),
|
|
455
|
+
className: "text-primary underline-offset-2 hover:underline",
|
|
456
|
+
children: v("export.create.options.createTemplateLink", "Create one")
|
|
457
|
+
}),
|
|
458
|
+
" ",
|
|
459
|
+
v("export.create.options.reuseTemplateHint", "to reuse export configurations.")
|
|
460
|
+
]
|
|
414
461
|
})] })]
|
|
415
|
-
}),
|
|
416
|
-
/* @__PURE__ */ x("p", {
|
|
417
|
-
className: "text-xs text-text-secondary mt-1.5",
|
|
418
|
-
children: y("export.create.options.dateRangeDescription", "Leave blank to export all data regardless of date.")
|
|
419
462
|
})
|
|
420
|
-
|
|
421
|
-
/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("label", {
|
|
422
|
-
className: "block text-sm font-semibold mb-2",
|
|
423
|
-
children: [
|
|
424
|
-
y("export.create.options.basedOnTemplate", "Based on Template"),
|
|
425
|
-
" ",
|
|
426
|
-
/* @__PURE__ */ x("span", {
|
|
427
|
-
className: "font-normal text-text-secondary",
|
|
428
|
-
children: y("export.create.shared.optional", "(optional)")
|
|
429
|
-
})
|
|
430
|
-
]
|
|
431
|
-
}), D.length > 0 ? /* @__PURE__ */ S("select", {
|
|
432
|
-
value: B ?? "",
|
|
433
|
-
onChange: (e) => V(e.target.value || void 0),
|
|
434
|
-
className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
|
|
435
|
-
children: [/* @__PURE__ */ x("option", {
|
|
436
|
-
value: "",
|
|
437
|
-
children: y("export.create.options.noTemplate", "No template")
|
|
438
|
-
}), D.map((e) => /* @__PURE__ */ x("option", {
|
|
439
|
-
value: e.id,
|
|
440
|
-
children: e.name
|
|
441
|
-
}, e.id))]
|
|
442
|
-
}) : /* @__PURE__ */ S("p", {
|
|
443
|
-
className: "text-sm text-text-secondary",
|
|
444
|
-
children: [
|
|
445
|
-
y("export.create.options.noTemplates", "No templates yet."),
|
|
446
|
-
" ",
|
|
447
|
-
/* @__PURE__ */ x("button", {
|
|
448
|
-
type: "button",
|
|
449
|
-
onClick: () => m?.(d + "/templates"),
|
|
450
|
-
className: "text-primary underline-offset-2 hover:underline",
|
|
451
|
-
children: y("export.create.options.createTemplateLink", "Create one")
|
|
452
|
-
}),
|
|
453
|
-
" ",
|
|
454
|
-
y("export.create.options.reuseTemplateHint", "to reuse export configurations.")
|
|
455
|
-
]
|
|
456
|
-
})] })
|
|
463
|
+
})
|
|
457
464
|
]
|
|
458
465
|
})
|
|
459
466
|
}),
|
|
460
|
-
A === "review" && /* @__PURE__ */
|
|
467
|
+
A === "review" && /* @__PURE__ */ b("div", {
|
|
461
468
|
className: "space-y-6",
|
|
462
|
-
children: /* @__PURE__ */ S
|
|
463
|
-
className: "
|
|
464
|
-
children: [/* @__PURE__ */
|
|
469
|
+
children: /* @__PURE__ */ x(S, {
|
|
470
|
+
className: "p-6 space-y-4",
|
|
471
|
+
children: [/* @__PURE__ */ x("h2", {
|
|
465
472
|
className: "text-lg font-bold flex items-center gap-2",
|
|
466
|
-
children: [/* @__PURE__ */
|
|
473
|
+
children: [/* @__PURE__ */ b(f, {
|
|
467
474
|
size: 20,
|
|
468
475
|
className: "text-primary"
|
|
469
|
-
}),
|
|
470
|
-
}), /* @__PURE__ */
|
|
476
|
+
}), v("export.create.review.title", "Review Export")]
|
|
477
|
+
}), /* @__PURE__ */ b("dl", {
|
|
471
478
|
className: "space-y-3 text-sm",
|
|
472
479
|
children: [
|
|
473
480
|
{
|
|
474
|
-
label:
|
|
481
|
+
label: v("export.create.review.fields.name", "Name"),
|
|
475
482
|
value: P
|
|
476
483
|
},
|
|
477
484
|
{
|
|
478
|
-
label:
|
|
485
|
+
label: v("export.create.review.fields.scope", "Scope"),
|
|
479
486
|
value: J(R)
|
|
480
487
|
},
|
|
481
488
|
{
|
|
482
|
-
label:
|
|
489
|
+
label: v("export.create.review.fields.entityTypes", "Entity Types"),
|
|
483
490
|
value: M.join(", ")
|
|
484
491
|
},
|
|
485
492
|
{
|
|
486
|
-
label:
|
|
493
|
+
label: v("export.create.review.fields.format", "Format"),
|
|
487
494
|
value: a(I)
|
|
488
495
|
},
|
|
489
496
|
{
|
|
490
|
-
label:
|
|
497
|
+
label: v("export.create.review.fields.archive", "Archive"),
|
|
491
498
|
value: "ZIP"
|
|
492
499
|
},
|
|
493
|
-
...H ||
|
|
494
|
-
label:
|
|
495
|
-
value: [H || "—",
|
|
500
|
+
...H || U ? [{
|
|
501
|
+
label: v("export.create.review.fields.dateRange", "Date Range"),
|
|
502
|
+
value: [H || "—", U || "—"].join(" → ")
|
|
496
503
|
}] : [],
|
|
497
504
|
...B ? [{
|
|
498
|
-
label:
|
|
499
|
-
value:
|
|
505
|
+
label: v("export.create.review.fields.template", "Template"),
|
|
506
|
+
value: O.find((e) => e.id === B)?.name ?? B
|
|
500
507
|
}] : []
|
|
501
|
-
].map(({ label: e, value: t }) => /* @__PURE__ */
|
|
508
|
+
].map(({ label: e, value: t }) => /* @__PURE__ */ x("div", {
|
|
502
509
|
className: "flex flex-col sm:flex-row sm:justify-between gap-1",
|
|
503
|
-
children: [/* @__PURE__ */
|
|
510
|
+
children: [/* @__PURE__ */ b("dt", {
|
|
504
511
|
className: "text-text-secondary",
|
|
505
512
|
children: e
|
|
506
|
-
}), /* @__PURE__ */
|
|
513
|
+
}), /* @__PURE__ */ b("dd", {
|
|
507
514
|
className: "font-semibold sm:text-right break-words",
|
|
508
515
|
children: t
|
|
509
516
|
})]
|
|
@@ -511,27 +518,27 @@ function T() {
|
|
|
511
518
|
})]
|
|
512
519
|
})
|
|
513
520
|
}),
|
|
514
|
-
/* @__PURE__ */
|
|
521
|
+
/* @__PURE__ */ x("div", {
|
|
515
522
|
className: "flex flex-col sm:flex-row gap-3 pt-2",
|
|
516
|
-
children: [/* @__PURE__ */
|
|
523
|
+
children: [/* @__PURE__ */ b("button", {
|
|
517
524
|
type: "button",
|
|
518
|
-
onClick:
|
|
525
|
+
onClick: q,
|
|
519
526
|
className: "px-6 py-3 border-2 border-border-subtle/50 rounded-lg hover:bg-accent hover:border-primary/30 transition-all duration-200 font-medium",
|
|
520
|
-
children: A === "entities" ?
|
|
521
|
-
}), A === "review" ? /* @__PURE__ */
|
|
527
|
+
children: A === "entities" ? v("export.create.actions.cancel", "Cancel") : v("export.create.actions.back", "Back")
|
|
528
|
+
}), A === "review" ? /* @__PURE__ */ x("button", {
|
|
522
529
|
type: "button",
|
|
523
|
-
onClick:
|
|
530
|
+
onClick: he,
|
|
524
531
|
disabled: E,
|
|
525
532
|
className: "flex-1 inline-flex items-center justify-center gap-2 px-6 py-3 bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-all duration-200 font-bold shadow-lg disabled:opacity-50 disabled:cursor-not-allowed",
|
|
526
|
-
children: [E ? /* @__PURE__ */
|
|
533
|
+
children: [E ? /* @__PURE__ */ b(g, {
|
|
527
534
|
size: 18,
|
|
528
535
|
className: "animate-spin"
|
|
529
|
-
}) : /* @__PURE__ */
|
|
530
|
-
}) : /* @__PURE__ */
|
|
536
|
+
}) : /* @__PURE__ */ b(p, { size: 18 }), v("export.create.actions.startExport", "Start Export")]
|
|
537
|
+
}) : /* @__PURE__ */ x("button", {
|
|
531
538
|
type: "button",
|
|
532
|
-
onClick:
|
|
539
|
+
onClick: me,
|
|
533
540
|
className: "flex-1 inline-flex items-center justify-center gap-2 px-6 py-3 bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-all duration-200 font-bold shadow-lg",
|
|
534
|
-
children: [
|
|
541
|
+
children: [v("export.create.actions.next", "Next"), /* @__PURE__ */ b(u, { size: 18 })]
|
|
535
542
|
})]
|
|
536
543
|
})
|
|
537
544
|
]
|