diff --git a/frontend/src/app/shared/types/model/UserTableEntry.ts b/frontend/src/app/shared/types/model/UserTableEntry.ts index 4b5bfa6eb7..648eba9d7c 100644 --- a/frontend/src/app/shared/types/model/UserTableEntry.ts +++ b/frontend/src/app/shared/types/model/UserTableEntry.ts @@ -13,11 +13,11 @@ export interface UserTableEntry { export const convertFromUsers = (users: User[], teamId: number | null): UserTableEntry[] => { // make a deep copy to not modify original value const usersCopy = JSON.parse(JSON.stringify(users)) as User[]; + let userTableEntries; if (!teamId) { - return usersCopy.map((u) => convertFromUser(u)); - } - return ( - usersCopy + userTableEntries = usersCopy.map((u) => convertFromUser(u)); + } else { + userTableEntries = usersCopy // first we filter user teams based on selected team id .map((u) => { u.userTeamList = u.userTeamList.filter((ut) => ut.team.id === teamId); @@ -25,8 +25,9 @@ export const convertFromUsers = (users: User[], teamId: number | null): UserTabl }) // we remove users without membership in selected team id .filter((u) => u.userTeamList.length) - .map((u) => convertFromUser(u)) - ); + .map((u) => convertFromUser(u)); + } + return userTableEntries.sort((a, b) => a.firstname.localeCompare(b.firstname)); }; export const convertFromUser = (user: User): UserTableEntry => { diff --git a/frontend/src/app/team-management/member-list/member-list.component.html b/frontend/src/app/team-management/member-list/member-list.component.html index 6a87fcbaf9..ddb4423386 100644 --- a/frontend/src/app/team-management/member-list/member-list.component.html +++ b/frontend/src/app/team-management/member-list/member-list.component.html @@ -17,7 +17,11 @@