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

[ES|QL] Bypass no data views screen #174316

Merged
merged 42 commits into from
Feb 5, 2024

Conversation

clintandrewhall
Copy link
Contributor

@clintandrewhall clintandrewhall commented Jan 5, 2024

Derived from #173068
Further addresses #169873

Summary

  • We're adding a link to the No Data Prompt to send a person to explore their data using ES|QL if there exists any ingested data but no data view.
  • This PR populates the query bar with the first available index (some special handling for logs index. 2a9edec)
  • All consumers of the prompt/no data view are updated in this PR.
  • There's an issue where, if you're in Discover, clicking the link won't refresh the page. . This is fixed on Discover side by reinitializing the state container when user clicks the "try es|ql" link and URL state updates.
  • There is an issue that you can save the es|ql chart from Discover, but Dashboard's empty screen blocks the navigation because data views don't exist [ES|QL] Bypass no data views screen #174316 (comment). This is fixed by allowing the dashboard to work without the default data view. Hopefully, this won't lead to major issues
  • ES|QL panels can't be created without the default data views this is fixed by trying to fallback to an ad-hoc dataview, plan to move that code to the utils introduced here [ES|QL] Use same adhoc dataviews for queries with the same index pattern #174736
  • fix circular deps
  • Add functional tests

Visuals

esql.empty.prompt.demo.mov

Storybook Stories

Can access ES|QL

Screenshot 2024-01-31 at 17 05 47

Cannot access (e.g. preview is unavailable - not implemented)

Screenshot 2024-01-31 at 17 05 59

cc: @stratoula @mattkime @thomasneirynck

@clintandrewhall clintandrewhall added WIP Work in progress loe:medium Medium Level of Effort release_note:skip Skip the PR/issue when compiling release notes impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) ci:build-storybooks v8.13.0 labels Jan 5, 2024
@clintandrewhall clintandrewhall changed the title [No Data Prompt] ES|QL direct link [shared-ux] ES|QL direct link Jan 5, 2024
@stratoula
Copy link
Contributor

Thanx Clint! Looks nice. I feel though that navigating the users to the show functions is not the correct path forward.
I am informed that I dont have a dataview but I do have data. The component navigates me to Discover to start exploring. I find much more useful to have a query that will actually help me to explore my data. from index | limit 10.

I am doing exactly the same on the global search so you can check my implementation there.
globalsearch

@MichaelMarcialis
Copy link
Contributor

@clintandrewhall: Regarding design support, I recall @andreadelrio sharing some design concepts for this a week or so ago, so I have a feeling she has something in mind for how to present these ES|QL links. I believe she's on PTO today, but will be back next week.

@andreadelrio: Hopefully I'm remembering correctly, but let me know if that's not the case, and I can happily lend some design assistance here as needed.

@clintandrewhall clintandrewhall force-pushed the shared_ux/prompt_esql branch 2 times, most recently from 6d48c06 to b75c9ee Compare January 9, 2024 17:06
@andreadelrio
Copy link
Contributor

Hi all, sending a couple of ideas of how we can handle this as discussed before

No illustrations
Frame 1367
With illustrations
Frame 1370

Notes:

  1. The illustration for the ES|QL card was found in a blog post. You can consider it a placeholder.
  2. All copy needs to be reviewed by one of our UX writers.

cc @clintandrewhall @ninoslavmiskovic @stratoula

@andreadelrio andreadelrio self-assigned this Jan 10, 2024
@clintandrewhall
Copy link
Contributor Author

@rshen91 @stratoula @andreadelrio I think we should ship the locator and related logic in this PR and hold off on the UX, rather than continue to rebase this until the UX is decided.

We can iterate in code on the different proposals using Storybook, and ship the changes with only Shared UX and design really being involved, (from a PR approval perspective, that is).

Thoughts?

@stratoula
Copy link
Contributor

@clintandrewhall makes sense and I am fine with that. This means that is going to look like this right?

image

@stratoula
Copy link
Contributor

stratoula commented Jan 11, 2024

