diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 2bb8e9847..107aec56e 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -38,9 +38,12 @@ class DashboardController < ActionController::Base end def app_config - { APP_VERSION: Chatwoot.config[:version], + { + APP_VERSION: Chatwoot.config[:version], VAPID_PUBLIC_KEY: VapidService.public_key, ENABLE_ACCOUNT_SIGNUP: GlobalConfigService.load('ENABLE_ACCOUNT_SIGNUP', 'false'), - FB_APP_ID: GlobalConfigService.load('FB_APP_ID', '') } + FB_APP_ID: GlobalConfigService.load('FB_APP_ID', ''), + FACEBOOK_API_VERSION: 'v13.0' + } end end diff --git a/app/controllers/platform/api/v1/users_controller.rb b/app/controllers/platform/api/v1/users_controller.rb index c9f256c6f..4a7eafc9c 100644 --- a/app/controllers/platform/api/v1/users_controller.rb +++ b/app/controllers/platform/api/v1/users_controller.rb @@ -21,6 +21,10 @@ class Platform::Api::V1::UsersController < PlatformController def update @resource.assign_attributes(user_update_params) + + # We are using devise's reconfirmable flow for changing emails + # But in case of platform APIs we don't want user to go through this extra step + @resource.skip_reconfirmation! if user_update_params[:email].present? @resource.save! end diff --git a/app/helpers/report_helper.rb b/app/helpers/report_helper.rb index 9f37295cb..5fdb34170 100644 --- a/app/helpers/report_helper.rb +++ b/app/helpers/report_helper.rb @@ -17,30 +17,30 @@ module ReportHelper end def conversations_count - (get_grouped_values scope.conversations).count + (get_grouped_values scope.conversations.where(account_id: account.id)).count end def incoming_messages_count - (get_grouped_values scope.messages.incoming.unscope(:order)).count + (get_grouped_values scope.messages.where(account_id: account.id).incoming.unscope(:order)).count end def outgoing_messages_count - (get_grouped_values scope.messages.outgoing.unscope(:order)).count + (get_grouped_values scope.messages.where(account_id: account.id).outgoing.unscope(:order)).count end def resolutions_count - (get_grouped_values scope.conversations.resolved).count + (get_grouped_values scope.conversations.where(account_id: account.id).resolved).count end def avg_first_response_time - grouped_reporting_events = (get_grouped_values scope.reporting_events.where(name: 'first_response')) + grouped_reporting_events = (get_grouped_values scope.reporting_events.where(name: 'first_response', account_id: account.id)) return grouped_reporting_events.average(:value_in_business_hours) if params[:business_hours] grouped_reporting_events.average(:value) end def avg_resolution_time - grouped_reporting_events = (get_grouped_values scope.reporting_events.where(name: 'conversation_resolved')) + grouped_reporting_events = (get_grouped_values scope.reporting_events.where(name: 'conversation_resolved', account_id: account.id)) return grouped_reporting_events.average(:value_in_business_hours) if params[:business_hours] grouped_reporting_events.average(:value) @@ -48,7 +48,7 @@ module ReportHelper def avg_resolution_time_summary reporting_events = scope.reporting_events - .where(name: 'conversation_resolved', created_at: range) + .where(name: 'conversation_resolved', account_id: account.id, created_at: range) avg_rt = params[:business_hours] ? reporting_events.average(:value_in_business_hours) : reporting_events.average(:value) return 0 if avg_rt.blank? @@ -58,7 +58,7 @@ module ReportHelper def avg_first_response_time_summary reporting_events = scope.reporting_events - .where(name: 'first_response', created_at: range) + .where(name: 'first_response', account_id: account.id, created_at: range) avg_frt = params[:business_hours] ? reporting_events.average(:value_in_business_hours) : reporting_events.average(:value) return 0 if avg_frt.blank? diff --git a/app/javascript/dashboard/helper/scriptGenerator.js b/app/javascript/dashboard/helper/scriptGenerator.js deleted file mode 100644 index 5a278d30a..000000000 --- a/app/javascript/dashboard/helper/scriptGenerator.js +++ /dev/null @@ -1,25 +0,0 @@ -export const createMessengerScript = pageId => ` - -
-
-`; diff --git a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json index 218d1cf95..405348058 100644 --- a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json +++ b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json @@ -341,10 +341,6 @@ "AUTO_ASSIGNMENT_SUCCESS_MESSAGE": "Auto assignment updated successfully", "ERROR_MESSAGE": "Could not update widget color. Please try again later." }, - "AUTO_ASSIGNMENT": { - "ENABLED": "Enabled", - "DISABLED": "Disabled" - }, "EMAIL_COLLECT_BOX": { "ENABLED": "Enabled", "DISABLED": "Disabled" @@ -402,6 +398,8 @@ "MESSENGER_SUB_HEAD": "Place this button inside your body tag", "INBOX_AGENTS": "Agents", "INBOX_AGENTS_SUB_TEXT": "Add or remove agents from this inbox", + "AGENT_ASSIGNMENT": "Conversation Assignment", + "AGENT_ASSIGNMENT_SUB_TEXT": "Update conversation assignment settings", "UPDATE": "Update", "ENABLE_EMAIL_COLLECT_BOX": "Enable email collect box", "ENABLE_EMAIL_COLLECT_BOX_SUB_TEXT": "Enable or disable email collect box on new conversation", diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue index 16b6b0f74..344ea218c 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue @@ -189,21 +189,6 @@

- -