Skip to content

Commit

Permalink
[Discover] Fix hiding histogram for rollup data views (#137157)
Browse files Browse the repository at this point in the history
* [Discover] hide chart for rollup data views

* [Discover] change implementation

* [Discover] apply suggestion

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
dimaanj and kibanamachine authored Jul 28, 2022
1 parent cb5b4cb commit 0a938d5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ async function mountComponent(isTimeBased: boolean = false) {
} as unknown as GetStateReturn,
viewMode: VIEW_MODE.DOCUMENT_LEVEL,
setDiscoverViewMode: jest.fn(),
isTimeBased,
};

let instance: ReactWrapper = {} as ReactWrapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export function DiscoverChart({
setDiscoverViewMode,
hideChart,
interval,
isTimeBased,
}: {
resetSavedSearch: () => void;
savedSearch: SavedSearch;
Expand All @@ -55,10 +56,10 @@ export function DiscoverChart({
dataView: DataView;
viewMode: VIEW_MODE;
setDiscoverViewMode: (viewMode: VIEW_MODE) => void;
isTimeBased: boolean;
hideChart?: boolean;
interval?: string;
}) {
const isTimeBased = dataView.isTimeBased();
const { uiSettings, data, storage } = useDiscoverServices();
const [showChartOptionsPopover, setShowChartOptionsPopover] = useState(false);
const showViewModeToggle = uiSettings.get(SHOW_FIELD_STATISTICS) ?? false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ export function DiscoverLayout({
setDiscoverViewMode={setDiscoverViewMode}
hideChart={state.hideChart}
interval={state.interval}
isTimeBased={isTimeBased}
/>
</EuiFlexItem>
<EuiHorizontalRule margin="none" />
Expand Down

0 comments on commit 0a938d5

Please sign in to comment.