Closed #4763: Hide closed epics in user dashboard

stable
David Barragán Merino 2016-11-14 13:06:55 +01:00 committed by Alejandro Alonso
parent 5d09ba4629
commit 70eb8bba1a
2 changed files with 26 additions and 16 deletions

View File

@ -103,45 +103,55 @@ class HomeService extends taiga.Service
assignedTo = Immutable.Map() assignedTo = Immutable.Map()
params = { params_epics = {
status__is_closed: false status__is_closed: false
assigned_to: userId assigned_to: userId
} }
params_us = { params_uss = {
is_closed: false is_closed: false
assigned_to: userId assigned_to: userId
} }
params_epics = { params_tasks = {
is_closed: false status__is_closed: false
assigned_to: userId
}
params_issues = {
status__is_closed: false
assigned_to: userId assigned_to: userId
} }
assignedEpicsPromise = @rs.epics.listInAllProjects(params_epics).then (epics) -> assignedEpicsPromise = @rs.epics.listInAllProjects(params_epics).then (epics) ->
assignedTo = assignedTo.set("epics", 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) 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) 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) assignedTo = assignedTo.set("issues", issues)
params = { params_epics = {
status__is_closed: false status__is_closed: false
watchers: userId watchers: userId
} }
params_us = { params_uss = {
is_closed: false is_closed: false
watchers: userId watchers: userId
} }
params_epics = { params_tasks = {
is_closed: false status__is_closed: false
watchers: userId
}
params_issues = {
status__is_closed: false
watchers: userId watchers: userId
} }
@ -150,13 +160,13 @@ class HomeService extends taiga.Service
watchingEpicsPromise = @rs.epics.listInAllProjects(params_epics).then (epics) -> watchingEpicsPromise = @rs.epics.listInAllProjects(params_epics).then (epics) ->
watching = watching.set("epics", 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) 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) 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) watching = watching.set("issues", issues)
workInProgress = Immutable.Map() workInProgress = Immutable.Map()

View File

@ -87,7 +87,7 @@ describe "tgHome", ->
mocks.resources.epics.listInAllProjects mocks.resources.epics.listInAllProjects
.withArgs(sinon.match({ .withArgs(sinon.match({
is_closed: false status__is_closed: false
assigned_to: userId assigned_to: userId
})) }))
.promise() .promise()
@ -95,7 +95,7 @@ describe "tgHome", ->
mocks.resources.epics.listInAllProjects mocks.resources.epics.listInAllProjects
.withArgs(sinon.match({ .withArgs(sinon.match({
is_closed: false status__is_closed: false
watchers: userId watchers: userId
})) }))
.promise() .promise()