-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Single Metric Viewer embeddable: Adds action for dashboard to apply filter from the embeddable to the page #198869
[ML] Single Metric Viewer embeddable: Adds action for dashboard to apply filter from the embeddable to the page #198869
Conversation
Pinging @elastic/ml-ui (:ml) |
...ion/explorer/explorer_charts/components/explorer_chart_label/entity_filter/entity_filter.tsx
Outdated
Show resolved
Hide resolved
@@ -59,7 +59,7 @@ export const EntityFilter: FC<EntityFilterProps> = ({ | |||
content={ | |||
<FormattedMessage | |||
id="xpack.ml.entityFilter.removeFilterTooltip" | |||
defaultMessage="Remove filter" | |||
defaultMessage="Add negate filter for value" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't seem to have any docs about what a negate filter is, other than perhaps https://www.elastic.co/guide/en/kibana/current/kuery-query.html#_negating_a_query, so my inclination is to try to make it a bit clearer. For example:
defaultMessage="Add negate filter for value" | |
defaultMessage="Add negate filter to exclude the value" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discover and Lens use 'Filter out value' here. What do you think about that more concise text @lcawl ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I agree that's clearer.
...lication/timeseriesexplorer/timeseriesexplorer_embeddable_chart/timeseriesexplorer_title.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and overall looks good. Added some comments on the styling and text used for the filter controls.
@elasticmachine merge upstream |
{entityData.entities.map((entity, i) => { | ||
return ( | ||
<EuiFlexItem grow={false}> | ||
<EuiFlexGroup gutterSize="none" alignItems="center"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any tweak we can make to the flex layout here to prevent the large gap between the entity field name / value text and the filter icons as the labels grow in length?
For that job I used the filebeat_ecs
QAF bootstrap template, and then this job config:
"analysis_config": {
"bucket_span": "1h",
"detectors": [
{
"detector_description": "mean(\"http.response.body.bytes\") by \"http.request.referrer\" partitionfield=\"host.id\"",
"function": "mean",
"field_name": "http.response.body.bytes",
"by_field_name": "http.request.referrer",
"partition_field_name": "host.id",
"detector_index": 0
}
],
"influencers": [
"host.id",
"http.request.referrer"
],
"model_prune_window": "30d"
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is part of the flex components responsive behavior - the text tries to wrap at the hyphens until it can fit fully 🤔 I tried using EuiTextTruncate
but the gap is still there so I think it's better to have the full value. I can dig deeper with someone in EUI to see if there's anything else we can do other than the props provided for the flex group.
smv-filter-resize.mp4
influencerFieldName={entity.fieldName} | ||
influencerFieldValue={entity.fieldValue} | ||
/> | ||
<EuiFlexItem grow={false}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably needs a separate issue - happens on main
and also affects the charts when in the Anomaly Explorer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to improve it in 9b52eef for dashboards with truncating and adding in a tooltip for the full entity value:
Note that the badges in the explorer view will still overlap. We should create a separate issue for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest changes look good for shorter field name / values. Separate issue created to improve for long values: #199549
content={ | ||
<FormattedMessage | ||
id="xpack.ml.entityFilter.removeFilterTooltip" | ||
defaultMessage={mode ? 'Filter out' : 'Remove filter'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need two different translations. There can't be two possible values for one translation ID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch - updated in 41c37ae
@@ -23,6 +23,7 @@ import type { AnomaliesTableData } from '../explorer_utils'; | |||
|
|||
interface ExplorerAnomaliesContainerProps { | |||
id: string; | |||
mode?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this have union of explicit values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it looks like this is always supplied, so doesn't need to be optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, higher up in the component chain, it will either not be provided or be "embeddable" - but by this point it will always be provided. Updated in 41c37ae
}; | ||
|
||
interface SingleMetricViewerTitleProps { | ||
api: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this any
be replaced with the correct type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 41c37ae
<EuiButtonIcon | ||
size="xs" | ||
onClick={() => { | ||
const trigger = uiActions.getTrigger(SINGLE_METRIC_VIEWER_ENTITY_FIELD_SELECTION_TRIGGER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as this is calling getTrigger
it might be more efficient if the whole function was declared above and wrapped in a useCallback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to a function wrapped in useCallback in 41c37ae
@@ -17,14 +20,16 @@ const SingleMetricViewerLazy = dynamic(async () => import('./single_metric_viewe | |||
export const getSingleMetricViewerComponent = ( | |||
coreStart: CoreStart, | |||
pluginStart: MlDependencies, | |||
mlServices: SingleMetricViewerServices | |||
mlServices: SingleMetricViewerServices, | |||
api?: SingleMetricViewerEmbeddableApi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
api is optional here, but in TimeSeriesExplorerEmbeddableChart
it is non-optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 41c37ae
@@ -48,16 +49,30 @@ export function ExplorerChartLabel({ | |||
const entityFieldBadges = entityFields.map((entity) => { | |||
const key = `${infoTooltip.chartFunction}-${entity.fieldName}-${entity.fieldType}-${entity.fieldValue}`; | |||
return ( | |||
<Fragment key={`badge-wrapper-${key}`}> | |||
<ExplorerChartLabelBadge entity={entity} /> | |||
<EuiFlexGroup gutterSize="none" alignItems="center" key={`badge-wrapper-${key}`}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I went ahead and reverted most of the changes to this layout since it relies on some css and made the least amount of changes possible. 21cb885
We should update this to use components in a separate PR.
@elasticmachine merge upstream |
/ci |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested latest changes and LGTM
@@ -23,6 +23,7 @@ import type { AnomaliesTableData } from '../explorer_utils'; | |||
|
|||
interface ExplorerAnomaliesContainerProps { | |||
id: string; | |||
mode: 'embeddable'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if mode
is always passed in and always has the value embeddable
, does it need to be passed in at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is basically a flag that we pass down to the filter icons to know what action they should be doing depending on whether they are used in the explorer in ML or in the embeddable/dashboard.
At this level it's always here because this is the component dashboard uses but then both it and the explorer and
use <ExplorerChartsContainer
which is where we need to get the flag to. We only care whether it's there or not.
Now that you mention it, it probably would make more sense to have a flag like isEmbedded
or isDashboard
instead since it really is used more as a boolean flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the code, ExplorerAnomaliesContainer
is only used once, where mode="embeddable"
is passed in.
This was why I was questioning it, it appears that ExplorerAnomaliesContainer
doesn't need it as a prop as the value never changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you're right. The naming tripped me up. So, removed it from ExplorerAnomaliesContainer and, since I use it more as a boolean flag for the tooltip content in entity filter, I updated the naming and made it a boolean in the lower components we do need it in. 8a4ccbf
Thanks, @jgowdyelastic 🙏
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/ci |
@elasticmachine merge upstream |
/ci |
💔 Build Failed
Failed CI StepsTest Failures
Metrics [docs]
History
|
@elasticmachine merge upstream |
Starting backport for target branches: 8.x |
…ly filter from the embeddable to the page (elastic#198869) ## Summary Related meta issue: elastic#187483 This PR adds the ability to add a filter and a negate filter to a dashboard via plus and minus icons in the SMV embeddable panel. This PR also updates the behavior of the anomaly charts panel in dashboards so that the minus icon works as a negate filter instead of removing the filter. This behavior is consistent with other plus/minus icons next to values in dashboard panels. In dashboard: <img width="1217" alt="Screenshot 2024-11-11 at 09 54 41" src="https://github.com/user-attachments/assets/a8e12ce8-3794-4ddc-93da-e3d0bf139df7"> With a by and partition field: <img width="1214" alt="Screenshot 2024-11-11 at 09 59 09" src="https://github.com/user-attachments/assets/3b508a64-8bb1-4d89-89b2-9b8d195d1cbe"> In cases: <img width="1555" alt="Screenshot 2024-11-11 at 10 00 41" src="https://github.com/user-attachments/assets/1d1ac6d7-29c8-4e84-a758-3dfc293d58fe"> Anomaly Charts in explorer: ![image](https://github.com/user-attachments/assets/6e738171-5f1a-46c2-bd34-2c8581f2a3e3) Anomaly charts in dashboard: ![image](https://github.com/user-attachments/assets/5011b44c-0a33-42a2-a869-413d4fffe4ad) ### Checklist Delete any items that are not applicable to this PR. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) --------- Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit f876540)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…to apply filter from the embeddable to the page (#198869) (#200638) # Backport This will backport the following commits from `main` to `8.x`: - [[ML] Single Metric Viewer embeddable: Add action for dashboard to apply filter from the embeddable to the page (#198869)](#198869) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Melissa Alvarez","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-18T19:08:20Z","message":"[ML] Single Metric Viewer embeddable: Add action for dashboard to apply filter from the embeddable to the page (#198869)\n\n## Summary\r\n\r\nRelated meta issue: https://github.com/elastic/kibana/issues/187483\r\n\r\nThis PR adds the ability to add a filter and a negate filter to a\r\ndashboard via plus and minus icons in the SMV embeddable panel.\r\nThis PR also updates the behavior of the anomaly charts panel in\r\ndashboards so that the minus icon works as a negate filter instead of\r\nremoving the filter. This behavior is consistent with other plus/minus\r\nicons next to values in dashboard panels.\r\n\r\nIn dashboard:\r\n\r\n<img width=\"1217\" alt=\"Screenshot 2024-11-11 at 09 54 41\"\r\nsrc=\"https://github.com/user-attachments/assets/a8e12ce8-3794-4ddc-93da-e3d0bf139df7\">\r\n\r\n\r\nWith a by and partition field:\r\n<img width=\"1214\" alt=\"Screenshot 2024-11-11 at 09 59 09\"\r\nsrc=\"https://github.com/user-attachments/assets/3b508a64-8bb1-4d89-89b2-9b8d195d1cbe\">\r\n\r\n\r\nIn cases:\r\n\r\n<img width=\"1555\" alt=\"Screenshot 2024-11-11 at 10 00 41\"\r\nsrc=\"https://github.com/user-attachments/assets/1d1ac6d7-29c8-4e84-a758-3dfc293d58fe\">\r\n\r\n\r\nAnomaly Charts in explorer:\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/6e738171-5f1a-46c2-bd34-2c8581f2a3e3)\r\n\r\nAnomaly charts in dashboard:\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/5011b44c-0a33-42a2-a869-413d4fffe4ad)\r\n\r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\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- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is usable by keyboard only (learn more\r\nabout [keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n- [ ] Any UI touched in this PR does not create any new axe failures\r\n(run axe in browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\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 renders correctly on smaller devices using a responsive\r\nlayout. (You can test this [in your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n- [ ] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"f876540dc7fc935e9cc4b7d841247ce7bca5728d","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement",":ml","Feature:Anomaly Detection","v9.0.0","Feature:Embeddables","backport:version","v8.17.0"],"title":"[ML] Single Metric Viewer embeddable: Add action for dashboard to apply filter from the embeddable to the page","number":198869,"url":"https://github.com/elastic/kibana/pull/198869","mergeCommit":{"message":"[ML] Single Metric Viewer embeddable: Add action for dashboard to apply filter from the embeddable to the page (#198869)\n\n## Summary\r\n\r\nRelated meta issue: https://github.com/elastic/kibana/issues/187483\r\n\r\nThis PR adds the ability to add a filter and a negate filter to a\r\ndashboard via plus and minus icons in the SMV embeddable panel.\r\nThis PR also updates the behavior of the anomaly charts panel in\r\ndashboards so that the minus icon works as a negate filter instead of\r\nremoving the filter. This behavior is consistent with other plus/minus\r\nicons next to values in dashboard panels.\r\n\r\nIn dashboard:\r\n\r\n<img width=\"1217\" alt=\"Screenshot 2024-11-11 at 09 54 41\"\r\nsrc=\"https://github.com/user-attachments/assets/a8e12ce8-3794-4ddc-93da-e3d0bf139df7\">\r\n\r\n\r\nWith a by and partition field:\r\n<img width=\"1214\" alt=\"Screenshot 2024-11-11 at 09 59 09\"\r\nsrc=\"https://github.com/user-attachments/assets/3b508a64-8bb1-4d89-89b2-9b8d195d1cbe\">\r\n\r\n\r\nIn cases:\r\n\r\n<img width=\"1555\" alt=\"Screenshot 2024-11-11 at 10 00 41\"\r\nsrc=\"https://github.com/user-attachments/assets/1d1ac6d7-29c8-4e84-a758-3dfc293d58fe\">\r\n\r\n\r\nAnomaly Charts in explorer:\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/6e738171-5f1a-46c2-bd34-2c8581f2a3e3)\r\n\r\nAnomaly charts in dashboard:\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/5011b44c-0a33-42a2-a869-413d4fffe4ad)\r\n\r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\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- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is usable by keyboard only (learn more\r\nabout [keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n- [ ] Any UI touched in this PR does not create any new axe failures\r\n(run axe in browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\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 renders correctly on smaller devices using a responsive\r\nlayout. (You can test this [in your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n- [ ] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"f876540dc7fc935e9cc4b7d841247ce7bca5728d"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198869","number":198869,"mergeCommit":{"message":"[ML] Single Metric Viewer embeddable: Add action for dashboard to apply filter from the embeddable to the page (#198869)\n\n## Summary\r\n\r\nRelated meta issue: https://github.com/elastic/kibana/issues/187483\r\n\r\nThis PR adds the ability to add a filter and a negate filter to a\r\ndashboard via plus and minus icons in the SMV embeddable panel.\r\nThis PR also updates the behavior of the anomaly charts panel in\r\ndashboards so that the minus icon works as a negate filter instead of\r\nremoving the filter. This behavior is consistent with other plus/minus\r\nicons next to values in dashboard panels.\r\n\r\nIn dashboard:\r\n\r\n<img width=\"1217\" alt=\"Screenshot 2024-11-11 at 09 54 41\"\r\nsrc=\"https://github.com/user-attachments/assets/a8e12ce8-3794-4ddc-93da-e3d0bf139df7\">\r\n\r\n\r\nWith a by and partition field:\r\n<img width=\"1214\" alt=\"Screenshot 2024-11-11 at 09 59 09\"\r\nsrc=\"https://github.com/user-attachments/assets/3b508a64-8bb1-4d89-89b2-9b8d195d1cbe\">\r\n\r\n\r\nIn cases:\r\n\r\n<img width=\"1555\" alt=\"Screenshot 2024-11-11 at 10 00 41\"\r\nsrc=\"https://github.com/user-attachments/assets/1d1ac6d7-29c8-4e84-a758-3dfc293d58fe\">\r\n\r\n\r\nAnomaly Charts in explorer:\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/6e738171-5f1a-46c2-bd34-2c8581f2a3e3)\r\n\r\nAnomaly charts in dashboard:\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/5011b44c-0a33-42a2-a869-413d4fffe4ad)\r\n\r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\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- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is usable by keyboard only (learn more\r\nabout [keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n- [ ] Any UI touched in this PR does not create any new axe failures\r\n(run axe in browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\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 renders correctly on smaller devices using a responsive\r\nlayout. (You can test this [in your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n- [ ] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"f876540dc7fc935e9cc4b7d841247ce7bca5728d"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Melissa Alvarez <[email protected]>
…ly filter from the embeddable to the page (elastic#198869) ## Summary Related meta issue: elastic#187483 This PR adds the ability to add a filter and a negate filter to a dashboard via plus and minus icons in the SMV embeddable panel. This PR also updates the behavior of the anomaly charts panel in dashboards so that the minus icon works as a negate filter instead of removing the filter. This behavior is consistent with other plus/minus icons next to values in dashboard panels. In dashboard: <img width="1217" alt="Screenshot 2024-11-11 at 09 54 41" src="https://github.com/user-attachments/assets/a8e12ce8-3794-4ddc-93da-e3d0bf139df7"> With a by and partition field: <img width="1214" alt="Screenshot 2024-11-11 at 09 59 09" src="https://github.com/user-attachments/assets/3b508a64-8bb1-4d89-89b2-9b8d195d1cbe"> In cases: <img width="1555" alt="Screenshot 2024-11-11 at 10 00 41" src="https://github.com/user-attachments/assets/1d1ac6d7-29c8-4e84-a758-3dfc293d58fe"> Anomaly Charts in explorer: ![image](https://github.com/user-attachments/assets/6e738171-5f1a-46c2-bd34-2c8581f2a3e3) Anomaly charts in dashboard: ![image](https://github.com/user-attachments/assets/5011b44c-0a33-42a2-a869-413d4fffe4ad) ### Checklist Delete any items that are not applicable to this PR. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) --------- Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: kibanamachine <[email protected]>
Summary
Related meta issue: #187483
This PR adds the ability to add a filter and a negate filter to a dashboard via plus and minus icons in the SMV embeddable panel.
This PR also updates the behavior of the anomaly charts panel in dashboards so that the minus icon works as a negate filter instead of removing the filter. This behavior is consistent with other plus/minus icons next to values in dashboard panels.
In dashboard:
With a by and partition field:
In cases:
Anomaly Charts in explorer:
Anomaly charts in dashboard:
Checklist
Delete any items that are not applicable to this PR.