@clintandrewhall fixed the logic here 2a9edec

no_dataview

You can remove the dataviewSpec, it works without it 🎸

@clintandrewhall
Copy link
Contributor Author

@clintandrewhall makes sense and I am fine with that. This means that is going to look like this right?

Actually, I'm suggesting we don't ship and UI change at all in this PR, just provide the locator and related logic. We'll leave any UX implementation to the next PR.

@stratoula
Copy link
Contributor

@clintandrewhall got it! I am fine with this approach too 👍

@ninoslavmiskovic
Copy link
Contributor

I like that @nreese !

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.

LGTM, one minor point below. Also, would be nice if someone else on the team can approve the state changes (resetStateContainer), but I personally don't see an issue.

const { discoverAppLocator, getIndices } = this.deps;

const indexName = await getIndexForESQLQuery({ dataViews: { getIndices } });
const esql = `from ${indexName ?? '*'} | limit 10`;
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if this should be fixed in this PR, but the indexName can contain special characters (like |). Is there some sanitization that we can add here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Really? I get this error when I try to create one:

Invalid index name [my|index|1], must not contain the following characters ['\',' ','"','<','*','?','>','|',',','/']

@stratoula
Copy link
Contributor

/ci

@stratoula
Copy link
Contributor

stratoula commented Feb 2, 2024

@Dosant amazing job! You are super fast! This is a very important improvement imho. Being able to query your data or even create visualizations with a dataview is huge! I am ready to approve, just waiting for the presentation team to chime in.

Would it make more sense to have this open a new dashboard with a new inline lens panel editor open so users can just start creating an ES|QL lens chart directly in dashboard?

This would be a very good idea. We will need ui actions here I think, it is not possible from a locator (or is it and I am missing something?)

I was hoping that the @elastic/kibana-presentation team can take the dashboard behavior as a follow up. I was thinking that we can navigate to a dashboard as Nathan says (and having the ES|QL panel open would be also fantastic) and then have only active the panels that do not require a dataview. These must be ES|QL, text, image, vega and maps. Now every time you click to Lens you get this no data view that I dont necessarily like. Lens should be inactive, works only with dataviews for now etc. But I think this is a bigger project and out of the scope of this PR. We can discuss further as an analyst XP team!

I think for now as a first iteration and as this is something that multiple people have complained about it makes sense. It navigates to Discover which is the best application we have to learn ES|QL. So it is ok, can this be better for dashboards? Absolutely!!

With that being said, I am fine with that if the rest of the gang is. @Dosant I think we need to prioritize the redesign of this component. There are 2 things I don't like:

  • ES|QL should be promoted as equivalent to dataviews
  • We only have docs for dataviews while I feel a link to ES|QL docs would be awesome here.

Also can we remove the ES|QL button when you specifically are in the dataviews management app?

image

@Dosant
Copy link
Contributor

Dosant commented Feb 2, 2024

@nreese, @ninoslavmiskovic: Dashboard presents users with screen below. Clicking "Try ES|QL" takes users to discover. Would it make more sense to have this open a new dashboard with a new inline lens panel editor open so users can just start creating a ES|QL lens chart directly in dashboard?

@stratoula: I was thinking that we can navigate to a dashboard as Nathan says (and having the ES|QL panel open would be also fantastic) and then have only active the panels that do not require a dataview.
I think for now as a first iteration and as this is something that multiple people have complained about it makes sense. It navigates to Discover which is the best application we have to learn ES|QL. So it is ok, can this be better for dashboards? Absolutely!!

@nreese, @ninoslavmiskovic, agree with @stratoula, I am afraid to extend the scope of this slipped pr further with the ff coming up. But the suggestion is totally how I'd like it to work. I'd like to create an issue and will see if this is something shared-ux can also do

@stratoula: @Dosant I think we need to prioritize the redesign of this component. There are 2 things I don't like:

  • ES|QL should be promoted as equivalent to dataviews
  • We only have docs for dataviews while I feel a link to ES|QL docs would be awesome here.

I'll create an issue for the @andreadelrio's proposal #174316 (comment). Not sure if I will follow up with it straight away, but will see.

As of the docs,
@ryankeairns, @andreadelrio, maybe you'd have a suggestion how can we low-effort add an ES|QL docs link to the design in this PR?

@nreese
Copy link
Contributor

nreese commented Feb 2, 2024

@nreese, @ninoslavmiskovic, agree with @stratoula, I am afraid to extend the scope of this slipped pr further with the ff coming up. But the suggestion is totally how I'd like it to work. I'd like to create an issue and will see if this is something shared-ux can also do

agree. I have created #176159 to track

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

kibana-presentation changes LGTM
code review and tested in chrome

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

Visualizations team changes LGTM! Thanx for this PR Anton. I did a brief testing again and everything works as expected. :)

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
dashboard 424 429 +5
dataViewManagement 190 195 +5
discover 709 715 +6
kibanaOverview 120 125 +5
lens 1252 1257 +5
visualizations 397 402 +5
total +31

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/deeplinks-analytics 5 6 +1
@kbn/es-query 201 202 +1
@kbn/esql-utils 11 13 +2
@kbn/shared-ux-prompt-no-data-views 11 14 +3
@kbn/shared-ux-prompt-no-data-views-mocks 16 23 +7
discover 95 104 +9
total +23

