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

[Dashboard] Add Analytics No Data Page #132188

Merged
merged 15 commits into from
May 24, 2022

Conversation

ThomThomson
Copy link
Contributor

@ThomThomson ThomThomson commented May 12, 2022

Fixes #132144

Summary

Adopts the Shared UX no data component in the Dashboard listing page, and in the dashboard app.

Add integrations callout in dashboard

Screen Shot 2022-05-18 at 6 07 44 PM

Creating a Data View from the create Dashboard route

Create Data View In Dashboard

Creating a Data View from the Dashboard Listing route

Create Data view in dashboard listing page

Checklist

Delete any items that are not applicable to this PR.

@ThomThomson ThomThomson added release_note:enhancement Feature:Dashboard Dashboard related features Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas loe:medium Medium Level of Effort impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. v8.3.0 labels May 18, 2022
@ThomThomson ThomThomson marked this pull request as ready for review May 19, 2022 19:13
@ThomThomson ThomThomson requested review from a team as code owners May 19, 2022 19:13
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

Copy link
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

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

LGTM

reviewed app services change + ran locally

Copy link
Contributor

@Heenawter Heenawter left a comment

Choose a reason for hiding this comment

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

Tested locally + code review - one tiny question but otherwise works great! 👍

Comment on lines 30 to 32
// loadTestFile(require.resolve('./dashboard_time'));
// loadTestFile(require.resolve('./dashboard_listing'));
// loadTestFile(require.resolve('./dashboard_clone'));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason these other tests are commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤭

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I commented them out just for testing purposes. That would have been bad. Thank you for catching this.

Copy link
Contributor

@majagrubic majagrubic left a comment

Choose a reason for hiding this comment

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

Let's not merge this until the issue with permissions is resolved, I'll keep you updated.

return true;
}

const defaultDataView = await dataViews.getDefaultDataView();
Copy link
Contributor

Choose a reason for hiding this comment

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

is this check necessary for Dashboard?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good question. The older version of this code had an ensureDefaultDataView check, so it seems to have been required before, but I can't exactly understand why. If there are any data views, surely one of them should be default, no?

Is there a reason this was required for Discover?

Copy link
Contributor

Choose a reason for hiding this comment

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

if memory serves well, in Discover, you save a saved search with a data view. if all data views get deleted and you try opening a saved search, that would throw an error. That's why the check. That being said, it was there before checking for existence of any data view, so I am not sure if it's relevant any more.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems like it should all work the same. I will remove this from the dashboard side!

);
};

export const isDashboardAppEmpty = async (dataViews: DataPublicPluginStart['dataViews']) => {
Copy link
Contributor

@majagrubic majagrubic May 20, 2022

Choose a reason for hiding this comment

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

just a nit: we're trying to standardize terminology in a way that by "no data" we refer to "there is no data in ES or there are no data views". by "empty" we refer to "this app is empty", aka there is data, but there are no dashboards yet. can we rename this to something like "noDataCheck" or "hasData" or even "canUseDashboard"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I will rename all of these. Naming is important, thank you for pointing this out!

@@ -47,7 +47,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
indices: [
{
names: ['ecommerce', 'kibana_sample_data_ecommerce'],
privileges: ['read'],
privileges: ['read', 'view_index_metadata'],
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's not change permissions here as this is a valid test case that caught a pretty big error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Aye aye, will undo this now that the fix is merged in!

@majagrubic
Copy link
Contributor

The app-services change has been merged: #132618

Can you try removing the additional privilege in the functional test and see if this works?

@ThomThomson
Copy link
Contributor Author

@elasticmachine merge upstream

@majagrubic
Copy link
Contributor

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
dashboard 266 375 +109

Async chunks

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

id before after diff
dashboard 304.4KB 439.6KB +135.2KB
Unknown metric groups

async chunk count

id before after diff
dashboard 3 10 +7

miscellaneous assets size

id before after diff
dashboard 0.0B 161.8KB +161.8KB

History

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

Copy link
Contributor

@majagrubic majagrubic left a comment

Choose a reason for hiding this comment

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

I pushed a commit that re-introduces a check for default data view. That actually does more than just check for one; it loads a default data view if there is none. This is needed in case of switching spaces, where a wrong data view could stay associated with the dashboard and dashboard would try to load the data from the data view from a previous space (which doesn't exist in a current space). Sorry for leading you down the wrong path.
Also approving this for no data changes, so that it doesn't block merging.

@ThomThomson ThomThomson merged commit 556b491 into elastic:main May 24, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label May 24, 2022
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:Dashboard Dashboard related features impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:medium Medium Level of Effort release_note:enhancement Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Call to Action] Please Adopt new AnalyticsNoDataPage for no-data handling on the Dashboard
7 participants