aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/background-tasks/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/background-tasks/utils.js')
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/utils.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/utils.js b/server/sonar-web/src/main/js/apps/background-tasks/utils.js
index 97207fa9864..cf0c4c89b8b 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/utils.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/utils.js
@@ -17,13 +17,15 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+ /* @flow */
import { STATUSES, ALL_TYPES, CURRENTS } from './constants';
+import { Task } from './types';
-export function updateTask (tasks, newTask) {
+export function updateTask (tasks: Task[], newTask: Task) {
return tasks.map(task => task.id === newTask.id ? newTask : task);
}
-export function mapFiltersToParameters (filters = {}) {
+export function mapFiltersToParameters (filters: any = {}) {
const parameters = {};
if (filters.status === STATUSES.ALL) {
@@ -79,7 +81,7 @@ function format (int, suffix) {
return `${int}${suffix}`;
}
-export function formatDuration (value) {
+export function formatDuration (value: ?number) {
if (!value) {
return '';
}