@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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AdminJobsPayloadDialog } from "@alepha/ui/components/admin/admin-jobs-payload-dialog";
|
|
1
2
|
import { AdminJobsStatusBadge } from "@alepha/ui/components/admin/admin-jobs-status-badge";
|
|
2
3
|
import { useConfirmedAction } from "@alepha/ui/components/admin/use-confirmed-action";
|
|
3
4
|
import { AlephaTable } from "@alepha/ui/components/alepha-table/alepha-table";
|
|
@@ -6,9 +7,10 @@ import { type Infer, type Page, z } from "alepha";
|
|
|
6
7
|
import type { AdminJobController, JobExecutionResource } from "alepha/api/jobs";
|
|
7
8
|
import { useClient } from "alepha/react";
|
|
8
9
|
import { useI18n } from "alepha/react/i18n";
|
|
9
|
-
import { Ban, CircleDot, RotateCcw } from "lucide-react";
|
|
10
|
-
import { useCallback } from "react";
|
|
10
|
+
import { Ban, Braces, CircleDot, RotateCcw } from "lucide-react";
|
|
11
|
+
import { useCallback, useState } from "react";
|
|
11
12
|
|
|
13
|
+
import TimeAgo from "../time-ago/time-ago.tsx";
|
|
12
14
|
import {
|
|
13
15
|
JOB_EXECUTION_STATUSES,
|
|
14
16
|
useJobStatusLabels,
|
|
@@ -60,6 +62,7 @@ export const AdminJobsExecutionsPanel = (
|
|
|
60
62
|
const client = useClient<AdminJobController>();
|
|
61
63
|
const { l, tr } = useI18n();
|
|
62
64
|
const statusLabels = useJobStatusLabels();
|
|
65
|
+
const [payloadOf, setPayloadOf] = useState<JobExecutionResource | null>(null);
|
|
63
66
|
|
|
64
67
|
const fetcher = useCallback(
|
|
65
68
|
async (params: { filters?: ExecFilters }) => {
|
|
@@ -116,125 +119,160 @@ export const AdminJobsExecutionsPanel = (
|
|
|
116
119
|
);
|
|
117
120
|
|
|
118
121
|
return (
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}}
|
|
144
|
-
columns={{
|
|
145
|
-
status: {
|
|
146
|
-
label: tr("admin.jobs.colStatus", { default: "Status" }),
|
|
147
|
-
cell: (e) => <AdminJobsStatusBadge status={e.status} />,
|
|
148
|
-
},
|
|
149
|
-
startedAt: {
|
|
150
|
-
label: tr("admin.jobs.colStarted", { default: "Started" }),
|
|
151
|
-
cell: (e) => (
|
|
152
|
-
<span className="text-muted-foreground text-xs">
|
|
153
|
-
{e.startedAt
|
|
154
|
-
? String(l(e.startedAt, { date: "fromNow" }))
|
|
155
|
-
: tr("admin.jobs.notStarted", { default: "Not started" })}
|
|
156
|
-
</span>
|
|
122
|
+
<>
|
|
123
|
+
<AlephaTable<JobExecutionResource>
|
|
124
|
+
className="min-h-0 flex-1"
|
|
125
|
+
persistenceKey={`admin.jobs.executions.${jobName}`}
|
|
126
|
+
pollMs={EXEC_POLL_MS}
|
|
127
|
+
rowKey={(e) => e.id}
|
|
128
|
+
fetch={fetcher}
|
|
129
|
+
filters={{
|
|
130
|
+
schema: execFiltersSchema,
|
|
131
|
+
render: (form) => (
|
|
132
|
+
<Control
|
|
133
|
+
input={form.input.status}
|
|
134
|
+
label=""
|
|
135
|
+
clearable
|
|
136
|
+
icon={CircleDot}
|
|
137
|
+
clearLabel={String(
|
|
138
|
+
tr("admin.jobs.statusAll", { default: "All statuses" }),
|
|
139
|
+
)}
|
|
140
|
+
triggerClassName="w-40"
|
|
141
|
+
items={JOB_EXECUTION_STATUSES.map((status) => ({
|
|
142
|
+
value: status,
|
|
143
|
+
label: statusLabels[status],
|
|
144
|
+
}))}
|
|
145
|
+
/>
|
|
157
146
|
),
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
147
|
+
}}
|
|
148
|
+
columns={{
|
|
149
|
+
status: {
|
|
150
|
+
label: tr("admin.jobs.colStatus", { default: "Status" }),
|
|
151
|
+
cell: (e) => <AdminJobsStatusBadge status={e.status} />,
|
|
152
|
+
},
|
|
153
|
+
startedAt: {
|
|
154
|
+
label: tr("admin.jobs.colStarted", { default: "Started" }),
|
|
155
|
+
cell: (e) => (
|
|
156
|
+
<span className="text-muted-foreground text-xs">
|
|
157
|
+
{e.startedAt
|
|
158
|
+
? String(l(e.startedAt, { date: "fromNow" }))
|
|
159
|
+
: tr("admin.jobs.notStarted", { default: "Not started" })}
|
|
160
|
+
</span>
|
|
161
|
+
),
|
|
162
|
+
},
|
|
163
|
+
scheduledAt: {
|
|
164
|
+
label: tr("admin.jobs.colScheduled", { default: "Scheduled" }),
|
|
165
|
+
cell: (e) =>
|
|
166
|
+
e.status === "scheduled" && e.scheduledAt ? (
|
|
167
|
+
// A parked row: a retry waiting out its backoff, a delayed
|
|
168
|
+
// push, or a job rescheduled onto its next stage.
|
|
169
|
+
<TimeAgo
|
|
170
|
+
value={e.scheduledAt}
|
|
171
|
+
className="text-muted-foreground text-xs"
|
|
172
|
+
/>
|
|
173
|
+
) : (
|
|
174
|
+
<span className="text-muted-foreground">-</span>
|
|
175
|
+
),
|
|
176
|
+
},
|
|
177
|
+
duration: {
|
|
178
|
+
label: tr("admin.jobs.colDuration", { default: "Duration" }),
|
|
179
|
+
align: "right",
|
|
180
|
+
cell: (e) => {
|
|
181
|
+
if (!e.startedAt || !e.completedAt) {
|
|
182
|
+
return <span className="text-muted-foreground">-</span>;
|
|
183
|
+
}
|
|
184
|
+
const ms =
|
|
185
|
+
new Date(e.completedAt).getTime() -
|
|
186
|
+
new Date(e.startedAt).getTime();
|
|
187
|
+
return (
|
|
188
|
+
<span className="text-xs">
|
|
189
|
+
{ms < 1000 ? `${ms} ms` : `${(ms / 1000).toFixed(1)} s`}
|
|
190
|
+
</span>
|
|
191
|
+
);
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
attempt: {
|
|
195
|
+
label: tr("admin.jobs.colAttempt", { default: "Attempt" }),
|
|
196
|
+
align: "right",
|
|
197
|
+
cell: (e) => (
|
|
170
198
|
<span className="text-xs">
|
|
171
|
-
{
|
|
199
|
+
{e.attempt}/{e.maxAttempts}
|
|
172
200
|
</span>
|
|
173
|
-
)
|
|
201
|
+
),
|
|
174
202
|
},
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
</span>
|
|
191
|
-
),
|
|
192
|
-
},
|
|
193
|
-
error: {
|
|
194
|
-
label: tr("admin.jobs.colError", { default: "Error" }),
|
|
195
|
-
cell: (e) =>
|
|
196
|
-
e.error ? (
|
|
197
|
-
<span
|
|
198
|
-
className="text-destructive line-clamp-2 text-xs"
|
|
199
|
-
title={e.error}
|
|
200
|
-
>
|
|
201
|
-
{e.error}
|
|
203
|
+
key: {
|
|
204
|
+
label: tr("admin.jobs.colKey", { default: "Key" }),
|
|
205
|
+
cell: (e) =>
|
|
206
|
+
e.key ? (
|
|
207
|
+
<span className="font-mono text-xs">{e.key}</span>
|
|
208
|
+
) : (
|
|
209
|
+
// Terminal rows release their key, so only a live one shows.
|
|
210
|
+
<span className="text-muted-foreground">-</span>
|
|
211
|
+
),
|
|
212
|
+
},
|
|
213
|
+
triggeredBy: {
|
|
214
|
+
label: tr("admin.jobs.colTriggeredBy", { default: "Triggered by" }),
|
|
215
|
+
cell: (e) => (
|
|
216
|
+
<span className="text-muted-foreground text-xs">
|
|
217
|
+
{e.triggeredByName ?? e.triggeredBy ?? "-"}
|
|
202
218
|
</span>
|
|
203
|
-
) : (
|
|
204
|
-
<span className="text-muted-foreground">—</span>
|
|
205
219
|
),
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
220
|
+
},
|
|
221
|
+
error: {
|
|
222
|
+
label: tr("admin.jobs.colError", { default: "Error" }),
|
|
223
|
+
cell: (e) =>
|
|
224
|
+
e.error ? (
|
|
225
|
+
<span
|
|
226
|
+
className="text-destructive line-clamp-2 text-xs"
|
|
227
|
+
title={e.error}
|
|
228
|
+
>
|
|
229
|
+
{e.error}
|
|
230
|
+
</span>
|
|
231
|
+
) : (
|
|
232
|
+
<span className="text-muted-foreground">-</span>
|
|
233
|
+
),
|
|
234
|
+
},
|
|
235
|
+
}}
|
|
236
|
+
rowActions={(e) => {
|
|
237
|
+
const actions = [] as Array<{
|
|
238
|
+
label: string;
|
|
239
|
+
icon: typeof RotateCcw;
|
|
240
|
+
onClick: (
|
|
241
|
+
_e: JobExecutionResource,
|
|
242
|
+
ctx: { refresh: () => void },
|
|
243
|
+
) => void;
|
|
244
|
+
destructive?: boolean;
|
|
245
|
+
}>;
|
|
226
246
|
actions.push({
|
|
227
|
-
label: tr("admin.jobs.
|
|
228
|
-
icon:
|
|
229
|
-
|
|
230
|
-
onClick: (_e, { refresh }) => cancel.run(e, refresh),
|
|
247
|
+
label: tr("admin.jobs.viewPayload", { default: "View payload" }),
|
|
248
|
+
icon: Braces,
|
|
249
|
+
onClick: () => setPayloadOf(e),
|
|
231
250
|
});
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
251
|
+
if (e.can.retry) {
|
|
252
|
+
actions.push({
|
|
253
|
+
label: tr("admin.jobs.retry", { default: "Retry" }),
|
|
254
|
+
icon: RotateCcw,
|
|
255
|
+
onClick: (_e, { refresh }) => retry.run(e, refresh),
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
if (e.can.cancel) {
|
|
259
|
+
actions.push({
|
|
260
|
+
label: tr("admin.jobs.cancel", { default: "Cancel" }),
|
|
261
|
+
icon: Ban,
|
|
262
|
+
destructive: true,
|
|
263
|
+
onClick: (_e, { refresh }) => cancel.run(e, refresh),
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
return actions;
|
|
267
|
+
}}
|
|
268
|
+
emptyMessage={String(
|
|
269
|
+
tr("admin.jobs.noExecs", { default: "No executions yet." }),
|
|
270
|
+
)}
|
|
271
|
+
/>
|
|
272
|
+
<AdminJobsPayloadDialog
|
|
273
|
+
execution={payloadOf}
|
|
274
|
+
onClose={() => setPayloadOf(null)}
|
|
275
|
+
/>
|
|
276
|
+
</>
|
|
239
277
|
);
|
|
240
278
|
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
void React;
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Dialog,
|
|
7
|
+
DialogContent,
|
|
8
|
+
DialogDescription,
|
|
9
|
+
DialogHeader,
|
|
10
|
+
DialogTitle,
|
|
11
|
+
} from "@alepha/ui/components/ui/dialog";
|
|
12
|
+
import type { JobExecutionResource } from "alepha/api/jobs";
|
|
13
|
+
import { useI18n } from "alepha/react/i18n";
|
|
14
|
+
|
|
15
|
+
export interface AdminJobsPayloadDialogProps {
|
|
16
|
+
/**
|
|
17
|
+
* The execution whose payload to show, or `null` when the dialog is
|
|
18
|
+
* closed.
|
|
19
|
+
*/
|
|
20
|
+
execution: JobExecutionResource | null;
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The payload of one execution, pretty-printed.
|
|
26
|
+
*
|
|
27
|
+
* A job that reschedules itself through stages carries the stage in its
|
|
28
|
+
* payload, so this is the one place the admin can read which stage a parked
|
|
29
|
+
* row is on.
|
|
30
|
+
*/
|
|
31
|
+
export const AdminJobsPayloadDialog = (props: AdminJobsPayloadDialogProps) => {
|
|
32
|
+
const { tr } = useI18n();
|
|
33
|
+
const execution = props.execution;
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Dialog
|
|
37
|
+
open={execution != null}
|
|
38
|
+
onOpenChange={(open) => {
|
|
39
|
+
if (!open) props.onClose();
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
<DialogContent>
|
|
43
|
+
<DialogHeader>
|
|
44
|
+
<DialogTitle>
|
|
45
|
+
{tr("admin.jobs.payloadTitle", { default: "Payload" })}
|
|
46
|
+
</DialogTitle>
|
|
47
|
+
<DialogDescription className="font-mono text-xs">
|
|
48
|
+
{execution?.id}
|
|
49
|
+
</DialogDescription>
|
|
50
|
+
</DialogHeader>
|
|
51
|
+
<pre className="bg-muted max-h-[60vh] overflow-auto rounded-md p-3 font-mono text-xs leading-relaxed">
|
|
52
|
+
{JSON.stringify(execution?.payload ?? null, null, 2)}
|
|
53
|
+
</pre>
|
|
54
|
+
</DialogContent>
|
|
55
|
+
</Dialog>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -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 { AdminKeysTokenDialog } from "@alepha/ui/components/admin/admin-keys-token-dialog";
|
|
@@ -25,7 +27,7 @@ export const AdminKeys = () => {
|
|
|
25
27
|
const userClient = useClient<ApiKeyController>();
|
|
26
28
|
const toast = useToast();
|
|
27
29
|
const dialog = useDialog();
|
|
28
|
-
const {
|
|
30
|
+
const { tr } = useI18n();
|
|
29
31
|
const [createdToken, setCreatedToken] = useState<string | null>(null);
|
|
30
32
|
const [refreshSignal, setRefreshSignal] = useState(0);
|
|
31
33
|
|
|
@@ -189,9 +191,10 @@ export const AdminKeys = () => {
|
|
|
189
191
|
label: tr("admin.keys.colCreated", { default: "Created" }),
|
|
190
192
|
sortable: true,
|
|
191
193
|
cell: (k) => (
|
|
192
|
-
<
|
|
193
|
-
{
|
|
194
|
-
|
|
194
|
+
<TimeAgo
|
|
195
|
+
value={k.createdAt}
|
|
196
|
+
className="text-muted-foreground text-xs"
|
|
197
|
+
/>
|
|
195
198
|
),
|
|
196
199
|
},
|
|
197
200
|
}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A channel name as a reader should see it: `email` becomes "Email",
|
|
3
|
+
* `discord` becomes "Discord", `sms` becomes "SMS".
|
|
4
|
+
*
|
|
5
|
+
* The acronym list is the whole reason this is not a plain title-caser:
|
|
6
|
+
* humanizing `sms` gives "Sms", which is what a filter dropdown offering
|
|
7
|
+
* "Email" beside "Sms" looks like. Everything else gets the generic
|
|
8
|
+
* treatment, which is right for a word and is the best a list that has never
|
|
9
|
+
* heard of the plugin can do.
|
|
10
|
+
*
|
|
11
|
+
* Display only. The value sent to the API is always the raw channel name.
|
|
12
|
+
*/
|
|
13
|
+
export const notificationChannelLabel = (channel: string): string => {
|
|
14
|
+
const known: Record<string, string> = { sms: "SMS", mqtt: "MQTT" };
|
|
15
|
+
const raw = channel.trim();
|
|
16
|
+
if (!raw) return channel;
|
|
17
|
+
return known[raw.toLowerCase()] ?? raw.charAt(0).toUpperCase() + raw.slice(1);
|
|
18
|
+
};
|
|
@@ -90,13 +90,18 @@ export const AdminNotificationsPreviewBody = (
|
|
|
90
90
|
</div>
|
|
91
91
|
) : null}
|
|
92
92
|
|
|
93
|
+
{/* One flat body, and one question about it: is it HTML? Email is the
|
|
94
|
+
only channel whose body is a document, so it is the only one that
|
|
95
|
+
gets the sandboxed frame. Everything else - sms today, a chat sink
|
|
96
|
+
tomorrow - is text and renders as text, with no per-channel branch
|
|
97
|
+
to add. */}
|
|
93
98
|
{preview.channel === "email" ? (
|
|
94
99
|
<div className="min-h-96 flex-1 overflow-hidden rounded border">
|
|
95
|
-
<EmailBodyFrame html={preview.
|
|
100
|
+
<EmailBodyFrame html={preview.body ?? ""} />
|
|
96
101
|
</div>
|
|
97
102
|
) : (
|
|
98
103
|
<div className="bg-muted rounded p-3 text-sm whitespace-pre-wrap">
|
|
99
|
-
{preview.
|
|
104
|
+
{preview.body}
|
|
100
105
|
</div>
|
|
101
106
|
)}
|
|
102
107
|
</div>
|
|
@@ -29,6 +29,8 @@ import {
|
|
|
29
29
|
} from "lucide-react";
|
|
30
30
|
import { useCallback, useState } from "react";
|
|
31
31
|
|
|
32
|
+
import TimeAgo from "../time-ago/time-ago.tsx";
|
|
33
|
+
import { notificationChannelLabel } from "./admin-notifications-channel-label.ts";
|
|
32
34
|
// Relative, not through the `@alepha/ui/components/*` alias: that subpath
|
|
33
35
|
// pattern maps to `.tsx`, so a plain `.ts` sibling only resolves this way.
|
|
34
36
|
import { useNotificationStatusLabels } from "./admin-notifications-status-labels.ts";
|
|
@@ -52,7 +54,7 @@ export const AdminNotifications = () => {
|
|
|
52
54
|
const userClient = useClient<AdminUserController>();
|
|
53
55
|
const toast = useToast();
|
|
54
56
|
const router = useRouter();
|
|
55
|
-
const {
|
|
57
|
+
const { tr } = useI18n();
|
|
56
58
|
const statusLabels = useNotificationStatusLabels();
|
|
57
59
|
const [selected, setSelected] = useState<{ id: string; tab: string } | null>(
|
|
58
60
|
null,
|
|
@@ -253,7 +255,10 @@ export const AdminNotifications = () => {
|
|
|
253
255
|
schema: z.object({
|
|
254
256
|
search: z.text().optional(),
|
|
255
257
|
status: z.enum(NOTIFICATION_STATUSES as [string]).optional(),
|
|
256
|
-
|
|
258
|
+
// Open, like the column behind it. A closed enum here would
|
|
259
|
+
// reject `?channel=discord` outright, so a plugin's channel
|
|
260
|
+
// would be listed in the table and unfilterable.
|
|
261
|
+
channel: z.text().optional(),
|
|
257
262
|
template: z.text().optional(),
|
|
258
263
|
}),
|
|
259
264
|
render: (form) => (
|
|
@@ -304,10 +309,15 @@ export const AdminNotifications = () => {
|
|
|
304
309
|
default: "All channels",
|
|
305
310
|
})}
|
|
306
311
|
triggerClassName="w-full"
|
|
312
|
+
// Derived from the templates this app registers, which
|
|
313
|
+
// already carry their own channel list. A hand-written
|
|
314
|
+
// pair could only ever offer the two the framework ships.
|
|
307
315
|
items={[
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
316
|
+
...new Set((templates ?? []).flatMap((t) => t.channels)),
|
|
317
|
+
].map((channel) => ({
|
|
318
|
+
label: notificationChannelLabel(channel),
|
|
319
|
+
value: channel,
|
|
320
|
+
}))}
|
|
311
321
|
inputProps={{
|
|
312
322
|
"aria-label": tr("admin.notifications.colChannel", {
|
|
313
323
|
default: "Channel",
|
|
@@ -424,9 +434,10 @@ export const AdminNotifications = () => {
|
|
|
424
434
|
label: tr("admin.notifications.colWhen", { default: "When" }),
|
|
425
435
|
sortable: true,
|
|
426
436
|
cell: (n) => (
|
|
427
|
-
<
|
|
428
|
-
{
|
|
429
|
-
|
|
437
|
+
<TimeAgo
|
|
438
|
+
value={n.createdAt}
|
|
439
|
+
className="text-muted-foreground text-xs"
|
|
440
|
+
/>
|
|
430
441
|
),
|
|
431
442
|
},
|
|
432
443
|
contact: {
|
|
@@ -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";
|
|
@@ -23,7 +25,7 @@ const formatAmount = (cents: number, currency = "USD") => {
|
|
|
23
25
|
|
|
24
26
|
export const AdminPayments = () => {
|
|
25
27
|
const client = useClient<AdminPaymentController>();
|
|
26
|
-
const {
|
|
28
|
+
const { tr } = useI18n();
|
|
27
29
|
|
|
28
30
|
const fetcher = useCallback(
|
|
29
31
|
async (params: { page: number; size: number; sort?: string }) => {
|
|
@@ -43,9 +45,10 @@ export const AdminPayments = () => {
|
|
|
43
45
|
label: tr("admin.payments.colWhen", { default: "When" }),
|
|
44
46
|
sortable: true,
|
|
45
47
|
cell: (p) => (
|
|
46
|
-
<
|
|
47
|
-
{
|
|
48
|
-
|
|
48
|
+
<TimeAgo
|
|
49
|
+
value={p.createdAt}
|
|
50
|
+
className="text-muted-foreground text-xs"
|
|
51
|
+
/>
|
|
49
52
|
),
|
|
50
53
|
},
|
|
51
54
|
amount: {
|
|
@@ -111,6 +111,18 @@ export interface AdminRouterOptions {
|
|
|
111
111
|
* that name. This option exists for applications that mount their own auth
|
|
112
112
|
* routes under a different name instead of `AuthRouter`.
|
|
113
113
|
*
|
|
114
|
+
* ⚠️ **It answers one surface, not the router.** This is the button in the
|
|
115
|
+
* admin account menu; where the ROUTER sends somebody whose session expired
|
|
116
|
+
* on a guarded page is `loginRoutesAtom` (`alepha/react/router`), and the
|
|
117
|
+
* two are set separately on purpose. This option cannot serve both: it says
|
|
118
|
+
* which route, and the router's question is which route FOR WHICH PART OF
|
|
119
|
+
* THE APPLICATION - a prefix the admin shell does not know, since it is
|
|
120
|
+
* mounted at a path the application chose. The framework could not read it
|
|
121
|
+
* either way round, because it does not import this package.
|
|
122
|
+
*
|
|
123
|
+
* An application with two doors sets both, naming the same route here as
|
|
124
|
+
* its `/admin` prefix names there.
|
|
125
|
+
*
|
|
114
126
|
* @default "login"
|
|
115
127
|
*/
|
|
116
128
|
loginRouteName?: string;
|
|
@@ -14,7 +14,6 @@ import type {
|
|
|
14
14
|
AdminSessionController,
|
|
15
15
|
AdminUserController,
|
|
16
16
|
} from "alepha/api/users";
|
|
17
|
-
import type { AdminWorkflowController } from "alepha/api/workflows";
|
|
18
17
|
import { Translate } from "alepha/react/i18n";
|
|
19
18
|
import { $client } from "alepha/server/links";
|
|
20
19
|
import {
|
|
@@ -29,7 +28,6 @@ import {
|
|
|
29
28
|
SlidersHorizontal,
|
|
30
29
|
Timer,
|
|
31
30
|
UsersIcon,
|
|
32
|
-
Workflow,
|
|
33
31
|
} from "lucide-react";
|
|
34
32
|
import { createElement } from "react";
|
|
35
33
|
|
|
@@ -143,20 +141,20 @@ import { adminRouterOptionsAtom } from "./admin-router-options.tsx";
|
|
|
143
141
|
* groups by their smallest member, so only an `order` of 1000 or more sinks a
|
|
144
142
|
* page in among them.
|
|
145
143
|
*
|
|
146
|
-
* ### These
|
|
144
|
+
* ### These twelve route names are claimed globally
|
|
147
145
|
*
|
|
148
146
|
* `dashboard`, `users`, `userDetail`, `sessions`, `keys`, `jobs`,
|
|
149
|
-
* `notifications`, `audits`, `files`, `parameters`, `payments
|
|
150
|
-
*
|
|
147
|
+
* `notifications`, `audits`, `files`, `parameters`, `payments` and
|
|
148
|
+
* `analytics` each carry an explicit `name:` so a future rename of the
|
|
151
149
|
* field itself (done for readability, without touching the string) never
|
|
152
150
|
* silently changes the public route name — the same reason `AuthRouter`'s
|
|
153
151
|
* pages all carry one too.
|
|
154
152
|
*
|
|
155
153
|
* Route names live in one process-wide namespace, and a duplicate does not
|
|
156
154
|
* throw: `ReactPageProvider.page()` returns the first match. An adopter that
|
|
157
|
-
* registers its own page named `files` (or any of the other
|
|
155
|
+
* registers its own page named `files` (or any of the other eleven) either
|
|
158
156
|
* shadows this one or is shadowed by it, silently, depending on mount order.
|
|
159
|
-
* Treat these
|
|
157
|
+
* Treat these twelve names as reserved when hanging pages off `layout`.
|
|
160
158
|
*
|
|
161
159
|
* ### It needs `<DialogProvider>` and `<Toaster />` above it
|
|
162
160
|
*
|
|
@@ -178,7 +176,6 @@ export class AdminRouter {
|
|
|
178
176
|
protected readonly parameterApi = $client<AdminParameterController>();
|
|
179
177
|
protected readonly paymentApi = $client<AdminPaymentController>();
|
|
180
178
|
protected readonly analyticsApi = $client<AdminAnalyticsController>();
|
|
181
|
-
protected readonly workflowApi = $client<AdminWorkflowController>();
|
|
182
179
|
|
|
183
180
|
/**
|
|
184
181
|
* Anchors the shell and the first breadcrumb. Not itself a nav entry — a
|
|
@@ -486,23 +483,4 @@ export class AdminRouter {
|
|
|
486
483
|
},
|
|
487
484
|
lazy: () => import("./admin-analytics.tsx"),
|
|
488
485
|
});
|
|
489
|
-
|
|
490
|
-
workflows = $pageNav({
|
|
491
|
-
parent: this.layout,
|
|
492
|
-
path: "/workflows",
|
|
493
|
-
name: "workflows",
|
|
494
|
-
head: { title: "Workflows" },
|
|
495
|
-
permission: "admin:workflow:read",
|
|
496
|
-
can: () => this.workflowApi.getWorkflowRegistry.can(),
|
|
497
|
-
nav: {
|
|
498
|
-
label: "Workflows",
|
|
499
|
-
labelKey: "admin.nav.workflows",
|
|
500
|
-
icon: createElement(Workflow),
|
|
501
|
-
group: "System",
|
|
502
|
-
groupKey: "admin.nav.group.system",
|
|
503
|
-
order: 1014,
|
|
504
|
-
keywords: ["saga", "steps", "executions"],
|
|
505
|
-
},
|
|
506
|
-
lazy: () => import("./admin-workflows.tsx"),
|
|
507
|
-
});
|
|
508
486
|
}
|
|
@@ -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";
|
|
@@ -297,9 +299,10 @@ export const AdminSessions = () => {
|
|
|
297
299
|
label: tr("admin.sessions.colStarted", { default: "Started" }),
|
|
298
300
|
sortable: true,
|
|
299
301
|
cell: (s) => (
|
|
300
|
-
<
|
|
301
|
-
{
|
|
302
|
-
|
|
302
|
+
<TimeAgo
|
|
303
|
+
value={s.createdAt}
|
|
304
|
+
className="text-muted-foreground text-xs"
|
|
305
|
+
/>
|
|
303
306
|
),
|
|
304
307
|
},
|
|
305
308
|
lastUsedAt: {
|
|
@@ -316,9 +319,10 @@ export const AdminSessions = () => {
|
|
|
316
319
|
expiresAt: {
|
|
317
320
|
label: tr("admin.sessions.colExpires", { default: "Expires" }),
|
|
318
321
|
cell: (s) => (
|
|
319
|
-
<
|
|
320
|
-
{
|
|
321
|
-
|
|
322
|
+
<TimeAgo
|
|
323
|
+
value={s.expiresAt}
|
|
324
|
+
className="text-muted-foreground text-xs"
|
|
325
|
+
/>
|
|
322
326
|
),
|
|
323
327
|
},
|
|
324
328
|
}}
|