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

[Lens] Add description property and check duplicate title on save #68219

Merged
merged 6 commits into from
Jun 10, 2020

Conversation

flash1293
Copy link
Contributor

Fixes #64979

This PR uses the checkForDuplicateTitle helper function from the saved_objects plugin to make sure a Lens saved object is not saved with the same title as another existing saved object.

As this helper was tied to the SavedObject type (which is not used by Lens), the type had to be adjusted slightly (src/plugins/saved_objects/public/saved_object/helpers/check_for_duplicate_title.ts and src/plugins/saved_objects/public/saved_object/helpers/display_duplicate_title_confirm_modal.ts)

While working on this, I discovered there is a textarea for the description in the save modal, but Lens saved objects don't include a description at all. This PR also passes the description through the various layers so it's saved and shown correctly

@flash1293 flash1293 marked this pull request as ready for review June 4, 2020 13:29
@flash1293 flash1293 requested a review from a team June 4, 2020 13:29
@flash1293 flash1293 requested a review from a team as a code owner June 4, 2020 13:29
@flash1293 flash1293 added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Jun 4, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@flash1293 flash1293 requested review from wylieconlon and mbondyra June 4, 2020 13:30
Copy link
Member

@lukeelmers lukeelmers left a comment

Choose a reason for hiding this comment

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

Updated app arch typings LGTM

Copy link
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

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

Tested in Safari. LGTM, although I would be happy to have another way of organizing saved visualizations.

@@ -34,10 +34,11 @@ export const getLensAliasConfig = (): VisTypeAlias => ({
searchFields: ['title^3'],
Copy link
Contributor

Choose a reason for hiding this comment

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

This is weird, because I can definitely search the description when I type a unique string, but I think this is supposed to be:

Suggested change
searchFields: ['title^3'],
searchFields: ['title^3', 'description'],

Copy link
Contributor

@mbondyra mbondyra Jun 9, 2020

Choose a reason for hiding this comment

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

@wylieconlon you got me curious about this one – I investigated a bit.

Turns out that the request doesn't use this param from here, but takes it from:
https://github.com/elastic/kibana/blob/master/src/plugins/visualizations/public/saved_visualizations/find_list_items.ts#L55

We search through both lens and visualize so I think it's good . Example of request:
http://localhost:5603/clb/api/saved_objects/_find?default_search_operator=AND&page=1&per_page=1000&search=lens_vis*&search_fields=title%5E3&search_fields=description&type=lens&type=visualization

@mbondyra
Copy link
Contributor

mbondyra commented Jun 9, 2020

@elasticmachine merge upstream

@mbondyra
Copy link
Contributor

mbondyra commented Jun 9, 2020

Tested in Safari. LGTM, although I would be happy to have another way of organizing saved visualizations.

@wylieconlon what do you have in mind?

Copy link
Contributor

@mbondyra mbondyra left a comment

Choose a reason for hiding this comment

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

Tested on FF, both functionality and code looks good to me 🆗

@wylieconlon
Copy link
Contributor

@mbondyra There is some longer-term effort to add tagging or folders to saved objects, for example: #16484

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lens - No duplicate title check / warning
6 participants