Skip to content
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

[ML] Anomaly Detection anomaly charts: remove filter icons for charts displayed in cases #200821

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export function ExplorerChartLabel({
isEmbeddable,
wrapLabel = false,
onSelectEntity,
showFilterIcons,
}) {
// Depending on whether we wrap the entityField badges to a new line, we render this differently:
//
Expand Down Expand Up @@ -51,13 +52,15 @@ export function ExplorerChartLabel({
return (
<Fragment key={`badge-wrapper-${key}`}>
<ExplorerChartLabelBadge entity={entity} />
{onSelectEntity !== undefined && (
{onSelectEntity !== undefined && showFilterIcons === true ? (
<EntityFilter
isEmbeddable={isEmbeddable}
onFilter={applyFilter}
influencerFieldName={entity.fieldName}
influencerFieldValue={entity.fieldValue}
/>
) : (
<>&nbsp;</>
)}
</Fragment>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ interface ExplorerAnomaliesContainerProps {
showSelectedInterval?: boolean;
chartsService: ChartsPluginStart;
timeRange: { from: string; to: string } | undefined;
showFilterIcons: boolean;
}

const tooManyBucketsCalloutMsg = i18n.translate(
Expand All @@ -63,6 +64,7 @@ export const ExplorerAnomaliesContainer: FC<ExplorerAnomaliesContainerProps> = (
showSelectedInterval,
chartsService,
timeRange,
showFilterIcons,
}) => {
return (
// TODO: Remove data-shared-item and data-rendering-count as part of https://github.com/elastic/kibana/issues/179376
Expand Down Expand Up @@ -102,6 +104,7 @@ export const ExplorerAnomaliesContainer: FC<ExplorerAnomaliesContainerProps> = (
showSelectedInterval,
chartsService,
id,
showFilterIcons,
}}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ function ExplorerChartContainer({
tooManyBucketsCalloutMsg,
showSelectedInterval,
chartsService,
showFilterIcons,
}) {
const [explorerSeriesLink, setExplorerSeriesLink] = useState('');
const [mapsLink, setMapsLink] = useState('');
Expand Down Expand Up @@ -258,6 +259,7 @@ function ExplorerChartContainer({
infoTooltip={{ ...series.infoTooltip, chartType }}
wrapLabel={wrapLabel}
onSelectEntity={onSelectEntity}
showFilterIcons={showFilterIcons}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
Expand Down Expand Up @@ -394,6 +396,7 @@ export const ExplorerChartsContainerUI = ({
tooManyBucketsCalloutMsg,
showSelectedInterval,
chartsService,
showFilterIcons = true,
}) => {
const {
services: { embeddable: embeddablePlugin, maps: mapsPlugin },
Expand Down Expand Up @@ -460,6 +463,7 @@ export const ExplorerChartsContainerUI = ({
tooManyBucketsCalloutMsg={tooManyBucketsCalloutMsg}
showSelectedInterval={showSelectedInterval}
chartsService={chartsService}
showFilterIcons={showFilterIcons}
/>
</EuiFlexItem>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const AnomalyChartsCaseAttachment = ({
onRenderComplete={api.onRenderComplete}
onError={api.onError}
timeRange$={api.parentApi.timeRange$}
showFilterIcons={false}
/>
</KibanaContextProvider>
</KibanaRenderContextProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface AnomalyChartsContainerProps
onRenderComplete: () => void;
onLoading: (v: boolean) => void;
onError: (error: Error) => void;
showFilterIcons?: boolean;
}

const AnomalyChartsContainer: FC<AnomalyChartsContainerProps> = ({
Expand All @@ -62,6 +63,7 @@ const AnomalyChartsContainer: FC<AnomalyChartsContainerProps> = ({
onError,
onLoading,
api,
showFilterIcons = true,
}) => {
const isMounted = useMountedState();

Expand Down Expand Up @@ -284,6 +286,7 @@ const AnomalyChartsContainer: FC<AnomalyChartsContainerProps> = ({
showSelectedInterval={false}
chartsService={chartsService}
timeRange={timeRange}
showFilterIcons={showFilterIcons}
/>
) : null}
</div>
Expand Down