From 7edae4b2a296bddbfb19ccb386b47be8e93ea410 Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Tue, 18 Aug 2020 11:39:11 +0300 Subject: [PATCH] [Dashboard] Sample data link does not work Closes #74812 --- .../listing/__snapshots__/dashboard_listing.test.js.snap | 5 +++++ .../public/application/listing/dashboard_listing.js | 2 +- .../public/application/listing/dashboard_listing.test.js | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/plugins/dashboard/public/application/listing/__snapshots__/dashboard_listing.test.js.snap b/src/plugins/dashboard/public/application/listing/__snapshots__/dashboard_listing.test.js.snap index 7985d34b117f5..82c90530c2b4c 100644 --- a/src/plugins/dashboard/public/application/listing/__snapshots__/dashboard_listing.test.js.snap +++ b/src/plugins/dashboard/public/application/listing/__snapshots__/dashboard_listing.test.js.snap @@ -11,6 +11,7 @@ exports[`after fetch hideWriteControls 1`] = ` findItems={[Function]} headingId="dashboardListingHeading" initialFilter="" + initialPageSize={10} listingLimit={1} noItemsFragment={
@@ -68,6 +69,7 @@ exports[`after fetch initialFilter 1`] = ` findItems={[Function]} headingId="dashboardListingHeading" initialFilter="my dashboard" + initialPageSize={10} listingLimit={1000} noItemsFragment={
@@ -169,6 +171,7 @@ exports[`after fetch renders call to action when no dashboards exist 1`] = ` findItems={[Function]} headingId="dashboardListingHeading" initialFilter="" + initialPageSize={10} listingLimit={1} noItemsFragment={
@@ -270,6 +273,7 @@ exports[`after fetch renders table rows 1`] = ` findItems={[Function]} headingId="dashboardListingHeading" initialFilter="" + initialPageSize={10} listingLimit={1000} noItemsFragment={
@@ -371,6 +375,7 @@ exports[`after fetch renders warning when listingLimit is exceeded 1`] = ` findItems={[Function]} headingId="dashboardListingHeading" initialFilter="" + initialPageSize={10} listingLimit={1} noItemsFragment={
diff --git a/src/plugins/dashboard/public/application/listing/dashboard_listing.js b/src/plugins/dashboard/public/application/listing/dashboard_listing.js index c8cb551fbe561..1a7a6b1d75234 100644 --- a/src/plugins/dashboard/public/application/listing/dashboard_listing.js +++ b/src/plugins/dashboard/public/application/listing/dashboard_listing.js @@ -115,7 +115,7 @@ export class DashboardListing extends React.Component { sampleDataInstallLink: ( - this.props.core.application.navigateTo('home', { + this.props.core.application.navigateToApp('home', { path: '#/tutorial_directory/sampleData', }) } diff --git a/src/plugins/dashboard/public/application/listing/dashboard_listing.test.js b/src/plugins/dashboard/public/application/listing/dashboard_listing.test.js index dccac4e7c3c76..6acb491f9a20c 100644 --- a/src/plugins/dashboard/public/application/listing/dashboard_listing.test.js +++ b/src/plugins/dashboard/public/application/listing/dashboard_listing.test.js @@ -79,6 +79,7 @@ describe('after fetch', () => { getViewUrl={() => {}} listingLimit={1000} hideWriteControls={false} + initialPageSize={10} initialFilter="my dashboard" core={{ notifications: { toasts: {} }, uiSettings: { get: jest.fn(() => 10) } }} /> @@ -101,6 +102,7 @@ describe('after fetch', () => { editItem={() => {}} getViewUrl={() => {}} listingLimit={1000} + initialPageSize={10} hideWriteControls={false} core={{ notifications: { toasts: {} }, uiSettings: { get: jest.fn(() => 10) } }} /> @@ -123,6 +125,7 @@ describe('after fetch', () => { editItem={() => {}} getViewUrl={() => {}} listingLimit={1} + initialPageSize={10} hideWriteControls={false} core={{ notifications: { toasts: {} }, uiSettings: { get: jest.fn(() => 10) } }} /> @@ -145,6 +148,7 @@ describe('after fetch', () => { editItem={() => {}} getViewUrl={() => {}} listingLimit={1} + initialPageSize={10} hideWriteControls={true} core={{ notifications: { toasts: {} }, uiSettings: { get: jest.fn(() => 10) } }} /> @@ -167,6 +171,7 @@ describe('after fetch', () => { editItem={() => {}} getViewUrl={() => {}} listingLimit={1} + initialPageSize={10} hideWriteControls={false} core={{ notifications: { toasts: {} }, uiSettings: { get: jest.fn(() => 10) } }} />