Dashboard/Links: Fixes open in new window for dashboard link (#24772)

* fixes target in dashboard link

* Update DashboardLinks.tsx

* Revert "Update DashboardLinks.tsx"

This reverts commit 2b23db8dc4.
This commit is contained in:
Kamal Galrani 2020-05-18 13:06:31 +05:30 committed by GitHub
parent 319051c70e
commit 7b18b101b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -25,7 +25,11 @@ export const DashboardLinks: FC<Props> = ({ dashboard }) => {
}
const linkElement = (
<a className="gf-form-label" href={sanitizeUrl(linkInfo.href)} target={link.target}>
<a
className="gf-form-label"
href={sanitizeUrl(linkInfo.href)}
target={link.targetBlank ? '_blank' : '_self'}
>
<Icon name={iconMap[link.icon] as IconName} />
<span>{sanitize(linkInfo.title)}</span>
</a>

View File

@ -45,7 +45,7 @@ export class DashboardsDropdown extends PureComponent<Props, State> {
<div className="gf-form">
<a
className="gf-form-label pointer"
target={link.target}
target={link.targetBlank ? '_blank' : '_self'}
onClick={this.onDropDownClick}
data-placement="bottom"
data-toggle="dropdown"

View File

@ -44,7 +44,7 @@ export interface DashboardLink {
asDropdown: boolean;
tags: [];
searchHits?: [];
target: string;
targetBlank: boolean;
}
export class DashboardModel {