Commit b1bdd82992b5133e24154c8692e25e79049cd907
Exists in
master
and in
4 other branches
Merge pull request #4269 from dosire/scrum-view-for-milestone
Scrum view style milestone view.
Showing
6 changed files
with
18 additions
and
28 deletions
Show diff stats
app/assets/javascripts/milestones.js.coffee
1 | $ -> | 1 | $ -> |
2 | - $('.milestone-issue-filter li[data-closed]').addClass('hide') | ||
3 | - | ||
4 | - $('.milestone-issue-filter ul.nav li a').click -> | ||
5 | - $('.milestone-issue-filter li').toggleClass('active') | ||
6 | - $('.milestone-issue-filter li[data-closed]').toggleClass('hide') | ||
7 | - false | ||
8 | - | ||
9 | $('.milestone-merge-requests-filter li[data-closed]').addClass('hide') | 2 | $('.milestone-merge-requests-filter li[data-closed]').addClass('hide') |
10 | 3 | ||
11 | $('.milestone-merge-requests-filter ul.nav li a').click -> | 4 | $('.milestone-merge-requests-filter ul.nav li a').click -> |
app/models/issue.rb
@@ -28,6 +28,8 @@ class Issue < ActiveRecord::Base | @@ -28,6 +28,8 @@ class Issue < ActiveRecord::Base | ||
28 | scope :cared, ->(user) { where(assignee_id: user) } | 28 | scope :cared, ->(user) { where(assignee_id: user) } |
29 | scope :authored, ->(user) { where(author_id: user) } | 29 | scope :authored, ->(user) { where(author_id: user) } |
30 | scope :open_for, ->(user) { opened.assigned(user) } | 30 | scope :open_for, ->(user) { opened.assigned(user) } |
31 | + scope :assigned, -> { where("assignee_id IS NOT NULL") } | ||
32 | + scope :unassigned, -> { where("assignee_id IS NULL") } | ||
31 | 33 | ||
32 | state_machine :state, initial: :opened do | 34 | state_machine :state, initial: :opened do |
33 | event :close do | 35 | event :close do |
@@ -0,0 +1,10 @@ | @@ -0,0 +1,10 @@ | ||
1 | +.span6 | ||
2 | + .ui-box.milestone-issue-filter | ||
3 | + %h5.title= title | ||
4 | + %ul.well-list | ||
5 | + - issues.each do |issue| | ||
6 | + %li{data: {closed: issue.closed?}} | ||
7 | + = link_to [@project, issue] do | ||
8 | + %span.badge.badge-info ##{issue.id} | ||
9 | + – | ||
10 | + = link_to_gfm truncate(issue.title, length: 60), [@project, issue] | ||
0 | \ No newline at end of file | 11 | \ No newline at end of file |
app/views/milestones/show.html.haml
@@ -56,20 +56,11 @@ | @@ -56,20 +56,11 @@ | ||
56 | 56 | ||
57 | 57 | ||
58 | .row | 58 | .row |
59 | - .span6 | ||
60 | - .ui-box.milestone-issue-filter | ||
61 | - .title | ||
62 | - %ul.nav.nav-pills | ||
63 | - %li.active= link_to('Open Issues', '#') | ||
64 | - %li=link_to('All Issues', '#') | ||
65 | - %ul.well-list | ||
66 | - - @issues.each do |issue| | ||
67 | - %li{data: {closed: issue.closed?}} | ||
68 | - = link_to [@project, issue] do | ||
69 | - %span.badge.badge-info ##{issue.id} | ||
70 | - – | ||
71 | - = link_to_gfm truncate(issue.title, length: 60), [@project, issue] | 59 | + = render(partial: 'issues', locals: {title: 'Unstarted Issues (open and unassigned)', issues: @issues.opened.unassigned}) |
60 | + | ||
61 | + = render(partial: 'issues', locals: {title: 'Ongoing Issues (open and assigned)', issues: @issues.opened.assigned}) | ||
72 | 62 | ||
63 | +.row | ||
73 | .span6 | 64 | .span6 |
74 | .ui-box.milestone-merge-requests-filter | 65 | .ui-box.milestone-merge-requests-filter |
75 | .title | 66 | .title |
@@ -84,6 +75,8 @@ | @@ -84,6 +75,8 @@ | ||
84 | – | 75 | – |
85 | = link_to_gfm truncate(merge_request.title, length: 60), [@project, merge_request] | 76 | = link_to_gfm truncate(merge_request.title, length: 60), [@project, merge_request] |
86 | 77 | ||
78 | + = render(:partial => 'issues', locals: {title: 'Completed Issues (closed)', issues: @issues.closed}) | ||
79 | + | ||
87 | %hr | 80 | %hr |
88 | %h6 Participants: | 81 | %h6 Participants: |
89 | %div | 82 | %div |
features/project/issues/milestones.feature
@@ -22,5 +22,3 @@ Feature: Project Milestones | @@ -22,5 +22,3 @@ Feature: Project Milestones | ||
22 | Given the milestone has open and closed issues | 22 | Given the milestone has open and closed issues |
23 | And I click link "v2.2" | 23 | And I click link "v2.2" |
24 | Then I should see 3 issues | 24 | Then I should see 3 issues |
25 | - When I click link "All Issues" | ||
26 | - Then I should see 4 issues |
features/steps/project/project_milestones.rb
@@ -51,11 +51,5 @@ class ProjectMilestones < Spinach::FeatureSteps | @@ -51,11 +51,5 @@ class ProjectMilestones < Spinach::FeatureSteps | ||
51 | 51 | ||
52 | Then "I should see 3 issues" do | 52 | Then "I should see 3 issues" do |
53 | page.should have_selector('.milestone-issue-filter .well-list li', count: 4) | 53 | page.should have_selector('.milestone-issue-filter .well-list li', count: 4) |
54 | - page.should have_selector('.milestone-issue-filter .well-list li.hide', count: 1) | ||
55 | - end | ||
56 | - | ||
57 | - Then "I should see 4 issues" do | ||
58 | - page.should have_selector('.milestone-issue-filter .well-list li', count: 4) | ||
59 | - page.should_not have_selector('.milestone-issue-filter .well-list li.hide') | ||
60 | end | 54 | end |
61 | end | 55 | end |