From: Pascal Mugnier Date: Wed, 18 Apr 2018 14:09:17 +0000 (+0200) Subject: Feature/pm/sonar 10554 display issues from external engine (#155) X-Git-Tag: 7.5~1309 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4c9a714da9a988f779652f43e53bf2dc23d8cbeb;p=sonarqube.git Feature/pm/sonar 10554 display issues from external engine (#155) --- diff --git a/server/sonar-web/src/main/js/app/styles/components/badges.css b/server/sonar-web/src/main/js/app/styles/components/badges.css index 1dd87fe7d64..c7c42cc6d59 100644 --- a/server/sonar-web/src/main/js/app/styles/components/badges.css +++ b/server/sonar-web/src/main/js/app/styles/components/badges.css @@ -70,8 +70,8 @@ a.badge { } .badge-tiny-height { - height: var(--tinyControlHeight); - line-height: calc(var(--tinyControlHeight) - 1px); + height: var(--tinyControlHeight) !important; + line-height: calc(var(--tinyControlHeight) - 1px) !important; } .badge-muted { diff --git a/server/sonar-web/src/main/js/app/styles/components/issues.css b/server/sonar-web/src/main/js/app/styles/components/issues.css index 686167c867b..3ff1e991902 100644 --- a/server/sonar-web/src/main/js/app/styles/components/issues.css +++ b/server/sonar-web/src/main/js/app/styles/components/issues.css @@ -90,6 +90,10 @@ overflow: hidden; } +.issue-message .button-link { + height: 16px; +} + .issue-rule { vertical-align: top; margin-top: 2px; diff --git a/server/sonar-web/src/main/js/app/styles/init/misc.css b/server/sonar-web/src/main/js/app/styles/init/misc.css index cecd341e962..80c0438930e 100644 --- a/server/sonar-web/src/main/js/app/styles/init/misc.css +++ b/server/sonar-web/src/main/js/app/styles/init/misc.css @@ -18,19 +18,19 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ .vertical-top { - vertical-align: top; + vertical-align: top !important; } .vertical-bottom { - vertical-align: bottom; + vertical-align: bottom !important; } .vertical-middle { - vertical-align: middle; + vertical-align: middle !important; } .vertical-text-top { - vertical-align: text-top; + vertical-align: text-top !important; } .nowrap { diff --git a/server/sonar-web/src/main/js/app/types.ts b/server/sonar-web/src/main/js/app/types.ts index 8f6f6f5da0f..7d32fffa2ba 100644 --- a/server/sonar-web/src/main/js/app/types.ts +++ b/server/sonar-web/src/main/js/app/types.ts @@ -218,6 +218,7 @@ export interface Issue { componentUuid: string; creationDate: string; effort?: string; + fromExternalRule?: boolean; key: string; flows: FlowLocation[][]; line?: number; @@ -400,6 +401,7 @@ export interface RuleDetails extends Rule { htmlDesc?: string; htmlNote?: string; internalKey?: string; + isExternal?: boolean; mdDesc?: string; mdNote?: string; remFnBaseEffort?: string; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsDescription.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsDescription.tsx index c353a8c5c77..b6e5b8455ef 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsDescription.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsDescription.tsx @@ -23,7 +23,7 @@ import { updateRule } from '../../../api/rules'; import { RuleDetails } from '../../../app/types'; import MarkdownTips from '../../../components/common/MarkdownTips'; import { Button, ResetButtonLink } from '../../../components/ui/buttons'; -import { translate } from '../../../helpers/l10n'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; interface Props { canWrite: boolean | undefined; @@ -192,10 +192,16 @@ export default class RuleDetailsDescription extends React.PureComponent -
+ {ruleDetails.isExternal ? ( +
+ {translateWithParameters('issue.external_issue_description', ruleDetails.name)} +
+ ) : ( +
+ )} {!ruleDetails.templateKey && (
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx index 87359ccaf3f..e5992257d0e 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx @@ -225,11 +225,13 @@ export default class RuleDetailsMeta extends React.PureComponent {
{ruleDetails.key} - - - + {!ruleDetails.isExternal && ( + + + + )} {!this.props.hideSimilarRulesFilter && ( )} diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueMessage.js b/server/sonar-web/src/main/js/components/issue/components/IssueMessage.js index 515edd9b3ba..888d7f2d521 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueMessage.js +++ b/server/sonar-web/src/main/js/components/issue/components/IssueMessage.js @@ -20,13 +20,15 @@ // @flow import React from 'react'; import PropTypes from 'prop-types'; -import { translate } from '../../../helpers/l10n'; +import Tooltip from '../../controls/Tooltip'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; export default class IssueMessage extends React.PureComponent { /*:: props: { + engine?: string; message: string, - rule: string, - organization: string + organization: string, + rule: string }; */ @@ -52,6 +54,14 @@ export default class IssueMessage extends React.PureComponent { aria-label={translate('issue.rule_details')} onClick={this.handleClick} /> + {this.props.engine && ( + +
+ {this.props.engine} +
+
+ )}
); } diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueTitleBar.js b/server/sonar-web/src/main/js/components/issue/components/IssueTitleBar.js index 3dbe2919e6e..0dad342b1b5 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueTitleBar.js +++ b/server/sonar-web/src/main/js/components/issue/components/IssueTitleBar.js @@ -75,7 +75,12 @@ export default function IssueTitleBar(props /*: Props */) { return (
- +
    @@ -84,8 +89,8 @@ export default function IssueTitleBar(props /*: Props */) { creationDate={issue.creationDate} isOpen={props.currentPopup === 'changelog'} issue={issue} - togglePopup={props.togglePopup} onFail={props.onFail} + togglePopup={props.togglePopup} /> {issue.textRange != null && ( @@ -120,9 +125,9 @@ export default function IssueTitleBar(props /*: Props */) { )} diff --git a/server/sonar-web/src/main/js/components/issue/types.js b/server/sonar-web/src/main/js/components/issue/types.js index 6b0ee3a90af..2a5ce7ed3fa 100644 --- a/server/sonar-web/src/main/js/components/issue/types.js +++ b/server/sonar-web/src/main/js/components/issue/types.js @@ -65,6 +65,7 @@ export type Issue = { componentUuid: string, creationDate: string, effort?: string, + externalRuleEngine?: string, key: string, flows: Array>, line?: number, diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index b1f66282102..0a5d7f44121 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -610,6 +610,8 @@ issue.effort=Effort: issue.x_effort={0} effort issue.filter_similar_issues=Filter Similar Issues issue.this_issue_involves_x_code_locations=This issue involves {0} code location(s) +issue.from_external_rule_engine=Issue detected by an external rule engine: {0} +issue.external_issue_description=This is external rule {0}. No details are available. issues.return_to_list=Return to List issues.bulk_change=All Issues ({0}) issues.bulk_change_selected=Selected Issues ({0})