From dad0192792da532113e0a064440587d51bd10378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Guti=C3=A9rrez?= Date: Mon, 25 Feb 2019 08:37:33 -0600 Subject: [PATCH] UI-3301: Load main number's E911 dialog on top notification click at Smart PBX (#119) * Change styles file extension from .css to .scss, to use SASS * Set style for e911 information banner * Show main company numbers section and E911 popup on banner click * Refactor strategyRefreshTemplate to receive arguments via object wrapper * Pass action from myOffice layout to strategy.strategyRefreshTemplate * Check e911 number availability and show edit dialog or toast * Fix typo in property name * Extract main numbers refresh template process into separate function * Refactor to use Lodash instead of jQuery utility functions * Pass action to banner via topMessage object * Refactor checkMissingE911 function * Convert action to object, to include more parameters * Add action callback for e911 at numbers strategy * Fixes on flow to check if update Emergency Caller ID * Request current account from API, when checking to update E911 caller ID * Fix e911 phone number filter * Use current authenticated account instead of requesting it from API --- i18n/en-US.json | 3 +- submodules/myOffice/myOffice.js | 17 +- .../myOffice/{myOffice.css => myOffice.scss} | 35 +- submodules/myOffice/views/layout.html | 4 +- submodules/strategy/strategy.js | 516 +++++++++++++----- 5 files changed, 436 insertions(+), 139 deletions(-) rename submodules/myOffice/{myOffice.css => myOffice.scss} (95%) diff --git a/i18n/en-US.json b/i18n/en-US.json index 46a7d37..9bf37bd 100644 --- a/i18n/en-US.json +++ b/i18n/en-US.json @@ -958,7 +958,8 @@ "resetCallSuccess": "Call strategy successfully reset.", "buyNumbersSuccess": "The numbers have been purchased.", "buyNumbersError": "An error occured while purchasing numbers.", - "removeNumberSuccess": "Number successfully removed from the main callflow." + "removeNumberSuccess": "Number successfully removed from the main callflow.", + "noE911NumberAvailable": "There are no main numbers with e911 feature available. Please assign a main number with the e911 feature." }, "popupRemoveFeatures": { "title": "Features", diff --git a/submodules/myOffice/myOffice.js b/submodules/myOffice/myOffice.js index 2b09ba8..d3c5f38 100644 --- a/submodules/myOffice/myOffice.js +++ b/submodules/myOffice/myOffice.js @@ -661,7 +661,8 @@ define(function(require) { if (!hasValidCallerId && !hasValidE911) { data.topMessage = { cssClass: 'btn-danger', - message: self.i18n.active().myOffice.missingCnamE911Message + message: self.i18n.active().myOffice.missingCnamE911Message, + action: 'checkMissingE911' }; } else if (!hasValidCallerId) { data.topMessage = { @@ -671,7 +672,8 @@ define(function(require) { } else if (!hasValidE911) { data.topMessage = { cssClass: 'btn-danger', - message: self.i18n.active().myOffice.missingE911Message + message: self.i18n.active().myOffice.missingE911Message, + action: 'checkMissingE911' }; } } @@ -700,7 +702,8 @@ define(function(require) { template.find('.link-box').on('click', function(e) { var $this = $(this), category = $this.data('category'), - subcategory = $this.data('subcategory'); + subcategory = $this.data('subcategory'), + actionType = $this.data('action'); $('.category').removeClass('active'); switch (category) { @@ -718,7 +721,13 @@ define(function(require) { break; case 'strategy': $('.category#strategy').addClass('active'); - monster.pub('voip.strategy.render', { parent: parent, openElement: subcategory }); + monster.pub('voip.strategy.render', { + parent: parent, + openElement: subcategory, + action: { + type: actionType + } + }); break; } }); diff --git a/submodules/myOffice/myOffice.css b/submodules/myOffice/myOffice.scss similarity index 95% rename from submodules/myOffice/myOffice.css rename to submodules/myOffice/myOffice.scss index 858372c..f68a424 100644 --- a/submodules/myOffice/myOffice.css +++ b/submodules/myOffice/myOffice.scss @@ -1,3 +1,5 @@ +@import '../../../../css/partials/base'; + /********** Header **********/ #myoffice_container .dashboard-header { height: 62px; @@ -60,14 +62,29 @@ } /********** Content **********/ -#myoffice_container .dashboard-content .dashboard-top-message { - padding: 10px; - margin-bottom: 10px; - border-radius: 2px; - opacity: 0.8; -} -#myoffice_container .dashboard-content .dashboard-top-message i { - margin-right: 10px; +#myoffice_container .dashboard-content { + .dashboard-top-message { + padding: 10px; + margin-bottom: 10px; + border-radius: 2px; + opacity: 0.8; + } + .dashboard-top-message{ + &.link-box[data-action] { + cursor: pointer; + &:hover { + background-color: #ff3b29; + background-image: -moz-linear-gradient(top, #ff3a28, #ff6161); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ff3a28), to(#ff6161)); + background-image: -webkit-linear-gradient(top, #ff3a28, #ff6161); + background-image: -o-linear-gradient(top, #ff3a28, #ff6161); + background-image: linear-gradient(to bottom, #ff3a28, #ff6161); + } + } + i { + margin-right: 10px; + } + } } #myoffice_container .dashboard-content-div { @@ -473,4 +490,4 @@ @keyframes warning-pulse-box { 0% { box-shadow: 0px 0px 5px #fbb450 inset, 0px 0px 5px #f89406; } 100% { box-shadow: 0px 0px 30px #fbb450 inset, 0px 0px 10px #f89406; } -} \ No newline at end of file +} diff --git a/submodules/myOffice/views/layout.html b/submodules/myOffice/views/layout.html index f785073..770fe50 100644 --- a/submodules/myOffice/views/layout.html +++ b/submodules/myOffice/views/layout.html @@ -23,7 +23,7 @@
{{#if topMessage}} -
+ {{/if}} @@ -123,7 +123,7 @@ {{else}} +
{{/if}}