@@ -31,6 +31,7 @@ const AnalysisWarningsModal = lazyLoadComponent( | |||
interface Props { | |||
componentKey: string; | |||
isBranch: boolean; | |||
onWarningDismiss: () => void; | |||
warnings: TaskWarning[]; | |||
} | |||
@@ -60,6 +61,9 @@ export default class ComponentNavWarnings extends React.PureComponent<Props, Sta | |||
defaultMessage={translate('component_navigation.last_analysis_had_warnings')} | |||
id="component_navigation.last_analysis_had_warnings" | |||
values={{ | |||
branchType: this.props.isBranch | |||
? translate('branches.branch') | |||
: translate('branches.pr'), | |||
warnings: ( | |||
<a href="#" onClick={this.handleClick}> | |||
<FormattedMessage |
@@ -45,6 +45,7 @@ export function HeaderMeta(props: HeaderMetaProps) { | |||
const { branchLike, component, currentUser, warnings } = props; | |||
const isABranch = isBranch(branchLike); | |||
const currentPage = getCurrentPage(component, branchLike); | |||
const displayVersion = component.version !== undefined && isABranch; | |||
@@ -54,6 +55,7 @@ export function HeaderMeta(props: HeaderMetaProps) { | |||
{warnings.length > 0 && ( | |||
<span className="header-meta-warnings"> | |||
<ComponentNavWarnings | |||
isBranch={isABranch} | |||
componentKey={component.key} | |||
onWarningDismiss={props.onWarningDismiss} | |||
warnings={warnings} |
@@ -26,6 +26,7 @@ it('should render', () => { | |||
const wrapper = shallow( | |||
<ComponentNavWarnings | |||
componentKey="foo" | |||
isBranch={true} | |||
onWarningDismiss={jest.fn()} | |||
warnings={[mockTaskWarning({ message: 'warning 1' })]} | |||
/> |
@@ -12,6 +12,7 @@ exports[`should render 1`] = ` | |||
id="component_navigation.last_analysis_had_warnings" | |||
values={ | |||
Object { | |||
"branchType": "branches.branch", | |||
"warnings": <a | |||
href="#" | |||
onClick={[Function]} |
@@ -10,6 +10,7 @@ exports[`should render correctly for a branch 1`] = ` | |||
> | |||
<ComponentNavWarnings | |||
componentKey="my-project" | |||
isBranch={true} | |||
onWarningDismiss={[MockFunction]} | |||
warnings={ | |||
Array [ | |||
@@ -63,6 +64,7 @@ exports[`should render correctly for a main project branch 1`] = ` | |||
> | |||
<ComponentNavWarnings | |||
componentKey="my-project" | |||
isBranch={true} | |||
onWarningDismiss={[MockFunction]} | |||
warnings={ | |||
Array [ | |||
@@ -116,6 +118,7 @@ exports[`should render correctly for a portfolio 1`] = ` | |||
> | |||
<ComponentNavWarnings | |||
componentKey="foo" | |||
isBranch={true} | |||
onWarningDismiss={[MockFunction]} | |||
warnings={ | |||
Array [ | |||
@@ -156,6 +159,7 @@ exports[`should render correctly for a pull request 1`] = ` | |||
> | |||
<ComponentNavWarnings | |||
componentKey="my-project" | |||
isBranch={false} | |||
onWarningDismiss={[MockFunction]} | |||
warnings={ | |||
Array [ |
@@ -2886,7 +2886,7 @@ component_navigation.status.in_progress.admin.help=A background task is in progr | |||
component_navigation.status.in_progress_X.admin.help=The {type} is in progress. | |||
component_navigation.status.last_blocked_due_to_bad_license_X=Last analysis blocked due to an invalid license, which has since been corrected. Please reanalyze this {0}. | |||
component_navigation.last_analysis_had_warnings=Last analysis had {warnings} | |||
component_navigation.last_analysis_had_warnings=Last analysis of this {branchType} had {warnings} | |||
component_navigation.x_warnings={warningsCount} {warningsCount, plural, one {warning} other {warnings}} | |||
component_navigation.pr_deco.error_detected_X=We've detected an issue with your configuration. Your SonarQube instance won't be able to perform any pull request decoration. {action} | |||
@@ -3941,7 +3941,9 @@ onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection.link=d | |||
# BRANCHES | |||
# | |||
#------------------------------------------------------------------------------ | |||
branches.branch=Branch | |||
branches.main_branch=Main Branch | |||
branches.pr=PR | |||
branches.see_the_pr=See the PR | |||
#------------------------------------------------------------------------------ |