diff --git a/app/views/admin/identities/edit.html.haml b/app/views/admin/identities/edit.html.haml
index 1ad6ce969cb..fa09138c502 100644
--- a/app/views/admin/identities/edit.html.haml
+++ b/app/views/admin/identities/edit.html.haml
@@ -1,3 +1,6 @@
+- add_to_breadcrumbs "Users", admin_users_path
+- add_to_breadcrumbs @user.name, admin_user_identities_path(@user)
+- breadcrumb_title "Edit Identity"
- page_title _("Edit"), @identity.provider, _("Identities"), @user.name, _("Users")
%h3.page-title
= _('Edit identity for %{user_name}') % { user_name: @user.name }
diff --git a/app/views/admin/identities/index.html.haml b/app/views/admin/identities/index.html.haml
index 59373ee6752..df3df159947 100644
--- a/app/views/admin/identities/index.html.haml
+++ b/app/views/admin/identities/index.html.haml
@@ -1,3 +1,5 @@
+- add_to_breadcrumbs "Users", admin_users_path
+- breadcrumb_title @user.name
- page_title _("Identities"), @user.name, _("Users")
= render 'admin/users/head'
diff --git a/app/views/admin/identities/new.html.haml b/app/views/admin/identities/new.html.haml
index ee743b0fd3c..c28d22625b5 100644
--- a/app/views/admin/identities/new.html.haml
+++ b/app/views/admin/identities/new.html.haml
@@ -1,3 +1,6 @@
+- add_to_breadcrumbs "Users", admin_users_path
+- add_to_breadcrumbs @user.name, admin_user_identities_path(@user)
+- breadcrumb_title "New Identity"
- page_title _("New Identity")
%h3.page-title= _('New identity')
%hr
diff --git a/app/views/admin/impersonation_tokens/index.html.haml b/app/views/admin/impersonation_tokens/index.html.haml
index 1378dde52ab..9e490713ef3 100644
--- a/app/views/admin/impersonation_tokens/index.html.haml
+++ b/app/views/admin/impersonation_tokens/index.html.haml
@@ -1,3 +1,5 @@
+- add_to_breadcrumbs "Users", admin_users_path
+- breadcrumb_title @user.name
- page_title "Impersonation Tokens", @user.name, "Users"
= render 'admin/users/head'
diff --git a/app/views/admin/users/keys.html.haml b/app/views/admin/users/keys.html.haml
index 0f644121e62..103bbb3b063 100644
--- a/app/views/admin/users/keys.html.haml
+++ b/app/views/admin/users/keys.html.haml
@@ -1,3 +1,5 @@
+- add_to_breadcrumbs "Users", admin_users_path
+- breadcrumb_title @user.name
- page_title "SSH Keys", @user.name, "Users"
= render 'admin/users/head'
= render 'profiles/keys/key_table', admin: true
diff --git a/app/views/admin/users/projects.html.haml b/app/views/admin/users/projects.html.haml
index cf50d45f755..3d39c1da408 100644
--- a/app/views/admin/users/projects.html.haml
+++ b/app/views/admin/users/projects.html.haml
@@ -1,3 +1,5 @@
+- add_to_breadcrumbs "Users", admin_users_path
+- breadcrumb_title @user.name
- page_title "Groups and projects", @user.name, "Users"
= render 'admin/users/head'
diff --git a/changelogs/unreleased/47419-Fix-breadcrumbs.yml b/changelogs/unreleased/47419-Fix-breadcrumbs.yml
new file mode 100644
index 00000000000..1a7f8196683
--- /dev/null
+++ b/changelogs/unreleased/47419-Fix-breadcrumbs.yml
@@ -0,0 +1,5 @@
+---
+title: Fix breadcrumbs in Admin/User interface.
+merge_request: 19608
+author: Robin Naundorf
+type: fixed
diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb
index 9e3221577c7..6c194c9a646 100644
--- a/spec/features/admin/admin_users_spec.rb
+++ b/spec/features/admin/admin_users_spec.rb
@@ -315,6 +315,40 @@ describe "Admin::Users" do
end
end
+ describe 'show breadcrumbs' do
+ it do
+ visit admin_user_path(user)
+
+ check_breadcrumb(user.name)
+
+ visit projects_admin_user_path(user)
+
+ check_breadcrumb(user.name)
+
+ visit keys_admin_user_path(user)
+
+ check_breadcrumb(user.name)
+
+ visit admin_user_impersonation_tokens_path(user)
+
+ check_breadcrumb(user.name)
+
+ visit admin_user_identities_path(user)
+
+ check_breadcrumb(user.name)
+
+ visit new_admin_user_identity_path(user)
+
+ check_breadcrumb("New Identity")
+
+ visit admin_user_identities_path(user)
+
+ find('.table').find(:link, 'Edit').click
+
+ check_breadcrumb("Edit Identity")
+ end
+ end
+
describe 'show user attributes' do
it do
visit admin_users_path
@@ -409,4 +443,8 @@ describe "Admin::Users" do
expect(page).not_to have_content('twitter')
end
end
+
+ def check_breadcrumb(content)
+ expect(find('.breadcrumbs-sub-title')).to have_content(content)
+ end
end