Skip to content

Commit

Permalink
[5.3] MSPB-365: Fix issue where 'Ignore Completed Elsewhere' is not g…
Browse files Browse the repository at this point in the history
…etting respected (#553)

* chore: remove unused checkbox

* feat: remove field if set to default

* chore: replace soft device chk

* feat: replace chk element for smartphones

* fix: resolve default values

* chore: add missing tooltip

* chore: restore system default

* fix: change tooltip position

* chore: remove unused field when save
  • Loading branch information
masmerino13 authored Oct 23, 2024
1 parent 68b9b50 commit 85a84be
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 28 deletions.
2 changes: 1 addition & 1 deletion i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
"__version": "3.19",
"ignoreCompletedElsewhere": {
"label": "Ignore Completed Elsewhere",
"help": "When checked supporting phones will show a call missed if it was part of a ring group answered elsewhere.",
"help": "When turned on, supporting phones will show a call missed if it was part of a ring group answered elsewhere.",
"systemDefault": "System Default"
},
"__comment": "UI-377: Adding Restart device feature",
Expand Down
12 changes: 9 additions & 3 deletions submodules/devices/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -743,8 +743,12 @@ define(function(require) {

// If value is set to something else than account default then we set the enabled boolean
if (value && value !== 'default') {
formData.ignore_completed_elsewhere = value === 'on'
formData.ignore_completed_elsewhere = value === 'on';
return;
}

delete formData.ignore_completed_elsewhere;
delete originalData.ignore_completed_elsewhere;
});

if ('mac_address' in formData) {
Expand Down Expand Up @@ -1185,10 +1189,10 @@ define(function(require) {
softphone: _.merge({}, sipSettings),
teammate: _.merge({
caller_id_options: {
outbound_privacy: "none"
outbound_privacy: 'none'
},
sip: _.merge({
ignore_completed_elsewhere: 'true',
ignore_completed_elsewhere: false
}, _.pick(sipSettings.sip, ['password', 'username'])),
media: {
webrtc: false,
Expand Down Expand Up @@ -1511,6 +1515,8 @@ define(function(require) {
self.updateMobileCallflowAssignment(userId, userMainCallflowId, device, callback);
},
saveDevice = function saveDevice(device, callback) {
delete device.system_ignore_completed_elsewhere;

var method = _.has(device, 'id') ? 'devicesUpdateDevice' : 'devicesCreateDevice';

self[method](device, _.partial(callback, null), callback);
Expand Down
5 changes: 5 additions & 0 deletions submodules/devices/devices.scss
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@
margin-left: 22px;
}

.voip-edit-device-popup .edit-device .ignore-completed-elsewhere-group {
display: flex;
align-items: center;
}

.voip-edit-device-popup .edit-device .actions {
border-top: 1px solid #CCCCCC;
height: 30px;
Expand Down
15 changes: 9 additions & 6 deletions submodules/devices/views/devices-mobile.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,16 @@
{{ i18n.devices.popupSettings.miscellaneous.sectionTitle }}
</div>

<div class="control-group">
<label class="control-label checkbox">
{{#monsterCheckbox i18n.devices.popupSettings.miscellaneous.ignoreCompletedElsewhere.label }}
<input type="checkbox" name="ignore_completed_elsewhere" id="ignore_completed_elsewhere" {{#if ignore_completed_elsewhere }}checked{{/if}} />
{{/monsterCheckbox}}
<div class="control-group ignore-completed-elsewhere-group">
<label class="control-label">{{ i18n.devices.popupSettings.miscellaneous.ignoreCompletedElsewhere.label }}</label>
<div class="btn-group-wrapper">
<i class="help-popover fa fa-question-circle fa-lg" data-original-title="{{i18n.devices.popupSettings.miscellaneous.ignoreCompletedElsewhere.help}}" data-placement="top" data-toggle="tooltip"></i>
</label>
<div class="btn-group btn-group-controls ignore-completed-elsewhere">
<button data-value="off" class="monster-button monster-button-ignore{{#compare ignore_completed_elsewhere "===" false}} monster-button-primary selected{{/compare}}">{{ i18n.off }}</button>
<button data-value="default" class="monster-button monster-button-ignore{{#compare ignore_completed_elsewhere "===" undefined}} monster-button-primary selected{{/compare}}">{{ i18n.devices.popupSettings.miscellaneous.ignoreCompletedElsewhere.systemDefault }} ({{ system_ignore_completed_elsewhere }})</button>
<button data-value="on" class="monster-button monster-button-ignore{{#compare ignore_completed_elsewhere "===" true}} monster-button-primary selected{{/compare}}">{{ i18n.on }}</button>
</div>
</div>
</div>

<div class="rtp-line">
Expand Down
10 changes: 1 addition & 9 deletions submodules/devices/views/devices-sip_device.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,6 @@
{{ i18n.devices.popupSettings.miscellaneous.sectionTitle }}
</div>

<div class="control-group">
<label class="control-label checkbox">
{{#monsterCheckbox i18n.devices.popupSettings.miscellaneous.ignoreCompletedElsewhere.label }}
<input type="checkbox" name="ignore_completed_elsewhere" id="ignore_completed_elsewhere" {{#if ignore_completed_elsewhere }}checked{{/if}}/>
{{/monsterCheckbox}}
<i class="help-popover fa fa-question-circle fa-lg" data-original-title="{{i18n.devices.popupSettings.miscellaneous.ignoreCompletedElsewhere.help}}" data-placement="top" data-toggle="tooltip"></i>
</label>
</div>

<div class="control-group">
<label class="control-label checkbox">
{{#monsterCheckbox i18n.devices.popupSettings.miscellaneous.unregisterNotifications.label }}
Expand All @@ -271,6 +262,7 @@
<div class="control-group ignore-completed-elsewhere-group">
<label class="control-label">{{ i18n.devices.popupSettings.miscellaneous.ignoreCompletedElsewhere.label }}</label>
<div class="btn-group-wrapper">
<i class="help-popover fa fa-question-circle fa-lg" data-original-title="{{i18n.devices.popupSettings.miscellaneous.ignoreCompletedElsewhere.help}}" data-placement="top" data-toggle="tooltip"></i>
<div class="btn-group btn-group-controls ignore-completed-elsewhere">
<button data-value="off" class="monster-button monster-button-ignore{{#compare ignore_completed_elsewhere "===" false}} monster-button-primary selected{{/compare}}">{{ i18n.off }}</button>
<button data-value="default" class="monster-button monster-button-ignore{{#compare ignore_completed_elsewhere "===" undefined}} monster-button-primary selected{{/compare}}">{{ i18n.devices.popupSettings.miscellaneous.ignoreCompletedElsewhere.systemDefault }} ({{ system_ignore_completed_elsewhere }})</button>
Expand Down
21 changes: 12 additions & 9 deletions submodules/devices/views/devices-softphone.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,6 @@
{{ i18n.devices.popupSettings.miscellaneous.sectionTitle }}
</div>

<div class="control-group">
<label class="control-label checkbox">
{{#monsterCheckbox i18n.devices.popupSettings.miscellaneous.ignoreCompletedElsewhere.label }}
<input type="checkbox" name="ignore_completed_elsewhere" id="ignore_completed_elsewhere" {{#if ignore_completed_elsewhere }}checked{{/if}} />
{{/monsterCheckbox}}
<i class="help-popover fa fa-question-circle fa-lg" data-original-title="{{i18n.devices.popupSettings.miscellaneous.ignoreCompletedElsewhere.help}}" data-placement="top" data-toggle="tooltip"></i>
</label>
</div>

<div class="control-group">
<label class="control-label checkbox">
{{#monsterCheckbox i18n.devices.popupSettings.miscellaneous.unregisterNotifications.label }}
Expand All @@ -212,6 +203,18 @@
</label>
</div>

<div class="control-group ignore-completed-elsewhere-group">
<label class="control-label">{{ i18n.devices.popupSettings.miscellaneous.ignoreCompletedElsewhere.label }}</label>
<div class="btn-group-wrapper">
<i class="help-popover fa fa-question-circle fa-lg" data-original-title="{{i18n.devices.popupSettings.miscellaneous.ignoreCompletedElsewhere.help}}" data-placement="top" data-toggle="tooltip"></i>
<div class="btn-group btn-group-controls ignore-completed-elsewhere">
<button data-value="off" class="monster-button monster-button-ignore{{#compare ignore_completed_elsewhere "===" false}} monster-button-primary selected{{/compare}}">{{ i18n.off }}</button>
<button data-value="default" class="monster-button monster-button-ignore{{#compare ignore_completed_elsewhere "===" undefined}} monster-button-primary selected{{/compare}}">{{ i18n.devices.popupSettings.miscellaneous.ignoreCompletedElsewhere.systemDefault }} ({{ system_ignore_completed_elsewhere }})</button>
<button data-value="on" class="monster-button monster-button-ignore{{#compare ignore_completed_elsewhere "===" true}} monster-button-primary selected{{/compare}}">{{ i18n.on }}</button>
</div>
</div>
</div>

<div class="control-group">
<label for="outbound_privacy" class="control-label checkbox">
{{i18n.commonMisc.outboundPrivacy.label}}
Expand Down

0 comments on commit 85a84be

Please sign in to comment.