Skip to content

Commit

Permalink
Only show supported groups, managers, developers and data-admins
Browse files Browse the repository at this point in the history
  • Loading branch information
ssb-jnk committed Dec 17, 2024
1 parent eb2ca96 commit 88a001e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/pages/TeamDetail/TeamDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,13 @@ const TeamDetail = () => {

return teamUsers.map(({ display_name, principal_name, section_name, groups }) => {
const userFullName = formatDisplayName(display_name)
const userGroups = groups?.filter((group) =>
group.uniform_name.startsWith((response.team as Team).uniform_name)
) as Group[]
const teamUniformName = (response.team as Team).uniform_name
// Because we dont yet support custom groups, we can filter out the groups that are not relevant
// TODO: Remove this when custom groups are supported
const validEndings = ['managers', 'developers', 'data-admins']
const userGroups = groups?.filter((group) => {
return validEndings.some((ending) => group.uniform_name === `${teamUniformName}-${ending}`)
}) as Group[]
return {
id: userFullName,
navn: (
Expand All @@ -139,11 +143,7 @@ const TeamDetail = () => {
/>
),
seksjon: section_name, // Makes section name searchable and sortable in table by including the field
gruppe: groups
?.filter((group) => {
const baseUniformName = (response.team as Team).uniform_name
return group.uniform_name.startsWith(baseUniformName)
})
gruppe: userGroups
.map((group) => getGroupType((response.team as Team).uniform_name, group.uniform_name))
.join(', '),
epost: principal_name,
Expand Down

0 comments on commit 88a001e

Please sign in to comment.