Skip to content

Commit

Permalink
Make case insensitive and prevent listing page from "blipping" up on …
Browse files Browse the repository at this point in the history
…the screen before the redirect
  • Loading branch information
stacey-gammon committed Nov 9, 2017
1 parent ff0b102 commit c33e31e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core_plugins/kibana/public/dashboard/index.js
Expand Up @@ -33,12 +33,14 @@ uiRoutes
type: 'dashboard',
}).then(results => {
// The search isn't an exact match, lets see if we can find a single exact match to use
const matchingDashboards = results.savedObjects.filter(dashboard => dashboard.attributes.title === title);
const matchingDashboards = results.savedObjects.filter(
dashboard => dashboard.attributes.title.toLowerCase() === title.toLowerCase());
if (matchingDashboards.length === 1) {
kbnUrl.redirect(createDashboardEditUrl(matchingDashboards[0].id));
} else {
kbnUrl.redirect(`${DashboardConstants.LANDING_PAGE_PATH}?filter="${title}"`);
}
throw uiRoutes.WAIT_FOR_URL_CHANGE_TOKEN;
}).catch(courier.redirectWhenMissing({
'dashboard': DashboardConstants.LANDING_PAGE_PATH
}));
Expand Down

0 comments on commit c33e31e

Please sign in to comment.