Milestone tab badges
What does this MR do?
Adds count badges to the tabs on the Milestone page to mirror the Issue page.
Are there points in the code the reviewer needs to double check?
CSS: Padding was added to the .milestone
element to make expired milestones look good.
Why was this MR needed?
For consistency with other tabs
What are the relevant issue numbers?
Closes #20114 (closed)
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
CHANGELOG entry added -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the style guides -
Branch has no merge conflicts with master
(if you do - rebase it please) -
Squashed related commits together
Merge request reports
Activity
mentioned in merge request !5425 (closed)
Added 1 commit:
- 3b899ee9 - Update CHANGELOG
Added 1 commit:
- 326a6ae4 - Update CHANGELOG
Added 13 commits:
-
326a6ae4...148b8487 - 4 commits from branch
master
- d93c4264 - Show badges in Milestone tabs and padding in Milestone list (both to match Issues page)
- e73421c9 - Changeling
- 9f2cf232 - Improved milestone counts with a single query
- 49ddf2ee - Use newer hash style
- 8fca4111 - Updated milestone count helper plus tests
- 385904ac - Take out of /dashboard/milestones as the helper query clashes with kaminari arrays
- 88a5286b - Added a small helper to reduce logic in the view
- 8694919c - Update CHANGELOG
- ef30be13 - Add paddings to milestone action buttons on mobile
Toggle commit list-
326a6ae4...148b8487 - 4 commits from branch
Added 1 commit:
- 6acc97fa - Update CHANGELOG
Added 1 commit:
- f1a5cc69 - Add space to make rubocop happy
mentioned in merge request !5921 (closed)
- spec/helpers/milestones_helper_spec.rb 0 → 100644
10 11 let(:counts) { helper.milestone_counts(project.milestones) } 12 13 it 'returns a hash containing three items' do 14 expect(counts.length).to eq 3 15 end 16 it 'returns a hash containing "opened" key' do 17 expect(counts.has_key?(:opened)).to eq true 18 end 19 it 'returns a hash containing "closed" key' do 20 expect(counts.has_key?(:closed)).to eq true 21 end 22 it 'returns a hash containing "all" key' do 23 expect(counts.has_key?(:all)).to eq true 24 end 25 # This throws a "NoMethodError: undefined method `+' for nil:NilClass" error for line 27; can't figure out why it can't find the keys in the hash This is because
milestone_{1,2,3}
are declared withlet
and so haven't been loaded, so there are no milestones. That's good, though - it means this doesn't handle nils properly! I think the specs in the other MR to implement this are also nicer, so we should have some with and without milestones: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5921@smcgivern I forgot to push a fix I did for this last night. I fixed it by creating the milestones with
let!
does that work for you?Edited by username-removed-408881@smcgivern can we have a backend developer to take care of that missing spec? I'm not sure how to update the helper for the case when no milestones are in the project :)
@alfredo1 I'm an idiot and reviewed https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5921, forgetting about the previous implementation of this. I think this one's the one to stick with, as it runs two fewer queries and you've been kind enough to pick it up.
Do you know why this one needed CSS changes and the other one didn't?
@smcgivern here are two screenshots showing the CSS fixes
When milestones were expired the elements did not looked good with the gray background
Thanks @alfredo! That makes sense.
Added 1 commit:
- cba658c5 - Fix failing specs
Added 1 commit:
- 1f49f28f - Ensure milestone counts work with no data
Added 47 commits:
-
1f49f28f...55de9cc8 - 35 commits from branch
master
- ae3a2859 - Show badges in Milestone tabs and padding in Milestone list (both to match Issues page)
- 4b2f285b - Changeling
- 291e486d - Improved milestone counts with a single query
- 6c5e1011 - Use newer hash style
- 4801bfe7 - Updated milestone count helper plus tests
- 3d9e457e - Take out of /dashboard/milestones as the helper query clashes with kaminari arrays
- 7786fdfb - Added a small helper to reduce logic in the view
- b9e43392 - Update CHANGELOG
- f9ed521a - Add paddings to milestone action buttons on mobile
- 6a2eab44 - Update CHANGELOG
- b71f9245 - Add space to make rubocop happy
- 2e104b98 - Fix failing specs
Toggle commit list-
1f49f28f...55de9cc8 - 35 commits from branch
Added 1 commit:
- 5b3f41cc - Update CHANGELOG
@smcgivern does the backend part look good to you? so I can assign to a frontend endboss to review the frontend part.
@alfredo1 sorry, yes it does! It looks like @jschatz1 is the only frontend endboss (too many 'end's!) around this week so I'll assign to him.
Reassigned to @jschatz1