From 31e76632580f89afdacb43ad63a4a8e624c56c04 Mon Sep 17 00:00:00 2001 From: Pranav Date: Thu, 29 Aug 2024 11:19:32 +0530 Subject: [PATCH 1/6] feat: Update the design for the Inbox management console (#10043) This is the continuation of the design update PR. This changes the design for the inbox pages. --------- Co-authored-by: Muhsin Keloth Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> --- .../dashboard/helper/featureHelper.js | 1 + .../dashboard/i18n/locale/en/inboxMgmt.json | 15 +- .../routes/dashboard/settings/inbox/Index.vue | 352 ++++++++---------- .../settings/inbox/components/ChannelName.vue | 55 +++ .../dashboard/settings/inbox/inbox.routes.js | 32 +- 5 files changed, 244 insertions(+), 211 deletions(-) create mode 100644 app/javascript/dashboard/routes/dashboard/settings/inbox/components/ChannelName.vue diff --git a/app/javascript/dashboard/helper/featureHelper.js b/app/javascript/dashboard/helper/featureHelper.js index a7fa21616..b4d131ce4 100644 --- a/app/javascript/dashboard/helper/featureHelper.js +++ b/app/javascript/dashboard/helper/featureHelper.js @@ -9,6 +9,7 @@ const FEATURE_HELP_URLS = { custom_attributes: 'https://chwt.app/hc/custom-attributes', dashboard_apps: 'https://chwt.app/hc/dashboard-apps', help_center: 'https://chwt.app/hc/help-center', + inboxes: 'https://chwt.app/hc/inboxes', integrations: 'https://chwt.app/hc/integrations', labels: 'https://chwt.app/hc/labels', macros: 'https://chwt.app/hc/macros', diff --git a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json index eec8ccde6..5bd1b6989 100644 --- a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json +++ b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json @@ -1,7 +1,8 @@ { "INBOX_MGMT": { "HEADER": "Inboxes", - "SIDEBAR_TXT": "

Inbox

When you connect a website or a facebook Page to Chatwoot, it is called an Inbox. You can have unlimited inboxes in your Chatwoot account.

Click on Add Inbox to connect a website or a Facebook Page.

In the Dashboard, you can see all the conversations from all your inboxes in a single place and respond to them under the `Conversations` tab.

You can also see conversations specific to an inbox by clicking on the inbox name on the left pane of the dashboard.

", + "DESCRIPTION": "A channel is the mode of communication your customer chooses to interact with you. An inbox is where you manage interactions for a specific channel. It can include communications from various sources such as email, live chat, and social media.", + "LEARN_MORE": "Learn more about inboxes", "RECONNECTION_REQUIRED": "Your inbox is disconnected. You won't receive new messages until you reauthorize it.", "CLICK_TO_RECONNECT": "Click here to reconnect.", "LIST": { @@ -745,6 +746,18 @@ "MICROSOFT": "Microsoft", "GOOGLE": "Google", "OTHER_PROVIDERS": "Other Providers" + }, + "CHANNELS": { + "MESSENGER": "Messenger", + "WEB_WIDGET": "Website", + "TWITTER_PROFILE": "Twitter", + "TWILIO_SMS": "Twilio SMS", + "WHATSAPP": "WhatsApp", + "SMS": "SMS", + "EMAIL": "Email", + "TELEGRAM": "Telegram", + "LINE": "Line", + "API": "API Channel" } } } diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/Index.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/Index.vue index c7c7a2a44..895d11360 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/inbox/Index.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/Index.vue @@ -1,219 +1,177 @@ - - - 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 20e6d6c1a..447913ecb 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/WebhookRow.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/WebhookRow.vue @@ -1,59 +1,58 @@ - diff --git a/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/specs/webhookHelper.spec.js b/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/specs/webhookHelper.spec.js new file mode 100644 index 000000000..9bde34063 --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/specs/webhookHelper.spec.js @@ -0,0 +1,9 @@ +import { getEventNamei18n } from '../webhookHelper'; + +describe('#getEventNamei18n', () => { + it('returns correct i18n translation text', () => { + expect(getEventNamei18n('message_created')).toEqual( + `INTEGRATION_SETTINGS.WEBHOOK.FORM.SUBSCRIPTIONS.EVENTS.MESSAGE_CREATED` + ); + }); +}); diff --git a/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/specs/webhookMixin.spec.js b/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/specs/webhookMixin.spec.js deleted file mode 100644 index c617b64b0..000000000 --- a/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/specs/webhookMixin.spec.js +++ /dev/null @@ -1,26 +0,0 @@ -import { createWrapper } from '@vue/test-utils'; -import webhookMixin from '../webhookMixin'; -import Vue from 'vue'; - -describe('webhookMixin', () => { - describe('#getEventLabel', () => { - it('returns correct i18n translation:', () => { - const Component = { - render() {}, - title: 'WebhookComponent', - mixins: [webhookMixin], - methods: { - $t(text) { - return text; - }, - }, - }; - const Constructor = Vue.extend(Component); - const vm = new Constructor().$mount(); - const wrapper = createWrapper(vm); - expect(wrapper.vm.getEventLabel('message_created')).toEqual( - `INTEGRATION_SETTINGS.WEBHOOK.FORM.SUBSCRIPTIONS.EVENTS.MESSAGE_CREATED` - ); - }); - }); -}); diff --git a/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/webhookHelper.js b/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/webhookHelper.js new file mode 100644 index 000000000..699dafdc8 --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/webhookHelper.js @@ -0,0 +1,4 @@ +export const getEventNamei18n = event => { + const eventName = event.toUpperCase(); + return `INTEGRATION_SETTINGS.WEBHOOK.FORM.SUBSCRIPTIONS.EVENTS.${eventName}`; +}; diff --git a/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/webhookMixin.js b/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/webhookMixin.js deleted file mode 100644 index 38283fe90..000000000 --- a/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhooks/webhookMixin.js +++ /dev/null @@ -1,10 +0,0 @@ -export default { - methods: { - getEventLabel(event) { - const eventName = event.toUpperCase(); - return this.$t( - `INTEGRATION_SETTINGS.WEBHOOK.FORM.SUBSCRIPTIONS.EVENTS.${eventName}` - ); - }, - }, -}; diff --git a/app/javascript/dashboard/routes/dashboard/settings/integrations/integrations.routes.js b/app/javascript/dashboard/routes/dashboard/settings/integrations/integrations.routes.js index c4d319173..8a4937dd4 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/integrations/integrations.routes.js +++ b/app/javascript/dashboard/routes/dashboard/settings/integrations/integrations.routes.js @@ -30,6 +30,14 @@ export default { permissions: ['administrator'], }, }, + { + path: 'webhook', + component: Webhook, + name: 'settings_integrations_webhook', + meta: { + permissions: ['administrator'], + }, + }, ], }, { @@ -49,14 +57,6 @@ export default { }; }, children: [ - { - path: 'webhook', - component: Webhook, - name: 'settings_integrations_webhook', - meta: { - permissions: ['administrator'], - }, - }, { path: 'slack', name: 'settings_integrations_slack', From 3a0e68030ae3eacee41c225fe79ef290db4d6a36 Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Thu, 29 Aug 2024 18:10:13 -0700 Subject: [PATCH 6/6] chore: [Snyk] Fix for 1 vulnerabilities (#10038) fix for vulnerabilties ------ Co-authored-by: snyk-bot --- Gemfile | 4 ++-- Gemfile.lock | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Gemfile b/Gemfile index a0624fee4..4044c9b66 100644 --- a/Gemfile +++ b/Gemfile @@ -96,12 +96,12 @@ gem 'koala' # slack client gem 'slack-ruby-client', '~> 2.2.0' # for dialogflow integrations -gem 'google-cloud-dialogflow-v2' +gem 'google-cloud-dialogflow-v2', '>= 0.24.0' gem 'grpc' # Translate integrations # 'google-cloud-translate' gem depends on faraday 2.0 version # this dependency breaks the slack-ruby-client gem -gem 'google-cloud-translate-v3' +gem 'google-cloud-translate-v3', '>= 0.7.0' ##-- apm and error monitoring ---# # loaded only when environment variables are set. diff --git a/Gemfile.lock b/Gemfile.lock index 06f479659..46a766b4c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -257,7 +257,7 @@ GEM faraday-net_http_persistent (2.1.0) faraday (~> 2.5) net-http-persistent (~> 4.0) - faraday-retry (2.1.0) + faraday-retry (2.2.1) faraday (~> 2.0) fcm (1.0.8) faraday (>= 1.0.0, < 3.0) @@ -271,7 +271,7 @@ GEM fugit (1.11.1) et-orbi (~> 1, >= 1.2.11) raabro (~> 1.4) - gapic-common (0.18.0) + gapic-common (0.20.0) faraday (>= 1.9, < 3.a) faraday-retry (>= 1.0, < 3.a) google-protobuf (~> 3.14) @@ -301,15 +301,15 @@ GEM google-cloud-core (1.6.0) google-cloud-env (~> 1.0) google-cloud-errors (~> 1.0) - google-cloud-dialogflow-v2 (0.23.0) - gapic-common (>= 0.18.0, < 2.a) + google-cloud-dialogflow-v2 (0.31.0) + gapic-common (>= 0.20.0, < 2.a) google-cloud-errors (~> 1.0) google-cloud-location (>= 0.4, < 2.a) google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) google-cloud-errors (1.3.1) - google-cloud-location (0.4.0) - gapic-common (>= 0.17.1, < 2.a) + google-cloud-location (0.6.0) + gapic-common (>= 0.20.0, < 2.a) google-cloud-errors (~> 1.0) google-cloud-storage (1.44.0) addressable (~> 2.8) @@ -319,17 +319,17 @@ GEM google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - google-cloud-translate-v3 (0.6.0) - gapic-common (>= 0.17.1, < 2.a) + google-cloud-translate-v3 (0.10.0) + gapic-common (>= 0.20.0, < 2.a) google-cloud-errors (~> 1.0) google-protobuf (3.25.3) google-protobuf (3.25.3-arm64-darwin) google-protobuf (3.25.3-x86_64-darwin) google-protobuf (3.25.3-x86_64-linux) - googleapis-common-protos (1.4.0) - google-protobuf (~> 3.14) - googleapis-common-protos-types (~> 1.2) - grpc (~> 1.27) + googleapis-common-protos (1.6.0) + google-protobuf (>= 3.18, < 5.a) + googleapis-common-protos-types (~> 1.7) + grpc (~> 1.41) googleapis-common-protos-types (1.14.0) google-protobuf (~> 3.18) googleauth (1.5.2) @@ -881,9 +881,9 @@ DEPENDENCIES foreman geocoder gmail_xoauth - google-cloud-dialogflow-v2 + google-cloud-dialogflow-v2 (>= 0.24.0) google-cloud-storage - google-cloud-translate-v3 + google-cloud-translate-v3 (>= 0.7.0) groupdate grpc haikunator