feat(dashboard): Add cross filter from context menu (#23141)

This commit is contained in:
Kamil Gabryjelski
2023-02-23 17:05:41 +01:00
committed by GitHub
parent 95eb8d79d0
commit ee1952e488
26 changed files with 896 additions and 753 deletions

View File

@@ -393,6 +393,7 @@ export class TableRenderer extends React.Component {
// Iterate through columns. Jump over duplicate values.
let i = 0;
while (i < visibleColKeys.length) {
let handleContextMenu;
const colKey = visibleColKeys[i];
const colSpan = attrIdx < colKey.length ? colAttrSpans[i][attrIdx] : 1;
let colLabelClass = 'pvtColLabel';
@@ -402,6 +403,10 @@ export class TableRenderer extends React.Component {
!omittedHighlightHeaderGroups.includes(colAttrs[attrIdx])
) {
colLabelClass += ' hoverable';
handleContextMenu = e =>
this.props.onContextMenu(e, colKey, undefined, {
[attrName]: colKey[attrIdx],
});
}
if (
highlightedHeaderCells &&
@@ -434,6 +439,7 @@ export class TableRenderer extends React.Component {
attrIdx,
this.props.tableOptions.clickColumnHeaderCallback,
)}
onContextMenu={handleContextMenu}
>
{displayHeaderCell(
needToggle,
@@ -590,12 +596,17 @@ export class TableRenderer extends React.Component {
const colIncrSpan = colAttrs.length !== 0 ? 1 : 0;
const attrValueCells = rowKey.map((r, i) => {
let handleContextMenu;
let valueCellClassName = 'pvtRowLabel';
if (
highlightHeaderCellsOnHover &&
!omittedHighlightHeaderGroups.includes(rowAttrs[i])
) {
valueCellClassName += ' hoverable';
handleContextMenu = e =>
this.props.onContextMenu(e, undefined, rowKey, {
[rowAttrs[i]]: r,
});
}
if (
highlightedHeaderCells &&
@@ -631,6 +642,7 @@ export class TableRenderer extends React.Component {
i,
this.props.tableOptions.clickRowHeaderCallback,
)}
onContextMenu={handleContextMenu}
>
{displayHeaderCell(
needRowToggle,