From b7336eca65dd4acf1d642a2cb73db76286d1c46f Mon Sep 17 00:00:00 2001 From: Tejaswini Chile Date: Wed, 15 Dec 2021 17:31:16 +0530 Subject: [PATCH 01/11] Fix: Add max retries for all jobs (#3582) --- Gemfile.lock | 124 +++++++++++----------- app/jobs/inboxes/fetch_imap_emails_job.rb | 2 + app/workers/email_reply_worker.rb | 2 +- config/schedule.yml | 4 +- config/sidekiq.yml | 3 +- 5 files changed, 69 insertions(+), 66 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b319c9103..9e90995a1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,63 +9,63 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (6.1.4.1) - actionpack (= 6.1.4.1) - activesupport (= 6.1.4.1) + actioncable (6.1.4.3) + actionpack (= 6.1.4.3) + activesupport (= 6.1.4.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.4.1) - actionpack (= 6.1.4.1) - activejob (= 6.1.4.1) - activerecord (= 6.1.4.1) - activestorage (= 6.1.4.1) - activesupport (= 6.1.4.1) + actionmailbox (6.1.4.3) + actionpack (= 6.1.4.3) + activejob (= 6.1.4.3) + activerecord (= 6.1.4.3) + activestorage (= 6.1.4.3) + activesupport (= 6.1.4.3) mail (>= 2.7.1) - actionmailer (6.1.4.1) - actionpack (= 6.1.4.1) - actionview (= 6.1.4.1) - activejob (= 6.1.4.1) - activesupport (= 6.1.4.1) + actionmailer (6.1.4.3) + actionpack (= 6.1.4.3) + actionview (= 6.1.4.3) + activejob (= 6.1.4.3) + activesupport (= 6.1.4.3) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.4.1) - actionview (= 6.1.4.1) - activesupport (= 6.1.4.1) + actionpack (6.1.4.3) + actionview (= 6.1.4.3) + activesupport (= 6.1.4.3) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.4.1) - actionpack (= 6.1.4.1) - activerecord (= 6.1.4.1) - activestorage (= 6.1.4.1) - activesupport (= 6.1.4.1) + actiontext (6.1.4.3) + actionpack (= 6.1.4.3) + activerecord (= 6.1.4.3) + activestorage (= 6.1.4.3) + activesupport (= 6.1.4.3) nokogiri (>= 1.8.5) - actionview (6.1.4.1) - activesupport (= 6.1.4.1) + actionview (6.1.4.3) + activesupport (= 6.1.4.3) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) active_record_query_trace (1.8) - activejob (6.1.4.1) - activesupport (= 6.1.4.1) + activejob (6.1.4.3) + activesupport (= 6.1.4.3) globalid (>= 0.3.6) - activemodel (6.1.4.1) - activesupport (= 6.1.4.1) - activerecord (6.1.4.1) - activemodel (= 6.1.4.1) - activesupport (= 6.1.4.1) + activemodel (6.1.4.3) + activesupport (= 6.1.4.3) + activerecord (6.1.4.3) + activemodel (= 6.1.4.3) + activesupport (= 6.1.4.3) activerecord-import (1.2.0) activerecord (>= 3.2) - activestorage (6.1.4.1) - actionpack (= 6.1.4.1) - activejob (= 6.1.4.1) - activerecord (= 6.1.4.1) - activesupport (= 6.1.4.1) + activestorage (6.1.4.3) + actionpack (= 6.1.4.3) + activejob (= 6.1.4.3) + activerecord (= 6.1.4.3) + activesupport (= 6.1.4.3) marcel (~> 1.0.0) mini_mime (>= 1.1.0) - activesupport (6.1.4.1) + activesupport (6.1.4.3) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -219,7 +219,7 @@ GEM grpc (~> 1.25) geocoder (1.7.0) gli (2.20.1) - globalid (0.5.2) + globalid (1.0.0) activesupport (>= 5.0) google-apis-core (0.4.1) addressable (~> 2.5, >= 2.5.1) @@ -297,7 +297,7 @@ GEM mime-types (~> 3.0) multi_xml (>= 0.5.2) httpclient (2.8.3) - i18n (1.8.10) + i18n (1.8.11) concurrent-ruby (~> 1.0) image_processing (1.12.1) mini_magick (>= 4.9.5, < 5) @@ -343,7 +343,7 @@ GEM listen (3.7.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.12.0) + loofah (2.13.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) @@ -358,7 +358,7 @@ GEM mini_magick (4.11.0) mini_mime (1.1.2) mini_portile2 (2.5.3) - minitest (5.14.4) + minitest (5.15.0) mock_redis (0.29.0) ruby2_keywords momentjs-rails (2.20.1) @@ -402,7 +402,7 @@ GEM pundit (2.1.1) activesupport (>= 3.0.0) raabro (1.4.0) - racc (1.5.2) + racc (1.6.0) rack (2.2.3) rack-attack (6.5.0) rack (>= 1.0, < 3) @@ -413,29 +413,29 @@ GEM rack-test (1.1.0) rack (>= 1.0, < 3) rack-timeout (0.6.0) - rails (6.1.4.1) - actioncable (= 6.1.4.1) - actionmailbox (= 6.1.4.1) - actionmailer (= 6.1.4.1) - actionpack (= 6.1.4.1) - actiontext (= 6.1.4.1) - actionview (= 6.1.4.1) - activejob (= 6.1.4.1) - activemodel (= 6.1.4.1) - activerecord (= 6.1.4.1) - activestorage (= 6.1.4.1) - activesupport (= 6.1.4.1) + rails (6.1.4.3) + actioncable (= 6.1.4.3) + actionmailbox (= 6.1.4.3) + actionmailer (= 6.1.4.3) + actionpack (= 6.1.4.3) + actiontext (= 6.1.4.3) + actionview (= 6.1.4.3) + activejob (= 6.1.4.3) + activemodel (= 6.1.4.3) + activerecord (= 6.1.4.3) + activestorage (= 6.1.4.3) + activesupport (= 6.1.4.3) bundler (>= 1.15.0) - railties (= 6.1.4.1) + railties (= 6.1.4.3) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.4.2) loofah (~> 2.3) - railties (6.1.4.1) - actionpack (= 6.1.4.1) - activesupport (= 6.1.4.1) + railties (6.1.4.3) + actionpack (= 6.1.4.3) + activesupport (= 6.1.4.3) method_source rake (>= 0.13) thor (~> 1.0) @@ -573,9 +573,9 @@ GEM sprockets (4.0.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) sprockets (>= 3.0.0) squasher (0.6.2) statsd-ruby (1.5.0) @@ -632,7 +632,7 @@ GEM websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) wisper (2.0.0) - zeitwerk (2.4.2) + zeitwerk (2.5.1) PLATFORMS arm64-darwin-20 diff --git a/app/jobs/inboxes/fetch_imap_emails_job.rb b/app/jobs/inboxes/fetch_imap_emails_job.rb index fa18e6599..3c15ed005 100644 --- a/app/jobs/inboxes/fetch_imap_emails_job.rb +++ b/app/jobs/inboxes/fetch_imap_emails_job.rb @@ -2,6 +2,8 @@ class Inboxes::FetchImapEmailsJob < ApplicationJob queue_as :low def perform(channel) + return unless channel.imap_enabled? + Mail.defaults do retriever_method :imap, address: channel.imap_address, port: channel.imap_port, diff --git a/app/workers/email_reply_worker.rb b/app/workers/email_reply_worker.rb index 1dc3c704b..79e7eb161 100644 --- a/app/workers/email_reply_worker.rb +++ b/app/workers/email_reply_worker.rb @@ -1,6 +1,6 @@ class EmailReplyWorker include Sidekiq::Worker - sidekiq_options queue: :mailers + sidekiq_options queue: :mailers, retry: 3 def perform(message_id) message = Message.find(message_id) diff --git a/config/schedule.yml b/config/schedule.yml index f0910ace4..156a19787 100644 --- a/config/schedule.yml +++ b/config/schedule.yml @@ -14,8 +14,8 @@ trigger_scheduled_items_job: class: 'TriggerScheduledItemsJob' queue: scheduled_jobs -# executed At every minute. +# executed At every 5th minute.. trigger_imap_email_inboxes_job: - cron: '*/1 * * * *' + cron: '*/5 * * * *' class: 'Inboxes::FetchImapEmailInboxesJob' queue: scheduled_jobs diff --git a/config/sidekiq.yml b/config/sidekiq.yml index c158e7202..2c6d89933 100644 --- a/config/sidekiq.yml +++ b/config/sidekiq.yml @@ -6,6 +6,7 @@ :verbose: false :concurrency: 5 :timeout: 25 +:max_retries: 3 # Sidekiq will run this file through ERB when reading it so you can # even put in dynamic logic, like a host-specific queue. @@ -25,7 +26,7 @@ - [action_mailbox_routing, 3] - [high, 5] - [critical, 10] - + # you can override concurrency based on environment production: :concurrency: 10 From e2e459a1acba53d2acf70068cfefc420471e3f27 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Wed, 15 Dec 2021 19:12:11 +0530 Subject: [PATCH 02/11] bug: Fixes space missing issue with message bubbles after sending messages (#3562) --- .../dashboard/assets/scss/widgets/_conversation-view.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/dashboard/assets/scss/widgets/_conversation-view.scss b/app/javascript/dashboard/assets/scss/widgets/_conversation-view.scss index 39cf6ad54..1be9e31e0 100644 --- a/app/javascript/dashboard/assets/scss/widgets/_conversation-view.scss +++ b/app/javascript/dashboard/assets/scss/widgets/_conversation-view.scss @@ -135,7 +135,7 @@ &.unread--toast { +.right { - margin-bottom: 0; + margin-bottom: var(--space-micro); } +.left { From 9984edd3ef357af8df8d61357910cdc02b2af477 Mon Sep 17 00:00:00 2001 From: Tejaswini Chile Date: Thu, 16 Dec 2021 00:24:50 +0530 Subject: [PATCH 03/11] Feat: Manage conversation for tweets based on the tweet flag (#3353) Add tweet conversation only if tweets are enabled. Fixes #1961 --- .../api/v1/accounts/inboxes_controller.rb | 15 +----------- .../dashboard/i18n/locale/en/inboxMgmt.json | 5 +++- .../dashboard/settings/inbox/Settings.vue | 11 +++++++++ app/models/channel/twitter_profile.rb | 3 +++ app/models/inbox.rb | 4 ++++ app/services/twitter/tweet_parser_service.rb | 7 +++++- app/views/api/v1/models/_inbox.json.jbuilder | 2 ++ ...d_tweet_enabled_flag_to_twitter_channel.rb | 5 ++++ db/schema.rb | 1 + lib/webhooks/twitter.rb | 1 + .../v1/accounts/inboxes_controller_spec.rb | 13 +++++++++++ spec/lib/webhooks/twitter_spec.rb | 23 ++++++++++++++++++- 12 files changed, 73 insertions(+), 17 deletions(-) create mode 100644 db/migrate/20211109143122_add_tweet_enabled_flag_to_twitter_channel.rb diff --git a/app/controllers/api/v1/accounts/inboxes_controller.rb b/app/controllers/api/v1/accounts/inboxes_controller.rb index 0c80d9983..463a08bfb 100644 --- a/app/controllers/api/v1/accounts/inboxes_controller.rb +++ b/app/controllers/api/v1/accounts/inboxes_controller.rb @@ -124,19 +124,6 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController end def get_channel_attributes(channel_type) - case channel_type - when 'Channel::WebWidget' - Channel::WebWidget::EDITABLE_ATTRS - when 'Channel::Api' - Channel::Api::EDITABLE_ATTRS - when 'Channel::Email' - Channel::Email::EDITABLE_ATTRS - when 'Channel::Telegram' - Channel::Telegram::EDITABLE_ATTRS - when 'Channel::Line' - Channel::Line::EDITABLE_ATTRS - else - [] - end + channel_type.constantize::EDITABLE_ATTRS.presence || [] end end diff --git a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json index 774c8160d..b64362027 100644 --- a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json +++ b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json @@ -47,7 +47,10 @@ }, "TWITTER": { "HELP": "To add your Twitter profile as a channel, you need to authenticate your Twitter Profile by clicking on 'Sign in with Twitter' ", - "ERROR_MESSAGE": "There was an error connecting to Twitter, please try again" + "ERROR_MESSAGE": "There was an error connecting to Twitter, please try again", + "TWEETS": { + "ENABLE": "Create conversations from mentioned Tweets" + } }, "WEBSITE_CHANNEL": { "TITLE": "Website channel", diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue index 7c8db94d5..ac54dac85 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue @@ -32,6 +32,14 @@ :label="inboxNameLabel" :placeholder="inboxNamePlaceHolder" /> + Date: Thu, 16 Dec 2021 13:00:55 +0530 Subject: [PATCH 04/11] enhancement: Changes button design for tables in settings page (#3553) * enhancement: Changes button design for tables in settings page * Minor fixes * Review fixes --- .../assets/scss/_foundation-custom.scss | 2 +- .../routes/dashboard/settings/agents/Index.vue | 12 +++++++----- .../settings/attributes/CustomAttribute.vue | 12 +++++++----- .../routes/dashboard/settings/canned/Index.vue | 13 +++++++------ .../routes/dashboard/settings/inbox/Index.vue | 12 +++++++----- .../integrationapps/MultipleIntegrationHooks.vue | 7 ++++--- .../dashboard/settings/integrations/Webhook.vue | 16 +++++++++++----- .../routes/dashboard/settings/labels/Index.vue | 12 +++++++----- .../routes/dashboard/settings/teams/Index.vue | 12 +++++++----- 9 files changed, 58 insertions(+), 40 deletions(-) diff --git a/app/javascript/dashboard/assets/scss/_foundation-custom.scss b/app/javascript/dashboard/assets/scss/_foundation-custom.scss index 1cfd002cf..3b7eca0f7 100644 --- a/app/javascript/dashboard/assets/scss/_foundation-custom.scss +++ b/app/javascript/dashboard/assets/scss/_foundation-custom.scss @@ -12,7 +12,7 @@ padding: var(--space-normal); } -.button-wrapper .button.link.grey-btn { +.button-wrapper .button.grey-btn { margin-left: var(--space-normal); } diff --git a/app/javascript/dashboard/routes/dashboard/settings/agents/Index.vue b/app/javascript/dashboard/routes/dashboard/settings/agents/Index.vue index 307fe9c7d..c3a75b0f6 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/agents/Index.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/agents/Index.vue @@ -57,24 +57,26 @@
- {{ $t('AGENT_MGMT.EDIT.BUTTON_TEXT') }} - {{ $t('AGENT_MGMT.DELETE.BUTTON_TEXT') }}
diff --git a/app/javascript/dashboard/routes/dashboard/settings/attributes/CustomAttribute.vue b/app/javascript/dashboard/routes/dashboard/settings/attributes/CustomAttribute.vue index 62e79a2c1..1153490a9 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/attributes/CustomAttribute.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/attributes/CustomAttribute.vue @@ -50,22 +50,24 @@ - {{ $t('ATTRIBUTES_MGMT.LIST.BUTTONS.EDIT') }} - {{ $t('ATTRIBUTES_MGMT.LIST.BUTTONS.DELETE') }} diff --git a/app/javascript/dashboard/routes/dashboard/settings/canned/Index.vue b/app/javascript/dashboard/routes/dashboard/settings/canned/Index.vue index 83adcd099..29e388e6c 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/canned/Index.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/canned/Index.vue @@ -50,23 +50,24 @@ - {{ $t('CANNED_MGMT.EDIT.BUTTON_TEXT') }} - {{ $t('CANNED_MGMT.DELETE.BUTTON_TEXT') }} diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/Index.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/Index.vue index c53f69701..07edeee15 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/inbox/Index.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/Index.vue @@ -68,25 +68,27 @@ > - {{ $t('INBOX_MGMT.SETTINGS') }} - {{ $t('INBOX_MGMT.DELETE.BUTTON_TEXT') }} diff --git a/app/javascript/dashboard/routes/dashboard/settings/integrationapps/MultipleIntegrationHooks.vue b/app/javascript/dashboard/routes/dashboard/settings/integrationapps/MultipleIntegrationHooks.vue index 085ce63eb..c19f52793 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/integrationapps/MultipleIntegrationHooks.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/integrationapps/MultipleIntegrationHooks.vue @@ -24,13 +24,14 @@ - {{ $t('INTEGRATION_APPS.LIST.DELETE.BUTTON_TEXT') }} diff --git a/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhook.vue b/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhook.vue index 38e198cee..2c489585c 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhook.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/integrations/Webhook.vue @@ -43,20 +43,26 @@ - {{ $t('INTEGRATION_SETTINGS.WEBHOOK.EDIT.BUTTON_TEXT') }} - {{ $t('INTEGRATION_SETTINGS.WEBHOOK.DELETE.BUTTON_TEXT') }} diff --git a/app/javascript/dashboard/routes/dashboard/settings/labels/Index.vue b/app/javascript/dashboard/routes/dashboard/settings/labels/Index.vue index 712d801e7..19fde4428 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/labels/Index.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/labels/Index.vue @@ -44,24 +44,26 @@ - {{ $t('LABEL_MGMT.FORM.EDIT') }} - {{ $t('LABEL_MGMT.FORM.DELETE') }} diff --git a/app/javascript/dashboard/routes/dashboard/settings/teams/Index.vue b/app/javascript/dashboard/routes/dashboard/settings/teams/Index.vue index f55169672..5eefe008f 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/teams/Index.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/teams/Index.vue @@ -27,24 +27,26 @@ > - {{ $t('TEAMS_SETTINGS.LIST.EDIT_TEAM') }} - {{ $t('TEAMS_SETTINGS.DELETE.BUTTON_TEXT') }} From e0c9687f5ec1bb99100f899906a03c49d553e2f2 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Thu, 16 Dec 2021 13:20:35 +0530 Subject: [PATCH 05/11] bug: Fixes irregular padding on agent selector in report page (#3593) * bug: Fixes irregular padding on agent selector in report page * code climate fixes --- .../dashboard/assets/scss/plugins/_multiselect.scss | 4 ++++ .../dashboard/assets/scss/widgets/_reports.scss | 3 ++- .../settings/reports/components/ReportFilters.vue | 8 ++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/javascript/dashboard/assets/scss/plugins/_multiselect.scss b/app/javascript/dashboard/assets/scss/plugins/_multiselect.scss index e97792b97..deba11150 100644 --- a/app/javascript/dashboard/assets/scss/plugins/_multiselect.scss +++ b/app/javascript/dashboard/assets/scss/plugins/_multiselect.scss @@ -51,6 +51,10 @@ width: 100%; } + p { + margin-bottom: 0; + } + &.multiselect__option--highlight { background: var(--white); color: var(--color-body); diff --git a/app/javascript/dashboard/assets/scss/widgets/_reports.scss b/app/javascript/dashboard/assets/scss/widgets/_reports.scss index eeb958ff3..bbd03ce9f 100644 --- a/app/javascript/dashboard/assets/scss/widgets/_reports.scss +++ b/app/javascript/dashboard/assets/scss/widgets/_reports.scss @@ -21,6 +21,7 @@ border: 1px solid var(--color-border); } -.display-flex { +.reports-option__wrap { + align-items: center; display: flex; } diff --git a/app/javascript/dashboard/routes/dashboard/settings/reports/components/ReportFilters.vue b/app/javascript/dashboard/routes/dashboard/settings/reports/components/ReportFilters.vue index a2f459734..46071f450 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/reports/components/ReportFilters.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/reports/components/ReportFilters.vue @@ -15,7 +15,7 @@ @input="changeFilterSelection" >