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
22ce76d4
Commit
22ce76d4
authored
8 years ago
by
Ruben Davila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor to mark Changes tab as active on new MR page.
parent
bac19f4c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
14 deletions
+5
-14
app/controllers/projects/application_controller.rb
app/controllers/projects/application_controller.rb
+1
-0
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+0
-7
app/views/projects/merge_requests/_new_submit.html.haml
app/views/projects/merge_requests/_new_submit.html.haml
+2
-2
spec/features/merge_requests/create_new_mr_spec.rb
spec/features/merge_requests/create_new_mr_spec.rb
+2
-5
No files found.
app/controllers/projects/application_controller.rb
View file @
22ce76d4
...
...
@@ -83,6 +83,7 @@ class Projects::ApplicationController < ApplicationController
end
def
apply_diff_view_cookie!
@show_changes_tab
=
params
[
:view
].
present?
cookies
.
permanent
[
:diff_view
]
=
params
.
delete
(
:view
)
if
params
[
:view
].
present?
end
...
...
This diff is collapsed.
Click to expand it.
app/controllers/projects/merge_requests_controller.rb
View file @
22ce76d4
...
...
@@ -216,7 +216,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@base_commit
=
@merge_request
.
diff_base_commit
@diffs
=
@merge_request
.
diffs
(
diff_options
)
if
@merge_request
.
compare
@diff_notes_disabled
=
true
@show_diff_tab
=
check_diff_tab
@pipeline
=
@merge_request
.
pipeline
@statuses
=
@pipeline
.
statuses
.
relevant
if
@pipeline
...
...
@@ -520,10 +519,4 @@ class Projects::MergeRequestsController < Projects::ApplicationController
params
[
:merge_request
]
||=
ActionController
::
Parameters
.
new
(
source_project:
@project
)
@merge_request
=
MergeRequests
::
BuildService
.
new
(
project
,
current_user
,
merge_request_params
).
execute
end
private
def
check_diff_tab
request
.
query_parameters
[
:view
].
present?
end
end
This diff is collapsed.
Click to expand it.
app/views/projects/merge_requests/_new_submit.html.haml
View file @
22ce76d4
...
...
@@ -54,6 +54,6 @@
});
:javascript
var
merge_request
=
new
MergeRequest
({
action
:
"
#{
(
@show_
diff
_tab
?
'diffs'
:
'new'
)
}
"
,
setUrl
:
false
action
:
"
#{
(
@show_
changes
_tab
?
'diffs'
:
'new'
)
}
"
,
setUrl
:
false
});
This diff is collapsed.
Click to expand it.
spec/features/merge_requests/create_new_mr_spec.rb
View file @
22ce76d4
require
'spec_helper'
feature
'Create New Merge Request'
,
feature:
true
,
js:
true
do
include
WaitForAjax
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
...
...
@@ -51,11 +49,10 @@ feature 'Create New Merge Request', feature: true, js: true do
click_link
'Changes'
expect
(
page
.
find_link
(
'Inline'
)[
:class
]).
to
match
(
/\bactive\b/
)
expect
(
page
.
find_link
(
'Side-by-side'
)[
:class
]).
not_to
match
(
/\bactive\b/
)
expect
(
page
).
to
have_css
(
'a.btn.active'
,
text:
'Inline'
)
expect
(
page
).
not_to
have_css
(
'a.btn.active'
,
text:
'Side-by-side'
)
click_link
'Side-by-side'
wait_for_ajax
within
'.merge-request'
do
expect
(
page
).
not_to
have_css
(
'a.btn.active'
,
text:
'Inline'
)
...
...
This diff is collapsed.
Click to expand it.
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