Skip to content

Commit

Permalink
feat: add validation and redirect for index pattern (#137)
Browse files Browse the repository at this point in the history
Signed-off-by: raintygao <[email protected]>
  • Loading branch information
raintygao authored Dec 23, 2022
1 parent 66442fe commit 9e1217a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions maps_dashboards/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ export class MapsDashboardsPlugin
// Get start services as specified in opensearch_dashboards.json
const [coreStart, depsStart] = await core.getStartServices();
const { navigation, data } = depsStart as AppPluginStartDependencies;

// make sure the index pattern list is up to date
data.indexPatterns.clearCache();
// make sure a default index pattern exists
// if not, the page will be redirected to management and maps won't be rendered
await data.indexPatterns.ensureDefaultIndexPattern();

const services: MapServices = {
...coreStart,
setHeaderActionMenu: params.setHeaderActionMenu,
Expand Down

0 comments on commit 9e1217a

Please sign in to comment.