From 70eb8bba1a249545fae00267e01028dac663f65b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Mon, 14 Nov 2016 13:06:55 +0100 Subject: [PATCH] Closed #4763: Hide closed epics in user dashboard --- app/modules/home/home.service.coffee | 38 ++++++++++++++--------- app/modules/home/home.service.spec.coffee | 4 +-- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/app/modules/home/home.service.coffee b/app/modules/home/home.service.coffee index 862e6b68..f6a9e69b 100644 --- a/app/modules/home/home.service.coffee +++ b/app/modules/home/home.service.coffee @@ -103,45 +103,55 @@ class HomeService extends taiga.Service assignedTo = Immutable.Map() - params = { + params_epics = { status__is_closed: false assigned_to: userId } - params_us = { + params_uss = { is_closed: false assigned_to: userId } - params_epics = { - is_closed: false + params_tasks = { + status__is_closed: false + assigned_to: userId + } + + params_issues = { + status__is_closed: false assigned_to: userId } assignedEpicsPromise = @rs.epics.listInAllProjects(params_epics).then (epics) -> assignedTo = assignedTo.set("epics", epics) - assignedUserStoriesPromise = @rs.userstories.listInAllProjects(params_us).then (userstories) -> + assignedUserStoriesPromise = @rs.userstories.listInAllProjects(params_uss).then (userstories) -> assignedTo = assignedTo.set("userStories", userstories) - assignedTasksPromise = @rs.tasks.listInAllProjects(params).then (tasks) -> + assignedTasksPromise = @rs.tasks.listInAllProjects(params_tasks).then (tasks) -> assignedTo = assignedTo.set("tasks", tasks) - assignedIssuesPromise = @rs.issues.listInAllProjects(params).then (issues) -> + assignedIssuesPromise = @rs.issues.listInAllProjects(params_issues).then (issues) -> assignedTo = assignedTo.set("issues", issues) - params = { + params_epics = { status__is_closed: false watchers: userId } - params_us = { + params_uss = { is_closed: false watchers: userId } - params_epics = { - is_closed: false + params_tasks = { + status__is_closed: false + watchers: userId + } + + params_issues = { + status__is_closed: false watchers: userId } @@ -150,13 +160,13 @@ class HomeService extends taiga.Service watchingEpicsPromise = @rs.epics.listInAllProjects(params_epics).then (epics) -> watching = watching.set("epics", epics) - watchingUserStoriesPromise = @rs.userstories.listInAllProjects(params_us).then (userstories) -> + watchingUserStoriesPromise = @rs.userstories.listInAllProjects(params_uss).then (userstories) -> watching = watching.set("userStories", userstories) - watchingTasksPromise = @rs.tasks.listInAllProjects(params).then (tasks) -> + watchingTasksPromise = @rs.tasks.listInAllProjects(params_tasks).then (tasks) -> watching = watching.set("tasks", tasks) - watchingIssuesPromise = @rs.issues.listInAllProjects(params).then (issues) -> + watchingIssuesPromise = @rs.issues.listInAllProjects(params_issues).then (issues) -> watching = watching.set("issues", issues) workInProgress = Immutable.Map() diff --git a/app/modules/home/home.service.spec.coffee b/app/modules/home/home.service.spec.coffee index a547feb8..30f605b3 100644 --- a/app/modules/home/home.service.spec.coffee +++ b/app/modules/home/home.service.spec.coffee @@ -87,7 +87,7 @@ describe "tgHome", -> mocks.resources.epics.listInAllProjects .withArgs(sinon.match({ - is_closed: false + status__is_closed: false assigned_to: userId })) .promise() @@ -95,7 +95,7 @@ describe "tgHome", -> mocks.resources.epics.listInAllProjects .withArgs(sinon.match({ - is_closed: false + status__is_closed: false watchers: userId })) .promise()