shamrickus commented on a change in pull request #5332:
URL: https://github.com/apache/trafficcontrol/pull/5332#discussion_r533835819



##########
File path: 
traffic_portal/app/src/common/modules/table/servers/TableServersController.js
##########
@@ -23,13 +23,22 @@ var TableServersController = function(tableName, servers, 
filter, $scope, $state
        // browserify can't handle classes...
        function SSHCellRenderer() {}
        SSHCellRenderer.prototype.init = function(params) {
-               this.eGui = document.createElement("A");
-               this.eGui.href = "ssh://" + userModel.user.username + "@" + 
params.value;
-               this.eGui.setAttribute("target", "_blank");
+               this.eGui = document.createElement("div");
                this.eGui.textContent = params.value;
+               this.data.cellHrefValue = "ssh://" + userModel.user.username + 
"@" + params.value;

Review comment:
       Getting `this.data` is undefined on page load
   ```
   Uncaught TypeError: this.data is undefined
       init 
https://localhost/resources/assets/js/app.js?built=1606856003402:24254
       initComponent 
https://localhost/resources/assets/js/ag-grid-community/dist/ag-grid-community.min.js:8
       createAndInitUserComponent 
https://localhost/resources/assets/js/ag-grid-community/dist/ag-grid-community.min.js:8
       newCellRenderer 
https://localhost/resources/assets/js/ag-grid-community/dist/ag-grid-community.min.js:8
       createCellRendererFunc 
https://localhost/resources/assets/js/ag-grid-community/dist/ag-grid-community.min.js:8
       executeFrame 
https://localhost/resources/assets/js/ag-grid-community/dist/ag-grid-community.min.js:8
       requestFrame 
https://localhost/resources/assets/js/ag-grid-community/dist/ag-grid-community.min.js:8
   app.js:24254:3```

##########
File path: 
traffic_portal/app/src/common/modules/table/servers/TableServersController.js
##########
@@ -365,7 +379,16 @@ var TableServersController = function(tableName, servers, 
filter, $scope, $state
                },
                onRowClicked: function(params) {
                        const selection = window.getSelection().toString();
-                       if(selection === "" || selection === 
$scope.mouseDownSelectionText) {
+                       const overrideCells = [

Review comment:
       I'd move this to a field on the controller since it never changes.

##########
File path: 
traffic_portal/app/src/common/modules/table/servers/TableServersController.js
##########
@@ -365,7 +379,16 @@ var TableServersController = function(tableName, servers, 
filter, $scope, $state
                },
                onRowClicked: function(params) {
                        const selection = window.getSelection().toString();
-                       if(selection === "" || selection === 
$scope.mouseDownSelectionText) {
+                       const overrideCells = [
+                               "iloIpAddress",
+                               "iloIpGateway",
+                               "mgmtIpGateway",
+                               "mgmtIpNetmask",
+                               "ipGateway",
+                               "ipAddress"
+                       ];
+                       let columnId = params.column.getColId();

Review comment:
       Getting `params.column` is undefined

##########
File path: 
traffic_portal/app/src/common/modules/table/servers/TableServersController.js
##########
@@ -23,13 +23,22 @@ var TableServersController = function(tableName, servers, 
filter, $scope, $state
        // browserify can't handle classes...
        function SSHCellRenderer() {}
        SSHCellRenderer.prototype.init = function(params) {
-               this.eGui = document.createElement("A");
-               this.eGui.href = "ssh://" + userModel.user.username + "@" + 
params.value;
-               this.eGui.setAttribute("target", "_blank");
+               this.eGui = document.createElement("div");
                this.eGui.textContent = params.value;
+               this.data.cellHrefValue = "ssh://" + userModel.user.username + 
"@" + params.value;
+
        };
        SSHCellRenderer.prototype.getGui = function() {return this.eGui;};
 
+       function ILOCellRenderer() {}
+       ILOCellRenderer.prototype.init = function(params) {
+               this.eGui = document.createElement("div");

Review comment:
       ILOCellRenderer never gets initialized. I believe it's because all of 
the columns it's on are hidden by default (the SSHCellRenderer has one that is 
not, so it does get initialized). 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to