diff options
10 files changed, 54 insertions, 22 deletions
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<Props, S return ( <div className="js-rule-description"> - <div - className="coding-rules-detail-description rule-desc markdown" - dangerouslySetInnerHTML={{ __html: ruleDetails.htmlDesc || '' }} - /> + {ruleDetails.isExternal ? ( + <div className="coding-rules-detail-description rule-desc markdown"> + {translateWithParameters('issue.external_issue_description', ruleDetails.name)} + </div> + ) : ( + <div + className="coding-rules-detail-description rule-desc markdown" + dangerouslySetInnerHTML={{ __html: ruleDetails.htmlDesc || '' }} + /> + )} {!ruleDetails.templateKey && ( <div className="coding-rules-detail-description coding-rules-detail-description-extra"> 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<Props, State> { <header className="page-header"> <div className="pull-right"> <span className="note text-middle">{ruleDetails.key}</span> - <Link - className="coding-rules-detail-permalink link-no-underline spacer-left text-middle" - to={getRuleUrl(ruleDetails.key, this.props.organization)}> - <LinkIcon /> - </Link> + {!ruleDetails.isExternal && ( + <Link + className="coding-rules-detail-permalink link-no-underline spacer-left text-middle" + to={getRuleUrl(ruleDetails.key, this.props.organization)}> + <LinkIcon /> + </Link> + )} {!this.props.hideSimilarRulesFilter && ( <SimilarRulesFilter onFilterChange={this.props.onFilterChange} rule={ruleDetails} /> )} 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 && ( + <Tooltip + overlay={translateWithParameters('issue.from_external_rule_engine', this.props.engine)}> + <div className="outline-badge badge-tiny-height spacer-left vertical-text-top"> + {this.props.engine} + </div> + </Tooltip> + )} </div> ); } 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 ( <div className="issue-row"> - <IssueMessage message={issue.message} rule={issue.rule} organization={issue.organization} /> + <IssueMessage + engine={issue.externalRuleEngine} + message={issue.message} + organization={issue.organization} + rule={issue.rule} + /> <div className="issue-row-meta"> <ul className="list-inline issue-meta-list"> @@ -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} /> </li> {issue.textRange != null && ( @@ -120,9 +125,9 @@ export default function IssueTitleBar(props /*: Props */) { <SimilarIssuesFilter isOpen={props.currentPopup === 'similarIssues'} issue={issue} - togglePopup={props.togglePopup} onFail={props.onFail} onFilter={props.onFilter} + togglePopup={props.togglePopup} /> </li> )} 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<Array<FlowLocation>>, 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}) |