Skip to content

feat: show organization name for groups on user profile #14448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Aug 29, 2024
Merged
Prev Previous commit
Next Next commit
sqlc.embed
  • Loading branch information
aslilac committed Aug 27, 2024
commit 164f8d66ec83ebc0c96da48c195d43832c6f4239
8 changes: 1 addition & 7 deletions coderd/database/dbmem/dbmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -2659,13 +2659,7 @@ func (q *FakeQuerier) GetGroups(_ context.Context, arg database.GetGroupsParams)
}

filtered = append(filtered, database.GetGroupsRow{
ID: group.ID,
Name: group.Name,
OrganizationID: group.OrganizationID,
AvatarURL: group.AvatarURL,
QuotaAllowance: group.QuotaAllowance,
DisplayName: group.DisplayName,
Source: group.Source,
Group: group,
OrganizationDisplayName: orgDisplayName,
})
}
Expand Down
24 changes: 9 additions & 15 deletions coderd/database/queries.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion coderd/database/queries/groups.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ LIMIT

-- name: GetGroups :many
SELECT
groups.*, organizations.display_name AS organization_display_name
sqlc.embed(groups), organizations.display_name AS organization_display_name
FROM
groups
INNER JOIN
Expand Down
16 changes: 8 additions & 8 deletions coderd/telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -669,15 +669,15 @@ func ConvertUser(dbUser database.User) User {
}
}

func ConvertGroup(group database.Group) Group {
func ConvertGroup(row database.GetGroupsRow) Group {
return Group{
ID: group.ID,
Name: group.Name,
OrganizationID: group.OrganizationID,
AvatarURL: group.AvatarURL,
QuotaAllowance: group.QuotaAllowance,
DisplayName: group.DisplayName,
Source: group.Source,
ID: row.Group.ID,
Name: row.Group.Name,
OrganizationID: row.Group.OrganizationID,
AvatarURL: row.Group.AvatarURL,
QuotaAllowance: row.Group.QuotaAllowance,
DisplayName: row.Group.DisplayName,
Source: row.Group.Source,
}
}

Expand Down
Loading