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

[Serverless Elasticsearch] User is blocked from moving forward when opening Discover, Dashboard, or Visualize Library #164432

Closed
Dosant opened this issue Aug 22, 2023 · 6 comments · Fixed by #164709
Assignees
Labels
Project:Serverless Work as part of the Serverless project for its initial release Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)

Comments

@Dosant
Copy link
Contributor

Dosant commented Aug 22, 2023

Serverless Elasticsearch blocks users from moving forward when opening Discover, Dashboard, or Visualize Library.

Screenshot 2023-08-21 at 12 51 32

In other serverless projects and regular Kibana this no-data page redirects to /integrations (fleet), but Serverless Elasticsearch project disabled fleet and no data component doesn't handle this case and fallbacks to no permissions screen.

if (!canAccessFleet) {
return <EuiTextColor color="default">{noPermissionDescription}</EuiTextColor>;
}

Locally this isn't reproduced because of isDev hack

const hasESDataValue = isDev || (await data.dataViews.hasData.hasESData().catch(() => false));

@Dosant Dosant added Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) Project:Serverless Work as part of the Serverless project for its initial release labels Aug 22, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@Dosant
Copy link
Contributor Author

Dosant commented Aug 22, 2023

Here are some ideas on how to fix this from a technical perspective:

Option 1. Fix inside the shared <NoData/> component (shared-ux)

Currently, the <NoData/> component can only redirect to the /integrations page if there is no data. When fleet is disabled, it thinks that the user has no access to the fleet and shows that blocking card. We can add an "Elasticsearch project getting started card" which would redirect to the getting started page /app/elasticsearch we can also automatically redirect from there.

The difficulty with this approach is that will have to change the component's API and configure this behavior in every place where it is used (Discover, Visualize, Dashboard). Through the config or some new extension point serverless search project will have to pass an option to show "Elasticsearch project getting started card" instead of the default fleet-based empty state.

A simpler alternative could be if we'd add a generic "Go Home" card which redirects to home URL. For the serverless search project this would be "getting started" page.

Option 2. Fix in Discover, Visualize, Dashboard where the apps determine if they need to show <NoData/> component (falls on AppEx AnalystXP teams)

Example in Discover:

const checkData = useCallback(async () => {
try {
if (savedSearchId) {
return true; // bypass NoData screen
}
const hasUserDataViewValue = await data.dataViews.hasData
.hasUserDataView()
.catch(() => false);
const hasESDataValue = isDev || (await data.dataViews.hasData.hasESData().catch(() => false));
setHasUserDataView(hasUserDataViewValue);
setHasESData(hasESDataValue);
if (!hasUserDataViewValue) {
setShowNoDataPage(true);
return false;
}
let defaultDataView: DataView | null = null;
try {
defaultDataView = await data.dataViews.getDefaultDataView({ displayErrors: false });
} catch (e) {
//
}
if (!defaultDataView) {
setShowNoDataPage(true);
return false;
}
return true;
} catch (e) {
setError(e);
return false;
}
}, [data.dataViews, isDev, savedSearchId]);

How could be implemented:

  1. Discover adds new kibana.yml option discover.enableEmptyState: boolean
  2. Discover uses it to skip the empty state
  3. Serverless elasticsearch project sets it in config/serverless.es.yml

Note: more changes will be needed from each app, because, for example, Discover fails if there is no data and no data views :
Screenshot 2023-08-22 at 13 36 38

An alternative that won't require applications fixes for empty states could be if the apps sredirect to home. For the serverless search project this would be "getting started" page, so I think the simplest short term fix would be:

  1. Discover adds new kibana.yml option discover.redirectHomeIfEmpty: boolean
  2. Discover uses it to redirect to home page if it loads with empty state
  3. Serverless elasticsearch project sets this option in config/serverless.es.yml
    (same for visualize and dashboard)

@sebelga
Copy link
Contributor

sebelga commented Aug 22, 2023

As mentioned in Slack, if we can allow a specific deepLinkId to redirect to that would give more flexibility.

If that's too complex for a first iteration, I'd prefer a more specific "noData.." in the naming of the config. "Empty" is ambiguous, what is empty? 😊 So something like discover.noData.redirectToHomePage: true

@Dosant
Copy link
Contributor Author

Dosant commented Aug 23, 2023

Here is an example how a simple redirect approach would look like. As described technically it is the simplest fix, however it still can be confusing for users

Screen.Recording.2023-08-23.at.11.48.48.mov

@Dosant
Copy link
Contributor Author

Dosant commented Aug 23, 2023

Here how it would look if we’d change the action card. The button would lead back to “getting started” page
(Welcome to Analytics doesn’t really make sense here, this also probably needs to be changed)

Screenshot 2023-08-23 at 13 27 13

@Dosant
Copy link
Contributor Author

Dosant commented Aug 24, 2023

Moving ahead with the updated page and card:

wip pr: #164709

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Project:Serverless Work as part of the Serverless project for its initial release Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)
Projects
None yet
3 participants