diff --git a/public/app/features/plugins/admin/api.ts b/public/app/features/plugins/admin/api.ts index 12dff5b852a..e281d4675be 100644 --- a/public/app/features/plugins/admin/api.ts +++ b/public/app/features/plugins/admin/api.ts @@ -17,7 +17,6 @@ import { export async function getPluginDetails(id: string): Promise { const remote = await getRemotePlugin(id); const isPublished = Boolean(remote); - const [localPlugins, versions, localReadme, localChangelog] = await Promise.all([ getLocalPlugins(), getPluginVersions(id, isPublished), @@ -36,6 +35,7 @@ export async function getPluginDetails(id: string): Promise - Last updated: + Last updated: {' '} - {formatDate(new Date(plugin.updatedAt))} + {formatDate(new Date(plugin.updatedAt), { day: 'numeric', month: 'short', year: 'numeric' })} + + )} + {plugin?.details?.lastCommitDate && ( + + + Last commit date: + {' '} + + {formatDate(new Date(plugin.details.lastCommitDate), { + day: 'numeric', + month: 'short', + year: 'numeric', + })} + )} diff --git a/public/app/features/plugins/admin/pages/PluginDetails.test.tsx b/public/app/features/plugins/admin/pages/PluginDetails.test.tsx index a283fc4d862..cca2d83f736 100644 --- a/public/app/features/plugins/admin/pages/PluginDetails.test.tsx +++ b/public/app/features/plugins/admin/pages/PluginDetails.test.tsx @@ -917,7 +917,7 @@ describe('Plugin details page', () => { const updatedAt = '2023-10-26T16:54:55.000Z'; const { queryByText } = renderPluginDetails({ id, updatedAt }); expect(queryByText('Last updated:')).toBeVisible(); - expect(queryByText('10/26/2023')).toBeVisible(); + expect(queryByText('Oct 26, 2023')).toBeVisible(); expect(queryByText('Report a concern')).toBeVisible(); }); @@ -928,6 +928,21 @@ describe('Plugin details page', () => { expect(queryByText('Last updated:')).toBeNull(); }); + it('should display last commit date information', async () => { + const id = 'right-panel-test-plugin'; + const lastCommitDate = '2023-10-26T16:54:55.000Z'; + const { queryByText } = renderPluginDetails({ id, details: { lastCommitDate, links: [] } }); + expect(queryByText('Last commit date:')).toBeVisible(); + expect(queryByText('Oct 26, 2023')).toBeVisible(); + }); + + it('should not display last commit date if there is no lastCommit data', async () => { + const id = 'right-panel-test-plugin'; + const lastCommitDate = undefined; + const { queryByText } = renderPluginDetails({ id, details: { lastCommitDate, links: [] } }); + expect(queryByText('Last commit date:')).toBeNull(); + }); + it('should not display Report Abuse if the plugin is Core', async () => { const id = 'right-panel-test-plugin'; const isCore = true; diff --git a/public/app/features/plugins/admin/types.ts b/public/app/features/plugins/admin/types.ts index 4f0796826ff..2ed5a48d495 100644 --- a/public/app/features/plugins/admin/types.ts +++ b/public/app/features/plugins/admin/types.ts @@ -78,6 +78,7 @@ export interface CatalogPluginDetails { statusContext?: string; iam?: IdentityAccessManagement; changelog?: string; + lastCommitDate?: string; } export interface CatalogPluginInfo { @@ -139,6 +140,7 @@ export type RemotePlugin = { versionSignedByOrgName: string; versionStatus: string; angularDetected?: boolean; + lastCommitDate?: string; }; // The available status codes on GCOM are available here: diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index 7b5f3ad7d3d..d7ed20e94f9 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -2178,12 +2178,13 @@ "downloads": "Downloads", "from": "From", "installedVersion": "Installed version: ", + "lastCommitDate": "Last commit date:", "latestVersion": "Latest version: ", "links": "Links ", "reportAbuse": "Report a concern ", "signature": "Signature", "status": "Status", - "updatedAt": "Last updated: ", + "updatedAt": "Last updated:", "version": "Version" } }, diff --git a/public/locales/pseudo-LOCALE/grafana.json b/public/locales/pseudo-LOCALE/grafana.json index f7d56d7f4ac..df500db9e06 100644 --- a/public/locales/pseudo-LOCALE/grafana.json +++ b/public/locales/pseudo-LOCALE/grafana.json @@ -2178,12 +2178,13 @@ "downloads": "Đőŵʼnľőäđş", "from": "Fřőm", "installedVersion": "Ĩʼnşŧäľľęđ vęřşįőʼn: ", + "lastCommitDate": "Ŀäşŧ čőmmįŧ đäŧę:", "latestVersion": "Ŀäŧęşŧ vęřşįőʼn: ", "links": "Ŀįʼnĸş ", "reportAbuse": "Ŗępőřŧ ä čőʼnčęřʼn ", "signature": "Ŝįģʼnäŧūřę", "status": "Ŝŧäŧūş", - "updatedAt": "Ŀäşŧ ūpđäŧęđ: ", + "updatedAt": "Ŀäşŧ ūpđäŧęđ:", "version": "Vęřşįőʼn" } },