</span> | </span> | ||||
)} | )} | ||||
{items} | {items} | ||||
{component.visibility === 'private' && <PrivateBadge className="spacer-left" />} | |||||
{component.visibility === 'private' && ( | |||||
<PrivateBadge className="spacer-left" qualifier={component.qualifier} /> | |||||
)} | |||||
</h1> | </h1> | ||||
); | ); | ||||
} | } |
</h2> | </h2> | ||||
{project.analysisDate && <ProjectCardQualityGate status={measures!['alert_status']} />} | {project.analysisDate && <ProjectCardQualityGate status={measures!['alert_status']} />} | ||||
<div className="pull-right text-right"> | <div className="pull-right text-right"> | ||||
{isPrivate && <PrivateBadge className="spacer-left" tooltipPlacement="left" />} | |||||
{isPrivate && ( | |||||
<PrivateBadge className="spacer-left" qualifier="TRK" tooltipPlacement="left" /> | |||||
)} | |||||
{hasTags && <TagsList tags={project.tags} customClass="spacer-left" />} | {hasTags && <TagsList tags={project.tags} customClass="spacer-left" />} | ||||
</div> | </div> | ||||
{project.analysisDate && | {project.analysisDate && |
</h2> | </h2> | ||||
{project.analysisDate && <ProjectCardQualityGate status={measures['alert_status']} />} | {project.analysisDate && <ProjectCardQualityGate status={measures['alert_status']} />} | ||||
<div className="pull-right text-right"> | <div className="pull-right text-right"> | ||||
{isPrivate && <PrivateBadge className="spacer-left" tooltipPlacement="left" />} | |||||
{isPrivate && ( | |||||
<PrivateBadge className="spacer-left" qualifier="TRK" tooltipPlacement="left" /> | |||||
)} | |||||
{hasTags && <TagsList tags={project.tags} customClass="spacer-left" />} | {hasTags && <TagsList tags={project.tags} customClass="spacer-left" />} | ||||
</div> | </div> | ||||
{project.analysisDate && ( | {project.analysisDate && ( |
</td> | </td> | ||||
<td className="thin nowrap"> | <td className="thin nowrap"> | ||||
{project.visibility === Visibility.Private && <PrivateBadge />} | |||||
{project.visibility === Visibility.Private && ( | |||||
<PrivateBadge qualifier={project.qualifier} /> | |||||
)} | |||||
</td> | </td> | ||||
<td className="nowrap"> | <td className="nowrap"> |
<td | <td | ||||
className="thin nowrap" | className="thin nowrap" | ||||
> | > | ||||
<PrivateBadge /> | |||||
<PrivateBadge | |||||
qualifier="TRK" | |||||
/> | |||||
</td> | </td> | ||||
<td | <td | ||||
className="nowrap" | className="nowrap" | ||||
<td | <td | ||||
className="thin nowrap" | className="thin nowrap" | ||||
> | > | ||||
<PrivateBadge /> | |||||
<PrivateBadge | |||||
qualifier="TRK" | |||||
/> | |||||
</td> | </td> | ||||
<td | <td | ||||
className="nowrap" | className="nowrap" |
interface Props { | interface Props { | ||||
className?: string; | className?: string; | ||||
qualifier: string; | |||||
tooltipPlacement?: string; | tooltipPlacement?: string; | ||||
} | } | ||||
export default function PrivateBadge({ className, tooltipPlacement = 'bottom' }: Props) { | |||||
export default function PrivateBadge({ className, qualifier, tooltipPlacement = 'bottom' }: Props) { | |||||
return ( | return ( | ||||
<Tooltip overlay={translate('visibility.private.description')} placement={tooltipPlacement}> | |||||
<Tooltip | |||||
overlay={translate('visibility.private.description', qualifier)} | |||||
placement={tooltipPlacement}> | |||||
<div className={classNames('outline-badge', className)}> | <div className={classNames('outline-badge', className)}> | ||||
{translate('visibility.private')} | {translate('visibility.private')} | ||||
</div> | </div> |
import PrivateBadge from '../PrivateBadge'; | import PrivateBadge from '../PrivateBadge'; | ||||
it('renders', () => { | it('renders', () => { | ||||
expect(shallow(<PrivateBadge />)).toMatchSnapshot(); | |||||
expect(shallow(<PrivateBadge qualifier="TRK" />)).toMatchSnapshot(); | |||||
}); | }); |
exports[`renders 1`] = ` | exports[`renders 1`] = ` | ||||
<Tooltip | <Tooltip | ||||
overlay="visibility.private.description" | |||||
overlay="visibility.private.description.TRK" | |||||
placement="bottom" | placement="bottom" | ||||
> | > | ||||
<div | <div |
visibility.public.description=This project is public. Anyone can browse and see the source code. | visibility.public.description=This project is public. Anyone can browse and see the source code. | ||||
visibility.public.description.short=Anyone can browse and see the source code. | visibility.public.description.short=Anyone can browse and see the source code. | ||||
visibility.private=Private | visibility.private=Private | ||||
visibility.private.description=This project is private. Only authorized users can browse and see the source code. | |||||
visibility.private.description.TRK=This project is private. Only authorized users can browse and see the source code. | |||||
visibility.private.description.VW=This portfolio is private. Only authorized users can browse it. | |||||
visibility.private.description.APP=This application is private. Only authorized users can browse it. | |||||
visibility.private.description.short=Only authorized users can browse and see the source code. | visibility.private.description.short=Only authorized users can browse and see the source code. | ||||