Async chunks

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

id before after diff
dashboard 383.7KB 385.7KB +2.0KB
dataViewManagement 136.3KB 137.9KB +1.6KB
discover 570.1KB 571.7KB +1.6KB
kibanaOverview 50.1KB 51.9KB +1.8KB
lens 1.4MB 1.4MB +2.2KB
visualizations 271.3KB 273.1KB +1.8KB
total +11.0KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/shared-ux-prompt-no-data-views 0 1 +1
@kbn/shared-ux-prompt-no-data-views-types 5 6 +1
share 10 11 +1
total +3

Page load bundle

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

id before after diff
discover 31.5KB 33.0KB +1.5KB
kbnUiSharedDeps-srcJs 2.9MB 2.9MB +110.0B
total +1.6KB
Unknown metric groups

API count

id before after diff
@kbn/deeplinks-analytics 5 6 +1
@kbn/es-query 261 263 +2
@kbn/esql-utils 11 14 +3
@kbn/shared-ux-page-analytics-no-data 18 19 +1
@kbn/shared-ux-prompt-no-data-views 26 34 +8
@kbn/shared-ux-prompt-no-data-views-mocks 17 24 +7
discover 141 151 +10
total +32

History

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

cc @andreadelrio @Dosant

@Dosant Dosant merged commit 450f9f6 into elastic:main Feb 5, 2024
20 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Feb 5, 2024
fkanout pushed a commit to fkanout/kibana that referenced this pull request Feb 7, 2024
> Derived from elastic#173068
> Further addresses elastic#169873

## Summary

- We're adding a link to the No Data Prompt to send a person to explore
their data using ES|QL if there exists any ingested data but no data
view.
- This PR populates the query bar with the first available index (some
special handling for logs index.
elastic@2a9edec)
- All consumers of the prompt/no data view are updated in this PR.
- [x] ~There's an issue where, if you're in Discover, clicking the link
won't refresh the page. .~ This is fixed on Discover side by
reinitializing the state container when user clicks the "try es|ql" link
and URL state updates.
- [x] ~There is an issue that you can save the es|ql chart from
Discover, but Dashboard's empty screen blocks the navigation because
data views don't exist
elastic#174316 (comment).
This is fixed by allowing the dashboard to work without the default data
view. Hopefully, this won't lead to major issues
- [x] ~ES|QL panels can't be created without the default data views~
this is fixed by trying to fallback to an ad-hoc dataview, plan to move
that code to the utils introduced here
elastic#174736
- [x] fix circular deps
- [x] Add functional tests


## Visuals



https://github.com/elastic/kibana/assets/7784120/af3592c1-f4c8-43bb-a128-3268b7761367




### Storybook Stories

#### Can access ES|QL

