diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-03-16 11:40:40 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-03-16 11:40:40 +0000 |
commit | 3735266d844465c33294983538928afbe3f2c080 (patch) | |
tree | 20307903cea3e189b8930d787589a218480fc961 | |
parent | 43c981c7d8a638e47c40a5e4455cbcf0775488a4 (diff) | |
parent | 37ce638ccd476144fe9235a4d091be4135a3e00a (diff) | |
download | gitlab-ce-3735266d844465c33294983538928afbe3f2c080.tar.gz |
Merge branch 'fix_visibility_level' into 'master'
Fix visibility level on new project page
Closes #19253
See merge request !9885
-rw-r--r-- | app/views/projects/new.html.haml | 3 | ||||
-rw-r--r-- | changelogs/unreleased/fix_visibility_level.yml | 4 | ||||
-rw-r--r-- | spec/features/projects/new_project_spec.rb | 9 |
3 files changed, 15 insertions, 1 deletions
diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index 2a98bba05ee..d129da943f8 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -1,5 +1,6 @@ - page_title 'New Project' - header_title "Projects", dashboard_projects_path +- visibility_level = params.dig(:project, :visibility_level) || default_project_visibility .project-edit-container .project-edit-errors @@ -95,7 +96,7 @@ = f.label :visibility_level, class: 'label-light' do Visibility Level = link_to icon('question-circle'), help_page_path("public_access/public_access") - = render 'shared/visibility_level', f: f, visibility_level: default_project_visibility, can_change_visibility_level: true, form_model: @project, with_label: false + = render 'shared/visibility_level', f: f, visibility_level: visibility_level.to_i, can_change_visibility_level: true, form_model: @project, with_label: false = f.submit 'Create project', class: "btn btn-create project-submit", tabindex: 4 = link_to 'Cancel', dashboard_projects_path, class: 'btn btn-cancel' diff --git a/changelogs/unreleased/fix_visibility_level.yml b/changelogs/unreleased/fix_visibility_level.yml new file mode 100644 index 00000000000..4cf649124ca --- /dev/null +++ b/changelogs/unreleased/fix_visibility_level.yml @@ -0,0 +1,4 @@ +--- +title: Fix visibility level on new project page +merge_request: 9885 +author: blackst0ne diff --git a/spec/features/projects/new_project_spec.rb b/spec/features/projects/new_project_spec.rb index 45185f2dd1f..52196ce49bd 100644 --- a/spec/features/projects/new_project_spec.rb +++ b/spec/features/projects/new_project_spec.rb @@ -16,6 +16,15 @@ feature "New project", feature: true do expect(find_field("project_visibility_level_#{level}")).to be_checked end + + it 'saves visibility level on validation error' do + visit new_project_path + + choose(key) + click_button('Create project') + + expect(find_field("project_visibility_level_#{level}")).to be_checked + end end end |