diff --git a/app/controllers/api/v1/accounts/webhooks_controller.rb b/app/controllers/api/v1/accounts/webhooks_controller.rb index 7ea257ed2..9f8e94821 100644 --- a/app/controllers/api/v1/accounts/webhooks_controller.rb +++ b/app/controllers/api/v1/accounts/webhooks_controller.rb @@ -23,7 +23,7 @@ class Api::V1::Accounts::WebhooksController < Api::V1::Accounts::BaseController private def webhook_params - params.require(:webhook).permit(:inbox_id, :url, subscriptions: []) + params.require(:webhook).permit(:inbox_id, :name, :url, subscriptions: []) end def fetch_webhook diff --git a/app/javascript/dashboard/i18n/locale/en/integrations.json b/app/javascript/dashboard/i18n/locale/en/integrations.json index 78804220d..f74e674d7 100644 --- a/app/javascript/dashboard/i18n/locale/en/integrations.json +++ b/app/javascript/dashboard/i18n/locale/en/integrations.json @@ -46,6 +46,10 @@ "CONVERSATION_TYPING_OFF": "Conversation Typing Off" } }, + "NAME": { + "LABEL": "Webhook Name", + "PLACEHOLDER": "Enter the name of the webhook" + }, "END_POINT": { "LABEL": "Webhook URL", "PLACEHOLDER": "Example: {webhookExampleURL}", diff --git a/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/WebhookForm.vue b/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/WebhookForm.vue index 430658329..3f4b31299 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/WebhookForm.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/WebhookForm.vue @@ -55,6 +55,7 @@ export default { data() { return { url: this.value.url || '', + name: this.value.name || '', subscriptions: this.value.subscriptions || [], supportedWebhookEvents: SUPPORTED_WEBHOOK_EVENTS, }; @@ -68,11 +69,15 @@ export default { } ); }, + webhookNameInputPlaceholder() { + return this.$t('INTEGRATION_SETTINGS.WEBHOOK.FORM.NAME.PLACEHOLDER'); + }, }, methods: { onSubmit() { this.$emit('submit', { url: this.url, + name: this.name, subscriptions: this.subscriptions, }); }, @@ -97,6 +102,15 @@ export default { {{ $t('INTEGRATION_SETTINGS.WEBHOOK.FORM.END_POINT.ERROR') }} + diff --git a/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/WebhookRow.vue b/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/WebhookRow.vue index e2bf986e0..3dfb177e5 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/WebhookRow.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/WebhookRow.vue @@ -37,8 +37,16 @@ const subscribedEvents = computed(() => {