dewrich closed pull request #1839: TP - only show 'manage keys' button on ds 
forms if protocol>0 or signingAl?
URL: https://github.com/apache/incubator-trafficcontrol/pull/1839
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/traffic_portal/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
 
b/traffic_portal/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
index e554e76780..a2bd5bc272 100644
--- 
a/traffic_portal/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
+++ 
b/traffic_portal/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
@@ -45,6 +45,12 @@ var FormDeliveryServiceController = 
function(deliveryService, type, types, $scop
 
     $scope.deliveryService = deliveryService;
 
+    $scope.manageKeys = {
+        sslKeys: deliveryService.protocol > 0,
+        urlSigKeys: deliveryService.signingAlgorithm == 'url_sig',
+        uriSigningKeys: deliveryService.signingAlgorithm == 'uri_signing'
+    };
+
     $scope.edgeFQDNs = function(ds) {
         var urlString = '';
         if (_.isArray(ds.exampleURLs) && ds.exampleURLs.length > 0) {
diff --git 
a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.DNS.tpl.html
 
b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.DNS.tpl.html
index 08200d6388..29fa9f6306 100644
--- 
a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.DNS.tpl.html
+++ 
b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.DNS.tpl.html
@@ -25,14 +25,14 @@
         </ol>
         <div class="pull-right" role="group" ng-show="!settings.isNew">
             <div class="btn-group" role="group" uib-dropdown 
is-open="keys.isopen">
-                <button 
ng-show="(deliveryService.protocol>0)||(deliveryService.signingAlgorithm)" 
type="button" class="btn btn-primary dropdown-toggle" uib-dropdown-toggle 
aria-haspopup="true" aria-expanded="false">
+                <button ng-if="manageKeys.sslKeys || manageKeys.urlSigKeys || 
manageKeys.uriSigningKeys" type="button" class="btn btn-primary 
dropdown-toggle" uib-dropdown-toggle aria-haspopup="true" aria-expanded="false">
                     <i class="fa fa-key"></i>&nbsp;
                     <span class="caret"></span>
                 </button>
                 <ul class="dropdown-menu-right dropdown-menu" 
uib-dropdown-menu>
-                    <li role="menuitem"><a 
ng-show="deliveryService.protocol>0" ng-click="manageSslKeys()">Manage SSL 
Keys</a></li>
-                    <li role="menuitem"><a 
ng-show="deliveryService.signingAlgorithm=='url_sig'" 
ng-click="manageUrlSigKeys()">Manage URL Sig Keys</a></li>
-                    <li role="menuitem"><a 
ng-show="deliveryService.signingAlgorithm=='uri_signing'" 
ng-click="manageUriSigningKeys()">Manage URI Signing Keys</a></li>
+                    <li role="menuitem"><a ng-if="manageKeys.sslKeys" 
ng-click="manageSslKeys()">Manage SSL Keys</a></li>
+                    <li role="menuitem"><a ng-if="manageKeys.urlSigKeys" 
ng-click="manageUrlSigKeys()">Manage URL Sig Keys</a></li>
+                    <li role="menuitem"><a ng-if="manageKeys.uriSigningKeys" 
ng-click="manageUriSigningKeys()">Manage URI Signing Keys</a></li>
                 </ul>
             </div>
             <div class="btn-group" role="group" uib-dropdown 
is-open="more.isopen">
diff --git 
a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.HTTP.tpl.html
 
b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.HTTP.tpl.html
index a36afe6a94..5f6d415e7a 100644
--- 
a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.HTTP.tpl.html
+++ 
b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.HTTP.tpl.html
@@ -25,14 +25,14 @@
         </ol>
         <div class="pull-right" role="group" ng-show="!settings.isNew">
             <div class="btn-group" role="group" uib-dropdown 
is-open="keys.isopen">
-                <button 
ng-show="(deliveryService.protocol>0)||(deliveryService.signingAlgorithm)" 
type="button" class="btn btn-primary dropdown-toggle" uib-dropdown-toggle 
aria-haspopup="true" aria-expanded="false">
+                <button ng-if="manageKeys.sslKeys || manageKeys.urlSigKeys || 
manageKeys.uriSigningKeys" type="button" class="btn btn-primary 
dropdown-toggle" uib-dropdown-toggle aria-haspopup="true" aria-expanded="false">
                     <i class="fa fa-key"></i>&nbsp;
                     <span class="caret"></span>
                 </button>
                 <ul class="dropdown-menu-right dropdown-menu" 
uib-dropdown-menu>
-                    <li role="menuitem"><a 
ng-show="deliveryService.protocol>0" ng-click="manageSslKeys()">Manage SSL 
Keys</a></li>
-                    <li role="menuitem"><a 
ng-show="deliveryService.signingAlgorithm=='url_sig'" 
ng-click="manageUrlSigKeys()">Manage URL Sig Keys</a></li>
-                    <li role="menuitem"><a 
ng-show="deliveryService.signingAlgorithm=='uri_signing'" 
ng-click="manageUriSigningKeys()">Manage URI Signing Keys</a></li>
+                    <li role="menuitem"><a ng-if="manageKeys.sslKeys" 
ng-click="manageSslKeys()">Manage SSL Keys</a></li>
+                    <li role="menuitem"><a ng-if="manageKeys.urlSigKeys" 
ng-click="manageUrlSigKeys()">Manage URL Sig Keys</a></li>
+                    <li role="menuitem"><a ng-if="manageKeys.uriSigningKeys" 
ng-click="manageUriSigningKeys()">Manage URI Signing Keys</a></li>
                 </ul>
             </div>
             <div class="btn-group" role="group" uib-dropdown 
is-open="more.isopen">
diff --git 
a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.Steering.tpl.html
 
b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.Steering.tpl.html
index 3d097f63a5..d3f79e2f6d 100644
--- 
a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.Steering.tpl.html
+++ 
b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.Steering.tpl.html
@@ -25,13 +25,14 @@
         </ol>
         <div class="pull-right" role="group" ng-show="!settings.isNew">
             <div class="btn-group" role="group" uib-dropdown 
is-open="keys.isopen">
-                <button 
ng-show="(deliveryService.protocol>0)||(deliveryService.signed==true)" 
type="button" class="btn btn-primary dropdown-toggle" uib-dropdown-toggle 
aria-haspopup="true" aria-expanded="false">
+                <button ng-if="manageKeys.sslKeys || manageKeys.urlSigKeys || 
manageKeys.uriSigningKeys" type="button" class="btn btn-primary 
dropdown-toggle" uib-dropdown-toggle aria-haspopup="true" aria-expanded="false">
                     <i class="fa fa-key"></i>&nbsp;
                     <span class="caret"></span>
                 </button>
                 <ul class="dropdown-menu-right dropdown-menu" 
uib-dropdown-menu>
-                    <li role="menuitem"><a 
ng-show="deliveryService.protocol>0" ng-click="manageSslKeys()">Manage SSL 
Keys</a></li>
-                    <li role="menuitem"><a 
ng-show="deliveryService.signed==true" ng-click="manageUrlSigKeys()">Manage URL 
Sig Keys</a></li>
+                    <li role="menuitem"><a ng-if="manageKeys.sslKeys" 
ng-click="manageSslKeys()">Manage SSL Keys</a></li>
+                    <li role="menuitem"><a ng-if="manageKeys.urlSigKeys" 
ng-click="manageUrlSigKeys()">Manage URL Sig Keys</a></li>
+                    <li role="menuitem"><a ng-if="manageKeys.uriSigningKeys" 
ng-click="manageUriSigningKeys()">Manage URI Signing Keys</a></li>
                 </ul>
             </div>
             <div class="btn-group" role="group" uib-dropdown 
is-open="more.isopen">
diff --git 
a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.anyMap.tpl.html
 
b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.anyMap.tpl.html
index bb1d36196f..4dde1945c7 100644
--- 
a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.anyMap.tpl.html
+++ 
b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.anyMap.tpl.html
@@ -25,13 +25,14 @@
         </ol>
         <div class="pull-right" role="group" ng-show="!settings.isNew">
             <div class="btn-group" role="group" uib-dropdown 
is-open="keys.isopen">
-                <button 
ng-show="(deliveryService.protocol>0)||(deliveryService.signed==true)" 
type="button" class="btn btn-primary dropdown-toggle" uib-dropdown-toggle 
aria-haspopup="true" aria-expanded="false">
+                <button ng-if="manageKeys.sslKeys || manageKeys.urlSigKeys || 
manageKeys.uriSigningKeys" type="button" class="btn btn-primary 
dropdown-toggle" uib-dropdown-toggle aria-haspopup="true" aria-expanded="false">
                     <i class="fa fa-key"></i>&nbsp;
                     <span class="caret"></span>
                 </button>
                 <ul class="dropdown-menu-right dropdown-menu" 
uib-dropdown-menu>
-                    <li role="menuitem"><a 
ng-show="deliveryService.protocol>0" ng-click="manageSslKeys()">Manage SSL 
Keys</a></li>
-                    <li role="menuitem"><a 
ng-show="deliveryService.signed==true" ng-click="manageUrlSigKeys()">Manage URL 
Sig Keys</a></li>
+                    <li role="menuitem"><a ng-if="manageKeys.sslKeys" 
ng-click="manageSslKeys()">Manage SSL Keys</a></li>
+                    <li role="menuitem"><a ng-if="manageKeys.urlSigKeys" 
ng-click="manageUrlSigKeys()">Manage URL Sig Keys</a></li>
+                    <li role="menuitem"><a ng-if="manageKeys.uriSigningKeys" 
ng-click="manageUriSigningKeys()">Manage URI Signing Keys</a></li>
                 </ul>
             </div>
             <div class="btn-group" role="group" uib-dropdown 
is-open="more.isopen">


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to