* 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';
isDefault: gate.isDefault
}));
- const hasDefault = some(allGates, gate => gate.isDefault);
- if (!hasDefault) {
- options.unshift({ value: '', label: translate('none') });
- }
-
return (
<Select
clearable={false}
onChange={this.handleChange}
optionRenderer={this.renderGateName}
options={options}
- placeholder={translate('none')}
style={{ width: 300 }}
value={gate && String(gate.id)}
valueRenderer={this.renderGateName}
optionRenderer={[Function]}
options={
Array [
- Object {
- "label": "none",
- "value": "",
- },
Object {
"isDefault": undefined,
"label": "name-1",
},
]
}
- placeholder="none"
style={
Object {
"width": 300,
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-import * as React from 'react';
-import * as classNames from 'classnames';
-import Tooltip from '../../../components/controls/Tooltip';
-import { translate } from '../../../helpers/l10n';
-
-interface Props {
- className?: string;
- tooltip?: boolean;
-}
-
-export default function BuiltInBadge({ className, tooltip = true }: Props) {
- const badge = (
- <div className={classNames('outline-badge', className)}>
- {translate('quality_gates.built_in')}
- </div>
- );
-
- const overlay = (
- <div>
- <p>{translate('quality_gates.built_in.description.1')}</p>
- <p>{translate('quality_gates.built_in.description.2')}</p>
- </div>
- );
-
- return tooltip ? <Tooltip overlay={overlay}>{badge}</Tooltip> : badge;
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import * as classNames from 'classnames';
+import Tooltip from '../../../components/controls/Tooltip';
+import { translate } from '../../../helpers/l10n';
+
+interface Props {
+ className?: string;
+ tooltip?: boolean;
+}
+
+export default function BuiltInQualityGateBadge({ className, tooltip = true }: Props) {
+ const badge = (
+ <div className={classNames('outline-badge', className)}>
+ {translate('quality_gates.built_in')}
+ </div>
+ );
+
+ const overlay = (
+ <div>
+ <p>{translate('quality_gates.built_in.description.1')}</p>
+ <p>{translate('quality_gates.built_in.description.2')}</p>
+ </div>
+ );
+
+ return tooltip ? <Tooltip overlay={overlay}>{badge}</Tooltip> : badge;
+}
* 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 {
<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">
*/
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';
<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>
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-import * as React from 'react';
-import * as classNames from 'classnames';
-import Tooltip from '../../../components/controls/Tooltip';
-import { translate } from '../../../helpers/l10n';
-
-interface Props {
- className?: string;
- tooltip?: boolean;
-}
-
-export default function BuiltInBadge({ className, tooltip = true }: Props) {
- const badge = (
- <div className={classNames('outline-badge', className)}>
- {translate('quality_profiles.built_in')}
- </div>
- );
-
- const overlay = (
- <span>
- {translate('quality_profiles.built_in.description.1')}{' '}
- {translate('quality_profiles.built_in.description.2')}
- </span>
- );
-
- return tooltip ? <Tooltip overlay={overlay}>{badge}</Tooltip> : badge;
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import * as classNames from 'classnames';
+import Tooltip from '../../../components/controls/Tooltip';
+import { translate } from '../../../helpers/l10n';
+
+interface Props {
+ className?: string;
+ tooltip?: boolean;
+}
+
+export default function BuiltInQualityProfileBadge({ className, tooltip = true }: Props) {
+ const badge = (
+ <div className={classNames('outline-badge', className)}>
+ {translate('quality_profiles.built_in')}
+ </div>
+ );
+
+ const overlay = (
+ <span>
+ {translate('quality_profiles.built_in.description.1')}{' '}
+ {translate('quality_profiles.built_in.description.2')}
+ </span>
+ );
+
+ return tooltip ? <Tooltip overlay={overlay}>{badge}</Tooltip> : badge;
+}
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,
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">
*/
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';
) : (
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" />
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';
organization={this.props.organization}>
{profile.name}
</ProfileLink>
- {profile.isBuiltIn && <BuiltInBadge className="spacer-left" />}
+ {profile.isBuiltIn && <BuiltInQualityProfileBadge className="spacer-left" />}
</div>
);
}