- Notifications
You must be signed in to change notification settings - Fork928
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Usesqlc.embed
, and another idea is to ropeGetGroupByID
andGetGroupsByOrgAndName
into theGetGroups
query.
It feels weird, but it guarantees 1fetch
query on the backend, and therefore 1 grouptype
.
I did this withOrganizationMembers
and use a wrapper func to convert the:Many
to:One
query:
coder/coderd/httpmw/organizationparam.go
Lines 123 to 126 ine000bd1
organizationMember,err:=database.ExpectOne(db.OrganizationMembers(ctx, database.OrganizationMembersParams{ | |
OrganizationID:organization.ID, | |
UserID:user.ID, | |
})) |
The alternative is making a view, but those are kinda a pain to maintain with migrations. I'll let you make that call based on where the types are used. It is just annoying to havedatabase.GetGroupRow
anddatabase.Group
types in the BE sometimes.
Uh oh!
There was an error while loading.Please reload this page.
I am not against this, but it sounds like it might be a little out of my comfort zone, and probably big enough for a PR of its own |
Definitely agree. This is one of the reasons row-typing can be really nice on the backend, but we're not replacing Go anytime soon. :p |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
49afab1
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Closes#14213
Show the organization the group is from on the user profile page for multi-org deployments