You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2019/07/24 17:22:30 UTC

[trafficcontrol] branch master updated: Make entire row clickable in TP assignment popups (#3725)

This is an automated email from the ASF dual-hosted git repository.

mitchell852 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 356799d  Make entire row clickable in TP assignment popups (#3725)
356799d is described below

commit 356799dc895a3dfbfe68014f99e1bbb4ce1f908c
Author: Alex Luckerman <35...@users.noreply.github.com>
AuthorDate: Wed Jul 24 11:22:24 2019 -0600

    Make entire row clickable in TP assignment popups (#3725)
    
    * Add whole row click support to assignment popups
    
    * Fix checkboxes for linking parameters to CGs
    
    * Trigger checkbox click on table row click
    
    * Add highlight to checked table rows
    
    * Fix link CG to param dialog simulated click issue
---
 .../TableCacheGroupParamsUnassignedController.js               | 10 +++++++---
 .../table.cacheGroupParamsUnassigned.tpl.html                  |  4 ++--
 .../table.assignFederationDeliveryServices.tpl.html            |  4 ++--
 .../cdnFederationUsers/table.assignFederationUsers.tpl.html    |  4 ++--
 .../deliveryServiceServers/table.assignDSServers.tpl.html      |  4 ++--
 .../federationResolvers/table.assignFedResolvers.tpl.html      |  4 ++--
 .../parameterProfiles/table.paramProfilesUnassigned.tpl.html   |  4 ++--
 .../profileParameters/table.profileParamsUnassigned.tpl.html   |  4 ++--
 .../table/roleCapabilities/table.assignCapabilities.tpl.html   |  4 ++--
 .../table.assignDeliveryServices.tpl.html                      |  4 ++--
 10 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/traffic_portal/app/src/common/modules/table/cacheGroupParameters/TableCacheGroupParamsUnassignedController.js b/traffic_portal/app/src/common/modules/table/cacheGroupParameters/TableCacheGroupParamsUnassignedController.js
index d7f0c9c..e87b6cf 100644
--- a/traffic_portal/app/src/common/modules/table/cacheGroupParameters/TableCacheGroupParamsUnassignedController.js
+++ b/traffic_portal/app/src/common/modules/table/cacheGroupParameters/TableCacheGroupParamsUnassignedController.js
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-var TableProfileParamsUnassignedController = function(cg, parameters, $scope, $uibModalInstance) {
+var TableCacheGroupParamsUnassignedController = function(cg, parameters, $scope, $uibModalInstance) {
 
 	var selectedParams = [];
 
@@ -44,6 +44,10 @@ var TableProfileParamsUnassignedController = function(cg, parameters, $scope, $u
 		}
 	};
 
+	$scope.handleRowClick = function($index) {
+		$('#checkbox-' + $index).trigger('click');
+	};
+
 	$scope.submit = function() {
 		$uibModalInstance.close(selectedParams);
 	};
@@ -65,5 +69,5 @@ var TableProfileParamsUnassignedController = function(cg, parameters, $scope, $u
 
 };
 
-TableProfileParamsUnassignedController.$inject = ['cg', 'parameters', '$scope', '$uibModalInstance'];
-module.exports = TableProfileParamsUnassignedController;
+TableCacheGroupParamsUnassignedController.$inject = ['cg', 'parameters', '$scope', '$uibModalInstance'];
+module.exports = TableCacheGroupParamsUnassignedController;
diff --git a/traffic_portal/app/src/common/modules/table/cacheGroupParameters/table.cacheGroupParamsUnassigned.tpl.html b/traffic_portal/app/src/common/modules/table/cacheGroupParameters/table.cacheGroupParamsUnassigned.tpl.html
index 6b8b0fe..88c01ef 100644
--- a/traffic_portal/app/src/common/modules/table/cacheGroupParameters/table.cacheGroupParamsUnassigned.tpl.html
+++ b/traffic_portal/app/src/common/modules/table/cacheGroupParameters/table.cacheGroupParamsUnassigned.tpl.html
@@ -34,8 +34,8 @@ under the License.
         </tr>
         </thead>
         <tbody>
-        <tr ng-repeat="p in ::unassignedParams">
-            <td><input type="checkbox" ng-click="updateParams($event, p.id)"></td>
+        <tr ng-repeat="p in ::unassignedParams" ng-class="::{'active': p.selected}" ng-click="handleRowClick($index)">
+            <td><input id="checkbox-{{$index}}" ng-model="p.selected" type="checkbox" ng-click="updateParams($event, p.id); $event.stopPropagation()"></td>
             <td data-search="^{{::p.name}}$">{{::p.name}}</td>
             <td data-search="^{{::p.configFile}}$">{{::p.configFile}}</td>
             <td data-search="^{{::p.value}}$">{{::p.value}}</td>
diff --git a/traffic_portal/app/src/common/modules/table/cdnFederationDeliveryServices/table.assignFederationDeliveryServices.tpl.html b/traffic_portal/app/src/common/modules/table/cdnFederationDeliveryServices/table.assignFederationDeliveryServices.tpl.html
index 6f760de..b9f9f82 100644
--- a/traffic_portal/app/src/common/modules/table/cdnFederationDeliveryServices/table.assignFederationDeliveryServices.tpl.html
+++ b/traffic_portal/app/src/common/modules/table/cdnFederationDeliveryServices/table.assignFederationDeliveryServices.tpl.html
@@ -34,8 +34,8 @@ under the License.
         </tr>
         </thead>
         <tbody>
-        <tr id="{{ds.id}}" class="ds-row" ng-repeat="ds in ::deliveryServices">
-            <td><input type="checkbox" ng-checked="ds.selected" ng-model="ds.selected" ng-change="onChange()"></td>
+        <tr id="{{ds.id}}" class="ds-row" ng-class="::{'active': ds.selected}" ng-repeat="ds in ::deliveryServices" ng-click="ds.selected = !ds.selected; onChange()">
+            <td><input type="checkbox" ng-model="ds.selected"></td>
             <td data-search="^{{::ds.xmlId}}$">{{::ds.xmlId}}</td>
             <td data-search="^{{::ds.displayName}}$">{{::ds.displayName}}</td>
             <td data-search="^{{::ds.type}}$">{{::ds.type}}</td>
diff --git a/traffic_portal/app/src/common/modules/table/cdnFederationUsers/table.assignFederationUsers.tpl.html b/traffic_portal/app/src/common/modules/table/cdnFederationUsers/table.assignFederationUsers.tpl.html
index 8e3db8a..e653d84 100644
--- a/traffic_portal/app/src/common/modules/table/cdnFederationUsers/table.assignFederationUsers.tpl.html
+++ b/traffic_portal/app/src/common/modules/table/cdnFederationUsers/table.assignFederationUsers.tpl.html
@@ -35,8 +35,8 @@ under the License.
         </tr>
         </thead>
         <tbody>
-        <tr id="{{u.id}}" class="user-row" ng-repeat="u in ::users">
-            <td><input type="checkbox" ng-checked="u.selected" ng-model="u.selected" ng-change="onChange()"></td>
+        <tr id="{{u.id}}" class="user-row" ng-class="::{'active': u.selected}" ng-repeat="u in ::users" ng-click="u.selected = !u.selected; onChange()">
+            <td><input type="checkbox" ng-model="u.selected"></td>
             <td data-search="^{{::u.fullName}}$">{{::u.fullName}}</td>
             <td data-search="^{{::u.username}}$">{{::u.username}}</td>
             <td data-search="^{{::u.email}}$">{{::u.email}}</td>
diff --git a/traffic_portal/app/src/common/modules/table/deliveryServiceServers/table.assignDSServers.tpl.html b/traffic_portal/app/src/common/modules/table/deliveryServiceServers/table.assignDSServers.tpl.html
index 5c27cd3..137ec13 100644
--- a/traffic_portal/app/src/common/modules/table/deliveryServiceServers/table.assignDSServers.tpl.html
+++ b/traffic_portal/app/src/common/modules/table/deliveryServiceServers/table.assignDSServers.tpl.html
@@ -34,8 +34,8 @@ under the License.
         </tr>
         </thead>
         <tbody>
-        <tr id="{{::s.id}}" class="server-row" ng-repeat="s in ::servers">
-            <td><input type="checkbox" ng-checked="s.selected" ng-model="s.selected" ng-change="onChange()"></td>
+        <tr id="{{::s.id}}" class="server-row" ng-class="::{'active': s.selected}" ng-repeat="s in ::servers" ng-click="s.selected = !s.selected; onChange()">
+            <td><input type="checkbox" ng-model="s.selected"></td>
             <td data-search="^{{::s.hostName}}$">{{::s.hostName}}</td>
             <td data-search="^{{::s.cachegroup}}$">{{::s.cachegroup}}</td>
             <td data-search="^{{::s.profile}}$">{{::s.profile}}</td>
diff --git a/traffic_portal/app/src/common/modules/table/federationResolvers/table.assignFedResolvers.tpl.html b/traffic_portal/app/src/common/modules/table/federationResolvers/table.assignFedResolvers.tpl.html
index 75a03bf..2ec51f6 100644
--- a/traffic_portal/app/src/common/modules/table/federationResolvers/table.assignFedResolvers.tpl.html
+++ b/traffic_portal/app/src/common/modules/table/federationResolvers/table.assignFedResolvers.tpl.html
@@ -33,8 +33,8 @@ under the License.
         </tr>
         </thead>
         <tbody>
-        <tr id="{{::r.id}}" class="resolver-row" ng-repeat="r in ::resolvers">
-            <td><input type="checkbox" ng-checked="r.selected" ng-model="r.selected" ng-change="onChange()"></td>
+        <tr id="{{::r.id}}" class="resolver-row" ng-class="::{'active': r.selected}" ng-repeat="r in ::resolvers" ng-click="r.selected = !r.selected; onChange()">
+            <td><input type="checkbox" ng-model="r.selected"></td>
             <td data-search="^{{::r.ipAddress}}$">{{::r.ipAddress}}</td>
             <td data-search="^{{::r.type}}$">{{::r.type}}</td>
         </tr>
diff --git a/traffic_portal/app/src/common/modules/table/parameterProfiles/table.paramProfilesUnassigned.tpl.html b/traffic_portal/app/src/common/modules/table/parameterProfiles/table.paramProfilesUnassigned.tpl.html
index 74e4e02..0b2f484 100644
--- a/traffic_portal/app/src/common/modules/table/parameterProfiles/table.paramProfilesUnassigned.tpl.html
+++ b/traffic_portal/app/src/common/modules/table/parameterProfiles/table.paramProfilesUnassigned.tpl.html
@@ -35,8 +35,8 @@ under the License.
         </tr>
         </thead>
         <tbody>
-        <tr id="{{::p.id}}" class="profile-row" ng-repeat="p in ::selectedProfiles">
-            <td><input type="checkbox" ng-checked="p.selected" ng-model="p.selected" ng-change="onChange()"></td>
+        <tr id="{{::p.id}}" class="profile-row" ng-class="::{'active': p.selected}" ng-repeat="p in ::selectedProfiles" ng-click="p.selected = !p.selected; onChange()">
+            <td><input type="checkbox" ng-model="p.selected"></td>
             <td data-search="^{{::p.name}}$">{{::p.name}}</td>
             <td data-search="^{{::p.description}}$">{{::p.description}}</td>
             <td data-search="^{{::p.type}}$">{{::p.type}}</td>
diff --git a/traffic_portal/app/src/common/modules/table/profileParameters/table.profileParamsUnassigned.tpl.html b/traffic_portal/app/src/common/modules/table/profileParameters/table.profileParamsUnassigned.tpl.html
index 2a6619b..4390e2b 100644
--- a/traffic_portal/app/src/common/modules/table/profileParameters/table.profileParamsUnassigned.tpl.html
+++ b/traffic_portal/app/src/common/modules/table/profileParameters/table.profileParamsUnassigned.tpl.html
@@ -34,8 +34,8 @@ under the License.
         </tr>
         </thead>
         <tbody>
-        <tr id="{{::p.id}}" class="param-row" ng-repeat="p in ::selectedParams">
-            <td><input type="checkbox" ng-checked="p.selected" ng-model="p.selected" ng-change="onChange()"></td>
+        <tr id="{{::p.id}}" class="param-row" ng-class="::{'active': p.selected}" ng-repeat="p in ::selectedParams" ng-click="p.selected = !p.selected; onChange()">
+            <td><input type="checkbox" ng-model="p.selected"></td>
             <td data-search="^{{::p.name}}$">{{::p.name}}</td>
             <td data-search="^{{::p.configFile}}$">{{::p.configFile}}</td>
             <td data-search="^{{::p.value}}$">{{::p.value}}</td>
diff --git a/traffic_portal/app/src/common/modules/table/roleCapabilities/table.assignCapabilities.tpl.html b/traffic_portal/app/src/common/modules/table/roleCapabilities/table.assignCapabilities.tpl.html
index 81bc58a..95f9549 100644
--- a/traffic_portal/app/src/common/modules/table/roleCapabilities/table.assignCapabilities.tpl.html
+++ b/traffic_portal/app/src/common/modules/table/roleCapabilities/table.assignCapabilities.tpl.html
@@ -30,8 +30,8 @@ under the License.
         </tr>
         </thead>
         <tbody>
-        <tr id="{{::c.name}}" class="cap-row" ng-repeat="c in ::selectedCapabilities">
-            <td><input type="checkbox" ng-checked="c.selected" ng-model="c.selected" ng-change="onChange()"></td>
+        <tr id="{{::c.name}}" class="cap-row" ng-class="::{'active': c.selected}" ng-repeat="c in ::selectedCapabilities" ng-click="c.selected = !c.selected; onChange()">
+            <td><input type="checkbox" ng-model="c.selected"></td>
             <td data-search="^{{::c.name}}$">{{::c.name}}</td>
         </tr>
         </tbody>
diff --git a/traffic_portal/app/src/common/modules/table/serverDeliveryServices/table.assignDeliveryServices.tpl.html b/traffic_portal/app/src/common/modules/table/serverDeliveryServices/table.assignDeliveryServices.tpl.html
index ba9109f..7debe55 100644
--- a/traffic_portal/app/src/common/modules/table/serverDeliveryServices/table.assignDeliveryServices.tpl.html
+++ b/traffic_portal/app/src/common/modules/table/serverDeliveryServices/table.assignDeliveryServices.tpl.html
@@ -32,8 +32,8 @@ under the License.
         </tr>
         </thead>
         <tbody>
-        <tr id="{{::ds.id}}" class="ds-row" ng-repeat="ds in ::selectedDeliveryServices">
-            <td><input type="checkbox" ng-checked="ds.selected" ng-model="ds.selected" ng-change="onChange()"></td>
+        <tr id="{{::ds.id}}" class="ds-row" ng-class="::{'active': ds.selected}" ng-repeat="ds in ::selectedDeliveryServices" ng-click="ds.selected = !ds.selected; onChange()">
+            <td><input type="checkbox" ng-model="ds.selected"></td>
             <td data-search="^{{::ds.xmlId}}$">{{::ds.xmlId}}</td>
             <td data-search="^{{::ds.displayName}}$">{{::ds.displayName}}</td>
             <td data-search="^{{::ds.type}}$">{{::ds.type}}</td>