<Tasks
loading={loading}
component={component}
- types={types}
tasks={tasks}
onCancelTask={this.handleCancelTask.bind(this)}
onFilterTask={this.handleFilterTask.bind(this)}
index: PropTypes.number.isRequired,
tasks: PropTypes.array.isRequired,
component: PropTypes.object,
- types: PropTypes.array.isRequired,
onCancelTask: PropTypes.func.isRequired,
onFilterTask: PropTypes.func.isRequired
};
render() {
- const { task, index, tasks, component, types, onCancelTask, onFilterTask } = this.props;
+ const { task, index, tasks, component, onCancelTask, onFilterTask } = this.props;
const prevTask = index > 0 ? tasks[index - 1] : null;
return (
<tr>
<TaskStatus task={task} />
- <TaskComponent task={task} types={types} />
+ <TaskComponent task={task} />
<TaskId task={task} />
<TaskDay task={task} prevTask={prevTask} />
<TaskDate date={task.submittedAt} baseDate={task.submittedAt} format="LTS" />
/*::
type Props = {
- task: Task,
- types: Array<string>
+ task: Task
};
*/
export default function TaskComponent(props /*: Props */) {
- const { task, types } = props;
+ const { task } = props;
if (!task.componentKey) {
return (
<span className="note">
{task.id}
</span>
- {types.length > 1 && <TaskType task={task} />}
+ <TaskType task={task} />
</td>
);
}
{task.componentName}
</Link>
- {types.length > 1 && <TaskType task={task} />}
+ <TaskType task={task} />
</td>
);
}
type Props = {
tasks: Array<*>,
component: Object,
- types: Array<*>,
loading: boolean,
onCancelTask: Function,
onFilterTask: Function
/*:: state: State; */
render() {
- const { tasks, component, types, loading, onCancelTask, onFilterTask } = this.props;
+ const { tasks, component, loading, onCancelTask, onFilterTask } = this.props;
const className = classNames('data zebra zebra-hover background-tasks', {
'new-loading': loading
index={index}
tasks={tasks}
component={component}
- types={types}
onCancelTask={onCancelTask}
onFilterTask={onFilterTask}
/>
--- /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.
+ */
+/* @flow */
+import React from 'react';
+import { shallow } from 'enzyme';
+import TaskComponent from '../TaskComponent';
+
+it('renders', () => {
+ const task = {
+ componentKey: 'foo',
+ componentName: 'foo',
+ componentQualifier: 'TRK',
+ id: 'bar',
+ organization: 'org',
+ type: 'REPORT'
+ };
+ expect(shallow(<TaskComponent task={task} />)).toMatchSnapshot();
+ expect(shallow(<TaskComponent task={{ ...task, componentKey: undefined }} />)).toMatchSnapshot();
+});
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`renders 1`] = `
+<td>
+ <span
+ className="little-spacer-right"
+ >
+ <QualifierIcon
+ qualifier="TRK"
+ />
+ </span>
+ <Connect(Organization)
+ organizationKey="org"
+ />
+ <Link
+ onlyActiveOnIndex={false}
+ style={Object {}}
+ to={
+ Object {
+ "pathname": "/dashboard",
+ "query": Object {
+ "id": "foo",
+ },
+ }
+ }
+ >
+ foo
+ </Link>
+ <TaskType
+ task={
+ Object {
+ "componentKey": "foo",
+ "componentName": "foo",
+ "componentQualifier": "TRK",
+ "id": "bar",
+ "organization": "org",
+ "type": "REPORT",
+ }
+ }
+ />
+</td>
+`;
+
+exports[`renders 2`] = `
+<td>
+ <span
+ className="note"
+ >
+ bar
+ </span>
+ <TaskType
+ task={
+ Object {
+ "componentKey": undefined,
+ "componentName": "foo",
+ "componentQualifier": "TRK",
+ "id": "bar",
+ "organization": "org",
+ "type": "REPORT",
+ }
+ }
+ />
+</td>
+`;
inactive=Inactive
including_abbreviated=incl.
incremental=Incremental
-incrementa.project_tooltip=Overall project status could be incomplete: incremental mode was used in the last analysis, so only changed files were examined.
+incremental.project_tooltip=Overall project status could be incomplete: incremental mode was used in the last analysis, so only changed files were examined.
info=Info
issue=Issue
issues=Issues