Skip to content

Commit 70a2a64

Browse files
committed
fix: aggregating view detector improvement
1 parent 63fac3e commit 70a2a64

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

src/pages/audit-report/types/index.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,23 @@ export interface ViewResult {
486486
panels?: PanelResult[];
487487
columnOptions?: Record<string, ColumnFilterOptions>;
488488
variables?: ViewVariable[];
489+
490+
/**
491+
* Card display configuration for tabular data.
492+
*
493+
* This controls presentation (e.g. card layout/default mode) and does not
494+
* contain primary result data by itself.
495+
*/
489496
card?: DisplayCard;
497+
498+
/**
499+
* Table display configuration (e.g. default sort and page size).
500+
*
501+
* This controls presentation/query defaults and does not contain primary
502+
* result data by itself.
503+
*/
490504
table?: DisplayTable;
505+
491506
requestFingerprint: string;
492507
sections?: ViewSection[];
493508
}

src/pages/views/components/ViewContent.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ const ViewContent: React.FC<ViewContentProps> = React.memo(
2727
}) => {
2828
const { panels, columns } = viewResult;
2929

30+
const hasPrimaryContent =
31+
(Array.isArray(panels) && panels.length > 0) ||
32+
(Array.isArray(columns) && columns.length > 0);
33+
3034
const isAggregatorView =
31-
viewResult.sections &&
32-
viewResult.sections.length > 0 &&
33-
!panels &&
34-
!columns;
35+
Boolean(viewResult.sections?.length) && !hasPrimaryContent;
3536

3637
const showVariables =
3738
!hideVariables && aggregatedVariables && aggregatedVariables.length > 0;

0 commit comments

Comments
 (0)