BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
9306d8fc
Commit
9306d8fc
authored
Oct 28, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dashboard_issues_and_mr' into 'master'
Dashboard issues and merge request filters Fixes #1597 See merge request !1219
parents
eaebc20e
d3bdd3ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
4 deletions
+58
-4
issuable_finder.rb
app/finders/issuable_finder.rb
+5
-1
issues.rb
features/steps/dashboard/issues.rb
+10
-0
merge_requests.rb
features/steps/dashboard/merge_requests.rb
+43
-3
No files found.
app/finders/issuable_finder.rb
View file @
9306d8fc
...
...
@@ -48,7 +48,7 @@ class IssuableFinder
else
[]
end
elsif
current_user
&&
params
[
:authorized_only
].
presence
elsif
current_user
&&
params
[
:authorized_only
].
presence
&&
!
current_user_related?
klass
.
of_projects
(
current_user
.
authorized_projects
).
references
(
:project
)
else
klass
.
of_projects
(
ProjectsFinder
.
new
.
execute
(
current_user
)).
references
(
:project
)
...
...
@@ -142,4 +142,8 @@ class IssuableFinder
def
project
Project
.
where
(
id:
params
[
:project_id
]).
first
if
params
[
:project_id
].
present?
end
def
current_user_related?
params
[
:scope
]
==
'created-by-me'
||
params
[
:scope
]
==
'authored'
||
params
[
:scope
]
==
'assigned-to-me'
end
end
features/steps/dashboard/issues.rb
View file @
9306d8fc
...
...
@@ -10,6 +10,7 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
step
'I should see issues authored by me'
do
should_see
(
authored_issue
)
should_see
(
authored_issue_on_public_project
)
should_not_see
(
assigned_issue
)
should_not_see
(
other_issue
)
end
...
...
@@ -22,6 +23,7 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
step
'I have authored issues'
do
authored_issue
authored_issue_on_public_project
end
step
'I have assigned issues'
do
...
...
@@ -64,6 +66,10 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
@other_issue
||=
create
:issue
,
project:
project
end
def
authored_issue_on_public_project
@authored_issue_on_public_project
||=
create
:issue
,
author:
current_user
,
project:
public_project
end
def
project
@project
||=
begin
project
=
create
:project
...
...
@@ -71,4 +77,8 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
project
end
end
def
public_project
@public_project
||=
create
:project
,
:public
end
end
features/steps/dashboard/merge_requests.rb
View file @
9306d8fc
...
...
@@ -4,13 +4,17 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
step
'I should see merge requests assigned to me'
do
should_see
(
assigned_merge_request
)
should_see
(
assigned_merge_request_from_fork
)
should_not_see
(
authored_merge_request
)
should_not_see
(
authored_merge_request_from_fork
)
should_not_see
(
other_merge_request
)
end
step
'I should see merge requests authored by me'
do
should_see
(
authored_merge_request
)
should_see
(
authored_merge_request_from_fork
)
should_not_see
(
assigned_merge_request
)
should_not_see
(
assigned_merge_request_from_fork
)
should_not_see
(
other_merge_request
)
end
...
...
@@ -22,10 +26,12 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
step
'I have authored merge requests'
do
authored_merge_request
authored_merge_request_from_fork
end
step
'I have assigned merge requests'
do
assigned_merge_request
assigned_merge_request_from_fork
end
step
'I have other merge requests'
do
...
...
@@ -53,15 +59,41 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
end
def
assigned_merge_request
@assigned_merge_request
||=
create
:merge_request
,
assignee:
current_user
,
target_project:
project
,
source_project:
project
@assigned_merge_request
||=
create
:merge_request
,
assignee:
current_user
,
target_project:
project
,
source_project:
project
end
def
authored_merge_request
@authored_merge_request
||=
create
:merge_request
,
source_branch:
'simple_merge_request'
,
author:
current_user
,
target_project:
project
,
source_project:
project
@authored_merge_request
||=
create
:merge_request
,
source_branch:
'simple_merge_request'
,
author:
current_user
,
target_project:
project
,
source_project:
project
end
def
other_merge_request
@other_merge_request
||=
create
:merge_request
,
source_branch:
'2_3_notes_fix'
,
target_project:
project
,
source_project:
project
@other_merge_request
||=
create
:merge_request
,
source_branch:
'2_3_notes_fix'
,
target_project:
project
,
source_project:
project
end
def
authored_merge_request_from_fork
@authored_merge_request_from_fork
||=
create
:merge_request
,
source_branch:
'basic_page'
,
author:
current_user
,
target_project:
public_project
,
source_project:
forked_project
end
def
assigned_merge_request_from_fork
@assigned_merge_request_from_fork
||=
create
:merge_request
,
source_branch:
'basic_page_fix'
,
assignee:
current_user
,
target_project:
public_project
,
source_project:
forked_project
end
def
project
...
...
@@ -71,4 +103,12 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
project
end
end
def
public_project
@public_project
||=
create
:project
,
:public
end
def
forked_project
@forked_project
||=
Projects
::
ForkService
.
new
(
public_project
,
current_user
).
execute
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