Skip to content
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

Fix project display name when listing invitations #3788

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion internal/controlplane/handlers_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,19 @@ func (s *Server) ListInvitations(ctx context.Context, _ *pb.ListInvitationsReque
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get project: %s", err)
}

// Parse the project metadata, so we can get the display name set by project owner
meta, err := projects.ParseMetadata(&targetProject)
if err != nil {
return nil, status.Errorf(codes.Internal, "error parsing project metadata: %v", err)
}

invitations = append(invitations, &pb.Invitation{
Code: i.Code,
Role: i.Role,
Email: i.Email,
Project: i.Project.String(),
ProjectDisplay: targetProject.Name,
ProjectDisplay: meta.Public.DisplayName,
CreatedAt: timestamppb.New(i.CreatedAt),
ExpiresAt: invite.GetExpireIn7Days(i.UpdatedAt),
Expired: invite.IsExpired(i.UpdatedAt),
Expand Down