Merge branch 'leipert-port-project-settings' into 'master'

Cleanup code for General Project Settings

See merge request gitlab-org/gitlab-ce!19245
This commit is contained in:
Rémy Coutable 2018-05-31 08:44:32 +00:00
commit b8198897b9
6 changed files with 50 additions and 42 deletions

View file

@ -1,13 +0,0 @@
- form = local_assigns.fetch(:form)
- project = local_assigns.fetch(:project)
.form-check
= label_tag :project_merge_method_ff do
= form.radio_button :merge_method, :ff, class: "js-merge-method-radio qa-radio-button-merge-ff"
%strong Fast-forward merge
%br
%span.descr
No merge commits are created and all merges are fast-forwarded, which means that merging is only allowed if the branch could be fast-forwarded.
%br
%span.descr
When fast-forward merge is not possible, the user is given the option to rebase.

View file

@ -0,0 +1,36 @@
- form = local_assigns.fetch(:form)
- project = local_assigns.fetch(:project)
.form-group
= label_tag :merge_method_merge, class: 'label-light' do
Merge method
.form-check
= label_tag :project_merge_method_merge do
= form.radio_button :merge_method, :merge, class: "js-merge-method-radio"
%strong Merge commit
%br
%span.descr
A merge commit is created for every merge, and merging is allowed as long as there are no conflicts.
.form-check
= label_tag :project_merge_method_rebase_merge do
= form.radio_button :merge_method, :rebase_merge, class: "js-merge-method-radio"
%strong Merge commit with semi-linear history
%br
%span.descr
A merge commit is created for every merge, but merging is only allowed if fast-forward merge is possible.
This way you could make sure that if this merge request would build, after merging to target branch it would also build.
%br
%span.descr
When fast-forward merge is not possible, the user is given the option to rebase.
.form-check
= label_tag :project_merge_method_ff do
= form.radio_button :merge_method, :ff, class: "js-merge-method-radio qa-radio-button-merge-ff"
%strong Fast-forward merge
%br
%span.descr
No merge commits are created and all merges are fast-forwarded, which means that merging is only allowed if the branch could be fast-forwarded.
%br
%span.descr
When fast-forward merge is not possible, the user is given the option to rebase.

View file

@ -1,13 +0,0 @@
- form = local_assigns.fetch(:form)
.form-check
= label_tag :project_merge_method_rebase_merge do
= form.radio_button :merge_method, :rebase_merge, class: "js-merge-method-radio"
%strong Merge commit with semi-linear history
%br
%span.descr
A merge commit is created for every merge, but merging is only allowed if fast-forward merge is possible.
This way you could make sure that if this merge request would build, after merging to target branch it would also build.
%br
%span.descr
When fast-forward merge is not possible, the user is given the option to rebase.

View file

@ -1,18 +1,5 @@
- form = local_assigns.fetch(:form)
.form-group
= label_tag :merge_method_merge, class: 'label-light' do
Merge method
.form-check
= label_tag :project_merge_method_merge do
= form.radio_button :merge_method, :merge, class: "js-merge-method-radio"
%strong Merge commit
%br
%span.descr
A merge commit is created for every merge, and merging is allowed as long as there are no conflicts.
= render 'merge_request_rebase_settings', form: form
= render 'merge_request_fast_forward_settings', project: @project, form: form
= render 'projects/merge_request_merge_method_settings', project: @project, form: form
= render 'projects/merge_request_merge_settings', form: form

View file

@ -33,10 +33,15 @@
%span.light (optional)
= f.text_area :description, class: "form-control", rows: 3, maxlength: 250
= render_if_exists 'projects/classification_policy_settings', f: f
- unless @project.empty_repo?
.form-group
= f.label :default_branch, "Default Branch", class: 'label-light'
= f.select(:default_branch, @project.repository.branch_names, {}, {class: 'select2 select-wide'})
= render_if_exists 'shared/repository_size_limit_setting', form: f, type: :project
.form-group
= f.label :tag_list, "Tags", class: 'label-light'
= f.text_field :tag_list, value: @project.tag_list.sort.join(', '), maxlength: 2000, class: "form-control"
@ -75,6 +80,8 @@
.js-project-permissions-form
= f.submit 'Save changes', class: "btn btn-save"
= render_if_exists 'projects/issues_settings'
%section.settings.merge-requests-feature.no-animate{ class: [('expanded' if expanded), ('hidden' if @project.project_feature.send(:merge_requests_access_level) == 0)] }
.settings-header
%h4
@ -84,10 +91,14 @@
%p
Customize your merge request restrictions.
.settings-content
= render_if_exists 'shared/promotions/promote_mr_features'
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "merge-request-settings-form" }, authenticity_token: true do |f|
= render 'merge_request_settings', form: f
= render 'projects/merge_request_settings', form: f
= f.submit 'Save changes', class: "btn btn-save qa-save-merge-request-changes"
= render_if_exists 'projects/service_desk_settings'
= render 'export', project: @project
%section.settings.advanced-settings.no-animate{ class: ('expanded' if expanded) }

View file

@ -5,7 +5,7 @@ module QA
class MergeRequest < QA::Page::Base
include Common
view 'app/views/projects/_merge_request_fast_forward_settings.html.haml' do
view 'app/views/projects/_merge_request_merge_method_settings.html.haml' do
element :radio_button_merge_ff
end