Commit 40da3788 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ph/339918/fixForkApprovalRulesApiRequest' into 'master'

Fixes approval rules not loading correctly for forks

See merge request gitlab-org/gitlab!72372
parents 2ad4db78 cdafefac
......@@ -23,7 +23,7 @@
= html_escape(_('From %{code_open}%{source_title}%{code_close} into')) % { source_title: source_title, code_open: '<code>'.html_safe, code_close: '</code>'.html_safe }
- if issuable.new_record?
%code#js-target-branch-title= target_title
%code#js-target-branch-title{ data: { branch_name: @merge_request.target_branch } }= target_title
&nbsp;
= link_to _('Change branches'), mr_change_branches_path(issuable)
- elsif issuable.for_fork?
......
......@@ -9,8 +9,10 @@ export default function mountApprovalInput(el) {
return null;
}
const targetBranchTitle = document.querySelector('#js-target-branch-title');
const targetBranch =
document.querySelector('#js-target-branch-title')?.textContent ||
targetBranchTitle?.dataset?.branchName ||
targetBranchTitle?.textContent ||
document.querySelector('#merge_request_target_branch')?.value;
const store = createStore(
......
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