Skip to content

Scheduling infrastructure for absolutely everyone.

fix: settings layout for org admin (#14723)

Udit Takkar74166fc2cbab
diff --git a/packages/features/settings/layouts/SettingsLayout.tsx b/packages/features/settings/layouts/SettingsLayout.tsx
index 22817352095..956adc6b92e 100644
--- a/packages/features/settings/layouts/SettingsLayout.tsx
+++ b/packages/features/settings/layouts/SettingsLayout.tsx
@@ -107,6 +107,12 @@ const tabs: VerticalTabItemProps[] = [
icon: "users",
children: [],
},
+ {
+ name: "other_teams",
+ href: "/settings/organizations/teams/other",
+ icon: "users",
+ children: [],
+ },
{
name: "admin",
href: "/settings/admin",
@@ -182,6 +188,7 @@ const useTabs = () => {
// check if name is in adminRequiredKeys
return processedTabs.filter((tab) => {
if (organizationRequiredKeys.includes(tab.name)) return !!orgBranding;
+ if (tab.name === "other_teams" && !isOrgAdminOrOwner) return false;
if (isAdmin) return true;
return !adminRequiredKeys.includes(tab.name);
@@ -392,17 +399,6 @@ const SettingsSidebarContainer = ({
const isOrgAdminOrOwner =
currentOrg && currentOrg?.user?.role && ["OWNER", "ADMIN"].includes(currentOrg?.user?.role);
- if (isOrgAdminOrOwner) {
- const teamsIndex = tabsWithPermissions.findIndex((tab) => tab.name === "teams");
-
- tabsWithPermissions.splice(teamsIndex + 1, 0, {
- name: "other_teams",
- href: "/settings/organizations/teams/other",
- icon: "users",
- children: [],
- });
- }
-
return (
<nav
style={{ maxHeight: `calc(100vh - ${bannersHeight}px)`, top: `${bannersHeight}px` }}