Skip to content

Fix "Confirm user" button on tabs other than "Account" and "SSH keys" in admin area

📖 What does this MR do?

Related to #335900 (closed)

In !64812 (merged) we moved the Confirm user button to the header which made it available on all the tabs. Due to some missing JavaScript and a JavaScript error the Confirm user currently only works on the Account and SSH keys tabs. This MR adds the missing JavaScript, fixes the error that was causing issues, and refactors some JavaScript in the process.

💻 Local testing

  1. Login as an Admin (root user in GDK)
  2. Navigate to Menu -> Admin -> Users and note the username of one of the users
  3. In your terminal in the gdk/gitlab directory run bin/rails console
  4. Run the following commands
    • user = User.find_by_username('<user name>')
    • user.confirmed_at = nil
    • user.save
  5. Navigate to Menu -> Admin -> Users and choose that user
  6. The Confirm user button should work in all of the tabs

📹 Videos

Before After
Screen_Recording_2021-07-12_at_1.23.57_PM720p Screen_Recording_2021-07-12_at_1.22.54_PM720p

🚦 Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Peter Hegman

Merge request reports

Loading