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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
a8e4f3ed
Commit
a8e4f3ed
authored
Apr 16, 2012
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Auto-merge: 'already can not be merged' alert
parent
8269a3a7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
5 deletions
+25
-5
app/assets/javascripts/merge_requests.js
app/assets/javascripts/merge_requests.js
+7
-1
app/controllers/merge_requests_controller.rb
app/controllers/merge_requests_controller.rb
+6
-2
app/views/merge_requests/automerge.js.haml
app/views/merge_requests/automerge.js.haml
+7
-2
app/views/merge_requests/show.html.haml
app/views/merge_requests/show.html.haml
+5
-0
No files found.
app/assets/javascripts/merge_requests.js
View file @
a8e4f3ed
...
@@ -7,7 +7,7 @@ var MergeRequest = {
...
@@ -7,7 +7,7 @@ var MergeRequest = {
function
(
opts
)
{
function
(
opts
)
{
this
.
opts
=
opts
;
this
.
opts
=
opts
;
if
(
$
(
"
.automerge_widget
"
).
leng
ht
){
if
(
$
(
"
.automerge_widget
"
).
leng
th
){
$
.
get
(
opts
.
url_to_automerge_check
,
function
(
data
){
$
.
get
(
opts
.
url_to_automerge_check
,
function
(
data
){
$
(
"
.automerge_widget
"
).
hide
();
$
(
"
.automerge_widget
"
).
hide
();
$
(
"
.automerge_widget.
"
+
data
.
state
).
show
();
$
(
"
.automerge_widget.
"
+
data
.
state
).
show
();
...
@@ -48,5 +48,11 @@ var MergeRequest = {
...
@@ -48,5 +48,11 @@ var MergeRequest = {
$
(
'
.status
'
).
removeClass
(
"
loading
"
);
$
(
'
.status
'
).
removeClass
(
"
loading
"
);
},
},
dataType
:
"
script
"
});
dataType
:
"
script
"
});
},
already_cannot_be_merged
:
function
(){
$
(
"
.automerge_widget
"
).
hide
();
$
(
"
.automerge_widget.already_cannot_be_merged
"
).
show
();
}
}
}
}
app/controllers/merge_requests_controller.rb
View file @
a8e4f3ed
...
@@ -104,9 +104,13 @@ class MergeRequestsController < ApplicationController
...
@@ -104,9 +104,13 @@ class MergeRequestsController < ApplicationController
end
end
def
automerge
def
automerge
render_404
unless
@merge_request
.
open?
&&
@merge_request
.
can_be_merged?
return
access_denied!
unless
can?
(
current_user
,
:accept_mr
,
@project
)
return
access_denied!
unless
can?
(
current_user
,
:accept_mr
,
@project
)
if
@merge_request
.
open?
&&
@merge_request
.
can_be_merged?
@merge_request
.
automerge!
(
current_user
)
@merge_request
.
automerge!
(
current_user
)
@status
=
true
else
@status
=
false
end
end
end
def
destroy
def
destroy
...
...
app/views/merge_requests/automerge.js.haml
View file @
a8e4f3ed
:plain
-
if
@status
:plain
location.reload();
location.reload();
-
else
:plain
MergeRequest.already_cannot_be_merged()
app/views/merge_requests/show.html.haml
View file @
a8e4f3ed
...
@@ -72,6 +72,11 @@
...
@@ -72,6 +72,11 @@
%p
%p
%strong
Checking for ability to automatically merge…
%strong
Checking for ability to automatically merge…
.automerge_widget.already_cannot_be_merged
{
:style
=>
"display:none"
}
.alert-message
%p
%strong
This merge request already can not be merged
...
...
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