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
c5802385
Commit
c5802385
authored
Jul 27, 2017
by
Tim Zallmann
Committed by
Phil Hughes
Jul 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inline JS Removal for Merge Requests
parent
6e2ebfa2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
27 deletions
+27
-27
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+19
-0
app/assets/javascripts/how_to_merge.js
app/assets/javascripts/how_to_merge.js
+2
-2
app/views/projects/merge_requests/creations/_new_compare.html.haml
.../projects/merge_requests/creations/_new_compare.html.haml
+1
-8
app/views/projects/merge_requests/creations/_new_submit.html.haml
...s/projects/merge_requests/creations/_new_submit.html.haml
+1
-6
app/views/projects/merge_requests/show.html.haml
app/views/projects/merge_requests/show.html.haml
+4
-11
No files found.
app/assets/javascripts/dispatcher.js
View file @
c5802385
...
...
@@ -20,6 +20,8 @@
/* global NamespaceSelects */
/* global Project */
/* global ProjectAvatar */
/* global MergeRequest */
/* global Compare */
/* global CompareAutocomplete */
/* global ProjectNew */
/* global ProjectShow */
...
...
@@ -221,6 +223,19 @@ import PerformanceBar from './performance_bar';
new
gl
.
IssuableTemplateSelectors
();
break
;
case
'
projects:merge_requests:creations:new
'
:
const
mrNewCompareNode
=
document
.
querySelector
(
'
.js-merge-request-new-compare
'
);
if
(
mrNewCompareNode
)
{
new
Compare
({
targetProjectUrl
:
mrNewCompareNode
.
dataset
.
targetProjectUrl
,
sourceBranchUrl
:
mrNewCompareNode
.
dataset
.
sourceBranchUrl
,
targetBranchUrl
:
mrNewCompareNode
.
dataset
.
targetBranchUrl
,
});
}
else
{
const
mrNewSubmitNode
=
document
.
querySelector
(
'
.js-merge-request-new-submit
'
);
new
MergeRequest
({
action
:
mrNewSubmitNode
.
dataset
.
mrSubmitAction
,
});
}
case
'
projects:merge_requests:creations:diffs
'
:
case
'
projects:merge_requests:edit
'
:
new
gl
.
Diff
();
...
...
@@ -257,6 +272,10 @@ import PerformanceBar from './performance_bar';
new
gl
.
Diff
();
shortcut_handler
=
new
ShortcutsIssuable
(
true
);
new
ZenMode
();
const
mrShowNode
=
document
.
querySelector
(
'
.merge-request
'
);
window
.
mergeRequest
=
new
MergeRequest
({
action
:
mrShowNode
.
dataset
.
mrAction
,
});
break
;
case
'
dashboard:activity
'
:
new
gl
.
Activities
();
...
...
app/assets/javascripts/how_to_merge.js
View file @
c5802385
...
...
@@ -3,10 +3,10 @@ document.addEventListener('DOMContentLoaded', () => {
modal
:
true
,
show
:
false
,
});
$
(
'
.how_to_merge_link
'
).
bind
(
'
click
'
,
()
=>
{
$
(
'
.how_to_merge_link
'
).
on
(
'
click
'
,
()
=>
{
modal
.
show
();
});
$
(
'
.modal-header .close
'
).
bind
(
'
click
'
,
()
=>
{
$
(
'
.modal-header .close
'
).
on
(
'
click
'
,
()
=>
{
modal
.
hide
();
});
});
app/views/projects/merge_requests/creations/_new_compare.html.haml
View file @
c5802385
...
...
@@ -3,7 +3,7 @@
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
@merge_request
],
url:
project_new_merge_request_path
(
@project
),
method: :get
,
html:
{
class:
"merge-request-form form-inline js-requires-input"
}
do
|
f
|
.hide.alert.alert-danger.mr-compare-errors
.merge-request-branches.
row
.merge-request-branches.
js-merge-request-new-compare.row
{
'data-target-project-url'
:
project_new_merge_request_update_branches_path
(
@source_project
),
'data-source-branch-url'
:
project_new_merge_request_branch_from_path
(
@source_project
),
'data-target-branch-url'
:
project_new_merge_request_branch_to_path
(
@source_project
)
}
.col-md-6
.panel.panel-default.panel-new-merge-request
.panel-heading
...
...
@@ -66,10 +66,3 @@
-
if
@merge_request
.
errors
.
any?
=
form_errors
(
@merge_request
)
=
f
.
submit
'Compare branches and continue'
,
class:
"btn btn-new mr-compare-btn"
:javascript
new
Compare
({
targetProjectUrl
:
"
#{
project_new_merge_request_update_branches_path
(
@source_project
)
}
"
,
sourceBranchUrl
:
"
#{
project_new_merge_request_branch_from_path
(
@source_project
)
}
"
,
targetBranchUrl
:
"
#{
project_new_merge_request_branch_to_path
(
@source_project
)
}
"
});
app/views/projects/merge_requests/creations/_new_submit.html.haml
View file @
c5802385
...
...
@@ -17,7 +17,7 @@
=
f
.
hidden_field
:target_project_id
=
f
.
hidden_field
:target_branch
.mr-compare.merge-request
.mr-compare.merge-request
.js-merge-request-new-submit
{
'data-mr-submit-action'
:
"#{j params[:tab].presence || 'new'}"
}
-
if
@commits
.
empty?
.commits-empty
%h4
...
...
@@ -50,8 +50,3 @@
.mr-loading-status
=
spinner
:javascript
var
merge_request
=
new
MergeRequest
({
action
:
"
#{
j
params
[
:tab
].
presence
||
'new'
}
"
,
});
app/views/projects/merge_requests/show.html.haml
View file @
c5802385
...
...
@@ -3,10 +3,10 @@
-
page_description
@merge_request
.
description
-
page_card_attributes
@merge_request
.
card_attributes
-
content_for
:page_specific_javascripts
do
=
page_specific_javascript
_bundle_tag
(
'common_vue'
)
=
page_specific_javascript
_bundle_tag
(
'diff_notes'
)
=
webpack
_bundle_tag
(
'common_vue'
)
=
webpack
_bundle_tag
(
'diff_notes'
)
.merge-request
{
'data-url'
=>
merge_request_path
(
@merge_request
,
format: :json
),
'data-project-path'
=>
project_path
(
@merge_request
.
project
)
}
.merge-request
{
'data-
mr-action'
:
"#{j params[:tab].presence || 'show'}"
,
'data-
url'
=>
merge_request_path
(
@merge_request
,
format: :json
),
'data-project-path'
=>
project_path
(
@merge_request
.
project
)
}
=
render
"projects/merge_requests/mr_title"
.merge-request-details.issuable-details
{
data:
{
id:
@merge_request
.
project
.
id
}
}
...
...
@@ -15,13 +15,13 @@
-
if
@merge_request
.
source_branch_exists?
=
render
"projects/merge_requests/how_to_merge"
-# haml-lint:disable InlineJavaScript
:javascript
window
.
gl
.
mrWidgetData
=
#{
serialize_issuable
(
@merge_request
)
}
#js-vue-mr-widget
.mr-widget
-
content_for
:page_specific_javascripts
do
=
webpack_bundle_tag
'common_vue'
=
webpack_bundle_tag
'vue_merge_request_widget'
.content-block.content-block-small.emoji-list-container
...
...
@@ -88,10 +88,3 @@
=
render
"projects/commit/change"
,
type:
'revert'
,
commit:
@merge_request
.
merge_commit
,
title:
@merge_request
.
title
-
if
@merge_request
.
can_be_cherry_picked?
=
render
"projects/commit/change"
,
type:
'cherry-pick'
,
commit:
@merge_request
.
merge_commit
,
title:
@merge_request
.
title
:javascript
$
(
function
()
{
window
.
mergeRequest
=
new
MergeRequest
({
action
:
"
#{
j
params
[
:tab
].
presence
||
'show'
}
"
,
});
});
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