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
abddc8c0
Commit
abddc8c0
authored
Apr 03, 2017
by
Simon Knox
Committed by
Jose Ivan Vargas
Apr 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
single select dropdown in markup
change click handler to check both user and group inputs
parent
04806024
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
43 deletions
+34
-43
app/assets/javascripts/project_new.js
app/assets/javascripts/project_new.js
+29
-30
app/views/projects/ee/_merge_request_settings.html.haml
app/views/projects/ee/_merge_request_settings.html.haml
+5
-13
No files found.
app/assets/javascripts/project_new.js
View file @
abddc8c0
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
this
.
ProjectNew
=
(
function
()
{
this
.
ProjectNew
=
(
function
()
{
function
ProjectNew
()
{
function
ProjectNew
()
{
this
.
toggleSettings
=
bind
(
this
.
toggleSettings
,
this
);
this
.
toggleSettings
=
bind
(
this
.
toggleSettings
,
this
);
this
.
$selects
=
$
(
'
.
features
select
'
);
this
.
$selects
=
$
(
'
.
project-feature
select
'
);
this
.
$repoSelects
=
this
.
$selects
.
filter
(
'
.js-repo-select
'
);
this
.
$repoSelects
=
this
.
$selects
.
filter
(
'
.js-repo-select
'
);
$
(
'
.project-edit-container
'
).
on
(
'
ajax:before
'
,
(
function
(
_this
)
{
$
(
'
.project-edit-container
'
).
on
(
'
ajax:before
'
,
(
function
(
_this
)
{
...
@@ -55,7 +55,8 @@
...
@@ -55,7 +55,8 @@
};
};
ProjectNew
.
prototype
.
addApprover
=
function
(
evt
)
{
ProjectNew
.
prototype
.
addApprover
=
function
(
evt
)
{
const
fieldName
=
evt
.
target
.
getAttribute
(
'
data-for
'
);
const
fieldNames
=
[
'
project[approver_ids]
'
,
'
project[approver_group_ids]
'
];
fieldNames
.
forEach
((
fieldName
)
=>
{
const
$select
=
$
(
`[name="
${
fieldName
}
"]`
);
const
$select
=
$
(
`[name="
${
fieldName
}
"]`
);
const
newValue
=
$select
.
val
();
const
newValue
=
$select
.
val
();
...
@@ -63,10 +64,6 @@
...
@@ -63,10 +64,6 @@
return
;
return
;
}
}
if
(
evt
.
target
.
type
===
'
submit
'
)
{
evt
.
preventDefault
();
}
const
$form
=
$
(
'
.js-approvers
'
).
closest
(
'
form
'
);
const
$form
=
$
(
'
.js-approvers
'
).
closest
(
'
form
'
);
$
(
'
.load-wrapper
'
).
removeClass
(
'
hidden
'
);
$
(
'
.load-wrapper
'
).
removeClass
(
'
hidden
'
);
$
.
ajax
({
$
.
ajax
({
...
@@ -82,9 +79,11 @@
...
@@ -82,9 +79,11 @@
$
(
'
.load-wrapper
'
).
addClass
(
'
hidden
'
);
$
(
'
.load-wrapper
'
).
addClass
(
'
hidden
'
);
},
},
error
(
err
)
{
error
(
err
)
{
// TODO: scroll into view or toast
window
.
Flash
(
'
Failed to add Approver
'
,
'
alert
'
);
window
.
Flash
(
'
Failed to add Approver
'
,
'
alert
'
);
},
},
});
});
});
};
};
ProjectNew
.
prototype
.
initVisibilitySelect
=
function
()
{
ProjectNew
.
prototype
.
initVisibilitySelect
=
function
()
{
...
...
app/views/projects/ee/_merge_request_settings.html.haml
View file @
abddc8c0
...
@@ -55,22 +55,14 @@
...
@@ -55,22 +55,14 @@
.form-group
.form-group
=
form
.
label
:approver_ids
,
class:
'label-light'
do
=
form
.
label
:approver_ids
,
class:
'label-light'
do
Approvers
Approvers
=
hidden_field_tag
"project[approver_ids]"
=
hidden_field_tag
"project[approver_group_ids]"
.input-group.input-btn-group
.input-group.input-btn-group
=
users_select_tag
(
"project[approver_ids]"
,
multiple:
true
,
class:
'input-large'
,
scope: :all
,
email_user:
true
)
=
hidden_field_tag
:approver_user_and_group_ids
,
''
,
{
class:
'js-select-user-and-group input-large'
,
tabindex:
1
}
%button
.btn.btn-success.js-approvers
{
type:
'button'
,
title:
'Add approver
(s)'
,
data:
{
for:
'project[approver_ids]'
}
}
%button
.btn.btn-success.js-approvers
{
type:
'button'
,
title:
'Add approver
s(s)'
}
Add
Add
.help-block
.help-block
Add an approver suggestion for each merge request
Add an approver or group suggestion for each merge request
=
form
.
label
:approver_group_ids
,
class:
'label-light'
do
Approver groups
.input-group.input-btn-group
-
skip_groups
=
project
.
approver_groups
.
pluck
(
:group_id
)
=
groups_select_tag
(
'project[approver_group_ids]'
,
multiple:
true
,
data:
{
skip_groups:
skip_groups
,
all_available:
true
},
class:
'input-large'
)
%button
.btn.btn-success.js-approvers
{
type:
'button'
,
title:
'Add group(s)'
,
data:
{
for:
'project[approver_group_ids]'
}
}
Add
.help-block
Add a group as an approver suggestion for each merge request
.panel.panel-default.prepend-top-10
.panel.panel-default.prepend-top-10
.panel-heading
.panel-heading
...
...
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