Skip to content
Snippets Groups Projects
Unverified Commit 46061c6f authored by Maz Ameli's avatar Maz Ameli Committed by GitHub
Browse files

Don't inform admins about MB cloud on EE instances (#14569)


* hide ctas when version is enterprise

* add isEnterprise to settings

* only run CTA test on OSS

Co-authored-by: default avatarPaul Rosenzweig <paul.a.rosenzweig@gmail.com>
parent ce88d260
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@ MetabaseSettings.docsTag = () => "latest";
// NOTE: use the "enterprise" key from version-info.json
MetabaseSettings.versionInfo = () =>
MetabaseSettings.get("version-info", {}).enterprise || {};
MetabaseSettings.isEnterprise = () => true;
// PLUGINS:
// import "./management";
......
......@@ -70,6 +70,7 @@ export default class SettingsEmailForm extends Component {
render() {
const { sendingEmail } = this.state;
return (
<Flex justifyContent="space-between">
<SettingsBatchForm
......@@ -99,7 +100,7 @@ export default class SettingsEmailForm extends Component {
];
}}
/>
{!MetabaseSettings.isHosted() && (
{!MetabaseSettings.isHosted() && !MetabaseSettings.isEnterprise() && (
<MarginHostingCTA tagline={t`Have your email configured for you.`} />
)}
</Flex>
......
......@@ -129,7 +129,7 @@ export default class SettingsSetupList extends Component {
</LoadingAndErrorWrapper>
</div>
{!MetabaseSettings.isHosted() && (
{!MetabaseSettings.isHosted() && !MetabaseSettings.isEnterprise() && (
<MarginHostingCTA tagline={t`Have your server maintained for you.`} />
)}
</Flex>
......
......@@ -24,7 +24,9 @@ export default class SettingsUpdatesForm extends Component {
currentVersion,
)} which is the latest and greatest!`}
</div>
{!MetabaseSettings.isHosted() && <HostingCTA />}
{!MetabaseSettings.isHosted() && !MetabaseSettings.isEnterprise() && (
<HostingCTA />
)}
</div>
);
} else if (MetabaseSettings.newVersionAvailable()) {
......
......@@ -179,6 +179,10 @@ class Settings {
return latest && latest.version;
}
isEnterprise() {
return false;
}
// returns a map that looks like {total: 6, digit: 1}
passwordComplexityRequirements() {
return this.get("password-complexity", {});
......
......@@ -222,6 +222,10 @@ export const describeWithToken = Cypress.env("HAS_ENTERPRISE_TOKEN")
? describe
: describe.skip;
export const itOpenSourceOnly = Cypress.env("HAS_ENTERPRISE_TOKEN")
? it.skip
: it;
// TODO: does this really need to be a global helper function?
export function createBasicAlert({ firstAlert, includeNormal } = {}) {
cy.get(".Icon-bell").click();
......
......@@ -4,6 +4,7 @@ import {
openOrdersTable,
version,
popover,
itOpenSourceOnly,
} from "__support__/cypress";
describe("scenarios > admin > settings", () => {
......@@ -12,14 +13,17 @@ describe("scenarios > admin > settings", () => {
signInAsAdmin();
});
it("should prompt admin to migrate to the hosted instance", () => {
cy.visit("/admin/settings/setup");
cy.findByText("Have your server maintained for you.");
cy.findByText("Migrate to Metabase Cloud.");
cy.findAllByRole("link", { name: "Learn more" })
.should("have.attr", "href")
.and("include", "/migrate/");
});
itOpenSourceOnly(
"should prompt admin to migrate to the hosted instance",
() => {
cy.visit("/admin/settings/setup");
cy.findByText("Have your server maintained for you.");
cy.findByText("Migrate to Metabase Cloud.");
cy.findAllByRole("link", { name: "Learn more" })
.should("have.attr", "href")
.and("include", "/migrate/");
},
);
it("should surface an error when validation for any field fails (metabase#4506)", () => {
const BASE_URL = Cypress.config().baseUrl;
......
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