@burdenoff/microfe-export 2026.1107.1 → 2026.1108.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/dev/main.d.ts +0 -2
- package/dist/export/ExportRoot.d.ts +0 -2
- package/dist/export/ExportRoot.js +9 -6
- package/dist/export/ExportRoot.js.map +1 -1
- package/dist/export/ExportRoutes.d.ts +1 -2
- package/dist/export/ExportRoutes.js +1 -2
- package/dist/export/ExportRoutes.js.map +1 -1
- package/dist/export/components/ExportProgressBar.d.ts +1 -2
- package/dist/export/components/ExportProgressBar.js +1 -2
- package/dist/export/components/ExportProgressBar.js.map +1 -1
- package/dist/export/components/ExportStatusBadge.d.ts +1 -3
- package/dist/export/components/ExportStatusBadge.js +7 -8
- package/dist/export/components/ExportStatusBadge.js.map +1 -1
- package/dist/export/components/PageLayout.d.ts +3 -5
- package/dist/export/components/PageLayout.js +1 -2
- package/dist/export/components/PageLayout.js.map +1 -1
- package/dist/export/constants/enums.d.ts +0 -2
- package/dist/export/constants/enums.js +1 -2
- package/dist/export/constants/enums.js.map +1 -1
- package/dist/export/constants/index.d.ts +0 -1
- package/dist/export/hooks/useExportQueries.d.ts +16 -33
- package/dist/export/hooks/useExportQueries.js +223 -225
- package/dist/export/hooks/useExportQueries.js.map +1 -1
- package/dist/export/hooks/useTr.d.ts +0 -2
- package/dist/export/hooks/useTr.js +1 -2
- package/dist/export/hooks/useTr.js.map +1 -1
- package/dist/export/index.d.ts +0 -1
- package/dist/export/index.js +5 -4
- package/dist/export/pages/CreateExportPage.d.ts +1 -2
- package/dist/export/pages/CreateExportPage.js +228 -229
- package/dist/export/pages/CreateExportPage.js.map +1 -1
- package/dist/export/pages/ExportDashboardPage.d.ts +1 -2
- package/dist/export/pages/ExportDashboardPage.js +17 -18
- package/dist/export/pages/ExportDashboardPage.js.map +1 -1
- package/dist/export/pages/ExportDetailPage.d.ts +1 -2
- package/dist/export/pages/ExportDetailPage.js +39 -40
- package/dist/export/pages/ExportDetailPage.js.map +1 -1
- package/dist/export/pages/ExportHistoryPage.d.ts +1 -2
- package/dist/export/pages/ExportHistoryPage.js +21 -20
- package/dist/export/pages/ExportHistoryPage.js.map +1 -1
- package/dist/export/pages/ExportLandingPage.d.ts +1 -2
- package/dist/export/pages/ExportLandingPage.js +1 -2
- package/dist/export/pages/ExportLandingPage.js.map +1 -1
- package/dist/export/pages/ExportTemplatesPage.d.ts +1 -2
- package/dist/export/pages/ExportTemplatesPage.js +25 -30
- package/dist/export/pages/ExportTemplatesPage.js.map +1 -1
- package/dist/export/pages/TemplateDetailPage.d.ts +1 -2
- package/dist/export/pages/TemplateDetailPage.js +11 -12
- package/dist/export/pages/TemplateDetailPage.js.map +1 -1
- package/dist/export/providers/ExportProvider.d.ts +0 -2
- package/dist/export/providers/ExportProvider.js +12 -16
- package/dist/export/providers/ExportProvider.js.map +1 -1
- package/dist/export/store/exportStore.d.ts +0 -2
- package/dist/export/store/exportStore.js +1 -2
- package/dist/export/store/exportStore.js.map +1 -1
- package/dist/export/types/index.d.ts +0 -1
- package/dist/export/utils/cn.d.ts +0 -2
- package/dist/export/utils/cn.js +2 -3
- package/dist/export/utils/cn.js.map +1 -1
- package/dist/export/utils/disabledModules.d.ts +0 -1
- package/dist/export/utils/disabledModules.js +3 -4
- package/dist/export/utils/disabledModules.js.map +1 -1
- package/dist/export/utils/events.d.ts +0 -2
- package/dist/export/utils/events.js +1 -2
- package/dist/export/utils/events.js.map +1 -1
- package/dist/export/utils/exportAuthority.d.ts +1 -6
- package/dist/export/utils/exportAuthority.js +5 -30
- package/dist/export/utils/exportAuthority.js.map +1 -1
- package/dist/export/utils/i18n.d.ts +0 -2
- package/dist/export/utils/i18n.js +1 -2
- package/dist/export/utils/i18n.js.map +1 -1
- package/dist/generated/global-operations.d.ts +4 -2
- package/dist/generated/global-types.d.ts +2 -22
- package/dist/generated/wspace-operations.d.ts +226 -181
- package/dist/generated/wspace-operations.js +1 -2
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +4 -24
- package/dist/generated/wspace-types.js +1 -2
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +1 -2
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +1 -1
- package/dist/node_modules/@apollo/client/errors/utils.js +1 -2
- package/dist/node_modules/@apollo/client/errors/utils.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +7 -8
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js +15 -16
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js +5 -6
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -1
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js +4 -5
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +2 -3
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js +2 -3
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +1 -1
- package/dist/node_modules/@apollo/client/version.js +2 -3
- package/dist/node_modules/@apollo/client/version.js.map +1 -1
- package/dist/node_modules/@wry/caches/lib/weak.js +1 -2
- package/dist/node_modules/@wry/caches/lib/weak.js.map +1 -1
- package/dist/node_modules/@wry/trie/lib/index.js +2 -3
- package/dist/node_modules/@wry/trie/lib/index.js.map +1 -1
- package/dist/node_modules/clsx/dist/clsx.js +8 -7
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/graphql-ws/dist/client.js +76 -69
- package/dist/node_modules/graphql-ws/dist/client.js.map +1 -1
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +2 -3
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +2 -3
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +41 -42
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +14 -15
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +21 -18
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +2 -3
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +229 -167
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/node_modules/{rxjs/node_modules/tslib → tslib}/tslib.es6.js +1 -2
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/test/happydom.d.ts +1 -0
- package/dist/translations/en.d.ts +0 -1
- package/dist/translations/en.js +1 -2
- package/dist/translations/en.js.map +1 -1
- package/dist/utils/nativeBridge.d.ts +0 -1
- package/dist/utils/nativeBridge.js +1 -2
- package/package.json +62 -46
- package/dist/dev/main.d.ts.map +0 -1
- package/dist/export/ExportRoot.d.ts.map +0 -1
- package/dist/export/ExportRoutes.d.ts.map +0 -1
- package/dist/export/components/ExportProgressBar.d.ts.map +0 -1
- package/dist/export/components/ExportStatusBadge.d.ts.map +0 -1
- package/dist/export/components/PageLayout.d.ts.map +0 -1
- package/dist/export/constants/enums.d.ts.map +0 -1
- package/dist/export/constants/index.d.ts.map +0 -1
- package/dist/export/hooks/useExportQueries.d.ts.map +0 -1
- package/dist/export/hooks/useTr.d.ts.map +0 -1
- package/dist/export/index.d.ts.map +0 -1
- package/dist/export/pages/CreateExportPage.d.ts.map +0 -1
- package/dist/export/pages/ExportDashboardPage.d.ts.map +0 -1
- package/dist/export/pages/ExportDetailPage.d.ts.map +0 -1
- package/dist/export/pages/ExportHistoryPage.d.ts.map +0 -1
- package/dist/export/pages/ExportLandingPage.d.ts.map +0 -1
- package/dist/export/pages/ExportTemplatesPage.d.ts.map +0 -1
- package/dist/export/pages/TemplateDetailPage.d.ts.map +0 -1
- package/dist/export/providers/ExportProvider.d.ts.map +0 -1
- package/dist/export/store/exportStore.d.ts.map +0 -1
- package/dist/export/types/index.d.ts.map +0 -1
- package/dist/export/utils/cn.d.ts.map +0 -1
- package/dist/export/utils/disabledModules.d.ts.map +0 -1
- package/dist/export/utils/events.d.ts.map +0 -1
- package/dist/export/utils/exportAuthority.d.ts.map +0 -1
- package/dist/export/utils/i18n.d.ts.map +0 -1
- package/dist/generated/global-operations.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/node_modules/rxjs/node_modules/tslib/tslib.es6.js.map +0 -1
- package/dist/translations/en.d.ts.map +0 -1
- package/dist/utils/nativeBridge.d.ts.map +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { exportArchiveDownload as e } from "../utils/exportAuthority.js";
|
|
2
2
|
import { useExport as t } from "../providers/ExportProvider.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { nativeImpact as
|
|
11
|
-
import { useState as
|
|
12
|
-
import { AlertCircle as
|
|
3
|
+
import { useCancelExportJob as n, useDeleteExportJob as r, useExportJob as ee, useExportJobProgress as i, useRetryExportJob as a } from "../hooks/useExportQueries.js";
|
|
4
|
+
import { ExportStatusBadge as o } from "../components/ExportStatusBadge.js";
|
|
5
|
+
import { ExportProgressBar as s } from "../components/ExportProgressBar.js";
|
|
6
|
+
import { PageLayout as c, PageSection as te } from "../components/PageLayout.js";
|
|
7
|
+
import { getArchiveFormatDisplayName as ne, getFormatDisplayName as l } from "../constants/enums.js";
|
|
8
|
+
import { useTr as u } from "../hooks/useTr.js";
|
|
9
|
+
import { cn as d } from "../utils/cn.js";
|
|
10
|
+
import { nativeImpact as f, nativeNotify as p } from "../../utils/nativeBridge.js";
|
|
11
|
+
import { useState as m } from "react";
|
|
12
|
+
import { AlertCircle as h, ArrowLeft as g, CheckCircle2 as re, Clock as _, Download as v, FileDown as y, FileText as ie, HardDrive as ae, Loader2 as b, RotateCcw as x, Trash2 as oe, XCircle as se } from "lucide-react";
|
|
13
13
|
import { useNavigate as ce, useParams as le } from "react-router";
|
|
14
14
|
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
15
15
|
import { CTAOverflowMenu as w, GlassCard as T, IllustratedEmptyState as E, NextSteps as D } from "@burdenoff/fe-libs/ui";
|
|
16
|
-
|
|
16
|
+
// src/export/pages/ExportDetailPage.tsx
|
|
17
17
|
function O(e) {
|
|
18
18
|
if (e === 0) return "0 B";
|
|
19
19
|
let t = 1024, n = [
|
|
@@ -23,22 +23,22 @@ function O(e) {
|
|
|
23
23
|
"GB",
|
|
24
24
|
"TB"
|
|
25
25
|
], r = Math.floor(Math.log(e) / Math.log(t));
|
|
26
|
-
return `${parseFloat((e / t **
|
|
26
|
+
return `${parseFloat((e / t ** r).toFixed(2))} ${n[r]}`;
|
|
27
27
|
}
|
|
28
28
|
var k = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
|
|
29
29
|
function A() {
|
|
30
|
-
let { jobId: A } = le(), { basePath: j = "/", navigate: M } = t(), N = ce(), P =
|
|
30
|
+
let { jobId: A } = le(), { basePath: j = "/", navigate: M } = t(), N = ce(), P = u(), F = () => {
|
|
31
31
|
window.history.length > 1 ? N(-1) : M?.(j);
|
|
32
|
-
}, { data: I, isLoading: L } =
|
|
32
|
+
}, { data: I, isLoading: L } = ee(A), { data: R } = i(A), [z, B] = m(null), { cancelJob: V, isPending: H } = n(), { deleteJob: U, isPending: W } = r(), { retryJob: ue, isPending: G } = a(), K = R ?? I ?? null, q = K?.status === "CREATED" || K?.status === "QUEUED" || K?.status === "RUNNING", J = K?.status === "COMPLETED", de = K?.status === "FAILED", Y = K?.status === "FAILED" || K?.status === "CANCELLED" || K?.status === "EXPIRED", fe = async () => {
|
|
33
33
|
A && B("cancel");
|
|
34
34
|
}, pe = async () => {
|
|
35
|
-
A && (
|
|
35
|
+
A && (f("medium"), B("delete"));
|
|
36
36
|
}, me = async () => {
|
|
37
|
-
if (
|
|
37
|
+
if (A && z) {
|
|
38
38
|
try {
|
|
39
|
-
z === "cancel" ? await V(A) : (await U(A), M?.(j)),
|
|
39
|
+
z === "cancel" ? await V(A) : (await U(A), M?.(j)), p("success");
|
|
40
40
|
} catch {
|
|
41
|
-
|
|
41
|
+
p("error");
|
|
42
42
|
}
|
|
43
43
|
B(null);
|
|
44
44
|
}
|
|
@@ -66,7 +66,7 @@ function A() {
|
|
|
66
66
|
onClick: F,
|
|
67
67
|
"aria-label": P("export.detail.actions.back", "Go back"),
|
|
68
68
|
className: "p-2.5 hover:bg-accent rounded-lg transition-all duration-200",
|
|
69
|
-
children: /* @__PURE__ */ S(
|
|
69
|
+
children: /* @__PURE__ */ S(g, { size: 20 })
|
|
70
70
|
}), /* @__PURE__ */ S("h1", {
|
|
71
71
|
className: "text-xl font-bold",
|
|
72
72
|
children: P("export.detail.notFound.title", "Export Not Found")
|
|
@@ -79,13 +79,13 @@ function A() {
|
|
|
79
79
|
type: "button",
|
|
80
80
|
onClick: F,
|
|
81
81
|
className: "inline-flex items-center gap-2 px-6 py-3 bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-colors font-medium",
|
|
82
|
-
children: [/* @__PURE__ */ S(
|
|
82
|
+
children: [/* @__PURE__ */ S(g, { size: 18 }), P("export.detail.actions.backToDashboard", "Back to Dashboard")]
|
|
83
83
|
})
|
|
84
84
|
})]
|
|
85
85
|
});
|
|
86
86
|
let Q = Z ? {
|
|
87
87
|
label: P("export.detail.actions.downloadArchive", "Download Archive"),
|
|
88
|
-
icon: /* @__PURE__ */ S(
|
|
88
|
+
icon: /* @__PURE__ */ S(v, { size: 16 }),
|
|
89
89
|
onSelect: () => {
|
|
90
90
|
Z && window.location.assign(Z);
|
|
91
91
|
}
|
|
@@ -125,7 +125,7 @@ function A() {
|
|
|
125
125
|
id: "download",
|
|
126
126
|
label: P("export.detail.nextSteps.download.label", "Download your export"),
|
|
127
127
|
description: P("export.detail.nextSteps.download.description", "Grab the generated files below before their download links expire."),
|
|
128
|
-
icon: /* @__PURE__ */ S(
|
|
128
|
+
icon: /* @__PURE__ */ S(v, { size: 16 }),
|
|
129
129
|
onClick: () => {
|
|
130
130
|
Z && window.location.assign(Z);
|
|
131
131
|
},
|
|
@@ -144,7 +144,7 @@ function A() {
|
|
|
144
144
|
id: "history",
|
|
145
145
|
label: P("export.detail.nextSteps.history.label", "Back to History"),
|
|
146
146
|
description: P("export.detail.nextSteps.history.description", "See all your exports and track other jobs in progress."),
|
|
147
|
-
icon: /* @__PURE__ */ S(
|
|
147
|
+
icon: /* @__PURE__ */ S(_, { size: 16 }),
|
|
148
148
|
onClick: () => M?.(j)
|
|
149
149
|
}
|
|
150
150
|
];
|
|
@@ -161,14 +161,14 @@ function A() {
|
|
|
161
161
|
onClick: F,
|
|
162
162
|
"aria-label": P("export.detail.actions.back", "Go back"),
|
|
163
163
|
className: "p-2.5 hover:bg-accent rounded-lg transition-colors duration-200 self-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",
|
|
164
|
-
children: /* @__PURE__ */ S(
|
|
164
|
+
children: /* @__PURE__ */ S(g, { size: 20 })
|
|
165
165
|
}),
|
|
166
166
|
/* @__PURE__ */ C("div", {
|
|
167
167
|
className: "flex items-center gap-3 flex-1 min-w-0",
|
|
168
168
|
children: [
|
|
169
169
|
/* @__PURE__ */ S("div", {
|
|
170
170
|
className: "p-2.5 rounded-lg bg-action-primary-bg/10",
|
|
171
|
-
children: /* @__PURE__ */ S(
|
|
171
|
+
children: /* @__PURE__ */ S(v, {
|
|
172
172
|
size: 24,
|
|
173
173
|
className: "text-primary"
|
|
174
174
|
})
|
|
@@ -183,7 +183,7 @@ function A() {
|
|
|
183
183
|
children: K.entityTypes.join(", ")
|
|
184
184
|
})]
|
|
185
185
|
}),
|
|
186
|
-
/* @__PURE__ */ S(
|
|
186
|
+
/* @__PURE__ */ S(o, { status: K.status })
|
|
187
187
|
]
|
|
188
188
|
}),
|
|
189
189
|
(Q || $.length > 0) && /* @__PURE__ */ S("div", {
|
|
@@ -198,7 +198,7 @@ function A() {
|
|
|
198
198
|
}),
|
|
199
199
|
(K.status === "RUNNING" || K.status === "QUEUED") && /* @__PURE__ */ C("div", {
|
|
200
200
|
className: "border border-border-seam rounded-xl bg-status-info-bg-subtle p-6",
|
|
201
|
-
children: [/* @__PURE__ */ S(
|
|
201
|
+
children: [/* @__PURE__ */ S(s, {
|
|
202
202
|
progress: K.progress,
|
|
203
203
|
size: "lg"
|
|
204
204
|
}), K.processedEntities != null && K.totalEntities != null && /* @__PURE__ */ S("p", {
|
|
@@ -211,7 +211,7 @@ function A() {
|
|
|
211
211
|
}),
|
|
212
212
|
de && K.errorMessage && /* @__PURE__ */ C("div", {
|
|
213
213
|
className: "border-2 border-border-default rounded-xl bg-status-error-bg-subtle p-6 flex items-start gap-4",
|
|
214
|
-
children: [/* @__PURE__ */ S(
|
|
214
|
+
children: [/* @__PURE__ */ S(h, {
|
|
215
215
|
size: 24,
|
|
216
216
|
className: "text-status-error-text flex-shrink-0 mt-0.5"
|
|
217
217
|
}), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("h3", {
|
|
@@ -226,22 +226,22 @@ function A() {
|
|
|
226
226
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",
|
|
227
227
|
children: [
|
|
228
228
|
{
|
|
229
|
-
icon: /* @__PURE__ */ S(
|
|
229
|
+
icon: /* @__PURE__ */ S(ie, { size: 18 }),
|
|
230
230
|
label: P("export.detail.info.format", "Format"),
|
|
231
|
-
value:
|
|
231
|
+
value: l(K.format)
|
|
232
232
|
},
|
|
233
233
|
{
|
|
234
234
|
icon: /* @__PURE__ */ S(ae, { size: 18 }),
|
|
235
235
|
label: P("export.detail.info.archive", "Archive"),
|
|
236
|
-
value:
|
|
236
|
+
value: ne(K.archiveFormat)
|
|
237
237
|
},
|
|
238
238
|
{
|
|
239
|
-
icon: /* @__PURE__ */ S(
|
|
239
|
+
icon: /* @__PURE__ */ S(v, { size: 18 }),
|
|
240
240
|
label: P("export.detail.info.totalSize", "Total Size"),
|
|
241
241
|
value: K.totalSizeBytes == null ? "-" : O(K.totalSizeBytes)
|
|
242
242
|
},
|
|
243
243
|
{
|
|
244
|
-
icon: /* @__PURE__ */ S(
|
|
244
|
+
icon: /* @__PURE__ */ S(_, { size: 18 }),
|
|
245
245
|
label: P("export.detail.info.created", "Created"),
|
|
246
246
|
value: new Date(K.createdAt).toLocaleDateString()
|
|
247
247
|
}
|
|
@@ -265,16 +265,16 @@ function A() {
|
|
|
265
265
|
title: P("export.detail.nextSteps.title", "What's next"),
|
|
266
266
|
steps: he
|
|
267
267
|
}),
|
|
268
|
-
K.parts.length > 0 && /* @__PURE__ */ S(
|
|
268
|
+
K.parts.length > 0 && /* @__PURE__ */ S(te, {
|
|
269
269
|
title: P("export.detail.parts.title", "Export Parts"),
|
|
270
270
|
description: P("export.detail.parts.description", "{{count}} file(s) generated", { count: K.parts.length }),
|
|
271
271
|
children: /* @__PURE__ */ S("div", {
|
|
272
272
|
className: "space-y-2",
|
|
273
273
|
children: K.parts.map((e) => /* @__PURE__ */ C("div", {
|
|
274
|
-
className:
|
|
274
|
+
className: d("border border-border-seam rounded-xl p-4 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 bg-bg-surface", "hover:border-primary/40 transition-colors duration-200"),
|
|
275
275
|
children: [/* @__PURE__ */ C("div", {
|
|
276
276
|
className: "flex items-center gap-3 min-w-0",
|
|
277
|
-
children: [/* @__PURE__ */ S(
|
|
277
|
+
children: [/* @__PURE__ */ S(y, {
|
|
278
278
|
size: 20,
|
|
279
279
|
className: "text-primary flex-shrink-0"
|
|
280
280
|
}), /* @__PURE__ */ C("div", {
|
|
@@ -298,10 +298,10 @@ function A() {
|
|
|
298
298
|
children: e.downloadUrl ? /* @__PURE__ */ C("a", {
|
|
299
299
|
href: e.downloadUrl,
|
|
300
300
|
className: "inline-flex items-center gap-2 px-3 py-1.5 bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-colors text-sm font-medium",
|
|
301
|
-
children: [/* @__PURE__ */ S(
|
|
301
|
+
children: [/* @__PURE__ */ S(v, { size: 14 }), P("export.detail.parts.download", "Download")]
|
|
302
302
|
}) : /* @__PURE__ */ C("span", {
|
|
303
303
|
className: "inline-flex items-center gap-1.5 text-sm text-text-secondary",
|
|
304
|
-
children: [/* @__PURE__ */ S(
|
|
304
|
+
children: [/* @__PURE__ */ S(_, { size: 14 }), P("export.detail.parts.pending", "Pending")]
|
|
305
305
|
})
|
|
306
306
|
})]
|
|
307
307
|
}, e.id))
|
|
@@ -310,7 +310,7 @@ function A() {
|
|
|
310
310
|
J && K.parts.length === 0 && /* @__PURE__ */ C("div", {
|
|
311
311
|
className: "border-2 border-border-default rounded-xl bg-status-success-bg-subtle p-6 text-center",
|
|
312
312
|
children: [
|
|
313
|
-
/* @__PURE__ */ S(
|
|
313
|
+
/* @__PURE__ */ S(re, {
|
|
314
314
|
size: 48,
|
|
315
315
|
className: "text-status-success-text mx-auto mb-3"
|
|
316
316
|
}),
|
|
@@ -365,7 +365,6 @@ function A() {
|
|
|
365
365
|
]
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
|
-
//#endregion
|
|
369
368
|
export { A as ExportDetailPage };
|
|
370
369
|
|
|
371
370
|
//# sourceMappingURL=ExportDetailPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportDetailPage.js","names":[],"sources":["../../../src/export/pages/ExportDetailPage.tsx"],"sourcesContent":["import { exportArchiveDownload } from \"../utils/exportAuthority\";\nimport { useState } from \"react\";\nimport { useParams, useNavigate } from \"react-router\";\nimport {\n ArrowLeft,\n Download,\n XCircle,\n Trash2,\n RotateCcw,\n Loader2,\n FileDown,\n Clock,\n AlertCircle,\n CheckCircle2,\n HardDrive,\n FileText,\n} from \"lucide-react\";\nimport {\n GlassCard,\n CTAOverflowMenu,\n IllustratedEmptyState,\n NextSteps,\n type NextStep,\n} from \"@burdenoff/fe-libs/ui\";\nimport type { CTAAction, CTAPrimaryAction } from \"@burdenoff/fe-libs/ui\";\nimport { useExport } from \"../providers/ExportProvider\";\nimport {\n useExportJob,\n useExportJobProgress,\n useCancelExportJob,\n useDeleteExportJob,\n useRetryExportJob,\n} from \"../hooks/useExportQueries\";\nimport { ExportStatusBadge } from \"../components/ExportStatusBadge\";\nimport { ExportProgressBar } from \"../components/ExportProgressBar\";\nimport { PageLayout, PageSection } from \"../components/PageLayout\";\nimport {\n getFormatDisplayName,\n getArchiveFormatDisplayName,\n} from \"../constants/enums\";\nimport { useTr } from \"../hooks/useTr\";\nimport { cn } from \"../utils/cn\";\nimport { nativeImpact, nativeNotify } from \"../../utils/nativeBridge\";\n\n/**\n * Format bytes to human-readable size\n */\nfunction formatBytes(bytes: number): string {\n if (bytes === 0) return \"0 B\";\n const k = 1024;\n const sizes = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\"];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;\n}\n\n/**\n * Helper to join paths correctly\n */\nconst joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith(\"/\") ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith(\"/\") ? path : `/${path}`;\n return cleanBase + cleanPath;\n};\n\n/**\n * Export Detail Page\n * Single export job detail view with parts, progress, download links.\n * Uses GraphQL subscriptions for live progress updates when a job is active.\n */\nexport function ExportDetailPage() {\n const { jobId } = useParams<{ jobId: string }>();\n const { basePath = \"/\", navigate } = useExport();\n const routerNavigate = useNavigate();\n const tr = useTr();\n\n const handleBack = () => {\n if (window.history.length > 1) {\n routerNavigate(-1);\n } else {\n navigate?.(basePath);\n }\n };\n\n const { data: job, isLoading } = useExportJob(jobId);\n const { data: progressJob } = useExportJobProgress(jobId);\n const [pendingAction, setPendingAction] = useState<\n \"cancel\" | \"delete\" | null\n >(null);\n\n const { cancelJob, isPending: cancelling } = useCancelExportJob();\n const { deleteJob, isPending: deleting } = useDeleteExportJob();\n const { retryJob, isPending: retrying } = useRetryExportJob(\n job?.exportScope ?? \"INDIVIDUAL\",\n );\n\n const liveJob = progressJob ?? job ?? null;\n\n // Jobs in CREATED/QUEUED/RUNNING can still be cancelled\n const isCancellable =\n liveJob?.status === \"CREATED\" ||\n liveJob?.status === \"QUEUED\" ||\n liveJob?.status === \"RUNNING\";\n const isCompleted = liveJob?.status === \"COMPLETED\";\n const isFailed = liveJob?.status === \"FAILED\";\n const isRetryable =\n liveJob?.status === \"FAILED\" ||\n liveJob?.status === \"CANCELLED\" ||\n liveJob?.status === \"EXPIRED\";\n\n const handleCancel = async () => {\n if (!jobId) return;\n setPendingAction(\"cancel\");\n };\n\n const handleDelete = async () => {\n if (!jobId) return;\n nativeImpact(\"medium\");\n setPendingAction(\"delete\");\n };\n\n const confirmPendingAction = async () => {\n if (!jobId || !pendingAction) return;\n try {\n if (pendingAction === \"cancel\") {\n await cancelJob(jobId);\n } else {\n await deleteJob(jobId);\n navigate?.(basePath);\n }\n nativeNotify(\"success\");\n } catch {\n nativeNotify(\"error\");\n }\n setPendingAction(null);\n };\n\n const handleRetry = async () => {\n if (!jobId) return;\n const newJob = await retryJob(jobId);\n // Navigate to the new job created by retry\n if (newJob?.id) {\n navigate?.(joinPath(basePath, newJob.id));\n }\n };\n\n // The primary download is the complete durable archive when ready;\n // otherwise the most relevant lifecycle action leads. Destructive Delete\n // always lives in the overflow menu and is confirmed via the dialog.\n const archiveDownloadUrl = exportArchiveDownload(liveJob);\n\n // Loading\n if (isLoading) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20\">\n <Loader2 size={48} className=\"animate-spin text-primary\" />\n <span className=\"mt-6 text-sm font-medium text-text-secondary\">\n {tr(\"export.detail.loading\", \"Loading export details…\")}\n </span>\n </div>\n );\n }\n\n // Not found\n if (!liveJob) {\n return (\n <PageLayout showHeader={false}>\n <div className=\"flex items-center gap-3 mb-6\">\n <button\n type=\"button\"\n onClick={handleBack}\n aria-label={tr(\"export.detail.actions.back\", \"Go back\")}\n className=\"p-2.5 hover:bg-accent rounded-lg transition-all duration-200\"\n >\n <ArrowLeft size={20} />\n </button>\n <h1 className=\"text-xl font-bold\">\n {tr(\"export.detail.notFound.title\", \"Export Not Found\")}\n </h1>\n </div>\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr(\"export.detail.notFound.heading\", \"Export not found\")}\n description={tr(\n \"export.detail.notFound.description\",\n \"The export job you are looking for does not exist or has been deleted.\",\n )}\n action={\n <button\n type=\"button\"\n onClick={handleBack}\n className=\"inline-flex items-center gap-2 px-6 py-3 bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-colors font-medium\"\n >\n <ArrowLeft size={18} />\n {tr(\"export.detail.actions.backToDashboard\", \"Back to Dashboard\")}\n </button>\n }\n />\n </PageLayout>\n );\n }\n\n // Primary CTA: download when ready, otherwise retry when retryable.\n const primaryAction: CTAPrimaryAction | undefined = archiveDownloadUrl\n ? {\n label: tr(\"export.detail.actions.downloadArchive\", \"Download Archive\"),\n icon: <Download size={16} />,\n onSelect: () => {\n if (archiveDownloadUrl) {\n window.location.assign(archiveDownloadUrl);\n }\n },\n }\n : isRetryable\n ? {\n label: tr(\"export.detail.actions.retry\", \"Retry Export\"),\n icon: <RotateCcw size={16} />,\n disabled: retrying,\n onSelect: () => {\n void handleRetry();\n },\n }\n : undefined;\n\n // Overflow actions: lifecycle controls + destructive delete.\n const overflowActions: CTAAction[] = [];\n if (isRetryable && archiveDownloadUrl) {\n overflowActions.push({\n label: tr(\"export.detail.actions.retry\", \"Retry Export\"),\n icon: <RotateCcw size={16} />,\n disabled: retrying,\n onSelect: () => {\n void handleRetry();\n },\n });\n }\n if (isCancellable) {\n overflowActions.push({\n label: tr(\"export.detail.actions.cancel\", \"Cancel Export\"),\n icon: <XCircle size={16} />,\n disabled: cancelling,\n onSelect: () => {\n void handleCancel();\n },\n });\n }\n if (!isCancellable) {\n overflowActions.push({\n label: tr(\"export.detail.actions.delete\", \"Delete Export\"),\n icon: <Trash2 size={16} />,\n intent: \"destructive\",\n disabled: deleting,\n onSelect: () => {\n void handleDelete();\n },\n });\n }\n\n // Next-step guidance — concrete actions wired to real handlers/links, tuned\n // to the job's current state so a new user knows what to do from here.\n const nextSteps: NextStep[] = [\n {\n id: \"download\",\n label: tr(\n \"export.detail.nextSteps.download.label\",\n \"Download your export\",\n ),\n description: tr(\n \"export.detail.nextSteps.download.description\",\n \"Grab the generated files below before their download links expire.\",\n ),\n icon: <Download size={16} />,\n onClick: () => {\n if (archiveDownloadUrl) {\n window.location.assign(archiveDownloadUrl);\n }\n },\n done: isCompleted,\n },\n ...(isRetryable\n ? [\n {\n id: \"retry\",\n label: tr(\n \"export.detail.nextSteps.retry.label\",\n \"Retry this export\",\n ),\n description: tr(\n \"export.detail.nextSteps.retry.description\",\n \"This export didn't finish — start a fresh run with the same settings.\",\n ),\n icon: <RotateCcw size={16} />,\n onClick: () => {\n void handleRetry();\n },\n } as NextStep,\n ]\n : []),\n {\n id: \"history\",\n label: tr(\"export.detail.nextSteps.history.label\", \"Back to History\"),\n description: tr(\n \"export.detail.nextSteps.history.description\",\n \"See all your exports and track other jobs in progress.\",\n ),\n icon: <Clock size={16} />,\n onClick: () => navigate?.(basePath),\n },\n ];\n\n return (\n <PageLayout showHeader={false}>\n {/* Header */}\n <div className=\"relative overflow-hidden rounded-xl bg-accent-wash border border-border-seam p-6 shadow-[var(--shadow-pop)]\">\n <div className=\"relative z-10 flex flex-col sm:flex-row sm:items-center gap-4\">\n <button\n type=\"button\"\n onClick={handleBack}\n aria-label={tr(\"export.detail.actions.back\", \"Go back\")}\n className=\"p-2.5 hover:bg-accent rounded-lg transition-colors duration-200 self-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40\"\n >\n <ArrowLeft size={20} />\n </button>\n <div className=\"flex items-center gap-3 flex-1 min-w-0\">\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <Download size={24} className=\"text-primary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <h1 className=\"text-xl sm:text-2xl font-bold truncate\">\n {liveJob.name}\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {liveJob.entityTypes.join(\", \")}\n </p>\n </div>\n <ExportStatusBadge status={liveJob.status} />\n </div>\n {(primaryAction || overflowActions.length > 0) && (\n <div className=\"flex-shrink-0\">\n <CTAOverflowMenu\n primary={primaryAction}\n actions={overflowActions}\n />\n </div>\n )}\n </div>\n </div>\n\n {/* Progress (for active jobs) */}\n {(liveJob.status === \"RUNNING\" || liveJob.status === \"QUEUED\") && (\n <div className=\"border border-border-seam rounded-xl bg-status-info-bg-subtle p-6\">\n <ExportProgressBar progress={liveJob.progress} size=\"lg\" />\n {liveJob.processedEntities != null &&\n liveJob.totalEntities != null && (\n <p className=\"text-sm text-text-secondary mt-2\">\n {tr(\n \"export.detail.progress.entitiesProcessed\",\n \"{{processed}} / {{total}} entities processed\",\n {\n processed: liveJob.processedEntities.toLocaleString(),\n total: liveJob.totalEntities.toLocaleString(),\n },\n )}\n </p>\n )}\n </div>\n )}\n\n {/* Error (for failed jobs) */}\n {isFailed && liveJob.errorMessage && (\n <div className=\"border-2 border-border-default rounded-xl bg-status-error-bg-subtle p-6 flex items-start gap-4\">\n <AlertCircle\n size={24}\n className=\"text-status-error-text flex-shrink-0 mt-0.5\"\n />\n <div>\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tr(\"export.detail.error.title\", \"Export Failed\")}\n </h3>\n <p className=\"text-sm text-status-error-text\">\n {liveJob.errorMessage}\n </p>\n </div>\n </div>\n )}\n\n {/* Info Grid */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\">\n {[\n {\n icon: <FileText size={18} />,\n label: tr(\"export.detail.info.format\", \"Format\"),\n value: getFormatDisplayName(liveJob.format),\n },\n {\n icon: <HardDrive size={18} />,\n label: tr(\"export.detail.info.archive\", \"Archive\"),\n value: getArchiveFormatDisplayName(liveJob.archiveFormat),\n },\n {\n icon: <Download size={18} />,\n label: tr(\"export.detail.info.totalSize\", \"Total Size\"),\n value:\n liveJob.totalSizeBytes != null\n ? formatBytes(liveJob.totalSizeBytes)\n : \"-\",\n },\n {\n icon: <Clock size={18} />,\n label: tr(\"export.detail.info.created\", \"Created\"),\n value: new Date(liveJob.createdAt).toLocaleDateString(),\n },\n ].map((item) => (\n <GlassCard\n key={item.label}\n treatment=\"metric\"\n className=\"p-4 border-border-seam\"\n >\n <div className=\"flex items-center gap-2 text-text-secondary mb-1\">\n {item.icon}\n <span className=\"text-xs font-medium\">{item.label}</span>\n </div>\n <p className=\"font-bold text-lg tabular-nums\">{item.value}</p>\n </GlassCard>\n ))}\n </div>\n\n {/* Next-step guidance for this export (dismissable, per-job) */}\n <NextSteps\n storageKey={`export-detail-${liveJob.id}`}\n title={tr(\"export.detail.nextSteps.title\", \"What's next\")}\n steps={nextSteps}\n />\n\n {/* Parts */}\n {liveJob.parts.length > 0 && (\n <PageSection\n title={tr(\"export.detail.parts.title\", \"Export Parts\")}\n description={tr(\n \"export.detail.parts.description\",\n \"{{count}} file(s) generated\",\n { count: liveJob.parts.length },\n )}\n >\n <div className=\"space-y-2\">\n {liveJob.parts.map((part) => (\n <div\n key={part.id}\n className={cn(\n \"border border-border-seam rounded-xl p-4 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 bg-bg-surface\",\n \"hover:border-primary/40 transition-colors duration-200\",\n )}\n >\n <div className=\"flex items-center gap-3 min-w-0\">\n <FileDown size={20} className=\"text-primary flex-shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"font-medium truncate\">{part.fileName}</p>\n <p className=\"text-sm text-text-secondary\">\n {part.entityTypes.join(\", \")} ·{\" \"}\n {formatBytes(part.sizeBytes)}\n {part.downloadExpiresAt &&\n ` · ${tr(\n \"export.detail.parts.expires\",\n \"expires {{date}}\",\n {\n date: new Date(\n part.downloadExpiresAt,\n ).toLocaleDateString(),\n },\n )}`}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-2 flex-shrink-0\">\n {part.downloadUrl ? (\n <a\n href={part.downloadUrl}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-colors text-sm font-medium\"\n >\n <Download size={14} />\n {tr(\"export.detail.parts.download\", \"Download\")}\n </a>\n ) : (\n <span className=\"inline-flex items-center gap-1.5 text-sm text-text-secondary\">\n <Clock size={14} />\n {tr(\"export.detail.parts.pending\", \"Pending\")}\n </span>\n )}\n </div>\n </div>\n ))}\n </div>\n </PageSection>\n )}\n\n {/* Completed message when no parts yet */}\n {isCompleted && liveJob.parts.length === 0 && (\n <div className=\"border-2 border-border-default rounded-xl bg-status-success-bg-subtle p-6 text-center\">\n <CheckCircle2\n size={48}\n className=\"text-status-success-text mx-auto mb-3\"\n />\n <h3 className=\"text-lg font-bold text-status-success-text mb-1\">\n {tr(\"export.detail.complete.title\", \"Export Complete\")}\n </h3>\n <p className=\"text-sm text-status-success-text\">\n {tr(\n \"export.detail.complete.noParts\",\n \"Your export has completed but no download parts are available yet.\",\n )}\n </p>\n </div>\n )}\n\n {pendingAction && (\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"export-confirm-title\"\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-bg-surface/80 backdrop-blur-sm p-4\"\n >\n <div className=\"w-full max-w-md rounded-xl border-2 border-border-subtle bg-bg-surface p-6 shadow-xl\">\n <h2 id=\"export-confirm-title\" className=\"text-lg font-bold\">\n {pendingAction === \"cancel\"\n ? tr(\"export.detail.confirm.cancel.title\", \"Cancel export?\")\n : tr(\"export.detail.confirm.delete.title\", \"Delete export?\")}\n </h2>\n <p className=\"mt-2 text-sm text-text-secondary\">\n {pendingAction === \"cancel\"\n ? tr(\n \"export.detail.confirm.cancel.description\",\n \"This stops the running export job. You can retry it later if needed.\",\n )\n : tr(\n \"export.detail.confirm.delete.description\",\n \"This removes the export job from history. This action cannot be undone.\",\n )}\n </p>\n <div className=\"mt-6 flex flex-col-reverse sm:flex-row sm:justify-end gap-3\">\n <button\n type=\"button\"\n onClick={() => setPendingAction(null)}\n className=\"px-4 py-2 rounded-lg border-2 border-border-subtle hover:bg-accent transition-colors font-medium\"\n >\n {tr(\"export.detail.confirm.keep\", \"Keep Export\")}\n </button>\n <button\n type=\"button\"\n onClick={confirmPendingAction}\n disabled={cancelling || deleting}\n className=\"inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-status-error-bg text-status-error-text hover:bg-status-error-bg/90 transition-colors font-medium disabled:opacity-50\"\n >\n {cancelling || deleting ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : null}\n {pendingAction === \"cancel\"\n ? tr(\"export.detail.actions.cancel\", \"Cancel Export\")\n : tr(\"export.detail.actions.delete\", \"Delete Export\")}\n </button>\n </div>\n </div>\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+CA,SAAS,EAAY,GAAuB;AAC1C,KAAI,MAAU,EAAG,QAAO;CACxB,IAAM,IAAI,MACJ,IAAQ;EAAC;EAAK;EAAM;EAAM;EAAM;EAAK,EACrC,IAAI,KAAK,MAAM,KAAK,IAAI,EAAM,GAAG,KAAK,IAAI,EAAE,CAAC;AACnD,QAAO,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MAAkB,WACf,EACE,4CACA,uEACD,GACD,EACE,4CACA,0EACD;OACH,CAAA;MACJ,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,UAAD;QACE,MAAK;QACL,eAAe,EAAiB,KAAK;QACrC,WAAU;kBAET,EAAG,8BAA8B,cAAc;QACzC,CAAA,EACT,kBAAC,UAAD;QACE,MAAK;QACL,SAAS;QACT,UAAU,KAAc;QACxB,WAAU;kBAJZ,CAMG,KAAc,IACb,kBAAC,GAAD;SAAS,MAAM;SAAI,WAAU;SAAiB,CAAA,GAC5C,MACH,MAAkB,WACf,EAAG,gCAAgC,gBAAgB,GACnD,EAAG,gCAAgC,gBAAgB,CAChD;UACL;;MACF;;IACF,CAAA;GAEG"}
|
|
1
|
+
{"version":3,"file":"ExportDetailPage.js","names":["formatBytes","bytes","k","sizes","i","joinPath","base","path","ExportDetailPage","useParams","useExport","routerNavigate","useNavigate","tr","useTr","handleBack","navigate","basePath","job","useExportJob","jobId","progressJob","useExportJobProgress","pendingAction","setPendingAction","useState","cancelling","useCancelExportJob","deleting","useDeleteExportJob","retrying","useRetryExportJob","liveJob","isCancellable","isCompleted","isFailed","isRetryable","handleCancel","handleDelete","nativeImpact","confirmPendingAction","cancelJob","deleteJob","nativeNotify","handleRetry","newJob","retryJob","archiveDownloadUrl","exportArchiveDownload","isLoading","Loader2","PageLayout","ArrowLeft","IllustratedEmptyState","primaryAction","Download","RotateCcw","overflowActions","XCircle","Trash2","nextSteps","Clock","ExportStatusBadge","CTAOverflowMenu","ExportProgressBar","AlertCircle","FileText","getFormatDisplayName","HardDrive","getArchiveFormatDisplayName","GlassCard","item","NextSteps","PageSection","cn","FileDown","part","CheckCircle2"],"sources":["../../../src/export/pages/ExportDetailPage.tsx"],"sourcesContent":["import { exportArchiveDownload } from \"../utils/exportAuthority\";\nimport { useState } from \"react\";\nimport { useParams, useNavigate } from \"react-router\";\nimport {\n ArrowLeft,\n Download,\n XCircle,\n Trash2,\n RotateCcw,\n Loader2,\n FileDown,\n Clock,\n AlertCircle,\n CheckCircle2,\n HardDrive,\n FileText,\n} from \"lucide-react\";\nimport {\n GlassCard,\n CTAOverflowMenu,\n IllustratedEmptyState,\n NextSteps,\n type NextStep,\n} from \"@burdenoff/fe-libs/ui\";\nimport type { CTAAction, CTAPrimaryAction } from \"@burdenoff/fe-libs/ui\";\nimport { useExport } from \"../providers/ExportProvider\";\nimport {\n useExportJob,\n useExportJobProgress,\n useCancelExportJob,\n useDeleteExportJob,\n useRetryExportJob,\n} from \"../hooks/useExportQueries\";\nimport { ExportStatusBadge } from \"../components/ExportStatusBadge\";\nimport { ExportProgressBar } from \"../components/ExportProgressBar\";\nimport { PageLayout, PageSection } from \"../components/PageLayout\";\nimport {\n getFormatDisplayName,\n getArchiveFormatDisplayName,\n} from \"../constants/enums\";\nimport { useTr } from \"../hooks/useTr\";\nimport { cn } from \"../utils/cn\";\nimport { nativeImpact, nativeNotify } from \"../../utils/nativeBridge\";\n\n/**\n * Format bytes to human-readable size\n */\nfunction formatBytes(bytes: number): string {\n if (bytes === 0) return \"0 B\";\n const k = 1024;\n const sizes = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\"];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;\n}\n\n/**\n * Helper to join paths correctly\n */\nconst joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith(\"/\") ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith(\"/\") ? path : `/${path}`;\n return cleanBase + cleanPath;\n};\n\n/**\n * Export Detail Page\n * Single export job detail view with parts, progress, download links.\n * Uses GraphQL subscriptions for live progress updates when a job is active.\n */\nexport function ExportDetailPage() {\n const { jobId } = useParams<{ jobId: string }>();\n const { basePath = \"/\", navigate } = useExport();\n const routerNavigate = useNavigate();\n const tr = useTr();\n\n const handleBack = () => {\n if (window.history.length > 1) {\n routerNavigate(-1);\n } else {\n navigate?.(basePath);\n }\n };\n\n const { data: job, isLoading } = useExportJob(jobId);\n const { data: progressJob } = useExportJobProgress(jobId);\n const [pendingAction, setPendingAction] = useState<\n \"cancel\" | \"delete\" | null\n >(null);\n\n const { cancelJob, isPending: cancelling } = useCancelExportJob();\n const { deleteJob, isPending: deleting } = useDeleteExportJob();\n const { retryJob, isPending: retrying } = useRetryExportJob();\n\n const liveJob = progressJob ?? job ?? null;\n\n // Jobs in CREATED/QUEUED/RUNNING can still be cancelled\n const isCancellable =\n liveJob?.status === \"CREATED\" ||\n liveJob?.status === \"QUEUED\" ||\n liveJob?.status === \"RUNNING\";\n const isCompleted = liveJob?.status === \"COMPLETED\";\n const isFailed = liveJob?.status === \"FAILED\";\n const isRetryable =\n liveJob?.status === \"FAILED\" ||\n liveJob?.status === \"CANCELLED\" ||\n liveJob?.status === \"EXPIRED\";\n\n const handleCancel = async () => {\n if (!jobId) return;\n setPendingAction(\"cancel\");\n };\n\n const handleDelete = async () => {\n if (!jobId) return;\n nativeImpact(\"medium\");\n setPendingAction(\"delete\");\n };\n\n const confirmPendingAction = async () => {\n if (!jobId || !pendingAction) return;\n try {\n if (pendingAction === \"cancel\") {\n await cancelJob(jobId);\n } else {\n await deleteJob(jobId);\n navigate?.(basePath);\n }\n nativeNotify(\"success\");\n } catch {\n nativeNotify(\"error\");\n }\n setPendingAction(null);\n };\n\n const handleRetry = async () => {\n if (!jobId) return;\n const newJob = await retryJob(jobId);\n // Navigate to the new job created by retry\n if (newJob?.id) {\n navigate?.(joinPath(basePath, newJob.id));\n }\n };\n\n // The primary download is the complete durable archive when ready;\n // otherwise the most relevant lifecycle action leads. Destructive Delete\n // always lives in the overflow menu and is confirmed via the dialog.\n const archiveDownloadUrl = exportArchiveDownload(liveJob);\n\n // Loading\n if (isLoading) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20\">\n <Loader2 size={48} className=\"animate-spin text-primary\" />\n <span className=\"mt-6 text-sm font-medium text-text-secondary\">\n {tr(\"export.detail.loading\", \"Loading export details…\")}\n </span>\n </div>\n );\n }\n\n // Not found\n if (!liveJob) {\n return (\n <PageLayout showHeader={false}>\n <div className=\"flex items-center gap-3 mb-6\">\n <button\n type=\"button\"\n onClick={handleBack}\n aria-label={tr(\"export.detail.actions.back\", \"Go back\")}\n className=\"p-2.5 hover:bg-accent rounded-lg transition-all duration-200\"\n >\n <ArrowLeft size={20} />\n </button>\n <h1 className=\"text-xl font-bold\">\n {tr(\"export.detail.notFound.title\", \"Export Not Found\")}\n </h1>\n </div>\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr(\"export.detail.notFound.heading\", \"Export not found\")}\n description={tr(\n \"export.detail.notFound.description\",\n \"The export job you are looking for does not exist or has been deleted.\",\n )}\n action={\n <button\n type=\"button\"\n onClick={handleBack}\n className=\"inline-flex items-center gap-2 px-6 py-3 bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-colors font-medium\"\n >\n <ArrowLeft size={18} />\n {tr(\"export.detail.actions.backToDashboard\", \"Back to Dashboard\")}\n </button>\n }\n />\n </PageLayout>\n );\n }\n\n // Primary CTA: download when ready, otherwise retry when retryable.\n const primaryAction: CTAPrimaryAction | undefined = archiveDownloadUrl\n ? {\n label: tr(\"export.detail.actions.downloadArchive\", \"Download Archive\"),\n icon: <Download size={16} />,\n onSelect: () => {\n if (archiveDownloadUrl) {\n window.location.assign(archiveDownloadUrl);\n }\n },\n }\n : isRetryable\n ? {\n label: tr(\"export.detail.actions.retry\", \"Retry Export\"),\n icon: <RotateCcw size={16} />,\n disabled: retrying,\n onSelect: () => {\n void handleRetry();\n },\n }\n : undefined;\n\n // Overflow actions: lifecycle controls + destructive delete.\n const overflowActions: CTAAction[] = [];\n if (isRetryable && archiveDownloadUrl) {\n overflowActions.push({\n label: tr(\"export.detail.actions.retry\", \"Retry Export\"),\n icon: <RotateCcw size={16} />,\n disabled: retrying,\n onSelect: () => {\n void handleRetry();\n },\n });\n }\n if (isCancellable) {\n overflowActions.push({\n label: tr(\"export.detail.actions.cancel\", \"Cancel Export\"),\n icon: <XCircle size={16} />,\n disabled: cancelling,\n onSelect: () => {\n void handleCancel();\n },\n });\n }\n if (!isCancellable) {\n overflowActions.push({\n label: tr(\"export.detail.actions.delete\", \"Delete Export\"),\n icon: <Trash2 size={16} />,\n intent: \"destructive\",\n disabled: deleting,\n onSelect: () => {\n void handleDelete();\n },\n });\n }\n\n // Next-step guidance — concrete actions wired to real handlers/links, tuned\n // to the job's current state so a new user knows what to do from here.\n const nextSteps: NextStep[] = [\n {\n id: \"download\",\n label: tr(\n \"export.detail.nextSteps.download.label\",\n \"Download your export\",\n ),\n description: tr(\n \"export.detail.nextSteps.download.description\",\n \"Grab the generated files below before their download links expire.\",\n ),\n icon: <Download size={16} />,\n onClick: () => {\n if (archiveDownloadUrl) {\n window.location.assign(archiveDownloadUrl);\n }\n },\n done: isCompleted,\n },\n ...(isRetryable\n ? [\n {\n id: \"retry\",\n label: tr(\n \"export.detail.nextSteps.retry.label\",\n \"Retry this export\",\n ),\n description: tr(\n \"export.detail.nextSteps.retry.description\",\n \"This export didn't finish — start a fresh run with the same settings.\",\n ),\n icon: <RotateCcw size={16} />,\n onClick: () => {\n void handleRetry();\n },\n } as NextStep,\n ]\n : []),\n {\n id: \"history\",\n label: tr(\"export.detail.nextSteps.history.label\", \"Back to History\"),\n description: tr(\n \"export.detail.nextSteps.history.description\",\n \"See all your exports and track other jobs in progress.\",\n ),\n icon: <Clock size={16} />,\n onClick: () => navigate?.(basePath),\n },\n ];\n\n return (\n <PageLayout showHeader={false}>\n {/* Header */}\n <div className=\"relative overflow-hidden rounded-xl bg-accent-wash border border-border-seam p-6 shadow-[var(--shadow-pop)]\">\n <div className=\"relative z-10 flex flex-col sm:flex-row sm:items-center gap-4\">\n <button\n type=\"button\"\n onClick={handleBack}\n aria-label={tr(\"export.detail.actions.back\", \"Go back\")}\n className=\"p-2.5 hover:bg-accent rounded-lg transition-colors duration-200 self-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40\"\n >\n <ArrowLeft size={20} />\n </button>\n <div className=\"flex items-center gap-3 flex-1 min-w-0\">\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <Download size={24} className=\"text-primary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <h1 className=\"text-xl sm:text-2xl font-bold truncate\">\n {liveJob.name}\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {liveJob.entityTypes.join(\", \")}\n </p>\n </div>\n <ExportStatusBadge status={liveJob.status} />\n </div>\n {(primaryAction || overflowActions.length > 0) && (\n <div className=\"flex-shrink-0\">\n <CTAOverflowMenu\n primary={primaryAction}\n actions={overflowActions}\n />\n </div>\n )}\n </div>\n </div>\n\n {/* Progress (for active jobs) */}\n {(liveJob.status === \"RUNNING\" || liveJob.status === \"QUEUED\") && (\n <div className=\"border border-border-seam rounded-xl bg-status-info-bg-subtle p-6\">\n <ExportProgressBar progress={liveJob.progress} size=\"lg\" />\n {liveJob.processedEntities != null &&\n liveJob.totalEntities != null && (\n <p className=\"text-sm text-text-secondary mt-2\">\n {tr(\n \"export.detail.progress.entitiesProcessed\",\n \"{{processed}} / {{total}} entities processed\",\n {\n processed: liveJob.processedEntities.toLocaleString(),\n total: liveJob.totalEntities.toLocaleString(),\n },\n )}\n </p>\n )}\n </div>\n )}\n\n {/* Error (for failed jobs) */}\n {isFailed && liveJob.errorMessage && (\n <div className=\"border-2 border-border-default rounded-xl bg-status-error-bg-subtle p-6 flex items-start gap-4\">\n <AlertCircle\n size={24}\n className=\"text-status-error-text flex-shrink-0 mt-0.5\"\n />\n <div>\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tr(\"export.detail.error.title\", \"Export Failed\")}\n </h3>\n <p className=\"text-sm text-status-error-text\">\n {liveJob.errorMessage}\n </p>\n </div>\n </div>\n )}\n\n {/* Info Grid */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\">\n {[\n {\n icon: <FileText size={18} />,\n label: tr(\"export.detail.info.format\", \"Format\"),\n value: getFormatDisplayName(liveJob.format),\n },\n {\n icon: <HardDrive size={18} />,\n label: tr(\"export.detail.info.archive\", \"Archive\"),\n value: getArchiveFormatDisplayName(liveJob.archiveFormat),\n },\n {\n icon: <Download size={18} />,\n label: tr(\"export.detail.info.totalSize\", \"Total Size\"),\n value:\n liveJob.totalSizeBytes != null\n ? formatBytes(liveJob.totalSizeBytes)\n : \"-\",\n },\n {\n icon: <Clock size={18} />,\n label: tr(\"export.detail.info.created\", \"Created\"),\n value: new Date(liveJob.createdAt).toLocaleDateString(),\n },\n ].map((item) => (\n <GlassCard\n key={item.label}\n treatment=\"metric\"\n className=\"p-4 border-border-seam\"\n >\n <div className=\"flex items-center gap-2 text-text-secondary mb-1\">\n {item.icon}\n <span className=\"text-xs font-medium\">{item.label}</span>\n </div>\n <p className=\"font-bold text-lg tabular-nums\">{item.value}</p>\n </GlassCard>\n ))}\n </div>\n\n {/* Next-step guidance for this export (dismissable, per-job) */}\n <NextSteps\n storageKey={`export-detail-${liveJob.id}`}\n title={tr(\"export.detail.nextSteps.title\", \"What's next\")}\n steps={nextSteps}\n />\n\n {/* Parts */}\n {liveJob.parts.length > 0 && (\n <PageSection\n title={tr(\"export.detail.parts.title\", \"Export Parts\")}\n description={tr(\n \"export.detail.parts.description\",\n \"{{count}} file(s) generated\",\n { count: liveJob.parts.length },\n )}\n >\n <div className=\"space-y-2\">\n {liveJob.parts.map((part) => (\n <div\n key={part.id}\n className={cn(\n \"border border-border-seam rounded-xl p-4 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 bg-bg-surface\",\n \"hover:border-primary/40 transition-colors duration-200\",\n )}\n >\n <div className=\"flex items-center gap-3 min-w-0\">\n <FileDown size={20} className=\"text-primary flex-shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"font-medium truncate\">{part.fileName}</p>\n <p className=\"text-sm text-text-secondary\">\n {part.entityTypes.join(\", \")} ·{\" \"}\n {formatBytes(part.sizeBytes)}\n {part.downloadExpiresAt &&\n ` · ${tr(\n \"export.detail.parts.expires\",\n \"expires {{date}}\",\n {\n date: new Date(\n part.downloadExpiresAt,\n ).toLocaleDateString(),\n },\n )}`}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-2 flex-shrink-0\">\n {part.downloadUrl ? (\n <a\n href={part.downloadUrl}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-colors text-sm font-medium\"\n >\n <Download size={14} />\n {tr(\"export.detail.parts.download\", \"Download\")}\n </a>\n ) : (\n <span className=\"inline-flex items-center gap-1.5 text-sm text-text-secondary\">\n <Clock size={14} />\n {tr(\"export.detail.parts.pending\", \"Pending\")}\n </span>\n )}\n </div>\n </div>\n ))}\n </div>\n </PageSection>\n )}\n\n {/* Completed message when no parts yet */}\n {isCompleted && liveJob.parts.length === 0 && (\n <div className=\"border-2 border-border-default rounded-xl bg-status-success-bg-subtle p-6 text-center\">\n <CheckCircle2\n size={48}\n className=\"text-status-success-text mx-auto mb-3\"\n />\n <h3 className=\"text-lg font-bold text-status-success-text mb-1\">\n {tr(\"export.detail.complete.title\", \"Export Complete\")}\n </h3>\n <p className=\"text-sm text-status-success-text\">\n {tr(\n \"export.detail.complete.noParts\",\n \"Your export has completed but no download parts are available yet.\",\n )}\n </p>\n </div>\n )}\n\n {pendingAction && (\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"export-confirm-title\"\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-bg-surface/80 backdrop-blur-sm p-4\"\n >\n <div className=\"w-full max-w-md rounded-xl border-2 border-border-subtle bg-bg-surface p-6 shadow-xl\">\n <h2 id=\"export-confirm-title\" className=\"text-lg font-bold\">\n {pendingAction === \"cancel\"\n ? tr(\"export.detail.confirm.cancel.title\", \"Cancel export?\")\n : tr(\"export.detail.confirm.delete.title\", \"Delete export?\")}\n </h2>\n <p className=\"mt-2 text-sm text-text-secondary\">\n {pendingAction === \"cancel\"\n ? tr(\n \"export.detail.confirm.cancel.description\",\n \"This stops the running export job. You can retry it later if needed.\",\n )\n : tr(\n \"export.detail.confirm.delete.description\",\n \"This removes the export job from history. This action cannot be undone.\",\n )}\n </p>\n <div className=\"mt-6 flex flex-col-reverse sm:flex-row sm:justify-end gap-3\">\n <button\n type=\"button\"\n onClick={() => setPendingAction(null)}\n className=\"px-4 py-2 rounded-lg border-2 border-border-subtle hover:bg-accent transition-colors font-medium\"\n >\n {tr(\"export.detail.confirm.keep\", \"Keep Export\")}\n </button>\n <button\n type=\"button\"\n onClick={confirmPendingAction}\n disabled={cancelling || deleting}\n className=\"inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-status-error-bg text-status-error-text hover:bg-status-error-bg/90 transition-colors font-medium disabled:opacity-50\"\n >\n {cancelling || deleting ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : null}\n {pendingAction === \"cancel\"\n ? tr(\"export.detail.actions.cancel\", \"Cancel Export\")\n : tr(\"export.detail.actions.delete\", \"Delete Export\")}\n </button>\n </div>\n </div>\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+CA,SAASA,EAAY,GAAuB;CAC1C,IAAIC,MAAU,GAAG,OAAO;CACxB,IAAMC,IAAI,MACJC,IAAQ;EAAC;EAAK;EAAM;EAAM;EAAM;CAAI,GACpCC,IAAI,KAAK,MAAM,KAAK,IAAIH,CAAK,IAAI,KAAK,IAAIC,CAAC,CAAC;CAClD,OAAO,GAAG,YAAYD,IAAiBC,KAAGE,EAAC,CAAG,QAAQ,CAAC,CAAC,EAAE,GAAGD,EAAMC;AACrE;AAKA,IAAMC,KAAY,GAAc,OACZC,EAAK,SAAS,GAAG,IAAIA,EAAK,MAAM,GAAG,EAAE,IAAIA,MACzCC,EAAK,WAAW,GAAG,IAAIA,IAAO,IAAIA;AAStD,SAAgBC,IAAmB;CACjC,IAAM,EAAE,aAAUC,GAA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ACE,MAAM;MACN,WAAU;KACX,CAAA;KACD,kBAAC,MAAD;MAAI,WAAU;MACX,UAAAhE,EAAG,gCAAgC,iBAAiB;KACnD,CAAA;KACJ,kBAAC,KAAD;MAAG,WAAU;MACV,UAAAA,EACC,kCACA,oEACF;KACC,CAAA;IACA;;GAGNU,KACC,kBAAC,OAAD;IACE,MAAK;IACL,cAAW;IACX,mBAAgB;IAChB,WAAU;IAEV,UAAA,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA;MACE,kBAAC,MAAD;OAAI,IAAG;OAAuB,WAAU;OACrC,UAAAA,MAAkB,WACfV,EAAG,sCAAsC,gBAAgB,IACzDA,EAAG,sCAAsC,gBAAgB;MAC3D,CAAA;MACJ,kBAAC,KAAD;OAAG,WAAU;OACV,UAAAU,MAAkB,WACfV,EACE,4CACA,sEACF,IACAA,EACE,4CACA,yEACF;MACH,CAAA;MACH,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC,UAAD;QACE,MAAK;QACL,eAAeW,EAAiB,IAAI;QACpC,WAAU;QAET,UAAAX,EAAG,8BAA8B,aAAa;OACzC,CAAA,GACR,kBAAC,UAAD;QACE,MAAK;QACL,SAAS2B;QACT,UAAUd,KAAcE;QACxB,WAAU;QAJZ,UAAA,CAMGF,KAAcE,IACb,kBAACsB,GAAD;SAAS,MAAM;SAAI,WAAU;QAAgB,CAAA,IAC3C,MACH3B,MAAkB,WACfV,EAAG,gCAAgC,eAAe,IAClDA,EAAG,gCAAgC,eAAe,CAChD;OACL,CAAA,CAAA;;KACF;;GACF,CAAA;EAEG;;AAEhB"}
|
|
@@ -2,5 +2,4 @@
|
|
|
2
2
|
* Export History Page
|
|
3
3
|
* Table/list of all past exports with filters and cursor-based pagination
|
|
4
4
|
*/
|
|
5
|
-
export declare function ExportHistoryPage(): import(
|
|
6
|
-
//# sourceMappingURL=ExportHistoryPage.d.ts.map
|
|
5
|
+
export declare function ExportHistoryPage(): import('react').JSX.Element;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { useExport as e } from "../providers/ExportProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import { useExportJobs as t } from "../hooks/useExportQueries.js";
|
|
3
|
+
import { useExportStore as n } from "../store/exportStore.js";
|
|
4
|
+
import { ExportStatusBadge as r } from "../components/ExportStatusBadge.js";
|
|
5
|
+
import { PageLayout as ee } from "../components/PageLayout.js";
|
|
6
|
+
import { useTr as i } from "../hooks/useTr.js";
|
|
7
|
+
import { cn as a } from "../utils/cn.js";
|
|
8
|
+
import { getAllStatuses as o, getFormatDisplayName as s, getStatusDisplayName as c } from "../constants/enums.js";
|
|
9
9
|
import { useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
10
10
|
import { AlertCircle as te, ChevronLeft as ne, ChevronRight as p, Clock as m, Download as h, Filter as g, RefreshCw as _, Search as v, X as y } from "lucide-react";
|
|
11
11
|
import { useSearchParams as b } from "react-router";
|
|
12
12
|
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
13
13
|
import { IllustratedEmptyState as w, PagePurpose as T } from "@burdenoff/fe-libs/ui";
|
|
14
|
-
|
|
14
|
+
// src/export/pages/ExportHistoryPage.tsx
|
|
15
15
|
var E = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
|
|
16
16
|
function D() {
|
|
17
|
-
let { basePath: D = "/", navigate: O } = e(), k =
|
|
17
|
+
let { basePath: D = "/", navigate: O } = e(), k = i(), { jobFilter: A, updateFilter: j, resetFilter: M, pagination: N, setPagination: P } = n(), [F] = b(), I = d(!1);
|
|
18
18
|
l(() => {
|
|
19
19
|
if (I.current) return;
|
|
20
20
|
I.current = !0;
|
|
21
21
|
let e = F.get("status");
|
|
22
22
|
e && j({ status: e });
|
|
23
23
|
}, [F, j]);
|
|
24
|
-
let [L, R] = f(!1), [z, B] = f([null]), [V, H] = f(0), U = z[V] ?? null, { data: W, totalCount: G, pageInfo: K, isLoading: q, error: J, refetch: Y } =
|
|
24
|
+
let [L, R] = f(!1), [z, B] = f([null]), [V, H] = f(0), U = z[V] ?? null, { data: W, totalCount: G, pageInfo: K, isLoading: q, error: J, refetch: Y } = t(A, {
|
|
25
25
|
first: N.pageSize,
|
|
26
26
|
after: U ?? void 0
|
|
27
27
|
}), X = u(() => {
|
|
@@ -31,10 +31,12 @@ function D() {
|
|
|
31
31
|
}, [W, A.search]), Z = A.search || A.status !== "all" || A.format !== "all", re = (e) => {
|
|
32
32
|
O?.(E(D, e));
|
|
33
33
|
}, ie = () => {
|
|
34
|
-
!K?.hasNextPage || !K.endCursor
|
|
34
|
+
if (!K?.hasNextPage || !K.endCursor) return;
|
|
35
|
+
let e = [...z.slice(0, V + 1), K.endCursor];
|
|
36
|
+
B(e), H((e) => e + 1), P({
|
|
35
37
|
page: N.page + 1,
|
|
36
38
|
cursor: K.endCursor
|
|
37
|
-
})
|
|
39
|
+
});
|
|
38
40
|
}, ae = () => {
|
|
39
41
|
if (V === 0) return;
|
|
40
42
|
let e = V - 1;
|
|
@@ -44,8 +46,8 @@ function D() {
|
|
|
44
46
|
});
|
|
45
47
|
}, Q = () => {
|
|
46
48
|
M(), B([null]), H(0);
|
|
47
|
-
}, oe = V > 0, $ = K?.hasNextPage ?? !1, se = V * N.pageSize + 1, ce = Math.min((V + 1) * N.pageSize, G), le = (e) => k(`export.shared.status.${e.toLowerCase()}`,
|
|
48
|
-
return /* @__PURE__ */ C(
|
|
49
|
+
}, oe = V > 0, $ = K?.hasNextPage ?? !1, se = V * N.pageSize + 1, ce = Math.min((V + 1) * N.pageSize, G), le = (e) => k(`export.shared.status.${e.toLowerCase()}`, c(e));
|
|
50
|
+
return /* @__PURE__ */ C(ee, {
|
|
49
51
|
title: k("export.history.title", "Export History"),
|
|
50
52
|
subtitle: k("export.history.subtitle", "View and manage all your past export jobs"),
|
|
51
53
|
icon: /* @__PURE__ */ S(m, { size: 24 }),
|
|
@@ -80,7 +82,7 @@ function D() {
|
|
|
80
82
|
}), /* @__PURE__ */ C("button", {
|
|
81
83
|
type: "button",
|
|
82
84
|
onClick: () => R(!L),
|
|
83
|
-
className:
|
|
85
|
+
className: a("inline-flex items-center gap-2 px-4 py-2.5 border-2 rounded-lg transition-all duration-200 font-medium", L || Z ? "bg-action-primary-bg text-action-primary-text border-primary" : "border-border-subtle/50 hover:border-primary/30"),
|
|
84
86
|
children: [/* @__PURE__ */ S(g, { size: 16 }), L ? k("export.history.filters.hide", "Hide") : k("export.history.filters.show", "Filter")]
|
|
85
87
|
})]
|
|
86
88
|
}), L && /* @__PURE__ */ C("div", {
|
|
@@ -113,7 +115,7 @@ function D() {
|
|
|
113
115
|
children: [/* @__PURE__ */ S("option", {
|
|
114
116
|
value: "all",
|
|
115
117
|
children: k("export.history.filters.status.all", "All Statuses")
|
|
116
|
-
}),
|
|
118
|
+
}), o().map((e) => /* @__PURE__ */ S("option", {
|
|
117
119
|
value: e,
|
|
118
120
|
children: le(e)
|
|
119
121
|
}, e))]
|
|
@@ -192,7 +194,7 @@ function D() {
|
|
|
192
194
|
children: X.map((e, t) => /* @__PURE__ */ S("button", {
|
|
193
195
|
type: "button",
|
|
194
196
|
onClick: () => re(e.id),
|
|
195
|
-
className:
|
|
197
|
+
className: a("w-full text-left border border-border-seam rounded-xl p-4 bg-bg-surface", "hover:border-primary/40 transition-colors duration-200", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40", "group animate-in fade-in-0"),
|
|
196
198
|
style: { animationDelay: `${t * 30}ms` },
|
|
197
199
|
children: /* @__PURE__ */ C("div", {
|
|
198
200
|
className: "flex items-start sm:items-center justify-between gap-3",
|
|
@@ -207,13 +209,13 @@ function D() {
|
|
|
207
209
|
e.entityTypes.join(", "),
|
|
208
210
|
" ·",
|
|
209
211
|
" ",
|
|
210
|
-
|
|
212
|
+
s(e.format),
|
|
211
213
|
e.createdAt && ` · ${new Date(e.createdAt).toLocaleDateString()}`
|
|
212
214
|
]
|
|
213
215
|
})]
|
|
214
216
|
}), /* @__PURE__ */ C("div", {
|
|
215
217
|
className: "flex items-center gap-2 flex-shrink-0",
|
|
216
|
-
children: [/* @__PURE__ */ S(
|
|
218
|
+
children: [/* @__PURE__ */ S(r, { status: e.status }), /* @__PURE__ */ S(p, {
|
|
217
219
|
size: 18,
|
|
218
220
|
className: "text-text-secondary group-hover:text-primary transition-colors hidden sm:block"
|
|
219
221
|
})]
|
|
@@ -271,7 +273,6 @@ function D() {
|
|
|
271
273
|
]
|
|
272
274
|
});
|
|
273
275
|
}
|
|
274
|
-
//#endregion
|
|
275
276
|
export { D as ExportHistoryPage };
|
|
276
277
|
|
|
277
278
|
//# sourceMappingURL=ExportHistoryPage.js.map
|