mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:37: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"
|
||||
@@ -122,10 +123,12 @@ func prepareInstanceMembersQuery(ctx context.Context, db prepareDatabase) (sq.Se
|
||||
HumanDisplayNameCol.identifier(),
|
||||
MachineNameCol.identifier(),
|
||||
HumanAvatarURLCol.identifier(),
|
||||
UserTypeCol.identifier(),
|
||||
countColumn.identifier(),
|
||||
).From(instanceMemberTable.identifier()).
|
||||
LeftJoin(join(HumanUserIDCol, InstanceMemberUserID)).
|
||||
LeftJoin(join(MachineUserIDCol, InstanceMemberUserID)).
|
||||
LeftJoin(join(UserIDCol, InstanceMemberUserID)).
|
||||
LeftJoin(join(LoginNameUserIDCol, InstanceMemberUserID) + db.Timetravel(call.Took(ctx))).
|
||||
Where(
|
||||
sq.Eq{LoginNameIsPrimaryCol.identifier(): true},
|
||||
@@ -145,6 +148,7 @@ func prepareInstanceMembersQuery(ctx context.Context, db prepareDatabase) (sq.Se
|
||||
displayName = sql.NullString{}
|
||||
machineName = sql.NullString{}
|
||||
avatarURL = sql.NullString{}
|
||||
userType = sql.NullInt32{}
|
||||
)
|
||||
|
||||
err := rows.Scan(
|
||||
@@ -161,6 +165,7 @@ func prepareInstanceMembersQuery(ctx context.Context, db prepareDatabase) (sq.Se
|
||||
&displayName,
|
||||
&machineName,
|
||||
&avatarURL,
|
||||
&userType,
|
||||
|
||||
&count,
|
||||
)
|
||||
@@ -179,6 +184,7 @@ func prepareInstanceMembersQuery(ctx context.Context, db prepareDatabase) (sq.Se
|
||||
} else {
|
||||
member.DisplayName = machineName.String
|
||||
}
|
||||
member.UserType = domain.UserType(userType.Int32)
|
||||
|
||||
members = append(members, member)
|
||||
}
|
||||
|
Reference in New Issue
Block a user