Commit 09193a4f authored by Clement Ho's avatar Clement Ho

Convert target branch link to use tree

parent 9e4e1afb
...@@ -47,7 +47,7 @@ export default class MergeRequestStore { ...@@ -47,7 +47,7 @@ export default class MergeRequestStore {
this.sourceBranchPath = data.source_branch_path; this.sourceBranchPath = data.source_branch_path;
this.sourceBranchLink = data.source_branch_with_namespace_link; this.sourceBranchLink = data.source_branch_with_namespace_link;
this.mergeError = data.merge_error; 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.conflictResolutionPath = data.conflict_resolution_path;
this.cancelAutoMergePath = data.cancel_merge_when_pipeline_succeeds_path; this.cancelAutoMergePath = data.cancel_merge_when_pipeline_succeeds_path;
this.removeWIPPath = data.remove_wip_path; this.removeWIPPath = data.remove_wip_path;
......
...@@ -76,9 +76,9 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated ...@@ -76,9 +76,9 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
end end
end end
def target_branch_commits_path def target_branch_tree_path
if target_branch_exists? if target_branch_exists?
project_commits_path(project, target_branch) project_tree_path(project, target_branch)
end end
end end
......
...@@ -93,8 +93,8 @@ class MergeRequestEntity < IssuableEntity ...@@ -93,8 +93,8 @@ class MergeRequestEntity < IssuableEntity
# Paths # Paths
# #
expose :target_branch_commits_path do |merge_request| expose :target_branch_tree_path do |merge_request|
presenter(merge_request).target_branch_commits_path presenter(merge_request).target_branch_tree_path
end end
expose :new_blob_path do |merge_request| expose :new_blob_path do |merge_request|
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
}, },
"additionalProperties": false "additionalProperties": false
}, },
"target_branch_commits_path": { "type": "string" }, "target_branch_tree_path": { "type": "string" },
"source_branch_path": { "type": "string" }, "source_branch_path": { "type": "string" },
"conflict_resolution_path": { "type": ["string", "null"] }, "conflict_resolution_path": { "type": ["string", "null"] },
"cancel_merge_when_pipeline_succeeds_path": { "type": "string" }, "cancel_merge_when_pipeline_succeeds_path": { "type": "string" },
......
...@@ -317,10 +317,10 @@ describe MergeRequestPresenter do ...@@ -317,10 +317,10 @@ describe MergeRequestPresenter do
end end
end end
describe '#target_branch_commits_path' do describe '#target_branch_tree_path' do
subject do subject do
described_class.new(resource, current_user: user) described_class.new(resource, current_user: user)
.target_branch_commits_path .target_branch_tree_path
end end
context 'when target branch exists' do context 'when target branch exists' do
...@@ -328,7 +328,7 @@ describe MergeRequestPresenter do ...@@ -328,7 +328,7 @@ describe MergeRequestPresenter do
allow(resource).to receive(:target_branch_exists?) { true } allow(resource).to receive(:target_branch_exists?) { true }
is_expected 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
end end
......
...@@ -46,7 +46,7 @@ describe MergeRequestEntity do ...@@ -46,7 +46,7 @@ describe MergeRequestEntity do
:conflict_resolution_path, :conflict_resolution_path,
:cancel_merge_when_pipeline_succeeds_path, :cancel_merge_when_pipeline_succeeds_path,
:create_issue_to_resolve_discussions_path, :create_issue_to_resolve_discussions_path,
:source_branch_path, :target_branch_commits_path, :source_branch_path, :target_branch_tree_path,
:commits_count) :commits_count)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment