Migrate persistent notification services to support translations (#96391)

* Migrate persistent notification services to support translations

* Apply suggestions from code review

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>

---------

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
pull/96436/head
Franck Nijhof 2023-07-12 16:11:28 +02:00 committed by GitHub
parent 2d474813c0
commit 7ca539fcd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 14 deletions

View File

@ -1,39 +1,25 @@
create:
name: Create
description: Show a notification in the frontend.
fields:
message:
name: Message
description: Message body of the notification.
required: true
example: Please check your configuration.yaml.
selector:
text:
title:
name: Title
description: Optional title for your notification.
example: Test notification
selector:
text:
notification_id:
name: Notification ID
description: Target ID of the notification, will replace a notification with the same ID.
example: 1234
selector:
text:
dismiss:
name: Dismiss
description: Remove a notification from the frontend.
fields:
notification_id:
name: Notification ID
description: Target ID of the notification, which should be removed.
required: true
example: 1234
selector:
text:
dismiss_all:
name: Dismiss All
description: Remove all notifications.

View File

@ -0,0 +1,36 @@
{
"services": {
"create": {
"name": "Create",
"description": "Shows a notification on the **Notifications** panel.",
"fields": {
"message": {
"name": "Message",
"description": "Message body of the notification."
},
"title": {
"name": "Title",
"description": "Optional title of the notification."
},
"notification_id": {
"name": "Notification ID",
"description": "ID of the notification. This new notification will overwrite an existing notification with the same ID."
}
}
},
"dismiss": {
"name": "Dismiss",
"description": "Removes a notification from the **Notifications** panel.",
"fields": {
"notification_id": {
"name": "Notification ID",
"description": "ID of the notification to be removed."
}
}
},
"dismiss_all": {
"name": "Dismiss all",
"description": "Removes all notifications from the **Notifications** panel."
}
}
}