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

[Dashboard] fix searchSessionId not updated when pinned filter changes #151390

Merged
merged 6 commits into from
Feb 21, 2023

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Feb 15, 2023

Fixes #151219 and #151224

PR separates shouldRefresh logic from unsavedChanges logic to account for difference in filter check.

shouldRefresh filter check:

  • includes pinned filters
  • excludes disabled filters
  • excludes $state so pinning/unpinning a filter does not cause a refresh.

@nreese nreese marked this pull request as ready for review February 16, 2023 13:09
@nreese nreese requested review from a team as code owners February 16, 2023 13:09
@nreese nreese added Feature:Dashboard Dashboard related features release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas auto-backport Deprecated - use backport:version if exact versions are needed v8.7.0 v8.8.0 labels Feb 16, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@nreese nreese added loe:small Small Level of Effort impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. labels Feb 16, 2023
Copy link
Member

@lukasolson lukasolson left a comment

Choose a reason for hiding this comment

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

DataDiscovery changes LGTM

@nreese
Copy link
Contributor Author

nreese commented Feb 21, 2023

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/es-query 192 193 +1

Async chunks

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

id before after diff
dashboard 382.8KB 383.0KB +242.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
kbnUiSharedDeps-srcJs 2.2MB 2.2MB +12.0B
Unknown metric groups

API count

id before after diff
@kbn/es-query 250 251 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

Changes LGTM! Code only review, but everything looks great.

expect(await getShouldRefresh.bind(dashboardContainerMock)(lastInput, input)).toBe(true);
});

test('should return false when disabled filters change', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice test additions!

return Object.keys(inputChanges).length > 0;
}

async function getInputChanges(
Copy link
Contributor

Choose a reason for hiding this comment

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

Good call moving this to a shared function.

@nreese nreese merged commit cd910be into elastic:main Feb 21, 2023
kibanamachine pushed a commit that referenced this pull request Feb 21, 2023
#151390)

Fixes #151219 and
#151224

PR separates shouldRefresh logic from unsavedChanges logic to account
for difference in filter check.

shouldRefresh filter check:
* includes pinned filters
* excludes disabled filters
* excludes $state so pinning/unpinning a filter does not cause a
refresh.

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit cd910be)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.7

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

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

kibanamachine added a commit that referenced this pull request Feb 21, 2023
…changes (#151390) (#151742)

# Backport

This will backport the following commits from `main` to `8.7`:
- [[Dashboard] fix searchSessionId not updated when pinned filter
changes (#151390)](#151390)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-02-21T16:31:06Z","message":"[Dashboard]
fix searchSessionId not updated when pinned filter changes
(#151390)\n\nFixes #151219
and\r\nhttps://github.com//issues/151224\r\n\r\nPR
separates shouldRefresh logic from unsavedChanges logic to
account\r\nfor difference in filter check.\r\n\r\nshouldRefresh filter
check:\r\n* includes pinned filters\r\n* excludes disabled filters\r\n*
excludes $state so pinning/unpinning a filter does not cause
a\r\nrefresh.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"cd910bee1cb062111e094c2744f153010e6b2e2c","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Dashboard","release_note:fix","Team:Presentation","loe:hours","impact:medium","auto-backport","v8.7.0","v8.8.0"],"number":151390,"url":"https://github.com/elastic/kibana/pull/151390","mergeCommit":{"message":"[Dashboard]
fix searchSessionId not updated when pinned filter changes
(#151390)\n\nFixes #151219
and\r\nhttps://github.com//issues/151224\r\n\r\nPR
separates shouldRefresh logic from unsavedChanges logic to
account\r\nfor difference in filter check.\r\n\r\nshouldRefresh filter
check:\r\n* includes pinned filters\r\n* excludes disabled filters\r\n*
excludes $state so pinning/unpinning a filter does not cause
a\r\nrefresh.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"cd910bee1cb062111e094c2744f153010e6b2e2c"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/151390","number":151390,"mergeCommit":{"message":"[Dashboard]
fix searchSessionId not updated when pinned filter changes
(#151390)\n\nFixes #151219
and\r\nhttps://github.com//issues/151224\r\n\r\nPR
separates shouldRefresh logic from unsavedChanges logic to
account\r\nfor difference in filter check.\r\n\r\nshouldRefresh filter
check:\r\n* includes pinned filters\r\n* excludes disabled filters\r\n*
excludes $state so pinning/unpinning a filter does not cause
a\r\nrefresh.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"cd910bee1cb062111e094c2744f153010e6b2e2c"}}]}]
BACKPORT-->

Co-authored-by: Nathan Reese <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Dashboard Dashboard related features impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v8.7.0 v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dashboard] searchSessionId not updated when pinned filter changes
6 participants