Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI-3111: Added privacy to callflow editor #69

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,20 @@
"current": "Current",
"original": "Original"
}
},
"privacy": {
"title": "Privacy",
"caller_id_title": "Privacy Caller-ID",
"toolbox_name": "Privacy cid",
"toolbox_tip": "Hide your CallerNumber or your CallerName",
"mode": "Mode",
"endpoint_strategy": "Endpoint strategy",
"full": "Full",
"name": "Name",
"number": "Number",
"none": "None",
"overwrite": "Overwrite",
"merge": "Merge"
}
},
"__comment": "UI-1260: created common control for carrier selection",
Expand Down
53 changes: 53 additions & 0 deletions submodules/misc/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,59 @@ define(function(require) {
}
}
},
'privacy_cid[]': {
name: self.i18n.active().oldCallflows.privacy.toolbox_name,
icon: 'lock',
category: self.i18n.active().oldCallflows.caller_id_cat,
module: 'privacy_cid',
tip: self.i18n.active().oldCallflows.privacy.toolbox_tip,
data: {
endpoint_strategy: 'overwrite',
mode: 'full'
},
isUsable: 'true',
weight: 10,
caption: function(node) {
return (node.getMetadata('endpoint_strategy') || '') + ' ' + (node.getMetadata('mode') || '');
},
edit: function(node, callback) {
var popup, popup_html;

popup_html = $(monster.template(self, 'misc-privacy', {
data_privacy: {
'endpoint_strategy': node.getMetadata('endpoint_strategy') || '',
'mode': node.getMetadata('mode') || ''
}
}));

$('#add', popup_html).click(function() {
var endpoint_strategy_val = $('#privacy_endpoint_strategy', popup_html).val(),
mode_val = $('#privacy_mode', popup_html).val();

node.setMetadata('endpoint_strategy', endpoint_strategy_val);
node.setMetadata('mode', mode_val);

node.caption = endpoint_strategy_val + ' ' + mode_val;

popup.dialog('close');
});

popup = monster.ui.dialog(popup_html, {
title: self.i18n.active().oldCallflows.privacy.caller_id_title,
beforeClose: function() {
if (typeof callback === 'function') {
callback();
}
}
});

monster.ui.tooltips(popup);

if (typeof callback === 'function') {
callback();
}
}
},
'prepend_cid[action=prepend]': {
name: self.i18n.active().oldCallflows.prepend,
icon: 'plus_circle',
Expand Down
27 changes: 27 additions & 0 deletions views/misc-privacy.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<div class="dialog_popup callflows-port">
<h1>{{ i18n.oldCallflows.privacy.title }}</h1>
<form name="form" method="post" action="#">
<div class="form_content">
<div class="popup_field">
<label for="privacy_mode">{{ i18n.oldCallflows.privacy.mode }}: </label>
<select id="privacy_mode">
<option value="full"{{#compare data_privacy.mode "===" "full"}} selected{{/compare}}>{{ i18n.oldCallflows.privacy.full }}</option>
<option value="name"{{#compare data_privacy.mode "===" "name"}} selected{{/compare}}>{{ i18n.oldCallflows.privacy.name }}</option>
<option value="number"{{#compare data_privacy.mode "===" "number"}} selected{{/compare}}>{{ i18n.oldCallflows.privacy.number }}</option>
<option value="none"{{#compare data_privacy.mode "===" "none"}} selected{{/compare}}>{{ i18n.oldCallflows.privacy.none }}</option>
</select>
</div>

<div class="popup_field">
<label for="privacy_endpoint_strategy">{{ i18n.oldCallflows.privacy.endpoint_strategy }}: </label>
<select id="privacy_endpoint_strategy">
<option value="overwrite"{{#compare data_privacy.endpoint_strategy "===" "overwrite"}} selected{{/compare}}>{{ i18n.oldCallflows.privacy.overwrite }}</option>
<option value="merge"{{#compare data_privacy.endpoint_strategy "===" "merge"}} selected{{/compare}}>{{ i18n.oldCallflows.privacy.merge }}</option>
</select>
</div>
</div>
</form>
<div class="buttons-center">
<button id="add" class="monster-button monster-button-primary">{{ i18n.save }}</button>
</div>
</div>