feat: insights orgs [CAL-1888] (#9551)
* initial commit * fixes on data returned * mobile style fixes * Update on styles and dates not being shown on graphics * feat: update insights filters UI (#9756) * feat: update insights filters UI Signed-off-by: Udit Takkar <[email protected]> * Fixes for filters with new UI * fix initialConfig lost while clearing filters * Add single user conditional for first render --------- Signed-off-by: Udit Takkar <[email protected]> Co-authored-by: Alan <[email protected]> --------- Signed-off-by: Udit Takkar <[email protected]> Co-authored-by: Efraín Rochín <[email protected]> Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
22 files changed
+993
-405
No files matched your search
@@ -37,16 +37,20 @@ export const listMembersHandler = async ({ ctx, input }: ListMembersOptions) =>
|
||||
username: true,
|
||||
},
|
||||
},
|
||||
accepted: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
type UserMap = Record<number, (typeof teams)[number]["members"][number]["user"]>;
|
||||
type UserMap = Record<number, (typeof teams)[number]["members"][number]["user"] & { accepted: boolean }>;
|
||||
// flatten users to be unique by id
|
||||
const users = teams
|
||||
.flatMap((t) => t.members)
|
||||
.reduce((acc, m) => (m.user.id in acc ? acc : { ...acc, [m.user.id]: m.user }), {} as UserMap);
|
||||
.reduce(
|
||||
(acc, m) => (m.user.id in acc ? acc : { ...acc, [m.user.id]: { ...m.user, accepted: m.accepted } }),
|
||||
{} as UserMap
|
||||
);
|
||||
|
||||
return Object.values(users);
|
||||
};
|
||||
Reference in new issue
Block a user