-
Notifications
You must be signed in to change notification settings - Fork 60
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
Hide hidden columns from trace viewer #179
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,10 @@ import { AgGridReact } from 'ag-grid-react'; | |
import { ColDef, IDatasource, GridReadyEvent } from 'ag-grid-community'; | ||
import { QueryHelper } from 'tsp-typescript-client/lib/models/query/query-helper'; | ||
import { cloneDeep } from 'lodash'; | ||
|
||
interface ColumnHeaderType { | ||
hidden: boolean; | ||
tag: string; | ||
} | ||
type TableOuputState = AbstractOutputState & { | ||
tableColumns: ColDef[]; | ||
}; | ||
|
@@ -140,12 +143,21 @@ export class TableOutputComponent extends AbstractOutputComponent<TableOutputPro | |
} | ||
|
||
columnEntries.forEach(columnHeader => { | ||
const typeString: string | null = columnHeader.type; | ||
let hiddenColumn = false; | ||
if (typeString) { | ||
const type: ColumnHeaderType = JSON.parse(typeString); | ||
hiddenColumn = type.hidden; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. check for undefined when the 'hidden' property doesn't exist. |
||
} | ||
|
||
const id = this.showIndexColumn ? ++columnHeader.id : columnHeader.id; | ||
colIds.push(id); | ||
columnsArray.push({ | ||
headerName: columnHeader.name, | ||
field: columnHeader.id.toString(), | ||
width: this.props.columnWidth | ||
width: this.props.columnWidth, | ||
hide: hiddenColumn | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the ag-grid, the hide property accepts boolean. In our case, the hidden column is set to string after JSON.parse. It's good to set to boolean though it works in this case. |
||
|
||
}); | ||
}); | ||
|
||
|
@@ -159,5 +171,6 @@ export class TableOutputComponent extends AbstractOutputComponent<TableOutputPro | |
this.setState({ | ||
tableColumns: this.columnArray | ||
}); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove |
||
} | ||
} |
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.
the column type field will need to be better documented in the tsp to mention those header types. But I guess that will be part of a more complete overhaul of the data type definition that we discussed a few weeks ago. Right now, the type is a string, while this code suggests it should be an object.