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
iv
gitlab-ce
Commits
91880e13
Commit
91880e13
authored
Jan 20, 2016
by
Jacob Schatz
Committed by
Phil Hughes
Mar 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial ajax build
parent
fde975fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
8 deletions
+22
-8
app/assets/javascripts/merge_request_widget.js.coffee
app/assets/javascripts/merge_request_widget.js.coffee
+18
-6
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+2
-1
app/views/projects/merge_requests/widget/_show.html.haml
app/views/projects/merge_requests/widget/_show.html.haml
+2
-1
No files found.
app/assets/javascripts/merge_request_widget.js.coffee
View file @
91880e13
...
@@ -9,6 +9,7 @@ class @MergeRequestWidget
...
@@ -9,6 +9,7 @@ class @MergeRequestWidget
#
#
constructor
:
(
@
opts
)
->
constructor
:
(
@
opts
)
->
modal
=
$
(
'#modal_merge_info'
).
modal
(
show
:
false
)
modal
=
$
(
'#modal_merge_info'
).
modal
(
show
:
false
)
@
getBuildStatus
()
mergeInProgress
:
(
deleteSourceBranch
=
false
)
->
mergeInProgress
:
(
deleteSourceBranch
=
false
)
->
$
.
ajax
$
.
ajax
...
@@ -30,13 +31,24 @@ class @MergeRequestWidget
...
@@ -30,13 +31,24 @@ class @MergeRequestWidget
$
.
get
@
opts
.
url_to_automerge_check
,
(
data
)
->
$
.
get
@
opts
.
url_to_automerge_check
,
(
data
)
->
$
(
'.mr-state-widget'
).
replaceWith
(
data
)
$
(
'.mr-state-widget'
).
replaceWith
(
data
)
getBuildStatus
:
->
urlToCiCheck
=
@
opts
.
url_to_ci_check
ciEnabled
=
@
opts
.
ci_enable
console
.
log
(
ciEnabled
)
setInterval
(
->
if
ciEnabled
$
.
getJSON
urlToCiCheck
,
(
data
)
->
console
.
log
(
"data"
,
data
);
return
return
),
5000
getCiStatus
:
->
getCiStatus
:
->
if
@
opts
.
ci_enable
$
.
get
@
opts
.
url_to_ci_check
,
(
data
)
=>
$
.
get
@
opts
.
url_to_ci_check
,
(
data
)
=>
this
.
showCiState
data
.
status
this
.
showCiState
data
.
status
if
data
.
coverage
if
data
.
coverage
this
.
showCiCoverage
data
.
coverage
this
.
showCiCoverage
data
.
coverage
,
'json'
,
'json'
showCiState
:
(
state
)
->
showCiState
:
(
state
)
->
$
(
'.ci_widget'
).
hide
()
$
(
'.ci_widget'
).
hide
()
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
91880e13
...
@@ -228,7 +228,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -228,7 +228,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController
response
=
{
response
=
{
status:
status
,
status:
status
,
coverage:
coverage
coverage:
coverage
,
ci_status:
@merge_request
.
ci_commit
.
status
}
}
render
json:
response
render
json:
response
...
...
app/views/projects/merge_requests/widget/_show.html.haml
View file @
91880e13
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
check_enable
:
#{
@merge_request
.
unchecked?
?
"true"
:
"false"
}
,
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
:
"
#{
ci_status_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
}
"
,
ci_enable
:
#{
@project
.
ci_service
?
"true"
:
"false"
}
,
ci_enable
:
#{
@project
.
ci_service
?
"true"
:
"false"
}
,
current_status
:
"
#{
@merge_request
.
gitlab_merge_status
}
"
,
current_status
:
"
#{
@merge_request
.
gitlab_merge_status
}
"
});
});
var
cici
=
"
#{
@project
}
"
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