@alepha/ui 0.28.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -2
- package/dist/components/account/account-connections.d.ts.map +1 -1
- package/dist/components/account/account-connections.js +4 -1
- package/dist/components/account/account-connections.js.map +1 -1
- package/dist/components/account/account-delete-dialog.d.ts.map +1 -1
- package/dist/components/account/account-delete-dialog.js +12 -15
- package/dist/components/account/account-delete-dialog.js.map +1 -1
- package/dist/components/account/account-keys.d.ts.map +1 -1
- package/dist/components/account/account-keys.js +22 -28
- package/dist/components/account/account-keys.js.map +1 -1
- package/dist/components/account/account-mfa-dialog.js +1 -4
- package/dist/components/account/account-mfa-dialog.js.map +1 -1
- package/dist/components/account/account-password-dialog.d.ts.map +1 -1
- package/dist/components/account/account-password-dialog.js +11 -14
- package/dist/components/account/account-password-dialog.js.map +1 -1
- package/dist/components/account/account-profile.js +3 -2
- package/dist/components/account/account-profile.js.map +1 -1
- package/dist/components/account/account-router-options.d.ts +38 -0
- package/dist/components/account/account-router-options.d.ts.map +1 -1
- package/dist/components/account/account-router-options.js.map +1 -1
- package/dist/components/account/account-router-page.d.ts +11 -1
- package/dist/components/account/account-router-page.d.ts.map +1 -1
- package/dist/components/account/account-router-page.js +11 -1
- package/dist/components/account/account-router-page.js.map +1 -1
- package/dist/components/account/account-router.d.ts +11 -0
- package/dist/components/account/account-router.d.ts.map +1 -1
- package/dist/components/account/account-router.js +16 -5
- package/dist/components/account/account-router.js.map +1 -1
- package/dist/components/admin/admin-audits.d.ts.map +1 -1
- package/dist/components/admin/admin-audits.js +91 -34
- package/dist/components/admin/admin-audits.js.map +1 -1
- package/dist/components/admin/admin-files.d.ts.map +1 -1
- package/dist/components/admin/admin-files.js +6 -17
- package/dist/components/admin/admin-files.js.map +1 -1
- package/dist/components/admin/admin-jobs-executions-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs-executions-panel.js +39 -8
- package/dist/components/admin/admin-jobs-executions-panel.js.map +1 -1
- package/dist/components/admin/admin-jobs-payload-dialog.d.ts +19 -0
- package/dist/components/admin/admin-jobs-payload-dialog.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs-payload-dialog.js +33 -0
- package/dist/components/admin/admin-jobs-payload-dialog.js.map +1 -0
- package/dist/components/admin/admin-keys.d.ts.map +1 -1
- package/dist/components/admin/admin-keys.js +5 -4
- package/dist/components/admin/admin-keys.js.map +1 -1
- package/dist/components/admin/admin-notifications-channel-label.d.ts +14 -0
- package/dist/components/admin/admin-notifications-channel-label.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-channel-label.js +26 -0
- package/dist/components/admin/admin-notifications-channel-label.js.map +1 -0
- package/dist/components/admin/admin-notifications-preview-body.d.ts.map +1 -1
- package/dist/components/admin/admin-notifications-preview-body.js +23 -13
- package/dist/components/admin/admin-notifications-preview-body.js.map +1 -1
- package/dist/components/admin/admin-notifications.d.ts.map +1 -1
- package/dist/components/admin/admin-notifications.js +11 -12
- package/dist/components/admin/admin-notifications.js.map +1 -1
- package/dist/components/admin/admin-payments.d.ts.map +1 -1
- package/dist/components/admin/admin-payments.js +9 -7
- package/dist/components/admin/admin-payments.js.map +1 -1
- package/dist/components/admin/admin-router-options.d.ts +12 -0
- package/dist/components/admin/admin-router-options.d.ts.map +1 -1
- package/dist/components/admin/admin-router-options.js.map +1 -1
- package/dist/components/admin/admin-router.d.ts +5 -8
- package/dist/components/admin/admin-router.d.ts.map +1 -1
- package/dist/components/admin/admin-router.js +6 -29
- package/dist/components/admin/admin-router.js.map +1 -1
- package/dist/components/admin/admin-sessions.d.ts.map +1 -1
- package/dist/components/admin/admin-sessions.js +9 -7
- package/dist/components/admin/admin-sessions.js.map +1 -1
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-audits-tab.js +5 -4
- package/dist/components/admin/admin-user-detail-audits-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-sessions-tab.js +7 -5
- package/dist/components/admin/admin-user-detail-sessions-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail.js +3 -2
- package/dist/components/admin/admin-user-detail.js.map +1 -1
- package/dist/components/admin/admin-users-roles-picker.d.ts.map +1 -1
- package/dist/components/admin/admin-users-roles-picker.js.map +1 -1
- package/dist/components/admin/admin-users.d.ts.map +1 -1
- package/dist/components/admin/admin-users.js +6 -4
- package/dist/components/admin/admin-users.js.map +1 -1
- package/dist/components/admin/analytics/AnalyticsChartBars.js +2 -1
- package/dist/components/admin/analytics/AnalyticsChartBars.js.map +1 -1
- package/dist/components/admin/parameter-history-item.d.ts.map +1 -1
- package/dist/components/admin/parameter-history-item.js +3 -2
- package/dist/components/admin/parameter-history-item.js.map +1 -1
- package/dist/components/alepha-table/alepha-table-bulk-menu.js +2 -1
- package/dist/components/alepha-table/alepha-table-bulk-menu.js.map +1 -1
- package/dist/components/alepha-table/alepha-table-filter-dialog.d.ts +60 -0
- package/dist/components/alepha-table/alepha-table-filter-dialog.d.ts.map +1 -0
- package/dist/components/alepha-table/alepha-table-filter-dialog.js +88 -0
- package/dist/components/alepha-table/alepha-table-filter-dialog.js.map +1 -0
- package/dist/components/alepha-table/alepha-table-filter-menu.d.ts +35 -0
- package/dist/components/alepha-table/alepha-table-filter-menu.d.ts.map +1 -0
- package/dist/components/alepha-table/alepha-table-filter-menu.js +54 -0
- package/dist/components/alepha-table/alepha-table-filter-menu.js.map +1 -0
- package/dist/components/alepha-table/alepha-table.d.ts +188 -3
- package/dist/components/alepha-table/alepha-table.d.ts.map +1 -1
- package/dist/components/alepha-table/alepha-table.js +551 -162
- package/dist/components/alepha-table/alepha-table.js.map +1 -1
- package/dist/components/alepha-table/query-filters.d.ts +73 -0
- package/dist/components/alepha-table/query-filters.d.ts.map +1 -0
- package/dist/components/alepha-table/query-filters.js +118 -0
- package/dist/components/alepha-table/query-filters.js.map +1 -0
- package/dist/components/app-actions/app-actions.d.ts +21 -0
- package/dist/components/app-actions/app-actions.d.ts.map +1 -1
- package/dist/components/app-actions/app-actions.js +11 -5
- package/dist/components/app-actions/app-actions.js.map +1 -1
- package/dist/components/app-shell/app-shell.d.ts +45 -0
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/app-shell.js +119 -16
- package/dist/components/app-shell/app-shell.js.map +1 -1
- package/dist/components/auth/auth-register.js +31 -30
- package/dist/components/auth/auth-register.js.map +1 -1
- package/dist/components/auto-form/auto-form.d.ts.map +1 -1
- package/dist/components/auto-form/auto-form.js +68 -30
- package/dist/components/auto-form/auto-form.js.map +1 -1
- package/dist/components/button-dark/button-dark.d.ts.map +1 -1
- package/dist/components/button-dark/button-dark.js +39 -8
- package/dist/components/button-dark/button-dark.js.map +1 -1
- package/dist/components/button-inbox/button-inbox.d.ts +66 -0
- package/dist/components/button-inbox/button-inbox.d.ts.map +1 -0
- package/dist/components/button-inbox/button-inbox.js +167 -0
- package/dist/components/button-inbox/button-inbox.js.map +1 -0
- package/dist/components/button-inbox/inbox-unread-atom.d.ts +22 -0
- package/dist/components/button-inbox/inbox-unread-atom.d.ts.map +1 -0
- package/dist/components/button-inbox/inbox-unread-atom.js +29 -0
- package/dist/components/button-inbox/inbox-unread-atom.js.map +1 -0
- package/dist/components/button-theme/button-theme.d.ts +4 -3
- package/dist/components/button-theme/button-theme.d.ts.map +1 -1
- package/dist/components/button-theme/button-theme.js +8 -25
- package/dist/components/button-theme/button-theme.js.map +1 -1
- package/dist/components/button-user/button-user.d.ts +19 -0
- package/dist/components/button-user/button-user.d.ts.map +1 -1
- package/dist/components/button-user/button-user.js +1 -1
- package/dist/components/button-user/button-user.js.map +1 -1
- package/dist/components/control/control.d.ts +51 -0
- package/dist/components/control/control.d.ts.map +1 -1
- package/dist/components/control/control.js +49 -5
- package/dist/components/control/control.js.map +1 -1
- package/dist/components/control-array/control-array.js +2 -1
- package/dist/components/control-array/control-array.js.map +1 -1
- package/dist/components/control-date/control-date.d.ts +27 -0
- package/dist/components/control-date/control-date.d.ts.map +1 -1
- package/dist/components/control-date/control-date.js +15 -19
- package/dist/components/control-date/control-date.js.map +1 -1
- package/dist/components/control-date/date-only.d.ts +18 -0
- package/dist/components/control-date/date-only.d.ts.map +1 -0
- package/dist/components/control-date/date-only.js +29 -0
- package/dist/components/control-date/date-only.js.map +1 -0
- package/dist/components/control-date-range/control-date-range.d.ts +56 -0
- package/dist/components/control-date-range/control-date-range.d.ts.map +1 -0
- package/dist/components/control-date-range/control-date-range.js +148 -0
- package/dist/components/control-date-range/control-date-range.js.map +1 -0
- package/dist/components/control-object/control-object.js +2 -1
- package/dist/components/control-object/control-object.js.map +1 -1
- package/dist/components/control-select/control-select.d.ts.map +1 -1
- package/dist/components/control-select/control-select.js +177 -37
- package/dist/components/control-select/control-select.js.map +1 -1
- package/dist/components/control-upload/control-upload.d.ts.map +1 -1
- package/dist/components/control-upload/control-upload.js +1 -11
- package/dist/components/control-upload/control-upload.js.map +1 -1
- package/dist/components/detail/detail-aside.d.ts.map +1 -1
- package/dist/components/detail/detail-aside.js +4 -3
- package/dist/components/detail/detail-aside.js.map +1 -1
- package/dist/components/file-image/file-image.js +2 -1
- package/dist/components/file-image/file-image.js.map +1 -1
- package/dist/components/markdown-view/SpoilerSpan.d.ts +28 -0
- package/dist/components/markdown-view/SpoilerSpan.d.ts.map +1 -0
- package/dist/components/markdown-view/SpoilerSpan.js +53 -0
- package/dist/components/markdown-view/SpoilerSpan.js.map +1 -0
- package/dist/components/markdown-view/diagram/layoutSequence.js +13 -23
- package/dist/components/markdown-view/diagram/layoutSequence.js.map +1 -1
- package/dist/components/markdown-view/diagram/textMetrics.js +2 -2
- package/dist/components/markdown-view/diagram/textMetrics.js.map +1 -1
- package/dist/components/markdown-view/markdown-view.css +44 -0
- package/dist/components/markdown-view/markdown-view.d.ts +12 -0
- package/dist/components/markdown-view/markdown-view.d.ts.map +1 -1
- package/dist/components/markdown-view/markdown-view.js +22 -1
- package/dist/components/markdown-view/markdown-view.js.map +1 -1
- package/dist/components/markdown-view/remarkSpoiler.d.ts +17 -0
- package/dist/components/markdown-view/remarkSpoiler.d.ts.map +1 -0
- package/dist/components/markdown-view/remarkSpoiler.js +117 -0
- package/dist/components/markdown-view/remarkSpoiler.js.map +1 -0
- package/dist/components/permission-matrix/permission-matrix-group-rows.d.ts +34 -0
- package/dist/components/permission-matrix/permission-matrix-group-rows.d.ts.map +1 -0
- package/dist/components/permission-matrix/permission-matrix-group-rows.js +109 -0
- package/dist/components/permission-matrix/permission-matrix-group-rows.js.map +1 -0
- package/dist/components/permission-matrix/permission-matrix.d.ts +145 -0
- package/dist/components/permission-matrix/permission-matrix.d.ts.map +1 -0
- package/dist/components/permission-matrix/permission-matrix.js +113 -0
- package/dist/components/permission-matrix/permission-matrix.js.map +1 -0
- package/dist/components/plate-layout/plate-layout.d.ts +5 -0
- package/dist/components/plate-layout/plate-layout.d.ts.map +1 -1
- package/dist/components/plate-layout/plate-layout.js +2 -1
- package/dist/components/plate-layout/plate-layout.js.map +1 -1
- package/dist/components/plate-layout/plate-tab-bar.d.ts +10 -0
- package/dist/components/plate-layout/plate-tab-bar.d.ts.map +1 -1
- package/dist/components/plate-layout/plate-tab-bar.js +1 -1
- package/dist/components/plate-layout/plate-tab-bar.js.map +1 -1
- package/dist/components/settings/settings-nav.js +2 -1
- package/dist/components/settings/settings-nav.js.map +1 -1
- package/dist/components/time-ago/time-ago.d.ts +57 -0
- package/dist/components/time-ago/time-ago.d.ts.map +1 -0
- package/dist/components/time-ago/time-ago.js +60 -0
- package/dist/components/time-ago/time-ago.js.map +1 -0
- package/dist/components/tree-view/tree-model.d.ts +128 -0
- package/dist/components/tree-view/tree-model.d.ts.map +1 -0
- package/dist/components/tree-view/tree-model.js +226 -0
- package/dist/components/tree-view/tree-model.js.map +1 -0
- package/dist/components/tree-view/tree-view-rename-input.d.ts +31 -0
- package/dist/components/tree-view/tree-view-rename-input.d.ts.map +1 -0
- package/dist/components/tree-view/tree-view-rename-input.js +68 -0
- package/dist/components/tree-view/tree-view-rename-input.js.map +1 -0
- package/dist/components/tree-view/tree-view-resizer.d.ts +38 -0
- package/dist/components/tree-view/tree-view-resizer.d.ts.map +1 -0
- package/dist/components/tree-view/tree-view-resizer.js +73 -0
- package/dist/components/tree-view/tree-view-resizer.js.map +1 -0
- package/dist/components/tree-view/tree-view-row.d.ts +177 -0
- package/dist/components/tree-view/tree-view-row.d.ts.map +1 -0
- package/dist/components/tree-view/tree-view-row.js +241 -0
- package/dist/components/tree-view/tree-view-row.js.map +1 -0
- package/dist/components/tree-view/tree-view.d.ts +186 -0
- package/dist/components/tree-view/tree-view.d.ts.map +1 -0
- package/dist/components/tree-view/tree-view.js +112 -0
- package/dist/components/tree-view/tree-view.js.map +1 -0
- package/dist/components/tree-view/use-tree-state.d.ts +79 -0
- package/dist/components/tree-view/use-tree-state.d.ts.map +1 -0
- package/dist/components/tree-view/use-tree-state.js +93 -0
- package/dist/components/tree-view/use-tree-state.js.map +1 -0
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/select.d.ts +7 -0
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +7 -0
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/lib/i18n-fr.d.ts.map +1 -1
- package/dist/lib/i18n-fr.js +31 -47
- package/dist/lib/i18n-fr.js.map +1 -1
- package/dist/lib/utils.d.ts +22 -2
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +29 -5
- package/dist/lib/utils.js.map +1 -1
- package/dist/styles.css +255 -0
- package/package.json +13 -14
- package/src/components/account/__tests__/account-router.spec.ts +95 -0
- package/src/components/account/account-connections.tsx +14 -1
- package/src/components/account/account-delete-dialog.tsx +3 -2
- package/src/components/account/account-keys.tsx +11 -4
- package/src/components/account/account-mfa-dialog.tsx +1 -1
- package/src/components/account/account-password-dialog.tsx +3 -2
- package/src/components/account/account-profile.tsx +1 -1
- package/src/components/account/account-router-options.tsx +45 -0
- package/src/components/account/account-router-page.tsx +11 -1
- package/src/components/account/account-router.tsx +23 -6
- package/src/components/admin/__tests__/admin-jobs-payload-dialog.browser.spec.tsx +68 -0
- package/src/components/admin/__tests__/admin-notifications-preview-body.browser.spec.tsx +20 -4
- package/src/components/admin/__tests__/admin-status-labels.browser.spec.tsx +0 -31
- package/src/components/admin/admin-audits.tsx +99 -5
- package/src/components/admin/admin-files.tsx +7 -16
- package/src/components/admin/admin-jobs-executions-panel.tsx +152 -114
- package/src/components/admin/admin-jobs-payload-dialog.tsx +57 -0
- package/src/components/admin/admin-keys.tsx +7 -4
- package/src/components/admin/admin-notifications-channel-label.ts +18 -0
- package/src/components/admin/admin-notifications-preview-body.tsx +7 -2
- package/src/components/admin/admin-notifications.tsx +19 -8
- package/src/components/admin/admin-payments.tsx +7 -4
- package/src/components/admin/admin-router-options.tsx +12 -0
- package/src/components/admin/admin-router.tsx +5 -27
- package/src/components/admin/admin-sessions.tsx +10 -6
- package/src/components/admin/admin-user-detail-audits-tab.tsx +7 -4
- package/src/components/admin/admin-user-detail-sessions-tab.tsx +7 -4
- package/src/components/admin/admin-users-roles-picker.tsx +4 -0
- package/src/components/admin/admin-users.tsx +6 -3
- package/src/components/admin/parameter-history-item.tsx +4 -2
- package/src/components/alepha-table/__tests__/alepha-table-default-hidden.browser.spec.tsx +108 -0
- package/src/components/alepha-table/__tests__/alepha-table-empty-state.browser.spec.tsx +233 -0
- package/src/components/alepha-table/__tests__/alepha-table-persist-facets.browser.spec.tsx +177 -0
- package/src/components/alepha-table/__tests__/alepha-table-persisted-filters.browser.spec.tsx +182 -0
- package/src/components/alepha-table/__tests__/alepha-table-query-seed.browser.spec.tsx +170 -0
- package/src/components/alepha-table/__tests__/alepha-table-row-action-checked.browser.spec.tsx +210 -0
- package/src/components/alepha-table/__tests__/alepha-table-row-action-group.browser.spec.tsx +202 -0
- package/src/components/alepha-table/__tests__/alepha-table-scope.browser.spec.tsx +161 -0
- package/src/components/alepha-table/__tests__/alepha-table-share-filters.browser.spec.tsx +309 -0
- package/src/components/alepha-table/__tests__/query-filters.spec.ts +212 -0
- package/src/components/alepha-table/alepha-table-filter-dialog.tsx +162 -0
- package/src/components/alepha-table/alepha-table-filter-menu.tsx +77 -0
- package/src/components/alepha-table/alepha-table.tsx +1113 -207
- package/src/components/alepha-table/query-filters.ts +159 -0
- package/src/components/app-actions/app-actions.tsx +32 -3
- package/src/components/app-shell/__tests__/sidebar-nav-accordion.browser.spec.tsx +163 -0
- package/src/components/app-shell/app-shell.tsx +255 -12
- package/src/components/auto-form/__tests__/auto-form-settings-card.browser.spec.tsx +1 -1
- package/src/components/auto-form/auto-form.tsx +98 -30
- package/src/components/button-dark/button-dark.tsx +47 -8
- package/src/components/button-inbox/__tests__/button-inbox.browser.spec.tsx +247 -0
- package/src/components/button-inbox/button-inbox.tsx +303 -0
- package/src/components/button-inbox/inbox-unread-atom.ts +27 -0
- package/src/components/button-theme/button-theme.tsx +16 -29
- package/src/components/button-user/__tests__/button-user-avatar.browser.spec.tsx +88 -0
- package/src/components/button-user/button-user.tsx +24 -1
- package/src/components/control/__tests__/control-date-range.browser.spec.tsx +177 -0
- package/src/components/control/control.tsx +119 -12
- package/src/components/control-date/control-date.tsx +117 -22
- package/src/components/control-date/date-only.ts +26 -0
- package/src/components/control-date-range/control-date-range.tsx +250 -0
- package/src/components/control-select/__tests__/control-select-clear-label.browser.spec.tsx +129 -15
- package/src/components/control-select/__tests__/control-select-deselect.browser.spec.tsx +27 -6
- package/src/components/control-select/__tests__/control-select-multi.browser.spec.tsx +204 -1
- package/src/components/control-select/__tests__/control-select-size-minimal.browser.spec.tsx +77 -1
- package/src/components/control-select/control-select.tsx +317 -83
- package/src/components/control-upload/control-upload.tsx +1 -10
- package/src/components/detail/detail-aside.tsx +30 -6
- package/src/components/markdown-view/SpoilerSpan.tsx +66 -0
- package/src/components/markdown-view/__tests__/markdown-view-spoiler.browser.spec.tsx +165 -0
- package/src/components/markdown-view/diagram/textMetrics.spec.ts +1 -1
- package/src/components/markdown-view/diagram/textMetrics.ts +2 -2
- package/src/components/markdown-view/markdown-view.css +44 -0
- package/src/components/markdown-view/markdown-view.tsx +37 -1
- package/src/components/markdown-view/remarkSpoiler.ts +150 -0
- package/src/components/permission-matrix/__tests__/permission-matrix.browser.spec.tsx +237 -0
- package/src/components/permission-matrix/permission-matrix-group-rows.tsx +240 -0
- package/src/components/permission-matrix/permission-matrix.tsx +286 -0
- package/src/components/plate-layout/__tests__/plate-layout.browser.spec.tsx +22 -0
- package/src/components/plate-layout/plate-layout.tsx +6 -0
- package/src/components/plate-layout/plate-tab-bar.tsx +27 -1
- package/src/components/time-ago/time-ago.browser.spec.tsx +110 -0
- package/src/components/time-ago/time-ago.tsx +80 -0
- package/src/components/tree-view/__tests__/tree-model.spec.ts +441 -0
- package/src/components/tree-view/__tests__/tree-view-drag.browser.spec.tsx +295 -0
- package/src/components/tree-view/__tests__/tree-view-rename.browser.spec.tsx +278 -0
- package/src/components/tree-view/__tests__/tree-view-resizer.browser.spec.tsx +112 -0
- package/src/components/tree-view/__tests__/tree-view.browser.spec.tsx +260 -0
- package/src/components/tree-view/__tests__/use-tree-state.browser.spec.tsx +238 -0
- package/src/components/tree-view/tree-model.ts +369 -0
- package/src/components/tree-view/tree-view-rename-input.tsx +95 -0
- package/src/components/tree-view/tree-view-resizer.tsx +83 -0
- package/src/components/tree-view/tree-view-row.tsx +414 -0
- package/src/components/tree-view/tree-view.tsx +300 -0
- package/src/components/tree-view/use-tree-state.ts +184 -0
- package/src/components/ui/button.tsx +79 -1
- package/src/components/ui/dropdown-menu.tsx +1 -1
- package/src/components/ui/select.tsx +7 -0
- package/src/components/ui/table.tsx +1 -1
- package/src/components/ui/tooltip.tsx +1 -1
- package/src/lib/i18n-fr.ts +34 -51
- package/src/lib/utils.ts +32 -4
- package/src/styles.css +255 -0
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts +0 -11
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts.map +0 -1
- package/dist/components/admin/admin-workflows-execution-sheet.js +0 -190
- package/dist/components/admin/admin-workflows-execution-sheet.js.map +0 -1
- package/dist/components/admin/admin-workflows-executions-panel.d.ts +0 -9
- package/dist/components/admin/admin-workflows-executions-panel.d.ts.map +0 -1
- package/dist/components/admin/admin-workflows-executions-panel.js +0 -121
- package/dist/components/admin/admin-workflows-executions-panel.js.map +0 -1
- package/dist/components/admin/admin-workflows-status-badge.d.ts +0 -12
- package/dist/components/admin/admin-workflows-status-badge.d.ts.map +0 -1
- package/dist/components/admin/admin-workflows-status-badge.js +0 -30
- package/dist/components/admin/admin-workflows-status-badge.js.map +0 -1
- package/dist/components/admin/admin-workflows-status-labels.d.ts +0 -19
- package/dist/components/admin/admin-workflows-status-labels.d.ts.map +0 -1
- package/dist/components/admin/admin-workflows-status-labels.js +0 -48
- package/dist/components/admin/admin-workflows-status-labels.js.map +0 -1
- package/dist/components/admin/admin-workflows.d.ts +0 -4
- package/dist/components/admin/admin-workflows.d.ts.map +0 -1
- package/dist/components/admin/admin-workflows.js +0 -145
- package/dist/components/admin/admin-workflows.js.map +0 -1
- package/src/components/admin/admin-workflows-execution-sheet.tsx +0 -285
- package/src/components/admin/admin-workflows-executions-panel.tsx +0 -169
- package/src/components/admin/admin-workflows-status-badge.tsx +0 -41
- package/src/components/admin/admin-workflows-status-labels.ts +0 -51
- package/src/components/admin/admin-workflows.tsx +0 -209
|
@@ -47,7 +47,17 @@ import { AccountRouter } from "./account-router.tsx";
|
|
|
47
47
|
* invitations = $pageAccount({
|
|
48
48
|
* path: "/invitations",
|
|
49
49
|
* name: "accountInvitations",
|
|
50
|
-
* nav: {
|
|
50
|
+
* nav: {
|
|
51
|
+
* label: "Invitations",
|
|
52
|
+
* // ⚠️ `createElement(Mail)`, never `<Mail />`. This module graph is
|
|
53
|
+
* // imported by `alepha db migrations create` under `tsx` with the
|
|
54
|
+
* // classic JSX transform, where the element form emits a bare
|
|
55
|
+
* // `React.createElement` and breaks migration generation for the
|
|
56
|
+
* // whole app - far from the icon that caused it.
|
|
57
|
+
* icon: createElement(Mail),
|
|
58
|
+
* group: "Lore",
|
|
59
|
+
* order: 100,
|
|
60
|
+
* },
|
|
51
61
|
* can: () => this.invitationApi.listMyInvitations.can(),
|
|
52
62
|
* lazy: () => import("./MyInvitations.tsx"),
|
|
53
63
|
* });
|
|
@@ -13,7 +13,10 @@ import { $client } from "alepha/server/links";
|
|
|
13
13
|
import { KeyRound, Plug, RadioTower, ShieldCheck, User } from "lucide-react";
|
|
14
14
|
import { createElement } from "react";
|
|
15
15
|
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
type AccountPage,
|
|
18
|
+
accountRouterOptionsAtom,
|
|
19
|
+
} from "./account-router-options.tsx";
|
|
17
20
|
|
|
18
21
|
/**
|
|
19
22
|
* The whole `/account` surface — five pages and their shell — mounted and
|
|
@@ -117,6 +120,18 @@ import { accountRouterOptionsAtom } from "./account-router-options.tsx";
|
|
|
117
120
|
export class AccountRouter {
|
|
118
121
|
protected readonly options = $store(accountRouterOptionsAtom);
|
|
119
122
|
|
|
123
|
+
/**
|
|
124
|
+
* Whether the application has declared it does not offer this page.
|
|
125
|
+
*
|
|
126
|
+
* ANDed into each page's `can`, never replacing it: whether the action
|
|
127
|
+
* exists stays the registry's question. See
|
|
128
|
+
* `AccountRouterOptions.hide` for the page this exists for and why `can`
|
|
129
|
+
* alone cannot answer it.
|
|
130
|
+
*/
|
|
131
|
+
protected hidden(page: AccountPage): boolean {
|
|
132
|
+
return this.options.hide?.includes(page) ?? false;
|
|
133
|
+
}
|
|
134
|
+
|
|
120
135
|
protected readonly profileApi = $client<MyProfileController>();
|
|
121
136
|
protected readonly realmApi = $client<RealmController>();
|
|
122
137
|
protected readonly identityApi = $client<MyIdentityController>();
|
|
@@ -149,7 +164,7 @@ export class AccountRouter {
|
|
|
149
164
|
path: "/",
|
|
150
165
|
name: "accountProfile",
|
|
151
166
|
head: { title: "Profile" },
|
|
152
|
-
can: () => this.profileApi.getMyProfile.can(),
|
|
167
|
+
can: () => !this.hidden("profile") && this.profileApi.getMyProfile.can(),
|
|
153
168
|
nav: {
|
|
154
169
|
label: "Profile",
|
|
155
170
|
labelKey: "account.nav.profile",
|
|
@@ -185,7 +200,8 @@ export class AccountRouter {
|
|
|
185
200
|
path: "/security",
|
|
186
201
|
name: "accountSecurity",
|
|
187
202
|
head: { title: "Security" },
|
|
188
|
-
can: () =>
|
|
203
|
+
can: () =>
|
|
204
|
+
!this.hidden("security") && this.identityApi.listMyIdentities.can(),
|
|
189
205
|
nav: {
|
|
190
206
|
label: "Security",
|
|
191
207
|
labelKey: "account.nav.security",
|
|
@@ -217,7 +233,7 @@ export class AccountRouter {
|
|
|
217
233
|
path: "/sessions",
|
|
218
234
|
name: "accountSessions",
|
|
219
235
|
head: { title: "Sessions" },
|
|
220
|
-
can: () => this.sessionApi.listMySessions.can(),
|
|
236
|
+
can: () => !this.hidden("sessions") && this.sessionApi.listMySessions.can(),
|
|
221
237
|
nav: {
|
|
222
238
|
label: "Sessions",
|
|
223
239
|
labelKey: "account.nav.sessions",
|
|
@@ -237,7 +253,7 @@ export class AccountRouter {
|
|
|
237
253
|
path: "/keys",
|
|
238
254
|
name: "accountKeys",
|
|
239
255
|
head: { title: "API keys" },
|
|
240
|
-
can: () => this.apiKeyApi.listApiKeys.can(),
|
|
256
|
+
can: () => !this.hidden("keys") && this.apiKeyApi.listApiKeys.can(),
|
|
241
257
|
nav: {
|
|
242
258
|
label: "API keys",
|
|
243
259
|
labelKey: "account.nav.keys",
|
|
@@ -257,7 +273,8 @@ export class AccountRouter {
|
|
|
257
273
|
path: "/connections",
|
|
258
274
|
name: "accountConnections",
|
|
259
275
|
head: { title: "Connected apps" },
|
|
260
|
-
can: () =>
|
|
276
|
+
can: () =>
|
|
277
|
+
!this.hidden("connections") && this.connectionApi.listMyConnections.can(),
|
|
261
278
|
nav: {
|
|
262
279
|
label: "Connected apps",
|
|
263
280
|
labelKey: "account.nav.connections",
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import { Alepha } from "alepha";
|
|
3
|
+
import type { JobExecutionResource } from "alepha/api/jobs";
|
|
4
|
+
import { AlephaContext } from "alepha/react";
|
|
5
|
+
import { AlephaReactI18n } from "alepha/react/i18n";
|
|
6
|
+
import { setupJsdomMocks } from "alepha/react/testing";
|
|
7
|
+
import { afterEach, beforeAll, describe, expect, it } from "vitest";
|
|
8
|
+
|
|
9
|
+
import { AdminJobsPayloadDialog } from "../admin-jobs-payload-dialog.tsx";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A job that reschedules itself through stages carries the stage in its
|
|
13
|
+
* payload, and this dialog is the one place the admin can read it. What it
|
|
14
|
+
* pins: the payload is printed whole while an execution is set, and nothing
|
|
15
|
+
* renders once cleared.
|
|
16
|
+
*/
|
|
17
|
+
describe("AdminJobsPayloadDialog", () => {
|
|
18
|
+
let alepha: Alepha | undefined;
|
|
19
|
+
|
|
20
|
+
beforeAll(() => {
|
|
21
|
+
setupJsdomMocks();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
afterEach(async () => {
|
|
25
|
+
await alepha?.stop();
|
|
26
|
+
alepha = undefined;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const parked: JobExecutionResource = {
|
|
30
|
+
id: "0192aaaa-0000-7000-8000-000000000001",
|
|
31
|
+
jobName: "CartRecoveryJobs.cartRecovery",
|
|
32
|
+
status: "scheduled",
|
|
33
|
+
priority: "normal",
|
|
34
|
+
attempt: 0,
|
|
35
|
+
maxAttempts: 4,
|
|
36
|
+
redispatchCount: 0,
|
|
37
|
+
key: "cart-1",
|
|
38
|
+
payload: { cartId: "cart-1", stage: "secondReminder" },
|
|
39
|
+
scheduledAt: "2026-09-05T20:00:00.000Z",
|
|
40
|
+
createdAt: "2026-09-04T20:00:00.000Z",
|
|
41
|
+
updatedAt: "2026-09-04T20:00:00.000Z",
|
|
42
|
+
can: { retry: false, cancel: true },
|
|
43
|
+
} as JobExecutionResource;
|
|
44
|
+
|
|
45
|
+
const mount = async (execution: JobExecutionResource | null) => {
|
|
46
|
+
alepha = Alepha.create().with(AlephaReactI18n);
|
|
47
|
+
await alepha.start();
|
|
48
|
+
return render(
|
|
49
|
+
<AlephaContext.Provider value={alepha}>
|
|
50
|
+
<AdminJobsPayloadDialog execution={execution} onClose={() => {}} />
|
|
51
|
+
</AlephaContext.Provider>,
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
it("prints the payload whole, stage included, while an execution is set", async () => {
|
|
56
|
+
await mount(parked);
|
|
57
|
+
|
|
58
|
+
expect(screen.getByText("Payload")).toBeTruthy();
|
|
59
|
+
expect(screen.getByText(/"stage": "secondReminder"/)).toBeTruthy();
|
|
60
|
+
expect(screen.getByText(/"cartId": "cart-1"/)).toBeTruthy();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("renders nothing when execution is null", async () => {
|
|
64
|
+
await mount(null);
|
|
65
|
+
|
|
66
|
+
expect(screen.queryByText("Payload")).toBeNull();
|
|
67
|
+
});
|
|
68
|
+
});
|
|
@@ -81,7 +81,7 @@ describe("AdminNotificationsPreviewBody", () => {
|
|
|
81
81
|
available: true,
|
|
82
82
|
channel: "email",
|
|
83
83
|
subject: "Welcome",
|
|
84
|
-
|
|
84
|
+
body: "<p>Hi Ada</p>",
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
const frame = container.querySelector("iframe");
|
|
@@ -99,7 +99,7 @@ describe("AdminNotificationsPreviewBody", () => {
|
|
|
99
99
|
const { container } = mount({
|
|
100
100
|
available: true,
|
|
101
101
|
channel: "email",
|
|
102
|
-
|
|
102
|
+
body: "<p>x</p>",
|
|
103
103
|
});
|
|
104
104
|
expect(container.textContent).toContain("Re-rendered from the template");
|
|
105
105
|
});
|
|
@@ -108,18 +108,34 @@ describe("AdminNotificationsPreviewBody", () => {
|
|
|
108
108
|
const { container } = mount({
|
|
109
109
|
available: true,
|
|
110
110
|
channel: "sms",
|
|
111
|
-
|
|
111
|
+
body: "Your code is 123456",
|
|
112
112
|
});
|
|
113
113
|
|
|
114
114
|
expect(container.querySelector("iframe")).toBeNull();
|
|
115
115
|
expect(container.textContent).toContain("Your code is 123456");
|
|
116
116
|
});
|
|
117
117
|
|
|
118
|
+
/**
|
|
119
|
+
* The component must be generic, not merely still correct for the two
|
|
120
|
+
* channels the framework ships. A plugin's channel renders as text through
|
|
121
|
+
* the same flat `body` an sms uses, with no entry anywhere that names it.
|
|
122
|
+
*/
|
|
123
|
+
it("renders an unknown channel as text, through the same flat body", () => {
|
|
124
|
+
const { container } = mount({
|
|
125
|
+
available: true,
|
|
126
|
+
channel: "discord",
|
|
127
|
+
body: "shipped v1.2.3",
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
expect(container.querySelector("iframe")).toBeNull();
|
|
131
|
+
expect(container.textContent).toContain("shipped v1.2.3");
|
|
132
|
+
});
|
|
133
|
+
|
|
118
134
|
it("lists attachment names without trying to load them", () => {
|
|
119
135
|
const { container } = mount({
|
|
120
136
|
available: true,
|
|
121
137
|
channel: "email",
|
|
122
|
-
|
|
138
|
+
body: "<p>x</p>",
|
|
123
139
|
attachments: ["invoice-2026-08.pdf"],
|
|
124
140
|
});
|
|
125
141
|
|
|
@@ -2,10 +2,6 @@ import { render } from "@testing-library/react";
|
|
|
2
2
|
import { Alepha } from "alepha";
|
|
3
3
|
import { jobExecutionEntity } from "alepha/api/jobs";
|
|
4
4
|
import { notificationQuerySchema } from "alepha/api/notifications";
|
|
5
|
-
import {
|
|
6
|
-
workflowExecutions,
|
|
7
|
-
workflowStepExecutions,
|
|
8
|
-
} from "alepha/api/workflows";
|
|
9
5
|
import { AlephaContext } from "alepha/react";
|
|
10
6
|
import { $dictionary, AlephaReactI18n, I18nProvider } from "alepha/react/i18n";
|
|
11
7
|
import { describe, expect, it } from "vitest";
|
|
@@ -17,10 +13,6 @@ import {
|
|
|
17
13
|
} from "../admin-jobs-status-labels.ts";
|
|
18
14
|
import { useNotificationStatusLabels } from "../admin-notifications-status-labels.ts";
|
|
19
15
|
import { NOTIFICATION_STATUSES } from "../admin-notifications-status-tones.ts";
|
|
20
|
-
import {
|
|
21
|
-
useWorkflowStatusLabels,
|
|
22
|
-
WORKFLOW_EXECUTION_STATUSES,
|
|
23
|
-
} from "../admin-workflows-status-labels.ts";
|
|
24
16
|
|
|
25
17
|
/**
|
|
26
18
|
* The status vocabularies are the one place where a translation can go
|
|
@@ -108,13 +100,6 @@ describe("admin status labels", () => {
|
|
|
108
100
|
expect(labels.skipped).toBe("Ignorée");
|
|
109
101
|
});
|
|
110
102
|
|
|
111
|
-
it("offers every workflow EXECUTION status, and no step-only one", () => {
|
|
112
|
-
expect(WORKFLOW_EXECUTION_STATUSES).toEqual(statusesOf(workflowExecutions));
|
|
113
|
-
// `skipped` is a step status: offering it as an execution filter would be
|
|
114
|
-
// a value the query can never match.
|
|
115
|
-
expect(WORKFLOW_EXECUTION_STATUSES).not.toContain("skipped");
|
|
116
|
-
});
|
|
117
|
-
|
|
118
103
|
it("translates every job status into French", async () => {
|
|
119
104
|
const labels = await renderWith(useJobStatusLabels, "fr");
|
|
120
105
|
|
|
@@ -128,22 +113,6 @@ describe("admin status labels", () => {
|
|
|
128
113
|
expect(labels.ok).toBe("Réussie");
|
|
129
114
|
});
|
|
130
115
|
|
|
131
|
-
it("translates both workflow vocabularies into French", async () => {
|
|
132
|
-
const labels = await renderWith(useWorkflowStatusLabels, "fr");
|
|
133
|
-
|
|
134
|
-
// The badge takes either an execution or a step status, so the labels
|
|
135
|
-
// have to span the union - the two enums differ on `timed_out`/`skipped`.
|
|
136
|
-
const union = new Set([
|
|
137
|
-
...statusesOf(workflowExecutions),
|
|
138
|
-
...statusesOf(workflowStepExecutions),
|
|
139
|
-
]);
|
|
140
|
-
for (const status of union) {
|
|
141
|
-
expect(labels[status]).toBeTruthy();
|
|
142
|
-
expect(labels[status]).not.toBe(status);
|
|
143
|
-
}
|
|
144
|
-
expect(labels.compensation_failed).toBe("Échec de la compensation");
|
|
145
|
-
});
|
|
146
|
-
|
|
147
116
|
it("falls back to the English default when no catalogue defines the key", async () => {
|
|
148
117
|
const labels = await renderWith(useJobStatusLabels, "en");
|
|
149
118
|
expect(labels.ok).toBe("Succeeded");
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
+
import TimeAgo from "../time-ago/time-ago.tsx";
|
|
4
|
+
|
|
3
5
|
void React;
|
|
4
6
|
|
|
5
7
|
import { AdminPage } from "@alepha/ui/components/admin/admin-page";
|
|
@@ -18,12 +20,31 @@ import type {
|
|
|
18
20
|
import { useClient } from "alepha/react";
|
|
19
21
|
import { useI18n } from "alepha/react/i18n";
|
|
20
22
|
import { useRouter } from "alepha/react/router";
|
|
21
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
CircleDot,
|
|
25
|
+
Layers,
|
|
26
|
+
SlidersHorizontal,
|
|
27
|
+
Trash2,
|
|
28
|
+
User,
|
|
29
|
+
Zap,
|
|
30
|
+
} from "lucide-react";
|
|
22
31
|
import { useCallback, useEffect, useState } from "react";
|
|
23
32
|
|
|
24
33
|
const auditFiltersSchema = z.object({
|
|
25
34
|
status: z.string().optional(),
|
|
26
35
|
action: z.string().optional(),
|
|
36
|
+
layer: z.string().optional(),
|
|
37
|
+
/**
|
|
38
|
+
* When, as a closed range of calendar days.
|
|
39
|
+
*
|
|
40
|
+
* ⚠️ Deliberately NOT a `dateRange` field on `auditQuerySchema`. That schema
|
|
41
|
+
* declares `from`, `to` and `after` with documented semantics (`after` is an
|
|
42
|
+
* exclusive cursor), and two ways to say one thing in a public query schema
|
|
43
|
+
* is a smell. The mapping happens at the call site below, which is also what
|
|
44
|
+
* proves a range control can drive an existing from/to endpoint with no API
|
|
45
|
+
* churn at all.
|
|
46
|
+
*/
|
|
47
|
+
createdAt: z.dateRange().optional(),
|
|
27
48
|
});
|
|
28
49
|
type AuditFilters = Infer<typeof auditFiltersSchema>;
|
|
29
50
|
|
|
@@ -31,7 +52,7 @@ export const AdminAudits = () => {
|
|
|
31
52
|
const client = useClient<AdminAuditController>();
|
|
32
53
|
const toast = useToast();
|
|
33
54
|
const router = useRouter();
|
|
34
|
-
const {
|
|
55
|
+
const { tr } = useI18n();
|
|
35
56
|
|
|
36
57
|
const [actions, setActions] = useState<AuditActionPair[]>([]);
|
|
37
58
|
|
|
@@ -70,7 +91,20 @@ export const AdminAudits = () => {
|
|
|
70
91
|
sort: params.sort,
|
|
71
92
|
type: pair?.type,
|
|
72
93
|
action: pair?.action,
|
|
94
|
+
layer:
|
|
95
|
+
f?.layer === "app" || f?.layer === "scoped" ? f.layer : undefined,
|
|
73
96
|
success: f?.status ? f.status === "ok" : undefined,
|
|
97
|
+
// A day resolved to an instant, in UTC. The reader arguably means
|
|
98
|
+
// their local day, but the server is not told their offset and UTC
|
|
99
|
+
// is what makes a shared link select the same rows for everyone. The
|
|
100
|
+
// end runs to the last millisecond so a one-day range selects that
|
|
101
|
+
// day rather than nothing.
|
|
102
|
+
...(f?.createdAt?.length === 2
|
|
103
|
+
? {
|
|
104
|
+
from: `${f.createdAt[0]}T00:00:00.000Z`,
|
|
105
|
+
to: `${f.createdAt[1]}T23:59:59.999Z`,
|
|
106
|
+
}
|
|
107
|
+
: {}),
|
|
74
108
|
},
|
|
75
109
|
});
|
|
76
110
|
},
|
|
@@ -142,6 +176,49 @@ export const AdminAudits = () => {
|
|
|
142
176
|
schema: auditFiltersSchema,
|
|
143
177
|
render: (form) => (
|
|
144
178
|
<div className="flex items-center gap-2">
|
|
179
|
+
{/*
|
|
180
|
+
Unfiltered by default, so this page stays the view that shows
|
|
181
|
+
everything: an admin who cannot see a row cannot audit it.
|
|
182
|
+
The control is here because tenant-scoped events (a project's
|
|
183
|
+
own activity, read on the project's page) otherwise bury the
|
|
184
|
+
deployment's security events under their volume.
|
|
185
|
+
*/}
|
|
186
|
+
<Control
|
|
187
|
+
input={form.input.layer}
|
|
188
|
+
label=""
|
|
189
|
+
clearable
|
|
190
|
+
icon={Layers}
|
|
191
|
+
clearLabel={String(
|
|
192
|
+
tr("admin.audits.layerAll", { default: "All layers" }),
|
|
193
|
+
)}
|
|
194
|
+
triggerClassName="w-40"
|
|
195
|
+
items={[
|
|
196
|
+
{
|
|
197
|
+
value: "app",
|
|
198
|
+
label: String(
|
|
199
|
+
tr("admin.audits.layerApp", { default: "App" }),
|
|
200
|
+
),
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
value: "scoped",
|
|
204
|
+
label: String(
|
|
205
|
+
tr("admin.audits.layerScoped", { default: "Scoped" }),
|
|
206
|
+
),
|
|
207
|
+
},
|
|
208
|
+
]}
|
|
209
|
+
/>
|
|
210
|
+
{/* No `items` and no `icon`: the control selects itself off the
|
|
211
|
+
schema's `date-range` format, and `parseField` gives that
|
|
212
|
+
format the calendar glyph. */}
|
|
213
|
+
<Control
|
|
214
|
+
input={form.input.createdAt}
|
|
215
|
+
label=""
|
|
216
|
+
clearable
|
|
217
|
+
triggerClassName="w-64"
|
|
218
|
+
placeholder={String(
|
|
219
|
+
tr("admin.audits.dateAll", { default: "Any date" }),
|
|
220
|
+
)}
|
|
221
|
+
/>
|
|
145
222
|
<Control
|
|
146
223
|
input={form.input.status}
|
|
147
224
|
label=""
|
|
@@ -191,9 +268,10 @@ export const AdminAudits = () => {
|
|
|
191
268
|
label: tr("admin.audits.colWhen", { default: "When" }),
|
|
192
269
|
sortable: true,
|
|
193
270
|
cell: (a) => (
|
|
194
|
-
<
|
|
195
|
-
{
|
|
196
|
-
|
|
271
|
+
<TimeAgo
|
|
272
|
+
value={a.createdAt}
|
|
273
|
+
className="text-muted-foreground text-xs"
|
|
274
|
+
/>
|
|
197
275
|
),
|
|
198
276
|
},
|
|
199
277
|
action: {
|
|
@@ -204,6 +282,22 @@ export const AdminAudits = () => {
|
|
|
204
282
|
</code>
|
|
205
283
|
),
|
|
206
284
|
},
|
|
285
|
+
scope: {
|
|
286
|
+
label: tr("admin.audits.colScope", { default: "Scope" }),
|
|
287
|
+
// Without this the Scoped filter shows rows with no way to tell
|
|
288
|
+
// which tenant they belong to, which is a filter that narrows to
|
|
289
|
+
// an unreadable list.
|
|
290
|
+
cell: (a) =>
|
|
291
|
+
a.scopeType ? (
|
|
292
|
+
<span className="font-mono text-xs">
|
|
293
|
+
{a.scopeType}:{a.scopeId ?? "?"}
|
|
294
|
+
</span>
|
|
295
|
+
) : (
|
|
296
|
+
<span className="text-muted-foreground text-xs">
|
|
297
|
+
{tr("admin.audits.layerApp", { default: "App" })}
|
|
298
|
+
</span>
|
|
299
|
+
),
|
|
300
|
+
},
|
|
207
301
|
resource: {
|
|
208
302
|
label: tr("admin.audits.colResource", { default: "Resource" }),
|
|
209
303
|
cell: (a) => {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
+
import TimeAgo from "../time-ago/time-ago.tsx";
|
|
4
|
+
|
|
3
5
|
void React;
|
|
4
6
|
|
|
5
7
|
import { AdminPage } from "@alepha/ui/components/admin/admin-page";
|
|
@@ -14,6 +16,7 @@ import {
|
|
|
14
16
|
HoverCardTrigger,
|
|
15
17
|
} from "@alepha/ui/components/ui/hover-card";
|
|
16
18
|
import { useToast } from "@alepha/ui/components/use-toast/use-toast";
|
|
19
|
+
import { formatBytes } from "@alepha/ui/lib/utils";
|
|
17
20
|
import { type Infer, z } from "alepha";
|
|
18
21
|
import type {
|
|
19
22
|
AdminFileStatsController,
|
|
@@ -31,16 +34,6 @@ import {
|
|
|
31
34
|
useState,
|
|
32
35
|
} from "react";
|
|
33
36
|
|
|
34
|
-
const formatBytes = (n: number) => {
|
|
35
|
-
if (!n) return "0 B";
|
|
36
|
-
const units = ["B", "KB", "MB", "GB", "TB"];
|
|
37
|
-
const i = Math.min(
|
|
38
|
-
units.length - 1,
|
|
39
|
-
Math.floor(Math.log(n) / Math.log(1024)),
|
|
40
|
-
);
|
|
41
|
-
return `${(n / 1024 ** i).toFixed(1)} ${units[i]}`;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
37
|
// Filter schema at module scope so its identity stays stable across renders
|
|
45
38
|
// — AlephaTable's internal `useForm` captures it once.
|
|
46
39
|
const filtersSchema = z.object({
|
|
@@ -54,7 +47,7 @@ const isImage = (mimeType?: string) => Boolean(mimeType?.startsWith("image/"));
|
|
|
54
47
|
export const AdminFiles = () => {
|
|
55
48
|
const client = useClient<FileController>();
|
|
56
49
|
const statsClient = useClient<AdminFileStatsController>();
|
|
57
|
-
const {
|
|
50
|
+
const { tr } = useI18n();
|
|
58
51
|
const toast = useToast();
|
|
59
52
|
// Bumped after a successful upload to reload the bucket-stats query (which
|
|
60
53
|
// lists it in its deps) and the table (via AlephaTable's `refreshSignal`
|
|
@@ -311,12 +304,10 @@ export const AdminFiles = () => {
|
|
|
311
304
|
label: tr("admin.files.colUploaded", { default: "Uploaded" }),
|
|
312
305
|
sortable: true,
|
|
313
306
|
cell: (f) => (
|
|
314
|
-
<
|
|
307
|
+
<TimeAgo
|
|
308
|
+
value={f.createdAt}
|
|
315
309
|
className="text-muted-foreground text-xs"
|
|
316
|
-
|
|
317
|
-
>
|
|
318
|
-
{String(l(f.createdAt, { date: "fromNow" }))}
|
|
319
|
-
</span>
|
|
310
|
+
/>
|
|
320
311
|
),
|
|
321
312
|
},
|
|
322
313
|
}}
|