Fixes #3444: Caller Log: Incoming calls move tabs out of Browser context

This commit is contained in:
Bola Ahmed Buari 2021-04-07 09:20:21 +00:00 committed by Thorsten Eckel
parent b26fdfd216
commit fc61d799d5
3 changed files with 78 additions and 71 deletions

View file

@ -39,11 +39,9 @@ class App.CTI extends App.Controller
) )
@controllerBind('menu:render', (data) => @controllerBind('menu:render', (data) =>
return if @switch() isnt true return if @switch() isnt true
localHtml = '' localHtml = App.view('navigation/menu_cti_ringing')(
for item in @ringingCalls() item: @ringingCalls()
localHtml += App.view('navigation/menu_cti_ringing')( )
item: item
)
$('.js-phoneMenuItem').after(localHtml) $('.js-phoneMenuItem').after(localHtml)
$('.call-widget').find('.js-newUser').bind('click', (e) => $('.call-widget').find('.js-newUser').bind('click', (e) =>
@newUser(e) @newUser(e)

View file

@ -1,60 +1,64 @@
<div class="call-widget"> <div class="call-widgets">
<div class="call-widget-header"> <% for item in @item: %>
<%- @Icon('status', "neutral") %> <div class="call-widget">
<div class="label"><%- @T('Inbound Call') %></div> <div class="call-widget-header">
<!-- <%- @Icon('status', "neutral") %>
<div class="flex-spacer"></div> <div class="label"><%- @T('Inbound Call') %></div>
<div class="btn btn--text js-remove" title="<%- @Ti('Remove') %>"><%- @Icon('diagonal-cross') %></div> <!--
--> <div class="flex-spacer"></div>
</div> <div class="btn btn--text js-remove" title="<%- @Ti('Remove') %>"><%- @Icon('diagonal-cross') %></div>
<div class="horizontal center"> -->
<% user = undefined %> </div>
<% shown = false %> <div class="horizontal center">
<% if @item.preferences.from && !_.isEmpty(@item.preferences.from): %> <% user = undefined %>
<% for caller_id in @item.preferences.from: %> <% shown = false %>
<% if caller_id.user_id && App.User.exists(caller_id.user_id): %> <% if item.preferences.from && !_.isEmpty(item.preferences.from): %>
<% user = App.User.fullLocal(caller_id.user_id) %> <% for caller_id in item.preferences.from: %>
<% classes = ['user-popover', 'u-textTruncate'] %> <% if caller_id.user_id && App.User.exists(caller_id.user_id): %>
<% classes.push('is-inactive') if !user.active %> <% user = App.User.fullLocal(caller_id.user_id) %>
<% if shown: %><div class="spacer"></div><% end %> <% classes = ['user-popover', 'u-textTruncate'] %>
<div class="user-card"> <% classes.push('is-inactive') if !user.active %>
<a href="<%- user.uiUrl() %>"><%- user.avatar() %></a> <% if shown: %><div class="spacer"></div><% end %>
<div class="<%= classes.join(' ') %>" data-id="<%- user.id %>"><% if caller_id.level isnt 'known': %><%- @T('maybe') %>: <% end %><%= user.displayNameLong() %></div> <div class="user-card">
<span class="text-muted"><%= @item.from_pretty %></span> <a href="<%- user.uiUrl() %>"><%- user.avatar() %></a>
</div> <div class="<%= classes.join(' ') %>" data-id="<%- user.id %>"><% if caller_id.level isnt 'known': %><%- @T('maybe') %>: <% end %><%= user.displayNameLong() %></div>
<% shown = true %> <span class="text-muted"><%= item.from_pretty %></span>
<% else if !_.isEmpty(caller_id.comment): %> </div>
<% shown = true %>
<% else if !_.isEmpty(caller_id.comment): %>
<% shown = true %>
<div class="user-card">
<%- @unique_avatar(caller_id.comment, caller_id.comment.split(" ").map((name) -> name[0]).join("")) %>
<%- @T('maybe') %>: <%= caller_id.comment %><br>
<span class="text-muted"><%= item.from_pretty %></span>
</div>
<% end %>
<% end %>
<% end %>
<% if !shown && !_.isEmpty(item.from_comment): %>
<% shown = true %> <% shown = true %>
<div class="user-card"> <div class="user-card">
<%- @unique_avatar(caller_id.comment, caller_id.comment.split(" ").map((name) -> name[0]).join("")) %> <%- @unique_avatar(item.from_comment, item.from_comment.split(" ").map((name) -> name[0]).join("")) %>
<%- @T('maybe') %>: <%= caller_id.comment %><br> <%= item.from_comment %><br>
<span class="text-muted"><%= @item.from_pretty %></span> <span class="text-muted"><%= item.from_pretty %></span>
</div> </div>
<% end %> <% end %>
<% end %> <% if !shown: %>
<% end %> <div class="user-card">
<% if !shown && !_.isEmpty(@item.from_comment): %> <%- @unique_avatar(item.from_pretty || item.from, '??') %>
<% shown = true %> <% if !_.isEmpty(item.from_pretty): %>
<div class="user-card"> <a class="inherit-color" href="<%- App.Utils.phoneify(item.from_pretty) %>"><%= item.from_pretty %></a>
<%- @unique_avatar(@item.from_comment, @item.from_comment.split(" ").map((name) -> name[0]).join("")) %> <% if item.direction is 'in': %>
<%= @item.from_comment %><br> <div class="btn btn--text btn--create no-padding js-newUser" href="#" data-phone="<%= item.from_pretty %>"><%- @Icon('plus-small') %> <span><%- @T('New User') %></div>
<span class="text-muted"><%= @item.from_pretty %></span> <% end %>
</div> <% else: %>
<% end %> <a class="inherit-color" href="<%- App.Utils.phoneify(item.from) %>"><%= item.from %></a>
<% if !shown: %> <% end %>
<div class="user-card"> </div>
<%- @unique_avatar(@item.from_pretty || @item.from, '??') %>
<% if !_.isEmpty(@item.from_pretty): %>
<a class="inherit-color" href="<%- App.Utils.phoneify(@item.from_pretty) %>"><%= @item.from_pretty %></a>
<% if @item.direction is 'in': %>
<div class="btn btn--text btn--create no-padding js-newUser" href="#" data-phone="<%= @item.from_pretty %>"><%- @Icon('plus-small') %> <span><%- @T('New User') %></div>
<% end %> <% end %>
<% else: %> <div class="flex-spacer"></div>
<a class="inherit-color" href="<%- App.Utils.phoneify(@item.from) %>"><%= @item.from %></a> <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>
<% end %>
</div> </div>
<% end %> </div>
<div class="flex-spacer"></div> <% end %>
<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>
</div>
</div>

View file

@ -3843,7 +3843,7 @@ footer {
.bulkAction-firstStep { .bulkAction-firstStep {
display: flex; display: flex;
align-items: center; align-items: center;
@include phone { @include phone {
flex-direction: column; flex-direction: column;
align-items: flex-end; align-items: flex-end;
@ -3858,10 +3858,10 @@ footer {
.bulkAction-secondStep { .bulkAction-secondStep {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
&-bottom { &-bottom {
display: flex; display: flex;
@include phone { @include phone {
display: block; display: block;
} }
@ -3870,7 +3870,7 @@ footer {
.bulkAction .btn { .bulkAction .btn {
margin: 0 16px; margin: 0 16px;
@include phone { @include phone {
margin: 10px; margin: 10px;
} }
@ -3883,7 +3883,7 @@ footer {
.bulkAction-controls { .bulkAction-controls {
margin-top: 10px; margin-top: 10px;
@include bidi-style(margin-left, auto, margin-right, 0); @include bidi-style(margin-left, auto, margin-right, 0);
@include phone { @include phone {
margin-top: 0; margin-top: 0;
display: flex; display: flex;
@ -4154,6 +4154,11 @@ footer {
} }
} }
.call-widgets {
overflow-y: auto;
max-height: 30vh;
}
.call-widget { .call-widget {
background: hsl(228,17%,91%); background: hsl(228,17%,91%);
padding: 8px 10px; padding: 8px 10px;
@ -5922,10 +5927,10 @@ footer {
.form-inline { .form-inline {
display: flex; display: flex;
@include phone { @include phone {
flex-wrap: wrap; flex-wrap: wrap;
.alert { .alert {
flex-basis: 100%; flex-basis: 100%;
} }
@ -5944,7 +5949,7 @@ footer {
position: relative; position: relative;
height: 60px; height: 60px;
flex: 1 1 auto; flex: 1 1 auto;
@include phone { @include phone {
width: 50%; width: 50%;
margin-bottom: 0; margin-bottom: 0;
@ -6006,10 +6011,10 @@ footer {
} }
.form-inline .form-group, .form-inline .form-group,
.form-inline.form-inline--enclosed .form-group { .form-inline.form-inline--enclosed .form-group {
@include phone { @include phone {
border-bottom: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0;
&:nth-child(even) { &:nth-child(even) {
border-right-width: 0; border-right-width: 0;
} }
@ -6075,10 +6080,10 @@ footer {
.bulkAction-secondStep .form-group { .bulkAction-secondStep .form-group {
min-width: 140px; min-width: 140px;
@include phone { @include phone {
min-width: 0; min-width: 0;
&.textarea { &.textarea {
border-bottom-width: 0; border-bottom-width: 0;
} }