Commit 01090760 authored by Phil Hughes's avatar Phil Hughes

EE port of 34060-simplified-general-project-settings

parent c7837b50
......@@ -378,6 +378,9 @@ import initGroupAnalytics from './init_group_analytics';
new UsersSelect();
new GroupsSelect();
setupProjectEdit();
// Initialize expandable settings panels
initSettingsPanels();
new UsersSelect();
break;
case 'projects:pipelines:new':
new NewBranchForm($('.js-new-pipeline-form'));
......
......@@ -36,7 +36,6 @@
}
select {
background: transparent;
transition: background 2s ease-out;
&.highlight-changes {
......
......@@ -54,8 +54,7 @@
.settings-content {
max-height: 1px;
overflow-y: scroll;
margin-right: -20px;
padding-right: 130px;
padding-right: 110px;
animation: collapseMaxHeight 300ms ease-out;
&.expanded {
......@@ -87,6 +86,23 @@
overflow: hidden;
margin-top: 20px;
}
.sub-section {
margin-bottom: 32px;
padding: 16px;
border: 1px solid $border-color;
background-color: $gray-light;
}
.bs-callout,
.checkbox:first-child,
.help-block {
margin-top: 0;
}
.label-light {
margin-bottom: 0;
}
}
.settings-list-icon {
......
- form = local_assigns.fetch(:form)
%fieldset.features.merge-requests-feature.append-bottom-default
%hr
%h5.prepend-top-0
Merge Requests
= render 'projects/ee/merge_request_settings', form: form, project: @project
= render 'projects/ee/merge_request_settings', form: form, project: @project
= render 'projects/merge_request_merge_settings', form: form
= render 'projects/merge_request_merge_settings', form: form
This diff is collapsed.
- if @project.feature_available?(:issuable_default_templates)
%fieldset.features.append-bottom-0.issues-feature
%hr
%h5.prepend-top-0
Issues
.form-group
= form.label :issues_template, class: 'label-light' do
Default description template for issues
= link_to icon('question-circle'), help_page_path('user/project/description_templates', anchor: 'setting-a-default-template-for-issues-and-merge-requests'), target: '_blank'
= form.text_area :issues_template, class: "form-control", rows: 3
.hint
Description parsed with #{link_to "GitLab Flavored Markdown", help_page_path('user/markdown'), target: '_blank'}.
- expanded = Rails.env.test?
%section.settings.issues-features{ style: ("display:none;" if @project.project_feature.send(:issues_access_level) == 0)}
.settings-header
%h4
Issue settings
%button.btn.js-settings-toggle
= expanded ? 'Collapse' : 'Expand'
%p
Customize your issue restrictions.
.settings-content.no-animate{ class: ('expanded' if expanded) }
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "issue-settings-form" }, authenticity_token: true do |f|
.form-group
= f.label :issues_template, class: 'label-light' do
Default description template for issues
= link_to icon('question-circle'), help_page_path('user/project/description_templates', anchor: 'setting-a-default-template-for-issues-and-merge-requests'), target: '_blank'
= f.text_area :issues_template, class: "form-control", rows: 3
.hint
Description parsed with #{link_to "GitLab Flavored Markdown", help_page_path('user/markdown'), target: '_blank'}.
= f.submit 'Save changes', class: "btn btn-save"
......@@ -11,7 +11,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end
step 'I save project' do
click_button 'Save changes'
page.within '.general-settings' do
click_button 'Save changes'
end
end
step 'I should see project with new settings' do
......@@ -32,7 +34,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
:project_avatar,
File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
)
click_button 'Save changes'
page.within '.general-settings' do
click_button 'Save changes'
end
@project.reload
end
......@@ -51,7 +55,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
:project_avatar,
File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
)
click_button 'Save changes'
page.within '.general-settings' do
click_button 'Save changes'
end
@project.reload
end
......@@ -92,7 +98,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
step 'change project default branch' do
select 'fix', from: 'project_default_branch'
click_button 'Save changes'
page.within '.general-settings' do
click_button 'Save changes'
end
end
step 'I should see project default branch changed' do
......
......@@ -103,7 +103,7 @@ module SharedProject
step 'I should see project settings' do
expect(current_path).to eq edit_project_path(@project)
expect(page).to have_content("Project name")
expect(page).to have_content("Sharing & Permissions")
expect(page).to have_content("Sharing and permissions")
end
def current_project
......
......@@ -20,21 +20,25 @@ describe 'Edit Project Settings' do
visit edit_project_path(project)
select 'Disabled', from: "project_project_feature_attributes_#{tool_name}_access_level"
click_button 'Save changes'
page.within('.sharing-permissions') do
click_button 'Save changes'
end
wait_for_requests
expect(page).not_to have_selector(".shortcuts-#{shortcut_name}")
select 'Everyone with access', from: "project_project_feature_attributes_#{tool_name}_access_level"
click_button 'Save changes'
page.within('.sharing-permissions') do
click_button 'Save changes'
end
wait_for_requests
expect(page).to have_selector(".shortcuts-#{shortcut_name}")
select 'Only team members', from: "project_project_feature_attributes_#{tool_name}_access_level"
click_button 'Save changes'
page.within('.sharing-permissions') do
click_button 'Save changes'
end
wait_for_requests
expect(page).to have_selector(".shortcuts-#{shortcut_name}")
sleep 0.1
end
end
end
......@@ -174,7 +178,11 @@ describe 'Edit Project Settings' do
it "disables repository related features" do
select "Disabled", from: "project_project_feature_attributes_repository_access_level"
expect(find(".edit-project")).to have_selector("select.disabled", count: 2)
page.within('.sharing-permissions') do
click_button "Save changes"
end
expect(find(".sharing-permissions")).to have_selector("select.disabled", count: 2)
end
it "shows empty features project homepage" do
......@@ -182,7 +190,9 @@ describe 'Edit Project Settings' do
select "Disabled", from: "project_project_feature_attributes_issues_access_level"
select "Disabled", from: "project_project_feature_attributes_wiki_access_level"
click_button "Save changes"
page.within('.sharing-permissions') do
click_button "Save changes"
end
wait_for_requests
visit project_path(project)
......@@ -195,7 +205,9 @@ describe 'Edit Project Settings' do
select "Disabled", from: "project_project_feature_attributes_issues_access_level"
select "Disabled", from: "project_project_feature_attributes_wiki_access_level"
click_button "Save changes"
page.within('.sharing-permissions') do
click_button "Save changes"
end
wait_for_requests
visit activity_project_path(project)
......@@ -236,7 +248,9 @@ describe 'Edit Project Settings' do
end
def save_changes_and_check_activity_tab
click_button "Save changes"
page.within('.sharing-permissions') do
click_button "Save changes"
end
wait_for_requests
visit activity_project_path(project)
......
......@@ -14,7 +14,9 @@ describe 'Edit Project Settings' do
it 'shows errors for invalid project name' do
visit edit_project_path(project)
fill_in 'project_name_edit', with: 'foo&bar'
click_button 'Save changes'
page.within('.general-settings') do
click_button 'Save changes'
end
expect(page).to have_field 'project_name_edit', with: 'foo&bar'
expect(page).to have_content "Name can contain only letters, digits, emojis, '_', '.', dash, space. It must start with letter, digit, emoji or '_'."
expect(page).to have_button 'Save changes'
......@@ -23,7 +25,9 @@ describe 'Edit Project Settings' do
it 'shows a successful notice when the project is updated' do
visit edit_project_path(project)
fill_in 'project_name_edit', with: 'hello world'
click_button 'Save changes'
page.within('.general-settings') do
click_button 'Save changes'
end
expect(page).to have_content "Project 'hello world' was successfully updated."
end
end
......
......@@ -20,6 +20,9 @@ feature 'Project settings > Merge Requests', :js do
expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved')
select 'Disabled', from: "project_project_feature_attributes_merge_requests_access_level"
within('.sharing-permissions-form') do
click_on('Save changes')
end
expect(page).not_to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).not_to have_content('Only allow merge requests to be merged if all discussions are resolved')
......@@ -37,6 +40,9 @@ feature 'Project settings > Merge Requests', :js do
expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved')
select 'Everyone with access', from: "project_project_feature_attributes_builds_access_level"
within('.sharing-permissions-form') do
click_on('Save changes')
end
expect(page).to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved')
......@@ -55,6 +61,9 @@ feature 'Project settings > Merge Requests', :js do
expect(page).not_to have_content('Only allow merge requests to be merged if all discussions are resolved')
select 'Everyone with access', from: "project_project_feature_attributes_merge_requests_access_level"
within('.sharing-permissions-form') do
click_on('Save changes')
end
expect(page).to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved')
......@@ -73,7 +82,9 @@ feature 'Project settings > Merge Requests', :js do
scenario 'when unchecked sets :printing_merge_request_link_enabled to false' do
uncheck('project_printing_merge_request_link_enabled')
click_on('Save')
within('.merge-request-settings-form') do
click_on('Save changes')
end
# Wait for save to complete and page to reload
checkbox = find_field('project_printing_merge_request_link_enabled')
......
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