Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions static/app/components/core/avatar/organizationAvatar.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import * as Sentry from '@sentry/react';

import type {OrganizationSummary} from 'sentry/types/organization';
import {explodeSlug} from 'sentry/utils';
Comment on lines 3 to 4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should try to no tie core components to sentry specific types / utils. Maybe this shouldn’t be in scraps ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was moved here initially because it was part of the Scraps initial component set, but I agree that we should either move it out of scraps, or make it's interface not tied to the Sentry type

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep it out of the scope of this PR though, it's going to be a larger change


Expand All @@ -15,6 +17,7 @@ export function OrganizationAvatar({
}: OrganizationAvatarProps) {
if (!organization) {
// @TODO(jonasbadalic): Do we need a placeholder here?
Sentry.captureMessage('OrganizationAvatar: organization summary is undefined');
Copy link
Member Author

@JonasBa JonasBa Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing screams if I remove the undefined type, but I don't trust the types here, so I would like to see some data first

return null;
}

Expand Down
5 changes: 3 additions & 2 deletions static/app/views/nav/mobileTopbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {useLocation} from 'sentry/utils/useLocation';
import useOnClickOutside from 'sentry/utils/useOnClickOutside';
import useOrganization from 'sentry/utils/useOrganization';
import {NAV_MOBILE_TOPBAR_HEIGHT} from 'sentry/views/nav/constants';
import {OrgDropdown} from 'sentry/views/nav/orgDropdown';
import {OrganizationDropdown} from 'sentry/views/nav/organizationDropdown';
import {PrimaryNavigationItems} from 'sentry/views/nav/primary/index';
import {SecondaryMobile} from 'sentry/views/nav/secondary/secondaryMobile';
import {useActiveNavGroup} from 'sentry/views/nav/useActiveNavGroup';
Expand Down Expand Up @@ -49,7 +49,8 @@ function MobileTopbar() {
return (
<Topbar showSuperuserWarning={showSuperuserWarning}>
<Left>
<OrgDropdown onClick={() => setView('closed')} />
{/* If the view is not closed, it will render under the full screen mobile menu */}
<OrganizationDropdown onClick={() => setView('closed')} />
{showSuperuserWarning && (
<Hook name="component:superuser-warning" organization={organization} />
)}
Expand Down
227 changes: 0 additions & 227 deletions static/app/views/nav/orgDropdown.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {CUSTOM_REFERRER_KEY} from 'sentry/constants';
import ConfigStore from 'sentry/stores/configStore';
import OrganizationsStore from 'sentry/stores/organizationsStore';
import {readStorageValue} from 'sentry/utils/useSessionStorage';
import {OrgDropdown} from 'sentry/views/nav/orgDropdown';
import {OrganizationDropdown} from 'sentry/views/nav/organizationDropdown';

describe('OrgDropdown', () => {
describe('OrganizationDropdown', () => {
const organization = OrganizationFixture({
access: ['org:read', 'member:read', 'team:read'],
});
Expand All @@ -19,7 +19,7 @@ describe('OrgDropdown', () => {
});

it('displays org info and links', async () => {
render(<OrgDropdown />, {organization});
render(<OrganizationDropdown />, {organization});

await userEvent.click(screen.getByRole('button', {name: 'Toggle organization menu'}));

Expand Down Expand Up @@ -47,7 +47,7 @@ describe('OrgDropdown', () => {
OrganizationFixture({id: '2', name: 'Org 2', slug: 'org-2'})
);

render(<OrgDropdown />, {organization});
render(<OrganizationDropdown />, {organization});

await userEvent.click(screen.getByRole('button', {name: 'Toggle organization menu'}));
await userEvent.hover(screen.getByText('Switch Organization'));
Expand Down Expand Up @@ -83,7 +83,7 @@ describe('OrgDropdown', () => {
})
);

render(<OrgDropdown />, {organization});
render(<OrganizationDropdown />, {organization});

await userEvent.click(screen.getByRole('button', {name: 'Toggle organization menu'}));
await userEvent.hover(screen.getByText('Switch Organization'));
Expand All @@ -106,7 +106,7 @@ describe('OrgDropdown', () => {
});

it('clicking project sets referrer in session storage', async () => {
render(<OrgDropdown />, {organization});
render(<OrganizationDropdown />, {organization});
await userEvent.click(screen.getByRole('button', {name: 'Toggle organization menu'}));
// We use onAction to navigate, no href is set:
expect(screen.getByRole('menuitemradio', {name: 'Projects'})).not.toHaveAttribute(
Expand Down
Loading
Loading