-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new title query param to dashboard listing page #14760
Add new title query param to dashboard listing page #14760
Conversation
@stacey-gammon I think this definitely does solve it! Awesome! Did you try search by title with spaces and weird characters and things that might be in a title in your tests? Does it kill two birds with one stone and allow a query that pre-populates the dashboard filter as well? |
So far seems to handle everything I can throw at it: (though I use the encoded version of that title)
yep, with the new |
hmmm failure looks unrelated:
jenkins, test this |
kbnUrl.redirect(createDashboardEditUrl(matchingDashboards[0].id)); | ||
} else { | ||
kbnUrl.redirect(`${DashboardConstants.LANDING_PAGE_PATH}?filter="${title}"`); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you throw uiRoutes.WAIT_FOR_URL_CHANGE_TOKEN
after calling kbnUrl.redirect()
then the router will wait for the url change to take effect (might take a tick or two) rather than rendering the route.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this to be case-sensitive? We're prompting the user for duplicate names on save even if they have different cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my gut feel is that it shouldn't be case sensitive, because I think it'd be a little weird to require them to write in the correct case in order to load the dashboard. That's just me though, I'd probably guess not case sensitive if I was wondering how it worked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
being case-insensitive feels right to me as well
This is great, just one question but besides that everything appears to be working here! Also, should we add functional tests for this? |
… found, if not, to refill the search box on the listing page
…the screen before the redirect
d1439a5
to
c33e31e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
* introduce a mechanism to load a dashboard by title is a single one is found, if not, to refill the search box on the listing page * Make case insensitive and prevent listing page from "blipping" up on the screen before the redirect * Add tests
* introduce a mechanism to load a dashboard by title is a single one is found, if not, to refill the search box on the listing page * Make case insensitive and prevent listing page from "blipping" up on the screen before the redirect * Add tests
If a single dashboard with that exact title is found, it's automatically loaded up. If not, it'll load the listing table up with the search box prefilled.
There is a little blip when loading the dashboard that first shows the listing page. I thought putting the logic in the resolve portion of the route would prevent the listing page from being loaded until that logic is complete. @spalger, do you know if there is an angular way to prevent that blip that I'm doing wrong?