feat: Add report on customer waiting time (#7545)
This commit is contained in:
@@ -35,6 +35,7 @@ const REPORTS_KEYS = {
|
||||
FIRST_RESPONSE_TIME: 'avg_first_response_time',
|
||||
RESOLUTION_TIME: 'avg_resolution_time',
|
||||
RESOLUTION_COUNT: 'resolutions_count',
|
||||
REPLY_TIME: 'reply_time',
|
||||
};
|
||||
|
||||
export default {
|
||||
@@ -78,6 +79,7 @@ export default {
|
||||
'FIRST_RESPONSE_TIME',
|
||||
'RESOLUTION_TIME',
|
||||
'RESOLUTION_COUNT',
|
||||
'REPLY_TIME',
|
||||
].forEach(async key => {
|
||||
try {
|
||||
await this.$store.dispatch('fetchAccountReport', {
|
||||
|
||||
@@ -44,6 +44,7 @@ const REPORTS_KEYS = {
|
||||
FIRST_RESPONSE_TIME: 'avg_first_response_time',
|
||||
RESOLUTION_TIME: 'avg_resolution_time',
|
||||
RESOLUTION_COUNT: 'resolutions_count',
|
||||
REPLY_TIME: 'reply_time',
|
||||
};
|
||||
|
||||
export default {
|
||||
@@ -60,6 +61,7 @@ export default {
|
||||
const reportKeys = [
|
||||
'CONVERSATIONS',
|
||||
'FIRST_RESPONSE_TIME',
|
||||
'REPLY_TIME',
|
||||
'RESOLUTION_TIME',
|
||||
'RESOLUTION_COUNT',
|
||||
'INCOMING_MESSAGES',
|
||||
|
||||
@@ -38,6 +38,7 @@ const REPORTS_KEYS = {
|
||||
FIRST_RESPONSE_TIME: 'avg_first_response_time',
|
||||
RESOLUTION_TIME: 'avg_resolution_time',
|
||||
RESOLUTION_COUNT: 'resolutions_count',
|
||||
REPLY_TIME: 'reply_time',
|
||||
};
|
||||
|
||||
export default {
|
||||
@@ -106,6 +107,7 @@ export default {
|
||||
'FIRST_RESPONSE_TIME',
|
||||
'RESOLUTION_TIME',
|
||||
'RESOLUTION_COUNT',
|
||||
'REPLY_TIME',
|
||||
].forEach(async key => {
|
||||
try {
|
||||
const { from, to, groupBy, businessHours } = this;
|
||||
|
||||
@@ -151,78 +151,48 @@ export const DEFAULT_CHART = {
|
||||
},
|
||||
};
|
||||
|
||||
const TIME_CHART_CONFIG = {
|
||||
datasets: [DEFAULT_BAR_CHART],
|
||||
scales: {
|
||||
xAxes: [
|
||||
{
|
||||
ticks: {
|
||||
fontFamily: CHART_FONT_FAMILY,
|
||||
},
|
||||
gridLines: {
|
||||
drawOnChartArea: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
yAxes: [
|
||||
{
|
||||
id: 'y-left',
|
||||
type: 'linear',
|
||||
position: 'left',
|
||||
ticks: {
|
||||
fontFamily: CHART_FONT_FAMILY,
|
||||
callback: (value, index, values) => {
|
||||
if (!index || index === values.length - 1) {
|
||||
return formatTime(value);
|
||||
}
|
||||
return '';
|
||||
},
|
||||
},
|
||||
gridLines: {
|
||||
drawOnChartArea: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const METRIC_CHART = {
|
||||
conversations_count: DEFAULT_CHART,
|
||||
incoming_messages_count: DEFAULT_CHART,
|
||||
outgoing_messages_count: DEFAULT_CHART,
|
||||
avg_first_response_time: {
|
||||
datasets: [DEFAULT_BAR_CHART],
|
||||
scales: {
|
||||
xAxes: [
|
||||
{
|
||||
ticks: {
|
||||
fontFamily: CHART_FONT_FAMILY,
|
||||
},
|
||||
gridLines: {
|
||||
drawOnChartArea: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
yAxes: [
|
||||
{
|
||||
id: 'y-left',
|
||||
type: 'linear',
|
||||
position: 'left',
|
||||
ticks: {
|
||||
fontFamily: CHART_FONT_FAMILY,
|
||||
callback: (value, index, values) => {
|
||||
if (!index || index === values.length - 1) {
|
||||
return formatTime(value);
|
||||
}
|
||||
return '';
|
||||
},
|
||||
},
|
||||
gridLines: {
|
||||
drawOnChartArea: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
avg_resolution_time: {
|
||||
datasets: [DEFAULT_BAR_CHART],
|
||||
scales: {
|
||||
xAxes: [
|
||||
{
|
||||
ticks: {
|
||||
fontFamily: CHART_FONT_FAMILY,
|
||||
},
|
||||
gridLines: {
|
||||
drawOnChartArea: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
yAxes: [
|
||||
{
|
||||
id: 'y-left',
|
||||
type: 'linear',
|
||||
position: 'left',
|
||||
ticks: {
|
||||
fontFamily: CHART_FONT_FAMILY,
|
||||
callback: (value, index, values) => {
|
||||
if (!index || index === values.length - 1) {
|
||||
return formatTime(value);
|
||||
}
|
||||
return '';
|
||||
},
|
||||
},
|
||||
gridLines: {
|
||||
drawOnChartArea: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
avg_first_response_time: TIME_CHART_CONFIG,
|
||||
reply_time: TIME_CHART_CONFIG,
|
||||
avg_resolution_time: TIME_CHART_CONFIG,
|
||||
resolutions_count: DEFAULT_CHART,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user