mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* Angular deprecation: Add Angular badge in plugin catalog page * Angular deprecation: Add alert in plugin details page * Angular deprecation: Disable install button if for Angular plugins * removed extra console.log * Add tests for Angular badge * Add tests for PluginDetailsAngularDeprecation * Add tests for InstallControlsButton * Add tests for ExternallyManagedButton * Table tests * Catalog: Update angular deprecation message * PR review feedback * Update tests * Update copy for angular tooltip and alert * Update tests * Fix test warnings * Fix angularDetected not being set for remote catalog plugins * Dynamic alert text based on grafana config * Moved deprecation message to a separate function * Removed unused Props in PluginAngularBadge
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
import React from 'react';
|
|
|
|
import { PluginType } from '@grafana/data';
|
|
import { HorizontalGroup, PluginSignatureBadge } from '@grafana/ui';
|
|
|
|
import { CatalogPlugin } from '../types';
|
|
|
|
import {
|
|
PluginEnterpriseBadge,
|
|
PluginDisabledBadge,
|
|
PluginInstalledBadge,
|
|
PluginUpdateAvailableBadge,
|
|
PluginAngularBadge,
|
|
} from './Badges';
|
|
|
|
type PluginBadgeType = {
|
|
plugin: CatalogPlugin;
|
|
};
|
|
|
|
export function PluginListItemBadges({ plugin }: PluginBadgeType) {
|
|
// Currently renderer plugins are not supported by the catalog due to complications related to installation / update / uninstall.
|
|
const hasUpdate = plugin.hasUpdate && !plugin.isCore && plugin.type !== PluginType.renderer;
|
|
if (plugin.isEnterprise) {
|
|
return (
|
|
<HorizontalGroup height="auto" wrap>
|
|
<PluginEnterpriseBadge plugin={plugin} />
|
|
{plugin.isDisabled && <PluginDisabledBadge error={plugin.error} />}
|
|
{hasUpdate && <PluginUpdateAvailableBadge plugin={plugin} />}
|
|
{plugin.angularDetected && <PluginAngularBadge />}
|
|
</HorizontalGroup>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<HorizontalGroup height="auto" wrap>
|
|
<PluginSignatureBadge status={plugin.signature} />
|
|
{plugin.isDisabled && <PluginDisabledBadge error={plugin.error} />}
|
|
{plugin.isInstalled && <PluginInstalledBadge />}
|
|
{hasUpdate && <PluginUpdateAvailableBadge plugin={plugin} />}
|
|
{plugin.angularDetected && <PluginAngularBadge />}
|
|
</HorizontalGroup>
|
|
);
|
|
}
|