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 {
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;
......
......@@ -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
......
......@@ -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|
......
......@@ -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" },
......
......@@ -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
......
......@@ -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
......
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