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, andgroups. - Updates 7 controllers (including EE extensions) to manage the visibility flag.
Affected controllers:
Profiles::PasskeysControllerProfiles::ChatNamesControllerUserSettings::PersonalAccessTokensControllerUserSettings::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
- Sign in to your GDK instance as an admin user.
-
Verify User Setting: Navigate to the Personal Access Tokens page:
/-/user_settings/personal_access_tokens. -
Verify User Setting: Navigate to the Password Change page:
/-/user_settings/password/edit. -
Verify Admin Setting: Navigate to Admin -> Settings -> Analytics:
/admin/application_settings/analytics.- Note: Requires a license with
product_analyticsand the:product_analytics_admin_settingsfeature flag enabled.
- Note: Requires a license with
-
Verify Admin Setting: Navigate to Admin -> Settings -> Work Items:
/admin/application_settings/work_item.- Note: Requires the
:work_item_configurable_typesfeature flag enabled.
- Note: Requires the
-
Verify Group Setting: Navigate to Group Settings -> Webhooks:
/groups/<group-name>/-/hooks.- Note: Requires the group to have the
group_webhookslicensed feature.
- Note: Requires the group to have the
-
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.
- Note: Requires LDAP to be enabled in your
-
Verify User Setting (Optional): Navigate to the Passkeys page:
/-/profile/passkeys/new. -
Verify User Setting (Optional): Navigate to the Chat Names page:
/-/user_settings/integration_accounts. - 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