Skip to content

Commit 234142a

Browse files
mrubenscte
authored andcommitted
Display the organization image in the account view (#4953)
1 parent 6a022d5 commit 234142a

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

packages/cloud/src/AuthService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ export class AuthService extends EventEmitter<AuthServiceEvents> {
488488
userInfo.organizationId = organization.id
489489
userInfo.organizationName = organization.name
490490
userInfo.organizationRole = primaryOrgMembership.role
491+
userInfo.organizationImageUrl = organization.image_url
491492
}
492493
}
493494
} catch (error) {

packages/types/src/cloud.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export interface CloudUserInfo {
1313
organizationId?: string
1414
organizationName?: string
1515
organizationRole?: string
16+
organizationImageUrl?: string
1617
}
1718

1819
/**

webview-ui/src/components/account/AccountView.tsx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,24 @@ export const AccountView = ({ userInfo, isAuthenticated, onDone }: AccountViewPr
4141
</div>
4242
)}
4343
</div>
44-
<h2 className="text-lg font-medium text-vscode-foreground mb-1">
44+
<h2 className="text-lg font-medium text-vscode-foreground mb-0">
4545
{userInfo?.name || t("account:unknownUser")}
4646
</h2>
47+
{userInfo?.email && (
48+
<p className="text-sm text-vscode-descriptionForeground">{userInfo?.email}</p>
49+
)}
4750
{userInfo?.organizationName && (
48-
<p className="text-sm text-vscode-descriptionForeground mb-1">
49-
{userInfo.organizationName}
50-
</p>
51+
<div className="flex items-center gap-2 text-sm text-vscode-descriptionForeground">
52+
{userInfo.organizationImageUrl && (
53+
<img
54+
src={userInfo.organizationImageUrl}
55+
alt={userInfo.organizationName}
56+
className="w-4 h-4 rounded object-cover"
57+
/>
58+
)}
59+
<span>{userInfo.organizationName}</span>
60+
</div>
5161
)}
52-
<p className="text-sm text-vscode-descriptionForeground">{userInfo?.email || ""}</p>
5362
</div>
5463
)}
5564
<div className="flex flex-col gap-2 mt-4">

0 commit comments

Comments
 (0)