border-bottom: none;
}
-.list-group-item > .badge,
.list-group-item-heading > .badge {
float: right;
margin: 3px;
}
-.list-group-item > .badge + .badge,
.list-group-item-heading > .badge + .badge {
margin-right: 5px;
}
{qualityGates.map(qualityGate => (
<Link
activeClassName="active"
- className="list-group-item"
+ className="list-group-item display-flex-center"
data-id={qualityGate.id}
key={qualityGate.id}
to={getQualityGateUrl(String(qualityGate.id), organization)}>
- <table>
- <tbody>
- <tr>
- <td>{qualityGate.name}</td>
- <td className="thin nowrap spacer-left text-right">
- {qualityGate.isDefault && <span className="badge">{translate('default')}</span>}
- {qualityGate.isBuiltIn && (
- <BuiltInQualityGateBadge className="little-spacer-left" />
- )}
- </td>
- </tr>
- </tbody>
- </table>
+ <span className="flex-1">{qualityGate.name}</span>
+ {qualityGate.isDefault && (
+ <span className="badge little-spacer-left">{translate('default')}</span>
+ )}
+ {qualityGate.isBuiltIn && <BuiltInQualityGateBadge className="little-spacer-left" />}
</Link>
))}
</div>
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2019 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 { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockQualityGate } from '../../../../helpers/testMocks';
+import List from '../List';
+
+it('should render correctly', () => {
+ expect(shallowRender()).toMatchSnapshot();
+});
+
+function shallowRender() {
+ return shallow(
+ <List
+ qualityGates={[
+ mockQualityGate(),
+ mockQualityGate({ isBuiltIn: true }),
+ mockQualityGate({ isDefault: true })
+ ]}
+ />
+ );
+}
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<div
+ className="list-group"
+>
+ <Link
+ activeClassName="active"
+ className="list-group-item display-flex-center"
+ data-id={1}
+ key="1"
+ onlyActiveOnIndex={false}
+ style={Object {}}
+ to={
+ Object {
+ "pathname": "/quality_gates/show/1",
+ }
+ }
+ >
+ <span
+ className="flex-1"
+ >
+ qualitygate
+ </span>
+ </Link>
+ <Link
+ activeClassName="active"
+ className="list-group-item display-flex-center"
+ data-id={1}
+ key="1"
+ onlyActiveOnIndex={false}
+ style={Object {}}
+ to={
+ Object {
+ "pathname": "/quality_gates/show/1",
+ }
+ }
+ >
+ <span
+ className="flex-1"
+ >
+ qualitygate
+ </span>
+ <BuiltInQualityGateBadge
+ className="little-spacer-left"
+ />
+ </Link>
+ <Link
+ activeClassName="active"
+ className="list-group-item display-flex-center"
+ data-id={1}
+ key="1"
+ onlyActiveOnIndex={false}
+ style={Object {}}
+ to={
+ Object {
+ "pathname": "/quality_gates/show/1",
+ }
+ }
+ >
+ <span
+ className="flex-1"
+ >
+ qualitygate
+ </span>
+ <span
+ className="badge little-spacer-left"
+ >
+ default
+ </span>
+ </Link>
+</div>
+`;