Skip to content
Snippets Groups Projects
Unverified Commit 61ac7789 authored by Mahatthana (Kelvin) Nomsawadi's avatar Mahatthana (Kelvin) Nomsawadi Committed by GitHub
Browse files

Make it easier to get help (#21212)

parent 617eaffc
No related branches found
No related tags found
No related merge requests found
......@@ -58,13 +58,6 @@ function githubIssueLink(bugReportDetails) {
);
}
function discourseLink(bugReportDetails) {
return (
"https://discourse.metabase.com/new-topic?category_id=7&body=" +
encodeURIComponent("```json\n" + bugReportDetails + "\n```")
);
}
const HelpLink = ({ title, description, link }) => (
<li className="mb2">
<ExternalLink
......@@ -112,27 +105,19 @@ export default class Help extends Component {
<HelpLinks>
<ol>
<HelpLink
title={t`Metabase Documentation`}
description={t`Includes a troubleshooting guide`}
link={MetabaseSettings.docsUrl()}
/>
<HelpLink
title={t`Post on the Metabase support forum`}
description={t`A community forum for all things Metabase`}
link={discourseLink(detailString)}
title={t`Get Help`}
description={t`Resources and support`}
link={
MetabaseSettings.isPaidPlan()
? "https://www.metabase.com/help-premium?utm_source=in-product&utm_medium=troubleshooting&utm_campaign=help"
: "https://www.metabase.com/help?utm_source=in-product&utm_medium=troubleshooting&utm_campaign=help"
}
/>
<HelpLink
title={t`File a bug report`}
description={t`Create a GitHub issue (includes the diagnostic info below)`}
link={githubIssueLink(detailString)}
/>
{MetabaseSettings.isPaidPlan() && (
<HelpLink
title={t`Contact support`}
description={t`Our team is ready to help you`}
link="mailto:support@metabase.com"
/>
)}
</ol>
</HelpLinks>
......
......@@ -37,9 +37,9 @@ export default class ProfileLink extends Component {
generateOptionsForUser = () => {
const { tag } = MetabaseSettings.get("version");
const { user } = this.props;
const isAdmin = user.is_superuser;
const canAccessSettings =
user.is_superuser ||
PLUGIN_FEATURE_LEVEL_PERMISSIONS.canAccessSettings(user);
isAdmin || PLUGIN_FEATURE_LEVEL_PERMISSIONS.canAccessSettings(user);
return [
{
......@@ -63,7 +63,11 @@ export default class ProfileLink extends Component {
{
title: t`Help`,
icon: null,
link: MetabaseSettings.docsUrl(),
link:
isAdmin && MetabaseSettings.isPaidPlan()
? "https://www.metabase.com/help-premium?utm_source=in-product&utm_medium=menu&utm_campaign=help"
: "https://www.metabase.com/help?utm_source=in-product&utm_medium=menu&utm_campaign=help",
externalLink: true,
event: `Navbar;Profile Dropdown;About ${tag}`,
},
......
......@@ -27,11 +27,17 @@ describeOSS("scenarios > admin > troubleshooting > help", () => {
cy.signInAsAdmin();
});
it("should hide the support link when running Metabase OSS", () => {
it("should link `Get Help` to help", () => {
cy.visit("/admin/troubleshooting/help");
cy.findByText("Metabase Admin");
cy.findByText("Contact support").should("not.exist");
cy.findByText("Get Help")
.parents("a")
.should("have.prop", "href")
.and(
"equal",
"https://www.metabase.com/help?utm_source=in-product&utm_medium=troubleshooting&utm_campaign=help",
);
});
});
......@@ -41,10 +47,16 @@ describeEE("scenarios > admin > troubleshooting > help (EE)", () => {
cy.signInAsAdmin();
});
it("should add the support link when running Metabase EE", () => {
it("should link `Get Help` to help-premium", () => {
cy.visit("/admin/troubleshooting/help");
cy.findByText("Metabase Admin");
cy.findByText("Contact support");
cy.findByText("Get Help")
.parents("a")
.should("have.prop", "href")
.and(
"equal",
"https://www.metabase.com/help-premium?utm_source=in-product&utm_medium=troubleshooting&utm_campaign=help",
);
});
});
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