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

Allow to "star" (favorite) a dashboard from the listing table #189285

Merged
merged 43 commits into from
Aug 13, 2024

Conversation

Dosant
Copy link
Contributor

@Dosant Dosant commented Jul 26, 2024

Summary

close https://github.com/elastic/kibana-team/issues/949

  • Allows to "star" (favorite) a dashboard from the listing table

Screenshot 2024-07-26 at 15 17 41
Screenshot 2024-07-26 at 15 17 45

  • 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

Dosant added 4 commits July 26, 2024 15:03
…vorites

# Conflicts:
#	x-pack/plugins/spaces/server/routes/views/index.ts
#	x-pack/test/api_integration/apis/content_management/helpers.ts
@Dosant
Copy link
Contributor Author

Dosant commented Jul 26, 2024

/ci

@Dosant
Copy link
Contributor Author

Dosant commented Jul 26, 2024

/ci

@Dosant
Copy link
Contributor Author

Dosant commented Jul 26, 2024

/ci

@Dosant
Copy link
Contributor Author

Dosant commented Jul 26, 2024

/ci

@Dosant
Copy link
Contributor Author

Dosant commented Jul 26, 2024

/ci

kibanamachine and others added 2 commits July 26, 2024 16:45
@Dosant
Copy link
Contributor Author

Dosant commented Jul 26, 2024

/ci

@Dosant Dosant force-pushed the d/2024-07-23-favorites branch from 1ea8347 to 7238690 Compare July 26, 2024 18:24
@Dosant
Copy link
Contributor Author

Dosant commented Jul 26, 2024

/ci

@Dosant
Copy link
Contributor Author

Dosant commented Jul 27, 2024

/ci

@Dosant
Copy link
Contributor Author

Dosant commented Jul 29, 2024

/ci

@Dosant Dosant changed the title wip favorites Allow to "star" (favorite) a dashboard from the listing table Jul 29, 2024
@Dosant
Copy link
Contributor Author

Dosant commented Aug 13, 2024

@elasticmachine merge upstream

@Dosant Dosant added ci:project-deploy-elasticsearch Create an Elasticsearch Serverless project and removed ci:project-deploy-elasticsearch Create an Elasticsearch Serverless project labels Aug 13, 2024
@Dosant
Copy link
Contributor Author

Dosant commented Aug 13, 2024

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

kibana-ci commented Aug 13, 2024

⏳ Build in-progress

Failed CI Steps

History

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

@Dosant Dosant enabled auto-merge (squash) August 13, 2024 12:57
@Dosant Dosant merged commit b8fc60b into elastic:main Aug 13, 2024
38 of 41 checks passed
bryce-b pushed a commit to bryce-b/kibana that referenced this pull request Aug 13, 2024
…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
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Aug 15, 2024
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 189285 locally

1 similar comment
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 189285 locally

@Dosant Dosant removed backport missing Added to PRs automatically when the are determined to be missing a backport. ci:project-deploy-elasticsearch Create an Elasticsearch Serverless project labels Aug 19, 2024
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Aug 20, 2024
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 189285 locally

@Dosant Dosant added backport:skip This commit does not require backporting v8.16.0 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Aug 22, 2024
Dosant added a commit that referenced this pull request Aug 29, 2024
## 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
stratoula added a commit that referenced this pull request Nov 18, 2024
## 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]>
stratoula pushed a commit to stratoula/kibana that referenced this pull request Nov 19, 2024
## 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
stratoula added a commit that referenced this pull request Nov 19, 2024
# 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]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
## 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:enhancement Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.