Skip to content

Commit

Permalink
feat: show actual teams/users in team alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
John van Leeuwen committed Sep 29, 2024
1 parent 0f51904 commit 0f245be
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions apps/backend/src/services/team-alignment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function calcTeamAlignment(
const userToTeam = initUserToTeam(teams);
const result = initResult(displayModules, Object.keys(teams));

const users = new Set<string>();
const actualTeams = new Set<string>();

const parseOptions: ParseOptions = {
limits,
Expand All @@ -52,9 +52,8 @@ export async function calcTeamAlignment(

userName = config.aliases?.[userName] || userName;

users.add(userName);

const key = calcKey(byUser, userName, userToTeam);
actualTeams.add(key);

for (const change of entry.body) {
for (let i = 0; i < modules.length; i++) {
Expand All @@ -72,9 +71,7 @@ export async function calcTeamAlignment(
}
}, parseOptions);

if (byUser) {
result.teams = Array.from(users);
}
result.teams = Array.from(actualTeams).sort();

return result;
}
Expand Down

0 comments on commit 0f245be

Please sign in to comment.