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
57d3a2d7
Commit
57d3a2d7
authored
Apr 04, 2017
by
Simon Knox
Committed by
Jose Ivan Vargas
Apr 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter already-selected users and groups from the dropdown
parent
e754b554
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
+24
-4
app/assets/javascripts/project_new.js
app/assets/javascripts/project_new.js
+22
-2
app/views/projects/ee/_merge_request_settings.html.haml
app/views/projects/ee/_merge_request_settings.html.haml
+2
-2
No files found.
app/assets/javascripts/project_new.js
View file @
57d3a2d7
...
...
@@ -35,11 +35,31 @@
multiple
:
true
,
minimumInputLength
:
0
,
query
(
query
)
{
const
groupsApi
=
Api
.
groups
(
query
.
term
,
{},
function
(
groups
)
{
const
existingGroupApprovers
=
[].
map
.
call
(
document
.
querySelectorAll
(
'
.js-approver-group
'
),
item
=>
parseInt
(
item
.
getAttribute
(
'
data-id
'
),
10
),
);
const
selectedGroupApprovers
=
$
(
'
[name="project[approver_group_ids]"]
'
).
val
()
.
split
(
'
,
'
)
.
filter
(
val
=>
val
!==
''
);
const
groupOptions
=
{
skip_groups
:
[...
existingGroupApprovers
,
...
selectedGroupApprovers
],
};
const
groupsApi
=
Api
.
groups
(
query
.
term
,
groupOptions
,
function
(
groups
)
{
return
groups
;
});
const
usersApi
=
Api
.
users
(
query
.
term
,
{},
function
(
groups
)
{
const
existingApprovers
=
[].
map
.
call
(
document
.
querySelectorAll
(
'
.js-approver
'
),
item
=>
parseInt
(
item
.
getAttribute
(
'
data-id
'
),
10
),
);
const
selectedApprovers
=
$
(
'
[name="project[approver_ids]"]
'
).
val
()
.
split
(
'
,
'
)
.
filter
(
id
=>
id
!==
''
);
const
userOptions
=
{
skip_users
:
[...
existingApprovers
,
...
selectedApprovers
],
};
const
usersApi
=
Api
.
users
(
query
.
term
,
userOptions
,
function
(
groups
)
{
return
groups
;
});
...
...
app/views/projects/ee/_merge_request_settings.html.haml
View file @
57d3a2d7
...
...
@@ -72,13 +72,13 @@
.load-wrapper.hidden
=
icon
(
'spinner spin'
,
class:
'approver-list-loader'
)
-
project
.
approvers
.
each
do
|
approver
|
%li
.approver.settings-flex-row
%li
.approver.settings-flex-row
.js-approver
{
data:
{
id:
approver
.
user_id
}
}
=
link_to
approver
.
user
.
name
,
approver
.
user
.pull-right
%button
{
href:
namespace_project_approver_path
(
project
.
namespace
,
project
,
approver
),
data:
{
confirm:
"Are you sure you want to remove approver #{approver.user.name}"
},
class:
"btn btn-remove js-approver-remove"
,
title:
'Remove approver'
}
=
icon
(
"trash"
)
-
project
.
approver_groups
.
each
do
|
approver_group
|
%li
.approver-group.settings-flex-row
%li
.approver-group.settings-flex-row
.js-approver-group
{
data:
{
id:
approver_group
.
group
.
id
}
}
.span
%span
.light
Group:
...
...
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