-
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
POC Adding a global saved query feature permission #166260
Conversation
showSaveQuery={ | ||
Boolean(core.application.capabilities.globalSavedQueries?.edit) || props.showSaveQuery | ||
} |
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.
Maybe rather as a fallback?
showSaveQuery={ | |
Boolean(core.application.capabilities.globalSavedQueries?.edit) || props.showSaveQuery | |
} | |
showSaveQuery={props.showSaveQuery ?? Boolean(core.application.capabilities.globalSavedQueries?.edit)} |
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 think when introducing this privilege, it should overwrite local consumers, given it's set to true
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.
But with the following code in Discover, you want to disable it for text-based searches, no?
const showSaveQuery =
!isPlainRecord &&
(Boolean(services.capabilities.discover.saveQuery) ||
Boolean(services.capabilities.globalSavedQueries.edit));
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.
You're right! Great catch! I guess we would need to solve that case in search_bar.tsx, disabling save queries for ES|QL
or other text based langs. This makes also more sense than just solving it in a single plugin 👍
💔 Build FailedFailed CI Steps
Test Failures
Metrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
const showSaveQuery = | ||
!isOfAggregateQueryType(query) && | ||
(Boolean(core.application.capabilities.savedQueryManagement?.edit) || props.showSaveQuery); |
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.
@davismcphee that's how it works to apply the change on unified search level.
With this the change in Discover of this PR is redundant.
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.
Make sense to me! This way is better than the old way anyway since it bakes the ES|QL check directly into Unified Search without needing consumers to know or care 👍
closing in favor of #166937 |
…es across Kibana (#166937) - Resolves #158173 Based on PoC #166260 ## Summary This PR adds a new "Saved Query Management" privilege with 2 options: - `All` will override any per app privilege and will allow users to save queries from any Kibana page - `None` will default to per app privileges (backward-compatible option) <img width="600" alt="Screenshot 2023-09-21 at 15 26 25" src="https://github.com/elastic/kibana/assets/1415710/6d53548e-5c5a-4d6d-a86a-1e639cb77202"> ### Checklist - [x] 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) - [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 --------- Co-authored-by: Matthias Wilhelm <[email protected]> Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]>
Summary
WIP
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers