@alepha/ui 0.27.0 → 0.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -15
- package/dist/components/account/account-connections.d.ts.map +1 -1
- package/dist/components/account/account-connections.js +24 -13
- 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 -8
- package/dist/components/account/account-delete-dialog.js.map +1 -1
- package/dist/components/account/account-header.d.ts.map +1 -1
- package/dist/components/account/account-header.js +3 -1
- package/dist/components/account/account-header.js.map +1 -1
- package/dist/components/account/account-keys.d.ts.map +1 -1
- package/dist/components/account/account-keys.js +35 -21
- package/dist/components/account/account-keys.js.map +1 -1
- package/dist/components/account/account-mfa-dialog.d.ts +20 -0
- package/dist/components/account/account-mfa-dialog.d.ts.map +1 -0
- package/dist/components/account/account-mfa-dialog.js +149 -0
- package/dist/components/account/account-mfa-dialog.js.map +1 -0
- package/dist/components/account/account-password-dialog.d.ts.map +1 -1
- package/dist/components/account/account-password-dialog.js +15 -10
- package/dist/components/account/account-password-dialog.js.map +1 -1
- package/dist/components/account/account-profile.d.ts.map +1 -1
- package/dist/components/account/account-profile.js +25 -25
- package/dist/components/account/account-profile.js.map +1 -1
- package/dist/components/account/account-router.d.ts +76 -2
- package/dist/components/account/account-router.d.ts.map +1 -1
- package/dist/components/account/account-router.js +44 -4
- package/dist/components/account/account-router.js.map +1 -1
- package/dist/components/account/account-security.d.ts +11 -1
- package/dist/components/account/account-security.d.ts.map +1 -1
- package/dist/components/account/account-security.js +119 -32
- package/dist/components/account/account-security.js.map +1 -1
- package/dist/components/account/account-sessions.d.ts.map +1 -1
- package/dist/components/account/account-sessions.js +46 -24
- package/dist/components/account/account-sessions.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 +4 -9
- package/dist/components/admin/admin-jobs-executions-panel.js.map +1 -1
- package/dist/components/admin/admin-jobs-status-badge.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs-status-badge.js +3 -3
- package/dist/components/admin/admin-jobs-status-badge.js.map +1 -1
- package/dist/components/admin/admin-jobs-status-labels.d.ts +26 -0
- package/dist/components/admin/admin-jobs-status-labels.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs-status-labels.js +46 -0
- package/dist/components/admin/admin-jobs-status-labels.js.map +1 -0
- package/dist/components/admin/admin-layout.d.ts.map +1 -1
- package/dist/components/admin/admin-layout.js +5 -3
- package/dist/components/admin/admin-layout.js.map +1 -1
- package/dist/components/admin/admin-notifications-detail-tabs.d.ts +21 -0
- package/dist/components/admin/admin-notifications-detail-tabs.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-detail-tabs.js +122 -0
- package/dist/components/admin/admin-notifications-detail-tabs.js.map +1 -0
- package/dist/components/admin/admin-notifications-detail.d.ts +23 -0
- package/dist/components/admin/admin-notifications-detail.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-detail.js +48 -0
- package/dist/components/admin/admin-notifications-detail.js.map +1 -0
- package/dist/components/admin/admin-notifications-preview-body.d.ts +13 -0
- package/dist/components/admin/admin-notifications-preview-body.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-preview-body.js +64 -0
- package/dist/components/admin/admin-notifications-preview-body.js.map +1 -0
- package/dist/components/admin/admin-notifications-preview-tab.d.ts +24 -0
- package/dist/components/admin/admin-notifications-preview-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-preview-tab.js +35 -0
- package/dist/components/admin/admin-notifications-preview-tab.js.map +1 -0
- package/dist/components/admin/admin-notifications-raw-tab.d.ts +18 -0
- package/dist/components/admin/admin-notifications-raw-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-raw-tab.js +53 -0
- package/dist/components/admin/admin-notifications-raw-tab.js.map +1 -0
- package/dist/components/admin/admin-notifications-status-badge.d.ts +17 -0
- package/dist/components/admin/admin-notifications-status-badge.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-status-badge.js +32 -0
- package/dist/components/admin/admin-notifications-status-badge.js.map +1 -0
- package/dist/components/admin/admin-notifications-status-labels.d.ts +17 -0
- package/dist/components/admin/admin-notifications-status-labels.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-status-labels.js +33 -0
- package/dist/components/admin/admin-notifications-status-labels.js.map +1 -0
- package/dist/components/admin/admin-notifications-status-tones.d.ts +44 -0
- package/dist/components/admin/admin-notifications-status-tones.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-status-tones.js +64 -0
- package/dist/components/admin/admin-notifications-status-tones.js.map +1 -0
- package/dist/components/admin/admin-notifications-template-label.d.ts +16 -0
- package/dist/components/admin/admin-notifications-template-label.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-template-label.js +24 -0
- package/dist/components/admin/admin-notifications-template-label.js.map +1 -0
- package/dist/components/admin/admin-notifications.d.ts +13 -2
- package/dist/components/admin/admin-notifications.d.ts.map +1 -1
- package/dist/components/admin/admin-notifications.js +264 -29
- package/dist/components/admin/admin-notifications.js.map +1 -1
- package/dist/components/admin/admin-router.d.ts +29 -2
- package/dist/components/admin/admin-router.d.ts.map +1 -1
- package/dist/components/admin/admin-router.js +68 -8
- 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 +1 -1
- package/dist/components/admin/admin-sessions.js.map +1 -1
- package/dist/components/admin/admin-user-detail-security-tab.d.ts +12 -2
- package/dist/components/admin/admin-user-detail-security-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-security-tab.js +63 -44
- package/dist/components/admin/admin-user-detail-security-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 +1 -1
- package/dist/components/admin/admin-user-detail-sessions-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail.js +20 -15
- package/dist/components/admin/admin-user-detail.js.map +1 -1
- package/dist/components/admin/admin-users.js +1 -1
- package/dist/components/admin/admin-users.js.map +1 -1
- package/dist/components/admin/admin-workflows-executions-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-executions-panel.js +4 -12
- package/dist/components/admin/admin-workflows-executions-panel.js.map +1 -1
- package/dist/components/admin/admin-workflows-status-badge.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-status-badge.js +3 -3
- package/dist/components/admin/admin-workflows-status-badge.js.map +1 -1
- package/dist/components/admin/admin-workflows-status-labels.d.ts +19 -0
- package/dist/components/admin/admin-workflows-status-labels.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows-status-labels.js +48 -0
- package/dist/components/admin/admin-workflows-status-labels.js.map +1 -0
- package/dist/components/alepha-table/alepha-table.d.ts +6 -0
- package/dist/components/alepha-table/alepha-table.d.ts.map +1 -1
- package/dist/components/alepha-table/alepha-table.js +33 -5
- package/dist/components/alepha-table/alepha-table.js.map +1 -1
- package/dist/components/auth/auth-login.d.ts.map +1 -1
- package/dist/components/auth/auth-login.js +27 -17
- package/dist/components/auth/auth-login.js.map +1 -1
- package/dist/components/auth/auth-mfa-step.d.ts +25 -0
- package/dist/components/auth/auth-mfa-step.d.ts.map +1 -0
- package/dist/components/auth/auth-mfa-step.js +122 -0
- package/dist/components/auth/auth-mfa-step.js.map +1 -0
- package/dist/components/auth/auth-register.js +2 -2
- package/dist/components/auth/auth-register.js.map +1 -1
- package/dist/components/auth/auth-reset-password.js +2 -2
- package/dist/components/auth/auth-router.d.ts +20 -0
- package/dist/components/auth/auth-router.d.ts.map +1 -1
- package/dist/components/auth/provider-labels.d.ts.map +1 -1
- package/dist/components/auth/provider-labels.js +1 -0
- package/dist/components/auth/provider-labels.js.map +1 -1
- package/dist/components/control/control.d.ts +11 -2
- package/dist/components/control/control.d.ts.map +1 -1
- package/dist/components/control/control.js +7 -2
- package/dist/components/control/control.js.map +1 -1
- package/dist/components/control-array/control-array.d.ts.map +1 -1
- package/dist/components/control-array/control-array.js +55 -10
- package/dist/components/control-array/control-array.js.map +1 -1
- package/dist/components/control-number/control-number.d.ts +5 -0
- package/dist/components/control-number/control-number.d.ts.map +1 -1
- package/dist/components/control-number/control-number.js +1 -0
- package/dist/components/control-number/control-number.js.map +1 -1
- package/dist/components/control-object/control-object.d.ts +12 -1
- package/dist/components/control-object/control-object.d.ts.map +1 -1
- 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-password/control-password.d.ts.map +1 -1
- package/dist/components/control-password/control-password.js +1 -0
- package/dist/components/control-password/control-password.js.map +1 -1
- package/dist/components/detail/detail-layout.d.ts +6 -0
- package/dist/components/detail/detail-layout.d.ts.map +1 -1
- package/dist/components/detail/detail-layout.js +2 -1
- package/dist/components/detail/detail-layout.js.map +1 -1
- package/dist/components/email-body-frame/email-body-frame.d.ts +37 -0
- package/dist/components/email-body-frame/email-body-frame.d.ts.map +1 -0
- package/dist/components/email-body-frame/email-body-frame.js +44 -0
- package/dist/components/email-body-frame/email-body-frame.js.map +1 -0
- package/dist/components/markdown-view/diagram/DiagramLabel.d.ts +33 -0
- package/dist/components/markdown-view/diagram/DiagramLabel.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/{FlowchartDiagramLabel.js → DiagramLabel.js} +15 -6
- package/dist/components/markdown-view/diagram/DiagramLabel.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.d.ts +0 -5
- package/dist/components/markdown-view/diagram/FlowchartDiagram.d.ts.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagram.js +2 -6
- package/dist/components/markdown-view/diagram/FlowchartDiagram.js.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.js +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.js.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.d.ts.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.js +2 -3
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.js.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.d.ts.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.js +2 -3
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.js.map +1 -1
- package/dist/components/markdown-view/diagram/MermaidFence.d.ts +20 -11
- package/dist/components/markdown-view/diagram/MermaidFence.d.ts.map +1 -1
- package/dist/components/markdown-view/diagram/MermaidFence.js +48 -13
- package/dist/components/markdown-view/diagram/MermaidFence.js.map +1 -1
- package/dist/components/markdown-view/diagram/SequenceDiagram.d.ts +50 -0
- package/dist/components/markdown-view/diagram/SequenceDiagram.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagram.js +141 -0
- package/dist/components/markdown-view/diagram/SequenceDiagram.js.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramFragment.d.ts +23 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramFragment.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramFragment.js +101 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramFragment.js.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramMessage.d.ts +23 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramMessage.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramMessage.js +77 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramMessage.js.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramNote.d.ts +16 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramNote.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramNote.js +39 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramNote.js.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipant.d.ts +20 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipant.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipant.js +61 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipant.js.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipantActor.d.ts +27 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipantActor.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipantActor.js +65 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipantActor.js.map +1 -0
- package/dist/components/markdown-view/diagram/layoutSequence.d.ts +155 -0
- package/dist/components/markdown-view/diagram/layoutSequence.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/layoutSequence.js +478 -0
- package/dist/components/markdown-view/diagram/layoutSequence.js.map +1 -0
- package/dist/components/markdown-view/diagram/sequenceModel.d.ts +132 -0
- package/dist/components/markdown-view/diagram/sequenceModel.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/sequenceModel.js +0 -0
- package/dist/components/markdown-view/diagram/sequenceParser.d.ts +32 -0
- package/dist/components/markdown-view/diagram/sequenceParser.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/sequenceParser.js +312 -0
- package/dist/components/markdown-view/diagram/sequenceParser.js.map +1 -0
- package/dist/components/markdown-view/markdown-view.css +65 -0
- package/dist/components/markdown-view/markdown-view.d.ts +18 -11
- package/dist/components/markdown-view/markdown-view.d.ts.map +1 -1
- package/dist/components/markdown-view/markdown-view.js +30 -16
- package/dist/components/markdown-view/markdown-view.js.map +1 -1
- package/dist/components/nav-shell/nav-page.d.ts +7 -0
- package/dist/components/nav-shell/nav-page.d.ts.map +1 -1
- package/dist/components/nav-shell/nav-page.js.map +1 -1
- package/dist/components/nav-shell/nav-tree-util.d.ts +64 -2
- package/dist/components/nav-shell/nav-tree-util.d.ts.map +1 -1
- package/dist/components/nav-shell/nav-tree-util.js +29 -6
- package/dist/components/nav-shell/nav-tree-util.js.map +1 -1
- package/dist/components/nav-shell/spotlight.d.ts +3 -2
- package/dist/components/nav-shell/spotlight.d.ts.map +1 -1
- package/dist/components/nav-shell/spotlight.js +9 -6
- package/dist/components/nav-shell/spotlight.js.map +1 -1
- package/dist/components/nav-shell/use-nav-breadcrumbs.d.ts.map +1 -1
- package/dist/components/nav-shell/use-nav-breadcrumbs.js +9 -2
- package/dist/components/nav-shell/use-nav-breadcrumbs.js.map +1 -1
- package/dist/components/nav-shell/use-nav-entries.d.ts +6 -0
- package/dist/components/nav-shell/use-nav-entries.d.ts.map +1 -1
- package/dist/components/nav-shell/use-nav-entries.js +8 -3
- package/dist/components/nav-shell/use-nav-entries.js.map +1 -1
- package/dist/components/nav-shell/use-nav-tree.d.ts.map +1 -1
- package/dist/components/nav-shell/use-nav-tree.js +1 -1
- package/dist/components/nav-shell/use-nav-tree.js.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +1 -1
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +1 -0
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.d.ts +2 -2
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +1 -0
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/avatar.d.ts +2 -2
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar.js +1 -0
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +2 -2
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.js +1 -0
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/card.d.ts +2 -2
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +1 -0
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/combobox.d.ts +1 -1
- package/dist/components/ui/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox.js.map +1 -1
- package/dist/components/ui/command.d.ts +2 -2
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +1 -0
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts +2 -2
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +1 -0
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +1 -1
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +1 -0
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/drawer.d.ts +1 -1
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +2 -2
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/empty.d.ts +1 -1
- package/dist/components/ui/empty.d.ts.map +1 -1
- package/dist/components/ui/empty.js.map +1 -1
- package/dist/components/ui/hover-card.d.ts +1 -1
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/input-group.d.ts +2 -2
- package/dist/components/ui/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group.js +1 -0
- package/dist/components/ui/input-group.js.map +1 -1
- package/dist/components/ui/input-otp.d.ts +1 -1
- package/dist/components/ui/input-otp.d.ts.map +1 -1
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.d.ts +1 -1
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +1 -0
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/label.d.ts +1 -1
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +1 -0
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/menubar.d.ts +2 -2
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar.js +1 -0
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/pagination.d.ts +1 -1
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js +1 -0
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +1 -0
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.d.ts +1 -1
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/segmented.d.ts +11 -0
- package/dist/components/ui/segmented.d.ts.map +1 -1
- package/dist/components/ui/segmented.js +6 -2
- package/dist/components/ui/segmented.js.map +1 -1
- package/dist/components/ui/select.d.ts +1 -1
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +1 -0
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/sheet.d.ts +2 -2
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +1 -0
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.d.ts +2 -2
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +1 -0
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.d.ts +1 -1
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.d.ts +1 -1
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +1 -0
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts +1 -11
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +0 -10
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/hooks/use-mobile.d.ts +1 -1
- package/dist/hooks/use-mobile.js +1 -1
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/lib/i18n-fr.d.ts.map +1 -1
- package/dist/lib/i18n-fr.js +252 -2
- package/dist/lib/i18n-fr.js.map +1 -1
- package/package.json +5 -5
- package/src/components/account/__tests__/account-router.spec.ts +25 -0
- package/src/components/account/__tests__/account-security-mfa-gate.browser.spec.tsx +76 -0
- package/src/components/account/account-connections.tsx +50 -18
- package/src/components/account/account-delete-dialog.tsx +24 -9
- package/src/components/account/account-header.tsx +4 -1
- package/src/components/account/account-keys.tsx +73 -29
- package/src/components/account/account-mfa-dialog.tsx +233 -0
- package/src/components/account/account-password-dialog.tsx +42 -12
- package/src/components/account/account-profile.tsx +66 -25
- package/src/components/account/account-router.tsx +47 -6
- package/src/components/account/account-security.tsx +209 -22
- package/src/components/account/account-sessions.tsx +87 -22
- package/src/components/action-error-toaster/__tests__/action-error-toaster.browser.spec.tsx +114 -0
- package/src/components/admin/__tests__/admin-nav-i18n.browser.spec.tsx +152 -0
- package/src/components/admin/__tests__/admin-notifications-preview-body.browser.spec.tsx +128 -0
- package/src/components/admin/__tests__/admin-notifications-raw-tab.browser.spec.tsx +76 -0
- package/src/components/admin/__tests__/admin-notifications-status-badge.browser.spec.tsx +121 -0
- package/src/components/admin/__tests__/admin-router.spec.ts +27 -0
- package/src/components/admin/__tests__/admin-status-labels.browser.spec.tsx +152 -0
- package/src/components/admin/__tests__/admin-user-detail-security-tab.browser.spec.tsx +92 -0
- package/src/components/admin/admin-jobs-executions-panel.tsx +8 -11
- package/src/components/admin/admin-jobs-status-badge.tsx +4 -5
- package/src/components/admin/admin-jobs-status-labels.ts +46 -0
- package/src/components/admin/admin-layout.tsx +9 -3
- package/src/components/admin/admin-notifications-detail-tabs.tsx +167 -0
- package/src/components/admin/admin-notifications-detail.tsx +100 -0
- package/src/components/admin/admin-notifications-preview-body.tsx +104 -0
- package/src/components/admin/admin-notifications-preview-tab.tsx +55 -0
- package/src/components/admin/admin-notifications-raw-tab.tsx +76 -0
- package/src/components/admin/admin-notifications-status-badge.tsx +44 -0
- package/src/components/admin/admin-notifications-status-labels.ts +42 -0
- package/src/components/admin/admin-notifications-status-tones.ts +85 -0
- package/src/components/admin/admin-notifications-template-label.ts +22 -0
- package/src/components/admin/admin-notifications.tsx +398 -31
- package/src/components/admin/admin-router.tsx +65 -8
- package/src/components/admin/admin-sessions.tsx +10 -3
- package/src/components/admin/admin-user-detail-security-tab.tsx +70 -5
- package/src/components/admin/admin-user-detail-sessions-tab.tsx +10 -3
- package/src/components/admin/admin-user-detail.tsx +92 -23
- package/src/components/admin/admin-users.tsx +1 -1
- package/src/components/admin/admin-workflows-executions-panel.tsx +8 -16
- package/src/components/admin/admin-workflows-status-badge.tsx +4 -5
- package/src/components/admin/admin-workflows-status-labels.ts +51 -0
- package/src/components/alepha-table/__tests__/alepha-table-row-key.browser.spec.tsx +106 -0
- package/src/components/alepha-table/alepha-table.tsx +50 -10
- package/src/components/auth/auth-login.tsx +37 -18
- package/src/components/auth/auth-mfa-step.tsx +177 -0
- package/src/components/auth/auth-register.tsx +1 -1
- package/src/components/auth/provider-labels.ts +4 -0
- package/src/components/control/__tests__/control-autofocus.browser.spec.tsx +107 -0
- package/src/components/control/control.tsx +20 -5
- package/src/components/control-array/__tests__/control-array-child-change.browser.spec.tsx +90 -0
- package/src/components/control-array/control-array.tsx +85 -13
- package/src/components/control-number/control-number.tsx +7 -0
- package/src/components/control-object/__tests__/control-object-clear.browser.spec.tsx +100 -0
- package/src/components/control-object/control-object.tsx +21 -2
- package/src/components/control-password/control-password.tsx +2 -1
- package/src/components/detail/__tests__/detail-layout.browser.spec.tsx +36 -0
- package/src/components/detail/detail-layout.tsx +20 -1
- package/src/components/email-body-frame/__tests__/email-body-frame.browser.spec.tsx +52 -0
- package/src/components/email-body-frame/email-body-frame.tsx +81 -0
- package/src/components/markdown-view/__tests__/markdown-view-mermaid.browser.spec.tsx +65 -2
- package/src/components/markdown-view/diagram/{FlowchartDiagramLabel.tsx → DiagramLabel.tsx} +14 -4
- package/src/components/markdown-view/diagram/FlowchartDiagram.tsx +1 -6
- package/src/components/markdown-view/diagram/FlowchartDiagramCluster.tsx +1 -1
- package/src/components/markdown-view/diagram/FlowchartDiagramEdge.tsx +2 -3
- package/src/components/markdown-view/diagram/FlowchartDiagramNode.tsx +2 -3
- package/src/components/markdown-view/diagram/MermaidFence.tsx +65 -15
- package/src/components/markdown-view/diagram/SequenceDiagram.tsx +203 -0
- package/src/components/markdown-view/diagram/SequenceDiagramFragment.tsx +120 -0
- package/src/components/markdown-view/diagram/SequenceDiagramMessage.tsx +100 -0
- package/src/components/markdown-view/diagram/SequenceDiagramNote.tsx +46 -0
- package/src/components/markdown-view/diagram/SequenceDiagramParticipant.tsx +80 -0
- package/src/components/markdown-view/diagram/SequenceDiagramParticipantActor.tsx +74 -0
- package/src/components/markdown-view/diagram/__tests__/sequence-diagram.browser.spec.tsx +267 -0
- package/src/components/markdown-view/diagram/layoutSequence.spec.ts +535 -0
- package/src/components/markdown-view/diagram/layoutSequence.ts +764 -0
- package/src/components/markdown-view/diagram/sequenceModel.ts +141 -0
- package/src/components/markdown-view/diagram/sequenceParser.spec.ts +495 -0
- package/src/components/markdown-view/diagram/sequenceParser.ts +443 -0
- package/src/components/markdown-view/markdown-view.css +65 -0
- package/src/components/markdown-view/markdown-view.tsx +34 -16
- package/src/components/nav-shell/__tests__/nav-tree-util.spec.ts +107 -1
- package/src/components/nav-shell/nav-page.tsx +8 -0
- package/src/components/nav-shell/nav-tree-util.ts +95 -2
- package/src/components/nav-shell/spotlight.tsx +22 -8
- package/src/components/nav-shell/use-nav-breadcrumbs.ts +9 -2
- package/src/components/nav-shell/use-nav-entries.ts +18 -2
- package/src/components/nav-shell/use-nav-tree.ts +4 -1
- package/src/components/ui/alert-dialog.tsx +1 -1
- package/src/components/ui/alert.tsx +2 -2
- package/src/components/ui/avatar.tsx +3 -3
- package/src/components/ui/breadcrumb.tsx +3 -3
- package/src/components/ui/card.tsx +5 -5
- package/src/components/ui/checkbox.tsx +1 -1
- package/src/components/ui/combobox.tsx +8 -8
- package/src/components/ui/command.tsx +4 -4
- package/src/components/ui/context-menu.tsx +7 -7
- package/src/components/ui/dialog.tsx +1 -1
- package/src/components/ui/drawer.tsx +6 -6
- package/src/components/ui/dropdown-menu.tsx +8 -14
- package/src/components/ui/empty.tsx +3 -3
- package/src/components/ui/hover-card.tsx +1 -1
- package/src/components/ui/input-group.tsx +2 -2
- package/src/components/ui/input-otp.tsx +1 -1
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/label.tsx +1 -1
- package/src/components/ui/menubar.tsx +9 -9
- package/src/components/ui/pagination.tsx +1 -1
- package/src/components/ui/popover.tsx +1 -1
- package/src/components/ui/progress.tsx +1 -1
- package/src/components/ui/segmented.tsx +28 -0
- package/src/components/ui/select.tsx +1 -1
- package/src/components/ui/sheet.tsx +4 -4
- package/src/components/ui/switch.tsx +1 -1
- package/src/components/ui/table.tsx +6 -9
- package/src/components/ui/tabs.tsx +1 -1
- package/src/components/ui/textarea.tsx +1 -1
- package/src/components/ui/tooltip.tsx +3 -11
- package/src/components/use-dialog/__tests__/use-dialog-providers.browser.spec.tsx +61 -0
- package/src/hooks/use-mobile.ts +1 -1
- package/src/lib/__tests__/i18n-fr.spec.ts +27 -5
- package/src/lib/i18n-fr.ts +308 -1
- package/dist/components/language-toggle/language-toggle.d.ts +0 -8
- package/dist/components/language-toggle/language-toggle.d.ts.map +0 -1
- package/dist/components/language-toggle/language-toggle.js +0 -49
- package/dist/components/language-toggle/language-toggle.js.map +0 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.d.ts +0 -23
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.d.ts.map +0 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.js.map +0 -1
- package/dist/components/ui/accordion.d.ts +0 -7
- package/dist/components/ui/accordion.d.ts.map +0 -1
- package/dist/components/ui/accordion.js +0 -55
- package/dist/components/ui/accordion.js.map +0 -1
- package/dist/components/ui/aspect-ratio.d.ts +0 -5
- package/dist/components/ui/aspect-ratio.d.ts.map +0 -1
- package/dist/components/ui/aspect-ratio.js +0 -15
- package/dist/components/ui/aspect-ratio.js.map +0 -1
- package/dist/components/ui/carousel.d.ts +0 -29
- package/dist/components/ui/carousel.d.ts.map +0 -1
- package/dist/components/ui/carousel.js +0 -144
- package/dist/components/ui/carousel.js.map +0 -1
- package/dist/components/ui/collapsible.d.ts +0 -6
- package/dist/components/ui/collapsible.d.ts.map +0 -1
- package/dist/components/ui/collapsible.js +0 -26
- package/dist/components/ui/collapsible.js.map +0 -1
- package/dist/components/ui/direction.d.ts +0 -2
- package/dist/components/ui/direction.d.ts.map +0 -1
- package/dist/components/ui/direction.js +0 -3
- package/dist/components/ui/item.d.ts +0 -23
- package/dist/components/ui/item.d.ts.map +0 -1
- package/dist/components/ui/item.js +0 -122
- package/dist/components/ui/item.js.map +0 -1
- package/dist/components/ui/navigation-menu.d.ts +0 -12
- package/dist/components/ui/navigation-menu.d.ts.map +0 -1
- package/dist/components/ui/navigation-menu.js +0 -84
- package/dist/components/ui/navigation-menu.js.map +0 -1
- package/dist/components/ui/radio-group.d.ts +0 -6
- package/dist/components/ui/radio-group.d.ts.map +0 -1
- package/dist/components/ui/radio-group.js +0 -29
- package/dist/components/ui/radio-group.js.map +0 -1
- package/dist/components/ui/scroll-area.d.ts +0 -5
- package/dist/components/ui/scroll-area.d.ts.map +0 -1
- package/dist/components/ui/scroll-area.js +0 -38
- package/dist/components/ui/scroll-area.js.map +0 -1
- package/dist/components/ui/toggle-group.d.ts +0 -12
- package/dist/components/ui/toggle-group.d.ts.map +0 -1
- package/dist/components/ui/toggle-group.js +0 -60
- package/dist/components/ui/toggle-group.js.map +0 -1
- package/dist/components/ui/toggle.d.ts +0 -9
- package/dist/components/ui/toggle.d.ts.map +0 -1
- package/dist/components/ui/toggle.js +0 -38
- package/dist/components/ui/toggle.js.map +0 -1
- package/src/components/language-toggle/language-toggle.tsx +0 -66
- package/src/components/ui/accordion.tsx +0 -77
- package/src/components/ui/aspect-ratio.tsx +0 -22
- package/src/components/ui/carousel.tsx +0 -258
- package/src/components/ui/collapsible.tsx +0 -21
- package/src/components/ui/direction.tsx +0 -6
- package/src/components/ui/item.tsx +0 -200
- package/src/components/ui/navigation-menu.tsx +0 -170
- package/src/components/ui/radio-group.tsx +0 -37
- package/src/components/ui/scroll-area.tsx +0 -53
- package/src/components/ui/toggle-group.tsx +0 -93
- package/src/components/ui/toggle.tsx +0 -44
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import { Alepha } from "alepha";
|
|
3
|
+
import type { IdentityResource } from "alepha/api/users";
|
|
4
|
+
import { AlephaContext } from "alepha/react";
|
|
5
|
+
import type { UseActionReturn } from "alepha/react";
|
|
6
|
+
import { AlephaReactI18n } from "alepha/react/i18n";
|
|
7
|
+
import { setupJsdomMocks } from "alepha/react/testing";
|
|
8
|
+
import { afterEach, beforeAll, describe, expect, it } from "vitest";
|
|
9
|
+
|
|
10
|
+
import { AdminUserDetailSecurityTab } from "../admin-user-detail-security-tab.tsx";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The support case this tab has to serve is a user who lost the phone holding
|
|
14
|
+
* their authenticator app and has no recovery code left.
|
|
15
|
+
*
|
|
16
|
+
* A TOTP enrollment is stored as an ordinary `identities` row, so left alone
|
|
17
|
+
* it surfaces under "Connected accounts" beside the OAuth providers, offering
|
|
18
|
+
* to remove a "connection" the user cannot sign in with in the first place.
|
|
19
|
+
* It gets its own card, and it stays out of the connected-accounts list.
|
|
20
|
+
*/
|
|
21
|
+
describe("AdminUserDetailSecurityTab - two-factor", () => {
|
|
22
|
+
let alepha: Alepha | undefined;
|
|
23
|
+
|
|
24
|
+
beforeAll(() => {
|
|
25
|
+
setupJsdomMocks();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
afterEach(async () => {
|
|
29
|
+
await alepha?.stop();
|
|
30
|
+
alepha = undefined;
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const action = (): UseActionReturn<[IdentityResource], void> =>
|
|
34
|
+
({ run: async () => undefined, loading: false }) as never;
|
|
35
|
+
|
|
36
|
+
const identity = (provider: string): IdentityResource =>
|
|
37
|
+
({ id: `id-${provider}`, provider }) as never;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Mounted with whatever the parent already computes: every identity except
|
|
41
|
+
* `credentials`, the `totp` row included. Splitting it out is this
|
|
42
|
+
* component's job, so the rule cannot be lost by a caller.
|
|
43
|
+
*/
|
|
44
|
+
const mount = async (enrolled: boolean) => {
|
|
45
|
+
alepha = Alepha.create().with(AlephaReactI18n);
|
|
46
|
+
await alepha.start();
|
|
47
|
+
return render(
|
|
48
|
+
<AlephaContext.Provider value={alepha}>
|
|
49
|
+
<AdminUserDetailSecurityTab
|
|
50
|
+
hasPassword
|
|
51
|
+
socialIdentities={
|
|
52
|
+
enrolled
|
|
53
|
+
? [identity("google"), identity("totp")]
|
|
54
|
+
: [identity("google")]
|
|
55
|
+
}
|
|
56
|
+
removeIdentity={action()}
|
|
57
|
+
clearTotp={action()}
|
|
58
|
+
onChangePassword={() => {}}
|
|
59
|
+
/>
|
|
60
|
+
</AlephaContext.Provider>,
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
it("should offer to clear the second factor when one is enrolled", async () => {
|
|
65
|
+
await mount(true);
|
|
66
|
+
|
|
67
|
+
expect(screen.queryByText("Two-factor authentication")).toBeTruthy();
|
|
68
|
+
expect(
|
|
69
|
+
screen.queryByRole("button", { name: /Clear second factor/ }),
|
|
70
|
+
).toBeTruthy();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("should say so when no second factor is enrolled", async () => {
|
|
74
|
+
await mount(false);
|
|
75
|
+
|
|
76
|
+
expect(screen.queryByText("Two-factor authentication")).toBeTruthy();
|
|
77
|
+
expect(
|
|
78
|
+
screen.queryByRole("button", { name: /Clear second factor/ }),
|
|
79
|
+
).toBeNull();
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
/*
|
|
83
|
+
* The authenticator app is not a way in, so listing it next to Google
|
|
84
|
+
* invites an administrator to "remove a connection" that was never one.
|
|
85
|
+
*/
|
|
86
|
+
it("should not list the authenticator app as a connected account", async () => {
|
|
87
|
+
await mount(true);
|
|
88
|
+
|
|
89
|
+
expect(screen.queryByText("Google")).toBeTruthy();
|
|
90
|
+
expect(screen.queryByText("Authenticator app")).toBeNull();
|
|
91
|
+
});
|
|
92
|
+
});
|
|
@@ -9,6 +9,11 @@ import { useI18n } from "alepha/react/i18n";
|
|
|
9
9
|
import { Ban, CircleDot, RotateCcw } from "lucide-react";
|
|
10
10
|
import { useCallback } from "react";
|
|
11
11
|
|
|
12
|
+
import {
|
|
13
|
+
JOB_EXECUTION_STATUSES,
|
|
14
|
+
useJobStatusLabels,
|
|
15
|
+
} from "./admin-jobs-status-labels.ts";
|
|
16
|
+
|
|
12
17
|
const EXEC_POLL_MS = 10_000;
|
|
13
18
|
|
|
14
19
|
const execFiltersSchema = z.object({
|
|
@@ -54,6 +59,7 @@ export const AdminJobsExecutionsPanel = (
|
|
|
54
59
|
const { jobName } = props;
|
|
55
60
|
const client = useClient<AdminJobController>();
|
|
56
61
|
const { l, tr } = useI18n();
|
|
62
|
+
const statusLabels = useJobStatusLabels();
|
|
57
63
|
|
|
58
64
|
const fetcher = useCallback(
|
|
59
65
|
async (params: { filters?: ExecFilters }) => {
|
|
@@ -128,18 +134,9 @@ export const AdminJobsExecutionsPanel = (
|
|
|
128
134
|
tr("admin.jobs.statusAll", { default: "All statuses" }),
|
|
129
135
|
)}
|
|
130
136
|
triggerClassName="w-40"
|
|
131
|
-
items={
|
|
132
|
-
"pending",
|
|
133
|
-
"running",
|
|
134
|
-
"scheduled",
|
|
135
|
-
"ok",
|
|
136
|
-
"error",
|
|
137
|
-
"cancelled",
|
|
138
|
-
].map((status) => ({
|
|
137
|
+
items={JOB_EXECUTION_STATUSES.map((status) => ({
|
|
139
138
|
value: status,
|
|
140
|
-
label:
|
|
141
|
-
tr(`admin.jobs.status.${status}` as any, { default: status }),
|
|
142
|
-
),
|
|
139
|
+
label: statusLabels[status],
|
|
143
140
|
}))}
|
|
144
141
|
/>
|
|
145
142
|
),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Badge } from "@alepha/ui/components/ui/badge";
|
|
2
2
|
import type { JobExecutionResource } from "alepha/api/jobs";
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import { useJobStatusLabels } from "./admin-jobs-status-labels.ts";
|
|
4
5
|
|
|
5
6
|
export interface AdminJobsStatusBadgeProps {
|
|
6
7
|
status: JobExecutionResource["status"];
|
|
@@ -22,12 +23,10 @@ const VARIANTS: Record<
|
|
|
22
23
|
* Coloured badge for a job execution's status.
|
|
23
24
|
*/
|
|
24
25
|
export const AdminJobsStatusBadge = (props: AdminJobsStatusBadgeProps) => {
|
|
25
|
-
const
|
|
26
|
+
const labels = useJobStatusLabels();
|
|
26
27
|
return (
|
|
27
28
|
<Badge variant={VARIANTS[props.status]}>
|
|
28
|
-
{
|
|
29
|
-
default: props.status,
|
|
30
|
-
})}
|
|
29
|
+
{labels[props.status] ?? props.status}
|
|
31
30
|
</Badge>
|
|
32
31
|
);
|
|
33
32
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { JobExecutionResource } from "alepha/api/jobs";
|
|
2
|
+
import { useI18n } from "alepha/react/i18n";
|
|
3
|
+
|
|
4
|
+
export type JobExecutionStatus = JobExecutionResource["status"];
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The job-execution vocabulary, in the order the filter offers it.
|
|
8
|
+
*
|
|
9
|
+
* `jobExecutionEntity`'s enum, restated: the panel and the badge both need
|
|
10
|
+
* the set, and a second hand-kept copy in each of them is how one of them
|
|
11
|
+
* ends up missing a status.
|
|
12
|
+
*/
|
|
13
|
+
export const JOB_EXECUTION_STATUSES: JobExecutionStatus[] = [
|
|
14
|
+
"pending",
|
|
15
|
+
"running",
|
|
16
|
+
"scheduled",
|
|
17
|
+
"ok",
|
|
18
|
+
"error",
|
|
19
|
+
"cancelled",
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Localised job-execution status labels, keyed by status.
|
|
24
|
+
*
|
|
25
|
+
* One literal `tr()` per status, rather than the
|
|
26
|
+
* `tr(\`admin.jobs.status.${status}\`)` this replaces. A computed key is
|
|
27
|
+
* invisible to `i18n-fr.spec.ts`, which finds keys by matching a literal
|
|
28
|
+
* after `tr(` - so the French entries could not be added at all: the spec
|
|
29
|
+
* would have reported every one of them as a translation nothing asks for.
|
|
30
|
+
* The statuses rendered raw in French as a result (`ok`, `error`,
|
|
31
|
+
* `cancelled`), which reads as a bug rather than as a missing translation.
|
|
32
|
+
*
|
|
33
|
+
* A record rather than a function, because both callers want the whole set:
|
|
34
|
+
* the filter lists it, and the badge indexes it.
|
|
35
|
+
*/
|
|
36
|
+
export const useJobStatusLabels = (): Record<JobExecutionStatus, string> => {
|
|
37
|
+
const { tr } = useI18n();
|
|
38
|
+
return {
|
|
39
|
+
pending: tr("admin.jobs.status.pending", { default: "Pending" }),
|
|
40
|
+
running: tr("admin.jobs.status.running", { default: "Running" }),
|
|
41
|
+
scheduled: tr("admin.jobs.status.scheduled", { default: "Scheduled" }),
|
|
42
|
+
ok: tr("admin.jobs.status.ok", { default: "Succeeded" }),
|
|
43
|
+
error: tr("admin.jobs.status.error", { default: "Failed" }),
|
|
44
|
+
cancelled: tr("admin.jobs.status.cancelled", { default: "Cancelled" }),
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -3,6 +3,7 @@ import { NavShell } from "@alepha/ui/components/nav-shell/nav-shell";
|
|
|
3
3
|
import { Spotlight } from "@alepha/ui/components/nav-shell/spotlight";
|
|
4
4
|
import { cn } from "@alepha/ui/lib/utils";
|
|
5
5
|
import { useStore } from "alepha/react";
|
|
6
|
+
import { useI18n } from "alepha/react/i18n";
|
|
6
7
|
import { ColorScheme } from "alepha/react/ui";
|
|
7
8
|
import { LayoutDashboard, Search } from "lucide-react";
|
|
8
9
|
import { useState } from "react";
|
|
@@ -42,6 +43,7 @@ import { adminRouterOptionsAtom } from "./admin-router-options.tsx";
|
|
|
42
43
|
export const AdminLayout = () => {
|
|
43
44
|
const [options] = useStore(adminRouterOptionsAtom);
|
|
44
45
|
const [spotlightOpen, setSpotlightOpen] = useState(false);
|
|
46
|
+
const { tr } = useI18n();
|
|
45
47
|
|
|
46
48
|
return (
|
|
47
49
|
<div className={cn("flex h-svh flex-col", options.className)}>
|
|
@@ -55,7 +57,7 @@ export const AdminLayout = () => {
|
|
|
55
57
|
<div className="flex items-center gap-2 px-2 py-1.5 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:gap-0 group-data-[collapsible=icon]:px-0">
|
|
56
58
|
<LayoutDashboard className="size-4 shrink-0" />
|
|
57
59
|
<span className="text-sm font-semibold tracking-tight group-data-[collapsible=icon]:hidden">
|
|
58
|
-
Admin
|
|
60
|
+
{tr("admin.nav.admin", { default: "Admin" })}
|
|
59
61
|
</span>
|
|
60
62
|
</div>
|
|
61
63
|
)
|
|
@@ -68,7 +70,7 @@ export const AdminLayout = () => {
|
|
|
68
70
|
className="text-muted-foreground hover:bg-accent hover:text-foreground hidden h-8 items-center gap-2 rounded-md border px-2 text-sm transition-colors sm:flex"
|
|
69
71
|
>
|
|
70
72
|
<Search className="size-4 shrink-0" />
|
|
71
|
-
<span>Search
|
|
73
|
+
<span>{tr("nav.spotlight.search", { default: "Search…" })}</span>
|
|
72
74
|
<kbd className="bg-muted text-muted-foreground pointer-events-none ml-2 hidden rounded px-1.5 font-mono text-[10px] md:inline">
|
|
73
75
|
⌘K
|
|
74
76
|
</kbd>
|
|
@@ -88,7 +90,11 @@ export const AdminLayout = () => {
|
|
|
88
90
|
an operator should see.
|
|
89
91
|
*/
|
|
90
92
|
adminRouteName={options.homeRouteName ?? "home"}
|
|
91
|
-
labels={{
|
|
93
|
+
labels={{
|
|
94
|
+
admin: tr("admin.nav.backToSite", {
|
|
95
|
+
default: "Back to site",
|
|
96
|
+
}),
|
|
97
|
+
}}
|
|
92
98
|
/>
|
|
93
99
|
)}
|
|
94
100
|
</div>
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { AdminNotificationsPreviewTab } from "@alepha/ui/components/admin/admin-notifications-preview-tab";
|
|
2
|
+
import { AdminNotificationsRawTab } from "@alepha/ui/components/admin/admin-notifications-raw-tab";
|
|
3
|
+
import { AdminNotificationsStatusBadge } from "@alepha/ui/components/admin/admin-notifications-status-badge";
|
|
4
|
+
import {
|
|
5
|
+
Tabs,
|
|
6
|
+
TabsContent,
|
|
7
|
+
TabsList,
|
|
8
|
+
TabsTrigger,
|
|
9
|
+
} from "@alepha/ui/components/ui/tabs";
|
|
10
|
+
import type { NotificationDetailResource } from "alepha/api/notifications";
|
|
11
|
+
import { useI18n } from "alepha/react/i18n";
|
|
12
|
+
import { useState } from "react";
|
|
13
|
+
|
|
14
|
+
export interface AdminNotificationsDetailTabsProps {
|
|
15
|
+
notificationId: string;
|
|
16
|
+
detail: NotificationDetailResource;
|
|
17
|
+
/**
|
|
18
|
+
* The tab to open on. Read once, at mount.
|
|
19
|
+
*
|
|
20
|
+
* ⚠️ The parent gives this component a `key` derived from the row and the
|
|
21
|
+
* requested tab, so arriving from a different row (or from the list's "Raw
|
|
22
|
+
* data" action) remounts it and re-reads this. That is deliberately not an
|
|
23
|
+
* effect: resetting state from `useEffect` is a cascading render, and the
|
|
24
|
+
* lint rule that says so is right.
|
|
25
|
+
*/
|
|
26
|
+
initialTab: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The three views of one notification: what happened, what it looked like,
|
|
31
|
+
* and everything else that was recorded.
|
|
32
|
+
*/
|
|
33
|
+
export const AdminNotificationsDetailTabs = (
|
|
34
|
+
props: AdminNotificationsDetailTabsProps,
|
|
35
|
+
) => {
|
|
36
|
+
const { l, tr } = useI18n();
|
|
37
|
+
const [tab, setTab] = useState(props.initialTab);
|
|
38
|
+
const detail = props.detail;
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Tabs
|
|
42
|
+
value={tab}
|
|
43
|
+
onValueChange={(value) => setTab(String(value))}
|
|
44
|
+
className="flex min-h-0 flex-1 flex-col overflow-hidden"
|
|
45
|
+
>
|
|
46
|
+
<TabsList className="mx-4">
|
|
47
|
+
<TabsTrigger value="details">
|
|
48
|
+
{tr("admin.notifications.tabDetails", { default: "Details" })}
|
|
49
|
+
</TabsTrigger>
|
|
50
|
+
<TabsTrigger value="preview">
|
|
51
|
+
{tr("admin.notifications.tabPreview", { default: "Preview" })}
|
|
52
|
+
</TabsTrigger>
|
|
53
|
+
<TabsTrigger value="raw">
|
|
54
|
+
{tr("admin.notifications.tabRaw", { default: "Raw" })}
|
|
55
|
+
</TabsTrigger>
|
|
56
|
+
</TabsList>
|
|
57
|
+
|
|
58
|
+
<TabsContent value="details" className="min-h-0 flex-1 overflow-y-auto">
|
|
59
|
+
<div className="space-y-6 px-4 pb-6 text-sm">
|
|
60
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
61
|
+
<AdminNotificationsStatusBadge status={detail.status} />
|
|
62
|
+
{detail.skipReason ? (
|
|
63
|
+
<span className="text-muted-foreground text-xs">
|
|
64
|
+
{detail.skipReason}
|
|
65
|
+
</span>
|
|
66
|
+
) : null}
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<dl className="grid grid-cols-2 gap-x-4 gap-y-2">
|
|
70
|
+
<dt className="text-muted-foreground text-xs">
|
|
71
|
+
{tr("admin.notifications.detailSent", { default: "Sent" })}
|
|
72
|
+
</dt>
|
|
73
|
+
<dd>{String(l(detail.createdAt, { date: "lll" }))}</dd>
|
|
74
|
+
|
|
75
|
+
{detail.lastEventAt ? (
|
|
76
|
+
<>
|
|
77
|
+
<dt className="text-muted-foreground text-xs">
|
|
78
|
+
{tr("admin.notifications.detailLastEvent", {
|
|
79
|
+
default: "Last event",
|
|
80
|
+
})}
|
|
81
|
+
</dt>
|
|
82
|
+
<dd>{String(l(detail.lastEventAt, { date: "lll" }))}</dd>
|
|
83
|
+
</>
|
|
84
|
+
) : null}
|
|
85
|
+
|
|
86
|
+
<dt className="text-muted-foreground text-xs">
|
|
87
|
+
{tr("admin.notifications.detailChannel", { default: "Channel" })}
|
|
88
|
+
</dt>
|
|
89
|
+
<dd>{detail.type ?? "-"}</dd>
|
|
90
|
+
|
|
91
|
+
<dt className="text-muted-foreground text-xs">
|
|
92
|
+
{tr("admin.notifications.detailCategory", {
|
|
93
|
+
default: "Category",
|
|
94
|
+
})}
|
|
95
|
+
</dt>
|
|
96
|
+
<dd>{detail.category ?? "-"}</dd>
|
|
97
|
+
|
|
98
|
+
<dt className="text-muted-foreground text-xs">
|
|
99
|
+
{tr("admin.notifications.detailProvider", {
|
|
100
|
+
default: "Provider",
|
|
101
|
+
})}
|
|
102
|
+
</dt>
|
|
103
|
+
<dd>{detail.provider ?? "-"}</dd>
|
|
104
|
+
|
|
105
|
+
{detail.smtpStatusCode ? (
|
|
106
|
+
<>
|
|
107
|
+
<dt className="text-muted-foreground text-xs">
|
|
108
|
+
{tr("admin.notifications.detailSmtpCode", {
|
|
109
|
+
default: "SMTP code",
|
|
110
|
+
})}
|
|
111
|
+
</dt>
|
|
112
|
+
<dd>{detail.smtpStatusCode}</dd>
|
|
113
|
+
</>
|
|
114
|
+
) : null}
|
|
115
|
+
</dl>
|
|
116
|
+
|
|
117
|
+
{detail.subject ? (
|
|
118
|
+
<div>
|
|
119
|
+
<div className="text-muted-foreground text-xs">
|
|
120
|
+
{tr("admin.notifications.detailSubject", {
|
|
121
|
+
default: "Subject",
|
|
122
|
+
})}
|
|
123
|
+
</div>
|
|
124
|
+
<div>{detail.subject}</div>
|
|
125
|
+
</div>
|
|
126
|
+
) : null}
|
|
127
|
+
|
|
128
|
+
{detail.error ? (
|
|
129
|
+
<div>
|
|
130
|
+
<div className="text-muted-foreground text-xs">
|
|
131
|
+
{tr("admin.notifications.detailError", { default: "Error" })}
|
|
132
|
+
</div>
|
|
133
|
+
<pre className="bg-muted overflow-x-auto rounded p-2 text-xs">
|
|
134
|
+
{detail.error}
|
|
135
|
+
</pre>
|
|
136
|
+
</div>
|
|
137
|
+
) : null}
|
|
138
|
+
|
|
139
|
+
{detail.outboxAvailable === false ? (
|
|
140
|
+
<p className="text-muted-foreground text-xs">
|
|
141
|
+
{tr("admin.notifications.detailOutboxGone", {
|
|
142
|
+
default:
|
|
143
|
+
"The original job record has passed its retention window, so variables and logs are no longer available. The receipt is kept for longer.",
|
|
144
|
+
})}
|
|
145
|
+
</p>
|
|
146
|
+
) : null}
|
|
147
|
+
</div>
|
|
148
|
+
</TabsContent>
|
|
149
|
+
|
|
150
|
+
<TabsContent
|
|
151
|
+
value="preview"
|
|
152
|
+
className="flex min-h-0 flex-1 flex-col overflow-y-auto"
|
|
153
|
+
>
|
|
154
|
+
{/* `active` gates the fetch, so opening a row never re-renders a
|
|
155
|
+
template nobody asked to see. */}
|
|
156
|
+
<AdminNotificationsPreviewTab
|
|
157
|
+
notificationId={props.notificationId}
|
|
158
|
+
active={tab === "preview"}
|
|
159
|
+
/>
|
|
160
|
+
</TabsContent>
|
|
161
|
+
|
|
162
|
+
<TabsContent value="raw" className="min-h-0 flex-1 overflow-y-auto">
|
|
163
|
+
<AdminNotificationsRawTab detail={detail} />
|
|
164
|
+
</TabsContent>
|
|
165
|
+
</Tabs>
|
|
166
|
+
);
|
|
167
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { AdminNotificationsDetailTabs } from "@alepha/ui/components/admin/admin-notifications-detail-tabs";
|
|
2
|
+
import {
|
|
3
|
+
Sheet,
|
|
4
|
+
SheetContent,
|
|
5
|
+
SheetDescription,
|
|
6
|
+
SheetHeader,
|
|
7
|
+
SheetTitle,
|
|
8
|
+
} from "@alepha/ui/components/ui/sheet";
|
|
9
|
+
import type { AdminNotificationController } from "alepha/api/notifications";
|
|
10
|
+
import { useClient, useQuery } from "alepha/react";
|
|
11
|
+
import { useI18n } from "alepha/react/i18n";
|
|
12
|
+
|
|
13
|
+
// Relative: the package's `components/*` subpath export maps to `.tsx`, so a
|
|
14
|
+
// plain `.ts` sibling only resolves this way.
|
|
15
|
+
import { notificationTemplateLabel } from "./admin-notifications-template-label.ts";
|
|
16
|
+
|
|
17
|
+
export interface AdminNotificationsDetailProps {
|
|
18
|
+
notificationId: string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Which tab to open on. The list's "Raw data" action opens straight onto
|
|
21
|
+
* `raw` rather than making the reader find it.
|
|
22
|
+
*/
|
|
23
|
+
initialTab?: string;
|
|
24
|
+
onClose: () => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Everything known about one message.
|
|
29
|
+
*
|
|
30
|
+
* ⚠️ **Renders with half the data missing, on purpose.** The receipt lives
|
|
31
|
+
* 90 days and the outbox row it points at lives 7, so `variables` and `logs`
|
|
32
|
+
* are simply absent on anything older than the shorter window. That is not
|
|
33
|
+
* an error state and must not look like one. `outboxAvailable` says which
|
|
34
|
+
* case this is.
|
|
35
|
+
*
|
|
36
|
+
* A `sensitive` template withholds subject, body and variables at the
|
|
37
|
+
* backend; nothing here needs to re-filter them.
|
|
38
|
+
*/
|
|
39
|
+
export const AdminNotificationsDetail = (
|
|
40
|
+
props: AdminNotificationsDetailProps,
|
|
41
|
+
) => {
|
|
42
|
+
const client = useClient<AdminNotificationController>();
|
|
43
|
+
const { tr } = useI18n();
|
|
44
|
+
|
|
45
|
+
const { data: detail } = useQuery(
|
|
46
|
+
{
|
|
47
|
+
handler: ({ signal }) =>
|
|
48
|
+
props.notificationId
|
|
49
|
+
? client.getNotification(
|
|
50
|
+
{ params: { id: props.notificationId } },
|
|
51
|
+
{ request: { signal } },
|
|
52
|
+
)
|
|
53
|
+
: Promise.resolve(null),
|
|
54
|
+
onError: () => {},
|
|
55
|
+
},
|
|
56
|
+
[client, props.notificationId],
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<Sheet
|
|
61
|
+
open={Boolean(props.notificationId)}
|
|
62
|
+
onOpenChange={(open) => {
|
|
63
|
+
if (!open) props.onClose();
|
|
64
|
+
}}
|
|
65
|
+
>
|
|
66
|
+
{/* Wider than the rest of the admin's sheets: this one has to fit a
|
|
67
|
+
rendered email, and an email is authored for a real column width. */}
|
|
68
|
+
<SheetContent className="flex w-full flex-col overflow-hidden sm:max-w-3xl">
|
|
69
|
+
<SheetHeader>
|
|
70
|
+
{/* Humanized through the same helper the list uses. Showing
|
|
71
|
+
`invitationInvite` here while the row that opened it says
|
|
72
|
+
"Invitation invite" makes one template look like two. The raw
|
|
73
|
+
name stays reachable in the Raw tab. */}
|
|
74
|
+
<SheetTitle title={detail?.template}>
|
|
75
|
+
{detail?.template
|
|
76
|
+
? notificationTemplateLabel(detail.template)
|
|
77
|
+
: tr("admin.notifications.detailTitle", {
|
|
78
|
+
default: "Notification",
|
|
79
|
+
})}
|
|
80
|
+
</SheetTitle>
|
|
81
|
+
<SheetDescription>{detail?.contact ?? ""}</SheetDescription>
|
|
82
|
+
</SheetHeader>
|
|
83
|
+
|
|
84
|
+
{detail && props.notificationId ? (
|
|
85
|
+
// Keyed on the row AND the requested tab: the sheet stays mounted
|
|
86
|
+
// between rows, so without this a "Raw data" click on a second row
|
|
87
|
+
// would land on whatever tab the previous one was left on. A key is
|
|
88
|
+
// the remount, which is how the tab state re-initialises without an
|
|
89
|
+
// effect that sets state.
|
|
90
|
+
<AdminNotificationsDetailTabs
|
|
91
|
+
key={`${props.notificationId}:${props.initialTab ?? "details"}`}
|
|
92
|
+
notificationId={props.notificationId}
|
|
93
|
+
detail={detail}
|
|
94
|
+
initialTab={props.initialTab ?? "details"}
|
|
95
|
+
/>
|
|
96
|
+
) : null}
|
|
97
|
+
</SheetContent>
|
|
98
|
+
</Sheet>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { EmailBodyFrame } from "@alepha/ui/components/email-body-frame/email-body-frame";
|
|
2
|
+
import { Badge } from "@alepha/ui/components/ui/badge";
|
|
3
|
+
import type { NotificationPreviewResource } from "alepha/api/notifications";
|
|
4
|
+
import { useI18n } from "alepha/react/i18n";
|
|
5
|
+
|
|
6
|
+
export interface AdminNotificationsPreviewBodyProps {
|
|
7
|
+
preview: NotificationPreviewResource;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* What a preview looks like, given one already fetched.
|
|
12
|
+
*
|
|
13
|
+
* Split from the tab that fetches it so the interesting half - three
|
|
14
|
+
* unavailable states that must not read alike - can be rendered in a test
|
|
15
|
+
* without a container or a client.
|
|
16
|
+
*/
|
|
17
|
+
export const AdminNotificationsPreviewBody = (
|
|
18
|
+
props: AdminNotificationsPreviewBodyProps,
|
|
19
|
+
) => {
|
|
20
|
+
const { tr } = useI18n();
|
|
21
|
+
const preview = props.preview;
|
|
22
|
+
|
|
23
|
+
if (!preview.available) {
|
|
24
|
+
/**
|
|
25
|
+
* Three separate sentences, deliberately. All three are normal, and an
|
|
26
|
+
* operator has to be able to tell retention (nothing to do) from a
|
|
27
|
+
* sensitive template (nothing will ever be shown) from a deleted
|
|
28
|
+
* template (someone changed the code). One shared "unavailable" would
|
|
29
|
+
* make all three look like a bug.
|
|
30
|
+
*/
|
|
31
|
+
const reasons: Record<string, string> = {
|
|
32
|
+
"outbox-purged": tr("admin.notifications.previewPurged", {
|
|
33
|
+
default:
|
|
34
|
+
"The job record holding this message's variables has passed its retention window, so it can no longer be rendered. The receipt is kept for longer.",
|
|
35
|
+
}),
|
|
36
|
+
sensitive: tr("admin.notifications.previewSensitive", {
|
|
37
|
+
default:
|
|
38
|
+
"This template is marked sensitive, so its rendered content is never shown in the admin.",
|
|
39
|
+
}),
|
|
40
|
+
"template-missing": tr("admin.notifications.previewTemplateMissing", {
|
|
41
|
+
default:
|
|
42
|
+
"The template that produced this message is no longer registered in the app, so there is nothing left to render it with.",
|
|
43
|
+
}),
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<div className="px-4 pb-6">
|
|
48
|
+
<p className="text-muted-foreground text-sm">
|
|
49
|
+
{reasons[preview.reason ?? ""] ??
|
|
50
|
+
tr("admin.notifications.previewUnavailable", {
|
|
51
|
+
default: "This message cannot be previewed.",
|
|
52
|
+
})}
|
|
53
|
+
</p>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<div className="flex min-h-0 flex-1 flex-col gap-4 px-4 pb-6">
|
|
60
|
+
<p className="text-muted-foreground text-xs">
|
|
61
|
+
{tr("admin.notifications.previewLive", {
|
|
62
|
+
default:
|
|
63
|
+
"Re-rendered from the template as it exists now. If the template changed since the send, this differs from what was delivered.",
|
|
64
|
+
})}
|
|
65
|
+
</p>
|
|
66
|
+
|
|
67
|
+
{preview.subject ? (
|
|
68
|
+
<div>
|
|
69
|
+
<div className="text-muted-foreground text-xs">
|
|
70
|
+
{tr("admin.notifications.detailSubject", { default: "Subject" })}
|
|
71
|
+
</div>
|
|
72
|
+
<div className="text-sm">{preview.subject}</div>
|
|
73
|
+
</div>
|
|
74
|
+
) : null}
|
|
75
|
+
|
|
76
|
+
{preview.attachments.length > 0 ? (
|
|
77
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
78
|
+
<span className="text-muted-foreground text-xs">
|
|
79
|
+
{tr("admin.notifications.previewAttachments", {
|
|
80
|
+
default: "Attachments",
|
|
81
|
+
})}
|
|
82
|
+
</span>
|
|
83
|
+
{/* Names only. The bytes are never resolved for a preview, so a
|
|
84
|
+
purged file cannot break the render. */}
|
|
85
|
+
{preview.attachments.map((attachment) => (
|
|
86
|
+
<Badge key={attachment} variant="secondary">
|
|
87
|
+
{attachment}
|
|
88
|
+
</Badge>
|
|
89
|
+
))}
|
|
90
|
+
</div>
|
|
91
|
+
) : null}
|
|
92
|
+
|
|
93
|
+
{preview.channel === "email" ? (
|
|
94
|
+
<div className="min-h-96 flex-1 overflow-hidden rounded border">
|
|
95
|
+
<EmailBodyFrame html={preview.html ?? ""} />
|
|
96
|
+
</div>
|
|
97
|
+
) : (
|
|
98
|
+
<div className="bg-muted rounded p-3 text-sm whitespace-pre-wrap">
|
|
99
|
+
{preview.message}
|
|
100
|
+
</div>
|
|
101
|
+
)}
|
|
102
|
+
</div>
|
|
103
|
+
);
|
|
104
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { AdminNotificationsPreviewBody } from "@alepha/ui/components/admin/admin-notifications-preview-body";
|
|
2
|
+
import type {
|
|
3
|
+
AdminNotificationController,
|
|
4
|
+
NotificationPreviewResource,
|
|
5
|
+
} from "alepha/api/notifications";
|
|
6
|
+
import { useClient, useQuery } from "alepha/react";
|
|
7
|
+
|
|
8
|
+
export interface AdminNotificationsPreviewTabProps {
|
|
9
|
+
notificationId: string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Whether this tab is the one on screen. The fetch is skipped until it is,
|
|
12
|
+
* so opening a row never re-renders a template nobody asked to see.
|
|
13
|
+
*/
|
|
14
|
+
active: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The message itself, re-rendered from its template.
|
|
19
|
+
*
|
|
20
|
+
* ⚠️ **This is not what was delivered, it is what the template produces
|
|
21
|
+
* today.** `storeRenderedBody` is off by default, so most receipts carry no
|
|
22
|
+
* body and the only way to show anything is to run the template again. If it
|
|
23
|
+
* has changed since the send the preview changes with it, which the banner in
|
|
24
|
+
* {@link AdminNotificationsPreviewBody} says out loud rather than implying a
|
|
25
|
+
* fidelity it does not have.
|
|
26
|
+
*
|
|
27
|
+
* The endpoint answers 200 with a reason rather than throwing when there is
|
|
28
|
+
* nothing to show: retention and a sensitive template are expected states,
|
|
29
|
+
* not errors.
|
|
30
|
+
*/
|
|
31
|
+
export const AdminNotificationsPreviewTab = (
|
|
32
|
+
props: AdminNotificationsPreviewTabProps,
|
|
33
|
+
) => {
|
|
34
|
+
const client = useClient<AdminNotificationController>();
|
|
35
|
+
|
|
36
|
+
const { data: preview } = useQuery<NotificationPreviewResource | null>(
|
|
37
|
+
{
|
|
38
|
+
handler: ({ signal }) =>
|
|
39
|
+
props.active && props.notificationId
|
|
40
|
+
? (client.previewNotification(
|
|
41
|
+
{ params: { id: props.notificationId } },
|
|
42
|
+
{ request: { signal } },
|
|
43
|
+
) as any)
|
|
44
|
+
: Promise.resolve(null),
|
|
45
|
+
onError: () => {},
|
|
46
|
+
},
|
|
47
|
+
[client, props.notificationId, props.active],
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
if (!preview) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return <AdminNotificationsPreviewBody preview={preview} />;
|
|
55
|
+
};
|