@lumerahq/ui 0.12.0 → 0.13.0-dev.0
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/README.md +16 -5
- package/dist/{RecordSheet-BuB-d3iw.js → RecordSheet-BwslIDfX.js} +360 -294
- package/dist/{automations-EgDXJ43_.js → automations-D4tZC_G7.js} +162 -1
- package/dist/components/audit-log/AuditLog.d.ts +3 -3
- package/dist/components/audit-log/AuditLog.d.ts.map +1 -1
- package/dist/components/audit-log/AuditLogEntry.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{highlighted-body-OFNGDK62-DkOFnnd1.js → highlighted-body-OFNGDK62-ClrpL6m7.js} +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/index.js +11 -4
- package/dist/lib/audit-log-core.d.ts +12 -0
- package/dist/lib/audit-log-core.d.ts.map +1 -1
- package/dist/lib/audit-log.d.ts +1 -1
- package/dist/lib/audit-log.d.ts.map +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +8 -1
- package/dist/mermaid-GHXKKRXX-B_NhCUBg.js +4 -0
- package/dist/{use-automation-run-B2iPUXiG.js → use-automation-run-BHa7eyZU.js} +1 -142
- package/dist/{use-sql-table-DWHMqSIq.js → use-sql-table-CkRTvZmH.js} +1 -1
- package/package.json +1 -1
- package/dist/mermaid-GHXKKRXX-Dcx-81a_.js +0 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import React__default, { useContext, createContext, forwardRef, createElement, memo, useId as useId$1, useTransition, useMemo, useRef, useEffect, useState, cloneElement, isValidElement, useCallback, Suspense, lazy, Fragment as Fragment$1, useLayoutEffect } from "react";
|
|
4
|
-
import { u as useAgentChat, a as useAgentChatSessions,
|
|
4
|
+
import { u as useAgentChat, a as useAgentChatSessions, b as useAuditLog, c as useAutomationRun } from "./use-automation-run-BHa7eyZU.js";
|
|
5
5
|
import { t as twMerge, p as clsx, o as cn$2, a as formatCellValue$2 } from "./formatters-D4T821Dv.js";
|
|
6
|
-
import { f as getDownloadUrl, t as pbSql, p as parentApiRequest, d as parentApiStream, B as BridgeError, z as automationStatuses, L as getAutomationRunFileDownloadUrl, R as listAutomationRunFiles } from "./automations-
|
|
6
|
+
import { f as getDownloadUrl, t as pbSql, p as parentApiRequest, d as parentApiStream, B as BridgeError, a0 as getRecordAuditLogSnapshot, a4 as auditLogSummaryWithCollectionLabel, a5 as auditLogDetailValue, Z as auditLogActorLabel, a2 as normalizeRecordAuditCollections, a6 as normalizeAuditLogFilterState, Y as AUDIT_LOG_MAX_COLLECTIONS, _ as auditLogRequestedCollectionName, $ as fetchRecordAuditLogCsv, a7 as normalizeAuditLogExportLimit, z as automationStatuses, L as getAutomationRunFileDownloadUrl, R as listAutomationRunFiles } from "./automations-D4tZC_G7.js";
|
|
7
7
|
import * as ReactDOM from "react-dom";
|
|
8
8
|
import { createPortal } from "react-dom";
|
|
9
9
|
import { useQuery } from "@tanstack/react-query";
|
|
@@ -24050,7 +24050,7 @@ var lr = (e) => {
|
|
|
24050
24050
|
for (; t > 0 && e[t - 1] === `
|
|
24051
24051
|
`; ) t--;
|
|
24052
24052
|
return e.slice(0, t);
|
|
24053
|
-
}, cr = lazy(() => import("./highlighted-body-OFNGDK62-
|
|
24053
|
+
}, cr = lazy(() => import("./highlighted-body-OFNGDK62-ClrpL6m7.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), st = ({ code: e, language: t, className: o, children: n, isIncomplete: r = false, startLine: s2, lineNumbers: a, ...l }) => {
|
|
24054
24054
|
let i = y2(), d2 = useMemo(() => lr(e), [e]), c2 = useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: d2.split(`
|
|
24055
24055
|
`).map((p2) => [{ content: p2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [d2]);
|
|
24056
24056
|
return jsx(nt.Provider, { value: { code: e }, children: jsxs(ot, { isIncomplete: r, language: t, children: [jsx(rt, { language: t }), n ? jsx("div", { className: i("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"), children: jsx("div", { className: i("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"), "data-streamdown": "code-block-actions", children: n }) }) : null, jsx(Suspense, { fallback: jsx(At, { className: o, language: t, lineNumbers: a, result: c2, startLine: s2, ...l }), children: jsx(cr, { className: o, code: d2, language: t, lineNumbers: a, raw: c2, startLine: s2, ...l }) })] }) });
|
|
@@ -24412,7 +24412,7 @@ var vo = ({ children: e, className: t, showControls: o, showCopy: n = true, show
|
|
|
24412
24412
|
let l = y2(), i = o && n, d2 = o && r, c2 = o && s2, p2 = i || d2 || c2;
|
|
24413
24413
|
return jsxs("div", { className: l("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"), "data-streamdown": "table-wrapper", children: [p2 ? jsxs("div", { className: l("flex items-center justify-end gap-1"), children: [i ? jsx(Te, {}) : null, d2 ? jsx(Pe, {}) : null, c2 ? jsx(Co, { showCopy: i, showDownload: d2, children: e }) : null] }) : null, jsx("div", { className: l("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"), children: jsx("table", { className: l("w-full divide-y divide-border", t), "data-streamdown": "table", ...a, children: e }) })] });
|
|
24414
24414
|
};
|
|
24415
|
-
var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-
|
|
24415
|
+
var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-B_NhCUBg.js").then((e) => ({ default: e.Mermaid }))), ns = /language-([^\s]+)/;
|
|
24416
24416
|
function qe(e, t) {
|
|
24417
24417
|
if (!(e != null && e.position || t != null && t.position)) return true;
|
|
24418
24418
|
if (!(e != null && e.position && (t != null && t.position))) return false;
|
|
@@ -29674,7 +29674,7 @@ function AuditLogEntry({
|
|
|
29674
29674
|
"Open record"
|
|
29675
29675
|
] }) : null;
|
|
29676
29676
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
29677
|
-
/* @__PURE__ */ jsxs(TableRow, { "aria-expanded": expanded, children: [
|
|
29677
|
+
/* @__PURE__ */ jsxs(TableRow, { "data-audit-log-entry": entry.id, "aria-expanded": expanded, children: [
|
|
29678
29678
|
/* @__PURE__ */ jsx(TableCell, { className: cn$2("text-xs text-muted-foreground", rowPadding), children: /* @__PURE__ */ jsx("time", { dateTime: entry.occurred_at, title: new Date(entry.occurred_at).toLocaleString(), children: relativeTime(entry.occurred_at) }) }),
|
|
29679
29679
|
showCollectionColumn ? /* @__PURE__ */ jsx(
|
|
29680
29680
|
TableCell,
|
|
@@ -29697,6 +29697,7 @@ function AuditLogEntry({
|
|
|
29697
29697
|
/* @__PURE__ */ jsx(
|
|
29698
29698
|
Button2,
|
|
29699
29699
|
{
|
|
29700
|
+
"data-audit-log-control": "details",
|
|
29700
29701
|
type: "button",
|
|
29701
29702
|
variant: "ghost",
|
|
29702
29703
|
size: "icon-sm",
|
|
@@ -29709,7 +29710,7 @@ function AuditLogEntry({
|
|
|
29709
29710
|
)
|
|
29710
29711
|
] }) })
|
|
29711
29712
|
] }),
|
|
29712
|
-
expanded ? /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsxs(
|
|
29713
|
+
expanded ? /* @__PURE__ */ jsx(TableRow, { "data-audit-log-details": entry.id, className: "hover:bg-transparent", children: /* @__PURE__ */ jsxs(
|
|
29713
29714
|
TableCell,
|
|
29714
29715
|
{
|
|
29715
29716
|
id: detailsID,
|
|
@@ -29717,7 +29718,7 @@ function AuditLogEntry({
|
|
|
29717
29718
|
className: cn$2("bg-muted/20 whitespace-normal", density === "comfortable" ? "p-5" : "p-4"),
|
|
29718
29719
|
children: [
|
|
29719
29720
|
detailFields.length > 0 ? /* @__PURE__ */ jsx(FieldGroups, { fields: detailFields }) : null,
|
|
29720
|
-
entry.has_snapshot ? /* @__PURE__ */ jsxs("div", { className: cn$2(detailFields.length > 0 && "mt-4 border-t pt-4"), children: [
|
|
29721
|
+
entry.has_snapshot ? /* @__PURE__ */ jsxs("div", { "data-audit-log-state": "snapshot", className: cn$2(detailFields.length > 0 && "mt-4 border-t pt-4"), children: [
|
|
29721
29722
|
/* @__PURE__ */ jsx("p", { className: "mb-3 text-sm font-medium", children: "Before and after" }),
|
|
29722
29723
|
snapshotQuery.isLoading ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 py-4 text-sm text-muted-foreground", children: [
|
|
29723
29724
|
/* @__PURE__ */ jsx(LoaderCircle, { className: "size-4 animate-spin" }),
|
|
@@ -42307,9 +42308,16 @@ function AuditLog({
|
|
|
42307
42308
|
const configurationError = availableCollections.length === 0 ? "Add at least one collection to the component." : availableCollections.length > AUDIT_LOG_MAX_COLLECTIONS ? `Choose no more than ${AUDIT_LOG_MAX_COLLECTIONS} collections.` : "";
|
|
42308
42309
|
const auditLog = useAuditLog(selectedCollections, requestFilters, { pageSize, enabled: !configurationError });
|
|
42309
42310
|
const columnCount = 3 + Number(showCollectionColumn) + Number(showActorColumn);
|
|
42310
|
-
const
|
|
42311
|
-
const
|
|
42312
|
-
|
|
42311
|
+
const configuredNameForCollection = (collection) => auditLogRequestedCollectionName(collection, auditLog.collectionStatus);
|
|
42312
|
+
const labelForCollection = (collection) => {
|
|
42313
|
+
const configuredName = configuredNameForCollection(collection);
|
|
42314
|
+
return collectionLabels?.[collection]?.trim() || collectionLabels?.[configuredName]?.trim() || configuredName;
|
|
42315
|
+
};
|
|
42316
|
+
const activityLabelForCollection = (collection) => {
|
|
42317
|
+
const configuredName = configuredNameForCollection(collection);
|
|
42318
|
+
return activityNouns?.[collection]?.trim() || activityNouns?.[configuredName]?.trim() || collectionLabels?.[collection]?.trim() || collectionLabels?.[configuredName]?.trim();
|
|
42319
|
+
};
|
|
42320
|
+
const currentActorOptions = useMemo(() => {
|
|
42313
42321
|
const actors = /* @__PURE__ */ new Map();
|
|
42314
42322
|
for (const entry of auditLog.entries) {
|
|
42315
42323
|
const actorID2 = entry.actor.id?.trim();
|
|
@@ -42319,12 +42327,21 @@ function AuditLog({
|
|
|
42319
42327
|
([, left], [, right]) => auditLogActorLabel(left).localeCompare(auditLogActorLabel(right))
|
|
42320
42328
|
);
|
|
42321
42329
|
}, [auditLog.entries]);
|
|
42330
|
+
const selectedActorCache = useRef(null);
|
|
42331
|
+
const currentSelectedActor = currentActorOptions.find(([actorID2]) => actorID2 === actor)?.[1];
|
|
42332
|
+
useEffect(() => {
|
|
42333
|
+
if (actor === "all") selectedActorCache.current = null;
|
|
42334
|
+
else if (currentSelectedActor) selectedActorCache.current = { id: actor, actor: currentSelectedActor };
|
|
42335
|
+
}, [actor, currentSelectedActor]);
|
|
42336
|
+
const selectedActor = currentSelectedActor ?? (selectedActorCache.current?.id === actor ? selectedActorCache.current.actor : void 0);
|
|
42337
|
+
const actorOptions = actor !== "all" && selectedActor && !currentSelectedActor ? [...currentActorOptions, [actor, selectedActor]].sort(
|
|
42338
|
+
([, left], [, right]) => auditLogActorLabel(left).localeCompare(auditLogActorLabel(right))
|
|
42339
|
+
) : currentActorOptions;
|
|
42322
42340
|
const hasFilters = selectedCollections.length !== availableCollections.length || Boolean(filterState.event || filterState.actor || filterState.since || filterState.until);
|
|
42323
42341
|
const hasDateFilter = Boolean(filterState.since || filterState.until);
|
|
42324
42342
|
const status = auditLog.error?.status;
|
|
42325
42343
|
const errorCopy = errorCopyFor(status);
|
|
42326
42344
|
const exportStatusForFilters = exportStatus.key === filterKey && exportStatus.message ? exportStatus : null;
|
|
42327
|
-
const selectedActor = actorOptions.find(([actorID2]) => actorID2 === actor)?.[1];
|
|
42328
42345
|
const selectedActorLabel = actor === "all" ? "All actors" : selectedActor ? auditLogActorLabel(selectedActor) : "Selected actor";
|
|
42329
42346
|
const disabledCollections = auditLog.collectionStatus.filter((collection) => !collection.audit_enabled).map((collection) => labelForCollection(collection.name));
|
|
42330
42347
|
const collectionSelectionLabel = selectedCollections.length === availableCollections.length ? "All collections" : selectedCollections.length === 1 ? labelForCollection(selectedCollections[0]) : `${selectedCollections.length} collections`;
|
|
@@ -42424,309 +42441,358 @@ function AuditLog({
|
|
|
42424
42441
|
setIsExporting(false);
|
|
42425
42442
|
}
|
|
42426
42443
|
};
|
|
42427
|
-
return /* @__PURE__ */ jsxs(
|
|
42428
|
-
|
|
42429
|
-
|
|
42430
|
-
|
|
42431
|
-
|
|
42432
|
-
|
|
42433
|
-
|
|
42434
|
-
|
|
42435
|
-
|
|
42436
|
-
|
|
42437
|
-
|
|
42438
|
-
|
|
42439
|
-
|
|
42440
|
-
|
|
42441
|
-
|
|
42442
|
-
|
|
42443
|
-
|
|
42444
|
-
|
|
42445
|
-
|
|
42446
|
-
|
|
42447
|
-
|
|
42448
|
-
|
|
42444
|
+
return /* @__PURE__ */ jsxs(
|
|
42445
|
+
"section",
|
|
42446
|
+
{
|
|
42447
|
+
"data-audit-log": "root",
|
|
42448
|
+
className: cn$2("overflow-hidden rounded-2xl border bg-card text-card-foreground", className),
|
|
42449
|
+
children: [
|
|
42450
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3 border-b px-5 py-4", children: [
|
|
42451
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
42452
|
+
/* @__PURE__ */ jsx("h2", { className: "font-semibold", children: title }),
|
|
42453
|
+
/* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: "Record changes across your selected collections" })
|
|
42454
|
+
] }),
|
|
42455
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
42456
|
+
/* @__PURE__ */ jsx(
|
|
42457
|
+
Button2,
|
|
42458
|
+
{
|
|
42459
|
+
"data-audit-log-control": "refresh",
|
|
42460
|
+
type: "button",
|
|
42461
|
+
variant: "ghost",
|
|
42462
|
+
size: "icon-sm",
|
|
42463
|
+
"aria-label": "Refresh activity",
|
|
42464
|
+
title: "Refresh activity",
|
|
42465
|
+
disabled: auditLog.isFetching || Boolean(configurationError),
|
|
42466
|
+
onClick: () => void auditLog.refresh(),
|
|
42467
|
+
children: /* @__PURE__ */ jsx(RefreshCw, { className: cn$2(auditLog.isFetching && "animate-spin") })
|
|
42468
|
+
}
|
|
42469
|
+
),
|
|
42470
|
+
/* @__PURE__ */ jsxs(
|
|
42471
|
+
Button2,
|
|
42472
|
+
{
|
|
42473
|
+
"data-audit-log-control": "export",
|
|
42474
|
+
type: "button",
|
|
42475
|
+
variant: "outline",
|
|
42476
|
+
size: "sm",
|
|
42477
|
+
disabled: isExporting || auditLog.entries.length === 0,
|
|
42478
|
+
onClick: () => void handleExport(),
|
|
42479
|
+
children: [
|
|
42480
|
+
isExporting ? /* @__PURE__ */ jsx(LoaderCircle, { className: "animate-spin" }) : /* @__PURE__ */ jsx(Download, {}),
|
|
42481
|
+
"Export CSV"
|
|
42482
|
+
]
|
|
42483
|
+
}
|
|
42484
|
+
)
|
|
42485
|
+
] })
|
|
42486
|
+
] }),
|
|
42487
|
+
exportStatusForFilters ? /* @__PURE__ */ jsxs(
|
|
42488
|
+
"div",
|
|
42449
42489
|
{
|
|
42450
|
-
|
|
42451
|
-
|
|
42452
|
-
|
|
42453
|
-
|
|
42454
|
-
|
|
42490
|
+
className: cn$2(
|
|
42491
|
+
"flex gap-2 border-b px-5 py-2.5 text-xs",
|
|
42492
|
+
exportStatusForFilters.tone === "success" ? "bg-emerald-50 text-emerald-950" : "bg-rose-50 text-rose-950"
|
|
42493
|
+
),
|
|
42494
|
+
role: "status",
|
|
42495
|
+
"aria-live": "polite",
|
|
42455
42496
|
children: [
|
|
42456
|
-
|
|
42457
|
-
"
|
|
42497
|
+
exportStatusForFilters.tone === "success" ? /* @__PURE__ */ jsx(CircleCheck, { className: "mt-0.5 size-4 shrink-0" }) : /* @__PURE__ */ jsx(CircleAlert, { className: "mt-0.5 size-4 shrink-0" }),
|
|
42498
|
+
/* @__PURE__ */ jsx("p", { children: exportStatusForFilters.message })
|
|
42458
42499
|
]
|
|
42459
42500
|
}
|
|
42460
|
-
)
|
|
42461
|
-
|
|
42462
|
-
|
|
42463
|
-
|
|
42464
|
-
|
|
42465
|
-
|
|
42466
|
-
|
|
42467
|
-
|
|
42468
|
-
|
|
42469
|
-
|
|
42470
|
-
|
|
42471
|
-
|
|
42472
|
-
|
|
42473
|
-
|
|
42474
|
-
|
|
42475
|
-
|
|
42476
|
-
|
|
42477
|
-
|
|
42478
|
-
|
|
42479
|
-
|
|
42480
|
-
|
|
42481
|
-
|
|
42482
|
-
|
|
42483
|
-
|
|
42484
|
-
|
|
42485
|
-
|
|
42486
|
-
|
|
42487
|
-
|
|
42488
|
-
|
|
42489
|
-
|
|
42490
|
-
|
|
42491
|
-
|
|
42492
|
-
|
|
42493
|
-
|
|
42494
|
-
|
|
42495
|
-
|
|
42496
|
-
|
|
42497
|
-
|
|
42498
|
-
|
|
42499
|
-
|
|
42500
|
-
checked,
|
|
42501
|
-
disabled: checked && selectedCollections.length === 1,
|
|
42502
|
-
onCheckedChange: (value) => toggleCollection(collection, value === true),
|
|
42503
|
-
children: /* @__PURE__ */ jsx("span", { className: "truncate", title: collection, children: labelForCollection(collection) })
|
|
42504
|
-
},
|
|
42505
|
-
collection
|
|
42506
|
-
);
|
|
42507
|
-
})
|
|
42508
|
-
] }),
|
|
42509
|
-
hasFilters ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42510
|
-
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
42511
|
-
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: resetFilters, children: [
|
|
42512
|
-
/* @__PURE__ */ jsx(FunnelX, {}),
|
|
42513
|
-
"Reset filters"
|
|
42501
|
+
) : null,
|
|
42502
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-end gap-2 border-b bg-muted/20 px-5 py-3", children: [
|
|
42503
|
+
availableCollections.length > 1 ? /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
42504
|
+
/* @__PURE__ */ jsx(Label, { className: "text-xs text-muted-foreground", children: "Collections" }),
|
|
42505
|
+
/* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
42506
|
+
/* @__PURE__ */ jsxs(
|
|
42507
|
+
DropdownMenuTrigger,
|
|
42508
|
+
{
|
|
42509
|
+
"data-audit-log-control": "collections",
|
|
42510
|
+
render: /* @__PURE__ */ jsx(Button2, { type: "button", variant: "outline", size: "sm", className: "w-[11rem] justify-start" }),
|
|
42511
|
+
children: [
|
|
42512
|
+
/* @__PURE__ */ jsx(ListFilter, {}),
|
|
42513
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: collectionSelectionLabel })
|
|
42514
|
+
]
|
|
42515
|
+
}
|
|
42516
|
+
),
|
|
42517
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", className: "w-64", children: [
|
|
42518
|
+
/* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
|
|
42519
|
+
/* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Select collections" }),
|
|
42520
|
+
availableCollections.map((collection) => {
|
|
42521
|
+
const checked = selectedCollections.includes(collection);
|
|
42522
|
+
return /* @__PURE__ */ jsx(
|
|
42523
|
+
DropdownMenuCheckboxItem,
|
|
42524
|
+
{
|
|
42525
|
+
checked,
|
|
42526
|
+
disabled: checked && selectedCollections.length === 1,
|
|
42527
|
+
onCheckedChange: (value) => toggleCollection(collection, value === true),
|
|
42528
|
+
children: /* @__PURE__ */ jsx("span", { className: "truncate", title: collection, children: labelForCollection(collection) })
|
|
42529
|
+
},
|
|
42530
|
+
collection
|
|
42531
|
+
);
|
|
42532
|
+
})
|
|
42533
|
+
] }),
|
|
42534
|
+
hasFilters ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42535
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
42536
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: resetFilters, children: [
|
|
42537
|
+
/* @__PURE__ */ jsx(FunnelX, {}),
|
|
42538
|
+
"Reset filters"
|
|
42539
|
+
] })
|
|
42540
|
+
] }) : null
|
|
42514
42541
|
] })
|
|
42515
|
-
] })
|
|
42516
|
-
] })
|
|
42517
|
-
|
|
42518
|
-
|
|
42519
|
-
|
|
42520
|
-
|
|
42521
|
-
|
|
42522
|
-
|
|
42523
|
-
|
|
42524
|
-
|
|
42525
|
-
|
|
42526
|
-
|
|
42527
|
-
|
|
42528
|
-
|
|
42529
|
-
|
|
42530
|
-
|
|
42531
|
-
|
|
42532
|
-
|
|
42533
|
-
|
|
42534
|
-
|
|
42535
|
-
|
|
42536
|
-
|
|
42537
|
-
|
|
42538
|
-
|
|
42539
|
-
|
|
42540
|
-
|
|
42541
|
-
|
|
42542
|
-
|
|
42543
|
-
|
|
42544
|
-
|
|
42545
|
-
|
|
42546
|
-
|
|
42547
|
-
|
|
42548
|
-
|
|
42549
|
-
|
|
42550
|
-
|
|
42551
|
-
|
|
42552
|
-
|
|
42553
|
-
|
|
42554
|
-
|
|
42555
|
-
|
|
42542
|
+
] })
|
|
42543
|
+
] }) : null,
|
|
42544
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
42545
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: fromID, className: "text-xs text-muted-foreground", children: "From" }),
|
|
42546
|
+
/* @__PURE__ */ jsx(
|
|
42547
|
+
Input2,
|
|
42548
|
+
{
|
|
42549
|
+
"data-audit-log-control": "from",
|
|
42550
|
+
id: fromID,
|
|
42551
|
+
"aria-label": "From date and time in your local timezone",
|
|
42552
|
+
type: "datetime-local",
|
|
42553
|
+
step: "60",
|
|
42554
|
+
value: fromDateTime,
|
|
42555
|
+
max: untilDateTime || void 0,
|
|
42556
|
+
className: "h-8 w-[12rem] text-xs",
|
|
42557
|
+
onChange: (inputEvent) => setFilters({ ...filterState, since: dateTimeBoundary(inputEvent.target.value) })
|
|
42558
|
+
}
|
|
42559
|
+
)
|
|
42560
|
+
] }),
|
|
42561
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
42562
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: untilID, className: "text-xs text-muted-foreground", children: "Until" }),
|
|
42563
|
+
/* @__PURE__ */ jsx(
|
|
42564
|
+
Input2,
|
|
42565
|
+
{
|
|
42566
|
+
"data-audit-log-control": "until",
|
|
42567
|
+
id: untilID,
|
|
42568
|
+
"aria-label": "Until date and time in your local timezone",
|
|
42569
|
+
type: "datetime-local",
|
|
42570
|
+
step: "60",
|
|
42571
|
+
value: untilDateTime,
|
|
42572
|
+
min: fromDateTime || void 0,
|
|
42573
|
+
className: "h-8 w-[12rem] text-xs",
|
|
42574
|
+
onChange: (inputEvent) => setFilters({ ...filterState, until: dateTimeBoundary(inputEvent.target.value) })
|
|
42575
|
+
}
|
|
42576
|
+
)
|
|
42577
|
+
] }),
|
|
42578
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
42579
|
+
/* @__PURE__ */ jsx(Label, { className: "text-xs text-muted-foreground", children: "Date presets" }),
|
|
42580
|
+
/* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
42581
|
+
/* @__PURE__ */ jsxs(
|
|
42582
|
+
DropdownMenuTrigger,
|
|
42583
|
+
{
|
|
42584
|
+
"data-audit-log-control": "date-presets",
|
|
42585
|
+
render: /* @__PURE__ */ jsx(Button2, { type: "button", variant: "outline", size: "sm", className: "w-[10rem] justify-start" }),
|
|
42586
|
+
children: [
|
|
42587
|
+
/* @__PURE__ */ jsx(CalendarClock, {}),
|
|
42588
|
+
"Quick range"
|
|
42589
|
+
]
|
|
42590
|
+
}
|
|
42591
|
+
),
|
|
42592
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", children: [
|
|
42593
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("last-24-hours"), children: "Last 24 hours" }),
|
|
42594
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("last-7-days"), children: "Last 7 days" }),
|
|
42595
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("today"), children: "Today" }),
|
|
42596
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
42597
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("clear"), children: "Clear date range" })
|
|
42598
|
+
] })
|
|
42599
|
+
] })
|
|
42600
|
+
] }),
|
|
42601
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
42602
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: eventID, className: "text-xs text-muted-foreground", children: "Event" }),
|
|
42603
|
+
/* @__PURE__ */ jsxs(
|
|
42604
|
+
Select,
|
|
42605
|
+
{
|
|
42606
|
+
value: event,
|
|
42607
|
+
onValueChange: (value) => value && setFilters({ ...filterState, event: value === "all" ? void 0 : value }),
|
|
42608
|
+
children: [
|
|
42609
|
+
/* @__PURE__ */ jsx(
|
|
42610
|
+
SelectTrigger2,
|
|
42611
|
+
{
|
|
42612
|
+
id: eventID,
|
|
42613
|
+
"data-audit-log-control": "event",
|
|
42614
|
+
size: "sm",
|
|
42615
|
+
className: "w-[8.5rem] rounded-lg border-border bg-background",
|
|
42616
|
+
children: /* @__PURE__ */ jsx(SelectValue2, { children: event === "all" ? "All events" : `${event[0].toUpperCase()}${event.slice(1)}` })
|
|
42617
|
+
}
|
|
42618
|
+
),
|
|
42619
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
42620
|
+
/* @__PURE__ */ jsx(SelectItem2, { value: "all", children: "All events" }),
|
|
42621
|
+
/* @__PURE__ */ jsx(SelectItem2, { value: "created", children: "Created" }),
|
|
42622
|
+
/* @__PURE__ */ jsx(SelectItem2, { value: "updated", children: "Updated" }),
|
|
42623
|
+
/* @__PURE__ */ jsx(SelectItem2, { value: "deleted", children: "Deleted" })
|
|
42624
|
+
] })
|
|
42625
|
+
]
|
|
42626
|
+
}
|
|
42627
|
+
)
|
|
42628
|
+
] }),
|
|
42629
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
42630
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: actorID, className: "text-xs text-muted-foreground", children: "Actor" }),
|
|
42631
|
+
/* @__PURE__ */ jsxs(
|
|
42632
|
+
Select,
|
|
42633
|
+
{
|
|
42634
|
+
value: actor,
|
|
42635
|
+
onValueChange: (value) => value && setFilters({ ...filterState, actor: value === "all" ? void 0 : value }),
|
|
42636
|
+
children: [
|
|
42637
|
+
/* @__PURE__ */ jsx(
|
|
42638
|
+
SelectTrigger2,
|
|
42639
|
+
{
|
|
42640
|
+
id: actorID,
|
|
42641
|
+
"data-audit-log-control": "actor",
|
|
42642
|
+
size: "sm",
|
|
42643
|
+
className: "w-[11rem] rounded-lg border-border bg-background",
|
|
42644
|
+
children: /* @__PURE__ */ jsx(SelectValue2, { children: selectedActorLabel })
|
|
42645
|
+
}
|
|
42646
|
+
),
|
|
42647
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
42648
|
+
/* @__PURE__ */ jsx(SelectItem2, { value: "all", children: "All actors" }),
|
|
42649
|
+
actorOptions.map(([actorID2, option]) => /* @__PURE__ */ jsx(SelectItem2, { value: actorID2, children: auditLogActorLabel(option) }, actorID2))
|
|
42650
|
+
] })
|
|
42651
|
+
]
|
|
42652
|
+
}
|
|
42653
|
+
)
|
|
42654
|
+
] }),
|
|
42655
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 text-[11px] text-muted-foreground", children: "Dates use local time" }),
|
|
42656
|
+
hasFilters ? /* @__PURE__ */ jsxs(
|
|
42657
|
+
Button2,
|
|
42556
42658
|
{
|
|
42557
|
-
|
|
42659
|
+
"data-audit-log-control": "reset",
|
|
42660
|
+
type: "button",
|
|
42661
|
+
variant: "ghost",
|
|
42662
|
+
size: "sm",
|
|
42663
|
+
className: "mb-px",
|
|
42664
|
+
onPointerDown: resetFiltersFromPointer,
|
|
42665
|
+
onClick: resetFilters,
|
|
42558
42666
|
children: [
|
|
42559
|
-
/* @__PURE__ */ jsx(
|
|
42560
|
-
"
|
|
42667
|
+
/* @__PURE__ */ jsx(FunnelX, {}),
|
|
42668
|
+
" Reset filters"
|
|
42561
42669
|
]
|
|
42562
42670
|
}
|
|
42563
|
-
)
|
|
42564
|
-
|
|
42565
|
-
|
|
42566
|
-
|
|
42567
|
-
/* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("today"), children: "Today" }),
|
|
42568
|
-
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
42569
|
-
/* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("clear"), children: "Clear date range" })
|
|
42570
|
-
] })
|
|
42571
|
-
] })
|
|
42572
|
-
] }),
|
|
42573
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
42574
|
-
/* @__PURE__ */ jsx(Label, { htmlFor: eventID, className: "text-xs text-muted-foreground", children: "Event" }),
|
|
42575
|
-
/* @__PURE__ */ jsxs(
|
|
42576
|
-
Select,
|
|
42671
|
+
) : null
|
|
42672
|
+
] }),
|
|
42673
|
+
filterChips.length > 0 ? /* @__PURE__ */ jsxs(
|
|
42674
|
+
"div",
|
|
42577
42675
|
{
|
|
42578
|
-
|
|
42579
|
-
|
|
42676
|
+
"data-audit-log-state": "active-filters",
|
|
42677
|
+
className: "flex flex-wrap items-center gap-2 border-b bg-muted/10 px-5 py-2 text-xs",
|
|
42580
42678
|
children: [
|
|
42581
|
-
/* @__PURE__ */ jsx(
|
|
42582
|
-
/* @__PURE__ */ jsxs(
|
|
42583
|
-
|
|
42584
|
-
|
|
42585
|
-
|
|
42586
|
-
|
|
42587
|
-
|
|
42679
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-muted-foreground", children: "Active filters" }),
|
|
42680
|
+
filterChips.map((chip) => /* @__PURE__ */ jsxs(
|
|
42681
|
+
"span",
|
|
42682
|
+
{
|
|
42683
|
+
"data-audit-log-filter": chip.key,
|
|
42684
|
+
className: "inline-flex h-6 max-w-full items-center gap-1 rounded-full border bg-background px-2 text-foreground",
|
|
42685
|
+
children: [
|
|
42686
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: chip.label }),
|
|
42687
|
+
/* @__PURE__ */ jsx(
|
|
42688
|
+
"button",
|
|
42689
|
+
{
|
|
42690
|
+
type: "button",
|
|
42691
|
+
className: "rounded-full text-muted-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:outline-none",
|
|
42692
|
+
"aria-label": `Clear ${chip.label}`,
|
|
42693
|
+
onClick: chip.onClear,
|
|
42694
|
+
children: /* @__PURE__ */ jsx(X$2, { className: "size-3" })
|
|
42695
|
+
}
|
|
42696
|
+
)
|
|
42697
|
+
]
|
|
42698
|
+
},
|
|
42699
|
+
chip.key
|
|
42700
|
+
))
|
|
42588
42701
|
]
|
|
42589
42702
|
}
|
|
42590
|
-
)
|
|
42591
|
-
|
|
42592
|
-
|
|
42593
|
-
/* @__PURE__ */ jsx(Label, { htmlFor: actorID, className: "text-xs text-muted-foreground", children: "Actor" }),
|
|
42594
|
-
/* @__PURE__ */ jsxs(
|
|
42595
|
-
Select,
|
|
42703
|
+
) : null,
|
|
42704
|
+
disabledCollections.length > 0 && !auditLog.error ? /* @__PURE__ */ jsxs(
|
|
42705
|
+
"div",
|
|
42596
42706
|
{
|
|
42597
|
-
|
|
42598
|
-
|
|
42707
|
+
"data-audit-log-state": "audit-disabled",
|
|
42708
|
+
className: "flex gap-2 border-b bg-amber-50 px-5 py-2.5 text-xs text-amber-950",
|
|
42709
|
+
role: "status",
|
|
42599
42710
|
children: [
|
|
42600
|
-
/* @__PURE__ */ jsx(
|
|
42601
|
-
/* @__PURE__ */ jsxs(
|
|
42602
|
-
|
|
42603
|
-
|
|
42711
|
+
/* @__PURE__ */ jsx(CircleAlert, { className: "mt-0.5 size-4 shrink-0" }),
|
|
42712
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
42713
|
+
"Auditing is off for ",
|
|
42714
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: disabledCollections.join(", ") }),
|
|
42715
|
+
". Existing history is still visible, but new changes will not be recorded."
|
|
42604
42716
|
] })
|
|
42605
42717
|
]
|
|
42606
42718
|
}
|
|
42607
|
-
)
|
|
42608
|
-
|
|
42609
|
-
|
|
42610
|
-
|
|
42611
|
-
|
|
42612
|
-
|
|
42613
|
-
|
|
42614
|
-
|
|
42615
|
-
|
|
42616
|
-
className: "
|
|
42617
|
-
|
|
42618
|
-
|
|
42619
|
-
|
|
42620
|
-
/* @__PURE__ */ jsx(
|
|
42621
|
-
|
|
42622
|
-
]
|
|
42623
|
-
|
|
42624
|
-
|
|
42625
|
-
|
|
42626
|
-
|
|
42627
|
-
|
|
42628
|
-
|
|
42629
|
-
|
|
42630
|
-
|
|
42631
|
-
|
|
42632
|
-
|
|
42633
|
-
|
|
42634
|
-
|
|
42635
|
-
|
|
42719
|
+
) : null,
|
|
42720
|
+
/* @__PURE__ */ jsxs(Table, { children: [
|
|
42721
|
+
/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { className: "hover:bg-transparent", children: [
|
|
42722
|
+
/* @__PURE__ */ jsx(TableHead, { className: "w-32 text-xs text-muted-foreground", children: "Time" }),
|
|
42723
|
+
showCollectionColumn ? /* @__PURE__ */ jsx(TableHead, { className: "w-48 text-xs text-muted-foreground", children: "Collection" }) : null,
|
|
42724
|
+
/* @__PURE__ */ jsx(TableHead, { className: "text-xs text-muted-foreground", children: "Activity" }),
|
|
42725
|
+
showActorColumn ? /* @__PURE__ */ jsx(TableHead, { className: "w-48 text-xs text-muted-foreground", children: "Actor" }) : null,
|
|
42726
|
+
/* @__PURE__ */ jsx(TableHead, { className: getRecordHref || onRecordClick ? "w-36" : "w-12", children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Actions" }) })
|
|
42727
|
+
] }) }),
|
|
42728
|
+
/* @__PURE__ */ jsx(TableBody, { children: auditLog.isLoading ? loadingState !== void 0 ? /* @__PURE__ */ jsx(TableRow, { "data-audit-log-state": "loading", className: "hover:bg-transparent", children: /* @__PURE__ */ jsx(TableCell, { colSpan: columnCount, className: "h-48 whitespace-normal text-center", children: loadingState }) }) : [0, 1, 2].map((item) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
42729
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-20" }) }),
|
|
42730
|
+
showCollectionColumn ? /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-28" }) }) : null,
|
|
42731
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-2/3" }) }),
|
|
42732
|
+
showActorColumn ? /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" }) }) : null,
|
|
42733
|
+
/* @__PURE__ */ jsx(TableCell, {})
|
|
42734
|
+
] }, item)) : configurationError || auditLog.error ? /* @__PURE__ */ jsx(TableRow, { "data-audit-log-state": "error", className: "hover:bg-transparent", children: /* @__PURE__ */ jsx(TableCell, { colSpan: columnCount, className: "h-48 whitespace-normal text-center", children: auditLog.error && errorState ? errorState(auditLog.error) : defaultState(
|
|
42735
|
+
/* @__PURE__ */ jsx(History, { className: "mx-auto mb-3 size-8 text-muted-foreground/60" }),
|
|
42736
|
+
configurationError ? "Audit log is not configured" : errorCopy.title,
|
|
42737
|
+
configurationError || `${errorCopy.description} Filters: ${filterSummary}.`,
|
|
42738
|
+
configurationError ? void 0 : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42739
|
+
hasFilters ? /* @__PURE__ */ jsxs(Button2, { type: "button", variant: "outline", size: "sm", onClick: resetFilters, children: [
|
|
42740
|
+
/* @__PURE__ */ jsx(FunnelX, {}),
|
|
42741
|
+
" Reset filters"
|
|
42742
|
+
] }) : null,
|
|
42743
|
+
/* @__PURE__ */ jsxs(Button2, { type: "button", variant: "ghost", size: "sm", onClick: () => void auditLog.refresh(), children: [
|
|
42744
|
+
/* @__PURE__ */ jsx(RefreshCw, {}),
|
|
42745
|
+
" Refresh"
|
|
42746
|
+
] })
|
|
42747
|
+
] })
|
|
42748
|
+
) }) }) : auditLog.entries.length === 0 ? /* @__PURE__ */ jsx(TableRow, { "data-audit-log-state": "empty", className: "hover:bg-transparent", children: /* @__PURE__ */ jsx(TableCell, { colSpan: columnCount, className: "h-48 whitespace-normal text-center", children: emptyState ?? defaultState(
|
|
42749
|
+
/* @__PURE__ */ jsx(History, { className: "mx-auto mb-3 size-8 text-muted-foreground/60" }),
|
|
42750
|
+
hasDateFilter ? "No activity in this date range" : hasFilters ? "No activity matches these filters" : "No activity to show",
|
|
42751
|
+
hasDateFilter ? "Try expanding the date range or reset filters." : disabledCollections.length > 0 ? "Auditing is off, and no existing changes match the current filters." : hasFilters ? "Try removing a filter or reset filters." : "No record changes have been logged yet.",
|
|
42752
|
+
hasFilters ? /* @__PURE__ */ jsxs(Button2, { type: "button", variant: "outline", size: "sm", onClick: resetFilters, children: [
|
|
42753
|
+
/* @__PURE__ */ jsx(FunnelX, {}),
|
|
42754
|
+
" Reset filters"
|
|
42755
|
+
] }) : void 0
|
|
42756
|
+
) }) }) : auditLog.entries.map((entry) => {
|
|
42757
|
+
const collectionApiName = entry.collection;
|
|
42758
|
+
return /* @__PURE__ */ jsx(
|
|
42759
|
+
AuditLogEntry,
|
|
42636
42760
|
{
|
|
42637
|
-
|
|
42638
|
-
|
|
42639
|
-
|
|
42640
|
-
|
|
42641
|
-
|
|
42642
|
-
|
|
42643
|
-
|
|
42644
|
-
|
|
42645
|
-
|
|
42646
|
-
|
|
42647
|
-
|
|
42648
|
-
|
|
42649
|
-
|
|
42650
|
-
|
|
42651
|
-
|
|
42652
|
-
|
|
42653
|
-
|
|
42654
|
-
|
|
42655
|
-
|
|
42656
|
-
] }) : null,
|
|
42657
|
-
/* @__PURE__ */ jsxs(Table, { children: [
|
|
42658
|
-
/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { className: "hover:bg-transparent", children: [
|
|
42659
|
-
/* @__PURE__ */ jsx(TableHead, { className: "w-32 text-xs text-muted-foreground", children: "Time" }),
|
|
42660
|
-
showCollectionColumn ? /* @__PURE__ */ jsx(TableHead, { className: "w-48 text-xs text-muted-foreground", children: "Collection" }) : null,
|
|
42661
|
-
/* @__PURE__ */ jsx(TableHead, { className: "text-xs text-muted-foreground", children: "Activity" }),
|
|
42662
|
-
showActorColumn ? /* @__PURE__ */ jsx(TableHead, { className: "w-48 text-xs text-muted-foreground", children: "Actor" }) : null,
|
|
42663
|
-
/* @__PURE__ */ jsx(TableHead, { className: getRecordHref || onRecordClick ? "w-36" : "w-12", children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Actions" }) })
|
|
42664
|
-
] }) }),
|
|
42665
|
-
/* @__PURE__ */ jsx(TableBody, { children: auditLog.isLoading ? loadingState !== void 0 ? /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx(TableCell, { colSpan: columnCount, className: "h-48 whitespace-normal text-center", children: loadingState }) }) : [0, 1, 2].map((item) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
42666
|
-
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-20" }) }),
|
|
42667
|
-
showCollectionColumn ? /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-28" }) }) : null,
|
|
42668
|
-
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-2/3" }) }),
|
|
42669
|
-
showActorColumn ? /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" }) }) : null,
|
|
42670
|
-
/* @__PURE__ */ jsx(TableCell, {})
|
|
42671
|
-
] }, item)) : configurationError || auditLog.error ? /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx(TableCell, { colSpan: columnCount, className: "h-48 whitespace-normal text-center", children: auditLog.error && errorState ? errorState(auditLog.error) : defaultState(
|
|
42672
|
-
/* @__PURE__ */ jsx(History, { className: "mx-auto mb-3 size-8 text-muted-foreground/60" }),
|
|
42673
|
-
configurationError ? "Audit log is not configured" : errorCopy.title,
|
|
42674
|
-
configurationError || `${errorCopy.description} Filters: ${filterSummary}.`,
|
|
42675
|
-
configurationError ? void 0 : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42676
|
-
hasFilters ? /* @__PURE__ */ jsxs(Button2, { type: "button", variant: "outline", size: "sm", onClick: resetFilters, children: [
|
|
42677
|
-
/* @__PURE__ */ jsx(FunnelX, {}),
|
|
42678
|
-
" Reset filters"
|
|
42679
|
-
] }) : null,
|
|
42680
|
-
/* @__PURE__ */ jsxs(Button2, { type: "button", variant: "ghost", size: "sm", onClick: () => void auditLog.refresh(), children: [
|
|
42681
|
-
/* @__PURE__ */ jsx(RefreshCw, {}),
|
|
42682
|
-
" Refresh"
|
|
42683
|
-
] })
|
|
42684
|
-
] })
|
|
42685
|
-
) }) }) : auditLog.entries.length === 0 ? /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx(TableCell, { colSpan: columnCount, className: "h-48 whitespace-normal text-center", children: emptyState ?? defaultState(
|
|
42686
|
-
/* @__PURE__ */ jsx(History, { className: "mx-auto mb-3 size-8 text-muted-foreground/60" }),
|
|
42687
|
-
hasDateFilter ? "No activity in this date range" : hasFilters ? "No activity matches these filters" : "No activity to show",
|
|
42688
|
-
hasDateFilter ? "Try expanding the date range or reset filters." : disabledCollections.length > 0 ? "Auditing is off, and no existing changes match the current filters." : hasFilters ? "Try removing a filter or reset filters." : "No record changes have been logged yet.",
|
|
42689
|
-
hasFilters ? /* @__PURE__ */ jsxs(Button2, { type: "button", variant: "outline", size: "sm", onClick: resetFilters, children: [
|
|
42690
|
-
/* @__PURE__ */ jsx(FunnelX, {}),
|
|
42691
|
-
" Reset filters"
|
|
42692
|
-
] }) : void 0
|
|
42693
|
-
) }) }) : auditLog.entries.map((entry) => {
|
|
42694
|
-
const collectionApiName = auditLogDetailValue(entry, "Collection");
|
|
42695
|
-
return /* @__PURE__ */ jsx(
|
|
42696
|
-
AuditLogEntry,
|
|
42761
|
+
entry,
|
|
42762
|
+
collectionApiName,
|
|
42763
|
+
collectionLabel: labelForCollection(collectionApiName),
|
|
42764
|
+
activityCollectionLabel: activityLabelForCollection(collectionApiName),
|
|
42765
|
+
density,
|
|
42766
|
+
showCollectionColumn,
|
|
42767
|
+
showActorColumn,
|
|
42768
|
+
showSystemFields,
|
|
42769
|
+
fieldLabels,
|
|
42770
|
+
columnCount,
|
|
42771
|
+
getRecordHref,
|
|
42772
|
+
onRecordClick
|
|
42773
|
+
},
|
|
42774
|
+
entry.id
|
|
42775
|
+
);
|
|
42776
|
+
}) })
|
|
42777
|
+
] }),
|
|
42778
|
+
auditLog.hasMore ? /* @__PURE__ */ jsx("div", { className: "flex justify-center border-t p-4", children: /* @__PURE__ */ jsxs(
|
|
42779
|
+
Button2,
|
|
42697
42780
|
{
|
|
42698
|
-
|
|
42699
|
-
|
|
42700
|
-
|
|
42701
|
-
|
|
42702
|
-
|
|
42703
|
-
|
|
42704
|
-
|
|
42705
|
-
|
|
42706
|
-
|
|
42707
|
-
|
|
42708
|
-
|
|
42709
|
-
|
|
42710
|
-
|
|
42711
|
-
|
|
42712
|
-
|
|
42713
|
-
}) })
|
|
42714
|
-
] }),
|
|
42715
|
-
auditLog.hasMore ? /* @__PURE__ */ jsx("div", { className: "flex justify-center border-t p-4", children: /* @__PURE__ */ jsxs(
|
|
42716
|
-
Button2,
|
|
42717
|
-
{
|
|
42718
|
-
type: "button",
|
|
42719
|
-
variant: "outline",
|
|
42720
|
-
size: "sm",
|
|
42721
|
-
disabled: auditLog.isLoadingMore,
|
|
42722
|
-
onClick: () => void auditLog.loadMore(),
|
|
42723
|
-
children: [
|
|
42724
|
-
auditLog.isLoadingMore ? /* @__PURE__ */ jsx(LoaderCircle, { className: "animate-spin" }) : null,
|
|
42725
|
-
"Load more"
|
|
42726
|
-
]
|
|
42727
|
-
}
|
|
42728
|
-
) }) : null
|
|
42729
|
-
] });
|
|
42781
|
+
"data-audit-log-control": "load-more",
|
|
42782
|
+
type: "button",
|
|
42783
|
+
variant: "outline",
|
|
42784
|
+
size: "sm",
|
|
42785
|
+
disabled: auditLog.isLoadingMore,
|
|
42786
|
+
onClick: () => void auditLog.loadMore(),
|
|
42787
|
+
children: [
|
|
42788
|
+
auditLog.isLoadingMore ? /* @__PURE__ */ jsx(LoaderCircle, { className: "animate-spin" }) : null,
|
|
42789
|
+
"Load more"
|
|
42790
|
+
]
|
|
42791
|
+
}
|
|
42792
|
+
) }) : null
|
|
42793
|
+
]
|
|
42794
|
+
}
|
|
42795
|
+
);
|
|
42730
42796
|
}
|
|
42731
42797
|
function RunDownloadAction({ run }) {
|
|
42732
42798
|
const [isDownloading, setIsDownloading] = useState(false);
|