aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/quality-profiles
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2018-06-07 11:44:15 +0200
committerSonarTech <sonartech@sonarsource.com>2018-06-08 20:20:51 +0200
commitb61ddb3f840fbc36e6aade3a51c4d36a30862521 (patch)
treee7f808607f34792972343ed0d210ebdaa0b72a60 /server/sonar-web/src/main/js/apps/quality-profiles
parent9582a47befb743f6fec4432e9022591f7f4cff41 (diff)
downloadsonarqube-b61ddb3f840fbc36e6aade3a51c4d36a30862521.tar.gz
sonarqube-b61ddb3f840fbc36e6aade3a51c4d36a30862521.zip
SONAR-10611 Fix quality gate and quality profile badge tooltips
Diffstat (limited to 'server/sonar-web/src/main/js/apps/quality-profiles')
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInQualityProfileBadge.tsx15
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx12
2 files changed, 8 insertions, 19 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInQualityProfileBadge.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInQualityProfileBadge.tsx
index 16b64e80812..b3b4c651758 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInQualityProfileBadge.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInQualityProfileBadge.tsx
@@ -19,8 +19,7 @@
*/
import * as React from 'react';
import * as classNames from 'classnames';
-import Tooltip from '../../../components/controls/Tooltip';
-import DocInclude from '../../../components/docs/DocInclude';
+import DocTooltip from '../../../components/docs/DocTooltip';
import { translate } from '../../../helpers/l10n';
interface Props {
@@ -35,12 +34,8 @@ export default function BuiltInQualityProfileBadge({ className, tooltip = true }
</div>
);
- const overlay = (
- <DocInclude
- className="abs-width-300 cut-margins"
- path="/tooltips/quality-profiles/built-in-quality-profile"
- />
- );
-
- return <Tooltip overlay={tooltip ? overlay : undefined}>{badge}</Tooltip>;
+ if (tooltip) {
+ return <DocTooltip doc="quality-profiles/built-in-quality-profile">{badge}</DocTooltip>;
+ }
+ return badge;
}
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx
index d05b77b2fda..4be2c924b0d 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx
@@ -28,7 +28,7 @@ import { getRulesUrl } from '../../../helpers/urls';
import { isStagnant } from '../utils';
import { Profile } from '../types';
import Tooltip from '../../../components/controls/Tooltip';
-import DocInclude from '../../../components/docs/DocInclude';
+import DocTooltip from '../../../components/docs/DocTooltip';
interface Props {
onRequestFail: (reason: any) => void;
@@ -61,15 +61,9 @@ export default class ProfilesListRow extends React.PureComponent<Props> {
if (profile.isDefault) {
return (
- <Tooltip
- overlay={
- <DocInclude
- className="abs-width-300 cut-margins"
- path="/tooltips/quality-profiles/default-quality-profile"
- />
- }>
+ <DocTooltip doc="quality-profiles/default-quality-profile">
<span className="badge">{translate('default')}</span>
- </Tooltip>
+ </DocTooltip>
);
}