fix: Display proper conversation ID with click-to-open in SLA reports (#12570)

This commit is contained in:
Sivin Varghese
2025-10-02 08:18:54 +05:30
committed by GitHub
parent ecff66146a
commit 109aaa2341
3 changed files with 10 additions and 5 deletions

View File

@@ -27,6 +27,11 @@ const conversationLabels = computed(() => {
? props.conversation.labels.split(',').map(item => item.trim())
: [];
});
const routerParams = computed(() => ({
name: 'inbox_conversation',
params: { conversation_id: props.conversationId },
}));
</script>
<template>
@@ -36,9 +41,9 @@ const conversationLabels = computed(() => {
<div
class="flex items-center gap-2 col-span-6 px-0 py-2 text-sm tracking-[0.5] text-n-slate-12 rtl:text-right"
>
<span class="text-n-slate-12">
{{ `#${conversationId} ` }}
</span>
<router-link :to="routerParams" class="text-n-slate-12 hover:underline">
{{ `#${conversationId}` }}
</router-link>
<span class="text-n-slate-11">
{{ $t('SLA_REPORTS.WITH') }}
</span>

View File

@@ -3,7 +3,7 @@ json.payload do
json.applied_sla applied_sla.push_event_data
json.conversation do
conversation = applied_sla.conversation
json.id conversation.id
json.id conversation.display_id
json.contact do
json.name conversation.contact.name if conversation.contact
end

View File

@@ -152,7 +152,7 @@ RSpec.describe 'Applied SLAs API', type: :request do
body = JSON.parse(response.body)
expect(body['payload'].size).to eq(1)
expect(body['payload'].first).to include('applied_sla')
expect(body['payload'].first['conversation']['id']).to eq(conversation2.id)
expect(body['payload'].first['conversation']['id']).to eq(conversation2.display_id)
expect(body['meta']).to include('count' => 1)
end