Browse Source

feat: Update organization switcher for Sentry 10 (#11859)

Lyn Nagara 6 years ago
parent
commit
f2401b574a

+ 11 - 8
src/sentry/static/sentry/app/components/sidebar/sidebarDropdown/switchOrganization.jsx

@@ -59,14 +59,17 @@ class SwitchOrganization extends React.Component {
                   {...getMenuProps({isStyled: true})}
                 >
                   <OrganizationList>
-                    {organizations.map(organization => (
-                      <SidebarMenuItem
-                        key={organization.slug}
-                        to={`/${organization.slug}/`}
-                      >
-                        <SidebarOrgSummary organization={organization} />
-                      </SidebarMenuItem>
-                    ))}
+                    {organizations.map(organization => {
+                      const url = new Set(organization.features).has('sentry10')
+                        ? `/organizations/${organization.slug}/`
+                        : `${organization.slug}/`;
+
+                      return (
+                        <SidebarMenuItem key={organization.slug} to={url}>
+                          <SidebarOrgSummary organization={organization} />
+                        </SidebarMenuItem>
+                      );
+                    })}
                   </OrganizationList>
                   {hasOrganizations &&
                     canCreateOrganization && <Divider css={{marginTop: 0}} />}