-
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
Allow to "star" (favorite) a dashboard from the listing table #189285
Conversation
…vorites # Conflicts: # x-pack/plugins/spaces/server/routes/views/index.ts # x-pack/test/api_integration/apis/content_management/helpers.ts
/ci |
/ci |
…o d/2024-07-23-favorites
/ci |
/ci |
…o d/2024-07-23-favorites
/ci |
… src/core/server/integration_tests/ci_checks'
/ci |
1ea8347
to
7238690
Compare
/ci |
/ci |
/ci |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
⏳ Build in-progress
Failed CI StepsHistory
To update your PR or re-run it, just comment with: |
…c#189285) ## Summary close elastic/kibana-team#949 - Allows to "star" (favorite) a dashboard from the listing table ![Screenshot 2024-07-26 at 15 17 41](https://github.com/user-attachments/assets/18f8e3d6-3c83-4d62-8a70-811b05ecd99b) ![Screenshot 2024-07-26 at 15 17 45](https://github.com/user-attachments/assets/45462395-1db1-4858-a2d8-3f681bb2072b) - Favorites are isolated per user (user profile id) and per space ### Implementation Details Please refer to and comment on the README.md 🙏 https://github.com/elastic/kibana/pull/189285/files#diff-307fab4354532049891c828da893b4efcf0df9391b1f3018d8d016a2288c5d4c ### TODO - Telemetry: I will add telemetry in a separate PR
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
## Summary Add telemetry to favorites feature #189285 - Adds UI usage counter telemetry, increase the counter when favorite / unfavorite is clicked - Add snapshot telemetry: - total "favorite" object in the deployment - total users+spaces count combination who have used the favorites feature - avg per user per space (only counts those users who favorited at least once) - max favorites objects per user per space Unfortunately, for snapshot telemetry, I had to add fields to kibana mapping. We didn't need them for a feature, but I didn't realize that will have to add them to a mapping. Not sure if there is a better way
## Summary close #194165 close elastic/kibana-team#1245 ### User-facing <img width="1680" alt="image" src="https://github.com/user-attachments/assets/6df4ee9f-1b4d-404c-a764-592998a1d430"> This PRs adds a new tab in the editor history component. You can star your query from the history and then you will see it in the Starred list. The started queries are scoped to a user and a space. ### Server To allow starring ESQL query, this PR extends [favorites service](#189285) with ability to store metadata in addition to an id. To make metadata strict and in future to support proper metadata migrations if needed, metadata needs to be defined as schema: ``` plugins.contentManagement.favorites.registerFavoriteType('esql_query', { typeMetadataSchema: schema.object({ query: schema.string(), timeRange:...., etc... }), }) ``` Notable changes: - Add support for registering a favorite type and a schema for favorite type metadata. Previosly the `dashboard` type was the only supported type and was hardcoded - Add `favoriteMetadata` property to a saved object mapping and make it `enabled:false` we don't want to index it, but just want to store metadata in addition to an id. [code](https://github.com/elastic/kibana/pull/198362/files#diff-d1a39e36f1de11a1110520d7607e6aee7d506c76626993842cb58db012b760a2R74-R87) - Add a 100 favorite items limit (per type per space per user). Just do it for sanity to prevent too large objects due to metadata stored in addtion to ids. --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]>
## Summary close elastic#194165 close elastic/kibana-team#1245 ### User-facing <img width="1680" alt="image" src="https://github.com/user-attachments/assets/6df4ee9f-1b4d-404c-a764-592998a1d430"> This PRs adds a new tab in the editor history component. You can star your query from the history and then you will see it in the Starred list. The started queries are scoped to a user and a space. ### Server To allow starring ESQL query, this PR extends [favorites service](elastic#189285) with ability to store metadata in addition to an id. To make metadata strict and in future to support proper metadata migrations if needed, metadata needs to be defined as schema: ``` plugins.contentManagement.favorites.registerFavoriteType('esql_query', { typeMetadataSchema: schema.object({ query: schema.string(), timeRange:...., etc... }), }) ``` Notable changes: - Add support for registering a favorite type and a schema for favorite type metadata. Previosly the `dashboard` type was the only supported type and was hardcoded - Add `favoriteMetadata` property to a saved object mapping and make it `enabled:false` we don't want to index it, but just want to store metadata in addition to an id. [code](https://github.com/elastic/kibana/pull/198362/files#diff-d1a39e36f1de11a1110520d7607e6aee7d506c76626993842cb58db012b760a2R74-R87) - Add a 100 favorite items limit (per type per space per user). Just do it for sanity to prevent too large objects due to metadata stored in addtion to ids. --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]> (cherry picked from commit 4597237) # Conflicts: # .github/CODEOWNERS
# Backport This will backport the following commits from `main` to `8.x`: - [[ES|QL] Starred queries in the editor (#198362)](#198362) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Anton Dosov","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-18T20:53:46Z","message":"[ES|QL] Starred queries in the editor (#198362)\n\n## Summary\r\n\r\nclose https://github.com/elastic/kibana/issues/194165\r\nclose https://github.com/elastic/kibana-team/issues/1245\r\n\r\n### User-facing\r\n\r\n<img width=\"1680\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/6df4ee9f-1b4d-404c-a764-592998a1d430\">\r\n\r\nThis PRs adds a new tab in the editor history component. You can star\r\nyour query from the history and then you will see it in the Starred\r\nlist. The started queries are scoped to a user and a space.\r\n\r\n\r\n### Server\r\n\r\nTo allow starring ESQL query, this PR extends [favorites\r\nservice](#189285) with ability to\r\nstore metadata in addition to an id. To make metadata strict and in\r\nfuture to support proper metadata migrations if needed, metadata needs\r\nto be defined as schema:\r\n\r\n```\r\nplugins.contentManagement.favorites.registerFavoriteType('esql_query', {\r\n typeMetadataSchema: schema.object({ query: schema.string(), timeRange:...., etc... }),\r\n})\r\n```\r\n\r\nNotable changes: \r\n\r\n- Add support for registering a favorite type and a schema for favorite\r\ntype metadata. Previosly the `dashboard` type was the only supported\r\ntype and was hardcoded\r\n- Add `favoriteMetadata` property to a saved object mapping and make it\r\n`enabled:false` we don't want to index it, but just want to store\r\nmetadata in addition to an id.\r\n[code](https://github.com/elastic/kibana/pull/198362/files#diff-d1a39e36f1de11a1110520d7607e6aee7d506c76626993842cb58db012b760a2R74-R87)\r\n- Add a 100 favorite items limit (per type per space per user). Just do\r\nit for sanity to prevent too large objects due to metadata stored in\r\naddtion to ids.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>","sha":"45972374f06a6189ec9e225fd00b191838f33e52","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["v9.0.0","release_note:feature","Team:SharedUX","Feature:ES|QL","Team:ESQL","backport:version","v8.17.0"],"number":198362,"url":"https://github.com/elastic/kibana/pull/198362","mergeCommit":{"message":"[ES|QL] Starred queries in the editor (#198362)\n\n## Summary\r\n\r\nclose https://github.com/elastic/kibana/issues/194165\r\nclose https://github.com/elastic/kibana-team/issues/1245\r\n\r\n### User-facing\r\n\r\n<img width=\"1680\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/6df4ee9f-1b4d-404c-a764-592998a1d430\">\r\n\r\nThis PRs adds a new tab in the editor history component. You can star\r\nyour query from the history and then you will see it in the Starred\r\nlist. The started queries are scoped to a user and a space.\r\n\r\n\r\n### Server\r\n\r\nTo allow starring ESQL query, this PR extends [favorites\r\nservice](#189285) with ability to\r\nstore metadata in addition to an id. To make metadata strict and in\r\nfuture to support proper metadata migrations if needed, metadata needs\r\nto be defined as schema:\r\n\r\n```\r\nplugins.contentManagement.favorites.registerFavoriteType('esql_query', {\r\n typeMetadataSchema: schema.object({ query: schema.string(), timeRange:...., etc... }),\r\n})\r\n```\r\n\r\nNotable changes: \r\n\r\n- Add support for registering a favorite type and a schema for favorite\r\ntype metadata. Previosly the `dashboard` type was the only supported\r\ntype and was hardcoded\r\n- Add `favoriteMetadata` property to a saved object mapping and make it\r\n`enabled:false` we don't want to index it, but just want to store\r\nmetadata in addition to an id.\r\n[code](https://github.com/elastic/kibana/pull/198362/files#diff-d1a39e36f1de11a1110520d7607e6aee7d506c76626993842cb58db012b760a2R74-R87)\r\n- Add a 100 favorite items limit (per type per space per user). Just do\r\nit for sanity to prevent too large objects due to metadata stored in\r\naddtion to ids.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>","sha":"45972374f06a6189ec9e225fd00b191838f33e52"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198362","number":198362,"mergeCommit":{"message":"[ES|QL] Starred queries in the editor (#198362)\n\n## Summary\r\n\r\nclose https://github.com/elastic/kibana/issues/194165\r\nclose https://github.com/elastic/kibana-team/issues/1245\r\n\r\n### User-facing\r\n\r\n<img width=\"1680\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/6df4ee9f-1b4d-404c-a764-592998a1d430\">\r\n\r\nThis PRs adds a new tab in the editor history component. You can star\r\nyour query from the history and then you will see it in the Starred\r\nlist. The started queries are scoped to a user and a space.\r\n\r\n\r\n### Server\r\n\r\nTo allow starring ESQL query, this PR extends [favorites\r\nservice](#189285) with ability to\r\nstore metadata in addition to an id. To make metadata strict and in\r\nfuture to support proper metadata migrations if needed, metadata needs\r\nto be defined as schema:\r\n\r\n```\r\nplugins.contentManagement.favorites.registerFavoriteType('esql_query', {\r\n typeMetadataSchema: schema.object({ query: schema.string(), timeRange:...., etc... }),\r\n})\r\n```\r\n\r\nNotable changes: \r\n\r\n- Add support for registering a favorite type and a schema for favorite\r\ntype metadata. Previosly the `dashboard` type was the only supported\r\ntype and was hardcoded\r\n- Add `favoriteMetadata` property to a saved object mapping and make it\r\n`enabled:false` we don't want to index it, but just want to store\r\nmetadata in addition to an id.\r\n[code](https://github.com/elastic/kibana/pull/198362/files#diff-d1a39e36f1de11a1110520d7607e6aee7d506c76626993842cb58db012b760a2R74-R87)\r\n- Add a 100 favorite items limit (per type per space per user). Just do\r\nit for sanity to prevent too large objects due to metadata stored in\r\naddtion to ids.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>","sha":"45972374f06a6189ec9e225fd00b191838f33e52"}},{"branch":"8.x","label":"v8.17.0","labelRegex":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Anton Dosov <[email protected]>
## Summary close elastic#194165 close elastic/kibana-team#1245 ### User-facing <img width="1680" alt="image" src="https://github.com/user-attachments/assets/6df4ee9f-1b4d-404c-a764-592998a1d430"> This PRs adds a new tab in the editor history component. You can star your query from the history and then you will see it in the Starred list. The started queries are scoped to a user and a space. ### Server To allow starring ESQL query, this PR extends [favorites service](elastic#189285) with ability to store metadata in addition to an id. To make metadata strict and in future to support proper metadata migrations if needed, metadata needs to be defined as schema: ``` plugins.contentManagement.favorites.registerFavoriteType('esql_query', { typeMetadataSchema: schema.object({ query: schema.string(), timeRange:...., etc... }), }) ``` Notable changes: - Add support for registering a favorite type and a schema for favorite type metadata. Previosly the `dashboard` type was the only supported type and was hardcoded - Add `favoriteMetadata` property to a saved object mapping and make it `enabled:false` we don't want to index it, but just want to store metadata in addition to an id. [code](https://github.com/elastic/kibana/pull/198362/files#diff-d1a39e36f1de11a1110520d7607e6aee7d506c76626993842cb58db012b760a2R74-R87) - Add a 100 favorite items limit (per type per space per user). Just do it for sanity to prevent too large objects due to metadata stored in addtion to ids. --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]>
Summary
close https://github.com/elastic/kibana-team/issues/949
Implementation Details
Please refer to and comment on the README.md 🙏 https://github.com/elastic/kibana/pull/189285/files#diff-307fab4354532049891c828da893b4efcf0df9391b1f3018d8d016a2288c5d4c
TODO