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
Kazuhiko Shiozaki
gitlab-ce
Commits
7a7ce701
Commit
7a7ce701
authored
May 19, 2015
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the user list from the target project in a merge request
Closes #1535
parent
2b1b026a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
5 deletions
+34
-5
CHANGELOG
CHANGELOG
+1
-0
app/helpers/selects_helper.rb
app/helpers/selects_helper.rb
+3
-2
app/views/projects/_issuable_form.html.haml
app/views/projects/_issuable_form.html.haml
+2
-2
app/views/projects/merge_requests/show/_context.html.haml
app/views/projects/merge_requests/show/_context.html.haml
+1
-1
features/project/forked_merge_requests.feature
features/project/forked_merge_requests.feature
+12
-0
features/steps/project/forked_merge_requests.rb
features/steps/project/forked_merge_requests.rb
+15
-0
No files found.
CHANGELOG
View file @
7a7ce701
...
@@ -5,6 +5,7 @@ v 7.12.0 (unreleased)
...
@@ -5,6 +5,7 @@ v 7.12.0 (unreleased)
- Disabled expansion of top/bottom blobs for new file diffs
- Disabled expansion of top/bottom blobs for new file diffs
- Update Asciidoctor gem to version 1.5.2. (Jakub Jirutka)
- Update Asciidoctor gem to version 1.5.2. (Jakub Jirutka)
- Fix resolving of relative links to repository files in AsciiDoc documents. (Jakub Jirutka)
- Fix resolving of relative links to repository files in AsciiDoc documents. (Jakub Jirutka)
- Use the user list from the target project in a merge request (Stan Hu)
v 7.11.0 (unreleased)
v 7.11.0 (unreleased)
- Fall back to Plaintext when Syntaxhighlighting doesn't work. Fixes some buggy lexers (Hannes Rosenögger)
- Fall back to Plaintext when Syntaxhighlighting doesn't work. Fixes some buggy lexers (Hannes Rosenögger)
...
...
app/helpers/selects_helper.rb
View file @
7a7ce701
...
@@ -10,6 +10,7 @@ module SelectsHelper
...
@@ -10,6 +10,7 @@ module SelectsHelper
any_user
=
opts
[
:any_user
]
||
false
any_user
=
opts
[
:any_user
]
||
false
email_user
=
opts
[
:email_user
]
||
false
email_user
=
opts
[
:email_user
]
||
false
first_user
=
opts
[
:first_user
]
&&
current_user
?
current_user
.
username
:
false
first_user
=
opts
[
:first_user
]
&&
current_user
?
current_user
.
username
:
false
project
=
opts
[
:project
]
||
@project
html
=
{
html
=
{
class:
css_class
,
class:
css_class
,
...
@@ -21,8 +22,8 @@ module SelectsHelper
...
@@ -21,8 +22,8 @@ module SelectsHelper
}
}
unless
opts
[
:scope
]
==
:all
unless
opts
[
:scope
]
==
:all
if
@
project
if
project
html
[
'data-project-id'
]
=
@
project
.
id
html
[
'data-project-id'
]
=
project
.
id
elsif
@group
elsif
@group
html
[
'data-group-id'
]
=
@group
.
id
html
[
'data-group-id'
]
=
@group
.
id
end
end
...
...
app/views/projects/_issuable_form.html.haml
View file @
7a7ce701
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
This merge request is marked a
<strong>
Work In Progress
</strong>
.
This merge request is marked a
<strong>
Work In Progress
</strong>
.
When it's ready, remove the
<code>
WIP
</code>
prefix from the title to allow it to be accepted.
When it's ready, remove the
<code>
WIP
</code>
prefix from the title to allow it to be accepted.
-
else
-
else
To prevent this merge request from being accepted before it's ready,
To prevent this merge request from being accepted before it's ready,
mark it a
<strong>
Work In Progress
</strong>
by starting the title with
<code>
[WIP]
</code>
or
<code>
WIP:
</code>
.
mark it a
<strong>
Work In Progress
</strong>
by starting the title with
<code>
[WIP]
</code>
or
<code>
WIP:
</code>
.
.form-group.issuable-description
.form-group.issuable-description
=
f
.
label
:description
,
'Description'
,
class:
'control-label'
=
f
.
label
:description
,
'Description'
,
class:
'control-label'
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
.col-sm-10
.col-sm-10
=
users_select_tag
(
"
#{
issuable
.
class
.
model_name
.
param_key
}
[assignee_id]"
,
=
users_select_tag
(
"
#{
issuable
.
class
.
model_name
.
param_key
}
[assignee_id]"
,
placeholder:
'Select a user'
,
class:
'custom-form-control'
,
null_user:
true
,
placeholder:
'Select a user'
,
class:
'custom-form-control'
,
null_user:
true
,
selected:
issuable
.
assignee_id
)
selected:
issuable
.
assignee_id
,
project:
@target_project
||
@project
)
=
link_to
'Assign to me'
,
'#'
,
class:
'btn assign-to-me-link'
=
link_to
'Assign to me'
,
'#'
,
class:
'btn assign-to-me-link'
.form-group
.form-group
...
...
app/views/projects/merge_requests/show/_context.html.haml
View file @
7a7ce701
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
none
none
.issuable-context-selectbox
.issuable-context-selectbox
-
if
can?
(
current_user
,
:modify_merge_request
,
@merge_request
)
-
if
can?
(
current_user
,
:modify_merge_request
,
@merge_request
)
=
users_select_tag
(
'merge_request[assignee_id]'
,
placeholder:
'Select assignee'
,
class:
'custom-form-control js-select2 js-assignee'
,
selected:
@merge_request
.
assignee_id
,
null_user:
true
)
=
users_select_tag
(
'merge_request[assignee_id]'
,
placeholder:
'Select assignee'
,
class:
'custom-form-control js-select2 js-assignee'
,
selected:
@merge_request
.
assignee_id
,
project:
@target_project
,
null_user:
true
)
%div
.prepend-top-20.clearfix
%div
.prepend-top-20.clearfix
.issuable-context-title
.issuable-context-title
...
...
features/project/forked_merge_requests.feature
View file @
7a7ce701
...
@@ -38,3 +38,15 @@ Feature: Project Forked Merge Requests
...
@@ -38,3 +38,15 @@ Feature: Project Forked Merge Requests
Given
I visit project
"Forked Shop"
merge requests page
Given
I visit project
"Forked Shop"
merge requests page
And
I click link
"New Merge Request"
And
I click link
"New Merge Request"
Then
the target repository should be the original repository
Then
the target repository should be the original repository
@javascript
Scenario
:
I
see the users in the target project for a new merge request
Given
I logout
And
I sign in as an admin
And
I have a project forked off of
"Shop"
called
"Forked Shop"
Then
I visit project
"Forked Shop"
merge requests page
And
I click link
"New Merge Request"
And
I fill out a
"Merge Request On Forked Project"
merge request
When
I click
"Assign to"
dropdown"
Then
I should see the target project ID in the input selector
And
I should see the users from the target project ID
features/steps/project/forked_merge_requests.rb
View file @
7a7ce701
...
@@ -128,6 +128,21 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
...
@@ -128,6 +128,21 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
page
.
should
have_select
(
"merge_request_target_project_id"
,
selected:
@project
.
path_with_namespace
)
page
.
should
have_select
(
"merge_request_target_project_id"
,
selected:
@project
.
path_with_namespace
)
end
end
step
'I click "Assign to" dropdown"'
do
first
(
'.ajax-users-select'
).
click
end
step
'I should see the target project ID in the input selector'
do
expect
(
page
).
to
have_selector
(
"input[data-project-id=
\"
#{
@project
.
id
}
\"
]"
)
end
step
'I should see the users from the target project ID'
do
expect
(
page
).
to
have_selector
(
'.user-result'
,
visible:
true
,
count:
2
)
users
=
page
.
all
(
'.user-name'
)
users
[
0
].
text
.
should
==
'Unassigned'
users
[
1
].
text
.
should
==
@project
.
users
.
first
.
name
end
# Verify a link is generated against the correct project
# Verify a link is generated against the correct project
def
verify_commit_link
(
container_div
,
container_project
)
def
verify_commit_link
(
container_div
,
container_project
)
# This should force a wait for the javascript to execute
# This should force a wait for the javascript to execute
...
...
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