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
580220c6
Commit
580220c6
authored
Dec 21, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'backport-mr-widget-ci-js' into 'master'
Backport moving MR widget CI JS out of script tag See merge request !8200
parents
f3f42f7b
27c613cb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
24 deletions
+49
-24
ci_bundle.js.es6
app/assets/javascripts/merge_request_widget/ci_bundle.js.es6
+42
-0
_accept.html.haml
...ews/projects/merge_requests/widget/open/_accept.html.haml
+3
-18
_check.html.haml
...iews/projects/merge_requests/widget/open/_check.html.haml
+3
-6
application.rb
config/application.rb
+1
-0
No files found.
app/assets/javascripts/merge_request_widget/ci_bundle.js.es6
0 → 100644
View file @
580220c6
/* global merge_request_widget */
(() => {
$(() => {
/* 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.
* */
if ($('.accept-mr-form').length) {
$('.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();
});
} else if ($('.rebase-in-progress').length) {
merge_request_widget.rebaseInProgress();
} else if ($('.rebase-mr-form').length) {
$('.rebase-mr-form').on('ajax:send', () => {
$('.rebase-mr-form :input').disable();
});
$('.js-rebase-button').on('click', () => {
$('.js-rebase-button').html("<i class='fa fa-spinner fa-spin'></i> Rebase in progress");
});
} else {
merge_request_widget.getMergeStatus();
}
});
})();
app/views/projects/merge_requests/widget/open/_accept.html.haml
View file @
580220c6
-
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
();
});
app/views/projects/merge_requests/widget/open/_check.html.haml
View file @
580220c6
-
content_for
:page_specific_javascripts
do
=
page_specific_javascript_tag
(
'merge_request_widget/ci_bundle.js'
)
%strong
=
icon
(
"spinner spin"
)
Checking ability to merge automatically
…
:javascript
$
(
function
()
{
merge_request_widget
.
getMergeStatus
();
});
config/application.rb
View file @
580220c6
...
...
@@ -96,6 +96,7 @@ 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
<<
"merge_request_widget/ci_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