feat: add user specific notification settings

The settings can be customized for each origin and each processor
individually. The default Web indicates notifications shown in the
Backstage UI. By default, if there are no settings saved in the
database, all notifications are enabled for all processors.

The origins will populate by time for each user as they receive the
first notification from that origin. Processors are shown as their own
columns.

Later, if it makes sense, allow users to also disable/enable
notifications based on notification topic.

Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
Heikki Hellgren
2024-08-08 13:32:10 +03:00
parent d336f929d8
commit 97ba58fa17
26 changed files with 802 additions and 55 deletions
@@ -6,6 +6,7 @@ metadata:
spec:
targets:
- ./remote-templates.yaml
- ./notifications-demo/template.yaml
# For local development of a template, you can reference your local templates here.
# Examples:
#
@@ -0,0 +1,69 @@
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
name: notifications-demo
title: Test Notifications template
description: scaffolder v1beta3 template demo sending notification
spec:
owner: backstage/techdocs-core
type: service
parameters:
- title: Notification
required:
- recipients
- title
properties:
recipients:
title: Recipients
type: string
description: Notification recipients
default: entity
enum:
- entity
- broadcast
entityRefs:
title: Entities
type: array
description: Entities to send the notification. Required if recipients is entity
ui:field: MultiEntityPicker
ui:options:
defaultNamespace: default
title:
title: Title
type: string
description: Notification title
description:
title: Description
type: string
description: Notification longer description
link:
title: Link
type: string
description: Notification link
severity:
title: Severity
type: string
description: Notification severity
default: normal
enum:
- low
- normal
- high
- critical
scope:
title: Scope
type: string
description: Notification scope
steps:
- id: send-notification
name: Send notification
action: notification:send
input:
recipients: ${{ parameters.recipients }}
entityRefs: ${{ parameters.entityRefs }}
title: ${{ parameters.title }}
description: ${{ parameters.description }}
link: ${{ parameters.link }}
severity: ${{ parameters.severity }}
scope: ${{ parameters.scope }}