-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement support for managing non-standard teams
allow management of non-standard teams, BUT only for standard groups.
- Loading branch information
Showing
5 changed files
with
54 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { getGroupType } from '../../utils/utils.ts' | ||
import { Team, Group } from '../../services/teamDetail.ts' | ||
import { DropdownItem } from '../../@types/pageTypes' | ||
|
||
// The only valid groups for MANAGED dapla teams | ||
export const standardGroups = ['developers', 'managers', 'data-admins'] | ||
|
||
/** | ||
* Display groups for use in the Dropdown component. Disable the group | ||
* if it's non-standard. | ||
* | ||
*/ | ||
export const displayGroupItem = | ||
(teamDetailData: Team) => | ||
({ uniform_name }: Group): DropdownItem => { | ||
const groupType = getGroupType(teamDetailData.uniform_name, uniform_name) | ||
return { | ||
id: uniform_name, | ||
title: groupType, | ||
disabled: !standardGroups.includes(groupType), | ||
} | ||
} |