From 94a83ea995b70c9d800c8a71465260ee6b7ce699 Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Sun, 6 Jun 2021 16:59:47 +0530 Subject: [PATCH] feat: Add an option to edit webhook URL (#2316) Co-authored-by: Pranav Raj S --- .../i18n/locale/en/integrations.json | 23 +++- .../settings/integrations/EditWebHook.vue | 108 ++++++++++++++++++ .../integrations/{New.vue => NewWebHook.vue} | 30 +++-- .../settings/integrations/Webhook.vue | 50 ++++++-- .../modules/specs/webhooks/actions.spec.js | 24 ++++ .../modules/specs/webhooks/mutations.spec.js | 10 ++ .../dashboard/store/modules/webhooks.js | 20 +++- .../dashboard/store/mutation-types.js | 1 + 8 files changed, 233 insertions(+), 33 deletions(-) create mode 100644 app/javascript/dashboard/routes/dashboard/settings/integrations/EditWebHook.vue rename app/javascript/dashboard/routes/dashboard/settings/integrations/{New.vue => NewWebHook.vue} (81%) diff --git a/app/javascript/dashboard/i18n/locale/en/integrations.json b/app/javascript/dashboard/i18n/locale/en/integrations.json index 8e158982a..cbbe0ebbf 100644 --- a/app/javascript/dashboard/i18n/locale/en/integrations.json +++ b/app/javascript/dashboard/i18n/locale/en/integrations.json @@ -12,10 +12,25 @@ "LIST": { "404": "There are no webhooks configured for this account.", "TITLE": "Manage webhooks", - "TABLE_HEADER": [ - "Webhook endpoint", - "Actions" - ] + "TABLE_HEADER": ["Webhook endpoint", "Actions"] + }, + "EDIT": { + "BUTTON_TEXT": "Edit", + "TITLE": "Edit webhook", + "CANCEL": "Cancel", + "DESC": "Webhook events provide you the realtime information about what's happening in your Chatwoot account. Please enter a valid URL to configure a callback.", + "FORM": { + "END_POINT": { + "LABEL": "Webhook URL", + "PLACEHOLDER": "Example: https://example/api/webhook", + "ERROR": "Please enter a valid URL" + }, + "SUBMIT": "Edit webhook" + }, + "API": { + "SUCCESS_MESSAGE": "Webhook URL updated successfully", + "ERROR_MESSAGE": "Could not connect to Woot Server, Please try again later" + } }, "ADD": { "CANCEL": "Cancel", diff --git a/app/javascript/dashboard/routes/dashboard/settings/integrations/EditWebHook.vue b/app/javascript/dashboard/routes/dashboard/settings/integrations/EditWebHook.vue new file mode 100644 index 000000000..cdfa2998a --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/integrations/EditWebHook.vue @@ -0,0 +1,108 @@ + + + diff --git a/app/javascript/dashboard/routes/dashboard/settings/integrations/New.vue b/app/javascript/dashboard/routes/dashboard/settings/integrations/NewWebHook.vue similarity index 81% rename from app/javascript/dashboard/routes/dashboard/settings/integrations/New.vue rename to app/javascript/dashboard/routes/dashboard/settings/integrations/NewWebHook.vue index 55fbbc650..8c445771f 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/integrations/New.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/integrations/NewWebHook.vue @@ -28,14 +28,15 @@ @@ -45,15 +46,14 @@