Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
19e2bf1c
Commit
19e2bf1c
authored
Aug 22, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failing specs and improve html
parent
894bd04d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
15 deletions
+26
-15
CHANGELOG
CHANGELOG
+1
-3
app/assets/stylesheets/pages/milestone.scss
app/assets/stylesheets/pages/milestone.scss
+11
-0
app/helpers/milestones_helper.rb
app/helpers/milestones_helper.rb
+1
-1
app/views/shared/milestones/_milestone.html.haml
app/views/shared/milestones/_milestone.html.haml
+1
-1
spec/helpers/milestones_helper_spec.rb
spec/helpers/milestones_helper_spec.rb
+12
-10
No files found.
CHANGELOG
View file @
19e2bf1c
...
@@ -31,6 +31,7 @@ v 8.12.0 (unreleased)
...
@@ -31,6 +31,7 @@ v 8.12.0 (unreleased)
- Fix markdown anchor icon interaction (ClemMakesApps)
- Fix markdown anchor icon interaction (ClemMakesApps)
- Test migration paths from 8.5 until current release !4874
- Test migration paths from 8.5 until current release !4874
- Replace animateEmoji timeout with eventListener (ClemMakesApps)
- Replace animateEmoji timeout with eventListener (ClemMakesApps)
- Show badges in Milestone tabs. !5946 (Dan Rowden)
- Optimistic locking for Issues and Merge Requests (title and description overriding prevention)
- Optimistic locking for Issues and Merge Requests (title and description overriding prevention)
- Add `wiki_page_events` to project hook APIs (Ben Boeckel)
- Add `wiki_page_events` to project hook APIs (Ben Boeckel)
- Remove Gitorious import
- Remove Gitorious import
...
@@ -364,9 +365,6 @@ v 8.10.1
...
@@ -364,9 +365,6 @@ v 8.10.1
- Add links to the real markdown.md file for all GFM examples. !5458
- Add links to the real markdown.md file for all GFM examples. !5458
v 8.10.0
v 8.10.0
- Show badges in Milestone tabs
v 8.10.0 (unreleased)
- Fix profile activity heatmap to show correct day name (eanplatter)
- Fix profile activity heatmap to show correct day name (eanplatter)
- Speed up ExternalWikiHelper#get_project_wiki_path
- Speed up ExternalWikiHelper#get_project_wiki_path
- Expose {should,force}_remove_source_branch (Ben Boeckel)
- Expose {should,force}_remove_source_branch (Ben Boeckel)
...
...
app/assets/stylesheets/pages/milestone.scss
View file @
19e2bf1c
...
@@ -68,3 +68,14 @@
...
@@ -68,3 +68,14 @@
border-bottom
:
1px
solid
$border-color
;
border-bottom
:
1px
solid
$border-color
;
padding
:
20px
0
;
padding
:
20px
0
;
}
}
@media
(
max-width
:
$screen-sm-min
)
{
.milestone-actions
{
@include
clearfix
();
padding-top
:
$gl-vert-padding
;
.btn
:first-child
{
margin-left
:
0
;
}
}
}
app/helpers/milestones_helper.rb
View file @
19e2bf1c
...
@@ -50,7 +50,7 @@ module MilestonesHelper
...
@@ -50,7 +50,7 @@ module MilestonesHelper
# Show 'active' class if provided GET param matches check
# Show 'active' class if provided GET param matches check
# `or_blank` allows the function to return 'active' when given an empty param
# `or_blank` allows the function to return 'active' when given an empty param
# Could be refactored to be simpler but that may make it harder to read
# Could be refactored to be simpler but that may make it harder to read
def
milestone_class_for_state
(
param
,
check
,
match_blank_param
=
false
)
def
milestone_class_for_state
(
param
,
check
,
match_blank_param
=
false
)
if
match_blank_param
if
match_blank_param
'active'
if
param
.
blank?
||
param
==
check
'active'
if
param
.
blank?
||
param
==
check
else
else
...
...
app/views/shared/milestones/_milestone.html.haml
View file @
19e2bf1c
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
-
if
@project
-
if
@project
.row
.row
.col-sm-6
=
render
(
'shared/milestone_expired'
,
milestone:
milestone
)
.col-sm-6
=
render
(
'shared/milestone_expired'
,
milestone:
milestone
)
.col-sm-6
.col-sm-6
.milestone-actions
-
if
can?
(
current_user
,
:admin_milestone
,
milestone
.
project
)
and
milestone
.
active?
-
if
can?
(
current_user
,
:admin_milestone
,
milestone
.
project
)
and
milestone
.
active?
=
link_to
edit_namespace_project_milestone_path
(
milestone
.
project
.
namespace
,
milestone
.
project
,
milestone
),
class:
"btn btn-xs btn-grouped"
do
=
link_to
edit_namespace_project_milestone_path
(
milestone
.
project
.
namespace
,
milestone
.
project
,
milestone
),
class:
"btn btn-xs btn-grouped"
do
Edit
Edit
...
...
spec/helpers/milestones_helper_spec.rb
View file @
19e2bf1c
require
'spec_helper'
require
'spec_helper'
describe
MilestonesHelper
do
describe
MilestonesHelper
do
describe
'#milestone_counts'
do
describe
'#milestone_counts'
do
let
(
:project
)
{
FactoryGirl
.
create
(
:project
)
}
let
(
:project
)
{
FactoryGirl
.
create
(
:project
)
}
let
(
:milestone_1
)
{
FactoryGirl
.
create
(
:active_milestone
,
project:
project
)
}
let
!
(
:milestone_1
)
{
FactoryGirl
.
create
(
:active_milestone
,
project:
project
)
}
let
(
:milestone_2
)
{
FactoryGirl
.
create
(
:active_milestone
,
project:
project
)
}
let
!
(
:milestone_2
)
{
FactoryGirl
.
create
(
:active_milestone
,
project:
project
)
}
let
(
:milestone_3
)
{
FactoryGirl
.
create
(
:closed_milestone
,
project:
project
)
}
let
!
(
:milestone_3
)
{
FactoryGirl
.
create
(
:closed_milestone
,
project:
project
)
}
let
(
:counts
)
{
helper
.
milestone_counts
(
project
.
milestones
)
}
let
(
:counts
)
{
helper
.
milestone_counts
(
project
.
milestones
)
}
it
'returns a hash containing three items'
do
it
'returns a hash containing three items'
do
expect
(
counts
.
length
).
to
eq
3
expect
(
counts
.
length
).
to
eq
3
end
end
it
'returns a hash containing "opened" key'
do
it
'returns a hash containing "opened" key'
do
expect
(
counts
.
has_key?
(
:opened
)).
to
eq
true
expect
(
counts
.
has_key?
(
:opened
)).
to
eq
true
end
end
it
'returns a hash containing "closed" key'
do
it
'returns a hash containing "closed" key'
do
expect
(
counts
.
has_key?
(
:closed
)).
to
eq
true
expect
(
counts
.
has_key?
(
:closed
)).
to
eq
true
end
end
it
'returns a hash containing "all" key'
do
it
'returns a hash containing "all" key'
do
expect
(
counts
.
has_key?
(
:all
)).
to
eq
true
expect
(
counts
.
has_key?
(
:all
)).
to
eq
true
end
end
# 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
# it 'shows "all" object is the sum of "opened" and "closed" objects' do
# total = counts[:opened] + counts[:closed]
# expect(counts[:all]).to eq total
# end
it
'shows "all" object is the sum of "opened" and "closed" objects'
do
puts
counts
.
as_json
total
=
counts
[
:opened
]
+
counts
[
:closed
]
expect
(
counts
[
:all
]).
to
eq
total
end
end
end
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment