Commit 2f5bea27 by Torkel Ödegaard Committed by GitHub

NewDataSourcePage: Restore signature badge lost in merge (#23832)

parent e35f27ea
...@@ -5,13 +5,23 @@ export interface CardProps { ...@@ -5,13 +5,23 @@ export interface CardProps {
logoUrl?: string; logoUrl?: string;
title: string; title: string;
description?: string; description?: string;
labels?: React.ReactNode;
actions?: React.ReactNode; actions?: React.ReactNode;
onClick?: () => void; onClick?: () => void;
ariaLabel?: string; ariaLabel?: string;
className?: string; className?: string;
} }
export const Card: React.FC<CardProps> = ({ logoUrl, title, description, actions, onClick, ariaLabel, className }) => { export const Card: React.FC<CardProps> = ({
logoUrl,
title,
description,
labels,
actions,
onClick,
ariaLabel,
className,
}) => {
const mainClassName = cx('add-data-source-item', className); const mainClassName = cx('add-data-source-item', className);
return ( return (
...@@ -20,6 +30,7 @@ export const Card: React.FC<CardProps> = ({ logoUrl, title, description, actions ...@@ -20,6 +30,7 @@ export const Card: React.FC<CardProps> = ({ logoUrl, title, description, actions
<div className="add-data-source-item-text-wrapper"> <div className="add-data-source-item-text-wrapper">
<span className="add-data-source-item-text">{title}</span> <span className="add-data-source-item-text">{title}</span>
{description && <span className="add-data-source-item-desc">{description}</span>} {description && <span className="add-data-source-item-desc">{description}</span>}
{labels && <div>{labels}</div>}
</div> </div>
{actions && <div className="add-data-source-item-actions">{actions}</div>} {actions && <div className="add-data-source-item-actions">{actions}</div>}
</div> </div>
......
...@@ -145,36 +145,17 @@ const DataSourceTypeCard: FC<DataSourceTypeCardProps> = props => { ...@@ -145,36 +145,17 @@ const DataSourceTypeCard: FC<DataSourceTypeCardProps> = props => {
{!isPhantom && <Button>Select</Button>} {!isPhantom && <Button>Select</Button>}
</> </>
} }
className={isPhantom && 'add-data-source-item--phantom'} labels={
onClick={onClick} !isPhantom && (
aria-label={e2e.pages.AddDataSource.selectors.dataSourcePlugins(plugin.name)}
>
<img className="add-data-source-item-logo" src={plugin.info.logos.small} />
<div className="add-data-source-item-text-wrapper">
<span className="add-data-source-item-text">{plugin.name}</span>
{plugin.info.description && <span className="add-data-source-item-desc">{plugin.info.description}</span>}
{!isPhantom && (
<div> <div>
<PluginSignatureBadge status={plugin.signature} /> <PluginSignatureBadge status={plugin.signature} />
</div> </div>
)} )
</div> }
<div className="add-data-source-item-actions"> className={isPhantom && 'add-data-source-item--phantom'}
{learnMoreLink && ( onClick={onClick}
<LinkButton aria-label={e2e.pages.AddDataSource.selectors.dataSourcePlugins(plugin.name)}
variant="secondary" />
href={`${learnMoreLink.url}?utm_source=grafana_add_ds`}
target="_blank"
rel="noopener"
onClick={onLearnMoreClick}
icon="external-link-alt"
>
{learnMoreLink.name}
</LinkButton>
)}
{!isPhantom && <Button>Select</Button>}
</div>
</Card>
); );
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment