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

[Discover][Embeddable] Pass embeddable filters to Surrounding Docs page #197190

Merged
merged 7 commits into from
Oct 24, 2024

Conversation

jughosta
Copy link
Contributor

@jughosta jughosta commented Oct 22, 2024

Summary

This PR makes sure to pass filters to DocViewer from the search panel on Dashboard. And DocViewer will pass filters over to Surrounding Docs page.

Checklist

@jughosta jughosta added the Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. label Oct 22, 2024
@jughosta jughosta changed the title [Discover][Embeddable] Current query and filters [Discover][Embeddable] Pass embeddable filters to Surrounding Docs page Oct 22, 2024
@jughosta jughosta self-assigned this Oct 22, 2024
@jughosta jughosta added release_note:fix backport:prev-major Backport to (8.x, 8.17, 8.16, 8.15) the previous major branch and other branches in development labels Oct 22, 2024
Comment on lines +163 to +164
query: savedSearchQuery,
filters: savedSearchFilters,
Copy link
Contributor Author

@jughosta jughosta Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I kept this as it was before. We might want to consider including the current Dashboard filters for cell actions too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's hard to say which behaviour is best for this. It's something worth discussing at least.

@jughosta jughosta marked this pull request as ready for review October 22, 2024 14:27
@jughosta jughosta requested a review from a team as a code owner October 22, 2024 14:27
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be working as expected, just one question about the implementation.

api.fetchContext$,
stateManager.rows,
stateManager.totalHitCount,
stateManager.columnsMeta,
stateManager.grid
);

// `api.query$` and `api.filters$` are the initial values from the saved search SO (as of now)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If api.query$ and api.filters$ already contain the saved search values, why are we switching to searchSource below?

Copy link
Contributor Author

@jughosta jughosta Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seemed less verbose to me. Okay, I am going to keep the variables but reassign them to api values 4615e64

Comment on lines +163 to +164
query: savedSearchQuery,
filters: savedSearchFilters,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's hard to say which behaviour is best for this. It's something worth discussing at least.

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #40 / Serverless Common UI - Management Index Management Indices can delete index

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 825.6KB 825.6KB -17.0B

History

cc @jughosta

Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look good and it works as expected, thanks 👍

@jughosta jughosta added v9.0.0 v8.16.0 backport:version Backport to applied version labels v8.17.0 and removed backport:prev-major Backport to (8.x, 8.17, 8.16, 8.15) the previous major branch and other branches in development labels Oct 24, 2024
@jughosta jughosta merged commit 1c3705b into elastic:main Oct 24, 2024
33 checks passed
@jughosta jughosta deleted the fix-dashboard-surrounding-docs-link branch October 24, 2024 10:16
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.16, 8.x

https://github.com/elastic/kibana/actions/runs/11497270994

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 24, 2024
…ge (elastic#197190)

## Summary

This PR makes sure to pass `filters` to DocViewer from the search panel
on Dashboard. And DocViewer will pass `filters` over to Surrounding Docs
page.

### Checklist

- [x] [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

(cherry picked from commit 1c3705b)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 24, 2024
…ge (elastic#197190)

## Summary

This PR makes sure to pass `filters` to DocViewer from the search panel
on Dashboard. And DocViewer will pass `filters` over to Surrounding Docs
page.

### Checklist

- [x] [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

(cherry picked from commit 1c3705b)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.16
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 24, 2024
…ocs page (#197190) (#197594)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Discover][Embeddable] Pass embeddable filters to Surrounding Docs
page (#197190)](#197190)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Julia
Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2024-10-24T10:16:21Z","message":"[Discover][Embeddable]
Pass embeddable filters to Surrounding Docs page (#197190)\n\n##
Summary\r\n\r\nThis PR makes sure to pass `filters` to DocViewer from
the search panel\r\non Dashboard. And DocViewer will pass `filters` over
to Surrounding Docs\r\npage.\r\n\r\n### Checklist\r\n\r\n- [x] [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","sha":"1c3705ba5b5aa60ea451a7d0ff7f95f2d21a1b80","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:DataDiscovery","v8.16.0","backport:version","v8.17.0"],"title":"[Discover][Embeddable]
Pass embeddable filters to Surrounding Docs
page","number":197190,"url":"https://github.com/elastic/kibana/pull/197190","mergeCommit":{"message":"[Discover][Embeddable]
Pass embeddable filters to Surrounding Docs page (#197190)\n\n##
Summary\r\n\r\nThis PR makes sure to pass `filters` to DocViewer from
the search panel\r\non Dashboard. And DocViewer will pass `filters` over
to Surrounding Docs\r\npage.\r\n\r\n### Checklist\r\n\r\n- [x] [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","sha":"1c3705ba5b5aa60ea451a7d0ff7f95f2d21a1b80"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197190","number":197190,"mergeCommit":{"message":"[Discover][Embeddable]
Pass embeddable filters to Surrounding Docs page (#197190)\n\n##
Summary\r\n\r\nThis PR makes sure to pass `filters` to DocViewer from
the search panel\r\non Dashboard. And DocViewer will pass `filters` over
to Surrounding Docs\r\npage.\r\n\r\n### Checklist\r\n\r\n- [x] [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","sha":"1c3705ba5b5aa60ea451a7d0ff7f95f2d21a1b80"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
kibanamachine added a commit that referenced this pull request Oct 24, 2024
…Docs page (#197190) (#197593)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[Discover][Embeddable] Pass embeddable filters to Surrounding Docs
page (#197190)](#197190)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Julia
Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2024-10-24T10:16:21Z","message":"[Discover][Embeddable]
Pass embeddable filters to Surrounding Docs page (#197190)\n\n##
Summary\r\n\r\nThis PR makes sure to pass `filters` to DocViewer from
the search panel\r\non Dashboard. And DocViewer will pass `filters` over
to Surrounding Docs\r\npage.\r\n\r\n### Checklist\r\n\r\n- [x] [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","sha":"1c3705ba5b5aa60ea451a7d0ff7f95f2d21a1b80","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:DataDiscovery","v8.16.0","backport:version","v8.17.0"],"title":"[Discover][Embeddable]
Pass embeddable filters to Surrounding Docs
page","number":197190,"url":"https://github.com/elastic/kibana/pull/197190","mergeCommit":{"message":"[Discover][Embeddable]
Pass embeddable filters to Surrounding Docs page (#197190)\n\n##
Summary\r\n\r\nThis PR makes sure to pass `filters` to DocViewer from
the search panel\r\non Dashboard. And DocViewer will pass `filters` over
to Surrounding Docs\r\npage.\r\n\r\n### Checklist\r\n\r\n- [x] [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","sha":"1c3705ba5b5aa60ea451a7d0ff7f95f2d21a1b80"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197190","number":197190,"mergeCommit":{"message":"[Discover][Embeddable]
Pass embeddable filters to Surrounding Docs page (#197190)\n\n##
Summary\r\n\r\nThis PR makes sure to pass `filters` to DocViewer from
the search panel\r\non Dashboard. And DocViewer will pass `filters` over
to Surrounding Docs\r\npage.\r\n\r\n### Checklist\r\n\r\n- [x] [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","sha":"1c3705ba5b5aa60ea451a7d0ff7f95f2d21a1b80"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels release_note:fix Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.16.0 v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants