-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1455 from gchq/BAI-1376-Display-entry-collaborato…
…rs-outside-of-the-settings-tab Bai 1376 display entry collaborators outside of the settings tab
- Loading branch information
Showing
21 changed files
with
345 additions
and
446 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import GroupsIcon from '@mui/icons-material/Groups' | ||
import PersonIcon from '@mui/icons-material/Person' | ||
import { useMemo } from 'react' | ||
import { CollaboratorEntry } from 'types/types' | ||
|
||
type EntityIconProps = { | ||
entryCollaborator: CollaboratorEntry | ||
} | ||
|
||
export default function EntityIcon({ entryCollaborator }: EntityIconProps) { | ||
const isUser = useMemo(() => entryCollaborator.entity.startsWith('user:'), [entryCollaborator]) | ||
return isUser ? <PersonIcon color='primary' /> : <GroupsIcon color='secondary' /> | ||
} |
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,20 @@ | ||
import { Typography } from '@mui/material' | ||
import { useMemo } from 'react' | ||
import UserDisplay from 'src/common/UserDisplay' | ||
import { CollaboratorEntry, EntityKind } from 'types/types' | ||
|
||
type EntityNameDisplayProps = { | ||
entryCollaborator: CollaboratorEntry | ||
} | ||
|
||
export default function EntityNameDisplay({ entryCollaborator }: EntityNameDisplayProps) { | ||
const [entryCollaboratorKind, entryCollaboratorName] = useMemo( | ||
() => entryCollaborator.entity.split(':'), | ||
[entryCollaborator], | ||
) | ||
return entryCollaboratorKind === EntityKind.USER || entryCollaboratorKind === EntityKind.GROUP ? ( | ||
<UserDisplay dn={entryCollaboratorName} /> | ||
) : ( | ||
<Typography fontWeight='bold'>{entryCollaboratorName}</Typography> | ||
) | ||
} |
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
Oops, something went wrong.