Skip to content

Commit

Permalink
remove filter icons when charts shown in cases
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarezmelissa87 committed Nov 19, 2024
1 parent ddf324a commit f3d3d30
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 1 deletion.

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

0 comments on commit f3d3d30

Please sign in to comment.