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
3bbe19d3
Commit
3bbe19d3
authored
Dec 20, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport moving MR widget CI JS out of script tag.
parent
0ba41ea1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
18 deletions
+30
-18
ci_bundle.js.es6
app/assets/javascripts/merge_request_widget/ci_bundle.js.es6
+24
-0
_accept.html.haml
...ews/projects/merge_requests/widget/open/_accept.html.haml
+3
-18
application.rb
config/application.rb
+3
-0
No files found.
app/assets/javascripts/merge_request_widget/ci_bundle.js.es6
0 → 100644
View file @
3bbe19d3
$(() => {
/* TODO: This needs a better home, or should be refactored. It was previously contained
* in a script tag in app/views/projects/merge_requests/widget/open/_accept.html.haml,
* but Vue chokes on script tags and prevents their execution. So it was moved here
* temporarily.
* */
$('.accept-mr-form').on('ajax:send', () => {
$('.accept-mr-form :input').disable();
});
$('.accept_merge_request').on('click', () => {
$('.js-merge-button').html('<i class="fa fa-spinner fa-spin"></i> Merge in progress');
});
$('.merge_when_build_succeeds').on('click', () => {
$('#merge_when_build_succeeds').val('1');
});
$('.js-merge-dropdown a').on('click', (e) => {
e.preventDefault();
$(this).closest('form').submit();
});
});
app/views/projects/merge_requests/widget/open/_accept.html.haml
View file @
3bbe19d3
-
content_for
:page_specific_javascripts
do
=
page_specific_javascript_tag
(
'merge_request_widget/ci_bundle.js'
)
-
status_class
=
@pipeline
?
" ci-
#{
@pipeline
.
status
}
"
:
nil
=
form_for
[
:merge
,
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
@merge_request
],
remote:
true
,
method: :post
,
html:
{
class:
'accept-mr-form js-quick-submit js-requires-input'
}
do
|
f
|
...
...
@@ -47,21 +50,3 @@
rows:
14
,
hint:
true
=
hidden_field_tag
:merge_when_build_succeeds
,
""
,
autocomplete:
"off"
:javascript
$
(
'.accept-mr-form'
).
on
(
'ajax:send'
,
function
()
{
$
(
".accept-mr-form :input"
).
disable
();
});
$
(
'.accept_merge_request'
).
on
(
'click'
,
function
()
{
$
(
'.js-merge-button'
).
html
(
"<i class='fa fa-spinner fa-spin'></i> Merge in progress"
);
});
$
(
'.merge_when_build_succeeds'
).
on
(
'click'
,
function
()
{
$
(
"#merge_when_build_succeeds"
).
val
(
"1"
);
});
$
(
'.js-merge-dropdown a'
).
on
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
this
).
closest
(
"form"
).
submit
();
});
config/application.rb
View file @
3bbe19d3
...
...
@@ -96,6 +96,9 @@ module Gitlab
config
.
assets
.
precompile
<<
"profile/profile_bundle.js"
config
.
assets
.
precompile
<<
"protected_branches/protected_branches_bundle.js"
config
.
assets
.
precompile
<<
"diff_notes/diff_notes_bundle.js"
config
.
assets
.
precompile
<<
"lib/vue_resource.js"
config
.
assets
.
precompile
<<
"merge_request_widget/ci_bundle.js"
config
.
assets
.
precompile
<<
"issuable/issuable_bundle.js"
config
.
assets
.
precompile
<<
"boards/boards_bundle.js"
config
.
assets
.
precompile
<<
"cycle_analytics/cycle_analytics_bundle.js"
config
.
assets
.
precompile
<<
"merge_conflicts/merge_conflicts_bundle.js"
...
...
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