Skip to content

Commit

Permalink
Refresh index pattern list before redirecting (elastic#63329)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Apr 22, 2020
1 parent aecd00f commit 2f794e6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/legacy/core_plugins/kibana/public/discover/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ export class DiscoverPlugin implements Plugin<void, void> {
await this.initializeServices();
await this.initializeInnerAngular();

// make sure the index pattern list is up to date
const [, { data: dataStart }] = await core.getStartServices();
await dataStart.indexPatterns.clearCache();
const { renderApp } = await import('./np_ready/application');
const unmount = await renderApp(innerAngularName, params.element);
return () => {
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/dashboard/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ export class DashboardPlugin
localStorage: new Storage(localStorage),
usageCollection,
};
// make sure the index pattern list is up to date
await dataStart.indexPatterns.clearCache();
const { renderApp } = await import('./application/application');
const unmount = renderApp(params.element, params.appBasePath, deps);
return () => {
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/visualize/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ export class VisualizePlugin
};
setServices(deps);

// make sure the index pattern list is up to date
await pluginsStart.data.indexPatterns.clearCache();
const { renderApp } = await import('./application/application');
const unmount = renderApp(params.element, params.appBasePath, deps);
return () => {
Expand Down
2 changes: 2 additions & 0 deletions test/functional/page_objects/dashboard_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ export function DashboardPageProvider({ getService, getPageObjects }: FtrProvide

public async clickNewDashboard() {
await listingTable.clickNewButton('createDashboardPromptButton');
// make sure the dashboard page is shown
await this.waitForRenderComplete();
}

public async clickCreateDashboardPrompt() {
Expand Down

0 comments on commit 2f794e6

Please sign in to comment.