@burdenoff/microfe-admin 2026.610.1 → 2026.624.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 +4 -4
- package/dist/admin/components/Charts.js.map +1 -1
- package/dist/admin/components/ConfirmDialog.js +6 -6
- package/dist/admin/components/ConfirmDialog.js.map +1 -1
- package/dist/admin/components/DataTable.js +7 -7
- package/dist/admin/components/DataTable.js.map +1 -1
- package/dist/admin/components/FormSheet.js +7 -7
- package/dist/admin/components/FormSheet.js.map +1 -1
- package/dist/admin/components/MetricCard.js +4 -4
- package/dist/admin/components/MetricCard.js.map +1 -1
- package/dist/admin/components/PageLayout.js +3 -3
- package/dist/admin/components/PageLayout.js.map +1 -1
- package/dist/admin/components/PermissionGuard.js +1 -1
- package/dist/admin/components/PermissionGuard.js.map +1 -1
- package/dist/admin/components/RowActions.js +2 -2
- package/dist/admin/components/RowActions.js.map +1 -1
- package/dist/admin/components/TenantMembersPanel.js +15 -15
- package/dist/admin/components/TenantMembersPanel.js.map +1 -1
- package/dist/admin/components/TenantSsoPanel.js +14 -14
- package/dist/admin/components/TenantSsoPanel.js.map +1 -1
- package/dist/admin/components/Toast.js +9 -9
- package/dist/admin/components/Toast.js.map +1 -1
- package/dist/admin/components/forms/SubscriptionForm.js +10 -10
- package/dist/admin/components/forms/SubscriptionForm.js.map +1 -1
- package/dist/admin/components/forms/TenantForm.js +8 -8
- package/dist/admin/components/forms/TenantForm.js.map +1 -1
- package/dist/admin/components/forms/TicketForm.js +2 -2
- package/dist/admin/components/forms/TicketForm.js.map +1 -1
- package/dist/admin/components/forms/UserForm.js +8 -8
- package/dist/admin/components/forms/UserForm.js.map +1 -1
- package/dist/admin/components/ui.js +16 -16
- package/dist/admin/components/ui.js.map +1 -1
- package/dist/admin/constants/index.js +8 -8
- package/dist/admin/constants/index.js.map +1 -1
- package/dist/admin/pages/AuditLogsPage.js +8 -8
- package/dist/admin/pages/AuditLogsPage.js.map +1 -1
- package/dist/admin/pages/CommunicationsPage.js +2 -2
- package/dist/admin/pages/CommunicationsPage.js.map +1 -1
- package/dist/admin/pages/FeatureFlagsPage.js +4 -4
- package/dist/admin/pages/FeatureFlagsPage.js.map +1 -1
- package/dist/admin/pages/OrganizationsListPage.js +6 -6
- package/dist/admin/pages/OrganizationsListPage.js.map +1 -1
- package/dist/admin/pages/ProductsPage.js +7 -7
- package/dist/admin/pages/ProductsPage.js.map +1 -1
- package/dist/admin/pages/ReferralsPage.js +23 -23
- package/dist/admin/pages/ReferralsPage.js.map +1 -1
- package/dist/admin/pages/RolesPermissionsPage.js +8 -8
- package/dist/admin/pages/RolesPermissionsPage.js.map +1 -1
- package/dist/admin/pages/SREPage.js +8 -8
- package/dist/admin/pages/SREPage.js.map +1 -1
- package/dist/admin/pages/SandboxSettingsPage.js +20 -20
- package/dist/admin/pages/SandboxSettingsPage.js.map +1 -1
- package/dist/admin/pages/SettingsPage.js +20 -20
- package/dist/admin/pages/SettingsPage.js.map +1 -1
- package/dist/admin/pages/SyncFailuresPage.js +11 -11
- package/dist/admin/pages/SyncFailuresPage.js.map +1 -1
- package/dist/admin/pages/TenantDetailPage.js +22 -22
- package/dist/admin/pages/TenantDetailPage.js.map +1 -1
- package/dist/admin/pages/TenantFormRoutePage.js +2 -2
- package/dist/admin/pages/TenantFormRoutePage.js.map +1 -1
- package/dist/admin/pages/TenantsListPage.js +5 -5
- package/dist/admin/pages/TenantsListPage.js.map +1 -1
- package/dist/admin/pages/UsersListPage.js +6 -6
- package/dist/admin/pages/UsersListPage.js.map +1 -1
- package/dist/admin/pages/WaitlistPage.js +7 -7
- package/dist/admin/pages/WaitlistPage.js.map +1 -1
- package/dist/admin/pages/WorkflowsPage.js +3 -3
- package/dist/admin/pages/WorkflowsPage.js.map +1 -1
- package/dist/admin/pages/WorkspacesListPage.js +8 -8
- package/dist/admin/pages/WorkspacesListPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -46,7 +46,7 @@ function x() {
|
|
|
46
46
|
children: [
|
|
47
47
|
/* @__PURE__ */ y(n, { children: [/* @__PURE__ */ y(a, { children: [/* @__PURE__ */ y("div", {
|
|
48
48
|
className: "flex items-center gap-2",
|
|
49
|
-
children: [/* @__PURE__ */ v(g, { className: "h-5 w-5 text-
|
|
49
|
+
children: [/* @__PURE__ */ v(g, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ v(o, {
|
|
50
50
|
className: "text-lg",
|
|
51
51
|
children: w("admin.settings.general.title", "General")
|
|
52
52
|
})]
|
|
@@ -78,7 +78,7 @@ function x() {
|
|
|
78
78
|
className: "text-sm font-medium",
|
|
79
79
|
children: w("admin.settings.general.defaultTimezone", "Default Timezone")
|
|
80
80
|
}), /* @__PURE__ */ y("select", {
|
|
81
|
-
className: "h-10 w-full rounded-md border border-
|
|
81
|
+
className: "h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
|
|
82
82
|
children: [
|
|
83
83
|
/* @__PURE__ */ v("option", {
|
|
84
84
|
value: "UTC",
|
|
@@ -111,7 +111,7 @@ function x() {
|
|
|
111
111
|
})] }),
|
|
112
112
|
/* @__PURE__ */ y(n, { children: [/* @__PURE__ */ y(a, { children: [/* @__PURE__ */ y("div", {
|
|
113
113
|
className: "flex items-center gap-2",
|
|
114
|
-
children: [/* @__PURE__ */ v(_, { className: "h-5 w-5 text-
|
|
114
|
+
children: [/* @__PURE__ */ v(_, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ v(o, {
|
|
115
115
|
className: "text-lg",
|
|
116
116
|
children: w("admin.settings.security.title", "Security")
|
|
117
117
|
})]
|
|
@@ -119,12 +119,12 @@ function x() {
|
|
|
119
119
|
className: "space-y-4",
|
|
120
120
|
children: [
|
|
121
121
|
/* @__PURE__ */ y("div", {
|
|
122
|
-
className: "flex items-center justify-between rounded-lg border border-border p-4",
|
|
122
|
+
className: "flex items-center justify-between rounded-lg border border-border-subtle p-4",
|
|
123
123
|
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("div", {
|
|
124
124
|
className: "font-medium",
|
|
125
125
|
children: w("admin.settings.security.twoFactor.title", "Two-Factor Authentication")
|
|
126
126
|
}), /* @__PURE__ */ v("div", {
|
|
127
|
-
className: "text-sm text-
|
|
127
|
+
className: "text-sm text-text-secondary",
|
|
128
128
|
children: w("admin.settings.security.twoFactor.description", "Require 2FA for all admin accounts")
|
|
129
129
|
})] }), /* @__PURE__ */ v(t, {
|
|
130
130
|
variant: "outline",
|
|
@@ -132,15 +132,15 @@ function x() {
|
|
|
132
132
|
})]
|
|
133
133
|
}),
|
|
134
134
|
/* @__PURE__ */ y("div", {
|
|
135
|
-
className: "flex items-center justify-between rounded-lg border border-border p-4",
|
|
135
|
+
className: "flex items-center justify-between rounded-lg border border-border-subtle p-4",
|
|
136
136
|
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("div", {
|
|
137
137
|
className: "font-medium",
|
|
138
138
|
children: w("admin.settings.security.sessionTimeout.title", "Session Timeout")
|
|
139
139
|
}), /* @__PURE__ */ v("div", {
|
|
140
|
-
className: "text-sm text-
|
|
140
|
+
className: "text-sm text-text-secondary",
|
|
141
141
|
children: w("admin.settings.security.sessionTimeout.description", "Auto-logout after inactivity")
|
|
142
142
|
})] }), /* @__PURE__ */ y("select", {
|
|
143
|
-
className: "h-9 rounded-md border border-
|
|
143
|
+
className: "h-9 rounded-md border border-border-default bg-bg-surface px-3 text-sm",
|
|
144
144
|
children: [
|
|
145
145
|
/* @__PURE__ */ v("option", {
|
|
146
146
|
value: "15",
|
|
@@ -162,12 +162,12 @@ function x() {
|
|
|
162
162
|
})]
|
|
163
163
|
}),
|
|
164
164
|
/* @__PURE__ */ y("div", {
|
|
165
|
-
className: "flex items-center justify-between rounded-lg border border-border p-4",
|
|
165
|
+
className: "flex items-center justify-between rounded-lg border border-border-subtle p-4",
|
|
166
166
|
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("div", {
|
|
167
167
|
className: "font-medium",
|
|
168
168
|
children: w("admin.settings.security.ipAllowlist.title", "IP Allowlist")
|
|
169
169
|
}), /* @__PURE__ */ v("div", {
|
|
170
|
-
className: "text-sm text-
|
|
170
|
+
className: "text-sm text-text-secondary",
|
|
171
171
|
children: w("admin.settings.security.ipAllowlist.description", "Restrict access to specific IPs")
|
|
172
172
|
})] }), /* @__PURE__ */ v(t, {
|
|
173
173
|
variant: "outline",
|
|
@@ -178,19 +178,19 @@ function x() {
|
|
|
178
178
|
})] }),
|
|
179
179
|
/* @__PURE__ */ y(n, { children: [/* @__PURE__ */ y(a, { children: [/* @__PURE__ */ y("div", {
|
|
180
180
|
className: "flex items-center gap-2",
|
|
181
|
-
children: [/* @__PURE__ */ v(f, { className: "h-5 w-5 text-
|
|
181
|
+
children: [/* @__PURE__ */ v(f, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ v(o, {
|
|
182
182
|
className: "text-lg",
|
|
183
183
|
children: w("admin.settings.notifications.title", "Notifications")
|
|
184
184
|
})]
|
|
185
185
|
}), /* @__PURE__ */ v(i, { children: w("admin.settings.notifications.description", "Configure notification preferences") })] }), /* @__PURE__ */ v(r, {
|
|
186
186
|
className: "space-y-4",
|
|
187
187
|
children: T.map((e) => /* @__PURE__ */ y("div", {
|
|
188
|
-
className: "flex items-center justify-between rounded-lg border border-border p-4",
|
|
188
|
+
className: "flex items-center justify-between rounded-lg border border-border-subtle p-4",
|
|
189
189
|
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("div", {
|
|
190
190
|
className: "font-medium",
|
|
191
191
|
children: e.label
|
|
192
192
|
}), /* @__PURE__ */ v("div", {
|
|
193
|
-
className: "text-sm text-
|
|
193
|
+
className: "text-sm text-text-secondary",
|
|
194
194
|
children: e.description
|
|
195
195
|
})] }), /* @__PURE__ */ y("label", {
|
|
196
196
|
className: "relative inline-flex cursor-pointer items-center",
|
|
@@ -198,7 +198,7 @@ function x() {
|
|
|
198
198
|
type: "checkbox",
|
|
199
199
|
defaultChecked: !0,
|
|
200
200
|
className: "peer sr-only"
|
|
201
|
-
}), /* @__PURE__ */ v("div", { className: "peer h-6 w-11 rounded-full bg-
|
|
201
|
+
}), /* @__PURE__ */ v("div", { className: "peer h-6 w-11 rounded-full bg-bg-sunken after:absolute after:left-[2px] after:top-0.5 after:h-5 after:w-5 after:rounded-full after:bg-bg-surface after:transition-all peer-checked:bg-action-primary-bg peer-checked:after:translate-x-full peer-focus:ring-2 peer-focus:ring-[var(--color-focus-ring)]" })]
|
|
202
202
|
})]
|
|
203
203
|
}, e.key))
|
|
204
204
|
})] })
|
|
@@ -208,14 +208,14 @@ function x() {
|
|
|
208
208
|
children: [
|
|
209
209
|
/* @__PURE__ */ y(n, { children: [/* @__PURE__ */ v(a, { children: /* @__PURE__ */ y("div", {
|
|
210
210
|
className: "flex items-center gap-2",
|
|
211
|
-
children: [/* @__PURE__ */ v(h, { className: "h-5 w-5 text-
|
|
211
|
+
children: [/* @__PURE__ */ v(h, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ v(o, {
|
|
212
212
|
className: "text-lg",
|
|
213
213
|
children: w("admin.settings.apiKeys.title", "API Keys")
|
|
214
214
|
})]
|
|
215
215
|
}) }), /* @__PURE__ */ y(r, {
|
|
216
216
|
className: "space-y-3",
|
|
217
217
|
children: [/* @__PURE__ */ v("p", {
|
|
218
|
-
className: "text-sm text-
|
|
218
|
+
className: "text-sm text-text-secondary",
|
|
219
219
|
children: w("admin.settings.apiKeys.description", "Manage API keys for programmatic access to the admin API.")
|
|
220
220
|
}), /* @__PURE__ */ v(t, {
|
|
221
221
|
variant: "outline",
|
|
@@ -225,14 +225,14 @@ function x() {
|
|
|
225
225
|
})] }),
|
|
226
226
|
/* @__PURE__ */ y(n, { children: [/* @__PURE__ */ v(a, { children: /* @__PURE__ */ y("div", {
|
|
227
227
|
className: "flex items-center gap-2",
|
|
228
|
-
children: [/* @__PURE__ */ v(m, { className: "h-5 w-5 text-
|
|
228
|
+
children: [/* @__PURE__ */ v(m, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ v(o, {
|
|
229
229
|
className: "text-lg",
|
|
230
230
|
children: w("admin.settings.integrations.title", "Integrations")
|
|
231
231
|
})]
|
|
232
232
|
}) }), /* @__PURE__ */ y(r, {
|
|
233
233
|
className: "space-y-3",
|
|
234
234
|
children: [/* @__PURE__ */ v("p", {
|
|
235
|
-
className: "text-sm text-
|
|
235
|
+
className: "text-sm text-text-secondary",
|
|
236
236
|
children: w("admin.settings.integrations.description", "Connect third-party services and tools.")
|
|
237
237
|
}), /* @__PURE__ */ v(t, {
|
|
238
238
|
variant: "outline",
|
|
@@ -242,7 +242,7 @@ function x() {
|
|
|
242
242
|
})] }),
|
|
243
243
|
/* @__PURE__ */ y(n, { children: [/* @__PURE__ */ v(a, { children: /* @__PURE__ */ y("div", {
|
|
244
244
|
className: "flex items-center gap-2",
|
|
245
|
-
children: [/* @__PURE__ */ v(p, { className: "h-5 w-5 text-
|
|
245
|
+
children: [/* @__PURE__ */ v(p, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ v(o, {
|
|
246
246
|
className: "text-lg",
|
|
247
247
|
children: w("admin.settings.data.title", "Data")
|
|
248
248
|
})]
|
|
@@ -262,7 +262,7 @@ function x() {
|
|
|
262
262
|
/* @__PURE__ */ v(c, {}),
|
|
263
263
|
/* @__PURE__ */ v(t, {
|
|
264
264
|
variant: "outline",
|
|
265
|
-
className: "w-full justify-start text-
|
|
265
|
+
className: "w-full justify-start text-status-error-text",
|
|
266
266
|
children: w("admin.settings.data.dangerZone", "Danger Zone")
|
|
267
267
|
})
|
|
268
268
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPage.js","names":[],"sources":["../../../src/admin/pages/SettingsPage.tsx"],"sourcesContent":["import { Settings, Shield, Key, Bell, Globe, Database } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n PageLayout,\n Card,\n CardHeader,\n CardTitle,\n CardContent,\n CardDescription,\n Button,\n Input,\n Separator,\n PermissionGuard,\n} from '../components';\nimport { useAdminPermissions } from '../hooks/useAdminPermissions';\nimport { tWithFallback } from '../utils/i18n';\n\n/**\n * Settings page\n */\nexport function SettingsPage() {\n const { canManageSettings, isLoading: permissionsLoading } = useAdminPermissions();\n const { t } = useI18n();\n const tr = (key: string, fallback: string, params?: Record<string, string | number>): string =>\n tWithFallback(t, key, fallback, params);\n\n const notificationSettings = [\n {\n key: 'newTenantSignups',\n label: tr('admin.settings.notifications.items.newTenantSignups.label', 'New tenant signups'),\n description: tr(\n 'admin.settings.notifications.items.newTenantSignups.description',\n 'Get notified when new tenants register'\n ),\n },\n {\n key: 'paymentFailures',\n label: tr('admin.settings.notifications.items.paymentFailures.label', 'Payment failures'),\n description: tr(\n 'admin.settings.notifications.items.paymentFailures.description',\n 'Alert when payments fail'\n ),\n },\n {\n key: 'criticalTickets',\n label: tr('admin.settings.notifications.items.criticalTickets.label', 'Critical tickets'),\n description: tr(\n 'admin.settings.notifications.items.criticalTickets.description',\n 'Notify on critical support tickets'\n ),\n },\n {\n key: 'systemAlerts',\n label: tr('admin.settings.notifications.items.systemAlerts.label', 'System alerts'),\n description: tr(\n 'admin.settings.notifications.items.systemAlerts.description',\n 'Infrastructure and health alerts'\n ),\n },\n ];\n\n return (\n <PermissionGuard\n allowed={canManageSettings}\n isLoading={permissionsLoading}\n pageTitle={tr('admin.settings.title', 'Settings')}\n denyMessage={tr(\n 'admin.settings.denyMessage',\n \"You don't have permission to manage platform settings.\"\n )}\n >\n <PageLayout\n title={tr('admin.settings.title', 'Settings')}\n description={tr(\n 'admin.settings.description',\n 'Configure platform settings and preferences'\n )}\n >\n <div className=\"grid gap-6 lg:grid-cols-3\">\n {/* Main settings */}\n <div className=\"space-y-6 lg:col-span-2\">\n {/* General */}\n <Card>\n <CardHeader>\n <div className=\"flex items-center gap-2\">\n <Settings className=\"h-5 w-5 text-muted-foreground\" />\n <CardTitle className=\"text-lg\">\n {tr('admin.settings.general.title', 'General')}\n </CardTitle>\n </div>\n <CardDescription>\n {tr('admin.settings.general.description', 'Basic platform configuration')}\n </CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">\n {tr('admin.settings.general.platformName', 'Platform Name')}\n </label>\n <Input defaultValue=\"Burdenoff Admin\" />\n </div>\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">\n {tr('admin.settings.general.supportEmail', 'Support Email')}\n </label>\n <Input defaultValue=\"support@burdenoff.com\" type=\"email\" />\n </div>\n </div>\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">\n {tr('admin.settings.general.defaultTimezone', 'Default Timezone')}\n </label>\n <select className=\"h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm\">\n <option value=\"UTC\">UTC</option>\n <option value=\"America/New_York\">\n {tr('admin.settings.general.timezones.eastern', 'Eastern Time (ET)')}\n </option>\n <option value=\"America/Los_Angeles\">\n {tr('admin.settings.general.timezones.pacific', 'Pacific Time (PT)')}\n </option>\n <option value=\"Europe/London\">\n {tr('admin.settings.general.timezones.london', 'London (GMT)')}\n </option>\n <option value=\"Asia/Kolkata\">\n {tr('admin.settings.general.timezones.india', 'India (IST)')}\n </option>\n </select>\n </div>\n <div className=\"flex justify-end\">\n <Button>{tr('admin.settings.general.saveChanges', 'Save Changes')}</Button>\n </div>\n </CardContent>\n </Card>\n\n {/* Security */}\n <Card>\n <CardHeader>\n <div className=\"flex items-center gap-2\">\n <Shield className=\"h-5 w-5 text-muted-foreground\" />\n <CardTitle className=\"text-lg\">\n {tr('admin.settings.security.title', 'Security')}\n </CardTitle>\n </div>\n <CardDescription>\n {tr(\n 'admin.settings.security.description',\n 'Security and authentication settings'\n )}\n </CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <div className=\"flex items-center justify-between rounded-lg border border-border p-4\">\n <div>\n <div className=\"font-medium\">\n {tr('admin.settings.security.twoFactor.title', 'Two-Factor Authentication')}\n </div>\n <div className=\"text-sm text-muted-foreground\">\n {tr(\n 'admin.settings.security.twoFactor.description',\n 'Require 2FA for all admin accounts'\n )}\n </div>\n </div>\n <Button variant=\"outline\">\n {tr('admin.settings.security.twoFactor.configure', 'Configure')}\n </Button>\n </div>\n <div className=\"flex items-center justify-between rounded-lg border border-border p-4\">\n <div>\n <div className=\"font-medium\">\n {tr('admin.settings.security.sessionTimeout.title', 'Session Timeout')}\n </div>\n <div className=\"text-sm text-muted-foreground\">\n {tr(\n 'admin.settings.security.sessionTimeout.description',\n 'Auto-logout after inactivity'\n )}\n </div>\n </div>\n <select className=\"h-9 rounded-md border border-input bg-background px-3 text-sm\">\n <option value=\"15\">\n {tr('admin.settings.security.sessionTimeout.options.15m', '15 minutes')}\n </option>\n <option value=\"30\">\n {tr('admin.settings.security.sessionTimeout.options.30m', '30 minutes')}\n </option>\n <option value=\"60\">\n {tr('admin.settings.security.sessionTimeout.options.1h', '1 hour')}\n </option>\n <option value=\"480\">\n {tr('admin.settings.security.sessionTimeout.options.8h', '8 hours')}\n </option>\n </select>\n </div>\n <div className=\"flex items-center justify-between rounded-lg border border-border p-4\">\n <div>\n <div className=\"font-medium\">\n {tr('admin.settings.security.ipAllowlist.title', 'IP Allowlist')}\n </div>\n <div className=\"text-sm text-muted-foreground\">\n {tr(\n 'admin.settings.security.ipAllowlist.description',\n 'Restrict access to specific IPs'\n )}\n </div>\n </div>\n <Button variant=\"outline\">\n {tr('admin.settings.security.ipAllowlist.manage', 'Manage')}\n </Button>\n </div>\n </CardContent>\n </Card>\n\n {/* Notifications */}\n <Card>\n <CardHeader>\n <div className=\"flex items-center gap-2\">\n <Bell className=\"h-5 w-5 text-muted-foreground\" />\n <CardTitle className=\"text-lg\">\n {tr('admin.settings.notifications.title', 'Notifications')}\n </CardTitle>\n </div>\n <CardDescription>\n {tr(\n 'admin.settings.notifications.description',\n 'Configure notification preferences'\n )}\n </CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n {notificationSettings.map((item) => (\n <div\n key={item.key}\n className=\"flex items-center justify-between rounded-lg border border-border p-4\"\n >\n <div>\n <div className=\"font-medium\">{item.label}</div>\n <div className=\"text-sm text-muted-foreground\">{item.description}</div>\n </div>\n <label className=\"relative inline-flex cursor-pointer items-center\">\n <input type=\"checkbox\" defaultChecked className=\"peer sr-only\" />\n <div className=\"peer h-6 w-11 rounded-full bg-muted after:absolute after:left-[2px] after:top-0.5 after:h-5 after:w-5 after:rounded-full after:bg-background after:transition-all peer-checked:bg-primary peer-checked:after:translate-x-full peer-focus:ring-2 peer-focus:ring-ring\" />\n </label>\n </div>\n ))}\n </CardContent>\n </Card>\n </div>\n\n {/* Sidebar */}\n <div className=\"space-y-6\">\n {/* API Keys */}\n <Card>\n <CardHeader>\n <div className=\"flex items-center gap-2\">\n <Key className=\"h-5 w-5 text-muted-foreground\" />\n <CardTitle className=\"text-lg\">\n {tr('admin.settings.apiKeys.title', 'API Keys')}\n </CardTitle>\n </div>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n <p className=\"text-sm text-muted-foreground\">\n {tr(\n 'admin.settings.apiKeys.description',\n 'Manage API keys for programmatic access to the admin API.'\n )}\n </p>\n <Button variant=\"outline\" className=\"w-full\">\n {tr('admin.settings.apiKeys.manage', 'Manage API Keys')}\n </Button>\n </CardContent>\n </Card>\n\n {/* Integrations */}\n <Card>\n <CardHeader>\n <div className=\"flex items-center gap-2\">\n <Globe className=\"h-5 w-5 text-muted-foreground\" />\n <CardTitle className=\"text-lg\">\n {tr('admin.settings.integrations.title', 'Integrations')}\n </CardTitle>\n </div>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n <p className=\"text-sm text-muted-foreground\">\n {tr(\n 'admin.settings.integrations.description',\n 'Connect third-party services and tools.'\n )}\n </p>\n <Button variant=\"outline\" className=\"w-full\">\n {tr('admin.settings.integrations.view', 'View Integrations')}\n </Button>\n </CardContent>\n </Card>\n\n {/* Data Management */}\n <Card>\n <CardHeader>\n <div className=\"flex items-center gap-2\">\n <Database className=\"h-5 w-5 text-muted-foreground\" />\n <CardTitle className=\"text-lg\">\n {tr('admin.settings.data.title', 'Data')}\n </CardTitle>\n </div>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n <Button variant=\"outline\" className=\"w-full justify-start\">\n {tr('admin.settings.data.export', 'Export Data')}\n </Button>\n <Button variant=\"outline\" className=\"w-full justify-start\">\n {tr('admin.settings.data.auditLogs', 'Audit Logs')}\n </Button>\n <Separator />\n <Button variant=\"outline\" className=\"w-full justify-start text-destructive\">\n {tr('admin.settings.data.dangerZone', 'Danger Zone')}\n </Button>\n </CardContent>\n </Card>\n </div>\n </div>\n </PageLayout>\n </PermissionGuard>\n );\n}\n"],"mappings":";;;;;;;;;;AAoBA,SAAgB,IAAe;CAC7B,IAAM,EAAE,sBAAmB,WAAW,MAAuB,GAAqB,EAC5E,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,GAAkB,MACzC,EAAc,GAAG,GAAK,GAAU,EAAO,EAEnC,IAAuB;EAC3B;GACE,KAAK;GACL,OAAO,EAAG,6DAA6D,qBAAqB;GAC5F,aAAa,EACX,mEACA,yCACD;GACF;EACD;GACE,KAAK;GACL,OAAO,EAAG,4DAA4D,mBAAmB;GACzF,aAAa,EACX,kEACA,2BACD;GACF;EACD;GACE,KAAK;GACL,OAAO,EAAG,4DAA4D,mBAAmB;GACzF,aAAa,EACX,kEACA,qCACD;GACF;EACD;GACE,KAAK;GACL,OAAO,EAAG,yDAAyD,gBAAgB;GACnF,aAAa,EACX,+DACA,mCACD;GACF;EACF;AAED,QACE,kBAAC,GAAD;EACE,SAAS;EACT,WAAW;EACX,WAAW,E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,CACR;UACK,CAAA,EACb,kBAAC,GAAD;OAAa,WAAU;iBAAvB;QACE,kBAAC,GAAD;SAAQ,SAAQ;SAAU,WAAU;mBACjC,EAAG,8BAA8B,cAAc;SACzC,CAAA;QACT,kBAAC,GAAD;SAAQ,SAAQ;SAAU,WAAU;mBACjC,EAAG,iCAAiC,aAAa;SAC3C,CAAA;QACT,kBAAC,GAAD,EAAa,CAAA;QACb,kBAAC,GAAD;SAAQ,SAAQ;SAAU,WAAU;mBACjC,EAAG,kCAAkC,cAAc;SAC7C,CAAA;QACG;SACT,EAAA,CAAA;MACH;OACF;;GACK,CAAA;EACG,CAAA"}
|
|
1
|
+
{"version":3,"file":"SettingsPage.js","names":[],"sources":["../../../src/admin/pages/SettingsPage.tsx"],"sourcesContent":["import { Settings, Shield, Key, Bell, Globe, Database } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n PageLayout,\n Card,\n CardHeader,\n CardTitle,\n CardContent,\n CardDescription,\n Button,\n Input,\n Separator,\n PermissionGuard,\n} from '../components';\nimport { useAdminPermissions } from '../hooks/useAdminPermissions';\nimport { tWithFallback } from '../utils/i18n';\n\n/**\n * Settings page\n */\nexport function SettingsPage() {\n const { canManageSettings, isLoading: permissionsLoading } = useAdminPermissions();\n const { t } = useI18n();\n const tr = (key: string, fallback: string, params?: Record<string, string | number>): string =>\n tWithFallback(t, key, fallback, params);\n\n const notificationSettings = [\n {\n key: 'newTenantSignups',\n label: tr('admin.settings.notifications.items.newTenantSignups.label', 'New tenant signups'),\n description: tr(\n 'admin.settings.notifications.items.newTenantSignups.description',\n 'Get notified when new tenants register'\n ),\n },\n {\n key: 'paymentFailures',\n label: tr('admin.settings.notifications.items.paymentFailures.label', 'Payment failures'),\n description: tr(\n 'admin.settings.notifications.items.paymentFailures.description',\n 'Alert when payments fail'\n ),\n },\n {\n key: 'criticalTickets',\n label: tr('admin.settings.notifications.items.criticalTickets.label', 'Critical tickets'),\n description: tr(\n 'admin.settings.notifications.items.criticalTickets.description',\n 'Notify on critical support tickets'\n ),\n },\n {\n key: 'systemAlerts',\n label: tr('admin.settings.notifications.items.systemAlerts.label', 'System alerts'),\n description: tr(\n 'admin.settings.notifications.items.systemAlerts.description',\n 'Infrastructure and health alerts'\n ),\n },\n ];\n\n return (\n <PermissionGuard\n allowed={canManageSettings}\n isLoading={permissionsLoading}\n pageTitle={tr('admin.settings.title', 'Settings')}\n denyMessage={tr(\n 'admin.settings.denyMessage',\n \"You don't have permission to manage platform settings.\"\n )}\n >\n <PageLayout\n title={tr('admin.settings.title', 'Settings')}\n description={tr(\n 'admin.settings.description',\n 'Configure platform settings and preferences'\n )}\n >\n <div className=\"grid gap-6 lg:grid-cols-3\">\n {/* Main settings */}\n <div className=\"space-y-6 lg:col-span-2\">\n {/* General */}\n <Card>\n <CardHeader>\n <div className=\"flex items-center gap-2\">\n <Settings className=\"h-5 w-5 text-text-secondary\" />\n <CardTitle className=\"text-lg\">\n {tr('admin.settings.general.title', 'General')}\n </CardTitle>\n </div>\n <CardDescription>\n {tr('admin.settings.general.description', 'Basic platform configuration')}\n </CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">\n {tr('admin.settings.general.platformName', 'Platform Name')}\n </label>\n <Input defaultValue=\"Burdenoff Admin\" />\n </div>\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">\n {tr('admin.settings.general.supportEmail', 'Support Email')}\n </label>\n <Input defaultValue=\"support@burdenoff.com\" type=\"email\" />\n </div>\n </div>\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">\n {tr('admin.settings.general.defaultTimezone', 'Default Timezone')}\n </label>\n <select className=\"h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm\">\n <option value=\"UTC\">UTC</option>\n <option value=\"America/New_York\">\n {tr('admin.settings.general.timezones.eastern', 'Eastern Time (ET)')}\n </option>\n <option value=\"America/Los_Angeles\">\n {tr('admin.settings.general.timezones.pacific', 'Pacific Time (PT)')}\n </option>\n <option value=\"Europe/London\">\n {tr('admin.settings.general.timezones.london', 'London (GMT)')}\n </option>\n <option value=\"Asia/Kolkata\">\n {tr('admin.settings.general.timezones.india', 'India (IST)')}\n </option>\n </select>\n </div>\n <div className=\"flex justify-end\">\n <Button>{tr('admin.settings.general.saveChanges', 'Save Changes')}</Button>\n </div>\n </CardContent>\n </Card>\n\n {/* Security */}\n <Card>\n <CardHeader>\n <div className=\"flex items-center gap-2\">\n <Shield className=\"h-5 w-5 text-text-secondary\" />\n <CardTitle className=\"text-lg\">\n {tr('admin.settings.security.title', 'Security')}\n </CardTitle>\n </div>\n <CardDescription>\n {tr(\n 'admin.settings.security.description',\n 'Security and authentication settings'\n )}\n </CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <div className=\"flex items-center justify-between rounded-lg border border-border-subtle p-4\">\n <div>\n <div className=\"font-medium\">\n {tr('admin.settings.security.twoFactor.title', 'Two-Factor Authentication')}\n </div>\n <div className=\"text-sm text-text-secondary\">\n {tr(\n 'admin.settings.security.twoFactor.description',\n 'Require 2FA for all admin accounts'\n )}\n </div>\n </div>\n <Button variant=\"outline\">\n {tr('admin.settings.security.twoFactor.configure', 'Configure')}\n </Button>\n </div>\n <div className=\"flex items-center justify-between rounded-lg border border-border-subtle p-4\">\n <div>\n <div className=\"font-medium\">\n {tr('admin.settings.security.sessionTimeout.title', 'Session Timeout')}\n </div>\n <div className=\"text-sm text-text-secondary\">\n {tr(\n 'admin.settings.security.sessionTimeout.description',\n 'Auto-logout after inactivity'\n )}\n </div>\n </div>\n <select className=\"h-9 rounded-md border border-border-default bg-bg-surface px-3 text-sm\">\n <option value=\"15\">\n {tr('admin.settings.security.sessionTimeout.options.15m', '15 minutes')}\n </option>\n <option value=\"30\">\n {tr('admin.settings.security.sessionTimeout.options.30m', '30 minutes')}\n </option>\n <option value=\"60\">\n {tr('admin.settings.security.sessionTimeout.options.1h', '1 hour')}\n </option>\n <option value=\"480\">\n {tr('admin.settings.security.sessionTimeout.options.8h', '8 hours')}\n </option>\n </select>\n </div>\n <div className=\"flex items-center justify-between rounded-lg border border-border-subtle p-4\">\n <div>\n <div className=\"font-medium\">\n {tr('admin.settings.security.ipAllowlist.title', 'IP Allowlist')}\n </div>\n <div className=\"text-sm text-text-secondary\">\n {tr(\n 'admin.settings.security.ipAllowlist.description',\n 'Restrict access to specific IPs'\n )}\n </div>\n </div>\n <Button variant=\"outline\">\n {tr('admin.settings.security.ipAllowlist.manage', 'Manage')}\n </Button>\n </div>\n </CardContent>\n </Card>\n\n {/* Notifications */}\n <Card>\n <CardHeader>\n <div className=\"flex items-center gap-2\">\n <Bell className=\"h-5 w-5 text-text-secondary\" />\n <CardTitle className=\"text-lg\">\n {tr('admin.settings.notifications.title', 'Notifications')}\n </CardTitle>\n </div>\n <CardDescription>\n {tr(\n 'admin.settings.notifications.description',\n 'Configure notification preferences'\n )}\n </CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n {notificationSettings.map((item) => (\n <div\n key={item.key}\n className=\"flex items-center justify-between rounded-lg border border-border-subtle p-4\"\n >\n <div>\n <div className=\"font-medium\">{item.label}</div>\n <div className=\"text-sm text-text-secondary\">{item.description}</div>\n </div>\n <label className=\"relative inline-flex cursor-pointer items-center\">\n <input type=\"checkbox\" defaultChecked className=\"peer sr-only\" />\n <div className=\"peer h-6 w-11 rounded-full bg-bg-sunken after:absolute after:left-[2px] after:top-0.5 after:h-5 after:w-5 after:rounded-full after:bg-bg-surface after:transition-all peer-checked:bg-action-primary-bg peer-checked:after:translate-x-full peer-focus:ring-2 peer-focus:ring-[var(--color-focus-ring)]\" />\n </label>\n </div>\n ))}\n </CardContent>\n </Card>\n </div>\n\n {/* Sidebar */}\n <div className=\"space-y-6\">\n {/* API Keys */}\n <Card>\n <CardHeader>\n <div className=\"flex items-center gap-2\">\n <Key className=\"h-5 w-5 text-text-secondary\" />\n <CardTitle className=\"text-lg\">\n {tr('admin.settings.apiKeys.title', 'API Keys')}\n </CardTitle>\n </div>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'admin.settings.apiKeys.description',\n 'Manage API keys for programmatic access to the admin API.'\n )}\n </p>\n <Button variant=\"outline\" className=\"w-full\">\n {tr('admin.settings.apiKeys.manage', 'Manage API Keys')}\n </Button>\n </CardContent>\n </Card>\n\n {/* Integrations */}\n <Card>\n <CardHeader>\n <div className=\"flex items-center gap-2\">\n <Globe className=\"h-5 w-5 text-text-secondary\" />\n <CardTitle className=\"text-lg\">\n {tr('admin.settings.integrations.title', 'Integrations')}\n </CardTitle>\n </div>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'admin.settings.integrations.description',\n 'Connect third-party services and tools.'\n )}\n </p>\n <Button variant=\"outline\" className=\"w-full\">\n {tr('admin.settings.integrations.view', 'View Integrations')}\n </Button>\n </CardContent>\n </Card>\n\n {/* Data Management */}\n <Card>\n <CardHeader>\n <div className=\"flex items-center gap-2\">\n <Database className=\"h-5 w-5 text-text-secondary\" />\n <CardTitle className=\"text-lg\">\n {tr('admin.settings.data.title', 'Data')}\n </CardTitle>\n </div>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n <Button variant=\"outline\" className=\"w-full justify-start\">\n {tr('admin.settings.data.export', 'Export Data')}\n </Button>\n <Button variant=\"outline\" className=\"w-full justify-start\">\n {tr('admin.settings.data.auditLogs', 'Audit Logs')}\n </Button>\n <Separator />\n <Button variant=\"outline\" className=\"w-full justify-start text-status-error-text\">\n {tr('admin.settings.data.dangerZone', 'Danger Zone')}\n </Button>\n </CardContent>\n </Card>\n </div>\n </div>\n </PageLayout>\n </PermissionGuard>\n );\n}\n"],"mappings":";;;;;;;;;;AAoBA,SAAgB,IAAe;CAC7B,IAAM,EAAE,sBAAmB,WAAW,MAAuB,GAA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kBAAC,GAAD;QAAW,WAAU;kBAClB,EAAG,qCAAqC,eAAe;QAC9C,CAAA,CACR;UACK,CAAA,EACb,kBAAC,GAAD;OAAa,WAAU;iBAAvB,CACE,kBAAC,KAAD;QAAG,WAAU;kBACV,EACC,2CACA,0CACD;QACC,CAAA,EACJ,kBAAC,GAAD;QAAQ,SAAQ;QAAU,WAAU;kBACjC,EAAG,oCAAoC,oBAAoB;QACrD,CAAA,CACG;SACT,EAAA,CAAA;MAGP,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UACE,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,GAAD,EAAU,WAAU,+BAAgC,CAAA,EACpD,kBAAC,GAAD;QAAW,WAAU;kBAClB,EAAG,6BAA6B,OAAO;QAC9B,CAAA,CACR;UACK,CAAA,EACb,kBAAC,GAAD;OAAa,WAAU;iBAAvB;QACE,kBAAC,GAAD;SAAQ,SAAQ;SAAU,WAAU;mBACjC,EAAG,8BAA8B,cAAc;SACzC,CAAA;QACT,kBAAC,GAAD;SAAQ,SAAQ;SAAU,WAAU;mBACjC,EAAG,iCAAiC,aAAa;SAC3C,CAAA;QACT,kBAAC,GAAD,EAAa,CAAA;QACb,kBAAC,GAAD;SAAQ,SAAQ;SAAU,WAAU;mBACjC,EAAG,kCAAkC,cAAc;SAC7C,CAAA;QACG;SACT,EAAA,CAAA;MACH;OACF;;GACK,CAAA;EACG,CAAA"}
|
|
@@ -33,7 +33,7 @@ var j = {
|
|
|
33
33
|
PENDING: "bg-warning/10 text-warning border-warning/30",
|
|
34
34
|
RETRYING: "bg-warning/10 text-warning border-warning/30",
|
|
35
35
|
SUCCESS: "bg-success/10 text-success border-success/30",
|
|
36
|
-
PERMANENTLY_FAILED: "bg-
|
|
36
|
+
PERMANENTLY_FAILED: "bg-status-error-bg/10 text-status-error-text border-status-error-border/30"
|
|
37
37
|
}, M = {
|
|
38
38
|
PENDING: "Pending",
|
|
39
39
|
RETRYING: "Retrying",
|
|
@@ -84,7 +84,7 @@ function N() {
|
|
|
84
84
|
header: "Operation",
|
|
85
85
|
width: "180px",
|
|
86
86
|
render: (e) => /* @__PURE__ */ T("code", {
|
|
87
|
-
className: "text-xs bg-
|
|
87
|
+
className: "text-xs bg-bg-sunken px-1.5 py-0.5 rounded",
|
|
88
88
|
children: e.operation
|
|
89
89
|
})
|
|
90
90
|
},
|
|
@@ -92,7 +92,7 @@ function N() {
|
|
|
92
92
|
key: "workspaceId",
|
|
93
93
|
header: "Workspace",
|
|
94
94
|
render: (e) => /* @__PURE__ */ T("span", {
|
|
95
|
-
className: "font-mono text-xs text-
|
|
95
|
+
className: "font-mono text-xs text-text-secondary",
|
|
96
96
|
children: e.workspaceId
|
|
97
97
|
})
|
|
98
98
|
},
|
|
@@ -110,7 +110,7 @@ function N() {
|
|
|
110
110
|
render: (e) => /* @__PURE__ */ E("span", {
|
|
111
111
|
className: "text-sm",
|
|
112
112
|
children: [e.attempts, /* @__PURE__ */ E("span", {
|
|
113
|
-
className: "text-
|
|
113
|
+
className: "text-text-secondary",
|
|
114
114
|
children: ["/", e.maxAttempts]
|
|
115
115
|
})]
|
|
116
116
|
})
|
|
@@ -120,10 +120,10 @@ function N() {
|
|
|
120
120
|
header: "Next retry",
|
|
121
121
|
width: "160px",
|
|
122
122
|
render: (e) => e.nextRetryAt ? /* @__PURE__ */ T("span", {
|
|
123
|
-
className: "text-sm text-
|
|
123
|
+
className: "text-sm text-text-secondary",
|
|
124
124
|
children: l(e.nextRetryAt)
|
|
125
125
|
}) : /* @__PURE__ */ T("span", {
|
|
126
|
-
className: "text-xs text-
|
|
126
|
+
className: "text-xs text-text-secondary",
|
|
127
127
|
children: "—"
|
|
128
128
|
})
|
|
129
129
|
},
|
|
@@ -132,7 +132,7 @@ function N() {
|
|
|
132
132
|
header: "Created",
|
|
133
133
|
width: "160px",
|
|
134
134
|
render: (e) => /* @__PURE__ */ T("span", {
|
|
135
|
-
className: "text-sm text-
|
|
135
|
+
className: "text-sm text-text-secondary",
|
|
136
136
|
children: l(e.createdAt)
|
|
137
137
|
})
|
|
138
138
|
},
|
|
@@ -221,7 +221,7 @@ function N() {
|
|
|
221
221
|
}, e))
|
|
222
222
|
}),
|
|
223
223
|
W && /* @__PURE__ */ T(i, { children: /* @__PURE__ */ E(a, {
|
|
224
|
-
className: "py-4 text-sm text-
|
|
224
|
+
className: "py-4 text-sm text-status-error-text",
|
|
225
225
|
children: ["Failed to load sync outbox entries: ", W.message]
|
|
226
226
|
}) }),
|
|
227
227
|
/* @__PURE__ */ T(f, {
|
|
@@ -245,16 +245,16 @@ function N() {
|
|
|
245
245
|
className: "font-medium",
|
|
246
246
|
children: "Last error"
|
|
247
247
|
}), /* @__PURE__ */ T("span", {
|
|
248
|
-
className: "text-xs text-
|
|
248
|
+
className: "text-xs text-text-secondary",
|
|
249
249
|
children: e.lastAttemptAt ? `Last attempt: ${c(e.lastAttemptAt)}` : "Never attempted"
|
|
250
250
|
})]
|
|
251
251
|
}),
|
|
252
252
|
/* @__PURE__ */ T("pre", {
|
|
253
|
-
className: "whitespace-pre-wrap break-words rounded bg-
|
|
253
|
+
className: "whitespace-pre-wrap break-words rounded bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
|
|
254
254
|
children: e.lastError ?? "No error recorded"
|
|
255
255
|
}),
|
|
256
256
|
/* @__PURE__ */ E("div", {
|
|
257
|
-
className: "text-xs text-
|
|
257
|
+
className: "text-xs text-text-secondary",
|
|
258
258
|
children: ["Entry id: ", /* @__PURE__ */ T("code", {
|
|
259
259
|
className: "font-mono",
|
|
260
260
|
children: e.id
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SyncFailuresPage.js","names":[],"sources":["../../../src/admin/pages/SyncFailuresPage.tsx"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react';\nimport { RefreshCw, AlertOctagon, Clock, CheckCircle2, RotateCw } from 'lucide-react';\nimport { useAdminPermissions } from '../hooks/useAdminPermissions';\nimport {\n PageLayout,\n MetricCard,\n MetricsGrid,\n Card,\n CardContent,\n Badge,\n Button,\n DataTable,\n Pagination,\n EmptyState,\n PermissionGuard,\n ConfirmDialog,\n useToast,\n} from '../components';\nimport { formatDateTime, formatRelativeTime } from '../utils/formatters';\nimport { SyncOutboxStatus } from '../../generated/global-types';\nimport {\n useListSyncOutboxEntriesQuery,\n useSyncOutboxStatsQuery,\n useRetrySyncOutboxEntryMutation,\n type ListSyncOutboxEntriesQuery,\n} from '../../generated/global-operations';\n\nconst PAGE_SIZE = 25;\n\n// Single source of truth for the underlying string values. Authored as a\n// const-tuple so TypeScript derives both the union type and a runtime guard.\n// The mapping below is type-checked: if codegen ever drops or renames a\n// SyncOutboxStatus enum member, the build fails at STATUS_TO_GQL, not at\n// runtime.\nconst STATUS_VALUES = ['PENDING', 'RETRYING', 'SUCCESS', 'PERMANENTLY_FAILED'] as const;\ntype StatusValue = (typeof STATUS_VALUES)[number];\ntype StatusFilter = 'all' | StatusValue;\n\ntype OutboxEntry = ListSyncOutboxEntriesQuery['listSyncOutboxEntries']['items'][number];\n\n// Typed bridge between our boundary string union and the codegen-generated\n// enum. Explicit mapping makes the codegen casing dependency a compile-time\n// constraint instead of a runtime cast.\nconst STATUS_TO_GQL: Record<StatusValue, SyncOutboxStatus> = {\n PENDING: SyncOutboxStatus.Pending,\n RETRYING: SyncOutboxStatus.Retrying,\n SUCCESS: SyncOutboxStatus.Success,\n PERMANENTLY_FAILED: SyncOutboxStatus.PermanentlyFailed,\n};\n\n// Reverse map: codegen enum value → boundary string. Falls back to\n// PERMANENTLY_FAILED if codegen ever emits an unknown value — a loud-but-safe\n// default that surfaces the drift without breaking the page.\nfunction asStatusValue(s: SyncOutboxStatus): StatusValue {\n const raw = String(s) as StatusValue;\n return (STATUS_VALUES as readonly string[]).includes(raw) ? raw : 'PERMANENTLY_FAILED';\n}\n\nconst STATUS_VARIANTS: Record<StatusValue, string> = {\n PENDING: 'bg-warning/10 text-warning border-warning/30',\n RETRYING: 'bg-warning/10 text-warning border-warning/30',\n SUCCESS: 'bg-success/10 text-success border-success/30',\n PERMANENTLY_FAILED: 'bg-destructive/10 text-destructive border-destructive/30',\n};\n\nconst STATUS_LABELS: Record<StatusValue, string> = {\n PENDING: 'Pending',\n RETRYING: 'Retrying',\n SUCCESS: 'Success',\n PERMANENTLY_FAILED: 'Permanently failed',\n};\n\nfunction StatusBadge({ status }: { status: SyncOutboxStatus }) {\n const key = asStatusValue(status);\n return (\n <Badge variant=\"outline\" className={STATUS_VARIANTS[key]}>\n {STATUS_LABELS[key]}\n </Badge>\n );\n}\n\n/**\n * Sync Failures admin page.\n *\n * Shows the state of the cross-layer sync outbox so a super-admin can spot\n * users/workspaces that didn't get fully provisioned (e.g. signup happened\n * while a downstream service was down) and manually requeue them once the\n * underlying problem is fixed.\n *\n * Manual retry only flips the row to RETRYING; the background reconciler in\n * global-tenant-svc actually performs the sync on its next tick. That keeps\n * the existing single-writer retry semantics intact.\n */\nexport function SyncFailuresPage() {\n const {\n canViewSyncFailures,\n canManageSyncFailures,\n isLoading: permissionsLoading,\n } = useAdminPermissions();\n const toast = useToast();\n\n const [page, setPage] = useState(1);\n const [statusFilter, setStatusFilter] = useState<StatusFilter>('PERMANENTLY_FAILED');\n const [confirmRetryId, setConfirmRetryId] = useState<string | null>(null);\n const [expandedErrorId, setExpandedErrorId] = useState<string | null>(null);\n\n const filter = useMemo(() => {\n if (statusFilter === 'all') return undefined;\n // Explicit, type-checked mapping — replaces the previous `as unknown as`\n // double-cast. If codegen ever renames a SyncOutboxStatus enum member,\n // the build fails at STATUS_TO_GQL above, not silently at runtime.\n return { statuses: [STATUS_TO_GQL[statusFilter]] };\n }, [statusFilter]);\n\n const skipQueries = permissionsLoading || !canViewSyncFailures;\n\n const {\n data: listData,\n loading: listLoading,\n error: listError,\n refetch: refetchList,\n } = useListSyncOutboxEntriesQuery({\n variables: {\n filter,\n limit: PAGE_SIZE,\n offset: (page - 1) * PAGE_SIZE,\n },\n fetchPolicy: 'cache-and-network',\n skip: skipQueries,\n });\n\n const {\n data: statsData,\n loading: statsLoading,\n refetch: refetchStats,\n } = useSyncOutboxStatsQuery({\n fetchPolicy: 'cache-and-network',\n skip: skipQueries,\n });\n\n const [retryEntry, { loading: retrying }] = useRetrySyncOutboxEntryMutation({\n onCompleted: (data) => {\n const result = data.retrySyncOutboxEntry;\n if (result.success) {\n toast.success(\n 'Requeued for retry',\n result.message ?? 'The reconciler will pick it up on the next tick.'\n );\n void refetchList();\n void refetchStats();\n } else {\n toast.error('Retry failed', result.message ?? 'Could not requeue this entry.');\n }\n },\n onError: (err) => {\n toast.error('Retry failed', err.message);\n },\n });\n\n const handleRefresh = useCallback(() => {\n void refetchList();\n void refetchStats();\n }, [refetchList, refetchStats]);\n\n const handleConfirmRetry = useCallback(async () => {\n if (!confirmRetryId) return;\n // Apollo's mutate promise rejects on network/GraphQL error; without the\n // finally the dialog would stay open and ConfirmDialog's awaited\n // onConfirm would see an unhandled rejection. The onError toast still\n // surfaces the failure to the user.\n try {\n await retryEntry({ variables: { id: confirmRetryId } });\n } finally {\n setConfirmRetryId(null);\n }\n }, [confirmRetryId, retryEntry]);\n\n const entries = listData?.listSyncOutboxEntries.items ?? [];\n const total = listData?.listSyncOutboxEntries.total ?? 0;\n const totalPages = Math.max(1, Math.ceil(total / PAGE_SIZE));\n const stats = statsData?.syncOutboxStats;\n\n const columns = useMemo(\n () => [\n {\n key: 'operation',\n header: 'Operation',\n width: '180px',\n render: (entry: OutboxEntry) => (\n <code className=\"text-xs bg-muted px-1.5 py-0.5 rounded\">{entry.operation}</code>\n ),\n },\n {\n key: 'workspaceId',\n header: 'Workspace',\n render: (entry: OutboxEntry) => (\n <span className=\"font-mono text-xs text-muted-foreground\">{entry.workspaceId}</span>\n ),\n },\n {\n key: 'status',\n header: 'Status',\n width: '170px',\n render: (entry: OutboxEntry) => <StatusBadge status={entry.status} />,\n },\n {\n key: 'attempts',\n header: 'Attempts',\n width: '100px',\n align: 'right' as const,\n render: (entry: OutboxEntry) => (\n <span className=\"text-sm\">\n {entry.attempts}\n <span className=\"text-muted-foreground\">/{entry.maxAttempts}</span>\n </span>\n ),\n },\n {\n key: 'nextRetryAt',\n header: 'Next retry',\n width: '160px',\n render: (entry: OutboxEntry) =>\n entry.nextRetryAt ? (\n <span className=\"text-sm text-muted-foreground\">\n {formatRelativeTime(entry.nextRetryAt)}\n </span>\n ) : (\n <span className=\"text-xs text-muted-foreground\">—</span>\n ),\n },\n {\n key: 'createdAt',\n header: 'Created',\n width: '160px',\n render: (entry: OutboxEntry) => (\n <span className=\"text-sm text-muted-foreground\">\n {formatRelativeTime(entry.createdAt)}\n </span>\n ),\n },\n {\n key: 'actions',\n header: '',\n width: '120px',\n align: 'right' as const,\n render: (entry: OutboxEntry) => {\n // Retry is only meaningful for entries that have exhausted automatic\n // retries. PENDING/RETRYING entries already get picked up by the\n // background reconciler. SUCCESS entries don't need retrying.\n const isRetryable = asStatusValue(entry.status) === 'PERMANENTLY_FAILED';\n if (!canManageSyncFailures || !isRetryable) {\n return null;\n }\n return (\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={(e) => {\n e.stopPropagation();\n setConfirmRetryId(entry.id);\n }}\n disabled={retrying}\n >\n <RotateCw className=\"mr-1.5 h-3.5 w-3.5\" />\n Retry\n </Button>\n );\n },\n },\n ],\n [canManageSyncFailures, retrying]\n );\n\n return (\n <PermissionGuard\n allowed={canViewSyncFailures}\n isLoading={permissionsLoading}\n pageTitle=\"Sync Failures\"\n denyMessage=\"Only super-admins can view cross-layer sync failures.\"\n >\n <PageLayout\n title=\"Sync Failures\"\n description=\"Cross-layer sync operations (global → workspace) that did not complete. Automatic retries run in the background; use the manual retry once the underlying issue is fixed.\"\n actions={\n <Button variant=\"outline\" onClick={handleRefresh} disabled={listLoading || statsLoading}>\n <RefreshCw className={`mr-2 h-4 w-4 ${listLoading ? 'animate-spin' : ''}`} />\n Refresh\n </Button>\n }\n >\n <div className=\"space-y-6\">\n {/* Stats */}\n <MetricsGrid>\n <MetricCard\n title=\"Pending\"\n value={stats?.pending ?? 0}\n icon={<Clock className=\"h-5 w-5\" />}\n subtitle=\"Waiting for first retry\"\n loading={statsLoading}\n />\n <MetricCard\n title=\"Retrying\"\n value={stats?.retrying ?? 0}\n icon={<RotateCw className=\"h-5 w-5\" />}\n subtitle=\"Automatic backoff in progress\"\n loading={statsLoading}\n />\n <MetricCard\n title=\"Permanently failed\"\n value={stats?.permanentlyFailed ?? 0}\n icon={<AlertOctagon className=\"h-5 w-5\" />}\n subtitle=\"Exhausted automatic retries\"\n priority={stats?.permanentlyFailed ? 'critical' : 'normal'}\n loading={statsLoading}\n />\n <MetricCard\n title=\"Successful\"\n value={stats?.successful ?? 0}\n icon={<CheckCircle2 className=\"h-5 w-5\" />}\n subtitle=\"Synced (auto-purged after 7 days)\"\n loading={statsLoading}\n />\n </MetricsGrid>\n\n {/* Filters */}\n <div className=\"flex flex-wrap items-center gap-2\">\n {(\n [\n ['PERMANENTLY_FAILED', 'Permanently failed'],\n ['RETRYING', 'Retrying'],\n ['PENDING', 'Pending'],\n ['SUCCESS', 'Successful'],\n ['all', 'All'],\n ] as Array<[StatusFilter, string]>\n ).map(([value, label]) => (\n <Button\n key={value}\n variant={statusFilter === value ? 'default' : 'outline'}\n size=\"sm\"\n onClick={() => {\n setStatusFilter(value);\n setPage(1);\n // Clear any expanded error detail card — the row it referenced\n // may not be in the new result set.\n setExpandedErrorId(null);\n }}\n >\n {label}\n </Button>\n ))}\n </div>\n\n {/* Error banner */}\n {listError && (\n <Card>\n <CardContent className=\"py-4 text-sm text-destructive\">\n Failed to load sync outbox entries: {listError.message}\n </CardContent>\n </Card>\n )}\n\n {/* Table */}\n <DataTable\n columns={columns}\n data={entries}\n keyExtractor={(entry) => entry.id}\n loading={listLoading}\n onRowClick={(entry: OutboxEntry) =>\n setExpandedErrorId((current) => (current === entry.id ? null : entry.id))\n }\n emptyState={\n <EmptyState\n icon={<CheckCircle2 className=\"h-8 w-8\" />}\n title=\"No sync failures\"\n description={\n statusFilter === 'PERMANENTLY_FAILED'\n ? 'Nothing has exhausted automatic retries.'\n : 'No outbox entries match the current filter.'\n }\n />\n }\n />\n\n {/* Expanded error detail */}\n {expandedErrorId &&\n entries\n .filter((e: OutboxEntry) => e.id === expandedErrorId)\n .map((entry: OutboxEntry) => (\n <Card key={entry.id}>\n <CardContent className=\"space-y-2 py-4 text-sm\">\n <div className=\"flex items-center justify-between\">\n <span className=\"font-medium\">Last error</span>\n <span className=\"text-xs text-muted-foreground\">\n {entry.lastAttemptAt\n ? `Last attempt: ${formatDateTime(entry.lastAttemptAt)}`\n : 'Never attempted'}\n </span>\n </div>\n <pre className=\"whitespace-pre-wrap break-words rounded bg-muted px-3 py-2 text-xs text-muted-foreground\">\n {entry.lastError ?? 'No error recorded'}\n </pre>\n <div className=\"text-xs text-muted-foreground\">\n Entry id: <code className=\"font-mono\">{entry.id}</code>\n </div>\n </CardContent>\n </Card>\n ))}\n\n {/* Pagination */}\n {total > PAGE_SIZE && (\n <Pagination\n page={page}\n totalPages={totalPages}\n totalItems={total}\n pageSize={PAGE_SIZE}\n onPageChange={(p) => {\n setPage(p);\n // Same rationale as the filter buttons — the previously\n // expanded row may not be in the new page's result set.\n setExpandedErrorId(null);\n }}\n />\n )}\n </div>\n\n {/* Retry confirm */}\n <ConfirmDialog\n open={!!confirmRetryId}\n onClose={() => setConfirmRetryId(null)}\n onConfirm={handleConfirmRetry}\n title=\"Retry this sync?\"\n description={\n <>\n The entry will be flipped to <strong>RETRYING</strong> and the background reconciler\n will pick it up on its next tick. Attempts will reset to 0 so the entry gets a fresh\n retry budget.\n <br />\n <br />\n Make sure the underlying issue (e.g. a downstream service that was down) is actually\n resolved — otherwise it will fail again.\n </>\n }\n confirmLabel={retrying ? 'Requeueing…' : 'Retry'}\n loading={retrying}\n />\n </PageLayout>\n </PermissionGuard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA2BA,IAAM,IAAY,IAOZ,IAAgB;CAAC;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SAAiB,CAAA,EAC/C,kBAAC,QAAD;SAAM,WAAU;mBACb,EAAM,gBACH,iBAAiB,EAAe,EAAM,cAAc,KACpD;SACC,CAAA,CACH;;OACN,kBAAC,OAAD;QAAK,WAAU;kBACZ,EAAM,aAAa;QAChB,CAAA;OACN,kBAAC,OAAD;QAAK,WAAU;kBAAf,CAA+C,cACnC,kBAAC,QAAD;SAAM,WAAU;mBAAa,EAAM;SAAU,CAAA,CACnD;;OACM;SACT,EAjBI,EAAM,GAiBV,CACP;KAGL,IAAQ,KACP,kBAAC,IAAD;MACQ;MACM;MACZ,YAAY;MACZ,UAAU;MACV,eAAe,MAAM;AAInB,OAHA,EAAQ,EAAE,EAGV,EAAmB,KAAK;;MAE1B,CAAA;KAEA;OAGN,kBAAC,IAAD;IACE,MAAM,CAAC,CAAC;IACR,eAAe,EAAkB,KAAK;IACtC,WAAW;IACX,OAAM;IACN,aACE,kBAAA,GAAA,EAAA,UAAA;KAAE;KAC6B,kBAAC,UAAD,EAAA,UAAQ,YAAiB,CAAA;;KAGtD,kBAAC,MAAD,EAAM,CAAA;KACN,kBAAC,MAAD,EAAM,CAAA;;KAGL,EAAA,CAAA;IAEL,cAAc,IAAW,gBAAgB;IACzC,SAAS;IACT,CAAA,CACS;;EACG,CAAA"}
|
|
1
|
+
{"version":3,"file":"SyncFailuresPage.js","names":[],"sources":["../../../src/admin/pages/SyncFailuresPage.tsx"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react';\nimport { RefreshCw, AlertOctagon, Clock, CheckCircle2, RotateCw } from 'lucide-react';\nimport { useAdminPermissions } from '../hooks/useAdminPermissions';\nimport {\n PageLayout,\n MetricCard,\n MetricsGrid,\n Card,\n CardContent,\n Badge,\n Button,\n DataTable,\n Pagination,\n EmptyState,\n PermissionGuard,\n ConfirmDialog,\n useToast,\n} from '../components';\nimport { formatDateTime, formatRelativeTime } from '../utils/formatters';\nimport { SyncOutboxStatus } from '../../generated/global-types';\nimport {\n useListSyncOutboxEntriesQuery,\n useSyncOutboxStatsQuery,\n useRetrySyncOutboxEntryMutation,\n type ListSyncOutboxEntriesQuery,\n} from '../../generated/global-operations';\n\nconst PAGE_SIZE = 25;\n\n// Single source of truth for the underlying string values. Authored as a\n// const-tuple so TypeScript derives both the union type and a runtime guard.\n// The mapping below is type-checked: if codegen ever drops or renames a\n// SyncOutboxStatus enum member, the build fails at STATUS_TO_GQL, not at\n// runtime.\nconst STATUS_VALUES = ['PENDING', 'RETRYING', 'SUCCESS', 'PERMANENTLY_FAILED'] as const;\ntype StatusValue = (typeof STATUS_VALUES)[number];\ntype StatusFilter = 'all' | StatusValue;\n\ntype OutboxEntry = ListSyncOutboxEntriesQuery['listSyncOutboxEntries']['items'][number];\n\n// Typed bridge between our boundary string union and the codegen-generated\n// enum. Explicit mapping makes the codegen casing dependency a compile-time\n// constraint instead of a runtime cast.\nconst STATUS_TO_GQL: Record<StatusValue, SyncOutboxStatus> = {\n PENDING: SyncOutboxStatus.Pending,\n RETRYING: SyncOutboxStatus.Retrying,\n SUCCESS: SyncOutboxStatus.Success,\n PERMANENTLY_FAILED: SyncOutboxStatus.PermanentlyFailed,\n};\n\n// Reverse map: codegen enum value → boundary string. Falls back to\n// PERMANENTLY_FAILED if codegen ever emits an unknown value — a loud-but-safe\n// default that surfaces the drift without breaking the page.\nfunction asStatusValue(s: SyncOutboxStatus): StatusValue {\n const raw = String(s) as StatusValue;\n return (STATUS_VALUES as readonly string[]).includes(raw) ? raw : 'PERMANENTLY_FAILED';\n}\n\nconst STATUS_VARIANTS: Record<StatusValue, string> = {\n PENDING: 'bg-warning/10 text-warning border-warning/30',\n RETRYING: 'bg-warning/10 text-warning border-warning/30',\n SUCCESS: 'bg-success/10 text-success border-success/30',\n PERMANENTLY_FAILED: 'bg-status-error-bg/10 text-status-error-text border-status-error-border/30',\n};\n\nconst STATUS_LABELS: Record<StatusValue, string> = {\n PENDING: 'Pending',\n RETRYING: 'Retrying',\n SUCCESS: 'Success',\n PERMANENTLY_FAILED: 'Permanently failed',\n};\n\nfunction StatusBadge({ status }: { status: SyncOutboxStatus }) {\n const key = asStatusValue(status);\n return (\n <Badge variant=\"outline\" className={STATUS_VARIANTS[key]}>\n {STATUS_LABELS[key]}\n </Badge>\n );\n}\n\n/**\n * Sync Failures admin page.\n *\n * Shows the state of the cross-layer sync outbox so a super-admin can spot\n * users/workspaces that didn't get fully provisioned (e.g. signup happened\n * while a downstream service was down) and manually requeue them once the\n * underlying problem is fixed.\n *\n * Manual retry only flips the row to RETRYING; the background reconciler in\n * global-tenant-svc actually performs the sync on its next tick. That keeps\n * the existing single-writer retry semantics intact.\n */\nexport function SyncFailuresPage() {\n const {\n canViewSyncFailures,\n canManageSyncFailures,\n isLoading: permissionsLoading,\n } = useAdminPermissions();\n const toast = useToast();\n\n const [page, setPage] = useState(1);\n const [statusFilter, setStatusFilter] = useState<StatusFilter>('PERMANENTLY_FAILED');\n const [confirmRetryId, setConfirmRetryId] = useState<string | null>(null);\n const [expandedErrorId, setExpandedErrorId] = useState<string | null>(null);\n\n const filter = useMemo(() => {\n if (statusFilter === 'all') return undefined;\n // Explicit, type-checked mapping — replaces the previous `as unknown as`\n // double-cast. If codegen ever renames a SyncOutboxStatus enum member,\n // the build fails at STATUS_TO_GQL above, not silently at runtime.\n return { statuses: [STATUS_TO_GQL[statusFilter]] };\n }, [statusFilter]);\n\n const skipQueries = permissionsLoading || !canViewSyncFailures;\n\n const {\n data: listData,\n loading: listLoading,\n error: listError,\n refetch: refetchList,\n } = useListSyncOutboxEntriesQuery({\n variables: {\n filter,\n limit: PAGE_SIZE,\n offset: (page - 1) * PAGE_SIZE,\n },\n fetchPolicy: 'cache-and-network',\n skip: skipQueries,\n });\n\n const {\n data: statsData,\n loading: statsLoading,\n refetch: refetchStats,\n } = useSyncOutboxStatsQuery({\n fetchPolicy: 'cache-and-network',\n skip: skipQueries,\n });\n\n const [retryEntry, { loading: retrying }] = useRetrySyncOutboxEntryMutation({\n onCompleted: (data) => {\n const result = data.retrySyncOutboxEntry;\n if (result.success) {\n toast.success(\n 'Requeued for retry',\n result.message ?? 'The reconciler will pick it up on the next tick.'\n );\n void refetchList();\n void refetchStats();\n } else {\n toast.error('Retry failed', result.message ?? 'Could not requeue this entry.');\n }\n },\n onError: (err) => {\n toast.error('Retry failed', err.message);\n },\n });\n\n const handleRefresh = useCallback(() => {\n void refetchList();\n void refetchStats();\n }, [refetchList, refetchStats]);\n\n const handleConfirmRetry = useCallback(async () => {\n if (!confirmRetryId) return;\n // Apollo's mutate promise rejects on network/GraphQL error; without the\n // finally the dialog would stay open and ConfirmDialog's awaited\n // onConfirm would see an unhandled rejection. The onError toast still\n // surfaces the failure to the user.\n try {\n await retryEntry({ variables: { id: confirmRetryId } });\n } finally {\n setConfirmRetryId(null);\n }\n }, [confirmRetryId, retryEntry]);\n\n const entries = listData?.listSyncOutboxEntries.items ?? [];\n const total = listData?.listSyncOutboxEntries.total ?? 0;\n const totalPages = Math.max(1, Math.ceil(total / PAGE_SIZE));\n const stats = statsData?.syncOutboxStats;\n\n const columns = useMemo(\n () => [\n {\n key: 'operation',\n header: 'Operation',\n width: '180px',\n render: (entry: OutboxEntry) => (\n <code className=\"text-xs bg-bg-sunken px-1.5 py-0.5 rounded\">{entry.operation}</code>\n ),\n },\n {\n key: 'workspaceId',\n header: 'Workspace',\n render: (entry: OutboxEntry) => (\n <span className=\"font-mono text-xs text-text-secondary\">{entry.workspaceId}</span>\n ),\n },\n {\n key: 'status',\n header: 'Status',\n width: '170px',\n render: (entry: OutboxEntry) => <StatusBadge status={entry.status} />,\n },\n {\n key: 'attempts',\n header: 'Attempts',\n width: '100px',\n align: 'right' as const,\n render: (entry: OutboxEntry) => (\n <span className=\"text-sm\">\n {entry.attempts}\n <span className=\"text-text-secondary\">/{entry.maxAttempts}</span>\n </span>\n ),\n },\n {\n key: 'nextRetryAt',\n header: 'Next retry',\n width: '160px',\n render: (entry: OutboxEntry) =>\n entry.nextRetryAt ? (\n <span className=\"text-sm text-text-secondary\">\n {formatRelativeTime(entry.nextRetryAt)}\n </span>\n ) : (\n <span className=\"text-xs text-text-secondary\">—</span>\n ),\n },\n {\n key: 'createdAt',\n header: 'Created',\n width: '160px',\n render: (entry: OutboxEntry) => (\n <span className=\"text-sm text-text-secondary\">\n {formatRelativeTime(entry.createdAt)}\n </span>\n ),\n },\n {\n key: 'actions',\n header: '',\n width: '120px',\n align: 'right' as const,\n render: (entry: OutboxEntry) => {\n // Retry is only meaningful for entries that have exhausted automatic\n // retries. PENDING/RETRYING entries already get picked up by the\n // background reconciler. SUCCESS entries don't need retrying.\n const isRetryable = asStatusValue(entry.status) === 'PERMANENTLY_FAILED';\n if (!canManageSyncFailures || !isRetryable) {\n return null;\n }\n return (\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={(e) => {\n e.stopPropagation();\n setConfirmRetryId(entry.id);\n }}\n disabled={retrying}\n >\n <RotateCw className=\"mr-1.5 h-3.5 w-3.5\" />\n Retry\n </Button>\n );\n },\n },\n ],\n [canManageSyncFailures, retrying]\n );\n\n return (\n <PermissionGuard\n allowed={canViewSyncFailures}\n isLoading={permissionsLoading}\n pageTitle=\"Sync Failures\"\n denyMessage=\"Only super-admins can view cross-layer sync failures.\"\n >\n <PageLayout\n title=\"Sync Failures\"\n description=\"Cross-layer sync operations (global → workspace) that did not complete. Automatic retries run in the background; use the manual retry once the underlying issue is fixed.\"\n actions={\n <Button variant=\"outline\" onClick={handleRefresh} disabled={listLoading || statsLoading}>\n <RefreshCw className={`mr-2 h-4 w-4 ${listLoading ? 'animate-spin' : ''}`} />\n Refresh\n </Button>\n }\n >\n <div className=\"space-y-6\">\n {/* Stats */}\n <MetricsGrid>\n <MetricCard\n title=\"Pending\"\n value={stats?.pending ?? 0}\n icon={<Clock className=\"h-5 w-5\" />}\n subtitle=\"Waiting for first retry\"\n loading={statsLoading}\n />\n <MetricCard\n title=\"Retrying\"\n value={stats?.retrying ?? 0}\n icon={<RotateCw className=\"h-5 w-5\" />}\n subtitle=\"Automatic backoff in progress\"\n loading={statsLoading}\n />\n <MetricCard\n title=\"Permanently failed\"\n value={stats?.permanentlyFailed ?? 0}\n icon={<AlertOctagon className=\"h-5 w-5\" />}\n subtitle=\"Exhausted automatic retries\"\n priority={stats?.permanentlyFailed ? 'critical' : 'normal'}\n loading={statsLoading}\n />\n <MetricCard\n title=\"Successful\"\n value={stats?.successful ?? 0}\n icon={<CheckCircle2 className=\"h-5 w-5\" />}\n subtitle=\"Synced (auto-purged after 7 days)\"\n loading={statsLoading}\n />\n </MetricsGrid>\n\n {/* Filters */}\n <div className=\"flex flex-wrap items-center gap-2\">\n {(\n [\n ['PERMANENTLY_FAILED', 'Permanently failed'],\n ['RETRYING', 'Retrying'],\n ['PENDING', 'Pending'],\n ['SUCCESS', 'Successful'],\n ['all', 'All'],\n ] as Array<[StatusFilter, string]>\n ).map(([value, label]) => (\n <Button\n key={value}\n variant={statusFilter === value ? 'default' : 'outline'}\n size=\"sm\"\n onClick={() => {\n setStatusFilter(value);\n setPage(1);\n // Clear any expanded error detail card — the row it referenced\n // may not be in the new result set.\n setExpandedErrorId(null);\n }}\n >\n {label}\n </Button>\n ))}\n </div>\n\n {/* Error banner */}\n {listError && (\n <Card>\n <CardContent className=\"py-4 text-sm text-status-error-text\">\n Failed to load sync outbox entries: {listError.message}\n </CardContent>\n </Card>\n )}\n\n {/* Table */}\n <DataTable\n columns={columns}\n data={entries}\n keyExtractor={(entry) => entry.id}\n loading={listLoading}\n onRowClick={(entry: OutboxEntry) =>\n setExpandedErrorId((current) => (current === entry.id ? null : entry.id))\n }\n emptyState={\n <EmptyState\n icon={<CheckCircle2 className=\"h-8 w-8\" />}\n title=\"No sync failures\"\n description={\n statusFilter === 'PERMANENTLY_FAILED'\n ? 'Nothing has exhausted automatic retries.'\n : 'No outbox entries match the current filter.'\n }\n />\n }\n />\n\n {/* Expanded error detail */}\n {expandedErrorId &&\n entries\n .filter((e: OutboxEntry) => e.id === expandedErrorId)\n .map((entry: OutboxEntry) => (\n <Card key={entry.id}>\n <CardContent className=\"space-y-2 py-4 text-sm\">\n <div className=\"flex items-center justify-between\">\n <span className=\"font-medium\">Last error</span>\n <span className=\"text-xs text-text-secondary\">\n {entry.lastAttemptAt\n ? `Last attempt: ${formatDateTime(entry.lastAttemptAt)}`\n : 'Never attempted'}\n </span>\n </div>\n <pre className=\"whitespace-pre-wrap break-words rounded bg-bg-sunken px-3 py-2 text-xs text-text-secondary\">\n {entry.lastError ?? 'No error recorded'}\n </pre>\n <div className=\"text-xs text-text-secondary\">\n Entry id: <code className=\"font-mono\">{entry.id}</code>\n </div>\n </CardContent>\n </Card>\n ))}\n\n {/* Pagination */}\n {total > PAGE_SIZE && (\n <Pagination\n page={page}\n totalPages={totalPages}\n totalItems={total}\n pageSize={PAGE_SIZE}\n onPageChange={(p) => {\n setPage(p);\n // Same rationale as the filter buttons — the previously\n // expanded row may not be in the new page's result set.\n setExpandedErrorId(null);\n }}\n />\n )}\n </div>\n\n {/* Retry confirm */}\n <ConfirmDialog\n open={!!confirmRetryId}\n onClose={() => setConfirmRetryId(null)}\n onConfirm={handleConfirmRetry}\n title=\"Retry this sync?\"\n description={\n <>\n The entry will be flipped to <strong>RETRYING</strong> and the background reconciler\n will pick it up on its next tick. Attempts will reset to 0 so the entry gets a fresh\n retry budget.\n <br />\n <br />\n Make sure the underlying issue (e.g. a downstream service that was down) is actually\n resolved — otherwise it will fail again.\n </>\n }\n confirmLabel={retrying ? 'Requeueing…' : 'Retry'}\n loading={retrying}\n />\n </PageLayout>\n </PermissionGuard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA2BA,IAAM,IAAY,IAOZ,IAAgB;CAAC;CAAW;CAAY;CAAW;CAAqB,EASxE,IAAuD;CAC3D,SAAS,EAAiB;CAC1B,UAAU,EAAiB;CAC3B,SAAS,EAAiB;CAC1B,oBAAoB,EAAiB;CACtC;AAKD,SAAS,EAAc,GAAkC;CACvD,IAAM,IAAM,OAAO,EAAE;AACrB,QAAQ,EAAoC,S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Af,CAA6C,cACjC,kBAAC,QAAD;SAAM,WAAU;mBAAa,EAAM;SAAU,CAAA,CACnD;;OACM;SACT,EAjBI,EAAM,GAiBV,CACP;KAGL,IAAQ,KACP,kBAAC,IAAD;MACQ;MACM;MACZ,YAAY;MACZ,UAAU;MACV,eAAe,MAAM;AAInB,OAHA,EAAQ,EAAE,EAGV,EAAmB,KAAK;;MAE1B,CAAA;KAEA;OAGN,kBAAC,IAAD;IACE,MAAM,CAAC,CAAC;IACR,eAAe,EAAkB,KAAK;IACtC,WAAW;IACX,OAAM;IACN,aACE,kBAAA,GAAA,EAAA,UAAA;KAAE;KAC6B,kBAAC,UAAD,EAAA,UAAQ,YAAiB,CAAA;;KAGtD,kBAAC,MAAD,EAAM,CAAA;KACN,kBAAC,MAAD,EAAM,CAAA;;KAGL,EAAA,CAAA;IAEL,cAAc,IAAW,gBAAgB;IACzC,SAAS;IACT,CAAA,CACS;;EACG,CAAA"}
|
|
@@ -59,13 +59,13 @@ function F() {
|
|
|
59
59
|
title: U("admin.tenantDetail.loadingTitle", "Loading..."),
|
|
60
60
|
children: /* @__PURE__ */ j("div", {
|
|
61
61
|
className: "flex h-64 items-center justify-center",
|
|
62
|
-
children: /* @__PURE__ */ j(O, { className: "h-8 w-8 animate-spin text-
|
|
62
|
+
children: /* @__PURE__ */ j(O, { className: "h-8 w-8 animate-spin text-text-secondary" })
|
|
63
63
|
})
|
|
64
64
|
}) : K || !Q ? /* @__PURE__ */ M(u, {
|
|
65
65
|
title: U("admin.tenantDetail.notFoundTitle", "Tenant Not Found"),
|
|
66
66
|
description: U("admin.tenantDetail.notFoundDescription", "The requested tenant could not be found"),
|
|
67
67
|
children: [K && /* @__PURE__ */ j("div", {
|
|
68
|
-
className: "mb-4 rounded-md border border-
|
|
68
|
+
className: "mb-4 rounded-md border border-status-error-border/50 bg-status-error-bg/10 p-4 text-sm text-status-error-text",
|
|
69
69
|
children: K.message
|
|
70
70
|
}), /* @__PURE__ */ M(i, {
|
|
71
71
|
variant: "outline",
|
|
@@ -120,15 +120,15 @@ function F() {
|
|
|
120
120
|
}), /* @__PURE__ */ M("div", {
|
|
121
121
|
className: "flex-1 space-y-4",
|
|
122
122
|
children: [/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("h2", {
|
|
123
|
-
className: "text-xl font-semibold text-
|
|
123
|
+
className: "text-xl font-semibold text-text-primary",
|
|
124
124
|
children: Q.name
|
|
125
125
|
}), /* @__PURE__ */ M("p", {
|
|
126
|
-
className: "text-sm text-
|
|
126
|
+
className: "text-sm text-text-secondary",
|
|
127
127
|
children: ["@", Q.slug]
|
|
128
128
|
})] }), /* @__PURE__ */ M("div", {
|
|
129
129
|
className: "flex flex-wrap items-center gap-4",
|
|
130
130
|
children: [/* @__PURE__ */ j(d, { status: Q.status }), Q.plan && /* @__PURE__ */ j("span", {
|
|
131
|
-
className: "rounded-md bg-primary/10 px-2 py-1 text-xs font-medium text-primary",
|
|
131
|
+
className: "rounded-md bg-action-primary-bg/10 px-2 py-1 text-xs font-medium text-primary",
|
|
132
132
|
children: Q.plan
|
|
133
133
|
})]
|
|
134
134
|
})]
|
|
@@ -140,8 +140,8 @@ function F() {
|
|
|
140
140
|
children: [
|
|
141
141
|
Q.ownerEmail && /* @__PURE__ */ M("div", {
|
|
142
142
|
className: "flex items-center gap-3",
|
|
143
|
-
children: [/* @__PURE__ */ j(te, { className: "h-4 w-4 text-
|
|
144
|
-
className: "text-xs text-
|
|
143
|
+
children: [/* @__PURE__ */ j(te, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
|
|
144
|
+
className: "text-xs text-text-secondary",
|
|
145
145
|
children: U("admin.tenantDetail.overview.ownerEmail", "Owner Email")
|
|
146
146
|
}), /* @__PURE__ */ j("p", {
|
|
147
147
|
className: "text-sm font-medium",
|
|
@@ -150,8 +150,8 @@ function F() {
|
|
|
150
150
|
}),
|
|
151
151
|
Q.domain && /* @__PURE__ */ M("div", {
|
|
152
152
|
className: "flex items-center gap-3",
|
|
153
|
-
children: [/* @__PURE__ */ j(D, { className: "h-4 w-4 text-
|
|
154
|
-
className: "text-xs text-
|
|
153
|
+
children: [/* @__PURE__ */ j(D, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
|
|
154
|
+
className: "text-xs text-text-secondary",
|
|
155
155
|
children: U("admin.tenantDetail.overview.domain", "Domain")
|
|
156
156
|
}), /* @__PURE__ */ j("p", {
|
|
157
157
|
className: "text-sm font-medium",
|
|
@@ -160,8 +160,8 @@ function F() {
|
|
|
160
160
|
}),
|
|
161
161
|
/* @__PURE__ */ M("div", {
|
|
162
162
|
className: "flex items-center gap-3",
|
|
163
|
-
children: [/* @__PURE__ */ j(T, { className: "h-4 w-4 text-
|
|
164
|
-
className: "text-xs text-
|
|
163
|
+
children: [/* @__PURE__ */ j(T, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
|
|
164
|
+
className: "text-xs text-text-secondary",
|
|
165
165
|
children: U("admin.tenantDetail.overview.created", "Created")
|
|
166
166
|
}), /* @__PURE__ */ j("p", {
|
|
167
167
|
className: "text-sm font-medium",
|
|
@@ -170,8 +170,8 @@ function F() {
|
|
|
170
170
|
}),
|
|
171
171
|
/* @__PURE__ */ M("div", {
|
|
172
172
|
className: "flex items-center gap-3",
|
|
173
|
-
children: [/* @__PURE__ */ j(T, { className: "h-4 w-4 text-
|
|
174
|
-
className: "text-xs text-
|
|
173
|
+
children: [/* @__PURE__ */ j(T, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
|
|
174
|
+
className: "text-xs text-text-secondary",
|
|
175
175
|
children: U("admin.tenantDetail.overview.lastUpdated", "Last Updated")
|
|
176
176
|
}), /* @__PURE__ */ j("p", {
|
|
177
177
|
className: "text-sm font-medium",
|
|
@@ -187,12 +187,12 @@ function F() {
|
|
|
187
187
|
}) }), /* @__PURE__ */ j(o, { children: /* @__PURE__ */ j("div", {
|
|
188
188
|
className: "space-y-2",
|
|
189
189
|
children: $.map((e) => /* @__PURE__ */ M("div", {
|
|
190
|
-
className: "flex items-center justify-between rounded-lg border border-border p-3",
|
|
190
|
+
className: "flex items-center justify-between rounded-lg border border-border-subtle p-3",
|
|
191
191
|
children: [/* @__PURE__ */ j("span", {
|
|
192
192
|
className: "text-sm font-medium",
|
|
193
193
|
children: e.name
|
|
194
194
|
}), /* @__PURE__ */ j("span", {
|
|
195
|
-
className: "text-xs text-
|
|
195
|
+
className: "text-xs text-text-secondary capitalize",
|
|
196
196
|
children: e.status?.toLowerCase()
|
|
197
197
|
})]
|
|
198
198
|
}, e.id))
|
|
@@ -204,37 +204,37 @@ function F() {
|
|
|
204
204
|
className: "grid gap-4 sm:grid-cols-2",
|
|
205
205
|
children: [
|
|
206
206
|
/* @__PURE__ */ M("div", {
|
|
207
|
-
className: "flex items-center justify-between rounded-lg border border-border p-3",
|
|
207
|
+
className: "flex items-center justify-between rounded-lg border border-border-subtle p-3",
|
|
208
208
|
children: [/* @__PURE__ */ j("span", {
|
|
209
209
|
className: "text-sm",
|
|
210
210
|
children: U("admin.tenantDetail.settings.allowSignup", "Allow Signup")
|
|
211
211
|
}), /* @__PURE__ */ j("span", {
|
|
212
|
-
className: `text-sm font-medium ${Q.settings?.allowSignup ? "text-success" : "text-
|
|
212
|
+
className: `text-sm font-medium ${Q.settings?.allowSignup ? "text-success" : "text-text-secondary"}`,
|
|
213
213
|
children: Q.settings?.allowSignup ? U("admin.tenantDetail.settings.enabled", "Enabled") : U("admin.tenantDetail.settings.disabled", "Disabled")
|
|
214
214
|
})]
|
|
215
215
|
}),
|
|
216
216
|
/* @__PURE__ */ M("div", {
|
|
217
|
-
className: "flex items-center justify-between rounded-lg border border-border p-3",
|
|
217
|
+
className: "flex items-center justify-between rounded-lg border border-border-subtle p-3",
|
|
218
218
|
children: [/* @__PURE__ */ j("span", {
|
|
219
219
|
className: "text-sm",
|
|
220
220
|
children: U("admin.tenantDetail.settings.sso", "SSO")
|
|
221
221
|
}), /* @__PURE__ */ j("span", {
|
|
222
|
-
className: `text-sm font-medium ${Q.settings?.ssoEnabled ? "text-success" : "text-
|
|
222
|
+
className: `text-sm font-medium ${Q.settings?.ssoEnabled ? "text-success" : "text-text-secondary"}`,
|
|
223
223
|
children: Q.settings?.ssoEnabled ? U("admin.tenantDetail.settings.enabled", "Enabled") : U("admin.tenantDetail.settings.disabled", "Disabled")
|
|
224
224
|
})]
|
|
225
225
|
}),
|
|
226
226
|
/* @__PURE__ */ M("div", {
|
|
227
|
-
className: "flex items-center justify-between rounded-lg border border-border p-3",
|
|
227
|
+
className: "flex items-center justify-between rounded-lg border border-border-subtle p-3",
|
|
228
228
|
children: [/* @__PURE__ */ j("span", {
|
|
229
229
|
className: "text-sm",
|
|
230
230
|
children: U("admin.tenantDetail.settings.mfaRequired", "MFA Required")
|
|
231
231
|
}), /* @__PURE__ */ j("span", {
|
|
232
|
-
className: `text-sm font-medium ${Q.settings?.mfaRequired ? "text-success" : "text-
|
|
232
|
+
className: `text-sm font-medium ${Q.settings?.mfaRequired ? "text-success" : "text-text-secondary"}`,
|
|
233
233
|
children: Q.settings?.mfaRequired ? U("admin.tenantDetail.settings.yes", "Yes") : U("admin.tenantDetail.settings.no", "No")
|
|
234
234
|
})]
|
|
235
235
|
}),
|
|
236
236
|
/* @__PURE__ */ M("div", {
|
|
237
|
-
className: "flex items-center justify-between rounded-lg border border-border p-3",
|
|
237
|
+
className: "flex items-center justify-between rounded-lg border border-border-subtle p-3",
|
|
238
238
|
children: [/* @__PURE__ */ j("span", {
|
|
239
239
|
className: "text-sm",
|
|
240
240
|
children: U("admin.tenantDetail.settings.dataRetention", "Data Retention")
|