@burdenoff/microfe-admin 2026.625.1 → 2026.626.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/admin/components/AccessDenied.js +2 -2
- package/dist/admin/components/AccessDenied.js.map +1 -1
- package/dist/admin/components/ActivityFeed.js +4 -4
- package/dist/admin/components/ActivityFeed.js.map +1 -1
- package/dist/admin/components/Charts.js.map +1 -1
- package/dist/admin/components/ConfirmDialog.js +1 -1
- package/dist/admin/components/ConfirmDialog.js.map +1 -1
- package/dist/admin/components/FormSheet.js +1 -1
- package/dist/admin/components/FormSheet.js.map +1 -1
- package/dist/admin/components/TenantSsoPanel.js +1 -1
- package/dist/admin/components/TenantSsoPanel.js.map +1 -1
- package/dist/admin/components/Toast.js +11 -11
- package/dist/admin/components/Toast.js.map +1 -1
- package/dist/admin/components/forms/SubscriptionForm.js +2 -2
- package/dist/admin/components/forms/SubscriptionForm.js.map +1 -1
- package/dist/admin/components/forms/TenantForm.js +1 -1
- package/dist/admin/components/forms/UserForm.js +1 -1
- package/dist/admin/components/ui.js +3 -3
- package/dist/admin/components/ui.js.map +1 -1
- package/dist/admin/constants/index.js +33 -24
- package/dist/admin/constants/index.js.map +1 -1
- package/dist/admin/pages/AuditLogsPage.js +92 -77
- package/dist/admin/pages/AuditLogsPage.js.map +1 -1
- package/dist/admin/pages/BillingPage.js +95 -51
- package/dist/admin/pages/BillingPage.js.map +1 -1
- package/dist/admin/pages/CommunicationsPage.js +97 -92
- package/dist/admin/pages/CommunicationsPage.js.map +1 -1
- package/dist/admin/pages/ContentPagesPage.js +274 -259
- package/dist/admin/pages/ContentPagesPage.js.map +1 -1
- package/dist/admin/pages/DashboardPage.js +113 -84
- package/dist/admin/pages/DashboardPage.js.map +1 -1
- package/dist/admin/pages/FeatureFlagsPage.js +93 -75
- package/dist/admin/pages/FeatureFlagsPage.js.map +1 -1
- package/dist/admin/pages/OrganizationsListPage.js +105 -87
- package/dist/admin/pages/OrganizationsListPage.js.map +1 -1
- package/dist/admin/pages/ProductsPage.js +138 -130
- package/dist/admin/pages/ProductsPage.js.map +1 -1
- package/dist/admin/pages/ReferralsPage.js +70 -52
- package/dist/admin/pages/ReferralsPage.js.map +1 -1
- package/dist/admin/pages/RolesPermissionsPage.js +136 -118
- package/dist/admin/pages/RolesPermissionsPage.js.map +1 -1
- package/dist/admin/pages/SREPage.js +34 -32
- package/dist/admin/pages/SREPage.js.map +1 -1
- package/dist/admin/pages/SandboxSettingsPage.js +360 -322
- package/dist/admin/pages/SandboxSettingsPage.js.map +1 -1
- package/dist/admin/pages/SettingsPage.js +63 -60
- package/dist/admin/pages/SettingsPage.js.map +1 -1
- package/dist/admin/pages/SyncFailuresPage.js +120 -118
- package/dist/admin/pages/SyncFailuresPage.js.map +1 -1
- package/dist/admin/pages/TenantDetailPage.js +261 -218
- package/dist/admin/pages/TenantDetailPage.js.map +1 -1
- package/dist/admin/pages/TenantFormRoutePage.js +65 -61
- package/dist/admin/pages/TenantFormRoutePage.js.map +1 -1
- package/dist/admin/pages/TenantsListPage.js +86 -71
- package/dist/admin/pages/TenantsListPage.js.map +1 -1
- package/dist/admin/pages/UsersListPage.js +128 -113
- package/dist/admin/pages/UsersListPage.js.map +1 -1
- package/dist/admin/pages/WaitlistPage.js +78 -63
- package/dist/admin/pages/WaitlistPage.js.map +1 -1
- package/dist/admin/pages/WorkflowsPage.js +107 -102
- package/dist/admin/pages/WorkflowsPage.js.map +1 -1
- package/dist/admin/pages/WorkspacesListPage.js +61 -49
- package/dist/admin/pages/WorkspacesListPage.js.map +1 -1
- package/dist/node_modules/@hookform/resolvers/dist/resolvers.js +2 -2
- package/dist/node_modules/@hookform/resolvers/dist/resolvers.js.map +1 -1
- package/dist/node_modules/@hookform/resolvers/zod/dist/zod.js +35 -26
- package/dist/node_modules/@hookform/resolvers/zod/dist/zod.js.map +1 -1
- package/dist/node_modules/react-hook-form/dist/index.esm.js +609 -516
- package/dist/node_modules/react-hook-form/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
|
@@ -48,9 +48,9 @@ u.displayName = "CardFooter";
|
|
|
48
48
|
var d = {
|
|
49
49
|
default: "bg-action-primary-bg text-action-primary-text",
|
|
50
50
|
secondary: "bg-secondary text-secondary-foreground",
|
|
51
|
-
success: "bg-success
|
|
52
|
-
warning: "bg-warning
|
|
53
|
-
destructive: "bg-status-error-bg
|
|
51
|
+
success: "bg-status-success-bg text-status-success-text border-status-success-border",
|
|
52
|
+
warning: "bg-status-warning-bg text-status-warning-text border-status-warning-border",
|
|
53
|
+
destructive: "bg-status-error-bg text-status-error-text border-status-error-border",
|
|
54
54
|
outline: "border-border-subtle bg-transparent text-text-primary"
|
|
55
55
|
}, f = t(({ className: t, variant: r = "default", children: i, ...a }, o) => /* @__PURE__ */ n("span", {
|
|
56
56
|
ref: o,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","names":[],"sources":["../../../src/admin/components/ui.tsx"],"sourcesContent":["/**\n * Shared UI Components for Admin Console\n * Using semantic tokens for consistent theming\n */\n\nimport type { ReactNode, HTMLAttributes, ButtonHTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\n// ============================================================================\n// Card Components\n// ============================================================================\n\ninterface CardProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\nexport const Card = forwardRef<HTMLDivElement, CardProps>(\n ({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'rounded-card border border-border-seam bg-bg-surface text-text-primary shadow-elevation-1 transition-[box-shadow,border-color] duration-200 hover:border-border-strong',\n className\n )}\n {...props}\n >\n {children}\n </div>\n )\n);\nCard.displayName = 'Card';\n\nexport const CardHeader = forwardRef<HTMLDivElement, CardProps>(\n ({ className, children, ...props }, ref) => (\n <div ref={ref} className={cn('flex flex-col space-y-1.5 p-6', className)} {...props}>\n {children}\n </div>\n )\n);\nCardHeader.displayName = 'CardHeader';\n\nexport const CardTitle = forwardRef<HTMLHeadingElement, HTMLAttributes<HTMLHeadingElement>>(\n ({ className, children, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn('text-2xl font-semibold leading-none tracking-tight', className)}\n {...props}\n >\n {children}\n </h3>\n )\n);\nCardTitle.displayName = 'CardTitle';\n\nexport const CardDescription = forwardRef<\n HTMLParagraphElement,\n HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => (\n <p ref={ref} className={cn('text-sm text-text-secondary', className)} {...props}>\n {children}\n </p>\n));\nCardDescription.displayName = 'CardDescription';\n\nexport const CardContent = forwardRef<HTMLDivElement, CardProps>(\n ({ className, children, ...props }, ref) => (\n <div ref={ref} className={cn('p-6 pt-0', className)} {...props}>\n {children}\n </div>\n )\n);\nCardContent.displayName = 'CardContent';\n\nexport const CardFooter = forwardRef<HTMLDivElement, CardProps>(\n ({ className, children, ...props }, ref) => (\n <div ref={ref} className={cn('flex items-center p-6 pt-0', className)} {...props}>\n {children}\n </div>\n )\n);\nCardFooter.displayName = 'CardFooter';\n\n// ============================================================================\n// Badge Component\n// ============================================================================\n\ninterface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n variant?: 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'outline';\n}\n\nconst badgeVariants = {\n default: 'bg-action-primary-bg text-action-primary-text',\n secondary: 'bg-secondary text-secondary-foreground',\n success: 'bg-success/10 text-success border-success/20',\n warning: 'bg-warning/10 text-warning border-warning/20',\n destructive: 'bg-status-error-bg/10 text-status-error-text border-status-error-border/20',\n outline: 'border-border-subtle bg-transparent text-text-primary',\n};\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(\n ({ className, variant = 'default', children, ...props }, ref) => (\n <span\n ref={ref}\n className={cn(\n 'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors',\n badgeVariants[variant],\n className\n )}\n {...props}\n >\n {children}\n </span>\n )\n);\nBadge.displayName = 'Badge';\n\n// ============================================================================\n// Button Component\n// ============================================================================\n\ninterface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: 'default' | 'secondary' | 'outline' | 'ghost' | 'destructive' | 'link';\n size?: 'default' | 'sm' | 'lg' | 'icon';\n}\n\nconst buttonVariants = {\n default: 'bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',\n outline: 'border border-border-default bg-bg-surface hover:bg-accent hover:text-text-primary',\n ghost: 'hover:bg-accent hover:text-text-primary',\n destructive: 'bg-status-error-bg text-status-error-text hover:bg-status-error-bg/90',\n link: 'text-primary underline-offset-4 hover:underline',\n};\n\nconst buttonSizes = {\n default: 'h-10 px-4 py-2',\n sm: 'h-9 rounded-md px-3',\n lg: 'h-11 rounded-md px-8',\n icon: 'h-10 w-10',\n};\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant = 'default', size = 'default', children, ...props }, ref) => (\n <button\n ref={ref}\n className={cn(\n 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2',\n 'disabled:pointer-events-none disabled:opacity-50',\n buttonVariants[variant],\n buttonSizes[size],\n className\n )}\n {...props}\n >\n {children}\n </button>\n )\n);\nButton.displayName = 'Button';\n\n// ============================================================================\n// Input Component\n// ============================================================================\n\ntype InputProps = React.InputHTMLAttributes<HTMLInputElement>;\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => (\n <input\n type={type}\n className={cn(\n 'flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm ring-offset-background',\n 'file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-text-primary',\n 'placeholder:text-text-secondary',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n className\n )}\n ref={ref}\n {...props}\n />\n )\n);\nInput.displayName = 'Input';\n\n// ============================================================================\n// Skeleton Component\n// ============================================================================\n\ntype SkeletonProps = HTMLAttributes<HTMLDivElement>;\n\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn('animate-pulse rounded-md bg-bg-sunken', className)} {...props} />\n )\n);\nSkeleton.displayName = 'Skeleton';\n\n// ============================================================================\n// Separator Component\n// ============================================================================\n\ninterface SeparatorProps extends HTMLAttributes<HTMLDivElement> {\n orientation?: 'horizontal' | 'vertical';\n}\n\nexport const Separator = forwardRef<HTMLDivElement, SeparatorProps>(\n ({ className, orientation = 'horizontal', ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'shrink-0 bg-border',\n orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',\n className\n )}\n {...props}\n />\n )\n);\nSeparator.displayName = 'Separator';\n\n// ============================================================================\n// Avatar Component\n// ============================================================================\n\ninterface AvatarProps extends HTMLAttributes<HTMLDivElement> {\n src?: string;\n alt?: string;\n fallback: string;\n size?: 'sm' | 'default' | 'lg';\n}\n\nconst avatarSizes = {\n sm: 'h-8 w-8 text-xs',\n default: 'h-10 w-10 text-sm',\n lg: 'h-12 w-12 text-base',\n};\n\nexport const Avatar = forwardRef<HTMLDivElement, AvatarProps>(\n ({ className, src, alt, fallback, size = 'default', ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'relative flex shrink-0 overflow-hidden rounded-full bg-bg-sunken',\n avatarSizes[size],\n className\n )}\n {...props}\n >\n {src ? (\n <img src={src} alt={alt} className=\"aspect-square h-full w-full object-cover\" />\n ) : (\n <span className=\"flex h-full w-full items-center justify-center font-medium text-text-secondary\">\n {fallback}\n </span>\n )}\n </div>\n )\n);\nAvatar.displayName = 'Avatar';\n\n// ============================================================================\n// Empty State Component\n// ============================================================================\n\ninterface EmptyStateProps {\n icon?: ReactNode;\n title: string;\n description?: string;\n action?: ReactNode;\n /**\n * On-brand illustration name (Boff UI 2.0). When provided, renders the\n * IllustratedEmptyState (host serves /illustrations/<name>.webp). Standard\n * names: empty-data, empty-search, empty-files, empty-people,\n * empty-notifications, onboarding, empty-generic. Falls back to the icon\n * variant when omitted.\n */\n illustration?: string;\n}\n\nexport function EmptyState({ icon, title, description, action, illustration }: EmptyStateProps) {\n if (illustration) {\n return (\n <IllustratedEmptyState\n illustration={illustration}\n title={title}\n description={description}\n action={action}\n className=\"py-12\"\n />\n );\n }\n return (\n <div className=\"flex flex-col items-center justify-center py-12 text-center\">\n {icon && <div className=\"mb-4 rounded-full bg-bg-sunken p-4 text-text-secondary\">{icon}</div>}\n <h3 className=\"mb-2 text-lg font-semibold\">{title}</h3>\n {description && <p className=\"mb-4 max-w-sm text-sm text-text-secondary\">{description}</p>}\n {action}\n </div>\n );\n}\n\n// ============================================================================\n// Loading Spinner Component\n// ============================================================================\n\ninterface SpinnerProps extends HTMLAttributes<HTMLDivElement> {\n size?: 'sm' | 'default' | 'lg';\n}\n\nconst spinnerSizes = {\n sm: 'h-4 w-4',\n default: 'h-6 w-6',\n lg: 'h-8 w-8',\n};\n\nexport function Spinner({ className, size = 'default', ...props }: SpinnerProps) {\n return (\n <div\n className={cn(\n 'animate-spin rounded-full border-2 border-current border-t-transparent text-primary',\n spinnerSizes[size],\n className\n )}\n {...props}\n />\n );\n}\n\n// ============================================================================\n// Page Loading Fallback\n// ============================================================================\n\ninterface PageLoadingFallbackProps {\n message?: string;\n}\n\nexport function PageLoadingFallback({ message = 'Loading...' }: PageLoadingFallbackProps) {\n return (\n <div className=\"flex h-full min-h-[400px] flex-col items-center justify-center gap-4\">\n <Spinner size=\"lg\" />\n <p className=\"text-sm text-text-secondary\">{message}</p>\n </div>\n );\n}\n"],"mappings":";;;;;AAkBA,IAAa,IAAO,GACjB,EAAE,cAAW,aAAU,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SAAM,UAAO,gBAAa,WAAQ,mBAAiC;AAY9F,QAXI,IAEA,kBAAC,GAAD;EACgB;EACP;EACM;EACL;EACR,WAAU;EACV,CAAA,GAIJ,kBAAC,OAAD;EAAK,WAAU;YAAf;GACG,KAAQ,kBAAC,OAAD;IAAK,WAAU;cAA0D;IAAW,CAAA;GAC7F,kBAAC,MAAD;IAAI,WAAU;cAA8B;IAAW,CAAA;GACtD,KAAe,kBAAC,KAAD;IAAG,WAAU;cAA6C;IAAgB,CAAA;GACzF;GACG"}
|
|
1
|
+
{"version":3,"file":"ui.js","names":[],"sources":["../../../src/admin/components/ui.tsx"],"sourcesContent":["/**\n * Shared UI Components for Admin Console\n * Using semantic tokens for consistent theming\n */\n\nimport type { ReactNode, HTMLAttributes, ButtonHTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\n// ============================================================================\n// Card Components\n// ============================================================================\n\ninterface CardProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\nexport const Card = forwardRef<HTMLDivElement, CardProps>(\n ({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'rounded-card border border-border-seam bg-bg-surface text-text-primary shadow-elevation-1 transition-[box-shadow,border-color] duration-200 hover:border-border-strong',\n className\n )}\n {...props}\n >\n {children}\n </div>\n )\n);\nCard.displayName = 'Card';\n\nexport const CardHeader = forwardRef<HTMLDivElement, CardProps>(\n ({ className, children, ...props }, ref) => (\n <div ref={ref} className={cn('flex flex-col space-y-1.5 p-6', className)} {...props}>\n {children}\n </div>\n )\n);\nCardHeader.displayName = 'CardHeader';\n\nexport const CardTitle = forwardRef<HTMLHeadingElement, HTMLAttributes<HTMLHeadingElement>>(\n ({ className, children, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn('text-2xl font-semibold leading-none tracking-tight', className)}\n {...props}\n >\n {children}\n </h3>\n )\n);\nCardTitle.displayName = 'CardTitle';\n\nexport const CardDescription = forwardRef<\n HTMLParagraphElement,\n HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => (\n <p ref={ref} className={cn('text-sm text-text-secondary', className)} {...props}>\n {children}\n </p>\n));\nCardDescription.displayName = 'CardDescription';\n\nexport const CardContent = forwardRef<HTMLDivElement, CardProps>(\n ({ className, children, ...props }, ref) => (\n <div ref={ref} className={cn('p-6 pt-0', className)} {...props}>\n {children}\n </div>\n )\n);\nCardContent.displayName = 'CardContent';\n\nexport const CardFooter = forwardRef<HTMLDivElement, CardProps>(\n ({ className, children, ...props }, ref) => (\n <div ref={ref} className={cn('flex items-center p-6 pt-0', className)} {...props}>\n {children}\n </div>\n )\n);\nCardFooter.displayName = 'CardFooter';\n\n// ============================================================================\n// Badge Component\n// ============================================================================\n\ninterface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n variant?: 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'outline';\n}\n\nconst badgeVariants = {\n default: 'bg-action-primary-bg text-action-primary-text',\n secondary: 'bg-secondary text-secondary-foreground',\n success: 'bg-status-success-bg text-status-success-text border-status-success-border',\n warning: 'bg-status-warning-bg text-status-warning-text border-status-warning-border',\n destructive: 'bg-status-error-bg text-status-error-text border-status-error-border',\n outline: 'border-border-subtle bg-transparent text-text-primary',\n};\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(\n ({ className, variant = 'default', children, ...props }, ref) => (\n <span\n ref={ref}\n className={cn(\n 'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors',\n badgeVariants[variant],\n className\n )}\n {...props}\n >\n {children}\n </span>\n )\n);\nBadge.displayName = 'Badge';\n\n// ============================================================================\n// Button Component\n// ============================================================================\n\ninterface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: 'default' | 'secondary' | 'outline' | 'ghost' | 'destructive' | 'link';\n size?: 'default' | 'sm' | 'lg' | 'icon';\n}\n\nconst buttonVariants = {\n default: 'bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',\n outline: 'border border-border-default bg-bg-surface hover:bg-accent hover:text-text-primary',\n ghost: 'hover:bg-accent hover:text-text-primary',\n destructive: 'bg-status-error-bg text-status-error-text hover:bg-status-error-bg/90',\n link: 'text-primary underline-offset-4 hover:underline',\n};\n\nconst buttonSizes = {\n default: 'h-10 px-4 py-2',\n sm: 'h-9 rounded-md px-3',\n lg: 'h-11 rounded-md px-8',\n icon: 'h-10 w-10',\n};\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant = 'default', size = 'default', children, ...props }, ref) => (\n <button\n ref={ref}\n className={cn(\n 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2',\n 'disabled:pointer-events-none disabled:opacity-50',\n buttonVariants[variant],\n buttonSizes[size],\n className\n )}\n {...props}\n >\n {children}\n </button>\n )\n);\nButton.displayName = 'Button';\n\n// ============================================================================\n// Input Component\n// ============================================================================\n\ntype InputProps = React.InputHTMLAttributes<HTMLInputElement>;\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => (\n <input\n type={type}\n className={cn(\n 'flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm ring-offset-background',\n 'file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-text-primary',\n 'placeholder:text-text-secondary',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n className\n )}\n ref={ref}\n {...props}\n />\n )\n);\nInput.displayName = 'Input';\n\n// ============================================================================\n// Skeleton Component\n// ============================================================================\n\ntype SkeletonProps = HTMLAttributes<HTMLDivElement>;\n\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn('animate-pulse rounded-md bg-bg-sunken', className)} {...props} />\n )\n);\nSkeleton.displayName = 'Skeleton';\n\n// ============================================================================\n// Separator Component\n// ============================================================================\n\ninterface SeparatorProps extends HTMLAttributes<HTMLDivElement> {\n orientation?: 'horizontal' | 'vertical';\n}\n\nexport const Separator = forwardRef<HTMLDivElement, SeparatorProps>(\n ({ className, orientation = 'horizontal', ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'shrink-0 bg-border',\n orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',\n className\n )}\n {...props}\n />\n )\n);\nSeparator.displayName = 'Separator';\n\n// ============================================================================\n// Avatar Component\n// ============================================================================\n\ninterface AvatarProps extends HTMLAttributes<HTMLDivElement> {\n src?: string;\n alt?: string;\n fallback: string;\n size?: 'sm' | 'default' | 'lg';\n}\n\nconst avatarSizes = {\n sm: 'h-8 w-8 text-xs',\n default: 'h-10 w-10 text-sm',\n lg: 'h-12 w-12 text-base',\n};\n\nexport const Avatar = forwardRef<HTMLDivElement, AvatarProps>(\n ({ className, src, alt, fallback, size = 'default', ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'relative flex shrink-0 overflow-hidden rounded-full bg-bg-sunken',\n avatarSizes[size],\n className\n )}\n {...props}\n >\n {src ? (\n <img src={src} alt={alt} className=\"aspect-square h-full w-full object-cover\" />\n ) : (\n <span className=\"flex h-full w-full items-center justify-center font-medium text-text-secondary\">\n {fallback}\n </span>\n )}\n </div>\n )\n);\nAvatar.displayName = 'Avatar';\n\n// ============================================================================\n// Empty State Component\n// ============================================================================\n\ninterface EmptyStateProps {\n icon?: ReactNode;\n title: string;\n description?: string;\n action?: ReactNode;\n /**\n * On-brand illustration name (Boff UI 2.0). When provided, renders the\n * IllustratedEmptyState (host serves /illustrations/<name>.webp). Standard\n * names: empty-data, empty-search, empty-files, empty-people,\n * empty-notifications, onboarding, empty-generic. Falls back to the icon\n * variant when omitted.\n */\n illustration?: string;\n}\n\nexport function EmptyState({ icon, title, description, action, illustration }: EmptyStateProps) {\n if (illustration) {\n return (\n <IllustratedEmptyState\n illustration={illustration}\n title={title}\n description={description}\n action={action}\n className=\"py-12\"\n />\n );\n }\n return (\n <div className=\"flex flex-col items-center justify-center py-12 text-center\">\n {icon && <div className=\"mb-4 rounded-full bg-bg-sunken p-4 text-text-secondary\">{icon}</div>}\n <h3 className=\"mb-2 text-lg font-semibold\">{title}</h3>\n {description && <p className=\"mb-4 max-w-sm text-sm text-text-secondary\">{description}</p>}\n {action}\n </div>\n );\n}\n\n// ============================================================================\n// Loading Spinner Component\n// ============================================================================\n\ninterface SpinnerProps extends HTMLAttributes<HTMLDivElement> {\n size?: 'sm' | 'default' | 'lg';\n}\n\nconst spinnerSizes = {\n sm: 'h-4 w-4',\n default: 'h-6 w-6',\n lg: 'h-8 w-8',\n};\n\nexport function Spinner({ className, size = 'default', ...props }: SpinnerProps) {\n return (\n <div\n className={cn(\n 'animate-spin rounded-full border-2 border-current border-t-transparent text-primary',\n spinnerSizes[size],\n className\n )}\n {...props}\n />\n );\n}\n\n// ============================================================================\n// Page Loading Fallback\n// ============================================================================\n\ninterface PageLoadingFallbackProps {\n message?: string;\n}\n\nexport function PageLoadingFallback({ message = 'Loading...' }: PageLoadingFallbackProps) {\n return (\n <div className=\"flex h-full min-h-[400px] flex-col items-center justify-center gap-4\">\n <Spinner size=\"lg\" />\n <p className=\"text-sm text-text-secondary\">{message}</p>\n </div>\n );\n}\n"],"mappings":";;;;;AAkBA,IAAa,IAAO,GACjB,EAAE,cAAW,aAAU,GAAG,KAAS,MAClC,kBAAC,OAAD;CACO;CACL,WAAW,EACT,0KACA,EACD;CACD,GAAI;CAEH;CACG,CAAA,CAET;AACD,EAAK,cAAc;AAEnB,IAAa,IAAa,GACvB,EAAE,cAAW,aAAU,GAAG,KAAS,MAClC,kBAAC,OAAD;CAAU;CAAK,WAAW,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GAC7F,kBAAC,MAAD;IAAI,WAAU;cAA8B;IAAW,CAAA;GACtD,KAAe,kBAAC,KAAD;IAAG,WAAU;cAA6C;IAAgB,CAAA;GACzF;GACG"}
|
|
@@ -1,90 +1,99 @@
|
|
|
1
1
|
//#region src/admin/constants/index.ts
|
|
2
2
|
var e = {
|
|
3
|
+
success: "bg-status-success-bg text-status-success-text border-status-success-border",
|
|
4
|
+
warning: "bg-status-warning-bg text-status-warning-text border-status-warning-border",
|
|
5
|
+
error: "bg-status-error-bg text-status-error-text border-status-error-border",
|
|
6
|
+
info: "bg-status-info-bg text-status-info-text border-status-info-border",
|
|
7
|
+
neutral: "bg-status-neutral-bg text-status-neutral-text border-status-neutral-border"
|
|
8
|
+
}, t = {
|
|
3
9
|
active: {
|
|
4
10
|
label: "Active",
|
|
5
|
-
color:
|
|
11
|
+
color: e.success
|
|
6
12
|
},
|
|
7
13
|
suspended: {
|
|
8
14
|
label: "Suspended",
|
|
9
|
-
color:
|
|
15
|
+
color: e.error
|
|
10
16
|
},
|
|
11
17
|
trial: {
|
|
12
18
|
label: "Trial",
|
|
13
|
-
color:
|
|
19
|
+
color: e.warning
|
|
14
20
|
},
|
|
15
21
|
deleted: {
|
|
16
22
|
label: "Deleted",
|
|
17
|
-
color:
|
|
23
|
+
color: e.neutral
|
|
18
24
|
},
|
|
19
25
|
pending: {
|
|
20
26
|
label: "Pending",
|
|
21
|
-
color:
|
|
27
|
+
color: e.info
|
|
22
28
|
},
|
|
23
29
|
provisioning: {
|
|
24
30
|
label: "Provisioning",
|
|
25
|
-
color:
|
|
31
|
+
color: e.warning
|
|
26
32
|
}
|
|
27
|
-
},
|
|
33
|
+
}, n = {
|
|
28
34
|
active: {
|
|
29
35
|
label: "Active",
|
|
30
|
-
color:
|
|
36
|
+
color: e.success
|
|
31
37
|
},
|
|
32
38
|
inactive: {
|
|
33
39
|
label: "Inactive",
|
|
34
|
-
color:
|
|
40
|
+
color: e.neutral
|
|
35
41
|
},
|
|
36
42
|
blocked: {
|
|
37
43
|
label: "Blocked",
|
|
38
|
-
color:
|
|
44
|
+
color: e.error
|
|
39
45
|
},
|
|
40
46
|
pending: {
|
|
41
47
|
label: "Pending",
|
|
42
|
-
color:
|
|
48
|
+
color: e.warning
|
|
43
49
|
}
|
|
44
|
-
}
|
|
50
|
+
};
|
|
51
|
+
e.success, e.neutral, e.error, e.info, e.warning, e.info, e.warning, e.success, e.neutral, e.neutral, e.info, e.warning, e.error;
|
|
52
|
+
var r = {
|
|
45
53
|
healthy: {
|
|
46
54
|
label: "Healthy",
|
|
47
|
-
color:
|
|
55
|
+
color: e.success
|
|
48
56
|
},
|
|
49
57
|
degraded: {
|
|
50
58
|
label: "Degraded",
|
|
51
|
-
color:
|
|
59
|
+
color: e.warning
|
|
52
60
|
},
|
|
53
61
|
down: {
|
|
54
62
|
label: "Down",
|
|
55
|
-
color:
|
|
63
|
+
color: e.error
|
|
56
64
|
},
|
|
57
65
|
unknown: {
|
|
58
66
|
label: "Unknown",
|
|
59
|
-
color:
|
|
67
|
+
color: e.neutral
|
|
60
68
|
}
|
|
61
|
-
},
|
|
69
|
+
}, i = {
|
|
62
70
|
pending: {
|
|
63
71
|
label: "Pending",
|
|
64
|
-
color:
|
|
72
|
+
color: e.neutral
|
|
65
73
|
},
|
|
66
74
|
running: {
|
|
67
75
|
label: "Running",
|
|
68
|
-
color:
|
|
76
|
+
color: e.info
|
|
69
77
|
},
|
|
70
78
|
in_progress: {
|
|
71
79
|
label: "In Progress",
|
|
72
|
-
color:
|
|
80
|
+
color: e.info
|
|
73
81
|
},
|
|
74
82
|
success: {
|
|
75
83
|
label: "Success",
|
|
76
|
-
color:
|
|
84
|
+
color: e.success
|
|
77
85
|
},
|
|
78
86
|
failed: {
|
|
79
87
|
label: "Failed",
|
|
80
|
-
color:
|
|
88
|
+
color: e.error
|
|
81
89
|
},
|
|
82
90
|
rolled_back: {
|
|
83
91
|
label: "Rolled Back",
|
|
84
|
-
color:
|
|
92
|
+
color: e.warning
|
|
85
93
|
}
|
|
86
94
|
};
|
|
95
|
+
e.warning, e.info, e.error, e.info;
|
|
87
96
|
//#endregion
|
|
88
|
-
export {
|
|
97
|
+
export { i as DEPLOYMENT_STATUS_CONFIG, r as HEALTH_STATUS_CONFIG, t as TENANT_STATUS_CONFIG, n as USER_STATUS_CONFIG };
|
|
89
98
|
|
|
90
99
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/admin/constants/index.ts"],"sourcesContent":["import type {\n TenantStatus,\n UserStatus,\n SubscriptionStatus,\n TicketStatus,\n TicketPriority,\n HealthStatus,\n DeploymentStatus,\n CloudProvider,\n} from '../types';\n\n/**\n * Tenant status labels and colors\n */\nexport const TENANT_STATUS_CONFIG: Record<TenantStatus, { label: string; color: string }> = {\n active: { label: 'Active', color:
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/admin/constants/index.ts"],"sourcesContent":["import type {\n TenantStatus,\n UserStatus,\n SubscriptionStatus,\n TicketStatus,\n TicketPriority,\n HealthStatus,\n DeploymentStatus,\n CloudProvider,\n} from '../types';\n\n/**\n * Semantic status-badge token bundles. These map to the platform status tokens\n * (bg/text/border) which are defined for EVERY theme + dark mode, so badges and\n * pills stay legible with strong contrast everywhere. Using these instead of\n * raw `bg-success/10`/`text-info` (whose base color tokens are undefined and\n * render invisible in dark mode).\n */\nconst STATUS_TOKENS = {\n success: 'bg-status-success-bg text-status-success-text border-status-success-border',\n warning: 'bg-status-warning-bg text-status-warning-text border-status-warning-border',\n error: 'bg-status-error-bg text-status-error-text border-status-error-border',\n info: 'bg-status-info-bg text-status-info-text border-status-info-border',\n neutral: 'bg-status-neutral-bg text-status-neutral-text border-status-neutral-border',\n} as const;\n\n/**\n * Tenant status labels and colors\n */\nexport const TENANT_STATUS_CONFIG: Record<TenantStatus, { label: string; color: string }> = {\n active: { label: 'Active', color: STATUS_TOKENS.success },\n suspended: { label: 'Suspended', color: STATUS_TOKENS.error },\n trial: { label: 'Trial', color: STATUS_TOKENS.warning },\n deleted: { label: 'Deleted', color: STATUS_TOKENS.neutral },\n pending: { label: 'Pending', color: STATUS_TOKENS.info },\n provisioning: { label: 'Provisioning', color: STATUS_TOKENS.warning },\n};\n\n/**\n * User status labels and colors\n */\nexport const USER_STATUS_CONFIG: Record<UserStatus, { label: string; color: string }> = {\n active: { label: 'Active', color: STATUS_TOKENS.success },\n inactive: { label: 'Inactive', color: STATUS_TOKENS.neutral },\n blocked: { label: 'Blocked', color: STATUS_TOKENS.error },\n pending: { label: 'Pending', color: STATUS_TOKENS.warning },\n};\n\n/**\n * Subscription status labels and colors\n */\nexport const SUBSCRIPTION_STATUS_CONFIG: Record<\n SubscriptionStatus,\n { label: string; color: string }\n> = {\n active: { label: 'Active', color: STATUS_TOKENS.success },\n canceled: { label: 'Canceled', color: STATUS_TOKENS.neutral },\n past_due: { label: 'Past Due', color: STATUS_TOKENS.error },\n trialing: { label: 'Trialing', color: STATUS_TOKENS.info },\n paused: { label: 'Paused', color: STATUS_TOKENS.warning },\n};\n\n/**\n * Ticket status labels and colors\n */\nexport const TICKET_STATUS_CONFIG: Record<TicketStatus, { label: string; color: string }> = {\n open: { label: 'Open', color: STATUS_TOKENS.info },\n in_progress: { label: 'In Progress', color: STATUS_TOKENS.warning },\n resolved: { label: 'Resolved', color: STATUS_TOKENS.success },\n closed: { label: 'Closed', color: STATUS_TOKENS.neutral },\n};\n\n/**\n * Ticket priority labels and colors\n */\nexport const TICKET_PRIORITY_CONFIG: Record<TicketPriority, { label: string; color: string }> = {\n low: { label: 'Low', color: STATUS_TOKENS.neutral },\n medium: { label: 'Medium', color: STATUS_TOKENS.info },\n high: { label: 'High', color: STATUS_TOKENS.warning },\n critical: { label: 'Critical', color: STATUS_TOKENS.error },\n};\n\n/**\n * Health status labels and colors\n */\nexport const HEALTH_STATUS_CONFIG: Record<HealthStatus, { label: string; color: string }> = {\n healthy: { label: 'Healthy', color: STATUS_TOKENS.success },\n degraded: { label: 'Degraded', color: STATUS_TOKENS.warning },\n down: { label: 'Down', color: STATUS_TOKENS.error },\n unknown: { label: 'Unknown', color: STATUS_TOKENS.neutral },\n};\n\n/**\n * Deployment status labels and colors\n */\nexport const DEPLOYMENT_STATUS_CONFIG: Record<DeploymentStatus, { label: string; color: string }> =\n {\n pending: { label: 'Pending', color: STATUS_TOKENS.neutral },\n running: { label: 'Running', color: STATUS_TOKENS.info },\n in_progress: { label: 'In Progress', color: STATUS_TOKENS.info },\n success: { label: 'Success', color: STATUS_TOKENS.success },\n failed: { label: 'Failed', color: STATUS_TOKENS.error },\n rolled_back: { label: 'Rolled Back', color: STATUS_TOKENS.warning },\n };\n\n/**\n * Cloud provider labels and colors. Each provider maps to a semantic status\n * tint so the pills stay theme-aware + dark-mode legible (no raw brand hexes).\n */\nexport const CLOUD_PROVIDER_CONFIG: Record<\n CloudProvider,\n { label: string; color: string; icon: string }\n> = {\n aws: { label: 'AWS', color: STATUS_TOKENS.warning, icon: 'aws' },\n azure: { label: 'Azure', color: STATUS_TOKENS.info, icon: 'azure' },\n gcp: { label: 'GCP', color: STATUS_TOKENS.error, icon: 'gcp' },\n digitalocean: { label: 'DigitalOcean', color: STATUS_TOKENS.info, icon: 'do' },\n};\n\n/**\n * Chart colors using semantic chart tokens (theme-aware full colors — not\n * `hsl(var(...))`, which would be invalid now that the chart vars are colors).\n */\nexport const CHART_COLORS = {\n primary: 'var(--color-chart-1)',\n secondary: 'var(--color-chart-2)',\n tertiary: 'var(--color-chart-3)',\n quaternary: 'var(--color-chart-4)',\n quinary: 'var(--color-chart-5)',\n};\n\n/**\n * Default pagination\n */\nexport const DEFAULT_PAGE_SIZE = 20;\nexport const PAGE_SIZE_OPTIONS = [10, 20, 50, 100];\n"],"mappings":";AAkBA,IAAM,IAAgB;CACpB,SAAS;CACT,SAAS;CACT,OAAO;CACP,MAAM;CACN,SAAS;CACV,EAKY,IAA+E;CAC1F,QAAQ;EAAE,OAAO;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-1,42 +1,43 @@
|
|
|
1
1
|
import { useAdminPermissions as e } from "../hooks/useAdminPermissions.js";
|
|
2
2
|
import { EmptyState as t, Input as n } from "../components/ui.js";
|
|
3
3
|
import { PageLayout as r } from "../components/PageLayout.js";
|
|
4
|
-
import {
|
|
5
|
-
import { DataTable as
|
|
6
|
-
import { PermissionGuard as
|
|
4
|
+
import { formatNumber as i, formatRelativeTime as a } from "../utils/formatters.js";
|
|
5
|
+
import { DataTable as o, Pagination as s } from "../components/DataTable.js";
|
|
6
|
+
import { PermissionGuard as c } from "../components/PermissionGuard.js";
|
|
7
7
|
import "../components/index.js";
|
|
8
|
-
import { useListAuditLogsQuery as
|
|
9
|
-
import { useCallback as
|
|
10
|
-
import { Database as
|
|
11
|
-
import { jsx as
|
|
12
|
-
import {
|
|
8
|
+
import { useListAuditLogsQuery as l } from "../../generated/global-operations.js";
|
|
9
|
+
import { useCallback as u, useMemo as d, useState as f } from "react";
|
|
10
|
+
import { Database as p, FileText as m, Key as h, Search as g, Settings as _, Shield as v, User as y } from "lucide-react";
|
|
11
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
12
|
+
import { EmphasisPanel as S, PagePurpose as C } from "@burdenoff/fe-libs/ui";
|
|
13
|
+
import { SaveToFilesButton as w } from "@burdenoff/fe-libs/storage";
|
|
13
14
|
//#region src/admin/pages/AuditLogsPage.tsx
|
|
14
|
-
var
|
|
15
|
-
auth: /* @__PURE__ */ y
|
|
16
|
-
user: /* @__PURE__ */ y
|
|
17
|
-
settings: /* @__PURE__ */
|
|
18
|
-
rbac: /* @__PURE__ */
|
|
19
|
-
data: /* @__PURE__ */
|
|
20
|
-
api: /* @__PURE__ */
|
|
15
|
+
var T = 20, E = {
|
|
16
|
+
auth: /* @__PURE__ */ b(y, { className: "h-3 w-3" }),
|
|
17
|
+
user: /* @__PURE__ */ b(y, { className: "h-3 w-3" }),
|
|
18
|
+
settings: /* @__PURE__ */ b(_, { className: "h-3 w-3" }),
|
|
19
|
+
rbac: /* @__PURE__ */ b(v, { className: "h-3 w-3" }),
|
|
20
|
+
data: /* @__PURE__ */ b(p, { className: "h-3 w-3" }),
|
|
21
|
+
api: /* @__PURE__ */ b(h, { className: "h-3 w-3" })
|
|
21
22
|
};
|
|
22
|
-
function
|
|
23
|
-
return
|
|
23
|
+
function D(e) {
|
|
24
|
+
return E[e.split(".")[0]] ?? /* @__PURE__ */ b(m, { className: "h-3 w-3" });
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
let { canViewAuditLogs:
|
|
26
|
+
function O() {
|
|
27
|
+
let { canViewAuditLogs: p, isLoading: h } = e(), [_, v] = f(1), [y, E] = f(""), [O, k] = f(""), A = h || !p, { data: j, loading: M, error: N } = l({
|
|
27
28
|
variables: {
|
|
28
|
-
resource:
|
|
29
|
-
limit:
|
|
30
|
-
offset: (
|
|
29
|
+
resource: O || void 0,
|
|
30
|
+
limit: T,
|
|
31
|
+
offset: (_ - 1) * T
|
|
31
32
|
},
|
|
32
33
|
fetchPolicy: "cache-and-network",
|
|
33
|
-
skip:
|
|
34
|
-
}),
|
|
35
|
-
if (!
|
|
36
|
-
let e =
|
|
37
|
-
return
|
|
38
|
-
}, [
|
|
39
|
-
let e =
|
|
34
|
+
skip: A
|
|
35
|
+
}), P = d(() => (j?.auditLogs?.edges ?? []).map((e) => e.node), [j]), F = d(() => {
|
|
36
|
+
if (!y) return P;
|
|
37
|
+
let e = y.toLowerCase();
|
|
38
|
+
return P.filter((t) => t.action.toLowerCase().includes(e) || t.actorId.toLowerCase().includes(e) || t.resource.toLowerCase().includes(e) || t.tenantId.toLowerCase().includes(e));
|
|
39
|
+
}, [P, y]), I = j?.auditLogs?.totalCount ?? 0, L = Math.ceil(I / T), R = u(() => {
|
|
40
|
+
let e = F;
|
|
40
41
|
if (e.length === 0) return null;
|
|
41
42
|
let t = [
|
|
42
43
|
"id",
|
|
@@ -70,24 +71,24 @@ function T() {
|
|
|
70
71
|
n(e.createdAt)
|
|
71
72
|
].join(","))];
|
|
72
73
|
return new Blob([r.join("\n")], { type: "text/csv;charset=utf-8;" });
|
|
73
|
-
}, [
|
|
74
|
-
let e =
|
|
74
|
+
}, [F]), z = u(() => {
|
|
75
|
+
let e = R();
|
|
75
76
|
if (!e) return;
|
|
76
77
|
let t = URL.createObjectURL(e), n = document.createElement("a"), r = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
77
78
|
n.href = t, n.setAttribute("download", `audit-logs-${r}.csv`), document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(t);
|
|
78
|
-
}, [
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
allowed:
|
|
81
|
-
isLoading:
|
|
79
|
+
}, [R]);
|
|
80
|
+
return /* @__PURE__ */ b(c, {
|
|
81
|
+
allowed: p,
|
|
82
|
+
isLoading: h,
|
|
82
83
|
pageTitle: "Audit Logs",
|
|
83
84
|
denyMessage: "You don't have permission to view audit logs.",
|
|
84
|
-
children: /* @__PURE__ */
|
|
85
|
+
children: /* @__PURE__ */ b(r, {
|
|
85
86
|
title: "Audit Logs",
|
|
86
87
|
gradientWord: "Logs",
|
|
87
|
-
description: `Security and compliance audit trail${
|
|
88
|
-
actions: /* @__PURE__ */
|
|
88
|
+
description: `Security and compliance audit trail${I ? ` · ${I} total` : ""}`,
|
|
89
|
+
actions: /* @__PURE__ */ b(w, {
|
|
89
90
|
label: "Export CSV",
|
|
90
|
-
disabled:
|
|
91
|
+
disabled: M || F.length === 0,
|
|
91
92
|
testId: "audit-logs-export",
|
|
92
93
|
defaultFolderPath: "/Admin/Audit Logs",
|
|
93
94
|
source: {
|
|
@@ -95,49 +96,63 @@ function T() {
|
|
|
95
96
|
filename: `audit-logs-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}.csv`,
|
|
96
97
|
mimeType: "text/csv",
|
|
97
98
|
getBlob: async () => {
|
|
98
|
-
let e =
|
|
99
|
+
let e = R();
|
|
99
100
|
return e ? { blob: e } : null;
|
|
100
101
|
}
|
|
101
102
|
},
|
|
102
|
-
onDownload:
|
|
103
|
+
onDownload: z
|
|
103
104
|
}),
|
|
104
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ x("div", {
|
|
105
106
|
className: "space-y-4",
|
|
106
107
|
children: [
|
|
107
|
-
/* @__PURE__ */ b("
|
|
108
|
-
|
|
108
|
+
/* @__PURE__ */ b(C, { children: "A tamper-evident record of who did what across the platform — every sign-in, permission change, and data action. Use this page to investigate a security incident, answer a compliance question, or export the trail as CSV for an auditor." }),
|
|
109
|
+
/* @__PURE__ */ x(S, {
|
|
110
|
+
className: "flex items-center gap-4 p-5",
|
|
109
111
|
children: [/* @__PURE__ */ b("div", {
|
|
112
|
+
className: "flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-action-primary-bg/15 text-action-primary-bg",
|
|
113
|
+
children: /* @__PURE__ */ b(m, { className: "h-6 w-6" })
|
|
114
|
+
}), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("div", {
|
|
115
|
+
className: "text-3xl font-bold tabular-nums text-text-primary",
|
|
116
|
+
children: i(I)
|
|
117
|
+
}), /* @__PURE__ */ b("p", {
|
|
118
|
+
className: "text-sm text-text-secondary",
|
|
119
|
+
children: "recorded audit events"
|
|
120
|
+
})] })]
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ x("div", {
|
|
123
|
+
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
124
|
+
children: [/* @__PURE__ */ x("div", {
|
|
110
125
|
className: "relative max-w-sm flex-1",
|
|
111
|
-
children: [/* @__PURE__ */
|
|
126
|
+
children: [/* @__PURE__ */ b(g, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ b(n, {
|
|
112
127
|
placeholder: "Search by action, actor, or resource...",
|
|
113
|
-
value:
|
|
114
|
-
onChange: (e) =>
|
|
128
|
+
value: y,
|
|
129
|
+
onChange: (e) => E(e.target.value),
|
|
115
130
|
className: "pl-9"
|
|
116
131
|
})]
|
|
117
|
-
}), /* @__PURE__ */
|
|
132
|
+
}), /* @__PURE__ */ b(n, {
|
|
118
133
|
placeholder: "Filter by resource (e.g. tenant, user)...",
|
|
119
|
-
value:
|
|
134
|
+
value: O,
|
|
120
135
|
onChange: (e) => {
|
|
121
|
-
|
|
136
|
+
v(1), k(e.target.value);
|
|
122
137
|
},
|
|
123
138
|
className: "max-w-xs"
|
|
124
139
|
})]
|
|
125
140
|
}),
|
|
126
|
-
|
|
141
|
+
N && /* @__PURE__ */ x("div", {
|
|
127
142
|
className: "rounded-md border border-status-error-border/50 bg-status-error-bg/10 p-4 text-sm text-status-error-text",
|
|
128
|
-
children: ["Failed to load audit logs: ",
|
|
143
|
+
children: ["Failed to load audit logs: ", N.message]
|
|
129
144
|
}),
|
|
130
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ b(o, {
|
|
131
146
|
columns: [
|
|
132
147
|
{
|
|
133
148
|
key: "action",
|
|
134
149
|
header: "Action",
|
|
135
|
-
render: (e) => /* @__PURE__ */
|
|
150
|
+
render: (e) => /* @__PURE__ */ x("div", {
|
|
136
151
|
className: "flex items-center gap-2",
|
|
137
|
-
children: [/* @__PURE__ */
|
|
152
|
+
children: [/* @__PURE__ */ b("span", {
|
|
138
153
|
className: "text-text-secondary",
|
|
139
|
-
children:
|
|
140
|
-
}), /* @__PURE__ */
|
|
154
|
+
children: D(e.action)
|
|
155
|
+
}), /* @__PURE__ */ b("span", {
|
|
141
156
|
className: "font-mono text-sm font-medium text-text-primary",
|
|
142
157
|
children: e.action
|
|
143
158
|
})]
|
|
@@ -147,12 +162,12 @@ function T() {
|
|
|
147
162
|
key: "actorId",
|
|
148
163
|
header: "Actor",
|
|
149
164
|
width: "180px",
|
|
150
|
-
render: (e) => /* @__PURE__ */
|
|
165
|
+
render: (e) => /* @__PURE__ */ x("div", {
|
|
151
166
|
className: "min-w-0",
|
|
152
|
-
children: [/* @__PURE__ */
|
|
167
|
+
children: [/* @__PURE__ */ b("div", {
|
|
153
168
|
className: "truncate text-sm",
|
|
154
169
|
children: e.actorId
|
|
155
|
-
}), /* @__PURE__ */
|
|
170
|
+
}), /* @__PURE__ */ b("div", {
|
|
156
171
|
className: "text-xs text-text-secondary capitalize",
|
|
157
172
|
children: e.actorType
|
|
158
173
|
})]
|
|
@@ -162,12 +177,12 @@ function T() {
|
|
|
162
177
|
key: "resource",
|
|
163
178
|
header: "Resource",
|
|
164
179
|
width: "150px",
|
|
165
|
-
render: (e) => /* @__PURE__ */
|
|
180
|
+
render: (e) => /* @__PURE__ */ x("div", {
|
|
166
181
|
className: "min-w-0",
|
|
167
|
-
children: [/* @__PURE__ */
|
|
182
|
+
children: [/* @__PURE__ */ b("div", {
|
|
168
183
|
className: "truncate text-sm",
|
|
169
184
|
children: e.resource
|
|
170
|
-
}), e.resourceId && /* @__PURE__ */
|
|
185
|
+
}), e.resourceId && /* @__PURE__ */ x("div", {
|
|
171
186
|
className: "truncate text-xs text-text-secondary",
|
|
172
187
|
children: ["#", String(e.resourceId).slice(-8)]
|
|
173
188
|
})]
|
|
@@ -177,7 +192,7 @@ function T() {
|
|
|
177
192
|
key: "tenantId",
|
|
178
193
|
header: "Tenant",
|
|
179
194
|
width: "130px",
|
|
180
|
-
render: (e) => /* @__PURE__ */
|
|
195
|
+
render: (e) => /* @__PURE__ */ b("span", {
|
|
181
196
|
className: "text-xs text-text-secondary",
|
|
182
197
|
children: e.tenantId ? `#${e.tenantId.slice(-8)}` : "—"
|
|
183
198
|
})
|
|
@@ -186,7 +201,7 @@ function T() {
|
|
|
186
201
|
key: "ipAddress",
|
|
187
202
|
header: "IP",
|
|
188
203
|
width: "120px",
|
|
189
|
-
render: (e) => /* @__PURE__ */
|
|
204
|
+
render: (e) => /* @__PURE__ */ b("span", {
|
|
190
205
|
className: "font-mono text-xs text-text-secondary",
|
|
191
206
|
children: e.ipAddress ?? "—"
|
|
192
207
|
})
|
|
@@ -195,25 +210,25 @@ function T() {
|
|
|
195
210
|
key: "createdAt",
|
|
196
211
|
header: "Time",
|
|
197
212
|
width: "110px",
|
|
198
|
-
render: (e) =>
|
|
213
|
+
render: (e) => a(e.createdAt)
|
|
199
214
|
}
|
|
200
215
|
],
|
|
201
|
-
data:
|
|
216
|
+
data: F,
|
|
202
217
|
keyExtractor: (e) => e.id,
|
|
203
|
-
loading:
|
|
204
|
-
emptyState: /* @__PURE__ */
|
|
218
|
+
loading: M,
|
|
219
|
+
emptyState: /* @__PURE__ */ b(t, {
|
|
205
220
|
illustration: "empty-files",
|
|
206
|
-
icon: /* @__PURE__ */
|
|
221
|
+
icon: /* @__PURE__ */ b(m, { className: "h-8 w-8" }),
|
|
207
222
|
title: "No audit logs found",
|
|
208
223
|
description: "Audit events will appear here when actions are performed"
|
|
209
224
|
})
|
|
210
225
|
}),
|
|
211
|
-
|
|
212
|
-
page:
|
|
213
|
-
totalPages:
|
|
214
|
-
totalItems:
|
|
215
|
-
pageSize:
|
|
216
|
-
onPageChange:
|
|
226
|
+
I > T && /* @__PURE__ */ b(s, {
|
|
227
|
+
page: _,
|
|
228
|
+
totalPages: L,
|
|
229
|
+
totalItems: I,
|
|
230
|
+
pageSize: T,
|
|
231
|
+
onPageChange: v
|
|
217
232
|
})
|
|
218
233
|
]
|
|
219
234
|
})
|
|
@@ -221,6 +236,6 @@ function T() {
|
|
|
221
236
|
});
|
|
222
237
|
}
|
|
223
238
|
//#endregion
|
|
224
|
-
export {
|
|
239
|
+
export { O as AuditLogsPage };
|
|
225
240
|
|
|
226
241
|
//# sourceMappingURL=AuditLogsPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuditLogsPage.js","names":[],"sources":["../../../src/admin/pages/AuditLogsPage.tsx"],"sourcesContent":["import { useState, useMemo, useCallback } from 'react';\nimport { FileText, Search, Download, User, Settings, Shield, Database, Key } from 'lucide-react';\nimport { SaveToFilesButton } from '@burdenoff/fe-libs/storage';\nimport {\n PageLayout,\n Input,\n DataTable,\n Pagination,\n EmptyState,\n Button,\n PermissionGuard,\n} from '../components';\nimport { useAdminPermissions } from '../hooks/useAdminPermissions';\nimport { formatRelativeTime } from '../utils/formatters';\nimport { useListAuditLogsQuery } from '../../generated/global-operations';\n\nconst PAGE_SIZE = 20;\n\nconst ACTION_ICONS: Record<string, React.ReactNode> = {\n auth: <User className=\"h-3 w-3\" />,\n user: <User className=\"h-3 w-3\" />,\n settings: <Settings className=\"h-3 w-3\" />,\n rbac: <Shield className=\"h-3 w-3\" />,\n data: <Database className=\"h-3 w-3\" />,\n api: <Key className=\"h-3 w-3\" />,\n};\n\nfunction getActionIcon(action: string) {\n const prefix = action.split('.')[0];\n return ACTION_ICONS[prefix] ?? <FileText className=\"h-3 w-3\" />;\n}\n\n/**\n * Audit logs page — connected to real backend\n */\nexport function AuditLogsPage() {\n const { canViewAuditLogs, isLoading: permissionsLoading } = useAdminPermissions();\n\n const [page, setPage] = useState(1);\n const [search, setSearch] = useState('');\n const [resourceFilter, setResourceFilter] = useState('');\n\n const skipQueries = permissionsLoading || !canViewAuditLogs;\n\n const { data, loading, error } = useListAuditLogsQuery({\n variables: {\n resource: resourceFilter || undefined,\n limit: PAGE_SIZE,\n offset: (page - 1) * PAGE_SIZE,\n },\n fetchPolicy: 'cache-and-network',\n skip: skipQueries,\n });\n\n const auditLogs = useMemo(() => {\n const edges = data?.auditLogs?.edges ?? [];\n return edges.map((e: (typeof edges)[number]) => e.node);\n }, [data]);\n\n type AuditLogNode = (typeof auditLogs)[number];\n\n const filteredLogs = useMemo(() => {\n if (!search) return auditLogs;\n const q = search.toLowerCase();\n return auditLogs.filter(\n (log: AuditLogNode) =>\n log.action.toLowerCase().includes(q) ||\n log.actorId.toLowerCase().includes(q) ||\n log.resource.toLowerCase().includes(q) ||\n log.tenantId.toLowerCase().includes(q)\n );\n }, [auditLogs, search]);\n\n const total = data?.auditLogs?.totalCount ?? 0;\n const totalPages = Math.ceil(total / PAGE_SIZE);\n\n const buildAuditCsvBlob = useCallback((): Blob | null => {\n const rows = filteredLogs;\n if (rows.length === 0) return null;\n\n const headers = [\n 'id',\n 'action',\n 'actorId',\n 'actorType',\n 'resource',\n 'resourceId',\n 'tenantId',\n 'ipAddress',\n 'userAgent',\n 'changes',\n 'metadata',\n 'createdAt',\n ];\n\n const escape = (value: unknown): string => {\n if (value === null || value === undefined) return '';\n const str = typeof value === 'object' ? JSON.stringify(value) : String(value);\n // RFC 4180: wrap in quotes if it contains quote, comma, or newline; double internal quotes\n if (/[\",\\n\\r]/.test(str)) {\n return `\"${str.replace(/\"/g, '\"\"')}\"`;\n }\n return str;\n };\n\n const csvLines = [\n headers.join(','),\n ...rows.map((log: AuditLogNode) =>\n [\n escape(log.id),\n escape(log.action),\n escape(log.actorId),\n escape(log.actorType),\n escape(log.resource),\n escape(log.resourceId),\n escape(log.tenantId),\n escape(log.ipAddress),\n escape((log as { userAgent?: unknown }).userAgent),\n escape((log as { changes?: unknown }).changes),\n escape((log as { metadata?: unknown }).metadata),\n escape(log.createdAt),\n ].join(',')\n ),\n ];\n\n return new Blob([csvLines.join('\\n')], { type: 'text/csv;charset=utf-8;' });\n }, [filteredLogs]);\n\n const exportToCsv = useCallback(() => {\n const blob = buildAuditCsvBlob();\n if (!blob) return;\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n const stamp = new Date().toISOString().replace(/[:.]/g, '-');\n link.href = url;\n link.setAttribute('download', `audit-logs-${stamp}.csv`);\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n URL.revokeObjectURL(url);\n }, [buildAuditCsvBlob]);\n\n const columns = [\n {\n key: 'action',\n header: 'Action',\n render: (log: (typeof auditLogs)[number]) => (\n <div className=\"flex items-center gap-2\">\n <span className=\"text-text-secondary\">{getActionIcon(log.action)}</span>\n <span className=\"font-mono text-sm font-medium text-text-primary\">{log.action}</span>\n </div>\n ),\n },\n {\n key: 'actorId',\n header: 'Actor',\n width: '180px',\n render: (log: (typeof auditLogs)[number]) => (\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm\">{log.actorId}</div>\n <div className=\"text-xs text-text-secondary capitalize\">{log.actorType}</div>\n </div>\n ),\n },\n {\n key: 'resource',\n header: 'Resource',\n width: '150px',\n render: (log: (typeof auditLogs)[number]) => (\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm\">{log.resource}</div>\n {log.resourceId && (\n <div className=\"truncate text-xs text-text-secondary\">\n #{String(log.resourceId).slice(-8)}\n </div>\n )}\n </div>\n ),\n },\n {\n key: 'tenantId',\n header: 'Tenant',\n width: '130px',\n render: (log: (typeof auditLogs)[number]) => (\n <span className=\"text-xs text-text-secondary\">\n {log.tenantId ? `#${log.tenantId.slice(-8)}` : '—'}\n </span>\n ),\n },\n {\n key: 'ipAddress',\n header: 'IP',\n width: '120px',\n render: (log: (typeof auditLogs)[number]) => (\n <span className=\"font-mono text-xs text-text-secondary\">{log.ipAddress ?? '—'}</span>\n ),\n },\n {\n key: 'createdAt',\n header: 'Time',\n width: '110px',\n render: (log: (typeof auditLogs)[number]) => formatRelativeTime(log.createdAt),\n },\n ];\n\n return (\n <PermissionGuard\n allowed={canViewAuditLogs}\n isLoading={permissionsLoading}\n pageTitle=\"Audit Logs\"\n denyMessage=\"You don't have permission to view audit logs.\"\n >\n <PageLayout\n title=\"Audit Logs\"\n gradientWord=\"Logs\"\n description={`Security and compliance audit trail${total ? ` · ${total} total` : ''}`}\n actions={\n <SaveToFilesButton\n label=\"Export CSV\"\n disabled={loading || filteredLogs.length === 0}\n testId=\"audit-logs-export\"\n defaultFolderPath=\"/Admin/Audit Logs\"\n source={{\n kind: 'blob',\n filename: `audit-logs-${new Date().toISOString().replace(/[:.]/g, '-')}.csv`,\n mimeType: 'text/csv',\n getBlob: async () => {\n const blob = buildAuditCsvBlob();\n return blob ? { blob } : null;\n },\n }}\n onDownload={exportToCsv}\n />\n }\n >\n <div className=\"space-y-4\">\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"relative max-w-sm flex-1\">\n <Search className=\"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary\" />\n <Input\n placeholder=\"Search by action, actor, or resource...\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n className=\"pl-9\"\n />\n </div>\n <Input\n placeholder=\"Filter by resource (e.g. tenant, user)...\"\n value={resourceFilter}\n onChange={(e) => {\n setPage(1);\n setResourceFilter(e.target.value);\n }}\n className=\"max-w-xs\"\n />\n </div>\n\n {error && (\n <div className=\"rounded-md border border-status-error-border/50 bg-status-error-bg/10 p-4 text-sm text-status-error-text\">\n Failed to load audit logs: {error.message}\n </div>\n )}\n\n <DataTable\n columns={columns}\n data={filteredLogs}\n keyExtractor={(l) => l.id}\n loading={loading}\n emptyState={\n <EmptyState\n illustration=\"empty-files\"\n icon={<FileText className=\"h-8 w-8\" />}\n title=\"No audit logs found\"\n description=\"Audit events will appear here when actions are performed\"\n />\n }\n />\n\n {total > PAGE_SIZE && (\n <Pagination\n page={page}\n totalPages={totalPages}\n totalItems={total}\n pageSize={PAGE_SIZE}\n onPageChange={setPage}\n />\n )}\n </div>\n </PageLayout>\n </PermissionGuard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAgBA,IAAM,IAAY,IAEZ,IAAgD;CACpD,MAAM,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA;CAClC,MAAM,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA;CAClC,UAAU,kBAAC,GAAD,EAAU,WAAU,WAAY,CAAA;CAC1C,MAAM,kBAAC,GAAD,EAAQ,WAAU,WAAY,CAAA;CACpC,MAAM,kBAAC,GAAD,EAAU,WAAU,WAAY,CAAA;CACtC,KAAK,kBAAC,GAAD,EAAK,WAAU,WAAY,CAAA;CACjC;AAED,SAAS,EAAc,GAAgB;AAErC,QAAO,EADQ,EAAO,MAAM,IAAI,CAAC,OACF,kBAAC,GAAD,EAAU,WAAU,WAAY,CAAA;;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AAU;oBAAf,CAAsD,KAClD,OAAO,EAAI,WAAW,CAAC,MAAM,GAAG,CAC9B;YAEJ;;QAET;OACD;QACE,KAAK;QACL,QAAQ;QACR,OAAO;QACP,SAAS,MACP,kBAAC,QAAD;SAAM,WAAU;mBACb,EAAI,WAAW,IAAI,EAAI,SAAS,MAAM,GAAG,KAAK;SAC1C,CAAA;QAEV;OACD;QACE,KAAK;QACL,QAAQ;QACR,OAAO;QACP,SAAS,MACP,kBAAC,QAAD;SAAM,WAAU;mBAAyC,EAAI,aAAa;SAAW,CAAA;QAExF;OACD;QACE,KAAK;QACL,QAAQ;QACR,OAAO;QACP,SAAS,MAAoC,EAAmB,EAAI,UAAU;QAC/E;OACF;MA8DS,MAAM;MACN,eAAe,MAAM,EAAE;MACd;MACT,YACE,kBAAC,GAAD;OACE,cAAa;OACb,MAAM,kBAAC,GAAD,EAAU,WAAU,WAAY,CAAA;OACtC,OAAM;OACN,aAAY;OACZ,CAAA;MAEJ,CAAA;KAED,IAAQ,KACP,kBAAC,GAAD;MACQ;MACM;MACZ,YAAY;MACZ,UAAU;MACV,cAAc;MACd,CAAA;KAEA;;GACK,CAAA;EACG,CAAA"}
|
|
1
|
+
{"version":3,"file":"AuditLogsPage.js","names":[],"sources":["../../../src/admin/pages/AuditLogsPage.tsx"],"sourcesContent":["import { useState, useMemo, useCallback } from 'react';\nimport { FileText, Search, Download, User, Settings, Shield, Database, Key } from 'lucide-react';\nimport { SaveToFilesButton } from '@burdenoff/fe-libs/storage';\nimport {\n PageLayout,\n Input,\n DataTable,\n Pagination,\n EmptyState,\n Button,\n PermissionGuard,\n} from '../components';\nimport { useAdminPermissions } from '../hooks/useAdminPermissions';\nimport { formatRelativeTime, formatNumber } from '../utils/formatters';\nimport { useListAuditLogsQuery } from '../../generated/global-operations';\nimport { PagePurpose, EmphasisPanel } from '@burdenoff/fe-libs/ui';\n\nconst PAGE_SIZE = 20;\n\nconst ACTION_ICONS: Record<string, React.ReactNode> = {\n auth: <User className=\"h-3 w-3\" />,\n user: <User className=\"h-3 w-3\" />,\n settings: <Settings className=\"h-3 w-3\" />,\n rbac: <Shield className=\"h-3 w-3\" />,\n data: <Database className=\"h-3 w-3\" />,\n api: <Key className=\"h-3 w-3\" />,\n};\n\nfunction getActionIcon(action: string) {\n const prefix = action.split('.')[0];\n return ACTION_ICONS[prefix] ?? <FileText className=\"h-3 w-3\" />;\n}\n\n/**\n * Audit logs page — connected to real backend\n */\nexport function AuditLogsPage() {\n const { canViewAuditLogs, isLoading: permissionsLoading } = useAdminPermissions();\n\n const [page, setPage] = useState(1);\n const [search, setSearch] = useState('');\n const [resourceFilter, setResourceFilter] = useState('');\n\n const skipQueries = permissionsLoading || !canViewAuditLogs;\n\n const { data, loading, error } = useListAuditLogsQuery({\n variables: {\n resource: resourceFilter || undefined,\n limit: PAGE_SIZE,\n offset: (page - 1) * PAGE_SIZE,\n },\n fetchPolicy: 'cache-and-network',\n skip: skipQueries,\n });\n\n const auditLogs = useMemo(() => {\n const edges = data?.auditLogs?.edges ?? [];\n return edges.map((e: (typeof edges)[number]) => e.node);\n }, [data]);\n\n type AuditLogNode = (typeof auditLogs)[number];\n\n const filteredLogs = useMemo(() => {\n if (!search) return auditLogs;\n const q = search.toLowerCase();\n return auditLogs.filter(\n (log: AuditLogNode) =>\n log.action.toLowerCase().includes(q) ||\n log.actorId.toLowerCase().includes(q) ||\n log.resource.toLowerCase().includes(q) ||\n log.tenantId.toLowerCase().includes(q)\n );\n }, [auditLogs, search]);\n\n const total = data?.auditLogs?.totalCount ?? 0;\n const totalPages = Math.ceil(total / PAGE_SIZE);\n\n const buildAuditCsvBlob = useCallback((): Blob | null => {\n const rows = filteredLogs;\n if (rows.length === 0) return null;\n\n const headers = [\n 'id',\n 'action',\n 'actorId',\n 'actorType',\n 'resource',\n 'resourceId',\n 'tenantId',\n 'ipAddress',\n 'userAgent',\n 'changes',\n 'metadata',\n 'createdAt',\n ];\n\n const escape = (value: unknown): string => {\n if (value === null || value === undefined) return '';\n const str = typeof value === 'object' ? JSON.stringify(value) : String(value);\n // RFC 4180: wrap in quotes if it contains quote, comma, or newline; double internal quotes\n if (/[\",\\n\\r]/.test(str)) {\n return `\"${str.replace(/\"/g, '\"\"')}\"`;\n }\n return str;\n };\n\n const csvLines = [\n headers.join(','),\n ...rows.map((log: AuditLogNode) =>\n [\n escape(log.id),\n escape(log.action),\n escape(log.actorId),\n escape(log.actorType),\n escape(log.resource),\n escape(log.resourceId),\n escape(log.tenantId),\n escape(log.ipAddress),\n escape((log as { userAgent?: unknown }).userAgent),\n escape((log as { changes?: unknown }).changes),\n escape((log as { metadata?: unknown }).metadata),\n escape(log.createdAt),\n ].join(',')\n ),\n ];\n\n return new Blob([csvLines.join('\\n')], { type: 'text/csv;charset=utf-8;' });\n }, [filteredLogs]);\n\n const exportToCsv = useCallback(() => {\n const blob = buildAuditCsvBlob();\n if (!blob) return;\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n const stamp = new Date().toISOString().replace(/[:.]/g, '-');\n link.href = url;\n link.setAttribute('download', `audit-logs-${stamp}.csv`);\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n URL.revokeObjectURL(url);\n }, [buildAuditCsvBlob]);\n\n const columns = [\n {\n key: 'action',\n header: 'Action',\n render: (log: (typeof auditLogs)[number]) => (\n <div className=\"flex items-center gap-2\">\n <span className=\"text-text-secondary\">{getActionIcon(log.action)}</span>\n <span className=\"font-mono text-sm font-medium text-text-primary\">{log.action}</span>\n </div>\n ),\n },\n {\n key: 'actorId',\n header: 'Actor',\n width: '180px',\n render: (log: (typeof auditLogs)[number]) => (\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm\">{log.actorId}</div>\n <div className=\"text-xs text-text-secondary capitalize\">{log.actorType}</div>\n </div>\n ),\n },\n {\n key: 'resource',\n header: 'Resource',\n width: '150px',\n render: (log: (typeof auditLogs)[number]) => (\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm\">{log.resource}</div>\n {log.resourceId && (\n <div className=\"truncate text-xs text-text-secondary\">\n #{String(log.resourceId).slice(-8)}\n </div>\n )}\n </div>\n ),\n },\n {\n key: 'tenantId',\n header: 'Tenant',\n width: '130px',\n render: (log: (typeof auditLogs)[number]) => (\n <span className=\"text-xs text-text-secondary\">\n {log.tenantId ? `#${log.tenantId.slice(-8)}` : '—'}\n </span>\n ),\n },\n {\n key: 'ipAddress',\n header: 'IP',\n width: '120px',\n render: (log: (typeof auditLogs)[number]) => (\n <span className=\"font-mono text-xs text-text-secondary\">{log.ipAddress ?? '—'}</span>\n ),\n },\n {\n key: 'createdAt',\n header: 'Time',\n width: '110px',\n render: (log: (typeof auditLogs)[number]) => formatRelativeTime(log.createdAt),\n },\n ];\n\n return (\n <PermissionGuard\n allowed={canViewAuditLogs}\n isLoading={permissionsLoading}\n pageTitle=\"Audit Logs\"\n denyMessage=\"You don't have permission to view audit logs.\"\n >\n <PageLayout\n title=\"Audit Logs\"\n gradientWord=\"Logs\"\n description={`Security and compliance audit trail${total ? ` · ${total} total` : ''}`}\n actions={\n <SaveToFilesButton\n label=\"Export CSV\"\n disabled={loading || filteredLogs.length === 0}\n testId=\"audit-logs-export\"\n defaultFolderPath=\"/Admin/Audit Logs\"\n source={{\n kind: 'blob',\n filename: `audit-logs-${new Date().toISOString().replace(/[:.]/g, '-')}.csv`,\n mimeType: 'text/csv',\n getBlob: async () => {\n const blob = buildAuditCsvBlob();\n return blob ? { blob } : null;\n },\n }}\n onDownload={exportToCsv}\n />\n }\n >\n <div className=\"space-y-4\">\n <PagePurpose>\n A tamper-evident record of who did what across the platform — every sign-in,\n permission change, and data action. Use this page to investigate a security incident,\n answer a compliance question, or export the trail as CSV for an auditor.\n </PagePurpose>\n\n {/* Emphasis: total recorded audit events. */}\n <EmphasisPanel className=\"flex items-center gap-4 p-5\">\n <div className=\"flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-action-primary-bg/15 text-action-primary-bg\">\n <FileText className=\"h-6 w-6\" />\n </div>\n <div>\n <div className=\"text-3xl font-bold tabular-nums text-text-primary\">\n {formatNumber(total)}\n </div>\n <p className=\"text-sm text-text-secondary\">recorded audit events</p>\n </div>\n </EmphasisPanel>\n\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"relative max-w-sm flex-1\">\n <Search className=\"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary\" />\n <Input\n placeholder=\"Search by action, actor, or resource...\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n className=\"pl-9\"\n />\n </div>\n <Input\n placeholder=\"Filter by resource (e.g. tenant, user)...\"\n value={resourceFilter}\n onChange={(e) => {\n setPage(1);\n setResourceFilter(e.target.value);\n }}\n className=\"max-w-xs\"\n />\n </div>\n\n {error && (\n <div className=\"rounded-md border border-status-error-border/50 bg-status-error-bg/10 p-4 text-sm text-status-error-text\">\n Failed to load audit logs: {error.message}\n </div>\n )}\n\n <DataTable\n columns={columns}\n data={filteredLogs}\n keyExtractor={(l) => l.id}\n loading={loading}\n emptyState={\n <EmptyState\n illustration=\"empty-files\"\n icon={<FileText className=\"h-8 w-8\" />}\n title=\"No audit logs found\"\n description=\"Audit events will appear here when actions are performed\"\n />\n }\n />\n\n {total > PAGE_SIZE && (\n <Pagination\n page={page}\n totalPages={totalPages}\n totalItems={total}\n pageSize={PAGE_SIZE}\n onPageChange={setPage}\n />\n )}\n </div>\n </PageLayout>\n </PermissionGuard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,IAAM,IAAY,IAEZ,IAAgD;CACpD,MAAM,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA;CAClC,MAAM,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA;CAClC,UAAU,kBAAC,GAAD,EAAU,WAAU,WAAY,CAAA;CAC1C,MAAM,kBAAC,GAAD,EAAQ,WAAU,WAAY,CAAA;CACpC,MAAM,kBAAC,GAAD,EAAU,WAAU,WAAY,CAAA;CACtC,KAAK,kBAAC,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