From dace97b7b0bf50dac68327abf113e1e10689e258 Mon Sep 17 00:00:00 2001 From: Pranav Raj S Date: Mon, 6 Sep 2021 11:42:02 +0530 Subject: [PATCH] feat: Update design - CSAT survey page (#2964) --- app/javascript/survey/components/Feedback.vue | 2 +- app/javascript/survey/components/Rating.vue | 2 +- app/javascript/survey/i18n/locale/en.json | 2 +- app/javascript/survey/views/Response.vue | 40 ++++++++++--------- .../api/v1/models/_csat_survey.json.jbuilder | 1 + 5 files changed, 25 insertions(+), 22 deletions(-) diff --git a/app/javascript/survey/components/Feedback.vue b/app/javascript/survey/components/Feedback.vue index 194233e28..dcba48137 100644 --- a/app/javascript/survey/components/Feedback.vue +++ b/app/javascript/survey/components/Feedback.vue @@ -1,5 +1,5 @@ @@ -55,9 +60,9 @@ import Banner from 'survey/components/Banner'; import configMixin from 'shared/mixins/configMixin'; import { getSurveyDetails, updateSurvey } from 'survey/api/survey'; import alertMixin from 'shared/mixins/alertMixin'; -const BRAND_LOGO = '/brand-assets/logo.svg'; + export default { - name: 'Home', + name: 'Response', components: { Branding, Rating, @@ -82,6 +87,7 @@ export default { feedbackMessage: '', isUpdating: false, logo: '', + inboxName: '', }; }, computed: { @@ -116,9 +122,6 @@ export default { } return this.$t('SURVEY.RATING.SUCCESS_MESSAGE'); }, - surveyDescription() { - return this.isRatingSubmitted ? '' : this.$t('SURVEY.DESCRIPTION'); - }, }, async mounted() { this.getSurveyDetails(); @@ -132,14 +135,12 @@ export default { this.feedbackMessage = message; this.updateSurveyDetails(); }, - imgUrlAlt() { - this.logo = BRAND_LOGO; - }, async getSurveyDetails() { this.isLoading = true; try { const result = await getSurveyDetails({ uuid: this.surveyId }); this.logo = result.data.inbox_avatar_url; + this.inboxName = result.data.inbox_name; this.surveyDetails = result?.data?.csat_survey_response; this.selectedRating = this.surveyDetails?.rating; this.feedbackMessage = this.surveyDetails?.feedback_message || ''; @@ -184,7 +185,8 @@ export default { diff --git a/app/views/public/api/v1/models/_csat_survey.json.jbuilder b/app/views/public/api/v1/models/_csat_survey.json.jbuilder index f11dd61a6..853c41cf5 100644 --- a/app/views/public/api/v1/models/_csat_survey.json.jbuilder +++ b/app/views/public/api/v1/models/_csat_survey.json.jbuilder @@ -1,5 +1,6 @@ json.id resource.id json.csat_survey_response resource.csat_survey_response json.inbox_avatar_url resource.inbox.avatar_url +json.inbox_name resource.inbox.name json.conversation_id resource.conversation_id json.created_at resource.created_at