mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Spiffier UI: Allow opening nav items in new tab (#3514)
This commit is contained in:
parent
eba183d506
commit
bb2b8fa70f
1
changes/issue-340-nav-open-new-tab
Normal file
1
changes/issue-340-nav-open-new-tab
Normal file
@ -0,0 +1 @@
|
||||
* Nav items can be opened in a new tab or window
|
@ -69,7 +69,7 @@ describe(
|
||||
|
||||
// Go to host details page
|
||||
cy.location("pathname").should("match", /hosts\/[0-9]/i);
|
||||
cy.get("span.status").should("contain", /online/i);
|
||||
cy.getAttached("span.status").should("contain", /online/i);
|
||||
|
||||
// Run policy on host
|
||||
let policyname = "";
|
||||
|
@ -1,4 +1,5 @@
|
||||
import React, { Component } from "react";
|
||||
import { Link } from "react-router";
|
||||
import PropTypes from "prop-types";
|
||||
import classnames from "classnames";
|
||||
|
||||
@ -35,7 +36,6 @@ class SiteTopNav extends Component {
|
||||
renderNavItem = (navItem) => {
|
||||
const { name, iconName } = navItem;
|
||||
const {
|
||||
onNavItemClick,
|
||||
pathname,
|
||||
config: { org_logo_url: orgLogoURL },
|
||||
} = this.props;
|
||||
@ -51,12 +51,12 @@ class SiteTopNav extends Component {
|
||||
if (iconName === "logo") {
|
||||
return (
|
||||
<li className={navItemClasses} key={`nav-item-${name}`}>
|
||||
<a
|
||||
<Link
|
||||
className={`${navItemBaseClass}__link`}
|
||||
onClick={onNavItemClick(navItem.location.pathname)}
|
||||
to={navItem.location.pathname}
|
||||
>
|
||||
<OrgLogoIcon className="logo" src={orgLogoURL} />
|
||||
</a>
|
||||
</Link>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
@ -82,9 +82,9 @@ class SiteTopNav extends Component {
|
||||
|
||||
return (
|
||||
<li className={navItemClasses} key={`nav-item-${name}`}>
|
||||
<a
|
||||
<Link
|
||||
className={`${navItemBaseClass}__link`}
|
||||
onClick={onNavItemClick(navItem.location.pathname)}
|
||||
to={navItem.location.pathname}
|
||||
>
|
||||
{icon}
|
||||
<span
|
||||
@ -93,7 +93,7 @@ class SiteTopNav extends Component {
|
||||
>
|
||||
{name}
|
||||
</span>
|
||||
</a>
|
||||
</Link>
|
||||
</li>
|
||||
);
|
||||
};
|
||||
|
@ -67,6 +67,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 14px 20px 17px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
&--active {
|
||||
|
Loading…
Reference in New Issue
Block a user