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

[Discover][Lens] Removes the dataview dependency from the text based mode #158531

Merged
merged 20 commits into from
May 31, 2023

Conversation

kertal
Copy link
Member

@kertal kertal commented May 26, 2023

Summary

Closes #154334

This PR:

  • make the text based languages to work with adhoc dataviews and not permanent dataviews. The text based languages will not be related with dataviews
  • enables the timepicker always for text based languages
  • the timepicker is disabled if the index pattern doesn't have an @timestamp field
  • the timepicker is enabled if the index pattern has an @timestamp field
  • the timepicker is enabled if the index pattern doesn't have an @timestamp field but there is a dirty state (user is writing the query and hasn't hit the update button. We do that to give the user the ability to change the timepicker with the query
  • An info text has been added to the editor footer to inform the users about the @timestamp existence

The timepicker in the disabled state needs to have a disabled status text (All time) but this is not possible atm. I have created an issue to eui elastic/eui#6814 to add this property. This is going to be tackled before the 8.9 FF but we don't want to block this PR

image

Checklist

@@ -136,7 +136,7 @@ export function Chart({
!chart.hidden &&
dataView.id &&
dataView.type !== DataViewType.ROLLUP &&
dataView.isTimeBased()
(isPlainRecord || (!isPlainRecord && dataView.isTimeBased()))
Copy link
Contributor

@stratoula stratoula May 29, 2023

Choose a reason for hiding this comment

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

ℹ️ This was a bug, the chart in text based languages should render regardless if the dataview is timeBased or not as we don't show the histogram but the Lens suggestions

@@ -404,7 +404,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.discover.waitUntilSidebarHasLoaded();

expect(await PageObjects.discover.getSidebarAriaDescription()).to.be(
'1 popular field. 53 available fields. 0 empty fields. 3 meta fields.'
Copy link
Contributor

Choose a reason for hiding this comment

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

ℹ️ this needs to change as adhoc dataviews do not store information for the popular fields

@stratoula stratoula changed the title [Discover] Text based no dataviews addon [Discover][Lens] Removes the dataview dependency from the text based mode May 29, 2023
@stratoula stratoula added v8.9.0 release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Feature:Discover Discover Application Feature:Unified search Unified search related tasks labels May 29, 2023
@stratoula stratoula marked this pull request as ready for review May 29, 2023 08:46
@stratoula stratoula requested review from a team as code owners May 29, 2023 08:46
@stratoula stratoula added the Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. label May 29, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

Pulled and tested locally, and it's working well overall! I left a few comments and questions on the code, but mainly I encountered two things while testing:

After reloading the page, the back button causes a warning toast about the data view ID when going back to a query that generates a new ad hoc data view. This is probably just the standard behaviour when an ad hoc data view isn't in the history state, but I wonder if we should do anything about it here:
back_button

I suspect this one might already exist in main, but I haven't checked yet. It seems that clicking into the text-based editor while the page is still loading will cause the text cursor to get messed up:
text_cursor_on_load

@stratoula
Copy link
Contributor

I suspect this one might already exist in main, but I haven't checked yet. It seems that clicking into the text-based editor while the page is still loading will cause the text cursor to get messed up:

Yes this happens in main too, I have it on my list to see what is going wrong here

@stratoula
Copy link
Contributor

After reloading the page, the back button causes a warning toast about the data view ID when going back to a query that generates a new ad hoc data view. This is probably just the standard behaviour when an ad hoc data view isn't in the history state, but I wonder if we should do anything about it here:

Good catch! I fixed it, we don't need these warnings for the text based mode. We had already silenced one in the past

Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

Thanks for the changes, looks like the warning toast is fixed! LGTM 👍

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
discover 459 460 +1

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/text-based-editor 13 14 +1
textBasedLanguages 16 17 +1
total +2

Async chunks

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

id before after diff
discover 421.2KB 421.6KB +434.0B
lens 1.2MB 1.2MB -131.0B
textBasedLanguages 67.9KB 68.6KB +759.0B
unifiedHistogram 43.4KB 43.4KB +58.0B
unifiedSearch 211.2KB 212.0KB +755.0B
total +1.8KB
Unknown metric groups

API count

id before after diff
@kbn/text-based-editor 14 15 +1
textBasedLanguages 16 17 +1
total +2

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 416 420 +4
total +6

References to deprecated APIs

id before after diff
discover 29 24 -5

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 500 504 +4
total +6

History

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

cc @kertal @stratoula

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.

As we are going to remove the ESQL entrypoint from Lens and the unified search changes are minimal I am approving on behalf of the visualizations team

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 Feature:Discover Discover Application Feature:Unified search Unified search related tasks 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. v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Text based] Remove the dataviews dependency
6 participants