const ruleEngine = engineName ? engineName : engine;
return (
- <div className="display-inline-flex-center issue-message break-word">
- <span className="spacer-right">{message}</span>
- {quickFixAvailable && (
- <Tooltip
- overlay={
- <FormattedMessage
- id="issue.quick_fix_available_with_sonarlint"
- defaultMessage={translate('issue.quick_fix_available_with_sonarlint')}
- values={{
- link: (
- <a
- href="https://www.sonarqube.org/sonarlint/?referrer=sonarqube-quick-fix"
- rel="noopener noreferrer"
- target="_blank">
- SonarLint
- </a>
- )
- }}
- />
- }
- mouseLeaveDelay={0.5}>
- <SonarLintIcon className="it__issues-sonarlint-quick-fix spacer-right" size={15} />
- </Tooltip>
- )}
+ <>
+ <div className="display-inline-flex-center issue-message break-word">
+ <span className="spacer-right">{message}</span>
+ {quickFixAvailable && (
+ <Tooltip
+ overlay={
+ <FormattedMessage
+ id="issue.quick_fix_available_with_sonarlint"
+ defaultMessage={translate('issue.quick_fix_available_with_sonarlint')}
+ values={{
+ link: (
+ <a
+ href="https://www.sonarqube.org/sonarlint/?referrer=sonarqube-quick-fix"
+ rel="noopener noreferrer"
+ target="_blank">
+ SonarLint
+ </a>
+ )
+ }}
+ />
+ }
+ mouseLeaveDelay={0.5}>
+ <SonarLintIcon className="it__issues-sonarlint-quick-fix spacer-right" size={15} />
+ </Tooltip>
+ )}
+ {ruleStatus && (ruleStatus === RuleStatus.Deprecated || ruleStatus === RuleStatus.Removed) && (
+ <DocumentationTooltip
+ className="spacer-left"
+ content={translate('rules.status', ruleStatus, 'help')}
+ links={[
+ {
+ href: '/documentation/user-guide/rules/',
+ label: translateWithParameters('see_x', translate('rules'))
+ }
+ ]}>
+ <span className="spacer-right badge badge-error">
+ {translate('rules.status', ruleStatus)}
+ </span>
+ </DocumentationTooltip>
+ )}
+ {ruleEngine && (
+ <Tooltip overlay={translateWithParameters('issue.from_external_rule_engine', ruleEngine)}>
+ <div className="badge spacer-right text-baseline">{ruleEngine}</div>
+ </Tooltip>
+ )}
+ {manualVulnerability && (
+ <Tooltip overlay={translate('issue.manual_vulnerability.description')}>
+ <div className="badge spacer-right text-baseline">
+ {translate('issue.manual_vulnerability')}
+ </div>
+ </Tooltip>
+ )}
+ </div>
<ButtonLink
aria-label={translate('issue.why_this_issue.long')}
className="issue-see-rule spacer-right text-baseline"
}>
{translate('issue.why_this_issue')}
</ButtonLink>
- {ruleStatus && (ruleStatus === RuleStatus.Deprecated || ruleStatus === RuleStatus.Removed) && (
- <DocumentationTooltip
- className="spacer-left"
- content={translate('rules.status', ruleStatus, 'help')}
- links={[
- {
- href: '/documentation/user-guide/rules/',
- label: translateWithParameters('see_x', translate('rules'))
- }
- ]}>
- <span className="spacer-right badge badge-error">
- {translate('rules.status', ruleStatus)}
- </span>
- </DocumentationTooltip>
- )}
- {ruleEngine && (
- <Tooltip overlay={translateWithParameters('issue.from_external_rule_engine', ruleEngine)}>
- <div className="badge spacer-right text-baseline">{ruleEngine}</div>
- </Tooltip>
- )}
- {manualVulnerability && (
- <Tooltip overlay={translate('issue.manual_vulnerability.description')}>
- <div className="badge spacer-right text-baseline">
- {translate('issue.manual_vulnerability')}
- </div>
- </Tooltip>
- )}
- </div>
+ </>
);
}
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should render correctly: default 1`] = `
-<div
- className="display-inline-flex-center issue-message break-word"
->
- <span
- className="spacer-right"
+<Fragment>
+ <div
+ className="display-inline-flex-center issue-message break-word"
>
- Reduce the number of conditional operators (4) used in the expression
- </span>
+ <span
+ className="spacer-right"
+ >
+ Reduce the number of conditional operators (4) used in the expression
+ </span>
+ </div>
<ButtonLink
aria-label="issue.why_this_issue.long"
className="issue-see-rule spacer-right text-baseline"
>
issue.why_this_issue
</ButtonLink>
-</div>
+</Fragment>
`;
exports[`should render correctly: is deprecated rule 1`] = `
-<div
- className="display-inline-flex-center issue-message break-word"
->
- <span
- className="spacer-right"
+<Fragment>
+ <div
+ className="display-inline-flex-center issue-message break-word"
>
- Reduce the number of conditional operators (4) used in the expression
- </span>
+ <span
+ className="spacer-right"
+ >
+ Reduce the number of conditional operators (4) used in the expression
+ </span>
+ <DocumentationTooltip
+ className="spacer-left"
+ content="rules.status.DEPRECATED.help"
+ links={
+ Array [
+ Object {
+ "href": "/documentation/user-guide/rules/",
+ "label": "see_x.rules",
+ },
+ ]
+ }
+ >
+ <span
+ className="spacer-right badge badge-error"
+ >
+ rules.status.DEPRECATED
+ </span>
+ </DocumentationTooltip>
+ </div>
<ButtonLink
aria-label="issue.why_this_issue.long"
className="issue-see-rule spacer-right text-baseline"
>
issue.why_this_issue
</ButtonLink>
- <DocumentationTooltip
- className="spacer-left"
- content="rules.status.DEPRECATED.help"
- links={
- Array [
- Object {
- "href": "/documentation/user-guide/rules/",
- "label": "see_x.rules",
- },
- ]
- }
- >
- <span
- className="spacer-right badge badge-error"
- >
- rules.status.DEPRECATED
- </span>
- </DocumentationTooltip>
-</div>
+</Fragment>
`;
exports[`should render correctly: is manual vulnerability 1`] = `
-<div
- className="display-inline-flex-center issue-message break-word"
->
- <span
- className="spacer-right"
+<Fragment>
+ <div
+ className="display-inline-flex-center issue-message break-word"
>
- Reduce the number of conditional operators (4) used in the expression
- </span>
+ <span
+ className="spacer-right"
+ >
+ Reduce the number of conditional operators (4) used in the expression
+ </span>
+ <Tooltip
+ overlay="issue.manual_vulnerability.description"
+ >
+ <div
+ className="badge spacer-right text-baseline"
+ >
+ issue.manual_vulnerability
+ </div>
+ </Tooltip>
+ </div>
<ButtonLink
aria-label="issue.why_this_issue.long"
className="issue-see-rule spacer-right text-baseline"
>
issue.why_this_issue
</ButtonLink>
- <Tooltip
- overlay="issue.manual_vulnerability.description"
- >
- <div
- className="badge spacer-right text-baseline"
- >
- issue.manual_vulnerability
- </div>
- </Tooltip>
-</div>
+</Fragment>
`;
exports[`should render correctly: is removed rule 1`] = `
-<div
- className="display-inline-flex-center issue-message break-word"
->
- <span
- className="spacer-right"
+<Fragment>
+ <div
+ className="display-inline-flex-center issue-message break-word"
>
- Reduce the number of conditional operators (4) used in the expression
- </span>
+ <span
+ className="spacer-right"
+ >
+ Reduce the number of conditional operators (4) used in the expression
+ </span>
+ <DocumentationTooltip
+ className="spacer-left"
+ content="rules.status.REMOVED.help"
+ links={
+ Array [
+ Object {
+ "href": "/documentation/user-guide/rules/",
+ "label": "see_x.rules",
+ },
+ ]
+ }
+ >
+ <span
+ className="spacer-right badge badge-error"
+ >
+ rules.status.REMOVED
+ </span>
+ </DocumentationTooltip>
+ </div>
<ButtonLink
aria-label="issue.why_this_issue.long"
className="issue-see-rule spacer-right text-baseline"
>
issue.why_this_issue
</ButtonLink>
- <DocumentationTooltip
- className="spacer-left"
- content="rules.status.REMOVED.help"
- links={
- Array [
- Object {
- "href": "/documentation/user-guide/rules/",
- "label": "see_x.rules",
- },
- ]
- }
- >
- <span
- className="spacer-right badge badge-error"
- >
- rules.status.REMOVED
- </span>
- </DocumentationTooltip>
-</div>
+</Fragment>
`;
exports[`should render correctly: with engine info 1`] = `
-<div
- className="display-inline-flex-center issue-message break-word"
->
- <span
- className="spacer-right"
+<Fragment>
+ <div
+ className="display-inline-flex-center issue-message break-word"
>
- Reduce the number of conditional operators (4) used in the expression
- </span>
+ <span
+ className="spacer-right"
+ >
+ Reduce the number of conditional operators (4) used in the expression
+ </span>
+ <Tooltip
+ overlay="issue.from_external_rule_engine.js"
+ >
+ <div
+ className="badge spacer-right text-baseline"
+ >
+ js
+ </div>
+ </Tooltip>
+ </div>
<ButtonLink
aria-label="issue.why_this_issue.long"
className="issue-see-rule spacer-right text-baseline"
>
issue.why_this_issue
</ButtonLink>
- <Tooltip
- overlay="issue.from_external_rule_engine.js"
- >
- <div
- className="badge spacer-right text-baseline"
- >
- js
- </div>
- </Tooltip>
-</div>
+</Fragment>
`;
exports[`should render correctly: with engine name 1`] = `
-<div
- className="display-inline-flex-center issue-message break-word"
->
- <span
- className="spacer-right"
+<Fragment>
+ <div
+ className="display-inline-flex-center issue-message break-word"
>
- Reduce the number of conditional operators (4) used in the expression
- </span>
+ <span
+ className="spacer-right"
+ >
+ Reduce the number of conditional operators (4) used in the expression
+ </span>
+ <Tooltip
+ overlay="issue.from_external_rule_engine.JS"
+ >
+ <div
+ className="badge spacer-right text-baseline"
+ >
+ JS
+ </div>
+ </Tooltip>
+ </div>
<ButtonLink
aria-label="issue.why_this_issue.long"
className="issue-see-rule spacer-right text-baseline"
>
issue.why_this_issue
</ButtonLink>
- <Tooltip
- overlay="issue.from_external_rule_engine.JS"
- >
- <div
- className="badge spacer-right text-baseline"
- >
- JS
- </div>
- </Tooltip>
-</div>
+</Fragment>
`;
exports[`should render correctly: with quick fix 1`] = `
-<div
- className="display-inline-flex-center issue-message break-word"
->
- <span
- className="spacer-right"
+<Fragment>
+ <div
+ className="display-inline-flex-center issue-message break-word"
>
- Reduce the number of conditional operators (4) used in the expression
- </span>
- <Tooltip
- mouseLeaveDelay={0.5}
- overlay={
- <FormattedMessage
- defaultMessage="issue.quick_fix_available_with_sonarlint"
- id="issue.quick_fix_available_with_sonarlint"
- values={
- Object {
- "link": <a
- href="https://www.sonarqube.org/sonarlint/?referrer=sonarqube-quick-fix"
- rel="noopener noreferrer"
- target="_blank"
- >
- SonarLint
- </a>,
+ <span
+ className="spacer-right"
+ >
+ Reduce the number of conditional operators (4) used in the expression
+ </span>
+ <Tooltip
+ mouseLeaveDelay={0.5}
+ overlay={
+ <FormattedMessage
+ defaultMessage="issue.quick_fix_available_with_sonarlint"
+ id="issue.quick_fix_available_with_sonarlint"
+ values={
+ Object {
+ "link": <a
+ href="https://www.sonarqube.org/sonarlint/?referrer=sonarqube-quick-fix"
+ rel="noopener noreferrer"
+ target="_blank"
+ >
+ SonarLint
+ </a>,
+ }
}
- }
+ />
+ }
+ >
+ <SonarLintIcon
+ className="it__issues-sonarlint-quick-fix spacer-right"
+ size={15}
/>
- }
- >
- <SonarLintIcon
- className="it__issues-sonarlint-quick-fix spacer-right"
- size={15}
- />
- </Tooltip>
+ </Tooltip>
+ </div>
<ButtonLink
aria-label="issue.why_this_issue.long"
className="issue-see-rule spacer-right text-baseline"
>
issue.why_this_issue
</ButtonLink>
-</div>
+</Fragment>
`;