diff --git a/src/plugins/home/public/application/components/home_app.js b/src/plugins/home/public/application/components/home_app.js index ea073b2bf29c..d245898678ba 100644 --- a/src/plugins/home/public/application/components/home_app.js +++ b/src/plugins/home/public/application/components/home_app.js @@ -61,16 +61,27 @@ const renderTutorialDirectory = (props) => { addBasePath={addBasePath} openTab={props.match.params.tab} isCloudEnabled={isCloudEnabled} + homeLink={props.homeLink} /> ); }; export function ImportSampleDataApp() { + const { application } = getServices(); return ( - + + renderTutorialDirectory({ + ...props, + homeLink: application.getUrlForApp('home'), + }) + } + /> diff --git a/src/plugins/home/public/application/components/tutorial_directory.js b/src/plugins/home/public/application/components/tutorial_directory.js index 0af08333221d..dc44d057990a 100644 --- a/src/plugins/home/public/application/components/tutorial_directory.js +++ b/src/plugins/home/public/application/components/tutorial_directory.js @@ -93,7 +93,8 @@ class TutorialDirectoryUi extends React.Component { async componentDidMount() { this._isMounted = true; - const { chrome, homeLink } = getServices(); + const { chrome } = getServices(); + const { homeLink } = this.props; chrome.setBreadcrumbs([ { diff --git a/src/plugins/home/public/application/opensearch_dashboards_services.ts b/src/plugins/home/public/application/opensearch_dashboards_services.ts index 5be37bda101b..02dc4b2b84b4 100644 --- a/src/plugins/home/public/application/opensearch_dashboards_services.ts +++ b/src/plugins/home/public/application/opensearch_dashboards_services.ts @@ -77,7 +77,6 @@ export interface HomeOpenSearchDashboardsServices { dataSource?: DataSourcePluginStart; workspaces: WorkspacesStart; sectionTypes: SectionTypeService; - homeLink?: string; } let services: HomeOpenSearchDashboardsServices | null = null; diff --git a/src/plugins/home/public/plugin.ts b/src/plugins/home/public/plugin.ts index 0d40d8f3a9b9..d7867959d019 100644 --- a/src/plugins/home/public/plugin.ts +++ b/src/plugins/home/public/plugin.ts @@ -157,9 +157,7 @@ export class HomePublicPlugin navLinkStatus: AppNavLinkStatus.hidden, mount: async (params: AppMountParameters) => { const [coreStart] = await core.getStartServices(); - setCommonService({ - homeLink: coreStart.application.getUrlForApp('home'), - }); + setCommonService(); coreStart.chrome.docTitle.change( i18n.translate('home.tutorialDirectory.featureCatalogueTitle', { defaultMessage: 'Add sample data',