Commit 5c84137d authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents 6b9733cf 7757f7e8
f5c6f6efe69a4c23fb1f10cebb66c47f90f1a70c
2eb4db13dab06b87382582f5fcddab0c8397463e
......@@ -91,7 +91,7 @@ export default (IssuableTokenKeys, disableTargetBranchFilter = false) => {
],
};
const tokenPosition = 2;
const tokenPosition = 3;
IssuableTokenKeys.tokenKeys.splice(tokenPosition, 0, ...[approvedBy.token]);
IssuableTokenKeys.tokenKeysWithAlternative.splice(tokenPosition, 0, ...[approvedBy.token]);
IssuableTokenKeys.conditions.push(...approvedBy.condition);
......
......@@ -71,6 +71,11 @@ export default class AvailableDropdownMappings {
gl: DropdownUser,
element: this.container.querySelector('#js-dropdown-assignee'),
},
reviewer: {
reference: null,
gl: DropdownUser,
element: this.container.querySelector('#js-dropdown-reviewer'),
},
'approved-by': {
reference: null,
gl: DropdownUser,
......
export const USER_TOKEN_TYPES = ['author', 'assignee', 'approved-by'];
export const USER_TOKEN_TYPES = ['author', 'assignee', 'approved-by', 'reviewer'];
export const DROPDOWN_TYPE = {
hint: 'hint',
......
......@@ -21,6 +21,15 @@ export const tokenKeys = [
icon: 'user',
tag: '@assignee',
},
{
formattedKey: __('Reviewer'),
key: 'reviewer',
type: 'string',
param: 'username',
symbol: '@',
icon: 'user',
tag: '@reviewer',
},
{
formattedKey: __('Milestone'),
key: 'milestone',
......@@ -85,6 +94,16 @@ export const conditions = flattenDeep(
tokenKey: 'assignee',
value: __('Any'),
},
{
url: 'reviewer_id=None',
tokenKey: 'reviewer',
value: __('None'),
},
{
url: 'reviewer_id=Any',
tokenKey: 'reviewer',
value: __('Any'),
},
{
url: 'author_username=support-bot',
tokenKey: 'author',
......
......@@ -47,15 +47,14 @@ export default {
class="dropdown-menu-toggle build-content gl-build-content"
>
<div class="gl-display-flex gl-align-items-center gl-justify-content-space-between">
<span class="gl-display-flex gl-align-items-center gl-w-90">
<span class="gl-display-flex gl-align-items-center gl-min-w-0">
<ci-icon :status="group.status" :size="24" />
<span class="gl-text-truncate mw-70p gl-pl-3 gl-display-inline-block">
<span class="gl-text-truncate mw-70p gl-pl-3">
{{ group.name }}
</span>
</span>
<span class="gl-font-weight-100 gl-font-size-lg gl-pr-2"> {{ group.size }} </span>
<span class="gl-font-weight-100 gl-font-size-lg"> {{ group.size }} </span>
</div>
</button>
......
......@@ -249,6 +249,10 @@ export class SearchAutocomplete {
text: s__('SearchAutocomplete|Merge requests assigned to me'),
url: `${mrPath}/?assignee_username=${userName}`,
},
{
text: s__("SearchAutocomplete|Merge requests that I'm a reviewer"),
url: `${mrPath}/?reviewer_username=${userName}`,
},
{
text: s__("SearchAutocomplete|Merge requests I've created"),
url: `${mrPath}/?author_username=${userName}`,
......
......@@ -139,10 +139,6 @@
width: 186px;
}
.gl-w-90 {
width: 90%;
}
.gl-build-content {
@include build-content();
}
......
......@@ -75,6 +75,22 @@
= render 'shared/issuable/user_dropdown_item',
user: User.new(username: '{{username}}', name: '{{name}}'),
avatar: { lazy: true, url: '{{avatar_url}}' }
#js-dropdown-reviewer.filtered-search-input-dropdown-menu.dropdown-menu
%ul{ data: { dropdown: true } }
%li.filter-dropdown-item{ data: { value: 'None' } }
%button.btn.btn-link{ type: 'button' }
= _('None')
%li.filter-dropdown-item{ data: { value: 'Any' } }
%button.btn.btn-link{ type: 'button' }
= _('Any')
%li.divider.droplab-item-ignore
- if current_user
= render 'shared/issuable/user_dropdown_item',
user: current_user
%ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
= render 'shared/issuable/user_dropdown_item',
user: User.new(username: '{{username}}', name: '{{name}}'),
avatar: { lazy: true, url: '{{avatar_url}}' }
= render_if_exists 'shared/issuable/approver_dropdown'
= render_if_exists 'shared/issuable/approved_by_dropdown'
#js-dropdown-milestone.filtered-search-input-dropdown-menu.dropdown-menu
......
......@@ -250,6 +250,9 @@ For example, to unlink the `MyOrg` account, the following **Disconnect** button
## Group Sync
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a demo of Group Sync using Azure, see [Demo: SAML Group Sync](https://youtu.be/Iqvo2tJfXjg).
When the SAML response includes a user and their group memberships from the SAML identity provider,
GitLab uses that information to automatically manage that user's GitLab group memberships.
......
......@@ -41,7 +41,7 @@ const approvers = {
export default (IssuableTokenKeys, disableTargetBranchFilter = false) => {
addExtraTokensForMergeRequests(IssuableTokenKeys, disableTargetBranchFilter);
const tokenPosition = 2;
const tokenPosition = 3;
IssuableTokenKeys.tokenKeys.splice(tokenPosition, 0, ...[approvers.token]);
IssuableTokenKeys.tokenKeysWithAlternative.splice(tokenPosition, 0, ...[approvers.token]);
......
......@@ -24067,6 +24067,9 @@ msgstr ""
msgid "SearchAutocomplete|Merge requests assigned to me"
msgstr ""
msgid "SearchAutocomplete|Merge requests that I'm a reviewer"
msgstr ""
msgid "SearchAutocomplete|in all GitLab"
msgstr ""
......
......@@ -172,4 +172,25 @@ RSpec.describe 'Dashboard Merge Requests' do
expect(find('.issues-filters')).to have_content('Created date')
end
end
context 'merge request review', :js do
let_it_be(:author_user) { create(:user) }
let!(:review_requested_merge_request) do
create(:merge_request,
reviewers: [current_user],
source_branch: 'review',
source_project: project,
author: author_user)
end
before do
visit merge_requests_dashboard_path(reviewer_username: current_user.username)
end
it 'displays review requested merge requests' do
expect(page).to have_content(review_requested_merge_request.title)
expect_tokens([reviewer_token(current_user.name)])
end
end
end
......@@ -113,6 +113,10 @@ module FilteredSearchHelpers
create_token('Assignee', assignee_name)
end
def reviewer_token(reviewer_name = nil)
create_token('Reviewer', reviewer_name)
end
def milestone_token(milestone_name = nil, has_symbol = true, operator = '=')
symbol = has_symbol ? '%' : nil
create_token('Milestone', milestone_name, symbol, operator)
......
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