-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change rendering/behavior of ILO/Mgmt IPs in Traffic Portal Servers list #5332
base: master
Are you sure you want to change the base?
Change rendering/behavior of ILO/Mgmt IPs in Traffic Portal Servers list #5332
Conversation
- added new cell renderer (ILOCellRenderer) - added new click handler for SSHCellRenderers and ILOCellRenderers
- both ssh/ilo cell renderers are now divs instead of a elements - a value associated with the cell has been added to both indicating what href to open - openCellInNewWindow() updated to use this value - onRowClick updated to not navigate if column's cells have either of these renderers
thanks @MylesBock - maybe @shamrickus can review? |
no problem, I would say so ag-grid is not my forte for sure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR should have an entry in CHANGELOG.md
@@ -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 = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd move this to a field on the controller since it never changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10-4, this was added mostly last minute to ensure that the default behavior for the row wasn't applied
this.eGui.textContent = params.value; | ||
this.data.cellHrefValue = "ssh://" + userModel.user.username + "@" + params.value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This literally crossed my mind Saturday afternoon 🙃
I need to figure out where it's approps to stash this, the context presently isn't correct of course
"ipGateway", | ||
"ipAddress" | ||
]; | ||
let columnId = params.column.getColId(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting params.column
is undefined
}; | ||
SSHCellRenderer.prototype.getGui = function() {return this.eGui;}; | ||
|
||
function ILOCellRenderer() {} | ||
ILOCellRenderer.prototype.init = function(params) { | ||
this.eGui = document.createElement("div"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I'll dig into this one tomorrow
What does this PR (Pull Request) do?
Updates
TableServersController
to change the behavior for the ag-grid.A new renderer is introduced and the previous SSHCellRenderer has been updated to use a
div
instead of ana
tagThe corresponding
onRowClick
behavior was also updated to ignore navigation when these columns are clickedWhich Traffic Control components are affected by this PR?
What is the best way to verify this PR?
Fire up TP with this branch, ensure ILO columns open to the iLO interface via HTTPS and the 'normal' mgmt IPs open a tab with an SSH target. Also ensure that when either of these are clicked the page remains the same.
If this is a bug fix, what versions of Traffic Control are affected?
The following criteria are ALL met by this PR