-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the team info component to the team page. This component shows some informations about the team: - name - amount of members - date created - date updated
- Loading branch information
Showing
11 changed files
with
132 additions
and
10 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './useCreateTeam'; | ||
export * from './useTeam'; |
64 changes: 64 additions & 0 deletions
64
src/frontend/apps/desk/src/features/teams/components/TeamInfo.tsx
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,64 @@ | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import IconGroup from '@/assets/icons/icon-group2.svg'; | ||
import { Box, Card, Text } from '@/components'; | ||
import { useCunninghamTheme } from '@/cunningham'; | ||
|
||
import { TeamResponse } from '../api/types'; | ||
|
||
interface TeamInfoProps { | ||
team: TeamResponse; | ||
} | ||
|
||
export const TeamInfo = ({ team }: TeamInfoProps) => { | ||
const { t } = useTranslation(); | ||
const { colorsTokens } = useCunninghamTheme(); | ||
|
||
return ( | ||
<Card className="m-b" style={{ paddingBottom: 0 }}> | ||
<Box className="m-b" $direction="row" $align="center" $gap="1.5rem"> | ||
<IconGroup | ||
width={44} | ||
color={colorsTokens()['primary-text']} | ||
aria-label={t('icon group')} | ||
style={{ | ||
flexShrink: 0, | ||
alignSelf: 'start', | ||
}} | ||
/> | ||
<Box> | ||
<Text as="h3" $weight="bold" $size="1.25rem" className="mt-0"> | ||
{t('Members of “{{teamName}}“', { | ||
teamName: team.name, | ||
})} | ||
</Text> | ||
<Text $size="m"> | ||
{t('Add people to the “{{teamName}}“ group.', { | ||
teamName: team.name, | ||
})} | ||
</Text> | ||
</Box> | ||
</Box> | ||
<Box | ||
className="p-s" | ||
$gap="1rem" | ||
$direction="row" | ||
$justify="space-evenly" | ||
$css={`border-top: 1px solid ${colorsTokens()['card-border']};`} | ||
> | ||
<Text $size="s"> | ||
{t('{{count}} member', { count: team.accesses.length })} | ||
</Text> | ||
<Text $size="s" $direction="row"> | ||
{t('Created at')} | ||
<Text $weight="bold">06/02/2024</Text> | ||
</Text> | ||
<Text $size="s" $direction="row"> | ||
{t('Last update at')} | ||
<Text $weight="bold">07/02/2024</Text> | ||
</Text> | ||
</Box> | ||
</Card> | ||
); | ||
}; |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './Panel'; | ||
export * from './TeamInfo'; |
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,39 @@ | ||
import { expect, test } from '@playwright/test'; | ||
|
||
import { keyCloakSignIn } from './common'; | ||
|
||
test.beforeEach(async ({ page, browserName }) => { | ||
await page.goto('/'); | ||
await keyCloakSignIn(page, browserName); | ||
}); | ||
|
||
test.describe('Team', () => { | ||
test('checks all the top box elements are visible', async ({ | ||
page, | ||
browserName, | ||
}) => { | ||
const panel = page.getByLabel('Teams panel').first(); | ||
|
||
await panel.getByRole('button', { name: 'Add a team' }).click(); | ||
|
||
const teamName = `My new team ${browserName}-${Math.floor(Math.random() * 1000)}`; | ||
await page.getByText('Team name').fill(teamName); | ||
await page.getByRole('button', { name: 'Create the team' }).click(); | ||
|
||
await expect(page.getByLabel('icon group')).toBeVisible(); | ||
await expect( | ||
page.getByRole('heading', { | ||
name: `Members of “${teamName}“`, | ||
level: 3, | ||
}), | ||
).toBeVisible(); | ||
await expect( | ||
page.getByText(`Add people to the “${teamName}“ group.`), | ||
).toBeVisible(); | ||
|
||
await expect(page.getByText(`1 member`)).toBeVisible(); | ||
|
||
await expect(page.getByText(`Created at 06/02/2024`)).toBeVisible(); | ||
await expect(page.getByText(`Last update at 07/02/2024`)).toBeVisible(); | ||
}); | ||
}); |
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