Skip to content

Hide integrations section if not matching search

Thomas Hutterer requested to merge 326749-hide-missed-section into master

What does this MR do and why?

This is a small follow-up to !96873 (merged), filtering another section that I overlooked in GDK and only spotted when verifying in production.

Screenshots or screen recordings

header header
before_integrations_fix after_integrations_fix

How to set up and validate locally

The Integrations section isn't visible in a default GDK setup, as neither GitPod nor Sourcegraph are active there. The quickest way to make the section appear is to "hack" GitPod to be there. This makes the Vue app show the section:

diff --git a/app/helpers/preferences_helper.rb b/app/helpers/preferences_helper.rb
index 57afe0ed0be..9056dc04a50 100644
--- a/app/helpers/preferences_helper.rb
+++ b/app/helpers/preferences_helper.rb
@@ -107,7 +107,7 @@ def language_choices
 
   def integration_views
     [].tap do |views|
-      views << { name: 'gitpod', message: gitpod_enable_description, message_url: gitpod_url_placeholder, help_link: help_page_path('integration/gitpod.md') } if Gitlab::CurrentSettings.gitpod_enabled
+      views << { name: 'gitpod', message: gitpod_enable_description, message_url: gitpod_url_placeholder, help_link: help_page_path('integration/gitpod.md') }
       views << { name: 'sourcegraph', message: sourcegraph_url_message, message_url: Gitlab::CurrentSettings.sourcegraph_url, help_link: help_page_path('user/profile/preferences.md', anchor: 'sourcegraph') } if Gitlab::Sourcegraph.feature_available? && Gitlab::CurrentSettings.sourcegraph_enabled
     end
   end
  • Now go to http://gdk.test:3000/-/profile/preferences and you should see the Integrations section at the bottom of the page.
  • Now search for "xxxxxxx" on this page with the searchbar on the top.
  • All sections, incl the Integrations section shoud be hidden.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading