-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Serverless Elasticsearch] Fix user is blocked from moving forward when opening Discover, Dashboard, or Visualize Library #164709
Conversation
@@ -0,0 +1,3 @@ | |||
# No Data Page | |||
|
|||
Helps to globally configure the no data page components |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need this dummy plugin to create a config for configuring the analytics empty pages "flavor"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative could be that all discover, visualize, dashboards expose this config on their own and pass it to the component.
@@ -33,13 +33,13 @@ export const NoDataPage = ({ | |||
values: { solution }, | |||
}); | |||
|
|||
const link = ( | |||
const link = docsLink ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making docsLink
here optional to skip the docs link for serverless search empty page for now
'data-test-subj': 'kbnOverviewElasticsearchGettingStarted', | ||
href: prependBasePath('/app/elasticsearch/'), | ||
/** force the no data card to be shown **/ | ||
canAccessFleet: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing/faking this explicitly so that NoDataCard
doesn't fallback to the "no access to fleet" page. This needs to be refactored.
Currently, it is ugly: even though the NoDataCard
seems to be generic and text and links can be configured through props, some "fleet" logic parts are still hardcoded inside the component. For example, the component checks the access to fleet through context.
'Set up your programming language client, ingest some data, and start searching.', | ||
}), | ||
'data-test-subj': 'kbnOverviewElasticsearchGettingStarted', | ||
href: prependBasePath('/app/elasticsearch/'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
href on this level is added only for "serverless_search" flavor, but not for "kibana" flavor because the integrations page is already hardcoded inside the component. The NoDataCard
must be refactored to be fully configurable and don't hardcode fleet stuff.
…into d/2023-08-23-search-empty
…into d/2023-08-23-search-empty
@@ -109,7 +105,7 @@ export function DiscoverMainRoute({ | |||
const hasUserDataViewValue = await data.dataViews.hasData | |||
.hasUserDataView() | |||
.catch(() => false); | |||
const hasESDataValue = isDev || (await data.dataViews.hasData.hasESData().catch(() => false)); | |||
const hasESDataValue = await data.dataViews.hasData.hasESData().catch(() => false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elastic/kibana-data-discovery
, hope you don't mind. Because of isDev
check I couldn't add a functional test for this state that would pass locally. This also made it harder to discover the bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elasticmachine merge upstream |
Pinging @elastic/appex-sharedux (Team:SharedUX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New Dashboard service LGTM! Code only review. Great to see this addressed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes to config/serverless.es.yml
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Visualize listing page LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Tested locally and works as expected.
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @Dosant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for fixing this 👍 Tested and works as expected now 👍
Thanks for the review @afharo @kc13greiner @stratoula @kertal @ThomThomson @jbudz ! @sphilipse if you have any feedback we can address it in a separate PR 👍 |
Summary
fix #164432
AnalyticsNoDataPage
could only point to "Integrations" (fleet), but serverless search disabled fleet plugin. TheAnalyticsNoDataPage
started showing "no access to fleet" state. This PR fixes it and shows empty state that makes sense for serverless search project:In this PR I am hacking together a way to override the content of the
AnalyticsNoDataPage
:AnalyticsNoDataPage
could only point to "Integrations". Some integrations-specific URLs and access checks are hardcoded deep inside the component. If the fleet plugin was not available, it just showed that the user didn't have access.AnalyticsNoDataPage
introduces "flavor" ('kibana' | 'serverless_search'). Depending on flavor it passes down different texts for the page and the card. There is also acanAccessFleet
hack that forces it to "true" for theserverless_search
flavor. This is needed to skip the fleet plugin access from inside the component and to avoid showing a "no permissions state". This needs to be refactored: probably, the inner card shouldn't be so tightly coupled to fleetno_data_page
plugin is added to register the new configno_data_page.analyticsNoDataPageFlavor: 'serverless_search'
. Analytics apps will pass the plugin down to theAnalyticsNoDataPage
so it can pick the flavor. The introduced plugin is the downside of having such a complex page as a stateless component. An Alternative could be if discover, visualize, dashboard would register their configs to pass down toAnalyticsNoDataPage
.