Refactor @hide_search_settings assignment from HAML to controllers

What does this MR do and why?

This MR refactors the @hide_search_settings instance variable assignment from HAML views to their respective controllers across both FOSS and EE directories.

By moving these assignments into the controller layer, we adhere to strict MVC principles and improve code maintainability. This ensures that the view logic remains focused on presentation, while data preparation is handled by the controller.

Key Changes:

  • Removes the inline assignment from 12 views (7 FOSS, 5 EE) across profiles, admin, user_settings, and groups.
  • Updates 7 controllers (including EE extensions) to manage the visibility flag.

Affected controllers:

  • Profiles::PasskeysController
  • Profiles::ChatNamesController
  • UserSettings::PersonalAccessTokensController
  • UserSettings::PasswordsController
  • Admin::ApplicationSettingsController (including EE extension)
  • Groups::LdapGroupLinksController (EE)
  • Groups::HooksController (EE)

References

Screenshots or screen recordings

Before After
(No visual change expected) (No visual change expected)

How to set up and validate locally

  1. Sign in to your GDK instance as an admin user.
  2. Verify User Setting: Navigate to the Personal Access Tokens page: /-/user_settings/personal_access_tokens.
  3. Verify User Setting: Navigate to the Password Change page: /-/user_settings/password/edit.
  4. Verify Admin Setting: Navigate to Admin -> Settings -> Analytics: /admin/application_settings/analytics.
    • Note: Requires a license with product_analytics and the :product_analytics_admin_settings feature flag enabled.
  5. Verify Admin Setting: Navigate to Admin -> Settings -> Work Items: /admin/application_settings/work_item.
    • Note: Requires the :work_item_configurable_types feature flag enabled.
  6. Verify Group Setting: Navigate to Group Settings -> Webhooks: /groups/<group-name>/-/hooks.
    • Note: Requires the group to have the group_webhooks licensed feature.
  7. Verify Group Setting: Navigate to Group Settings -> LDAP Groups: /groups/<group-name>/-/ldap_group_links.
    • Note: Requires LDAP to be enabled in your gitlab.yml.
  8. Verify User Setting (Optional): Navigate to the Passkeys page: /-/profile/passkeys/new.
  9. Verify User Setting (Optional): Navigate to the Chat Names page: /-/user_settings/integration_accounts.
  10. Verify that the "Search settings" bar is successfully hidden on all these pages.

MR acceptance checklist

Check the MR acceptance checklist.

  • Moved variable assignments to controllers (FOSS & EE)
  • Removed assignments from HAML views (FOSS & EE)
  • Evaluated against GitLab MR acceptance checklist
  • Tests pass locally
Edited by Sijin T V

Merge request reports

Loading