Commit 23c22db6 authored by Simon Knox's avatar Simon Knox

give setting clearer name

parent 49531054
......@@ -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
......
- 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_wide_approvals }, false, true)
= form.label :disable_overriding_approvers_per_merge_request do
= form.check_box(:disable_overriding_approvers_per_merge_request, { checked: can_override_approvals }, false, true)
%strong Can overwrite approvers and approvals required per merge request
.form-group.reset-approvals-on-push
......
- 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 overwritable
- if overridable
- 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 overwritable
- if overridable
.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: !overwritable
= form.number_field :approvals_before_merge, class: 'form-control', value: issuable.approvals_required, readonly: !overridable
- if overwritable
- if overridable
.help-block.suggested-approvers
- if @suggested_approvers.any?
Suggested approvers:
......
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class AddProjectWideApprovalsToProject < ActiveRecord::Migration
class AddDisableOverridingApproversPerMergeRequestToProject < 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
......@@ -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
......
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