diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-04-18 14:07:05 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-04-18 14:07:05 +0200 |
commit | babc03b1695154175eafae59d4f775189a14f2a5 (patch) | |
tree | 320d576a215de4dbe31cd67ca4e5622854a008c2 /server/sonar-web/src/main/js/apps/background-tasks | |
parent | 87bc861ee8dd174ad26291ad235398b6a37e1955 (diff) | |
download | sonarqube-babc03b1695154175eafae59d4f775189a14f2a5.tar.gz sonarqube-babc03b1695154175eafae59d4f775189a14f2a5.zip |
SONAR-7548 Display type of background tasks
Diffstat (limited to 'server/sonar-web/src/main/js/apps/background-tasks')
6 files changed, 52 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Search.js b/server/sonar-web/src/main/js/apps/background-tasks/components/Search.js index 6a66f8b22b9..fda9220cfff 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Search.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Search.js @@ -81,7 +81,7 @@ export default React.createClass({ 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 diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Task.js b/server/sonar-web/src/main/js/apps/background-tasks/components/Task.js index ad384d12529..87ce4286d0b 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Task.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Task.js @@ -28,7 +28,7 @@ import TaskCancelButton from './TaskCancelButton'; 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); @@ -39,7 +39,7 @@ export default function Task ({ task, index, tasks, component, onCancelTask, onF 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"/> diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.js b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.js index e6a0ca329f8..ddced30d774 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.js @@ -19,14 +19,18 @@ */ 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> ); } @@ -39,6 +43,11 @@ export default function TaskComponent ({ task }) { </span> <span>{task.componentName}</span> </a> + {types.length > 1 && ( + <TaskType task={task}/> + )} </td> ); -} +}; + +export default TaskComponent; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskType.js b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskType.js new file mode 100644 index 00000000000..3877801818c --- /dev/null +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskType.js @@ -0,0 +1,34 @@ +/* + * 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; 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 6d3b225eb87..c086e2a110d 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 @@ -22,7 +22,7 @@ import React from 'react'; 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> @@ -45,6 +45,7 @@ export default function Tasks ({ tasks, component, onCancelTask, onFilterTask }) index={index} tasks={tasks} component={component} + types={types} onCancelTask={onCancelTask} onFilterTask={onFilterTask}/> ))} diff --git a/server/sonar-web/src/main/js/apps/background-tasks/containers/TasksContainer.js b/server/sonar-web/src/main/js/apps/background-tasks/containers/TasksContainer.js index 890782913a0..783b304934e 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/containers/TasksContainer.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/containers/TasksContainer.js @@ -27,7 +27,8 @@ function mapStateToProps (state) { return { fetching: state.fetching, tasks: state.tasks, - component: state.component + component: state.component, + types: state.types }; } |