diff options
10 files changed, 56 insertions, 12 deletions
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Task.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/Task.tsx index 79875d311a8..aec46467931 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Task.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Task.tsx @@ -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> ); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskSubmitter.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskSubmitter.tsx new file mode 100644 index 00000000000..378cc1eb226 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskSubmitter.tsx @@ -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>; +} diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Tasks.js b/server/sonar-web/src/main/js/apps/background-tasks/components/Tasks.js index af0696c6afa..37510fb0c9b 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Tasks.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Tasks.js @@ -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> diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/ScannerContext-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/ScannerContext-test.tsx index 12bd9297176..cb3de25e5ef 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/ScannerContext-test.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/ScannerContext-test.tsx @@ -36,6 +36,7 @@ const task = { status: 'PENDING', id: '123', submittedAt: '2017-01-01', + submitterLogin: 'yoda', type: 'REPORT' }; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Stacktrace-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Stacktrace-test.tsx index 8b8a8af5e1d..0a5826e4750 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Stacktrace-test.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Stacktrace-test.tsx @@ -36,6 +36,7 @@ const task = { status: 'PENDING', id: '123', submittedAt: '2017-01-01', + submitterLogin: 'yoda', type: 'REPORT' }; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Task-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Task-test.tsx index 68217c536ad..9ff179bbe17 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Task-test.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Task-test.tsx @@ -32,6 +32,7 @@ it('renders', () => { status: 'PENDING', id: '123', submittedAt: '2017-01-01', + submitterLogin: 'yoda', type: 'REPORT' }} /> diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskComponent-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskComponent-test.tsx index ad89c600812..ba65497fc92 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskComponent-test.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskComponent-test.tsx @@ -29,6 +29,7 @@ const TASK = { organization: 'org', status: 'PENDING', submittedAt: '2017-01-01', + submitterLogin: 'yoda', type: 'REPORT' }; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/Task-test.tsx.snap b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/Task-test.tsx.snap index 36c6d8c522f..0fffe27edc9 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/Task-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/Task-test.tsx.snap @@ -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", } } diff --git a/server/sonar-web/src/main/js/apps/background-tasks/types.ts b/server/sonar-web/src/main/js/apps/background-tasks/types.ts index 239c4581d61..220240365e5 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/types.ts +++ b/server/sonar-web/src/main/js/apps/background-tasks/types.ts @@ -34,5 +34,6 @@ export interface Task { startedAt?: string; status: string; submittedAt: string; + submitterLogin?: string; type: string; } diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 5f7d150df99..a8fb7a71477 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -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 |