Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Commit

Permalink
feat: add certified icon to columoption (#1330)
Browse files Browse the repository at this point in the history
* add certified icon to columoption

* fix import order
  • Loading branch information
pkdotson committed Aug 26, 2021
1 parent 1aad2d1 commit a415c41
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
* under the License.
*/
import React from 'react';
import { styled } from '@superset-ui/core';
import { Tooltip } from './Tooltip';
import { ColumnTypeLabel } from './ColumnTypeLabel';
import InfoTooltipWithTrigger from './InfoTooltipWithTrigger';
import CertifiedIconWithTooltip from './CertifiedIconWithTooltip';
import { ColumnMeta } from '../types';

export type ColumnOptionProps = {
Expand All @@ -29,6 +31,12 @@ export type ColumnOptionProps = {
labelRef?: React.RefObject<any>;
};

const StyleOverrides = styled.span`
svg {
margin-right: ${({ theme }) => theme.gridUnit}px;
}
`;

export function ColumnOption({
column,
labelRef,
Expand All @@ -40,8 +48,15 @@ export function ColumnOption({
const type = hasExpression ? 'expression' : type_generic;

return (
<span>
<StyleOverrides>
{showType && type !== undefined && <ColumnTypeLabel type={type} />}
{column.is_certified && (
<CertifiedIconWithTooltip
metricName={column.metric_name}
certifiedBy={column.certified_by}
details={column.certification_details}
/>
)}
{showTooltip ? (
<Tooltip
id="metric-name-tooltip"
Expand Down Expand Up @@ -76,7 +91,7 @@ export function ColumnOption({
placement="top"
/>
)}
</span>
</StyleOverrides>
);
}

Expand Down

1 comment on commit a415c41

@vercel
Copy link

@vercel vercel bot commented on a415c41 Aug 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.