![Screenshot 2024-01-31 at 17 05
47](https://github.com/elastic/kibana/assets/7784120/370d0351-198e-4dc3-b22e-86f497ad4df5)


#### Cannot access (e.g. preview is unavailable - _not implemented_)

![Screenshot 2024-01-31 at 17 05
59](https://github.com/elastic/kibana/assets/7784120/c2bf52ab-9fa8-4f25-9e5d-512d4f4342fa)


---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: Rachel Shen <rshen@elastic.co>
Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
> Derived from elastic#173068
> Further addresses elastic#169873

## Summary

- We're adding a link to the No Data Prompt to send a person to explore
their data using ES|QL if there exists any ingested data but no data
view.
- This PR populates the query bar with the first available index (some
special handling for logs index.
elastic@2a9edec)
- All consumers of the prompt/no data view are updated in this PR.
- [x] ~There's an issue where, if you're in Discover, clicking the link
won't refresh the page. .~ This is fixed on Discover side by
reinitializing the state container when user clicks the "try es|ql" link
and URL state updates.
- [x] ~There is an issue that you can save the es|ql chart from
Discover, but Dashboard's empty screen blocks the navigation because
data views don't exist
elastic#174316 (comment).
This is fixed by allowing the dashboard to work without the default data
view. Hopefully, this won't lead to major issues
- [x] ~ES|QL panels can't be created without the default data views~
this is fixed by trying to fallback to an ad-hoc dataview, plan to move
that code to the utils introduced here
elastic#174736
- [x] fix circular deps
- [x] Add functional tests


## Visuals



https://github.com/elastic/kibana/assets/7784120/af3592c1-f4c8-43bb-a128-3268b7761367




### Storybook Stories

#### Can access ES|QL

![Screenshot 2024-01-31 at 17 05
47](https://github.com/elastic/kibana/assets/7784120/370d0351-198e-4dc3-b22e-86f497ad4df5)


#### Cannot access (e.g. preview is unavailable - _not implemented_)

![Screenshot 2024-01-31 at 17 05
59](https://github.com/elastic/kibana/assets/7784120/c2bf52ab-9fa8-4f25-9e5d-512d4f4342fa)


---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: Rachel Shen <rshen@elastic.co>
Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
> Derived from elastic#173068
> Further addresses elastic#169873

## Summary

- We're adding a link to the No Data Prompt to send a person to explore
their data using ES|QL if there exists any ingested data but no data
view.
- This PR populates the query bar with the first available index (some
special handling for logs index.
elastic@2a9edec)
- All consumers of the prompt/no data view are updated in this PR.
- [x] ~There's an issue where, if you're in Discover, clicking the link
won't refresh the page. .~ This is fixed on Discover side by
reinitializing the state container when user clicks the "try es|ql" link
and URL state updates.
- [x] ~There is an issue that you can save the es|ql chart from
Discover, but Dashboard's empty screen blocks the navigation because
data views don't exist
elastic#174316 (comment).
This is fixed by allowing the dashboard to work without the default data
view. Hopefully, this won't lead to major issues
- [x] ~ES|QL panels can't be created without the default data views~
this is fixed by trying to fallback to an ad-hoc dataview, plan to move
that code to the utils introduced here
elastic#174736
- [x] fix circular deps
- [x] Add functional tests


## Visuals



https://github.com/elastic/kibana/assets/7784120/af3592c1-f4c8-43bb-a128-3268b7761367




### Storybook Stories

#### Can access ES|QL

![Screenshot 2024-01-31 at 17 05
47](https://github.com/elastic/kibana/assets/7784120/370d0351-198e-4dc3-b22e-86f497ad4df5)


#### Cannot access (e.g. preview is unavailable - _not implemented_)

![Screenshot 2024-01-31 at 17 05
59](https://github.com/elastic/kibana/assets/7784120/c2bf52ab-9fa8-4f25-9e5d-512d4f4342fa)


---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: Rachel Shen <rshen@elastic.co>
Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
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 ci:build-storybooks impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:medium Medium Level of Effort release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) v8.13.0 WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.