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:
Jack Westbrook 2021-08-04 17:55:03 +02:00 committed by GitHub
parent fcd0dac814
commit e21ecf237b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 7 deletions

View File

@ -82,9 +82,19 @@ export const InstallControls = ({ plugin, isInflight, hasUpdate, isInstalled, ha
if (isEnterprise && !config.licenseInfo?.hasValidLicense) {
return (
<div className={styles.message}>
Marketplace doesn&#39;t support installing Enterprise plugins yet. Stay tuned!
</div>
<HorizontalGroup height="auto" align="center">
<span className={styles.message}>No valid Grafana Enterprise license detected.</span>
<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>
);
}

View File

@ -62,15 +62,14 @@ describe('Plugin details page', () => {
});
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(getByText(expected)).toBeInTheDocument());
await waitFor(() => expect(queryByRole('button', { name: /(un)?install/i })).not.toBeInTheDocument());
});
it('should not display install / uninstall buttons for core plugins', async () => {
const { queryByRole } = setup('core');
await waitFor(() => expect(queryByRole('button', { name: /(un)?install/i })).not.toBeInTheDocument());
});
});