From 5361917ef7604bf26affe48de1d0f95802442d8a Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Mon, 11 Jun 2018 11:00:57 +0000 Subject: [PATCH 1/4] Added privacy to callflow editor --- i18n/en-US.json | 14 +++++++++++ submodules/misc/misc.js | 53 +++++++++++++++++++++++++++++++++++++++++ views/misc-privacy.html | 27 +++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 views/misc-privacy.html diff --git a/i18n/en-US.json b/i18n/en-US.json index ccd8be20..bbfc4527 100644 --- a/i18n/en-US.json +++ b/i18n/en-US.json @@ -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", diff --git a/submodules/misc/misc.js b/submodules/misc/misc.js index 0b9aaaa9..be285aae 100644 --- a/submodules/misc/misc.js +++ b/submodules/misc/misc.js @@ -322,6 +322,59 @@ define(function(require) { } } }, + 'privacy[]': { + name: self.i18n.active().oldCallflows.privacy.toolbox_name, + icon: 'x_circle', + category: self.i18n.active().oldCallflows.caller_id_cat, + module: 'privacy', + 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', diff --git a/views/misc-privacy.html b/views/misc-privacy.html new file mode 100644 index 00000000..14470f6b --- /dev/null +++ b/views/misc-privacy.html @@ -0,0 +1,27 @@ +
+

{{ i18n.oldCallflows.privacy.title }}

+
+
+ + + +
+
+
+ +
+
\ No newline at end of file From 04ffdf61c481d89f75b8fc2628584a239dc70506 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Tue, 17 Sep 2019 07:56:06 +0300 Subject: [PATCH 2/4] renamed 'privacy' to 'privacy_cid' --- submodules/misc/misc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/submodules/misc/misc.js b/submodules/misc/misc.js index be285aae..a1439365 100644 --- a/submodules/misc/misc.js +++ b/submodules/misc/misc.js @@ -322,11 +322,11 @@ define(function(require) { } } }, - 'privacy[]': { + 'privacy_cid[]': { name: self.i18n.active().oldCallflows.privacy.toolbox_name, icon: 'x_circle', category: self.i18n.active().oldCallflows.caller_id_cat, - module: 'privacy', + module: 'privacy_cid', tip: self.i18n.active().oldCallflows.privacy.toolbox_tip, data: { endpoint_strategy: 'overwrite', From 28bfa23e2cc2f2fd4c1bc5dce1dd746cc16f2368 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Tue, 17 Sep 2019 07:57:31 +0300 Subject: [PATCH 3/4] Changed icon to 'lock' --- submodules/misc/misc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/misc/misc.js b/submodules/misc/misc.js index a1439365..5565584c 100644 --- a/submodules/misc/misc.js +++ b/submodules/misc/misc.js @@ -324,7 +324,7 @@ define(function(require) { }, 'privacy_cid[]': { name: self.i18n.active().oldCallflows.privacy.toolbox_name, - icon: 'x_circle', + icon: 'lock', category: self.i18n.active().oldCallflows.caller_id_cat, module: 'privacy_cid', tip: self.i18n.active().oldCallflows.privacy.toolbox_tip, From ca2416b8a136c93f432e4aaed8e84db00ed3d61f Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Tue, 17 Sep 2019 08:01:35 +0300 Subject: [PATCH 4/4] removed inline style usage --- views/misc-privacy.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/misc-privacy.html b/views/misc-privacy.html index 14470f6b..a44e0c77 100644 --- a/views/misc-privacy.html +++ b/views/misc-privacy.html @@ -4,7 +4,7 @@

{{ i18n.oldCallflows.privacy.title }}