Skip to content

Commit

Permalink
Fixes #4401 - Clicking on the name of a user on an incoming call does…
Browse files Browse the repository at this point in the history
… not open user information
  • Loading branch information
mantas committed Nov 11, 2023
1 parent d63911c commit 4747590
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
Expand Up @@ -20,7 +20,7 @@
<% if shown: %><div class="spacer"></div><% end %>
<div class="user-card">
<a href="<%- user.uiUrl() %>"><%- user.avatar() %></a>
<div class="<%= classes.join(' ') %>" data-id="<%- user.id %>"><% if caller_id.level isnt 'known': %><%- @T('maybe:') %> <% end %><%= user.displayNameLong() %></div>
<a href="<%- user.uiUrl() %>" class="inherit-color <%= classes.join(' ') %>" data-id="<%- user.id %>"><% if caller_id.level isnt 'known': %><%- @T('maybe:') %> <% end %><%= user.displayNameLong() %></a>
<span class="text-muted"><%= item.from_pretty %></span>
<div class="btn btn--small btn--quad btn--create space-left js-newTicket" title="<%- @Ti('New Ticket') %>" data-user-id="<% if user: %><%- user.id %><% end %>"><%- @Icon('plus') %></div>
</div>
Expand Down
31 changes: 30 additions & 1 deletion spec/system/cti_spec.rb
Expand Up @@ -41,9 +41,38 @@ def authenticate
visit '/'

within '#navigation .menu' do
place_call
expect(page).to have_link('Phone', href: '#cti')
end
end

context 'when agent is on the phone' do
let(:agent) do
create(:agent, phone: agent_phone).tap do |user|
user.preferences[:cti] = true
user.save!
end
end

let(:cti_log) do
create(:cti_log,
direction: 'in',
from: customer.phone,
preferences: { from: [{ user_id: customer.id }] })
end

before { cti_log }

it 'shows call and opens user profile on click' do
visit '/'

within '.call-widgets .user-card' do
click_link customer.fullname
end

expect(current_url).to end_with("user/profile/#{customer.id}")
end
end
end

context 'when cti integration is not on' do
Expand Down Expand Up @@ -136,7 +165,7 @@ def authenticate

context 'with private number' do
let(:customer_phone) { '007' }
let(:agent_phone) { '008' }
let(:agent_phone) { '008' }

it 'appears verbatim' do

Expand Down

0 comments on commit 4747590

Please sign in to comment.