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
Tatuya Kamada
gitlab-ce
Commits
2e839cee
Commit
2e839cee
authored
Jun 17, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed tests. Fixed overrided scope. Better usability for milestone view
parent
b1bdd829
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
68 additions
and
49 deletions
+68
-49
app/assets/javascripts/milestones.js.coffee
app/assets/javascripts/milestones.js.coffee
+0
-7
app/contexts/issues/list_context.rb
app/contexts/issues/list_context.rb
+1
-1
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+3
-1
app/models/issue.rb
app/models/issue.rb
+0
-2
app/views/milestones/_issues.html.haml
app/views/milestones/_issues.html.haml
+11
-10
app/views/milestones/_merge_request.html.haml
app/views/milestones/_merge_request.html.haml
+5
-0
app/views/milestones/show.html.haml
app/views/milestones/show.html.haml
+45
-25
features/steps/project/project_milestones.rb
features/steps/project/project_milestones.rb
+1
-1
features/steps/userteams/userteams.rb
features/steps/userteams/userteams.rb
+2
-2
No files found.
app/assets/javascripts/milestones.js.coffee
deleted
100644 → 0
View file @
b1bdd829
$
->
$
(
'.milestone-merge-requests-filter li[data-closed]'
).
addClass
(
'hide'
)
$
(
'.milestone-merge-requests-filter ul.nav li a'
).
click
->
$
(
'.milestone-merge-requests-filter li'
).
toggleClass
(
'active'
)
$
(
'.milestone-merge-requests-filter li[data-closed]'
).
toggleClass
(
'hide'
)
false
app/contexts/issues/list_context.rb
View file @
2e839cee
...
@@ -8,7 +8,7 @@ module Issues
...
@@ -8,7 +8,7 @@ module Issues
@issues
=
case
params
[
:status
]
@issues
=
case
params
[
:status
]
when
issues_filter
[
:all
]
then
@project
.
issues
when
issues_filter
[
:all
]
then
@project
.
issues
when
issues_filter
[
:closed
]
then
@project
.
issues
.
closed
when
issues_filter
[
:closed
]
then
@project
.
issues
.
closed
when
issues_filter
[
:to_me
]
then
@project
.
issues
.
assigned
(
current_user
)
when
issues_filter
[
:to_me
]
then
@project
.
issues
.
assigned
_to
(
current_user
)
when
issues_filter
[
:by_me
]
then
@project
.
issues
.
authored
(
current_user
)
when
issues_filter
[
:by_me
]
then
@project
.
issues
.
authored
(
current_user
)
else
@project
.
issues
.
opened
else
@project
.
issues
.
opened
end
end
...
...
app/models/concerns/issuable.rb
View file @
2e839cee
...
@@ -22,8 +22,10 @@ module Issuable
...
@@ -22,8 +22,10 @@ module Issuable
scope
:closed
,
->
{
with_state
(
:closed
)
}
scope
:closed
,
->
{
with_state
(
:closed
)
}
scope
:of_group
,
->
(
group
)
{
where
(
project_id:
group
.
project_ids
)
}
scope
:of_group
,
->
(
group
)
{
where
(
project_id:
group
.
project_ids
)
}
scope
:of_user_team
,
->
(
team
)
{
where
(
project_id:
team
.
project_ids
,
assignee_id:
team
.
member_ids
)
}
scope
:of_user_team
,
->
(
team
)
{
where
(
project_id:
team
.
project_ids
,
assignee_id:
team
.
member_ids
)
}
scope
:assigned
,
->
(
u
)
{
where
(
assignee_id:
u
.
id
)}
scope
:assigned
_to
,
->
(
u
)
{
where
(
assignee_id:
u
.
id
)}
scope
:recent
,
->
{
order
(
"created_at DESC"
)
}
scope
:recent
,
->
{
order
(
"created_at DESC"
)
}
scope
:assigned
,
->
{
where
(
"assignee_id IS NOT NULL"
)
}
scope
:unassigned
,
->
{
where
(
"assignee_id IS NULL"
)
}
delegate
:name
,
delegate
:name
,
:email
,
:email
,
...
...
app/models/issue.rb
View file @
2e839cee
...
@@ -28,8 +28,6 @@ class Issue < ActiveRecord::Base
...
@@ -28,8 +28,6 @@ class Issue < ActiveRecord::Base
scope
:cared
,
->
(
user
)
{
where
(
assignee_id:
user
)
}
scope
:cared
,
->
(
user
)
{
where
(
assignee_id:
user
)
}
scope
:authored
,
->
(
user
)
{
where
(
author_id:
user
)
}
scope
:authored
,
->
(
user
)
{
where
(
author_id:
user
)
}
scope
:open_for
,
->
(
user
)
{
opened
.
assigned
(
user
)
}
scope
:open_for
,
->
(
user
)
{
opened
.
assigned
(
user
)
}
scope
:assigned
,
->
{
where
(
"assignee_id IS NOT NULL"
)
}
scope
:unassigned
,
->
{
where
(
"assignee_id IS NULL"
)
}
state_machine
:state
,
initial: :opened
do
state_machine
:state
,
initial: :opened
do
event
:close
do
event
:close
do
...
...
app/views/milestones/_issues.html.haml
View file @
2e839cee
.span6
.ui-box
.ui-box.milestone-issue-filter
%h5
.title
=
title
%h5
.title
=
title
%ul
.well-list
%ul
.well-list
-
issues
.
each
do
|
issue
|
-
issues
.
each
do
|
issue
|
%li
{
data:
{
closed:
issue
.
closed?
}}
%li
=
link_to
[
@project
,
issue
]
do
=
link_to
[
@project
,
issue
]
do
%span
.badge.badge-info
##{issue.id}
%span
.badge
{
class:
issue
.
closed?
?
'badge-important'
:
'badge-info'
}
##{issue.id}
–
=
link_to_gfm
truncate
(
issue
.
title
,
length:
60
),
[
@project
,
issue
]
=
link_to_gfm
truncate
(
issue
.
title
,
length:
60
),
[
@project
,
issue
]
-
if
issue
.
assignee
.pull-right
=
image_tag
gravatar_icon
(
issue
.
assignee
.
email
,
16
),
class:
"avatar s16"
app/views/milestones/_merge_request.html.haml
0 → 100644
View file @
2e839cee
%li
=
link_to
[
@project
,
merge_request
]
do
%span
.badge.badge-info
##{merge_request.id}
–
=
link_to_gfm
truncate
(
merge_request
.
title
,
length:
60
),
[
@project
,
merge_request
]
app/views/milestones/show.html.haml
View file @
2e839cee
...
@@ -55,32 +55,52 @@
...
@@ -55,32 +55,52 @@
=
markdown
@milestone
.
description
=
markdown
@milestone
.
description
.row
%ul
.nav.nav-tabs
=
render
(
partial:
'issues'
,
locals:
{
title:
'Unstarted Issues (open and unassigned)'
,
issues:
@issues
.
opened
.
unassigned
})
%li
.active
=
link_to
'#tab-issues'
,
'data-toggle'
=>
'tab'
do
Issues
%span
.badge
=
@issues
.
count
%li
=
link_to
'#tab-merge-requests'
,
'data-toggle'
=>
'tab'
do
Merge Requests
%span
.badge
=
@merge_requests
.
count
%li
=
link_to
'#tab-participants'
,
'data-toggle'
=>
'tab'
do
Participants
%span
.badge
=
@users
.
count
=
render
(
partial:
'issues'
,
locals:
{
title:
'Ongoing Issues (open and assigned)'
,
issues:
@issues
.
opened
.
assigned
})
.row
.tab-content
.tab-pane.active
#tab-issues
.row
.span4
=
render
(
'issues'
,
title:
'Unstarted Issues (open and unassigned)'
,
issues:
@issues
.
opened
.
unassigned
)
.span4
=
render
(
'issues'
,
title:
'Ongoing Issues (open and assigned)'
,
issues:
@issues
.
opened
.
assigned
)
.span4
=
render
(
'issues'
,
title:
'Completed Issues (closed)'
,
issues:
@issues
.
closed
)
.tab-pane
#tab-merge-requests
.row
.span6
.span6
.ui-box.milestone-merge-requests-filter
.ui-box
.title
%h5
.title
Open
%ul
.nav.nav-pills
%li
.active
=
link_to
(
'Open Merge Requests'
,
'#'
)
%li
=
link_to
(
'All Merge Requests'
,
'#'
)
%ul
.well-list
%ul
.well-list
-
@merge_requests
.
each
do
|
merge_request
|
-
@merge_requests
.
opened
.
each
do
|
merge_request
|
%li
{
data:
{
closed:
merge_request
.
closed?
||
merge_request
.
merged?
}}
=
render
'merge_request'
,
merge_request:
merge_request
=
link_to
[
@project
,
merge_request
]
do
.span6
%span
.badge.badge-info
##{merge_request.id}
.ui-box
–
%h5
.title
Closed
=
link_to_gfm
truncate
(
merge_request
.
title
,
length:
60
),
[
@project
,
merge_request
]
%ul
.well-list
-
@merge_requests
.
closed
.
each
do
|
merge_request
|
=
render
(
:partial
=>
'issues'
,
locals:
{
title:
'Completed Issues (closed)'
,
issues:
@issues
.
closed
})
=
render
'merge_request'
,
merge_request:
merge_request
%hr
.tab-pane
#tab-participants
%h6
Participants:
%ul
.bordered-list
%div
-
@users
.
each
do
|
user
|
-
@users
.
each
do
|
user
|
=
link_to_member
(
@project
,
user
)
%li
=
link_to
user
,
title:
user
.
name
,
class:
"dark"
do
.clearfix
=
image_tag
gravatar_icon
(
user
.
email
,
32
),
class:
"avatar s32"
%strong
=
truncate
(
user
.
name
,
lenght:
40
)
%br
%small
.cgray
=
user
.
username
features/steps/project/project_milestones.rb
View file @
2e839cee
...
@@ -50,6 +50,6 @@ class ProjectMilestones < Spinach::FeatureSteps
...
@@ -50,6 +50,6 @@ class ProjectMilestones < Spinach::FeatureSteps
end
end
Then
"I should see 3 issues"
do
Then
"I should see 3 issues"
do
page
.
should
have_selector
(
'
.milestone-issue-filter .well-list
li'
,
count:
4
)
page
.
should
have_selector
(
'
#tab-issues
li'
,
count:
4
)
end
end
end
end
features/steps/userteams/userteams.rb
View file @
2e839cee
...
@@ -93,7 +93,7 @@ class Userteams < Spinach::FeatureSteps
...
@@ -93,7 +93,7 @@ class Userteams < Spinach::FeatureSteps
Then
'I should see issues from this team assigned to me'
do
Then
'I should see issues from this team assigned to me'
do
team
=
UserTeam
.
last
team
=
UserTeam
.
last
team
.
projects
.
each
do
|
project
|
team
.
projects
.
each
do
|
project
|
project
.
issues
.
assigned
(
current_user
).
each
do
|
issue
|
project
.
issues
.
assigned
_to
(
current_user
).
each
do
|
issue
|
page
.
should
have_content
issue
.
title
page
.
should
have_content
issue
.
title
end
end
end
end
...
@@ -121,7 +121,7 @@ class Userteams < Spinach::FeatureSteps
...
@@ -121,7 +121,7 @@ class Userteams < Spinach::FeatureSteps
team
=
UserTeam
.
last
team
=
UserTeam
.
last
team
.
projects
.
each
do
|
project
|
team
.
projects
.
each
do
|
project
|
team
.
members
.
each
do
|
member
|
team
.
members
.
each
do
|
member
|
project
.
issues
.
assigned
(
member
).
each
do
|
issue
|
project
.
issues
.
assigned
_to
(
member
).
each
do
|
issue
|
page
.
should
have_content
issue
.
title
page
.
should
have_content
issue
.
title
end
end
end
end
...
...
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