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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
51ceb380
Commit
51ceb380
authored
Jan 21, 2016
by
Jacob Schatz
Committed by
Phil Hughes
Mar 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds JSON callback, which is currently not working.
parent
91880e13
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
10 deletions
+16
-10
app/assets/javascripts/merge_request_widget.js.coffee
app/assets/javascripts/merge_request_widget.js.coffee
+5
-7
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+9
-2
app/views/projects/merge_requests/widget/_show.html.haml
app/views/projects/merge_requests/widget/_show.html.haml
+1
-1
config/routes.rb
config/routes.rb
+1
-0
No files found.
app/assets/javascripts/merge_request_widget.js.coffee
View file @
51ceb380
...
...
@@ -33,15 +33,13 @@ class @MergeRequestWidget
getBuildStatus
:
->
urlToCiCheck
=
@
opts
.
url_to_ci_check
ciEnabled
=
@
opts
.
ci_enable
console
.
log
(
ciEnabled
)
console
.
log
(
'checking'
)
setInterval
(
->
if
ciEnabled
$
.
getJSON
urlToCiCheck
,
(
data
)
->
console
.
log
(
"data"
,
data
);
return
$
.
getJSON
urlToCiCheck
,
(
data
)
->
console
.
log
(
"data"
,
data
);
return
),
5000
return
),
5000
getCiStatus
:
->
$
.
get
@
opts
.
url_to_ci_check
,
(
data
)
=>
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
51ceb380
...
...
@@ -218,6 +218,14 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
end
def
st
@ci_commit
=
@merge_request
.
ci_commit
@statuses
=
@ci_commit
.
statuses
if
@ci_commit
render
json:
{
statuses:
@statuses
}
end
def
ci_status
ci_service
=
@merge_request
.
source_project
.
ci_service
status
=
ci_service
.
commit_status
(
merge_request
.
last_commit
.
sha
,
merge_request
.
source_branch
)
...
...
@@ -228,8 +236,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
response
=
{
status:
status
,
coverage:
coverage
,
ci_status:
@merge_request
.
ci_commit
.
status
coverage:
coverage
}
render
json:
response
...
...
app/views/projects/merge_requests/widget/_show.html.haml
View file @
51ceb380
...
...
@@ -13,7 +13,7 @@
merge_request_widget
=
new
MergeRequestWidget
({
url_to_automerge_check
:
"
#{
merge_check_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
}
"
,
check_enable
:
#{
@merge_request
.
unchecked?
?
"true"
:
"false"
}
,
url_to_ci_check
:
"
#{
ci_status
_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
}
"
,
url_to_ci_check
:
"
#{
st
_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
}
"
,
ci_enable
:
#{
@project
.
ci_service
?
"true"
:
"false"
}
,
current_status
:
"
#{
@merge_request
.
gitlab_merge_status
}
"
});
...
...
config/routes.rb
View file @
51ceb380
...
...
@@ -620,6 +620,7 @@ Rails.application.routes.draw do
post
:merge
post
:cancel_merge_when_build_succeeds
get
:ci_status
get
:st
post
:toggle_subscription
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