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
ef89ff91
Commit
ef89ff91
authored
Dec 15, 2020
by
Samantha Ming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address reviewer & attempt to solve confusing code
parent
d94ffb92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
13 deletions
+10
-13
app/assets/javascripts/users_select/index.js
app/assets/javascripts/users_select/index.js
+10
-8
changelogs/unreleased/233736-add-reviewer-approval-rules.yml
changelogs/unreleased/233736-add-reviewer-approval-rules.yml
+0
-5
No files found.
app/assets/javascripts/users_select/index.js
View file @
ef89ff91
...
...
@@ -754,16 +754,17 @@ UsersSelect.prototype.users = function(query, options, callback) {
...
getAjaxUsersSelectParams
(
options
,
AJAX_USERS_SELECT_PARAMS_MAP
),
};
if
(
options
.
issuableType
===
'
merge_request
'
||
(
!
options
.
issuableType
&&
(
options
.
iid
||
options
.
targetBranch
))
)
{
const
isMergeRequest
=
options
.
issuableType
===
'
merge_request
'
;
const
isEditMergeRequest
=
!
options
.
issuableType
&&
(
options
.
iid
&&
options
.
targetBranch
);
const
isNewMergeRequest
=
!
options
.
issuableType
&&
(
!
options
.
iid
&&
options
.
targetBranch
);
if
(
isMergeRequest
||
isEditMergeRequest
||
isNewMergeRequest
)
{
params
.
merge_request_iid
=
options
.
iid
||
null
;
params
.
approval_rules
=
true
;
}
if
(
!
options
.
iid
)
{
params
.
target_branch
=
options
.
targetBranch
||
null
;
}
if
(
isNewMergeRequest
)
{
params
.
target_branch
=
options
.
targetBranch
||
null
;
}
return
axios
.
get
(
url
,
{
params
}).
then
(({
data
})
=>
{
...
...
@@ -804,7 +805,7 @@ UsersSelect.prototype.renderRow = function(
</strong>
${
username
?
`<span class="dropdown-menu-user-username
text
gl-text-gray-400">
${
username
}
</span>`
?
`<span class="dropdown-menu-user-username gl-text-gray-400">
${
username
}
</span>`
:
''
}
${
this
.
renderApprovalRules
(
elsClassName
,
user
.
applicable_approval_rules
)}
...
...
@@ -834,6 +835,7 @@ UsersSelect.prototype.renderApprovalRules = function(elsClassName, approvalRules
if
(
!
gon
.
features
?.
reviewerApprovalRules
||
!
elsClassName
?.
includes
(
'
reviewer
'
))
{
return
''
;
}
const
count
=
approvalRules
.
length
;
const
[
rule
]
=
approvalRules
;
const
countText
=
sprintf
(
__
(
'
(+%{count} rules)
'
),
{
count
});
...
...
changelogs/unreleased/233736-add-reviewer-approval-rules.yml
deleted
100644 → 0
View file @
d94ffb92
---
title
:
Display approval rules in reviewer dropdown
merge_request
:
46738
author
:
type
:
added
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