diff --git a/app/javascript/dashboard/api/csatReports.js b/app/javascript/dashboard/api/csatReports.js index 46d5decd4..2d3ce12e5 100644 --- a/app/javascript/dashboard/api/csatReports.js +++ b/app/javascript/dashboard/api/csatReports.js @@ -35,10 +35,10 @@ class CSATReportsAPI extends ApiClient { }); } - getMetrics({ from, to, user_ids, inbox_id, team_id } = {}) { + getMetrics({ from, to, user_ids, inbox_id, team_id, rating } = {}) { // no ratings for metrics return axios.get(`${this.url}/metrics`, { - params: { since: from, until: to, user_ids, inbox_id, team_id }, + params: { since: from, until: to, user_ids, inbox_id, team_id, rating }, }); } } diff --git a/app/javascript/dashboard/routes/dashboard/settings/reports/CsatResponses.vue b/app/javascript/dashboard/routes/dashboard/settings/reports/CsatResponses.vue index 501dc5a7c..7d29fc8d9 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/reports/CsatResponses.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/reports/CsatResponses.vue @@ -16,7 +16,7 @@ > {{ $t('CSAT_REPORTS.DOWNLOAD') }} - + diff --git a/app/javascript/dashboard/routes/dashboard/settings/reports/Index.vue b/app/javascript/dashboard/routes/dashboard/settings/reports/Index.vue index 0d9d00003..d38e983a7 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/reports/Index.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/reports/Index.vue @@ -92,7 +92,7 @@ export default { } if (!this.accountReport.data.length) return {}; const labels = this.accountReport.data.map(element => { - if (this.groupBy.period === GROUP_BY_FILTER[2].period) { + if (this.groupBy?.period === GROUP_BY_FILTER[2].period) { let week_date = new Date(fromUnixTime(element.timestamp)); const first_day = week_date.getDate() - week_date.getDay(); const last_day = first_day + 6; @@ -105,10 +105,10 @@ export default { 'dd/MM/yy' )}`; } - if (this.groupBy.period === GROUP_BY_FILTER[3].period) { + if (this.groupBy?.period === GROUP_BY_FILTER[3].period) { return format(fromUnixTime(element.timestamp), 'MMM-yyyy'); } - if (this.groupBy.period === GROUP_BY_FILTER[4].period) { + if (this.groupBy?.period === GROUP_BY_FILTER[4].period) { return format(fromUnixTime(element.timestamp), 'yyyy'); } return format(fromUnixTime(element.timestamp), 'dd-MMM-yyyy'); @@ -213,7 +213,7 @@ export default { return { from, to, - groupBy: groupBy.period, + groupBy: groupBy?.period, businessHours, }; }, diff --git a/app/javascript/dashboard/routes/dashboard/settings/reports/components/CsatMetricCard.vue b/app/javascript/dashboard/routes/dashboard/settings/reports/components/CsatMetricCard.vue index 1846d1549..7bee6765f 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/reports/components/CsatMetricCard.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/reports/components/CsatMetricCard.vue @@ -1,5 +1,10 @@