mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:47:32 +00:00
chore(console): remove first and lastName fallback from user (#5629)
* chore(console): remove first and lastName fallback from user * use display name and ensure it's set without required name fields * add user type to user grant and memberships responses * contributor, members * fix avatar display checks --------- Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
"github.com/zitadel/zitadel/internal/api/authz"
|
||||
"github.com/zitadel/zitadel/internal/api/call"
|
||||
"github.com/zitadel/zitadel/internal/domain"
|
||||
"github.com/zitadel/zitadel/internal/errors"
|
||||
"github.com/zitadel/zitadel/internal/query/projection"
|
||||
"github.com/zitadel/zitadel/internal/telemetry/tracing"
|
||||
@@ -124,10 +125,12 @@ func prepareOrgMembersQuery(ctx context.Context, db prepareDatabase) (sq.SelectB
|
||||
HumanDisplayNameCol.identifier(),
|
||||
MachineNameCol.identifier(),
|
||||
HumanAvatarURLCol.identifier(),
|
||||
UserTypeCol.identifier(),
|
||||
countColumn.identifier(),
|
||||
).From(orgMemberTable.identifier()).
|
||||
LeftJoin(join(HumanUserIDCol, OrgMemberUserID)).
|
||||
LeftJoin(join(MachineUserIDCol, OrgMemberUserID)).
|
||||
LeftJoin(join(UserIDCol, OrgMemberUserID)).
|
||||
LeftJoin(join(LoginNameUserIDCol, OrgMemberUserID) + db.Timetravel(call.Took(ctx))).
|
||||
Where(
|
||||
sq.Eq{LoginNameIsPrimaryCol.identifier(): true},
|
||||
@@ -147,6 +150,7 @@ func prepareOrgMembersQuery(ctx context.Context, db prepareDatabase) (sq.SelectB
|
||||
displayName = sql.NullString{}
|
||||
machineName = sql.NullString{}
|
||||
avatarURL = sql.NullString{}
|
||||
userType = sql.NullInt32{}
|
||||
)
|
||||
|
||||
err := rows.Scan(
|
||||
@@ -163,6 +167,7 @@ func prepareOrgMembersQuery(ctx context.Context, db prepareDatabase) (sq.SelectB
|
||||
&displayName,
|
||||
&machineName,
|
||||
&avatarURL,
|
||||
&userType,
|
||||
|
||||
&count,
|
||||
)
|
||||
@@ -181,6 +186,7 @@ func prepareOrgMembersQuery(ctx context.Context, db prepareDatabase) (sq.SelectB
|
||||
} else {
|
||||
member.DisplayName = machineName.String
|
||||
}
|
||||
member.UserType = domain.UserType(userType.Int32)
|
||||
|
||||
members = append(members, member)
|
||||
}
|
||||
|
Reference in New Issue
Block a user