Skip to content

Commit

Permalink
Fixes draft contributor names and sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
d13 committed Jan 18, 2024
1 parent 9935ae9 commit d2f8ed2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/plus/gk/account/organizationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export class OrganizationService implements Disposable {
if (this._fullOrganizations == null) {
this._fullOrganizations = new Map();
}
organization.members.sort((a, b) => (a.name ?? a.username).localeCompare(b.name ?? b.username));
this._fullOrganizations.set(id, organization);
}
return this._fullOrganizations.get(id);
Expand Down
2 changes: 1 addition & 1 deletion src/plus/webviews/patchDetails/patchDetailsWebview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ export class PatchDetailsWebviewProvider

const items = members.map(member => {
const item: OrganizationMemberQuickPickItem = {
label: member.name,
label: member.name ?? member.username,
description: member.email,
// TODO: needs to support current collaborator selections
picked: initSelections ? initSelections.has(member.id) : false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ export class GlDraftDetails extends GlTreeBase {
<gk-avatar .src=${userSelection.avatarUrl}></gk-avatar>
</div>
<div class="user-selection__info">
<div class="user-selection__name">${userSelection.member.name}</div>
<div class="user-selection__name">
${userSelection.member.name ?? userSelection.member.username}
</div>
</div>
<div class="user-selection__actions">
${when(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ export class GlPatchCreate extends GlTreeBase<GlPatchCreateEvents> {
<gk-avatar .src=${userSelection.avatarUrl}></gk-avatar>
</div>
<div class="user-selection__info">
<div class="user-selection__name">${userSelection.member.name}</div>
<div class="user-selection__name">
${userSelection.member.name ?? userSelection.member.username}
</div>
</div>
<div class="user-selection__actions">
<gk-popover>
Expand Down
7 changes: 7 additions & 0 deletions src/webviews/apps/plus/patchDetails/patchDetails.scss
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ textarea.message-input__control {

&__info {
flex: 1;
min-width: 0;
white-space: nowrap;
}

&__name {
overflow: hidden;
text-overflow: ellipsis;
}

&__actions {
Expand Down

0 comments on commit d2f8ed2

Please sign in to comment.