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) => { ...@@ -91,7 +91,7 @@ export default (IssuableTokenKeys, disableTargetBranchFilter = false) => {
], ],
}; };
const tokenPosition = 2; const tokenPosition = 3;
IssuableTokenKeys.tokenKeys.splice(tokenPosition, 0, ...[approvedBy.token]); IssuableTokenKeys.tokenKeys.splice(tokenPosition, 0, ...[approvedBy.token]);
IssuableTokenKeys.tokenKeysWithAlternative.splice(tokenPosition, 0, ...[approvedBy.token]); IssuableTokenKeys.tokenKeysWithAlternative.splice(tokenPosition, 0, ...[approvedBy.token]);
IssuableTokenKeys.conditions.push(...approvedBy.condition); IssuableTokenKeys.conditions.push(...approvedBy.condition);
......
...@@ -71,6 +71,11 @@ export default class AvailableDropdownMappings { ...@@ -71,6 +71,11 @@ export default class AvailableDropdownMappings {
gl: DropdownUser, gl: DropdownUser,
element: this.container.querySelector('#js-dropdown-assignee'), element: this.container.querySelector('#js-dropdown-assignee'),
}, },
reviewer: {
reference: null,
gl: DropdownUser,
element: this.container.querySelector('#js-dropdown-reviewer'),
},
'approved-by': { 'approved-by': {
reference: null, reference: null,
gl: DropdownUser, 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 = { export const DROPDOWN_TYPE = {
hint: 'hint', hint: 'hint',
......
...@@ -21,6 +21,15 @@ export const tokenKeys = [ ...@@ -21,6 +21,15 @@ export const tokenKeys = [
icon: 'user', icon: 'user',
tag: '@assignee', tag: '@assignee',
}, },
{
formattedKey: __('Reviewer'),
key: 'reviewer',
type: 'string',
param: 'username',
symbol: '@',
icon: 'user',
tag: '@reviewer',
},
{ {
formattedKey: __('Milestone'), formattedKey: __('Milestone'),
key: 'milestone', key: 'milestone',
...@@ -85,6 +94,16 @@ export const conditions = flattenDeep( ...@@ -85,6 +94,16 @@ export const conditions = flattenDeep(
tokenKey: 'assignee', tokenKey: 'assignee',
value: __('Any'), value: __('Any'),
}, },
{
url: 'reviewer_id=None',
tokenKey: 'reviewer',
value: __('None'),
},
{
url: 'reviewer_id=Any',
tokenKey: 'reviewer',
value: __('Any'),
},
{ {
url: 'author_username=support-bot', url: 'author_username=support-bot',
tokenKey: 'author', tokenKey: 'author',
......
...@@ -47,15 +47,14 @@ export default { ...@@ -47,15 +47,14 @@ export default {
class="dropdown-menu-toggle build-content gl-build-content" class="dropdown-menu-toggle build-content gl-build-content"
> >
<div class="gl-display-flex gl-align-items-center gl-justify-content-space-between"> <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" /> <ci-icon :status="group.status" :size="24" />
<span class="gl-text-truncate mw-70p gl-pl-3">
<span class="gl-text-truncate mw-70p gl-pl-3 gl-display-inline-block">
{{ group.name }} {{ group.name }}
</span> </span>
</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> </div>
</button> </button>
......
...@@ -249,6 +249,10 @@ export class SearchAutocomplete { ...@@ -249,6 +249,10 @@ export class SearchAutocomplete {
text: s__('SearchAutocomplete|Merge requests assigned to me'), text: s__('SearchAutocomplete|Merge requests assigned to me'),
url: `${mrPath}/?assignee_username=${userName}`, 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"), text: s__("SearchAutocomplete|Merge requests I've created"),
url: `${mrPath}/?author_username=${userName}`, url: `${mrPath}/?author_username=${userName}`,
......
...@@ -139,10 +139,6 @@ ...@@ -139,10 +139,6 @@
width: 186px; width: 186px;
} }
.gl-w-90 {
width: 90%;
}
.gl-build-content { .gl-build-content {
@include build-content(); @include build-content();
} }
......
...@@ -75,6 +75,22 @@ ...@@ -75,6 +75,22 @@
= render 'shared/issuable/user_dropdown_item', = render 'shared/issuable/user_dropdown_item',
user: User.new(username: '{{username}}', name: '{{name}}'), user: User.new(username: '{{username}}', name: '{{name}}'),
avatar: { lazy: true, url: '{{avatar_url}}' } 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/approver_dropdown'
= render_if_exists 'shared/issuable/approved_by_dropdown' = render_if_exists 'shared/issuable/approved_by_dropdown'
#js-dropdown-milestone.filtered-search-input-dropdown-menu.dropdown-menu #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 ...@@ -250,6 +250,9 @@ For example, to unlink the `MyOrg` account, the following **Disconnect** button
## Group Sync ## 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, 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. GitLab uses that information to automatically manage that user's GitLab group memberships.
......
...@@ -41,7 +41,7 @@ const approvers = { ...@@ -41,7 +41,7 @@ const approvers = {
export default (IssuableTokenKeys, disableTargetBranchFilter = false) => { export default (IssuableTokenKeys, disableTargetBranchFilter = false) => {
addExtraTokensForMergeRequests(IssuableTokenKeys, disableTargetBranchFilter); addExtraTokensForMergeRequests(IssuableTokenKeys, disableTargetBranchFilter);
const tokenPosition = 2; const tokenPosition = 3;
IssuableTokenKeys.tokenKeys.splice(tokenPosition, 0, ...[approvers.token]); IssuableTokenKeys.tokenKeys.splice(tokenPosition, 0, ...[approvers.token]);
IssuableTokenKeys.tokenKeysWithAlternative.splice(tokenPosition, 0, ...[approvers.token]); IssuableTokenKeys.tokenKeysWithAlternative.splice(tokenPosition, 0, ...[approvers.token]);
......
...@@ -24067,6 +24067,9 @@ msgstr "" ...@@ -24067,6 +24067,9 @@ msgstr ""
msgid "SearchAutocomplete|Merge requests assigned to me" msgid "SearchAutocomplete|Merge requests assigned to me"
msgstr "" msgstr ""
msgid "SearchAutocomplete|Merge requests that I'm a reviewer"
msgstr ""
msgid "SearchAutocomplete|in all GitLab" msgid "SearchAutocomplete|in all GitLab"
msgstr "" msgstr ""
......
...@@ -172,4 +172,25 @@ RSpec.describe 'Dashboard Merge Requests' do ...@@ -172,4 +172,25 @@ RSpec.describe 'Dashboard Merge Requests' do
expect(find('.issues-filters')).to have_content('Created date') expect(find('.issues-filters')).to have_content('Created date')
end end
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 end
...@@ -113,6 +113,10 @@ module FilteredSearchHelpers ...@@ -113,6 +113,10 @@ module FilteredSearchHelpers
create_token('Assignee', assignee_name) create_token('Assignee', assignee_name)
end end
def reviewer_token(reviewer_name = nil)
create_token('Reviewer', reviewer_name)
end
def milestone_token(milestone_name = nil, has_symbol = true, operator = '=') def milestone_token(milestone_name = nil, has_symbol = true, operator = '=')
symbol = has_symbol ? '%' : nil symbol = has_symbol ? '%' : nil
create_token('Milestone', milestone_name, symbol, operator) 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