Skip to content

Commit 94c527f

Browse files
committed
fix(webapp): keep the query-only nav items behind query access
Extracting the side menu's sections lost the inner `isAdmin || featureFlags.hasQueryAccess` wrapper around Errors, Query, Queues and Dashboards. Until the previous commit the tight outer gate hid that - logs-only orgs never entered the block at all - so widening the outer gate to restore their Logs entry exposed all four to them. All four gate expressions now match the pre-extraction ones, and every item id the side menu builds is accounted for.
1 parent c8d7ec6 commit 94c527f

1 file changed

Lines changed: 38 additions & 34 deletions

File tree

apps/webapp/app/components/navigation/sideMenuSections.tsx

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -140,40 +140,44 @@ export function buildSideMenuSections({
140140
} satisfies SideMenuItemConfig,
141141
]
142142
: []),
143-
{
144-
id: "errors",
145-
name: "Errors",
146-
icon: BugIcon,
147-
activeIconColor: "text-errors",
148-
to: v3ErrorsPath(organization, project, environment),
149-
dataAction: "errors",
150-
},
151-
{
152-
id: "query",
153-
name: "Query",
154-
icon: CodeSquareIcon,
155-
activeIconColor: "text-query",
156-
to: queryPath(organization, project, environment),
157-
dataAction: "query",
158-
},
159-
{
160-
id: "queues",
161-
name: "Queues",
162-
icon: QueuesIcon,
163-
activeIconColor: "text-queues",
164-
to: v3QueuesPath(organization, project, environment),
165-
dataAction: "queues",
166-
},
167-
{
168-
id: "dashboards",
169-
name: "Dashboards",
170-
icon: ChartBarIcon,
171-
activeIconColor: "text-metrics",
172-
to: v3DashboardsLandingPath(organization, project, environment),
173-
dataAction: "dashboards-landing",
174-
action: dashboards?.action,
175-
after: dashboards?.after,
176-
},
143+
...(isAdmin || featureFlags.hasQueryAccess
144+
? [
145+
{
146+
id: "errors",
147+
name: "Errors",
148+
icon: BugIcon,
149+
activeIconColor: "text-errors",
150+
to: v3ErrorsPath(organization, project, environment),
151+
dataAction: "errors",
152+
} satisfies SideMenuItemConfig,
153+
{
154+
id: "query",
155+
name: "Query",
156+
icon: CodeSquareIcon,
157+
activeIconColor: "text-query",
158+
to: queryPath(organization, project, environment),
159+
dataAction: "query",
160+
} satisfies SideMenuItemConfig,
161+
{
162+
id: "queues",
163+
name: "Queues",
164+
icon: QueuesIcon,
165+
activeIconColor: "text-queues",
166+
to: v3QueuesPath(organization, project, environment),
167+
dataAction: "queues",
168+
} satisfies SideMenuItemConfig,
169+
{
170+
id: "dashboards",
171+
name: "Dashboards",
172+
icon: ChartBarIcon,
173+
activeIconColor: "text-metrics",
174+
to: v3DashboardsLandingPath(organization, project, environment),
175+
dataAction: "dashboards-landing",
176+
action: dashboards?.action,
177+
after: dashboards?.after,
178+
} satisfies SideMenuItemConfig,
179+
]
180+
: []),
177181
],
178182
});
179183
}

0 commit comments

Comments
 (0)