From 6437a22dd465aba83ca23e53d4e22d35c3039960 Mon Sep 17 00:00:00 2001 From: Marlon Pina Tojal Date: Tue, 5 Dec 2023 15:18:04 +0100 Subject: [PATCH 1/3] add token and new notifications Signed-off-by: Marlon Pina Tojal --- .../administration/notifications/Alerts.vue | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/views/administration/notifications/Alerts.vue b/src/views/administration/notifications/Alerts.vue index 20e0e9e42..70fcf472e 100644 --- a/src/views/administration/notifications/Alerts.vue +++ b/src/views/administration/notifications/Alerts.vue @@ -139,6 +139,8 @@ + FILE_SYSTEM
INDEXING_SERVICE
REPOSITORY
+
USER_CREATED
+
USER_DELETED
@@ -224,6 +228,7 @@ publisherClass: row.publisher.publisherClass, notificationLevel: row.notificationLevel, destination: this.parseDestination(row), + token: this.parseToken(row), jiraTicketType: this.parseJiraTicketType(row), scope: row.scope, notifyOn: row.notifyOn, @@ -238,6 +243,7 @@ }, created() { this.parseDestination(this.alert); + this.parseToken(this.alert); this.parseJiraTicketType(this.alert); }, watch: { @@ -274,6 +280,15 @@ return null; } }, + parseToken: function(alert) { + if (alert.publisherConfig) { + let value = JSON.parse(alert.publisherConfig); + if (value) { + return value.token; + } + return null; + } + }, parseJiraTicketType: function(alert) { if (alert.publisherConfig) { let value = JSON.parse(alert.publisherConfig); @@ -292,11 +307,12 @@ logSuccessfulPublish: this.logSuccessfulPublish, notifyChildren: this.notifyChildren, notificationLevel: this.notificationLevel, - publisherConfig: JSON.stringify({ destination: this.destination, jiraTicketType: this.jiraTicketType }), + publisherConfig: JSON.stringify({ destination: this.destination, jiraTicketType: this.jiraTicketType, token: this.token }), notifyOn: this.notifyOn }).then((response) => { this.alert = response.data; this.destination = this.parseDestination(this.alert); + this.token = this.parseToken(this.alert); this.jiraTicketType = this.parseJiraTicketType(this.alert); EventBus.$emit('admin:alerts:rowUpdate', index, this.alert); this.$toastr.s(this.$t('message.updated')); From d1ee770eae84b3e2c02f9db3aa9bc3f1d06dfed5 Mon Sep 17 00:00:00 2001 From: Marlon Pina Tojal Date: Thu, 11 Jan 2024 08:50:50 +0100 Subject: [PATCH 2/3] add api token header Signed-off-by: Marlon Pina Tojal --- src/i18n/locales/en.json | 1 + .../administration/notifications/Alerts.vue | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index c543d2749..86ff98bd2 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -645,6 +645,7 @@ "select_ecosystem": "Select Ecosystems", "registered_email_address": "Registered email address", "api_token": "API token", + "api_token_header": "API token header", "consumer_key": "Consumer key", "consumer_secret": "Consumer secret", "personal_access_token": "Personal Access Token", diff --git a/src/views/administration/notifications/Alerts.vue b/src/views/administration/notifications/Alerts.vue index 70fcf472e..ef1733843 100644 --- a/src/views/administration/notifications/Alerts.vue +++ b/src/views/administration/notifications/Alerts.vue @@ -139,6 +139,8 @@ + { this.alert = response.data; this.destination = this.parseDestination(this.alert); this.token = this.parseToken(this.alert); + this.tokenHeader = this.parseTokenHeader(this.alert); this.jiraTicketType = this.parseJiraTicketType(this.alert); EventBus.$emit('admin:alerts:rowUpdate', index, this.alert); this.$toastr.s(this.$t('message.updated')); From bbd4079e070d76ae1a730707422b527878bcc317 Mon Sep 17 00:00:00 2001 From: Marlon Pina Tojal Date: Mon, 4 Mar 2024 19:47:30 +0100 Subject: [PATCH 3/3] lint Signed-off-by: Marlon Pina Tojal --- src/views/administration/notifications/Alerts.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/administration/notifications/Alerts.vue b/src/views/administration/notifications/Alerts.vue index f5bb30461..1c5887610 100644 --- a/src/views/administration/notifications/Alerts.vue +++ b/src/views/administration/notifications/Alerts.vue @@ -302,7 +302,7 @@ export default { return null; } }, - parseToken: function(alert) { + parseToken: function (alert) { if (alert.publisherConfig) { let value = JSON.parse(alert.publisherConfig); if (value) { @@ -311,7 +311,7 @@ export default { return null; } }, - parseTokenHeader: function(alert) { + parseTokenHeader: function (alert) { if (alert.publisherConfig) { let value = JSON.parse(alert.publisherConfig); if (value) { @@ -343,7 +343,7 @@ export default { destination: this.destination, jiraTicketType: this.jiraTicketType, token: this.token, - tokenHeader: this.tokenHeader + tokenHeader: this.tokenHeader, }), notifyOn: this.notifyOn, })