Plugins: Add repositoryUrl parameter to plugin details panel. (#107048)
add repositoryUrl parameter to plugin details
This commit is contained in:
@@ -40,6 +40,7 @@ export async function getPluginDetails(id: string): Promise<CatalogPluginDetails
|
||||
licenseUrl: remote?.licenseUrl,
|
||||
documentationUrl: remote?.documentationUrl,
|
||||
sponsorshipUrl: remote?.sponsorshipUrl,
|
||||
repositoryUrl: remote?.repositoryUrl,
|
||||
raiseAnIssueUrl: remote?.raiseAnIssueUrl,
|
||||
signatureType: local?.signatureType || (remote?.signatureType !== '' ? remote?.signatureType : undefined),
|
||||
signature: local?.signature,
|
||||
|
||||
@@ -75,6 +75,7 @@ const mockPlugin: CatalogPlugin = {
|
||||
documentationUrl: 'https://test-plugin.com/docs',
|
||||
licenseUrl: 'https://github.com/grafana/test-plugin/blob/main/LICENSE',
|
||||
sponsorshipUrl: 'https://github.com/sponsors/grafana',
|
||||
repositoryUrl: 'https://github.com/grafana/test-plugin',
|
||||
grafanaDependency: '>=9.0.0',
|
||||
statusContext: 'stable',
|
||||
},
|
||||
|
||||
@@ -36,7 +36,7 @@ export function PluginDetailsPanel(props: Props): React.ReactElement | null {
|
||||
|
||||
const customLinks = plugin.details?.links?.filter((link) => {
|
||||
const customLinksFiltered = ![
|
||||
plugin.url,
|
||||
plugin.details?.repositoryUrl,
|
||||
plugin.details?.licenseUrl,
|
||||
plugin.details?.documentationUrl,
|
||||
plugin.details?.raiseAnIssueUrl,
|
||||
@@ -47,7 +47,7 @@ export function PluginDetailsPanel(props: Props): React.ReactElement | null {
|
||||
return customLinksFiltered;
|
||||
});
|
||||
const shouldRenderLinks =
|
||||
plugin.url ||
|
||||
plugin.details?.repositoryUrl ||
|
||||
plugin.details?.licenseUrl ||
|
||||
plugin.details?.documentationUrl ||
|
||||
plugin.details?.raiseAnIssueUrl ||
|
||||
@@ -105,9 +105,9 @@ export function PluginDetailsPanel(props: Props): React.ReactElement | null {
|
||||
<>
|
||||
<Box padding={2} borderColor="medium" borderStyle="solid" data-testid="plugin-details-regular-links">
|
||||
<Stack direction="column" gap={2}>
|
||||
{plugin.url && (
|
||||
{plugin.details?.repositoryUrl && (
|
||||
<LinkButton
|
||||
href={plugin.url}
|
||||
href={plugin.details?.repositoryUrl}
|
||||
variant="secondary"
|
||||
fill="solid"
|
||||
icon="code-branch"
|
||||
|
||||
@@ -86,6 +86,7 @@ export interface CatalogPluginDetails {
|
||||
licenseUrl?: string;
|
||||
documentationUrl?: string;
|
||||
sponsorshipUrl?: string;
|
||||
repositoryUrl?: string;
|
||||
raiseAnIssueUrl?: string;
|
||||
signatureType?: PluginSignatureType;
|
||||
signature?: PluginSignatureStatus;
|
||||
@@ -156,6 +157,7 @@ export type RemotePlugin = {
|
||||
licenseUrl?: string;
|
||||
documentationUrl?: string;
|
||||
sponsorshipUrl?: string;
|
||||
repositoryUrl?: string;
|
||||
raiseAnIssueUrl?: string;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user