From 9bbf811bd05a96fc157443bad7aaf8b57f4a26b1 Mon Sep 17 00:00:00 2001 From: "Qingyang(Abby) Hu" Date: Mon, 26 Jun 2023 14:20:33 -0700 Subject: [PATCH] No index pattern routing (#4401) Should redirect to stack management page if there is no index pattern detected. Signed-off-by: abbyhu2000 --- src/plugins/dashboard/public/plugin.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/dashboard/public/plugin.tsx b/src/plugins/dashboard/public/plugin.tsx index 205a114fc3bf..229c80e663c8 100644 --- a/src/plugins/dashboard/public/plugin.tsx +++ b/src/plugins/dashboard/public/plugin.tsx @@ -374,6 +374,13 @@ export class DashboardPlugin mount: async (params: AppMountParameters) => { const [coreStart, pluginsStart, dashboardStart] = await core.getStartServices(); this.currentHistory = params.history; + + // make sure the index pattern list is up to date + pluginsStart.data.indexPatterns.clearCache(); + // make sure a default index pattern exists + // if not, the page will be redirected to management and dashboard won't be rendered + await pluginsStart.data.indexPatterns.ensureDefaultIndexPattern(); + appMounted(); const { embeddable: embeddableStart,