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
09193a4f
Commit
09193a4f
authored
Jul 11, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert target branch link to use tree
parent
9e4e1afb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
10 deletions
+10
-10
mr_widget_store.js
...cripts/vue_merge_request_widget/stores/mr_widget_store.js
+1
-1
merge_request_presenter.rb
app/presenters/merge_request_presenter.rb
+2
-2
merge_request_entity.rb
app/serializers/merge_request_entity.rb
+2
-2
merge_request.json
spec/fixtures/api/schemas/entities/merge_request.json
+1
-1
merge_request_presenter_spec.rb
spec/presenters/merge_request_presenter_spec.rb
+3
-3
merge_request_entity_spec.rb
spec/serializers/merge_request_entity_spec.rb
+1
-1
No files found.
app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js
View file @
09193a4f
...
...
@@ -47,7 +47,7 @@ export default class MergeRequestStore {
this
.
sourceBranchPath
=
data
.
source_branch_path
;
this
.
sourceBranchLink
=
data
.
source_branch_with_namespace_link
;
this
.
mergeError
=
data
.
merge_error
;
this
.
targetBranchPath
=
data
.
target_branch_
commits
_path
;
this
.
targetBranchPath
=
data
.
target_branch_
tree
_path
;
this
.
conflictResolutionPath
=
data
.
conflict_resolution_path
;
this
.
cancelAutoMergePath
=
data
.
cancel_merge_when_pipeline_succeeds_path
;
this
.
removeWIPPath
=
data
.
remove_wip_path
;
...
...
app/presenters/merge_request_presenter.rb
View file @
09193a4f
...
...
@@ -76,9 +76,9 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
end
end
def
target_branch_
commits
_path
def
target_branch_
tree
_path
if
target_branch_exists?
project_
commits
_path
(
project
,
target_branch
)
project_
tree
_path
(
project
,
target_branch
)
end
end
...
...
app/serializers/merge_request_entity.rb
View file @
09193a4f
...
...
@@ -93,8 +93,8 @@ class MergeRequestEntity < IssuableEntity
# Paths
#
expose
:target_branch_
commits
_path
do
|
merge_request
|
presenter
(
merge_request
).
target_branch_
commits
_path
expose
:target_branch_
tree
_path
do
|
merge_request
|
presenter
(
merge_request
).
target_branch_
tree
_path
end
expose
:new_blob_path
do
|
merge_request
|
...
...
spec/fixtures/api/schemas/entities/merge_request.json
View file @
09193a4f
...
...
@@ -74,7 +74,7 @@
},
"additionalProperties"
:
false
},
"target_branch_
commits
_path"
:
{
"type"
:
"string"
},
"target_branch_
tree
_path"
:
{
"type"
:
"string"
},
"source_branch_path"
:
{
"type"
:
"string"
},
"conflict_resolution_path"
:
{
"type"
:
[
"string"
,
"null"
]
},
"cancel_merge_when_pipeline_succeeds_path"
:
{
"type"
:
"string"
},
...
...
spec/presenters/merge_request_presenter_spec.rb
View file @
09193a4f
...
...
@@ -317,10 +317,10 @@ describe MergeRequestPresenter do
end
end
describe
'#target_branch_
commits
_path'
do
describe
'#target_branch_
tree
_path'
do
subject
do
described_class
.
new
(
resource
,
current_user:
user
)
.
target_branch_
commits
_path
.
target_branch_
tree
_path
end
context
'when target branch exists'
do
...
...
@@ -328,7 +328,7 @@ describe MergeRequestPresenter do
allow
(
resource
).
to
receive
(
:target_branch_exists?
)
{
true
}
is_expected
.
to
eq
(
"/
#{
resource
.
target_project
.
full_path
}
/
commits
/
#{
resource
.
target_branch
}
"
)
.
to
eq
(
"/
#{
resource
.
target_project
.
full_path
}
/
tree
/
#{
resource
.
target_branch
}
"
)
end
end
...
...
spec/serializers/merge_request_entity_spec.rb
View file @
09193a4f
...
...
@@ -46,7 +46,7 @@ describe MergeRequestEntity do
:conflict_resolution_path
,
:cancel_merge_when_pipeline_succeeds_path
,
:create_issue_to_resolve_discussions_path
,
:source_branch_path
,
:target_branch_
commits
_path
,
:source_branch_path
,
:target_branch_
tree
_path
,
:commits_count
)
end
...
...
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