Skip to content

Commit

Permalink
Hide device caller id based on feature set
Browse files Browse the repository at this point in the history
Co-authored-by: Joris Tirado <joris@2600hz.com>
  • Loading branch information
Isaac2600Hz and Joris Tirado committed Sep 19, 2022
1 parent 441712d commit 9cd3793
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion submodules/devices/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,21 @@ define(function(require) {
*/
devicesRenderDevice: function(args) {
var self = this,
isCallerIdConfigurable = function() {
if (!monster.util.isNumberFeatureEnabled('e911')) {
return false;
}
var isEditableWhenSetOnAccount = monster.util.isFeatureAvailable(
'smartpbx.devices.settings.callerId.editWhenSetOnAccount'
),
isNotSetOnAccount = _
.chain(monster.apps.auth.currentAccount)
.get('caller_id.external.number')
.isUndefined()
.value();

return isEditableWhenSetOnAccount || isNotSetOnAccount;
},
data = _.get(args, 'data'),
isAssignAllowed = !!_.get(args, 'allowAssign', true),
callbackSave = _.get(args, 'callbackSave'),
Expand All @@ -353,7 +368,7 @@ define(function(require) {
name: 'devices-' + type,
data: $.extend(true, {}, data, {
isProvisionerConfigured: monster.config.api.hasOwnProperty('provisioner'),
showEmergencyCallerId: monster.util.isNumberFeatureEnabled('e911')
showEmergencyCallerId: isCallerIdConfigurable()
}),
submodule: 'devices'
})),
Expand Down

0 comments on commit 9cd3793

Please sign in to comment.