SideMenu: Fixes issue with logout link opened in new tab (#21488)

* SideMenu: Fixes issue with logout link opened in new tab

* Updated snapshot
This commit is contained in:
Torkel Ödegaard 2020-01-15 10:29:27 +01:00 committed by GitHub
parent 2355d0901a
commit 98bbdea69d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 7 deletions

View File

@ -5,24 +5,28 @@ export interface FooterLink {
text: string; text: string;
icon?: string; icon?: string;
url?: string; url?: string;
target: string;
} }
export let getFooterLinks = (): FooterLink[] => { export let getFooterLinks = (): FooterLink[] => {
return [ return [
{ {
text: 'Docs', text: 'Documentation',
icon: 'fa fa-file-code-o', icon: 'fa fa-file-code-o',
url: 'https://grafana.com/docs/grafana/latest/?utm_source=grafana_footer', url: 'https://grafana.com/docs/grafana/latest/?utm_source=grafana_footer',
target: '_blank',
}, },
{ {
text: 'Support & Enterprise', text: 'Support & Enterprise',
icon: 'fa fa-support', icon: 'fa fa-support',
url: 'https://grafana.com/products/enterprise/?utm_source=grafana_footer', url: 'https://grafana.com/products/enterprise/?utm_source=grafana_footer',
target: '_blank',
}, },
{ {
text: 'Community', text: 'Community',
icon: 'fa fa-comments-o', icon: 'fa fa-comments-o',
url: 'https://community.grafana.com/?utm_source=grafana_footer', url: 'https://community.grafana.com/?utm_source=grafana_footer',
target: '_blank',
}, },
]; ];
}; };
@ -34,6 +38,7 @@ export let getVersionLinks = (): FooterLink[] => {
{ {
text: `Grafana v${buildInfo.version} (commit: ${buildInfo.commit})`, text: `Grafana v${buildInfo.version} (commit: ${buildInfo.commit})`,
url: 'https://grafana.com', url: 'https://grafana.com',
target: '_blank',
}, },
]; ];
@ -42,6 +47,7 @@ export let getVersionLinks = (): FooterLink[] => {
text: `New version available!`, text: `New version available!`,
icon: 'fa fa-download', icon: 'fa fa-download',
url: 'https://grafana.com/grafana/download?utm_source=grafana_footer', url: 'https://grafana.com/grafana/download?utm_source=grafana_footer',
target: '_blank',
}); });
} }

View File

@ -76,7 +76,7 @@ class BottomNavLinks extends PureComponent<Props, State> {
{children.map((child, index) => { {children.map((child, index) => {
return ( return (
<li key={`${child.text}-${index}`}> <li key={`${child.text}-${index}`}>
<a href={child.url} target="_blank" rel="noopener"> <a href={child.url} target={child.target} rel="noopener">
{child.icon && <i className={child.icon} />} {child.icon && <i className={child.icon} />}
{child.text} {child.text}
</a> </a>

View File

@ -20,7 +20,6 @@ exports[`Render should render children 1`] = `
> >
<a <a
rel="noopener" rel="noopener"
target="_blank"
/> />
</li> </li>
<li <li
@ -28,7 +27,6 @@ exports[`Render should render children 1`] = `
> >
<a <a
rel="noopener" rel="noopener"
target="_blank"
/> />
</li> </li>
<li <li
@ -36,7 +34,6 @@ exports[`Render should render children 1`] = `
> >
<a <a
rel="noopener" rel="noopener"
target="_blank"
/> />
</li> </li>
<li <li
@ -44,7 +41,6 @@ exports[`Render should render children 1`] = `
> >
<a <a
rel="noopener" rel="noopener"
target="_blank"
/> />
</li> </li>
<li <li

View File

@ -167,7 +167,7 @@ exports[`ServerStats Should render table with stats 1`] = `
className="fa fa-file-code-o" className="fa fa-file-code-o"
/> />
Docs Documentation
</a> </a>
</li> </li>
<li> <li>