interface Props {
componentKey: string;
+ isBranch: boolean;
onWarningDismiss: () => void;
warnings: TaskWarning[];
}
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
const { branchLike, component, currentUser, warnings } = props;
const isABranch = isBranch(branchLike);
+
const currentPage = getCurrentPage(component, branchLike);
const displayVersion = component.version !== undefined && isABranch;
{warnings.length > 0 && (
<span className="header-meta-warnings">
<ComponentNavWarnings
+ isBranch={isABranch}
componentKey={component.key}
onWarningDismiss={props.onWarningDismiss}
warnings={warnings}
const wrapper = shallow(
<ComponentNavWarnings
componentKey="foo"
+ isBranch={true}
onWarningDismiss={jest.fn()}
warnings={[mockTaskWarning({ message: 'warning 1' })]}
/>
id="component_navigation.last_analysis_had_warnings"
values={
Object {
+ "branchType": "branches.branch",
"warnings": <a
href="#"
onClick={[Function]}
>
<ComponentNavWarnings
componentKey="my-project"
+ isBranch={true}
onWarningDismiss={[MockFunction]}
warnings={
Array [
>
<ComponentNavWarnings
componentKey="my-project"
+ isBranch={true}
onWarningDismiss={[MockFunction]}
warnings={
Array [
>
<ComponentNavWarnings
componentKey="foo"
+ isBranch={true}
onWarningDismiss={[MockFunction]}
warnings={
Array [
>
<ComponentNavWarnings
componentKey="my-project"
+ isBranch={false}
onWarningDismiss={[MockFunction]}
warnings={
Array [
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}
# BRANCHES
#
#------------------------------------------------------------------------------
+branches.branch=Branch
branches.main_branch=Main Branch
+branches.pr=PR
branches.see_the_pr=See the PR
#------------------------------------------------------------------------------