Skip to content

Commit

Permalink
Changed lens and visualize to use navigateToApp when returning to a n…
Browse files Browse the repository at this point in the history
…on-dashboard originating app
  • Loading branch information
ThomThomson committed May 12, 2020
1 parent e481dc1 commit 0f581df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/plugins/visualize/public/application/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function VisualizeAppController($scope, $route, $injector, $timeout, kbnUrlState
data: { query: queryService, indexPatterns },
toastNotifications,
chrome,
core: { docLinks, fatalErrors, uiSettings },
core: { docLinks, fatalErrors, uiSettings, application },
I18nContext,
setActiveUrl,
visualizations,
Expand Down Expand Up @@ -684,8 +684,7 @@ function VisualizeAppController($scope, $route, $injector, $timeout, kbnUrlState
embeddableType: VISUALIZE_EMBEDDABLE_TYPE,
});
} else {
const href = chrome.navLinks.get(lastAppType).url;
window.location.href = href;
application.navigateToApp(lastAppType);
}
} else if (savedVis.id === $route.current.params.id) {
chrome.docTitle.change(savedVis.lastSavedTitle);
Expand Down
6 changes: 1 addition & 5 deletions x-pack/plugins/lens/public/app_plugin/mounter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ export async function mountApp(
embeddableType: LENS_EMBEDDABLE_TYPE,
});
} else {
const originatingAppLink = coreStart.chrome.navLinks.get(originatingApp);
if (!originatingAppLink || !originatingAppLink.url) {
throw new Error('Cannot get originating app url');
}
window.location.href = originatingAppLink.url;
coreStart.application.navigateToApp(originatingApp);
}
}
};
Expand Down

0 comments on commit 0f581df

Please sign in to comment.