Skip to content

Commit 2a98911

Browse files
Hide hidden columns from trace viewer
Use the "type" parameter to encode hidden columns. Signed-off-by: Matthew Khouzam <[email protected]>
1 parent 8860de9 commit 2a98911

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

viewer-prototype/src/browser/trace-viewer/components/table-output-component.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import { AgGridReact } from 'ag-grid-react';
55
import { ColDef, IDatasource, GridReadyEvent } from 'ag-grid-community';
66
import { QueryHelper } from 'tsp-typescript-client/lib/models/query/query-helper';
77
import { cloneDeep } from 'lodash';
8-
8+
interface ColumnHeaderType {
9+
hidden: boolean;
10+
tag: string;
11+
}
912
type TableOuputState = AbstractOutputState & {
1013
tableColumns: ColDef[];
1114
};
@@ -140,12 +143,21 @@ export class TableOutputComponent extends AbstractOutputComponent<TableOutputPro
140143
}
141144

142145
columnEntries.forEach(columnHeader => {
146+
const typeString: string | null = columnHeader.type;
147+
let hiddenColumn = false;
148+
if (typeString) {
149+
const type: ColumnHeaderType = JSON.parse(typeString);
150+
hiddenColumn = type.hidden;
151+
}
152+
143153
const id = this.showIndexColumn ? ++columnHeader.id : columnHeader.id;
144154
colIds.push(id);
145155
columnsArray.push({
146156
headerName: columnHeader.name,
147157
field: columnHeader.id.toString(),
148-
width: this.props.columnWidth
158+
width: this.props.columnWidth,
159+
hide: hiddenColumn
160+
149161
});
150162
});
151163

@@ -159,5 +171,6 @@ export class TableOutputComponent extends AbstractOutputComponent<TableOutputPro
159171
this.setState({
160172
tableColumns: this.columnArray
161173
});
174+
162175
}
163176
}

0 commit comments

Comments
 (0)