mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Catalog: Update enterprise license messaging in PluginDetails (#37547)
* feat(catalog): change messaging if enterprise license is missing and add link * test(catalog): fix failing PluginDetails test
This commit is contained in:
@@ -82,9 +82,19 @@ export const InstallControls = ({ plugin, isInflight, hasUpdate, isInstalled, ha
|
|||||||
|
|
||||||
if (isEnterprise && !config.licenseInfo?.hasValidLicense) {
|
if (isEnterprise && !config.licenseInfo?.hasValidLicense) {
|
||||||
return (
|
return (
|
||||||
<div className={styles.message}>
|
<HorizontalGroup height="auto" align="center">
|
||||||
Marketplace doesn't support installing Enterprise plugins yet. Stay tuned!
|
<span className={styles.message}>No valid Grafana Enterprise license detected.</span>
|
||||||
</div>
|
<LinkButton
|
||||||
|
href={`${getExternalManageLink(plugin)}?utm_source=grafana_catalog_learn_more`}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
size="sm"
|
||||||
|
fill="text"
|
||||||
|
icon="external-link-alt"
|
||||||
|
>
|
||||||
|
Learn more
|
||||||
|
</LinkButton>
|
||||||
|
</HorizontalGroup>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,15 +62,14 @@ describe('Plugin details page', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should not display install button for enterprise plugins', async () => {
|
it('should not display install button for enterprise plugins', async () => {
|
||||||
const { getByText } = setup('enterprise');
|
const { queryByRole } = setup('enterprise');
|
||||||
|
|
||||||
const expected = "Marketplace doesn't support installing Enterprise plugins yet. Stay tuned!";
|
await waitFor(() => expect(queryByRole('button', { name: /(un)?install/i })).not.toBeInTheDocument());
|
||||||
|
|
||||||
await waitFor(() => expect(getByText(expected)).toBeInTheDocument());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not display install / uninstall buttons for core plugins', async () => {
|
it('should not display install / uninstall buttons for core plugins', async () => {
|
||||||
const { queryByRole } = setup('core');
|
const { queryByRole } = setup('core');
|
||||||
|
|
||||||
await waitFor(() => expect(queryByRole('button', { name: /(un)?install/i })).not.toBeInTheDocument());
|
await waitFor(() => expect(queryByRole('button', { name: /(un)?install/i })).not.toBeInTheDocument());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user