diff --git a/app/javascript/dashboard/api/integrations.js b/app/javascript/dashboard/api/integrations.js index d4ffcbca3..2a10c436c 100644 --- a/app/javascript/dashboard/api/integrations.js +++ b/app/javascript/dashboard/api/integrations.js @@ -29,6 +29,13 @@ class IntegrationsAPI extends ApiClient { return axios.post(`${this.baseUrl()}/integrations/hooks`, hookData); } + updateHook(hookId, hookData) { + return axios.patch( + `${this.baseUrl()}/integrations/hooks/${hookId}`, + hookData + ); + } + deleteHook(hookId) { return axios.delete(`${this.baseUrl()}/integrations/hooks/${hookId}`); } diff --git a/app/javascript/dashboard/i18n/locale/en/integrations.json b/app/javascript/dashboard/i18n/locale/en/integrations.json index 82782988f..027ff0038 100644 --- a/app/javascript/dashboard/i18n/locale/en/integrations.json +++ b/app/javascript/dashboard/i18n/locale/en/integrations.json @@ -132,6 +132,22 @@ "TITLE": "Delete the integration", "MESSAGE": "Are you sure you want to delete the integration? Doing so will result in the loss of access to conversations on your Slack workspace." }, + "INTEGRATION_MODE": { + "TITLE": "Integration mode", + "DESCRIPTION": "Choose how your team uses the connected Slack channel.", + "TWO_WAY": { + "LABEL": "Two-way communication", + "DESCRIPTION": "Replies in Slack threads are sent to the customer. Start a message with 'note:' to keep it private." + }, + "ALERTS_ONLY": { + "LABEL": "Alerts only", + "DESCRIPTION": "Conversations are synced to Slack for internal discussion, but messages sent in Slack threads never reach the customer. Replies to customers are sent from the dashboard." + }, + "API": { + "SUCCESS_MESSAGE": "Integration mode updated successfully", + "ERROR_MESSAGE": "There was an error updating the integration mode, please try again" + } + }, "HELP_TEXT": { "TITLE": "How to use the Slack Integration?", "BODY": "With this integration, all of your incoming conversations will be synced to the ***{selectedChannelName}*** channel in your Slack workspace. You can manage all your customer conversations right within the channel and never miss a message.\n\nHere are the main features of the integration:\n\n**Respond to conversations from within Slack:** To respond to a conversation in the ***{selectedChannelName}*** Slack channel, simply type out your message and send it as a thread. This will create a response back to the customer through Chatwoot. It's that simple!\n\n **Create private notes:** If you want to create private notes instead of replies, start your message with ***`note:`***. This ensures that your message is kept private and won't be visible to the customer.\n\n**Associate an agent profile:** If the person who replied on Slack has an agent profile in Chatwoot under the same email, the replies will be associated with that agent profile automatically. This means you can easily track who said what and when. On the other hand, when the replier doesn't have an associated agent profile, the replies will appear from the bot profile to the customer.", diff --git a/app/javascript/dashboard/routes/dashboard/settings/integrations/Slack.vue b/app/javascript/dashboard/routes/dashboard/settings/integrations/Slack.vue index d1877fbc3..24e462087 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/integrations/Slack.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/integrations/Slack.vue @@ -5,6 +5,7 @@ import { useRouter, useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n'; import Integration from './Integration.vue'; import SelectChannelWarning from './Slack/SelectChannelWarning.vue'; +import SlackIntegrationMode from './Slack/SlackIntegrationMode.vue'; import SlackIntegrationHelpText from './Slack/SlackIntegrationHelpText.vue'; import SettingsLayout from '../SettingsLayout.vue'; import BaseSettingsHeader from '../components/BaseSettingsHeader.vue'; @@ -103,11 +104,12 @@ onMounted(() => { ), }" /> -
+
+ diff --git a/app/javascript/dashboard/routes/dashboard/settings/integrations/Slack/SelectChannelWarning.vue b/app/javascript/dashboard/routes/dashboard/settings/integrations/Slack/SelectChannelWarning.vue index 479b67e7b..302241439 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/integrations/Slack/SelectChannelWarning.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/integrations/Slack/SelectChannelWarning.vue @@ -61,7 +61,7 @@ const updateIntegration = async () => {