Commit 7b18b101 by Kamal Galrani Committed by GitHub

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 2b23db8dc4bc6e8db5de6f09b0ab3b7cf29b11d1.
parent 319051c7
......@@ -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>
......
......@@ -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"
......
......@@ -44,7 +44,7 @@ export interface DashboardLink {
asDropdown: boolean;
tags: [];
searchHits?: [];
target: string;
targetBlank: boolean;
}
export class DashboardModel {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment