Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sidebars/user_settings/menus/password_menu.rb')
-rw-r--r--lib/sidebars/user_settings/menus/password_menu.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/sidebars/user_settings/menus/password_menu.rb b/lib/sidebars/user_settings/menus/password_menu.rb
new file mode 100644
index 00000000000..9a53e0c727e
--- /dev/null
+++ b/lib/sidebars/user_settings/menus/password_menu.rb
@@ -0,0 +1,39 @@
+# frozen_string_literal: true
+
+module Sidebars
+ module UserSettings
+ module Menus
+ class PasswordMenu < ::Sidebars::Menu
+ override :link
+ def link
+ edit_profile_password_path
+ end
+
+ override :title
+ def title
+ _('Password')
+ end
+
+ override :sprite_icon
+ def sprite_icon
+ 'lock'
+ end
+
+ override :render?
+ def render?
+ !!context.current_user&.allow_password_authentication?
+ end
+
+ override :active_routes
+ def active_routes
+ { controller: :passwords }
+ end
+
+ override :extra_container_html_options
+ def extra_container_html_options
+ { 'data-qa-selector': 'profile_password_link' }
+ end
+ end
+ end
+ end
+end