diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-02-11 18:57:39 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-02-16 14:44:59 +0100 |
commit | 4621ff0206176da5af9fc8c1c704a2ca5aded1ad (patch) | |
tree | b2b6bbcb5ae6812c591f8c71e454454566f3d493 /server/sonar-web/src/main/js/apps/background-tasks/containers | |
parent | e53211f03c6d95428b387cc3beddf5378579769a (diff) | |
download | sonarqube-4621ff0206176da5af9fc8c1c704a2ca5aded1ad.tar.gz sonarqube-4621ff0206176da5af9fc8c1c704a2ca5aded1ad.zip |
SONAR-7191 Update the background tasks page to reflect latest WS changes
Diffstat (limited to 'server/sonar-web/src/main/js/apps/background-tasks/containers')
5 files changed, 213 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/containers/BackgroundTasksAppContainer.js b/server/sonar-web/src/main/js/apps/background-tasks/containers/BackgroundTasksAppContainer.js new file mode 100644 index 00000000000..75496136964 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/background-tasks/containers/BackgroundTasksAppContainer.js @@ -0,0 +1,38 @@ +/* + * 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 { connect } from 'react-redux'; + +import Main from '../components/BackgroundTasksApp'; +import { initApp } from '../store/actions'; + +function mapStateToProps () { + return {}; +} + +function mapDispatchToProps (dispatch) { + return { + initApp: () => dispatch(initApp()) + }; +} + +export default connect( + mapStateToProps, + mapDispatchToProps +)(Main); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/containers/ListFooterContainer.js b/server/sonar-web/src/main/js/apps/background-tasks/containers/ListFooterContainer.js new file mode 100644 index 00000000000..048068f63f5 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/background-tasks/containers/ListFooterContainer.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 { connect } from 'react-redux'; + +import ListFooter from '../../../components/shared/list-footer'; + +function mapStateToProps (state) { + return { + ready: !state.fetching, + total: state.total, + count: state.tasks.length + }; +} + +export default connect( + mapStateToProps +)(ListFooter); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/containers/SearchContainer.js b/server/sonar-web/src/main/js/apps/background-tasks/containers/SearchContainer.js new file mode 100644 index 00000000000..ccae8470dd2 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/background-tasks/containers/SearchContainer.js @@ -0,0 +1,51 @@ +/* + * 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 { connect } from 'react-redux'; + +import Search from '../components/Search'; +import { filterTasks, search } from '../store/actions'; + +function mapStateToProps (state) { + return { + fetching: state.fetching, + status: state.status, + currents: state.currents, + date: state.date, + query: state.query, + taskType: state.taskType, + types: state.types + }; +} + +function mapDispatchToProps (dispatch) { + return { + onRefresh: () => dispatch(filterTasks()), + onStatusChange: (status) => dispatch(filterTasks({ status })), + onTypeChange: (taskType) => dispatch(filterTasks({ taskType })), + onCurrentsChange: (currents) => dispatch(filterTasks({ currents })), + onDateChange: (date) => dispatch(filterTasks({ date })), + onSearch: (query) => dispatch(search(query)) + }; +} + +export default connect( + mapStateToProps, + mapDispatchToProps +)(Search); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/containers/StatsContainer.js b/server/sonar-web/src/main/js/apps/background-tasks/containers/StatsContainer.js new file mode 100644 index 00000000000..f1828926628 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/background-tasks/containers/StatsContainer.js @@ -0,0 +1,48 @@ +/* + * 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 { connect } from 'react-redux'; + +import Stats from '../components/Stats'; +import { filterTasks, cancelAllPending } from '../store/actions'; +import { STATUSES, CURRENTS, DEFAULT_FILTERS } from '../constants'; + +function mapStateToProps (state) { + return { + pendingCount: state.pendingCount, + failingCount: state.failingCount, + inProgressDuration: state.inProgressDuration + }; +} + +function mapDispatchToProps (dispatch) { + return { + onShowFailing: () => dispatch(filterTasks({ + ...DEFAULT_FILTERS, + status: STATUSES.FAILED, + currents: CURRENTS.ONLY_CURRENTS + })), + onCancelAllPending: () => dispatch(cancelAllPending()) + }; +} + +export default connect( + mapStateToProps, + mapDispatchToProps +)(Stats); 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 new file mode 100644 index 00000000000..0fc2989b98c --- /dev/null +++ b/server/sonar-web/src/main/js/apps/background-tasks/containers/TasksContainer.js @@ -0,0 +1,42 @@ +/* + * 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 { connect } from 'react-redux'; + +import Tasks from '../components/Tasks'; +import { cancelTask, filterTasks } from '../store/actions'; + +function mapStateToProps (state) { + return { + fetching: state.fetching, + tasks: state.tasks + }; +} + +function mapDispatchToProps (dispatch) { + return { + onCancelTask: (task) => dispatch(cancelTask(task)), + onFilterTask: (task) => dispatch(filterTasks({ query: task.componentKey })) + }; +} + +export default connect( + mapStateToProps, + mapDispatchToProps +)(Tasks); |