});
expect(await ui.applicationPageTitle.find()).toBeInTheDocument();
expect(screen.getByText('application.info.empty_description')).toBeInTheDocument();
- expect(screen.queryByText(/visibility/)).not.toBeInTheDocument();
+ expect(screen.getByText('visibility.public')).toBeInTheDocument();
expect(ui.tags.get()).toHaveTextContent('no_tags');
});
expect(await ui.projectPageTitle.find()).toBeInTheDocument();
expect(ui.qualityGateList.query()).not.toBeInTheDocument();
expect(ui.qualityProfilesList.query()).not.toBeInTheDocument();
- expect(screen.queryByText(/visibility/)).not.toBeInTheDocument();
+ expect(screen.getByText('visibility.public')).toBeInTheDocument();
expect(ui.tags.get()).toHaveTextContent('no_tags');
expect(screen.getByText('project.info.empty_description')).toBeInTheDocument();
});
expect(await ui.projectPageTitle.find()).toBeInTheDocument();
expect(ui.qualityGateList.query()).not.toBeInTheDocument();
expect(ui.qualityProfilesList.query()).not.toBeInTheDocument();
- expect(screen.queryByText(/visibility/)).not.toBeInTheDocument();
+ expect(screen.getByText('visibility.public')).toBeInTheDocument();
expect(ui.tags.get()).toHaveTextContent('no_tags');
expect(screen.getByText('project.info.empty_description')).toBeInTheDocument();
});
<MetaKey componentKey={component.key} qualifier={component.qualifier} />
</ProjectInformationSection>
- {component.visibility === Visibility.Private && (
- <ProjectInformationSection>
- <MetaVisibility qualifier={component.qualifier} visibility={component.visibility} />
- </ProjectInformationSection>
- )}
+ <ProjectInformationSection>
+ <MetaVisibility
+ qualifier={component.qualifier}
+ visibility={component.visibility ?? Visibility.Public}
+ />
+ </ProjectInformationSection>
<ProjectInformationSection>
<MetaDescription description={component.description} isApp={isApp} />
import { translate, translateWithParameters } from '../../../../helpers/l10n';
import { formatMeasure } from '../../../../helpers/measures';
import { getProjectUrl } from '../../../../helpers/urls';
-import { ComponentQualifier, Visibility } from '../../../../types/component';
+import { ComponentQualifier } from '../../../../types/component';
import { MetricKey, MetricType } from '../../../../types/metrics';
import { Status } from '../../../../types/types';
import { CurrentUser, isLoggedIn } from '../../../../types/users';
/>
)}
- <h3 className="it__project-card-name" title={name}>
+ <h1 className="it__project-card-name" title={name}>
<StandoutLink to={getProjectUrl(key)}>{name}</StandoutLink>
- </h3>
+ </h1>
{qualifier === ComponentQualifier.Application && (
<Tooltip
- placement="top"
overlay={
<span>
{translate('qualifier.APP')}
}
>
<span>
- <Badge className="sw-ml-2 sw-font-sans">{translate('qualifier.APP')}</Badge>
+ <Badge className="sw-ml-2">{translate('qualifier.APP')}</Badge>
</span>
</Tooltip>
)}
- {visibility === Visibility.Private && (
- <Tooltip overlay={translate('visibility', visibility, 'description', qualifier)}>
- <span>
- <Badge className="sw-ml-2 sw-font-sans">
- {translate('visibility', visibility)}
- </Badge>
- </span>
- </Tooltip>
- )}
+ <Tooltip overlay={translate('visibility', visibility, 'description', qualifier)}>
+ <span>
+ <Badge className="sw-ml-2">{translate('visibility', visibility)}</Badge>
+ </span>
+ </Tooltip>
</div>
{analysisDate && (
<Tooltip overlay={qualityGateLabel}>
value={measures.new_lines}
/>
</span>
- <span>{translate('metric.new_lines.name')}</span>
+ <span className="sw-body-sm">{translate('metric.new_lines.name')}</span>
</div>
</>
)
value={measures.ncloc}
/>
</span>
- <span>{translate('metric.ncloc.name')}</span>
+ <span className="sw-body-sm">{translate('metric.ncloc.name')}</span>
</div>
<SeparatorCircleIcon className="sw-mx-1" />
<span className="sw-body-sm" data-key={MetricKey.ncloc_language_distribution}>
qualifier,
visibility,
}: PrivacyBadgeContainerProps) {
- if (visibility !== Visibility.Private) {
- return null;
- }
-
return (
<Tooltip overlay={translate('visibility', visibility, 'description', qualifier)}>
<div className={classNames('badge', className)}>{translate('visibility', visibility)}</div>
expect(getWrapper()).toMatchSnapshot();
});
-it('do not render', () => {
+it('should render public', () => {
expect(getWrapper({ visibility: Visibility.Public })).toMatchSnapshot();
});
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`do not render 1`] = `""`;
-
exports[`renders 1`] = `
<Tooltip
overlay="visibility.private.description.TRK"
</div>
</Tooltip>
`;
+
+exports[`should render public 1`] = `
+<Tooltip
+ overlay="visibility.public.description.TRK"
+>
+ <div
+ className="badge"
+ >
+ visibility.public
+ </div>
+</Tooltip>
+`;
padding: 12px 17px;
color: #eff2f9;
background-color: #2a2f40;
- letter-spacing: 0.04em;
}
.tooltip-inner .alert {