Skip to content

Commit

Permalink
feat: Enable/disable CSAT in web widget settings (#2531)
Browse files Browse the repository at this point in the history
  • Loading branch information
muhsin-k committed Jul 5, 2021
1 parent abda86f commit 48127e0
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/api/v1/accounts/inboxes_controller.rb
Expand Up @@ -88,12 +88,12 @@ def update_channel_feature_flags
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,
Expand Down
6 changes: 6 additions & 0 deletions app/javascript/dashboard/i18n/locale/en/inboxMgmt.json
Expand Up @@ -216,6 +216,10 @@
"EMAIL_COLLECT_BOX": {
"ENABLED": "Enabled",
"DISABLED": "Disabled"
},
"ENABLE_CSAT": {
"ENABLED": "Enabled",
"DISABLED": "Disabled"
}
},
"DELETE": {
Expand Down Expand Up @@ -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.",
Expand Down
Expand Up @@ -170,6 +170,21 @@
</p>
</label>

<label v-if="isAWebWidgetInbox" class="medium-9 columns">
{{ $t('INBOX_MGMT.SETTINGS_POPUP.ENABLE_CSAT') }}
<select v-model="csatSurveyEnabled">
<option :value="true">
{{ $t('INBOX_MGMT.EDIT.ENABLE_CSAT.ENABLED') }}
</option>
<option :value="false">
{{ $t('INBOX_MGMT.EDIT.ENABLE_CSAT.DISABLED') }}
</option>
</select>
<p class="help-text">
{{ $t('INBOX_MGMT.SETTINGS_POPUP.ENABLE_CSAT_SUB_TEXT') }}
</p>
</label>

<label v-if="isAWebWidgetInbox">
{{ $t('INBOX_MGMT.FEATURES.LABEL') }}
</label>
Expand Down Expand Up @@ -310,6 +325,7 @@ export default {
autoAssignment: false,
emailCollectEnabled: false,
isAgentListUpdating: false,
csatSurveyEnabled: false,
selectedInboxName: '',
channelWebsiteUrl: '',
channelWelcomeTitle: '',
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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: {
Expand Down
1 change: 1 addition & 0 deletions app/views/api/v1/models/_inbox.json.jbuilder
Expand Up @@ -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)
Expand Down

0 comments on commit 48127e0

Please sign in to comment.