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
23c22db6
Commit
23c22db6
authored
Jun 06, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
give setting clearer name
parent
49531054
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
13 deletions
+14
-13
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-1
app/views/projects/ee/_merge_request_settings.html.haml
app/views/projects/ee/_merge_request_settings.html.haml
+3
-2
app/views/shared/issuable/_approvals.html.haml
app/views/shared/issuable/_approvals.html.haml
+7
-7
db/migrate/20170605151307_add_disable_overriding_approvers_per_merge_request_to_project.rb
...able_overriding_approvers_per_merge_request_to_project.rb
+2
-2
db/schema.rb
db/schema.rb
+1
-1
No files found.
app/controllers/projects_controller.rb
View file @
23c22db6
...
...
@@ -346,7 +346,7 @@ class ProjectsController < Projects::ApplicationController
mirror
mirror_trigger_builds
mirror_user_id
project_wide_approvals
disable_overriding_approvers_per_merge_request
repository_size_limit
reset_approvals_on_push
service_desk_enabled
...
...
app/views/projects/ee/_merge_request_settings.html.haml
View file @
23c22db6
-
form
=
local_assigns
.
fetch
(
:form
)
-
project
=
local_assigns
.
fetch
(
:project
)
-
can_override_approvals
=
!
project
.
try
(
:disable_overriding_approvers_per_merge_request
)
.form-group
=
label_tag
:merge_method_merge
,
class:
'label-light'
do
...
...
@@ -107,8 +108,8 @@
.form-group.mr-overwrite-approvals
.checkbox
=
form
.
label
:
project_wide_approvals
do
=
form
.
check_box
(
:
project_wide_approvals
,
{
checked:
!
project
.
project_w
ide_approvals
},
false
,
true
)
=
form
.
label
:
disable_overriding_approvers_per_merge_request
do
=
form
.
check_box
(
:
disable_overriding_approvers_per_merge_request
,
{
checked:
can_overr
ide_approvals
},
false
,
true
)
%strong
Can overwrite approvers and approvals required per merge request
.form-group.reset-approvals-on-push
...
...
app/views/shared/issuable/_approvals.html.haml
View file @
23c22db6
-
issuable
=
local_assigns
.
fetch
(
:issuable
)
-
overwritable
=
!
issuable
.
target_project
.
project_wide_approvals
-
form
=
local_assigns
.
fetch
(
:form
)
-
return
unless
issuable
.
is_a?
(
MergeRequest
)
-
return
unless
issuable
.
requires_approve?
-
overridable
=
!
issuable
.
target_project
.
try
(
:disable_overriding_approvers_per_merge_request
)
.form-group
=
form
.
label
:approver_ids
,
class:
'control-label'
do
Approvers
.col-sm-10
-
if
over
writ
able
-
if
over
rid
able
-
author
=
issuable
.
author
||
current_user
-
skip_users
=
issuable
.
all_approvers_including_groups
+
[
author
]
=
users_select_tag
(
"merge_request[approver_ids]"
,
multiple:
true
,
class:
'input-large'
,
email_user:
true
,
skip_users:
skip_users
)
...
...
@@ -36,7 +36,7 @@
-
issuable
.
overall_approvers
.
each
do
|
approver
|
%li
{
id:
dom_id
(
approver
.
user
),
class:
item_classes
+
[
'approver'
]
}
=
link_to
approver
.
user
.
name
,
approver
.
user
-
if
over
writ
able
-
if
over
rid
able
.pull-right
-
if
unsaved_approvers
=
link_to
"#"
,
data:
{
confirm:
"Are you sure you want to remove approver
#{
approver
.
user
.
name
}
"
},
class:
"btn-xs btn btn-remove"
,
title:
'Remove approver'
do
...
...
@@ -50,7 +50,7 @@
%li
{
id:
dom_id
(
approver_group
.
group
),
class:
item_classes
+
[
'approver-group'
]
}
Group:
=
link_to
approver_group
.
group
.
name
,
approver_group
.
group
-
if
issuable
.
target_project
.
approvals_overwritable_mr
-
if
overridable
.pull-right
-
if
unsaved_approvers
=
link_to
"#"
,
data:
{
confirm:
"Are you sure you want to remove group
#{
approver_group
.
group
.
name
}
"
},
class:
"btn-xs btn btn-remove"
,
title:
'Remove group'
do
...
...
@@ -65,9 +65,9 @@
.form-group
=
form
.
label
:approvals_before_merge
,
class:
'label-light'
do
Approvals required
=
form
.
number_field
:approvals_before_merge
,
class:
'form-control'
,
value:
issuable
.
approvals_required
,
readonly:
!
over
writ
able
=
form
.
number_field
:approvals_before_merge
,
class:
'form-control'
,
value:
issuable
.
approvals_required
,
readonly:
!
over
rid
able
-
if
over
writ
able
-
if
over
rid
able
.help-block.suggested-approvers
-
if
@suggested_approvers
.
any?
Suggested approvers:
...
...
db/migrate/20170605151307_add_
project_wide_approvals
_to_project.rb
→
db/migrate/20170605151307_add_
disable_overriding_approvers_per_merge_request
_to_project.rb
View file @
23c22db6
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
Add
ProjectWideApprovals
ToProject
<
ActiveRecord
::
Migration
class
Add
DisableOverridingApproversPerMergeRequest
ToProject
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
...
...
@@ -26,6 +26,6 @@ class AddProjectWideApprovalsToProject < ActiveRecord::Migration
# disable_ddl_transaction!
def
change
add_column
:projects
,
:
project_wide_approvals
,
:boolean
add_column
:projects
,
:
disable_overriding_approvers_per_merge_request
,
:boolean
end
end
db/schema.rb
View file @
23c22db6
...
...
@@ -1144,7 +1144,7 @@ ActiveRecord::Schema.define(version: 20170605151307) do
t
.
string
"import_jid"
t
.
integer
"cached_markdown_version"
t
.
datetime
"last_repository_updated_at"
t
.
boolean
"
project_wide_approvals
"
t
.
boolean
"
disable_overriding_approvers_per_merge_request
"
end
add_index
"projects"
,
[
"ci_id"
],
name:
"index_projects_on_ci_id"
,
using: :btree
...
...
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