From 48127e00d7a27919831707f4a4883299b4f482ba Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Mon, 5 Jul 2021 11:07:02 +0530 Subject: [PATCH] feat: Enable/disable CSAT in web widget settings (#2531) --- .../api/v1/accounts/inboxes_controller.rb | 4 ++-- .../dashboard/i18n/locale/en/inboxMgmt.json | 6 ++++++ .../dashboard/settings/inbox/Settings.vue | 18 ++++++++++++++++++ app/views/api/v1/models/_inbox.json.jbuilder | 1 + 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/v1/accounts/inboxes_controller.rb b/app/controllers/api/v1/accounts/inboxes_controller.rb index a51681617..2621a4a33 100644 --- a/app/controllers/api/v1/accounts/inboxes_controller.rb +++ b/app/controllers/api/v1/accounts/inboxes_controller.rb @@ -88,12 +88,12 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController end def permitted_params - params.permit(:id, :avatar, :name, :greeting_message, :greeting_enabled, :enable_email_collect, channel: + params.permit(:id, :avatar, :name, :greeting_message, :greeting_enabled, :enable_email_collect, :csat_survey_enabled, channel: [:type, :website_url, :widget_color, :welcome_title, :welcome_tagline, :webhook_url, :email, :reply_time]) end def inbox_update_params - params.permit(:enable_auto_assignment, :enable_email_collect, :name, :avatar, :greeting_message, :greeting_enabled, + params.permit(:enable_auto_assignment, :enable_email_collect, :name, :avatar, :greeting_message, :greeting_enabled, :csat_survey_enabled, :working_hours_enabled, :out_of_office_message, :timezone, channel: [ :website_url, diff --git a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json index 8948adfc4..24463aac8 100644 --- a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json +++ b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json @@ -216,6 +216,10 @@ "EMAIL_COLLECT_BOX": { "ENABLED": "Enabled", "DISABLED": "Disabled" + }, + "ENABLE_CSAT": { + "ENABLED": "Enabled", + "DISABLED": "Disabled" } }, "DELETE": { @@ -255,6 +259,8 @@ "ENABLE_EMAIL_COLLECT_BOX": "Enable email collect box", "ENABLE_EMAIL_COLLECT_BOX_SUB_TEXT": "Enable or disable email collect box on new conversation", "AUTO_ASSIGNMENT": "Enable auto assignment", + "ENABLE_CSAT": "Enable CSAT", + "ENABLE_CSAT_SUB_TEXT": "Enable/Disable CSAT(Customer satisfaction) survey after resolving a conversation", "INBOX_UPDATE_TITLE": "Inbox Settings", "INBOX_UPDATE_SUB_TEXT": "Update your inbox settings", "AUTO_ASSIGNMENT_SUB_TEXT": "Enable or disable the automatic assignment of new conversations to the agents added to this inbox.", diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue index e44f75eb4..2515a81a8 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue @@ -170,6 +170,21 @@

+ + @@ -310,6 +325,7 @@ export default { autoAssignment: false, emailCollectEnabled: false, isAgentListUpdating: false, + csatSurveyEnabled: false, selectedInboxName: '', channelWebsiteUrl: '', channelWelcomeTitle: '', @@ -451,6 +467,7 @@ export default { this.greetingMessage = this.inbox.greeting_message; this.autoAssignment = this.inbox.enable_auto_assignment; this.emailCollectEnabled = this.inbox.enable_email_collect; + this.csatSurveyEnabled = this.inbox.csat_survey_enabled; this.channelWebsiteUrl = this.inbox.website_url; this.channelWelcomeTitle = this.inbox.welcome_title; this.channelWelcomeTagline = this.inbox.welcome_tagline; @@ -492,6 +509,7 @@ export default { name: this.selectedInboxName, enable_auto_assignment: this.autoAssignment, enable_email_collect: this.emailCollectEnabled, + csat_survey_enabled: this.csatSurveyEnabled, greeting_enabled: this.greetingEnabled, greeting_message: this.greetingMessage || '', channel: { diff --git a/app/views/api/v1/models/_inbox.json.jbuilder b/app/views/api/v1/models/_inbox.json.jbuilder index 0a4148b53..980ee6941 100644 --- a/app/views/api/v1/models/_inbox.json.jbuilder +++ b/app/views/api/v1/models/_inbox.json.jbuilder @@ -7,6 +7,7 @@ json.greeting_message resource.greeting_message json.working_hours_enabled resource.working_hours_enabled json.enable_email_collect resource.enable_email_collect json.out_of_office_message resource.out_of_office_message +json.csat_survey_enabled resource.csat_survey_enabled json.working_hours resource.weekly_schedule json.timezone resource.timezone json.avatar_url resource.try(:avatar_url)