Skip to content
Snippets Groups Projects
Unverified Commit f0be8a32 authored by Kyle Doherty's avatar Kyle Doherty Committed by GitHub
Browse files

fix-profile-help-link (#8172)

parent 722afa46
No related branches found
No related tags found
No related merge requests found
......@@ -113,6 +113,7 @@ class EntityMenu extends Component {
<EntityMenuItem
icon={item.icon}
title={item.title}
externalLink={item.externalLink}
action={
item.action &&
(() => {
......
......@@ -48,10 +48,11 @@ const itemClasses = cxs({
},
});
const LinkMenuItem = ({ children, link, onClose, event }) => (
const LinkMenuItem = ({ children, link, onClose, event, externalLink }) => (
<Link
className={itemClasses}
to={link}
target={externalLink ? "_blank" : null}
onClick={onClose}
data-metabase-event={event}
>
......@@ -65,7 +66,15 @@ const ActionMenuItem = ({ children, action, event }) => (
</div>
);
const EntityMenuItem = ({ action, title, icon, link, onClose, event }) => {
const EntityMenuItem = ({
action,
title,
icon,
link,
onClose,
event,
externalLink,
}) => {
if (link && action) {
console.warn(
"EntityMenuItem Error: You cannot specify both action and link props",
......@@ -80,7 +89,12 @@ const EntityMenuItem = ({ action, title, icon, link, onClose, event }) => {
if (link) {
return (
<LinkMenuItem link={link} onClose={onClose} event={event}>
<LinkMenuItem
link={link}
externalLink={externalLink}
onClose={onClose}
event={event}
>
{content}
</LinkMenuItem>
);
......
......@@ -35,7 +35,7 @@ export default class ProfileLink extends Component {
};
generateOptionsForUser = () => {
const { tag } = this.props;
const { tag } = MetabaseSettings.get("version");
const admin = this.props.user.is_superuser;
const adminContext = this.props.context === "admin";
return [
......@@ -66,7 +66,10 @@ export default class ProfileLink extends Component {
{
title: t`Help`,
icon: null,
link: `https://metabase.com/docs/${tag}`,
// HACK - for some reason if you use // react router treats the link
// as a non local route
link: `//metabase.com/docs/${tag}`,
externalLink: true,
event: `Navbar;Profile Dropdown;About ${tag}`,
},
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment