diff --git a/public/app/features/plugins/admin/api.ts b/public/app/features/plugins/admin/api.ts index abe86d3b8f7..da44c8538fe 100644 --- a/public/app/features/plugins/admin/api.ts +++ b/public/app/features/plugins/admin/api.ts @@ -25,6 +25,7 @@ export async function getPluginDetails(id: string): Promise setDismissed(true)}> -

- This {plugin.type} plugin is deprecated and removed from the catalog. No further updates will be made to the - plugin. -

+

{deprecationMessage}

) : null; } diff --git a/public/app/features/plugins/admin/pages/PluginDetails.test.tsx b/public/app/features/plugins/admin/pages/PluginDetails.test.tsx index a8482bdb52b..bb4aa5ed385 100644 --- a/public/app/features/plugins/admin/pages/PluginDetails.test.tsx +++ b/public/app/features/plugins/admin/pages/PluginDetails.test.tsx @@ -752,7 +752,7 @@ describe('Plugin details page', () => { }); await waitFor(() => - expect(queryByText(/plugin is deprecated and removed from the catalog/i)).toBeInTheDocument() + expect(queryByText(/plugin is deprecated and has been removed from the catalog/i)).toBeInTheDocument() ); }); @@ -764,9 +764,26 @@ describe('Plugin details page', () => { }); await waitFor(() => - expect(queryByText(/plugin is deprecated and removed from the catalog/i)).not.toBeInTheDocument() + expect(queryByText(/plugin is deprecated and has been removed from the catalog/i)).not.toBeInTheDocument() ); }); + + it('should display a custom deprecation message if the plugin has it set', async () => { + const statusContext = 'A detailed explanation of why this plugin is deprecated.'; + const { queryByText } = renderPluginDetails({ + id, + isInstalled: true, + isDeprecated: true, + details: { + statusContext, + links: [], + }, + }); + + const re = new RegExp(`No further updates will be made to the plugin. More information: ${statusContext}`, 'i'); + + await waitFor(() => expect(queryByText(re)).toBeInTheDocument()); + }); }); describe('viewed as user without grafana admin permissions', () => { diff --git a/public/app/features/plugins/admin/types.ts b/public/app/features/plugins/admin/types.ts index 3a9f49855e4..576fefd75d3 100644 --- a/public/app/features/plugins/admin/types.ts +++ b/public/app/features/plugins/admin/types.ts @@ -70,6 +70,7 @@ export interface CatalogPluginDetails { }>; grafanaDependency?: string; pluginDependencies?: PluginDependencies['plugins']; + statusContext?: string; } export interface CatalogPluginInfo { @@ -113,6 +114,7 @@ export type RemotePlugin = { signatureType: PluginSignatureType | ''; slug: string; status: RemotePluginStatus; + statusContext?: string; typeCode: PluginType; typeId: number; typeName: string;