@@ -18,13 +18,14 @@ | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
import * as React from 'react'; | |||
import TaskStatus from './TaskStatus'; | |||
import TaskActions from './TaskActions'; | |||
import TaskComponent from './TaskComponent'; | |||
import TaskId from './TaskId'; | |||
import TaskExecutionTime from './TaskExecutionTime'; | |||
import TaskDay from './TaskDay'; | |||
import TaskDate from './TaskDate'; | |||
import TaskExecutionTime from './TaskExecutionTime'; | |||
import TaskActions from './TaskActions'; | |||
import TaskId from './TaskId'; | |||
import TaskStatus from './TaskStatus'; | |||
import TaskSubmitter from './TaskSubmitter'; | |||
import { Task as ITask } from '../types'; | |||
interface Props { | |||
@@ -43,19 +44,20 @@ export default function Task(props: Props) { | |||
<TaskStatus status={task.status} /> | |||
<TaskComponent task={task} /> | |||
<TaskId id={task.id} /> | |||
<TaskSubmitter submitter={task.submitterLogin} /> | |||
<TaskDay | |||
submittedAt={task.submittedAt} | |||
prevSubmittedAt={previousTask && previousTask.submittedAt} | |||
submittedAt={task.submittedAt} | |||
/> | |||
<TaskDate date={task.submittedAt} /> | |||
<TaskDate date={task.startedAt} baseDate={task.submittedAt} /> | |||
<TaskDate date={task.executedAt} baseDate={task.submittedAt} /> | |||
<TaskDate baseDate={task.submittedAt} date={task.startedAt} /> | |||
<TaskDate baseDate={task.submittedAt} date={task.executedAt} /> | |||
<TaskExecutionTime ms={task.executionTimeMs} /> | |||
<TaskActions | |||
component={component} | |||
task={task} | |||
onFilterTask={onFilterTask} | |||
onCancelTask={onCancelTask} | |||
onFilterTask={onFilterTask} | |||
task={task} | |||
/> | |||
</tr> | |||
); |
@@ -0,0 +1,29 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2018 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 { translate } from '../../../helpers/l10n'; | |||
interface Props { | |||
submitter?: string; | |||
} | |||
export default function TaskSubmitter({ submitter }: Props) { | |||
return <td className="thin nowrap note">{submitter || translate('anonymous')}</td>; | |||
} |
@@ -56,6 +56,7 @@ export default class Tasks extends React.PureComponent { | |||
<th>{translate('background_tasks.table.status')}</th> | |||
<th>{translate('background_tasks.table.task')}</th> | |||
<th>{translate('background_tasks.table.id')}</th> | |||
<th className="text-right">{translate('background_tasks.table.submitter')}</th> | |||
<th> </th> | |||
<th className="text-right">{translate('background_tasks.table.submitted')}</th> | |||
<th className="text-right">{translate('background_tasks.table.started')}</th> | |||
@@ -67,13 +68,13 @@ export default class Tasks extends React.PureComponent { | |||
<tbody> | |||
{tasks.map((task, index, tasks) => ( | |||
<Task | |||
key={task.id} | |||
task={task} | |||
tasks={tasks} | |||
component={component} | |||
key={task.id} | |||
onCancelTask={onCancelTask} | |||
onFilterTask={onFilterTask} | |||
previousTask={index > 0 ? tasks[index - 1] : undefined} | |||
task={task} | |||
tasks={tasks} | |||
/> | |||
))} | |||
</tbody> |
@@ -36,6 +36,7 @@ const task = { | |||
status: 'PENDING', | |||
id: '123', | |||
submittedAt: '2017-01-01', | |||
submitterLogin: 'yoda', | |||
type: 'REPORT' | |||
}; | |||
@@ -36,6 +36,7 @@ const task = { | |||
status: 'PENDING', | |||
id: '123', | |||
submittedAt: '2017-01-01', | |||
submitterLogin: 'yoda', | |||
type: 'REPORT' | |||
}; | |||
@@ -32,6 +32,7 @@ it('renders', () => { | |||
status: 'PENDING', | |||
id: '123', | |||
submittedAt: '2017-01-01', | |||
submitterLogin: 'yoda', | |||
type: 'REPORT' | |||
}} | |||
/> |
@@ -29,6 +29,7 @@ const TASK = { | |||
organization: 'org', | |||
status: 'PENDING', | |||
submittedAt: '2017-01-01', | |||
submitterLogin: 'yoda', | |||
type: 'REPORT' | |||
}; | |||
@@ -12,6 +12,7 @@ exports[`renders 1`] = ` | |||
"id": "123", | |||
"status": "PENDING", | |||
"submittedAt": "2017-01-01", | |||
"submitterLogin": "yoda", | |||
"type": "REPORT", | |||
} | |||
} | |||
@@ -19,6 +20,9 @@ exports[`renders 1`] = ` | |||
<TaskId | |||
id="123" | |||
/> | |||
<TaskSubmitter | |||
submitter="yoda" | |||
/> | |||
<TaskDay | |||
submittedAt="2017-01-01" | |||
/> | |||
@@ -41,6 +45,7 @@ exports[`renders 1`] = ` | |||
"id": "123", | |||
"status": "PENDING", | |||
"submittedAt": "2017-01-01", | |||
"submitterLogin": "yoda", | |||
"type": "REPORT", | |||
} | |||
} |
@@ -34,5 +34,6 @@ export interface Task { | |||
startedAt?: string; | |||
status: string; | |||
submittedAt: string; | |||
submitterLogin?: string; | |||
type: string; | |||
} |
@@ -12,6 +12,7 @@ admin=Admin | |||
apply=Apply | |||
all=All | |||
and=And | |||
anonymous=Anonymous | |||
any=Any | |||
ascending=Ascending | |||
assignee=Assignee | |||
@@ -2237,6 +2238,7 @@ background_tasks.table.status=Status | |||
background_tasks.table.task=Task | |||
background_tasks.table.id=ID | |||
background_tasks.table.submitted=Submitted | |||
background_tasks.table.submitter=Submitter | |||
background_tasks.table.started=Started | |||
background_tasks.table.finished=Finished | |||
background_tasks.table.duration=Duration |