✨(frontend) display full name if available
We can get the full name from the OIDC, so we should display it if available.
This commit is contained in:
@@ -14,6 +14,7 @@ and this project adheres to
|
|||||||
- 📝Contributing.md #352
|
- 📝Contributing.md #352
|
||||||
- 🌐(frontend) add localization to editor #268
|
- 🌐(frontend) add localization to editor #268
|
||||||
- ✨Public and restricted doc editable #357
|
- ✨Public and restricted doc editable #357
|
||||||
|
- ✨(frontend) Add full name if available #380
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ test.describe('Doc Header', () => {
|
|||||||
role: 'owner',
|
role: 'owner',
|
||||||
user: {
|
user: {
|
||||||
email: 'super@owner.com',
|
email: 'super@owner.com',
|
||||||
|
full_name: 'Super Owner',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -65,7 +66,7 @@ test.describe('Doc Header', () => {
|
|||||||
card.getByText('Created at 09/01/2021, 11:00 AM'),
|
card.getByText('Created at 09/01/2021, 11:00 AM'),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
await expect(
|
await expect(
|
||||||
card.getByText('Owners: super@owner.com / super2@owner.com'),
|
card.getByText('Owners: Super Owner / super2@owner.com'),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
await expect(card.getByText('Your role: Owner')).toBeVisible();
|
await expect(card.getByText('Your role: Owner')).toBeVisible();
|
||||||
await expect(page.getByRole('button', { name: 'Share' })).toBeVisible();
|
await expect(page.getByRole('button', { name: 'Share' })).toBeVisible();
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ test.describe('Document list members', () => {
|
|||||||
user: {
|
user: {
|
||||||
id: `fc092149-cafa-4ffa-a29d-e4b18af751-${pageId}-${i}`,
|
id: `fc092149-cafa-4ffa-a29d-e4b18af751-${pageId}-${i}`,
|
||||||
email: `impress@impress.world-page-${pageId}-${i}`,
|
email: `impress@impress.world-page-${pageId}-${i}`,
|
||||||
|
full_name: `Impress World Page ${pageId}-${i}`,
|
||||||
},
|
},
|
||||||
team: '',
|
team: '',
|
||||||
role: 'editor',
|
role: 'editor',
|
||||||
@@ -58,9 +59,11 @@ test.describe('Document list members', () => {
|
|||||||
await waitForElementCount(list.locator('li'), 21, 10000);
|
await waitForElementCount(list.locator('li'), 21, 10000);
|
||||||
|
|
||||||
expect(await list.locator('li').count()).toBeGreaterThan(20);
|
expect(await list.locator('li').count()).toBeGreaterThan(20);
|
||||||
|
await expect(list.getByText(`Impress World Page 1-16`)).toBeVisible();
|
||||||
await expect(
|
await expect(
|
||||||
list.getByText(`impress@impress.world-page-1-16`),
|
list.getByText(`impress@impress.world-page-1-16`),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
|
await expect(list.getByText(`Impress World Page 2-15`)).toBeVisible();
|
||||||
await expect(
|
await expect(
|
||||||
list.getByText(`impress@impress.world-page-2-15`),
|
list.getByText(`impress@impress.world-page-2-15`),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
|
|||||||
@@ -8,4 +8,6 @@
|
|||||||
export interface User {
|
export interface User {
|
||||||
id: string;
|
id: string;
|
||||||
email: string;
|
email: string;
|
||||||
|
full_name: string;
|
||||||
|
short_name: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ export const DocHeader = ({ doc, versionId }: DocHeaderProps) => {
|
|||||||
)
|
)
|
||||||
.map((access, index, accesses) => (
|
.map((access, index, accesses) => (
|
||||||
<Fragment key={`access-${index}`}>
|
<Fragment key={`access-${index}`}>
|
||||||
{access.user.email}{' '}
|
{access.user.full_name || access.user.email}{' '}
|
||||||
{index < accesses.length - 1 ? ' / ' : ''}
|
{index < accesses.length - 1 ? ' / ' : ''}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -84,9 +84,10 @@ export const MemberItem = ({
|
|||||||
$css={`flex: ${isSmallMobile ? '100%' : '70%'};`}
|
$css={`flex: ${isSmallMobile ? '100%' : '70%'};`}
|
||||||
>
|
>
|
||||||
<IconBG iconName="account_circle" $size="2rem" />
|
<IconBG iconName="account_circle" $size="2rem" />
|
||||||
<Text $justify="center" $css="flex:1;">
|
<Box $justify="center" $css="flex:1;">
|
||||||
{access.user.email}
|
{access.user.full_name && <Text>{access.user.full_name}</Text>}
|
||||||
</Text>
|
<Text>{access.user.email}</Text>
|
||||||
|
</Box>
|
||||||
<Box
|
<Box
|
||||||
$direction="row"
|
$direction="row"
|
||||||
$gap="1rem"
|
$gap="1rem"
|
||||||
|
|||||||
@@ -213,6 +213,8 @@ export class ApiPlugin implements WorkboxPlugin {
|
|||||||
user: {
|
user: {
|
||||||
id: 'dummy-id',
|
id: 'dummy-id',
|
||||||
email: 'dummy-email',
|
email: 'dummy-email',
|
||||||
|
full_name: 'dummy-full-name',
|
||||||
|
short_name: 'dummy-short-name',
|
||||||
},
|
},
|
||||||
abilities: {
|
abilities: {
|
||||||
destroy: false,
|
destroy: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user