Commit d137ce50 authored by Robert Speicher's avatar Robert Speicher Committed by Ruben Davila

Merge branch '21257-label-lists-should-shows-opened-or-closed-issues-with-that-label' into 'master'

Label list shows all issues (opened or closed) with that label

## What does this MR do?

Change the label list to shows all issues (opened or closed) with that label.

## What are the relevant issue numbers?

Closes #21257

See merge request !5991
parent 32a80b26
...@@ -65,11 +65,17 @@ v 8.11.2 ...@@ -65,11 +65,17 @@ v 8.11.2
v 8.11.3 (unreleased) v 8.11.3 (unreleased)
- Don't try to show merge conflict resolution info if a merge conflict contains non-UTF-8 characters - Don't try to show merge conflict resolution info if a merge conflict contains non-UTF-8 characters
v 8.11.2 (unreleased) v 8.11.3 (unreleased)
- Label list shows all issues (opened or closed) with that label
v 8.11.2
- Show "Create Merge Request" widget for push events to fork projects on the source project - Show "Create Merge Request" widget for push events to fork projects on the source project
v 8.11.1 v 8.11.1
- Pulled due to packaging error. - Pulled due to packaging error.
- Does not halt the GitHub import process when an error occurs
- Fix file links on project page when default view is Files !5933
- Change using size to use count and caching it for number of group members
v 8.11.0 v 8.11.0
- Use test coverage value from the latest successful pipeline in badge. !5862 - Use test coverage value from the latest successful pipeline in badge. !5862
......
...@@ -36,7 +36,12 @@ module Boards ...@@ -36,7 +36,12 @@ module Boards
end end
def set_state def set_state
params[:state] = list.done? ? 'closed' : 'opened' params[:state] =
case list.list_type.to_sym
when :backlog then 'opened'
when :done then 'closed'
else 'all'
end
end end
def board_label_ids def board_label_ids
......
...@@ -31,10 +31,9 @@ Below is a table of the definitions used for GitLab's Issue Board. ...@@ -31,10 +31,9 @@ Below is a table of the definitions used for GitLab's Issue Board.
There are three types of lists, the ones you create based on your labels, and There are three types of lists, the ones you create based on your labels, and
two default: two default:
- **Backlog** (default): shows all issues that do not fall in one of the other - **Backlog** (default): shows all opened issues that do not fall in one of the other lists. Always appears on the very left.
lists. Always appears on the very left. - **Done** (default): shows all closed issues that do not fall in one of the other lists. Always appears on the very right.
- **Done** (default): shows all closed issues. Always appears on the very right. - Label list: a list based on a label. It shows all opened or closed issues with that label.
- Label list: a list based on a label. It shows all issues with that label.
![GitLab Issue Board](img/issue_board.png) ![GitLab Issue Board](img/issue_board.png)
......
...@@ -30,7 +30,7 @@ describe Boards::Issues::ListService, services: true do ...@@ -30,7 +30,7 @@ describe Boards::Issues::ListService, services: true do
let!(:closed_issue1) { create(:labeled_issue, :closed, project: project, labels: [bug]) } let!(:closed_issue1) { create(:labeled_issue, :closed, project: project, labels: [bug]) }
let!(:closed_issue2) { create(:labeled_issue, :closed, project: project, labels: [p3]) } let!(:closed_issue2) { create(:labeled_issue, :closed, project: project, labels: [p3]) }
let!(:closed_issue3) { create(:issue, :closed, project: project) } let!(:closed_issue3) { create(:issue, :closed, project: project) }
let!(:closed_issue4) { create(:labeled_issue, :closed, project: project, labels: [p1]) } let!(:closed_issue4) { create(:labeled_issue, :closed, project: project, labels: [p1, development]) }
before do before do
project.team << [user, :developer] project.team << [user, :developer]
...@@ -58,15 +58,15 @@ describe Boards::Issues::ListService, services: true do ...@@ -58,15 +58,15 @@ describe Boards::Issues::ListService, services: true do
issues = described_class.new(project, user, params).execute issues = described_class.new(project, user, params).execute
expect(issues).to eq [closed_issue4, closed_issue2, closed_issue3, closed_issue1] expect(issues).to eq [closed_issue2, closed_issue3, closed_issue1]
end end
it 'returns opened issues that have label list applied when listing issues from a label list' do it 'returns opened/closed issues that have label list applied when listing issues from a label list' do
params = { id: list1.id } params = { id: list1.id }
issues = described_class.new(project, user, params).execute issues = described_class.new(project, user, params).execute
expect(issues).to eq [list1_issue3, list1_issue1, list1_issue2] expect(issues).to eq [closed_issue4, list1_issue3, list1_issue1, list1_issue2]
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment