fix: missing metrics and labels from label summary (#11718)
This commit is contained in:
@@ -31,7 +31,7 @@ class V2::Reports::LabelSummaryBuilder < V2::Reports::BaseSummaryBuilder
|
|||||||
resolved_counts: fetch_resolved_counts(conversation_filter),
|
resolved_counts: fetch_resolved_counts(conversation_filter),
|
||||||
resolution_metrics: fetch_metrics(conversation_filter, 'conversation_resolved', use_business_hours),
|
resolution_metrics: fetch_metrics(conversation_filter, 'conversation_resolved', use_business_hours),
|
||||||
first_response_metrics: fetch_metrics(conversation_filter, 'first_response', use_business_hours),
|
first_response_metrics: fetch_metrics(conversation_filter, 'first_response', use_business_hours),
|
||||||
reply_metrics: fetch_metrics(conversation_filter, 'reply', use_business_hours)
|
reply_metrics: fetch_metrics(conversation_filter, 'reply_time', use_business_hours)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -63,7 +63,9 @@ class V2::Reports::LabelSummaryBuilder < V2::Reports::BaseSummaryBuilder
|
|||||||
end
|
end
|
||||||
|
|
||||||
def fetch_resolved_counts(conversation_filter)
|
def fetch_resolved_counts(conversation_filter)
|
||||||
fetch_counts(conversation_filter.merge(status: :resolved))
|
# since the base query is ActsAsTaggableOn,
|
||||||
|
# the status :resolved won't automatically be converted to integer status
|
||||||
|
fetch_counts(conversation_filter.merge(status: Conversation.statuses[:resolved]))
|
||||||
end
|
end
|
||||||
|
|
||||||
def fetch_counts(conversation_filter)
|
def fetch_counts(conversation_filter)
|
||||||
|
|||||||
@@ -4,7 +4,9 @@
|
|||||||
I18n.t('reports.label_csv.label_title'),
|
I18n.t('reports.label_csv.label_title'),
|
||||||
I18n.t('reports.label_csv.conversations_count'),
|
I18n.t('reports.label_csv.conversations_count'),
|
||||||
I18n.t('reports.label_csv.avg_first_response_time'),
|
I18n.t('reports.label_csv.avg_first_response_time'),
|
||||||
I18n.t('reports.label_csv.avg_resolution_time')
|
I18n.t('reports.label_csv.avg_resolution_time'),
|
||||||
|
I18n.t('reports.label_csv.avg_reply_time'),
|
||||||
|
I18n.t('reports.label_csv.resolution_count'),
|
||||||
]
|
]
|
||||||
%>
|
%>
|
||||||
<%= CSVSafe.generate_line headers -%>
|
<%= CSVSafe.generate_line headers -%>
|
||||||
|
|||||||
@@ -105,6 +105,8 @@ en:
|
|||||||
conversations_count: No. of conversations
|
conversations_count: No. of conversations
|
||||||
avg_first_response_time: Avg first response time
|
avg_first_response_time: Avg first response time
|
||||||
avg_resolution_time: Avg resolution time
|
avg_resolution_time: Avg resolution time
|
||||||
|
avg_reply_time: Avg reply time
|
||||||
|
resolution_count: Resolution Count
|
||||||
team_csv:
|
team_csv:
|
||||||
team_name: Team name
|
team_name: Team name
|
||||||
conversations_count: Conversations count
|
conversations_count: Conversations count
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ RSpec.describe V2::Reports::LabelSummaryBuilder do
|
|||||||
create(:reporting_event,
|
create(:reporting_event,
|
||||||
account: account,
|
account: account,
|
||||||
conversation: conv,
|
conversation: conv,
|
||||||
name: 'reply',
|
name: 'reply_time',
|
||||||
value: (15 + (idx * 5)) * 60,
|
value: (15 + (idx * 5)) * 60,
|
||||||
value_in_business_hours: (10 + (idx * 3)) * 60,
|
value_in_business_hours: (10 + (idx * 3)) * 60,
|
||||||
created_at: Time.zone.today)
|
created_at: Time.zone.today)
|
||||||
|
|||||||
Reference in New Issue
Block a user