mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
51dccb9555
commit
7038ce28bf
2 changed files with 4 additions and 3 deletions
|
@ -82,10 +82,11 @@ describe('Dashboard URL Helper', () => {
|
|||
x: 'y',
|
||||
y: 'z',
|
||||
});
|
||||
url = 'http://notDashboardUrl';
|
||||
expect(getUrlVars(url)).toEqual({});
|
||||
url = 'http://localhost:5601/app/kibana#/dashboard/777182';
|
||||
expect(getUrlVars(url)).toEqual({});
|
||||
url =
|
||||
'http://localhost:5601/app/kibana#/dashboard/777182?title=Some%20Dashboard%20With%20Spaces';
|
||||
expect(getUrlVars(url)).toEqual({ title: 'Some Dashboard With Spaces' });
|
||||
});
|
||||
|
||||
it('getLensUrlFromDashboardAbsoluteUrl', () => {
|
||||
|
|
|
@ -28,7 +28,7 @@ export function getUrlVars(url: string): Record<string, string> {
|
|||
// @ts-ignore
|
||||
url.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(_, key, value) {
|
||||
// @ts-ignore
|
||||
vars[key] = value;
|
||||
vars[key] = decodeURIComponent(value);
|
||||
});
|
||||
return vars;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue