summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-03-30 14:03:22 +0200
committerStas Vilchik <vilchiks@gmail.com>2016-03-30 14:03:22 +0200
commit9ac2512ad01b64c6c7d2af6b4600f6ee0b3729af (patch)
tree3b60be424aa059d8cb9d833ae2b1293f0a84bdd7 /server
parent737b9fdfcc2cd876c34620a9cc228fe760366c7b (diff)
downloadsonarqube-9ac2512ad01b64c6c7d2af6b4600f6ee0b3729af.tar.gz
sonarqube-9ac2512ad01b64c6c7d2af6b4600f6ee0b3729af.zip
SONAR-7423 Remove displaying of duration of task in progress
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/Stats.js24
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/containers/StatsContainer.js1
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/store/actions.js17
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/store/reducers.js6
-rw-r--r--server/sonar-web/tests/apps/background-tasks-test.js20
5 files changed, 7 insertions, 61 deletions
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Stats.js b/server/sonar-web/src/main/js/apps/background-tasks/components/Stats.js
index 2fc18a7bd75..450a5098671 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/Stats.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Stats.js
@@ -19,10 +19,8 @@
*/
import React, { Component } from 'react';
-import { formatDuration } from './../helpers';
import { translate } from '../../../helpers/l10n';
-
export default class Stats extends Component {
handleCancelAllPending (e) {
e.preventDefault();
@@ -34,27 +32,6 @@ export default class Stats extends Component {
this.props.onShowFailing();
}
- renderInProgressDuration () {
- if (!this.props.inProgressDuration) {
- return null;
- }
- return (
- <span
- className="huge-spacer-left"
- title={translate('background_tasks.in_progress_duration')}
- data-toggle="tooltip">
- <i
- className="spinner spacer-right"
- style={{ verticalAlign: 'text-top' }}/>
- <span
- ref="inProgressDuration"
- className="emphasised-measure">
- {formatDuration(this.props.inProgressDuration)}
- </span>
- </span>
- );
- }
-
renderPending () {
if (this.props.pendingCount == null) {
return null;
@@ -130,7 +107,6 @@ export default class Stats extends Component {
<span className="huge-spacer-left">
{this.renderFailures()}
</span>
- {this.renderInProgressDuration()}
</section>
);
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
index 86fa2952825..510295faf54 100644
--- 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
@@ -27,7 +27,6 @@ function mapStateToProps (state) {
return {
pendingCount: state.pendingCount,
failingCount: state.failingCount,
- inProgressDuration: state.inProgressDuration,
component: state.component
};
}
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/store/actions.js b/server/sonar-web/src/main/js/apps/background-tasks/store/actions.js
index 1e59fd84dbc..b3d54560da2 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/store/actions.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/store/actions.js
@@ -63,12 +63,11 @@ export function updateQuery (query) {
};
}
-export function receiveStats ({ pendingCount, failingCount, inProgressDuration }) {
+export function receiveStats ({ pendingCount, failingCount }) {
return {
type: RECEIVE_STATS,
pendingCount,
- failingCount,
- inProgressDuration
+ failingCount
};
}
@@ -141,10 +140,6 @@ function mapFiltersToParameters (filters = {}) {
return parameters;
}
-function getInProgressDuration (tasks) {
- return tasks.length ? tasks[0].executionTimeMs : null;
-}
-
function fetchTasks (filters) {
return (dispatch, getState) => {
const { component } = getState();
@@ -161,20 +156,18 @@ function fetchTasks (filters) {
return Promise.all([
getActivity(parameters),
getActivity({ ps: 1, onlyCurrents: true, status: STATUSES.FAILED }),
- getActivity({ ps: 1, status: STATUSES.PENDING }),
- getActivity({ ps: 1, status: STATUSES.IN_PROGRESS })
+ getActivity({ ps: 1, status: STATUSES.PENDING })
]).then(responses => {
- const [activity, failingActivity, pendingActivity, inProgressActivity] = responses;
+ const [activity, failingActivity, pendingActivity] = responses;
const tasks = activity.tasks;
const total = activity.paging.total;
dispatch(receiveTasks(tasks, total));
const pendingCount = pendingActivity.paging.total;
- const inProgressDuration = getInProgressDuration(inProgressActivity.tasks);
const failingCount = failingActivity.paging.total;
- dispatch(receiveStats({ pendingCount, failingCount, inProgressDuration }));
+ dispatch(receiveStats({ pendingCount, failingCount }));
});
};
}
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/store/reducers.js b/server/sonar-web/src/main/js/apps/background-tasks/store/reducers.js
index 3774f5aebda..44cb08af7fd 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/store/reducers.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/store/reducers.js
@@ -40,8 +40,7 @@ export const initialState = {
// stats
pendingCount: 0,
- failingCount: 0,
- inProgressDuration: null
+ failingCount: 0
};
function updateTask (tasks, newTask) {
@@ -82,8 +81,7 @@ export default function (state = initialState, action) {
return {
...state,
pendingCount: action.pendingCount,
- failingCount: action.failingCount,
- inProgressDuration: action.inProgressDuration
+ failingCount: action.failingCount
};
case CANCEL_ALL_PENDING:
return {
diff --git a/server/sonar-web/tests/apps/background-tasks-test.js b/server/sonar-web/tests/apps/background-tasks-test.js
index 7e3a605f9ee..a684e26631c 100644
--- a/server/sonar-web/tests/apps/background-tasks-test.js
+++ b/server/sonar-web/tests/apps/background-tasks-test.js
@@ -152,26 +152,6 @@ describe('Background Tasks', function () {
expect(spy).to.have.been.called;
});
});
-
- describe('In Progress Duration', () => {
- it('should show duration', () => {
- let result = TestUtils.renderIntoDocument(<Stats inProgressDuration="173"/>),
- inProgressDuration = result.refs.inProgressDuration;
- expect(inProgressDuration.textContent).to.include('173ms');
- });
-
- it('should format duration', () => {
- let result = TestUtils.renderIntoDocument(<Stats inProgressDuration="1073"/>),
- inProgressDuration = result.refs.inProgressDuration;
- expect(inProgressDuration.textContent).to.include('1s');
- });
-
- it('should not show duration', () => {
- let result = TestUtils.renderIntoDocument(<Stats/>),
- inProgressDuration = result.refs.inProgressDuration;
- expect(inProgressDuration).to.not.be.ok;
- });
- });
});
describe('Helpers', () => {