summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2018-10-06 18:05:14 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2018-10-06 18:05:14 +0000
commit2fce6d6f9b28bb8136c23ec89c0efe143694dbc4 (patch)
tree2c5d9b4d5abe82538a449ffbf889eac07d67573d
parent4c351e17eefb0f24979084219521f0426620a244 (diff)
parent75b2c9bf6f5529bf198fef92903ad27836487ca6 (diff)
downloadgitlab-ce-2fce6d6f9b28bb8136c23ec89c0efe143694dbc4.tar.gz
Merge branch '52242-ui-ux-bug-in-change-group-path' into 'master'
Fix invalid parent path on group settings page Closes #52242 See merge request gitlab-org/gitlab-ce!22142
-rw-r--r--app/views/groups/settings/_advanced.html.haml4
-rw-r--r--changelogs/unreleased/52242-ui-ux-bug-in-change-group-path.yml5
-rw-r--r--spec/features/groups/group_settings_spec.rb16
3 files changed, 23 insertions, 2 deletions
diff --git a/app/views/groups/settings/_advanced.html.haml b/app/views/groups/settings/_advanced.html.haml
index b7c673db705..3814d45929d 100644
--- a/app/views/groups/settings/_advanced.html.haml
+++ b/app/views/groups/settings/_advanced.html.haml
@@ -12,8 +12,8 @@
.group-root-path.input-group-prepend.has-tooltip{ title: group_path(@group), :'data-placement' => 'bottom' }
.input-group-text
%span>= root_url
- - if parent
- %strong= parent.full_path + '/'
+ - if @group.parent
+ %strong= @group.parent.full_path + '/'
= f.hidden_field :parent_id
= f.text_field :path, placeholder: 'open-source', class: 'form-control',
autofocus: local_assigns[:autofocus] || false, required: true,
diff --git a/changelogs/unreleased/52242-ui-ux-bug-in-change-group-path.yml b/changelogs/unreleased/52242-ui-ux-bug-in-change-group-path.yml
new file mode 100644
index 00000000000..3fea6f33451
--- /dev/null
+++ b/changelogs/unreleased/52242-ui-ux-bug-in-change-group-path.yml
@@ -0,0 +1,5 @@
+---
+title: Fix incorrect parent path on group settings page
+merge_request: 22142
+author:
+type: fixed
diff --git a/spec/features/groups/group_settings_spec.rb b/spec/features/groups/group_settings_spec.rb
index 59254ecc982..08fd9f8af2a 100644
--- a/spec/features/groups/group_settings_spec.rb
+++ b/spec/features/groups/group_settings_spec.rb
@@ -98,6 +98,22 @@ describe 'Edit group settings' do
end
end
+ describe 'edit group path' do
+ it 'has a root URL label for top-level group' do
+ visit edit_group_path(group)
+
+ expect(find(:css, '.group-root-path').text).to eq(root_url)
+ end
+
+ it 'has a parent group URL label for a subgroup group', :postgresql do
+ subgroup = create(:group, parent: group)
+
+ visit edit_group_path(subgroup)
+
+ expect(find(:css, '.group-root-path').text).to eq(group_url(subgroup.parent) + '/')
+ end
+ end
+
def update_path(new_group_path)
visit edit_group_path(group)