Skip to content

Hide organization switcher for users with one organization

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Background

Follow-up from https://gitlab.com/gitlab-com/gl-infra/tenant-scale/organizations/organizations-internal-feedback/-/issues/1#note_2711361120

Proposal

If a user has only one organization they should not see the organization switcher

Implementation guide

  1. Add a new method has_multiple_organizations? to User model. Something like organizations.limit(2).count > 1 might work.
  2. Add has_multiple_organizations: user.has_multiple_organizations? to app/helpers/sidebars_helper.rb#L66.
  3. In app/assets/javascripts/super_sidebar/components/super_topbar.vue#L57 check this.sidebarData.has_multiple_organizations
Edited by 🤖 GitLab Bot 🤖