Connections: Fix connections home page on enterprise (#111751)

This commit is contained in:
Hugo Kiyodi Oshiro
2025-10-14 15:34:33 -03:00
committed by GitHub
parent 75a1846344
commit 507720e601
2 changed files with 5 additions and 7 deletions
@@ -2,7 +2,6 @@ import { RenderResult, screen } from '@testing-library/react';
import { Route, Routes } from 'react-router-dom-v5-compat';
import { render } from 'test/test-utils';
import { GrafanaEdition } from '@grafana/data/internal';
import { config } from '@grafana/runtime';
import { contextSrv } from 'app/core/services/context_srv';
import * as api from 'app/features/datasources/api';
@@ -46,7 +45,7 @@ describe('Connections', () => {
});
test('shows the "Connections Homepage" page by default when edition is Cloud', async () => {
config.buildInfo.edition = GrafanaEdition.Enterprise;
config.pluginAdminExternalManageEnabled = true;
renderPage();
// Add new connection card
@@ -66,7 +65,7 @@ describe('Connections', () => {
});
test('shows the OSS "Connections Homepage" page by default when edition is OpenSource', async () => {
config.buildInfo.edition = GrafanaEdition.OpenSource;
config.pluginAdminExternalManageEnabled = false;
renderPage();
// Add new connection card
@@ -1,7 +1,6 @@
import { css } from '@emotion/css';
import { GrafanaTheme2 } from '@grafana/data';
import { GrafanaEdition } from '@grafana/data/internal';
import { Trans } from '@grafana/i18n';
import { config } from '@grafana/runtime';
import { useStyles2 } from '@grafana/ui';
@@ -13,9 +12,9 @@ import PageCard from '../components/PageCard/PageCard';
export default function ConnectionsHomePage() {
const styles = useStyles2(getStyles);
const isOSS = config.buildInfo.edition === GrafanaEdition.OpenSource;
const isOnPrem = !config.pluginAdminExternalManageEnabled;
let cardsData = isOSS ? getOssCardData() : getCloudCardData();
let cardsData = isOnPrem ? getOssCardData() : getCloudCardData();
return (
<Page
@@ -31,7 +30,7 @@ export default function ConnectionsHomePage() {
<Trans i18nKey="connections.connections-home-page.welcome-to-connections">Welcome to Connections</Trans>
</h1>
<p className={styles.subTitle}>
{isOSS ? (
{isOnPrem ? (
<Trans i18nKey="connections.oss.connections-home-page.subtitle">
Manage your data source connections in one place. Use this page to add a new data source or manage your
existing connections.