aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-11-24 17:00:35 +0100
committerEric Hartmann <hartmann.eric@gmail.Com>2017-12-04 13:44:55 +0100
commit21e116729e9d8529f6a0a70dce996eb4fba3e1e1 (patch)
treed5120823c94a0894dafdd4015f4db44528fbfc38
parent878887d3f9ecd7c580c911b8d80e16871393b9f5 (diff)
downloadsonarqube-21e116729e9d8529f6a0a70dce996eb4fba3e1e1.tar.gz
sonarqube-21e116729e9d8529f6a0a70dce996eb4fba3e1e1.zip
Apply feedback
-rw-r--r--server/sonar-web/src/main/js/apps/projectQualityGate/Form.tsx7
-rw-r--r--server/sonar-web/src/main/js/apps/projectQualityGate/__tests__/__snapshots__/Form-test.tsx.snap5
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx (renamed from server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInBadge.tsx)2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.js4
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/List.js4
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInQualityProfileBadge.tsx (renamed from server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInBadge.tsx)2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileHeader.tsx6
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritanceBox.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx4
9 files changed, 14 insertions, 24 deletions
diff --git a/server/sonar-web/src/main/js/apps/projectQualityGate/Form.tsx b/server/sonar-web/src/main/js/apps/projectQualityGate/Form.tsx
index a2bcf4111cf..909767bfed9 100644
--- a/server/sonar-web/src/main/js/apps/projectQualityGate/Form.tsx
+++ b/server/sonar-web/src/main/js/apps/projectQualityGate/Form.tsx
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { some } from 'lodash';
import { QualityGate } from '../../api/quality-gates';
import Select from '../../components/controls/Select';
import { translate } from '../../helpers/l10n';
@@ -96,11 +95,6 @@ export default class Form extends React.PureComponent<Props, State> {
isDefault: gate.isDefault
}));
- const hasDefault = some(allGates, gate => gate.isDefault);
- if (!hasDefault) {
- options.unshift({ value: '', label: translate('none') });
- }
-
return (
<Select
clearable={false}
@@ -108,7 +102,6 @@ export default class Form extends React.PureComponent<Props, State> {
onChange={this.handleChange}
optionRenderer={this.renderGateName}
options={options}
- placeholder={translate('none')}
style={{ width: 300 }}
value={gate && String(gate.id)}
valueRenderer={this.renderGateName}
diff --git a/server/sonar-web/src/main/js/apps/projectQualityGate/__tests__/__snapshots__/Form-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectQualityGate/__tests__/__snapshots__/Form-test.tsx.snap
index 3e5a39759b8..e7620afb1a2 100644
--- a/server/sonar-web/src/main/js/apps/projectQualityGate/__tests__/__snapshots__/Form-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/projectQualityGate/__tests__/__snapshots__/Form-test.tsx.snap
@@ -10,10 +10,6 @@ exports[`renders 1`] = `
options={
Array [
Object {
- "label": "none",
- "value": "",
- },
- Object {
"isDefault": undefined,
"label": "name-1",
"value": "1",
@@ -25,7 +21,6 @@ exports[`renders 1`] = `
},
]
}
- placeholder="none"
style={
Object {
"width": 300,
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInBadge.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx
index 6d5ad233540..5907e9d5770 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInBadge.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx
@@ -27,7 +27,7 @@ interface Props {
tooltip?: boolean;
}
-export default function BuiltInBadge({ className, tooltip = true }: Props) {
+export default function BuiltInQualityGateBadge({ className, tooltip = true }: Props) {
const badge = (
<div className={classNames('outline-badge', className)}>
{translate('quality_gates.built_in')}
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.js b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.js
index 2ac134c5275..b86e89a41b8 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.js
@@ -18,7 +18,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-import BuiltInBadge from './BuiltInBadge';
+import BuiltInQualityGateBadge from './BuiltInQualityGateBadge';
import { translate } from '../../../helpers/l10n';
export default class DetailsHeader extends React.PureComponent {
@@ -51,7 +51,7 @@ export default class DetailsHeader extends React.PureComponent {
<div className="layout-page-main-inner">
<h2 className="pull-left">
{qualityGate.name}
- {qualityGate.isBuiltIn && <BuiltInBadge className="spacer-left" tooltip={true} />}
+ {qualityGate.isBuiltIn && <BuiltInQualityGateBadge className="spacer-left" />}
</h2>
<div className="pull-right">
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/List.js b/server/sonar-web/src/main/js/apps/quality-gates/components/List.js
index f99de57f400..d29633c5102 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/List.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/List.js
@@ -19,7 +19,7 @@
*/
import React from 'react';
import { Link } from 'react-router';
-import BuiltInBadge from './BuiltInBadge';
+import BuiltInQualityGateBadge from './BuiltInQualityGateBadge';
import { translate } from '../../../helpers/l10n';
import { getQualityGateUrl } from '../../../helpers/urls';
@@ -42,7 +42,7 @@ export default function List({ organization, qualityGates }) {
<span className="text-middle badge">{translate('default')}</span>
)}
{qualityGate.isBuiltIn && (
- <BuiltInBadge className="little-spacer-left" tooltip={false} />
+ <BuiltInQualityGateBadge className="little-spacer-left" tooltip={false} />
)}
</td>
</tr>
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInBadge.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInQualityProfileBadge.tsx
index c0113215f4f..f7e7d5f2679 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInBadge.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInQualityProfileBadge.tsx
@@ -27,7 +27,7 @@ interface Props {
tooltip?: boolean;
}
-export default function BuiltInBadge({ className, tooltip = true }: Props) {
+export default function BuiltInQualityProfileBadge({ className, tooltip = true }: Props) {
const badge = (
<div className={classNames('outline-badge', className)}>
{translate('quality_profiles.built_in')}
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileHeader.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileHeader.tsx
index b131bb089de..72e6bd8ef4b 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileHeader.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileHeader.tsx
@@ -22,7 +22,7 @@ import { Link, IndexLink } from 'react-router';
import ProfileLink from '../components/ProfileLink';
import ProfileActions from '../components/ProfileActions';
import ProfileDate from '../components/ProfileDate';
-import BuiltInBadge from '../components/BuiltInBadge';
+import BuiltInQualityProfileBadge from '../components/BuiltInQualityProfileBadge';
import { translate } from '../../../helpers/l10n';
import {
isStagnant,
@@ -92,7 +92,9 @@ export default class ProfileHeader extends React.PureComponent<Props> {
organization={organization}>
<span>{profile.name}</span>
</ProfileLink>
- {profile.isBuiltIn && <BuiltInBadge className="spacer-left" tooltip={false} />}
+ {profile.isBuiltIn && (
+ <BuiltInQualityProfileBadge className="spacer-left" tooltip={false} />
+ )}
</h1>
<div className="pull-right">
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritanceBox.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritanceBox.tsx
index 12e27f57594..4e357b8c1c8 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritanceBox.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritanceBox.tsx
@@ -19,7 +19,7 @@
*/
import * as React from 'react';
import ProfileLink from '../components/ProfileLink';
-import BuiltInBadge from '../components/BuiltInBadge';
+import BuiltInQualityProfileBadge from '../components/BuiltInQualityProfileBadge';
import Tooltip from '../../../components/controls/Tooltip';
import { translate, translateWithParameters } from '../../../helpers/l10n';
@@ -58,7 +58,7 @@ export default function ProfileInheritanceBox({ displayLink = true, ...props }:
) : (
profile.name
)}
- {profile.isBuiltIn && <BuiltInBadge className="spacer-left" />}
+ {profile.isBuiltIn && <BuiltInQualityProfileBadge className="spacer-left" />}
{extendsBuiltIn && (
<Tooltip overlay={translate('quality_profiles.extends_built_in')}>
<i className="icon-help spacer-left" />
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 ff75c1cef3b..20b2073a37f 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
@@ -22,7 +22,7 @@ import { Link } from 'react-router';
import ProfileLink from '../components/ProfileLink';
import ProfileDate from '../components/ProfileDate';
import ProfileActions from '../components/ProfileActions';
-import BuiltInBadge from '../components/BuiltInBadge';
+import BuiltInQualityProfileBadge from '../components/BuiltInQualityProfileBadge';
import { translate } from '../../../helpers/l10n';
import { getRulesUrl } from '../../../helpers/urls';
import { isStagnant } from '../utils';
@@ -48,7 +48,7 @@ export default class ProfilesListRow extends React.PureComponent<Props> {
organization={this.props.organization}>
{profile.name}
</ProfileLink>
- {profile.isBuiltIn && <BuiltInBadge className="spacer-left" />}
+ {profile.isBuiltIn && <BuiltInQualityProfileBadge className="spacer-left" />}
</div>
);
}