Add Places group to default search view

What does this MR do and why?

Add Places group to default search view

This copies the previously-named "persistent links" from the context switcher dropdown to the default view of the global search modal.

Part of #409522 (closed).

Iteration Merge request
Add context switcher items to global search mod... (#409522 - closed), copying "static" links over only 👈 You are here!
Add context switcher items to global search mod... (#409522 - closed), copying frequent projects/groups only none yet
Replace the tertiary 🔎 button in the navigatio... (#415809 - closed) !127935 (merged)
Replace the context switcher toggle with contex... (#415811 - closed) none yet
Tidy up the context switcher changes (#415812 - closed) none yet

Commits

Flatten/simplify result list template conditionals

Add Places group to default search view

This copies the previously-named "persistent links" from the context switcher dropdown to the default view of the global search modal.

The recent issues and merge requests links are now only shown when in a context which has them. This avoids sending issue/merge request dashboard links to non-logged in users, who would just be redirected to the login page anyway.

This also preserves/extends a feature added in !114285 (merged), which hides issue-related links from users in projects with the feature disabled.

Part of #409522 (closed).

Screenshots or screen recordings

State Before After Notes
Logged in, no context logged_in__no_context logged_in__no_context
Logged out, no context logged_out__no_context logged_out__no_context In Before, the recent issues and merge requests links pointed to the /dashboard/* pages, which redirect to the login page, which isn't that useful. So, they've been hidden.
Logged in, group context logged_in__group_context logged_in__group_context
Logged out, group context logged_out__group_context logged_out__group_context
Logged in, project context logged_in__project_context logged_in__project_context
Logged out, project context logged_out__project_context logged_out__project_context
Logged in, project context, issues disabled logged_in__project_context_no_issues logged_in__project_no_issues_context
Logged out, project context, issues disabled logged_out__project_context_no_issues logged_out__project_no_issues_context In Before, the recent issues link pointed to the /dashboard/issues page, which redirects to the login page, which isn't that useful. So, it's been hidden.

How to set up and validate locally

Logged out state

  1. echo "Feature.enable(:super_sidebar_logged_out)" | rails c
  2. Visit a publicly visible page, like a public project, group or /explore. (The root path / redirects to the login page, so isn't useful.)
  3. Open the search modal by pressing /, or clicking the search icon in the sidebar.

Logged in state

  1. Visit any page.
  2. Open the search modal by pressing /, or clicking the search icon in the sidebar.

MR acceptance checklist

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

Edited by Mark Florian

Merge request reports

Loading