mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[8.x] [ML] Anomaly Detection anomaly charts: remove filter icons for charts displayed in cases (#200821) (#201855)
# Backport This will backport the following commits from `main` to `8.x`: - [[ML] Anomaly Detection anomaly charts: remove filter icons for charts displayed in cases (#200821)](https://github.com/elastic/kibana/pull/200821) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Melissa Alvarez","email":"melissa.alvarez@elastic.co"},"sourceCommit":{"committedDate":"2024-11-26T18:36:58Z","message":"[ML] Anomaly Detection anomaly charts: remove filter icons for charts displayed in cases (#200821)\n\n## Summary\r\n\r\nFixes https://github.com/elastic/kibana/issues/199549\r\n\r\nThis PR hides the filter icons for anomaly charts embeddable in cases as\r\nthey do not have any functionality there.\r\n\r\nCases:\r\n<img width=\"947\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/78c7c059-f289-4dcc-97bd-8eadcd03e37c\">\r\n\r\nDashboards:\r\n<img width=\"737\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/368c718a-62bb-4277-90d1-ad0f156a7d08\">\r\n\r\nexplorer:\r\n<img width=\"1089\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/20b2bda8-a81a-4d57-b831-be6e0fb3e170\">\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [ ] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [ ]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] If a plugin configuration key changed, check if it needs to be\r\nallowlisted in the cloud and added to the [docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n- [ ] This was checked for breaking HTTP API changes, and any breaking\r\nchanges have been approved by the breaking-change committee. The\r\n`release_note:breaking` label should be applied in these situations.\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n- [ ] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_node:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"f635b32c6169af8f3866b86f62557a9b435f7e98","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","Feature:Anomaly Detection","release_note:skip","v9.0.0","backport:version","v8.17.0","v8.18.0"],"title":"[ML] Anomaly Detection anomaly charts: remove filter icons for charts displayed in cases","number":200821,"url":"https://github.com/elastic/kibana/pull/200821","mergeCommit":{"message":"[ML] Anomaly Detection anomaly charts: remove filter icons for charts displayed in cases (#200821)\n\n## Summary\r\n\r\nFixes https://github.com/elastic/kibana/issues/199549\r\n\r\nThis PR hides the filter icons for anomaly charts embeddable in cases as\r\nthey do not have any functionality there.\r\n\r\nCases:\r\n<img width=\"947\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/78c7c059-f289-4dcc-97bd-8eadcd03e37c\">\r\n\r\nDashboards:\r\n<img width=\"737\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/368c718a-62bb-4277-90d1-ad0f156a7d08\">\r\n\r\nexplorer:\r\n<img width=\"1089\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/20b2bda8-a81a-4d57-b831-be6e0fb3e170\">\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [ ] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [ ]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] If a plugin configuration key changed, check if it needs to be\r\nallowlisted in the cloud and added to the [docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n- [ ] This was checked for breaking HTTP API changes, and any breaking\r\nchanges have been approved by the breaking-change committee. The\r\n`release_note:breaking` label should be applied in these situations.\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n- [ ] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_node:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"f635b32c6169af8f3866b86f62557a9b435f7e98"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200821","number":200821,"mergeCommit":{"message":"[ML] Anomaly Detection anomaly charts: remove filter icons for charts displayed in cases (#200821)\n\n## Summary\r\n\r\nFixes https://github.com/elastic/kibana/issues/199549\r\n\r\nThis PR hides the filter icons for anomaly charts embeddable in cases as\r\nthey do not have any functionality there.\r\n\r\nCases:\r\n<img width=\"947\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/78c7c059-f289-4dcc-97bd-8eadcd03e37c\">\r\n\r\nDashboards:\r\n<img width=\"737\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/368c718a-62bb-4277-90d1-ad0f156a7d08\">\r\n\r\nexplorer:\r\n<img width=\"1089\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/20b2bda8-a81a-4d57-b831-be6e0fb3e170\">\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [ ] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [ ]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] If a plugin configuration key changed, check if it needs to be\r\nallowlisted in the cloud and added to the [docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n- [ ] This was checked for breaking HTTP API changes, and any breaking\r\nchanges have been approved by the breaking-change committee. The\r\n`release_note:breaking` label should be applied in these situations.\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n- [ ] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_node:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"f635b32c6169af8f3866b86f62557a9b435f7e98"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Melissa Alvarez <melissa.alvarez@elastic.co>
This commit is contained in:
parent
cf4dc3769b
commit
39db30978d
6 changed files with 17 additions and 1 deletions
|
@ -20,6 +20,7 @@ exports[`ExplorerChartLabelBadge Render the chart label in one line. 1`] = `
|
|||
}
|
||||
}
|
||||
/>
|
||||
|
||||
|
||||
<span
|
||||
className="ml-explorer-chart-info-icon"
|
||||
|
@ -97,6 +98,7 @@ exports[`ExplorerChartLabelBadge Render the chart label in two lines. 1`] = `
|
|||
}
|
||||
}
|
||||
/>
|
||||
|
||||
</span>
|
||||
</Fragment>
|
||||
`;
|
||||
|
|
|
@ -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:
|
||||
//
|
||||
|
@ -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}
|
||||
/>
|
||||
) : (
|
||||
<> </>
|
||||
)}
|
||||
</Fragment>
|
||||
);
|
||||
|
|
|
@ -39,6 +39,7 @@ interface ExplorerAnomaliesContainerProps {
|
|||
showSelectedInterval?: boolean;
|
||||
chartsService: ChartsPluginStart;
|
||||
timeRange: { from: string; to: string } | undefined;
|
||||
showFilterIcons: boolean;
|
||||
}
|
||||
|
||||
const tooManyBucketsCalloutMsg = i18n.translate(
|
||||
|
@ -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
|
||||
|
@ -102,6 +104,7 @@ export const ExplorerAnomaliesContainer: FC<ExplorerAnomaliesContainerProps> = (
|
|||
showSelectedInterval,
|
||||
chartsService,
|
||||
id,
|
||||
showFilterIcons,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
|
|
@ -100,6 +100,7 @@ function ExplorerChartContainer({
|
|||
tooManyBucketsCalloutMsg,
|
||||
showSelectedInterval,
|
||||
chartsService,
|
||||
showFilterIcons,
|
||||
}) {
|
||||
const [explorerSeriesLink, setExplorerSeriesLink] = useState('');
|
||||
const [mapsLink, setMapsLink] = useState('');
|
||||
|
@ -258,6 +259,7 @@ function ExplorerChartContainer({
|
|||
infoTooltip={{ ...series.infoTooltip, chartType }}
|
||||
wrapLabel={wrapLabel}
|
||||
onSelectEntity={onSelectEntity}
|
||||
showFilterIcons={showFilterIcons}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem grow={false}>
|
||||
|
@ -394,6 +396,7 @@ export const ExplorerChartsContainerUI = ({
|
|||
tooManyBucketsCalloutMsg,
|
||||
showSelectedInterval,
|
||||
chartsService,
|
||||
showFilterIcons = true,
|
||||
}) => {
|
||||
const {
|
||||
services: { embeddable: embeddablePlugin, maps: mapsPlugin },
|
||||
|
@ -460,6 +463,7 @@ export const ExplorerChartsContainerUI = ({
|
|||
tooManyBucketsCalloutMsg={tooManyBucketsCalloutMsg}
|
||||
showSelectedInterval={showSelectedInterval}
|
||||
chartsService={chartsService}
|
||||
showFilterIcons={showFilterIcons}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
);
|
||||
|
|
|
@ -80,6 +80,7 @@ const AnomalyChartsCaseAttachment = ({
|
|||
onRenderComplete={api.onRenderComplete}
|
||||
onError={api.onError}
|
||||
timeRange$={api.parentApi.timeRange$}
|
||||
showFilterIcons={false}
|
||||
/>
|
||||
</KibanaContextProvider>
|
||||
</KibanaRenderContextProvider>
|
||||
|
|
|
@ -51,6 +51,7 @@ export interface AnomalyChartsContainerProps
|
|||
onRenderComplete: () => void;
|
||||
onLoading: (v: boolean) => void;
|
||||
onError: (error: Error) => void;
|
||||
showFilterIcons?: boolean;
|
||||
}
|
||||
|
||||
const AnomalyChartsContainer: FC<AnomalyChartsContainerProps> = ({
|
||||
|
@ -62,6 +63,7 @@ const AnomalyChartsContainer: FC<AnomalyChartsContainerProps> = ({
|
|||
onError,
|
||||
onLoading,
|
||||
api,
|
||||
showFilterIcons = true,
|
||||
}) => {
|
||||
const isMounted = useMountedState();
|
||||
|
||||
|
@ -284,6 +286,7 @@ const AnomalyChartsContainer: FC<AnomalyChartsContainerProps> = ({
|
|||
showSelectedInterval={false}
|
||||
chartsService={chartsService}
|
||||
timeRange={timeRange}
|
||||
showFilterIcons={showFilterIcons}
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue