mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Feat: Linking to plugin details page rather than externally for new datasources (#63499)
Changed links to help enterprise users install plugins directly via internal grafana catalog instead of linking out to grafana.com
This commit is contained in:
@@ -123,6 +123,7 @@ export interface PluginInclude {
|
||||
interface PluginMetaInfoLink {
|
||||
name: string;
|
||||
url: string;
|
||||
target?: '_blank' | '_self' | '_parent' | '_top';
|
||||
}
|
||||
|
||||
export interface PluginBuildInfo {
|
||||
|
||||
@@ -14,6 +14,7 @@ export function DataSourceTypeCard({ onClick, dataSourcePlugin }: Props) {
|
||||
const isPhantom = dataSourcePlugin.module === 'phantom';
|
||||
const isClickable = !isPhantom && !dataSourcePlugin.unlicensed;
|
||||
const learnMoreLink = dataSourcePlugin.info?.links?.length > 0 ? dataSourcePlugin.info.links[0] : null;
|
||||
const learnMoreLinkTarget = learnMoreLink?.target ?? '_blank';
|
||||
|
||||
const styles = useStyles2(getStyles);
|
||||
|
||||
@@ -47,10 +48,9 @@ export function DataSourceTypeCard({ onClick, dataSourcePlugin }: Props) {
|
||||
<LinkButton
|
||||
aria-label={`${dataSourcePlugin.name}, learn more.`}
|
||||
href={`${learnMoreLink.url}?utm_source=grafana_add_ds`}
|
||||
icon="external-link-alt"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
rel="noopener"
|
||||
target="_blank"
|
||||
target={learnMoreLinkTarget}
|
||||
variant="secondary"
|
||||
>
|
||||
{learnMoreLink.name}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DataSourcePluginMeta, PluginType } from '@grafana/data';
|
||||
import { config, featureEnabled } from '@grafana/runtime';
|
||||
import { featureEnabled } from '@grafana/runtime';
|
||||
import { DataSourcePluginCategory } from 'app/types';
|
||||
|
||||
export function buildCategories(plugins: DataSourcePluginMeta[]): DataSourcePluginCategory[] {
|
||||
@@ -244,8 +244,9 @@ function getPhantomPlugin(options: GetPhantomPluginOptions): DataSourcePluginMet
|
||||
author: { name: 'Grafana Labs' },
|
||||
links: [
|
||||
{
|
||||
url: config.pluginCatalogURL + options.id,
|
||||
url: '/plugins/' + options.id,
|
||||
name: 'Install now',
|
||||
target: '_self',
|
||||
},
|
||||
],
|
||||
screenshots: [],
|
||||
|
||||
Reference in New Issue
Block a user