Skip to content

Commit

Permalink
UI-2016: Fixed an issue with numbers common control
Browse files Browse the repository at this point in the history
  • Loading branch information
JRMaitre committed Jan 28, 2016
1 parent 971afab commit e86b804
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 20 deletions.
33 changes: 18 additions & 15 deletions apps/common/submodules/numbers/numbers.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ define(function(require){
value.friendlyUsedBy = self.i18n.active().numbers[value.used_by];
}

value.isLocal = value.features.indexOf('local') > -1;

return value;
},

Expand Down Expand Up @@ -130,22 +132,15 @@ define(function(require){

value = self.numbersFormatNumber(value);

if(value.used_by) {
if(data.viewType === 'pbx') {
if(value.used_by === 'callflow' || value.used_by === 'mobile') {
value.isLocal = value.features.indexOf('local') > -1;
thisAccount.usedNumbers.push(value);
}
}
else {
value.isLocal = value.features.indexOf('local') > -1;
thisAccount.usedNumbers.push(value);
}
}
else {
value.isLocal = value.features.indexOf('local') > -1;
if(!value.used_by) {
thisAccount.spareNumbers.push(value);
}
else if(data.viewType !== 'pbx') {
thisAccount.usedNumbers.push(value)
}
else if(value.used_by === 'callflow' || value.used_by === 'mobile') {
thisAccount.usedNumbers.push(value);
}
});

thisAccount.countUsedNumbers = thisAccount.usedNumbers.length;
Expand Down Expand Up @@ -221,7 +216,15 @@ define(function(require){

value = self.numbersFormatNumber(value);

value.used_by ? usedNumbers.push(value) : spareNumbers.push(value);
if(!value.used_by) {
spareNumbers.push(value)
}
else if(listType === 'full') {
usedNumbers.push(value);
}
else if(value.used_by === 'callflow' || value.used_by === 'mobile') {
usedNumbers.push(value);
}
}
});

Expand Down
10 changes: 5 additions & 5 deletions apps/common/views/numbers-spare.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@
<span class="city">{{ this.friendlyLocality }}</span>
{{/if}}
</span>
{{#compare this.state '===' 'port_in'}}
<div class="features pull-right">
<i class="fa fa-exclamation-triangle monster-red active help-popover" data-toggle="tooltip" data-placement="top" data-original-title="{{../../../i18n.numbers.portIconHelp}}"></i>
</div>
{{/compare}}
{{#compare this.state '===' 'port_in'}}
<div class="features pull-right">
<i class="fa fa-exclamation-triangle monster-red active help-popover" data-toggle="tooltip" data-placement="top" data-original-title="{{../../../i18n.numbers.portIconHelp}}"></i>
</div>
{{/compare}}
</div>
{{else}}
<div class="number-box no-data">
Expand Down
5 changes: 5 additions & 0 deletions apps/common/views/numbers-spareAccount.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<span class="city">{{ this.friendlyLocality }}</span>
{{/if}}
</span>
{{#compare this.state '===' 'port_in'}}
<div class="features pull-right">
<i class="fa fa-exclamation-triangle monster-red active help-popover" data-toggle="tooltip" data-placement="top" data-original-title="{{../../i18n.numbers.portIconHelp}}"></i>
</div>
{{/compare}}
</div>
{{else}}
<div class="number-box no-data">
Expand Down
1 change: 1 addition & 0 deletions apps/websockets
Submodule websockets added at f0b945

0 comments on commit e86b804

Please sign in to comment.