Skip to content

feat(teams): Add avatar upload UI to team settings#117140

Merged
shashjar merged 22 commits into
masterfrom
shashjar/add-avatar-upload-UI-to-team-settings
Jun 10, 2026
Merged

feat(teams): Add avatar upload UI to team settings#117140
shashjar merged 22 commits into
masterfrom
shashjar/add-avatar-upload-UI-to-team-settings

Conversation

@shashjar

@shashjar shashjar commented Jun 8, 2026

Copy link
Copy Markdown
Member

One of multiple PRs to fix #49864.

Follow-up to #117137.

Adds the team type to the AvatarChooser component with TeamAvatar preview. Wires AvatarChooser into the team settings page between the form and "Team Administration" panel. All existing <TeamAvatar> usages (~20 sites) automatically render uploaded avatars (or continue to render the letters if no specific avatar image is uploaded).

Before

image

After

image

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 8, 2026
@shashjar shashjar requested review from a team June 8, 2026 21:44
@shashjar shashjar marked this pull request as ready for review June 8, 2026 21:44
@shashjar shashjar requested a review from a team as a code owner June 8, 2026 21:44
@shashjar shashjar removed the request for review from a team June 8, 2026 21:44
Comment thread static/app/views/settings/organizationTeams/teamSettings/index.tsx
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 93.67% 93.67% ±0%
Typed 132,573 132,574 🟢 +1
Untyped 8,963 8,965 🔴 +2
🔍 2 new type safety issues introduced

Type assertions (as) (2 new)

File Line Detail
static/app/components/avatarChooser/index.tsx 240 as Teammodel as Team
static/app/views/settings/organizationTeams/teamSettings/index.tsx 171 as Teamresp as Team

This is informational only and does not block the PR.

shashjar added 3 commits June 8, 2026 15:26
…into shashjar/add-team-avatar-API-endpoint-and-photo-serving-view
…-view' into shashjar/add-avatar-upload-UI-to-team-settings
Comment thread static/app/views/settings/organizationTeams/teamSettings/index.tsx
shashjar and others added 2 commits June 9, 2026 09:27
…7137)

One of multiple PRs to fix
#49864.

Follow-up to #117132.

These endpoints were previously removed in
#61633.

Adds `GET/PUT /api/0/teams/{org}/{team}/avatar/` endpoints for reading
and uploading team avatars. Adds a `/team-avatar/{ident}/` photo serving
view for rendering avatar images. Follows the same patterns as
`OrganizationAvatarEndpoint` and `OrganizationAvatarPhotoView`.

Will be followed up by the frontend work to incorporate team avatars
into the UI.

---------

Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Base automatically changed from shashjar/add-team-avatar-API-endpoint-and-photo-serving-view to shashjar/update-team-serializer-to-return-avatar-data June 9, 2026 17:23
@shashjar shashjar requested review from a team as code owners June 9, 2026 17:23
Comment thread src/sentry/web/urls.py Outdated
Comment thread static/app/components/avatarChooser/index.tsx

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3f0ca8e. Configure here.

Comment thread static/app/views/settings/organizationTeams/teamSettings/index.tsx
Base automatically changed from shashjar/update-team-serializer-to-return-avatar-data to master June 9, 2026 21:52
@shashjar shashjar requested a review from a team as a code owner June 9, 2026 21:52
type === 'user' ? (
<UserAvatar {...sharedAvatarProps} user={model as AvatarUser} />
) : type === 'team' ? (
<TeamAvatar {...sharedAvatarProps} team={model as Team} />

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Will fix the type safety issues in a follow-up

@shashjar shashjar removed request for a team June 9, 2026 22:20
@shashjar shashjar merged commit 65674a3 into master Jun 10, 2026
77 checks passed
@shashjar shashjar deleted the shashjar/add-avatar-upload-UI-to-team-settings branch June 10, 2026 18:11
shashjar added a commit that referenced this pull request Jun 10, 2026
…on `type` (#117348)

Follow-up to #117140.

Refactors `AvatarChooserProps` from a single loose interface into a
discriminated union on the `type` prop, so each variant pairs the
correct `model` type with a correctly-typed `onSave` callback. Removes
the `resp as Team` cast in team settings, since `resp` is now typed as
`Team` by the union.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avatars for teams

3 participants