From 88726bed86bef18c34a332c95bf6ca6e85796329 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sun, 25 Sep 2022 09:46:45 -0500 Subject: [PATCH] Update:Notification system descriptions #996 --- client/components/cards/NotificationCard.vue | 2 +- .../modals/notification/NotificationEditModal.vue | 7 ++++++- client/components/ui/Dropdown.vue | 11 +++++++++-- client/pages/config/notifications.vue | 7 +++++-- server/managers/NotificationManager.js | 2 +- server/objects/settings/NotificationSettings.js | 4 ++-- server/utils/notifications.js | 2 +- 7 files changed, 25 insertions(+), 10 deletions(-) diff --git a/client/components/cards/NotificationCard.vue b/client/components/cards/NotificationCard.vue index 05bf66de..7f74239e 100644 --- a/client/components/cards/NotificationCard.vue +++ b/client/components/cards/NotificationCard.vue @@ -76,7 +76,7 @@ export default { }, sendTestClick() { const payload = { - message: `Send a test notification to event ${this.eventName}?`, + message: `Trigger this notification with test data?`, callback: (confirmed) => { if (confirmed) { this.sendTest() diff --git a/client/components/modals/notification/NotificationEditModal.vue b/client/components/modals/notification/NotificationEditModal.vue index a9382a68..3f53db05 100644 --- a/client/components/modals/notification/NotificationEditModal.vue +++ b/client/components/modals/notification/NotificationEditModal.vue @@ -16,6 +16,8 @@ +

Available variables: {{ availableVariables.join(', ') }}

+
@@ -73,7 +75,7 @@ export default { return this.notificationData.events || [] }, eventOptions() { - return this.notificationEvents.map((e) => ({ value: e.name, text: e.name })) + return this.notificationEvents.map((e) => ({ value: e.name, text: e.name, subtext: e.description })) }, selectedEventData() { return this.notificationEvents.find((e) => e.name === this.newNotification.eventName) @@ -83,6 +85,9 @@ export default { }, title() { return this.isNew ? 'Create Notification' : 'Update Notification' + }, + availableVariables() { + return this.selectedEventData ? this.selectedEventData.variables || null : null } }, methods: { diff --git a/client/components/ui/Dropdown.vue b/client/components/ui/Dropdown.vue index 22eeed17..0a4b9c30 100644 --- a/client/components/ui/Dropdown.vue +++ b/client/components/ui/Dropdown.vue @@ -3,7 +3,9 @@

{{ label }}