value={this.props.status}
onChange={this.props.onStatusChange}/>
</li>
- {this.props.types.length > 1 && !this.props.component && (
+ {this.props.types.length > 1 && (
<li>
<h6 className="bt-search-form-label">
Type
import TaskLogsLink from './TaskLogsLink';
import { STATUSES } from './../constants';
-export default function Task ({ task, index, tasks, component, onCancelTask, onFilterTask }) {
+export default function Task ({ task, index, tasks, component, types, onCancelTask, onFilterTask }) {
function handleFilterTask (task, e) {
e.preventDefault();
onFilterTask(task);
return (
<tr>
<TaskStatus task={task}/>
- <TaskComponent task={task}/>
+ <TaskComponent task={task} types={types}/>
<TaskDay task={task} prevTask={prevTask}/>
<TaskDate date={task.submittedAt} baseDate={task.submittedAt} format="LTS"/>
<TaskDate date={task.startedAt} baseDate={task.submittedAt} format="LTS"/>
*/
import React from 'react';
+import TaskType from './TaskType';
import { getComponentUrl } from '../../../helpers/urls';
import QualifierIcon from '../../../components/shared/qualifier-icon';
-export default function TaskComponent ({ task }) {
+const TaskComponent = ({ task, types }) => {
if (!task.componentKey) {
return (
<td>
<span className="note">{task.id}</span>
+ {types.length > 1 && (
+ <TaskType task={task}/>
+ )}
</td>
);
}
</span>
<span>{task.componentName}</span>
</a>
+ {types.length > 1 && (
+ <TaskType task={task}/>
+ )}
</td>
);
-}
+};
+
+export default TaskComponent;
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact 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 React from 'react';
+
+import { translate } from '../../../helpers/l10n';
+
+const TaskType = ({ task }) => {
+ return (
+ <span className="note spacer-left">
+ {'['}
+ {translate('background_task.type', task.type)}
+ {']'}
+ </span>
+ );
+};
+
+export default TaskType;
import Task from './Task';
import { translate } from '../../../helpers/l10n';
-export default function Tasks ({ tasks, component, onCancelTask, onFilterTask }) {
+export default function Tasks ({ tasks, component, types, onCancelTask, onFilterTask }) {
return (
<table className="data zebra zebra-hover background-tasks">
<thead>
index={index}
tasks={tasks}
component={component}
+ types={types}
onCancelTask={onCancelTask}
onFilterTask={onFilterTask}/>
))}
return {
fetching: state.fetching,
tasks: state.tasks,
- component: state.component
+ component: state.component,
+ types: state.types
};
}