Commit 1f2628fe authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Allow Group path to be changed at the same time as name

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 52a8e5c0
...@@ -21,17 +21,6 @@ ...@@ -21,17 +21,6 @@
= link_to 'Cancel', admin_groups_path, class: "btn btn-cancel" = link_to 'Cancel', admin_groups_path, class: "btn btn-cancel"
- else - else
.form-group.group_name_holder
= f.label :path, class: 'control-label' do
%span Group path
.col-sm-10
= f.text_field :path, placeholder: "example-group", class: "form-control danger"
.bs-callout.bs-callout-danger
%ul
%li Changing group path can have unintended side effects.
%li Renaming group path will rename directory for all related projects
%li It will change web url for access group and group projects.
%li It will change the git path to repositories under this group.
.form-actions .form-actions
= f.submit 'Save changes', class: "btn btn-primary" = f.submit 'Save changes', class: "btn btn-primary"
= link_to 'Cancel', admin_group_path(@group), class: "btn btn-cancel" = link_to 'Cancel', admin_group_path(@group), class: "btn btn-cancel"
......
...@@ -14,6 +14,13 @@ ...@@ -14,6 +14,13 @@
= root_url = root_url
= f.text_field :path, placeholder: 'open-source', class: 'form-control', = f.text_field :path, placeholder: 'open-source', class: 'form-control',
autofocus: local_assigns[:autofocus] || false autofocus: local_assigns[:autofocus] || false
- if @group.persisted?
.bs-callout.bs-callout-danger
%ul
%li Changing group path can have unintended side effects.
%li Renaming group path will rename directory for all related projects
%li It will change web url for access group and group projects.
%li It will change the git path to repositories under this group.
.form-group.group-description-holder .form-group.group-description-holder
= f.label :description, 'Details', class: 'control-label' = f.label :description, 'Details', class: 'control-label'
......
...@@ -77,7 +77,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps ...@@ -77,7 +77,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end end
step 'submit form with new group "Samurai" info' do step 'submit form with new group "Samurai" info' do
fill_in 'group_name', with: 'Samurai' fill_in 'group_path', with: 'Samurai'
fill_in 'group_description', with: 'Tokugawa Shogunate' fill_in 'group_description', with: 'Tokugawa Shogunate'
click_button "Create group" click_button "Create group"
end end
...@@ -94,6 +94,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps ...@@ -94,6 +94,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
step 'I change group "Owned" name to "new-name"' do step 'I change group "Owned" name to "new-name"' do
fill_in 'group_name', with: 'new-name' fill_in 'group_name', with: 'new-name'
fill_in 'group_path', with: 'new-name'
click_button "Save group" click_button "Save group"
end end
......
...@@ -3,7 +3,7 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps ...@@ -3,7 +3,7 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps
include SharedPaths include SharedPaths
step 'fill project form with valid data' do step 'fill project form with valid data' do
fill_in 'project_name', with: 'Empty' fill_in 'project_path', with: 'Empty'
click_button "Create project" click_button "Create project"
end end
......
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