Skip to content

Commit

Permalink
feat(sidebar): Always show all tabs in the Organization Settings view…
Browse files Browse the repository at this point in the history
… (Part 2) (#65625)

* Removed show prop so tabs are always shown regardless of access
* Continuation of getsentry/getsentry#13022

Rate-limit page
<img width="948" alt="image"
src="https://github.com/getsentry/sentry/assets/33237075/f9650136-16c2-4b6f-b969-deddb0a7e5c0">
  • Loading branch information
iamrajjoshi authored Feb 22, 2024
1 parent bf85769 commit 9af303c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const organizationNavigation: NavigationSection[] = [
{
path: `${pathPrefix}/members/`,
title: t('Members'),
show: ({access}) => access!.has('member:read'),
description: t('Manage user membership for an organization'),
id: 'members',
},
Expand Down Expand Up @@ -64,8 +63,7 @@ const organizationNavigation: NavigationSection[] = [
{
path: `${pathPrefix}/rate-limits/`,
title: t('Rate Limits'),
show: ({access, features}) =>
features!.has('legacy-rate-limits') && access!.has('org:write'),
show: ({features}) => features!.has('legacy-rate-limits'),
description: t('Configure rate limits for all projects in the organization'),
id: 'rate-limits',
},
Expand Down
11 changes: 10 additions & 1 deletion static/app/views/settings/organizationRateLimits/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import withOrganization from 'sentry/utils/withOrganization';
import PermissionAlert from 'sentry/views/settings/organization/permissionAlert';

import OrganizationRateLimits from './organizationRateLimits';

function OrganizationRateLimitsContainer(
props: React.ComponentProps<typeof OrganizationRateLimits>
) {
return !props.organization ? null : <OrganizationRateLimits {...props} />;
if (!props.organization) {
return null;
}

return props.organization.access.includes('org:write') ? (
<OrganizationRateLimits {...props} />
) : (
<PermissionAlert />
);
}

export default withOrganization(OrganizationRateLimitsContainer);

0 comments on commit 9af303c

Please sign in to comment.