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 2020/08/04 14:37:02 UTC

[trafficcontrol] branch master updated: Dont allow selecting rows for topology ds (#4929)

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 d407df2  Dont allow selecting rows for topology ds (#4929)
d407df2 is described below

commit d407df2f7181ccfe50a3cea9cf64478406c2ab6f
Author: Steve Hamrick <sh...@users.noreply.github.com>
AuthorDate: Tue Aug 4 08:36:49 2020 -0600

    Dont allow selecting rows for topology ds (#4929)
    
    * Dont allow selecting rows for topology ds
---
 .../TableAssignDeliveryServicesController.js                       | 7 +++++++
 .../serverDeliveryServices/table.assignDeliveryServices.tpl.html   | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/traffic_portal/app/src/common/modules/table/serverDeliveryServices/TableAssignDeliveryServicesController.js b/traffic_portal/app/src/common/modules/table/serverDeliveryServices/TableAssignDeliveryServicesController.js
index 83c0821..ede43ac 100644
--- a/traffic_portal/app/src/common/modules/table/serverDeliveryServices/TableAssignDeliveryServicesController.js
+++ b/traffic_portal/app/src/common/modules/table/serverDeliveryServices/TableAssignDeliveryServicesController.js
@@ -61,6 +61,13 @@ var TableAssignDeliveryServicesController = function(server, deliveryServices, a
 		return ds;
 	});
 
+	$scope.toggleRow = function(ds) {
+		if (!ds.topology) {
+			ds.selected = !ds.selected;
+			$scope.onChange();
+		}
+	};
+
 	$scope.selectAll = function($event) {
 		var checkbox = $event.target;
 		if (checkbox.checked) {
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 b532f4b..698e0e8 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,7 +32,7 @@ under the License.
         </tr>
         </thead>
         <tbody>
-        <tr id="{{::ds.id}}" class="ds-row" ng-class="::{'active': ds.selected}" ng-repeat="ds in ::selectedDeliveryServices" ng-click="ds.selected = !ds.selected; onChange()">
+        <tr id="{{::ds.id}}" class="ds-row" ng-class="::{'active': ds.selected}" ng-repeat="ds in ::selectedDeliveryServices" ng-click="toggleRow(ds)">
             <td><input type="checkbox" ng-model="ds.selected" ng-disabled="ds.topology"></td>
             <td data-search="^{{::ds.xmlId}}$">{{::ds.xmlId}}</td>
             <td data-search="^{{::ds.displayName}}$">{{::ds.displayName}}</td>