💬(frontend) change literal occurances of pad to document
- change urls from /pads to /docs - change part of the litteral occurances of pad to document
This commit is contained in:
@@ -16,6 +16,8 @@ and this project adheres to
|
|||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
|
||||||
|
- Change most of the occurences from pad to document (#76)
|
||||||
|
- Change site from Impress to Docs (#76)
|
||||||
- Generate PDF from a modal (#68)
|
- Generate PDF from a modal (#68)
|
||||||
- Remove trigger workflow on push tags on CI (#68)
|
- Remove trigger workflow on push tags on CI (#68)
|
||||||
|
|
||||||
|
|||||||
@@ -30,14 +30,16 @@ export const createPad = async (
|
|||||||
length: number,
|
length: number,
|
||||||
isPublic: boolean = false,
|
isPublic: boolean = false,
|
||||||
) => {
|
) => {
|
||||||
const panel = page.getByLabel('Pads panel').first();
|
const panel = page.getByLabel('Documents panel').first();
|
||||||
const buttonCreate = page.getByRole('button', { name: 'Create the pad' });
|
const buttonCreate = page.getByRole('button', {
|
||||||
|
name: 'Create the document',
|
||||||
|
});
|
||||||
|
|
||||||
const randomPads = randomName(padName, browserName, length);
|
const randomPads = randomName(padName, browserName, length);
|
||||||
|
|
||||||
for (let i = 0; i < randomPads.length; i++) {
|
for (let i = 0; i < randomPads.length; i++) {
|
||||||
await panel.getByRole('button', { name: 'Add a pad' }).click();
|
await panel.getByRole('button', { name: 'Add a document' }).click();
|
||||||
await page.getByText('Pad name').fill(randomPads[i]);
|
await page.getByText('Document name').fill(randomPads[i]);
|
||||||
|
|
||||||
if (isPublic) {
|
if (isPublic) {
|
||||||
await page.getByText('Is it public ?').click();
|
await page.getByText('Is it public ?').click();
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ test.describe('Language', () => {
|
|||||||
test('checks the language picker', async ({ page }) => {
|
test('checks the language picker', async ({ page }) => {
|
||||||
await expect(
|
await expect(
|
||||||
page.getByRole('button', {
|
page.getByRole('button', {
|
||||||
name: 'Create a new pad',
|
name: 'Create a new document',
|
||||||
}),
|
}),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ test.describe('Language', () => {
|
|||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
page.getByRole('button', {
|
page.getByRole('button', {
|
||||||
name: 'Créer un nouveau pad',
|
name: 'Créer un nouveau document',
|
||||||
}),
|
}),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -10,20 +10,20 @@ test.beforeEach(async ({ page, browserName }) => {
|
|||||||
test.describe('Pad Create', () => {
|
test.describe('Pad Create', () => {
|
||||||
test('checks all the create pad elements are visible', async ({ page }) => {
|
test('checks all the create pad elements are visible', async ({ page }) => {
|
||||||
const buttonCreateHomepage = page.getByRole('button', {
|
const buttonCreateHomepage = page.getByRole('button', {
|
||||||
name: 'Create a new pad',
|
name: 'Create a new document',
|
||||||
});
|
});
|
||||||
await buttonCreateHomepage.click();
|
await buttonCreateHomepage.click();
|
||||||
await expect(buttonCreateHomepage).toBeHidden();
|
await expect(buttonCreateHomepage).toBeHidden();
|
||||||
|
|
||||||
const card = page.getByLabel('Create new pad card').first();
|
const card = page.getByLabel('Create new document card').first();
|
||||||
|
|
||||||
await expect(card.getByLabel('Pad name')).toBeVisible();
|
await expect(card.getByLabel('Document name')).toBeVisible();
|
||||||
|
|
||||||
await expect(card.getByLabel('icon group')).toBeVisible();
|
await expect(card.getByLabel('icon group')).toBeVisible();
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
card.getByRole('heading', {
|
card.getByRole('heading', {
|
||||||
name: 'Name the pad',
|
name: 'Name the document',
|
||||||
level: 3,
|
level: 3,
|
||||||
}),
|
}),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
@@ -32,7 +32,7 @@ test.describe('Pad Create', () => {
|
|||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
card.getByRole('button', {
|
card.getByRole('button', {
|
||||||
name: 'Create the pad',
|
name: 'Create the document',
|
||||||
}),
|
}),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
|
|
||||||
@@ -45,12 +45,12 @@ test.describe('Pad Create', () => {
|
|||||||
|
|
||||||
test('checks the cancel button interaction', async ({ page }) => {
|
test('checks the cancel button interaction', async ({ page }) => {
|
||||||
const buttonCreateHomepage = page.getByRole('button', {
|
const buttonCreateHomepage = page.getByRole('button', {
|
||||||
name: 'Create a new pad',
|
name: 'Create a new document',
|
||||||
});
|
});
|
||||||
await buttonCreateHomepage.click();
|
await buttonCreateHomepage.click();
|
||||||
await expect(buttonCreateHomepage).toBeHidden();
|
await expect(buttonCreateHomepage).toBeHidden();
|
||||||
|
|
||||||
const card = page.getByLabel('Create new pad card').first();
|
const card = page.getByLabel('Create new document card').first();
|
||||||
|
|
||||||
await card
|
await card
|
||||||
.getByRole('button', {
|
.getByRole('button', {
|
||||||
@@ -65,18 +65,18 @@ test.describe('Pad Create', () => {
|
|||||||
page,
|
page,
|
||||||
browserName,
|
browserName,
|
||||||
}) => {
|
}) => {
|
||||||
const panel = page.getByLabel('Pads panel').first();
|
const panel = page.getByLabel('Documents panel').first();
|
||||||
|
|
||||||
await panel.getByRole('button', { name: 'Add a pad' }).click();
|
await panel.getByRole('button', { name: 'Add a document' }).click();
|
||||||
|
|
||||||
const padName = `My routing pad ${browserName}-${Math.floor(Math.random() * 1000)}`;
|
const padName = `My routing pad ${browserName}-${Math.floor(Math.random() * 1000)}`;
|
||||||
await page.getByText('Pad name').fill(padName);
|
await page.getByText('Document name').fill(padName);
|
||||||
await page.getByRole('button', { name: 'Create the pad' }).click();
|
await page.getByRole('button', { name: 'Create the document' }).click();
|
||||||
|
|
||||||
const elPad = page.locator('h2').getByText(padName);
|
const elPad = page.locator('h2').getByText(padName);
|
||||||
await expect(elPad).toBeVisible();
|
await expect(elPad).toBeVisible();
|
||||||
|
|
||||||
await panel.getByRole('button', { name: 'Add a pad' }).click();
|
await panel.getByRole('button', { name: 'Add a document' }).click();
|
||||||
await expect(elPad).toBeHidden();
|
await expect(elPad).toBeHidden();
|
||||||
|
|
||||||
await panel.locator('li').getByText(padName).click();
|
await panel.locator('li').getByText(padName).click();
|
||||||
@@ -87,18 +87,18 @@ test.describe('Pad Create', () => {
|
|||||||
await expect(page).toHaveURL('/');
|
await expect(page).toHaveURL('/');
|
||||||
|
|
||||||
const buttonCreateHomepage = page.getByRole('button', {
|
const buttonCreateHomepage = page.getByRole('button', {
|
||||||
name: 'Create a new pad',
|
name: 'Create a new document',
|
||||||
});
|
});
|
||||||
|
|
||||||
await expect(buttonCreateHomepage).toBeVisible();
|
await expect(buttonCreateHomepage).toBeVisible();
|
||||||
|
|
||||||
await page.goto('/pads');
|
await page.goto('/docs');
|
||||||
await expect(buttonCreateHomepage).toBeVisible();
|
await expect(buttonCreateHomepage).toBeVisible();
|
||||||
await expect(page).toHaveURL(/\/pads$/);
|
await expect(page).toHaveURL(/\/docs$/);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('checks 404 on pads/[id] page', async ({ page }) => {
|
test('checks 404 on docs/[id] page', async ({ page }) => {
|
||||||
await page.goto('/pads/some-unknown-pad');
|
await page.goto('/docs/some-unknown-pad');
|
||||||
await expect(
|
await expect(
|
||||||
page.getByText(
|
page.getByText(
|
||||||
'It seems that the page you are looking for does not exist or cannot be displayed correctly.',
|
'It seems that the page you are looking for does not exist or cannot be displayed correctly.',
|
||||||
@@ -114,14 +114,14 @@ test.describe('Pad Create', () => {
|
|||||||
response.url().includes('/documents/') && response.status() === 201,
|
response.url().includes('/documents/') && response.status() === 201,
|
||||||
);
|
);
|
||||||
|
|
||||||
const panel = page.getByLabel('Pads panel').first();
|
const panel = page.getByLabel('Documents panel').first();
|
||||||
|
|
||||||
await panel.getByRole('button', { name: 'Add a pad' }).click();
|
await panel.getByRole('button', { name: 'Add a document' }).click();
|
||||||
|
|
||||||
const padName = `My routing pad ${browserName}-${Math.floor(Math.random() * 1000)}`;
|
const padName = `My routing pad ${browserName}-${Math.floor(Math.random() * 1000)}`;
|
||||||
await page.getByText('Pad name').fill(padName);
|
await page.getByText('Document name').fill(padName);
|
||||||
await page.getByText('Is it public ?').click();
|
await page.getByText('Is it public ?').click();
|
||||||
await page.getByRole('button', { name: 'Create the pad' }).click();
|
await page.getByRole('button', { name: 'Create the document' }).click();
|
||||||
|
|
||||||
const responsePad = await responsePromisePad;
|
const responsePad = await responsePromisePad;
|
||||||
const is_public = (await responsePad.json()).is_public;
|
const is_public = (await responsePad.json()).is_public;
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ test.describe('Pad Editor', () => {
|
|||||||
2,
|
2,
|
||||||
);
|
);
|
||||||
|
|
||||||
const panel = page.getByLabel('Pads panel').first();
|
const panel = page.getByLabel('Documents panel').first();
|
||||||
|
|
||||||
// Check the first pad
|
// Check the first pad
|
||||||
await panel.getByText(firstPad).click();
|
await panel.getByText(firstPad).click();
|
||||||
@@ -116,7 +116,7 @@ test.describe('Pad Editor', () => {
|
|||||||
}) => {
|
}) => {
|
||||||
const [pad] = await createPad(page, 'pad-save-page', browserName, 1);
|
const [pad] = await createPad(page, 'pad-save-page', browserName, 1);
|
||||||
|
|
||||||
const panel = page.getByLabel('Pads panel').first();
|
const panel = page.getByLabel('Documents panel').first();
|
||||||
|
|
||||||
// Check the first pad
|
// Check the first pad
|
||||||
await panel.getByText(pad).click();
|
await panel.getByText(pad).click();
|
||||||
@@ -129,14 +129,14 @@ test.describe('Pad Editor', () => {
|
|||||||
|
|
||||||
await panel
|
await panel
|
||||||
.getByRole('button', {
|
.getByRole('button', {
|
||||||
name: 'Add a pad',
|
name: 'Add a document',
|
||||||
})
|
})
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
const card = page.getByLabel('Create new pad card').first();
|
const card = page.getByLabel('Create new document card').first();
|
||||||
await expect(
|
await expect(
|
||||||
card.getByRole('heading', {
|
card.getByRole('heading', {
|
||||||
name: 'Name the pad',
|
name: 'Name the document',
|
||||||
level: 3,
|
level: 3,
|
||||||
}),
|
}),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
@@ -151,7 +151,7 @@ test.describe('Pad Editor', () => {
|
|||||||
test('it saves the doc when we quit pages', async ({ page, browserName }) => {
|
test('it saves the doc when we quit pages', async ({ page, browserName }) => {
|
||||||
const [pad] = await createPad(page, 'pad-save-quit', browserName, 1);
|
const [pad] = await createPad(page, 'pad-save-quit', browserName, 1);
|
||||||
|
|
||||||
const panel = page.getByLabel('Pads panel').first();
|
const panel = page.getByLabel('Documents panel').first();
|
||||||
|
|
||||||
// Check the first pad
|
// Check the first pad
|
||||||
await panel.getByText(pad).click();
|
await panel.getByText(pad).click();
|
||||||
@@ -188,7 +188,7 @@ test.describe('Pad Editor', () => {
|
|||||||
|
|
||||||
await keyCloakSignIn(page, newBrowserName);
|
await keyCloakSignIn(page, newBrowserName);
|
||||||
|
|
||||||
const panel = page.getByLabel('Pads panel').first();
|
const panel = page.getByLabel('Documents panel').first();
|
||||||
await panel.getByText(padName).click();
|
await panel.getByText(padName).click();
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
|
|||||||
@@ -9,21 +9,21 @@ test.beforeEach(async ({ page, browserName }) => {
|
|||||||
await keyCloakSignIn(page, browserName);
|
await keyCloakSignIn(page, browserName);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.describe('Pads Panel', () => {
|
test.describe('Documents Panel', () => {
|
||||||
test('checks all the elements are visible', async ({ page }) => {
|
test('checks all the elements are visible', async ({ page }) => {
|
||||||
const panel = page.getByLabel('Pads panel').first();
|
const panel = page.getByLabel('Documents panel').first();
|
||||||
|
|
||||||
await expect(panel.getByText('Documents')).toBeVisible();
|
await expect(panel.getByText('Documents')).toBeVisible();
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
panel.getByRole('button', {
|
panel.getByRole('button', {
|
||||||
name: 'Sort the pads',
|
name: 'Sort the documents',
|
||||||
}),
|
}),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
panel.getByRole('button', {
|
panel.getByRole('button', {
|
||||||
name: 'Add a pad',
|
name: 'Add a document',
|
||||||
}),
|
}),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
});
|
});
|
||||||
@@ -41,11 +41,11 @@ test.describe('Pads Panel', () => {
|
|||||||
response.status() === 200,
|
response.status() === 200,
|
||||||
);
|
);
|
||||||
|
|
||||||
const panel = page.getByLabel('Pads panel').first();
|
const panel = page.getByLabel('Documents panel').first();
|
||||||
|
|
||||||
await panel
|
await panel
|
||||||
.getByRole('button', {
|
.getByRole('button', {
|
||||||
name: 'Sort the pads by creation date ascendent',
|
name: 'Sort the documents by creation date ascendent',
|
||||||
})
|
})
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ test.describe('Pads Panel', () => {
|
|||||||
|
|
||||||
await panel
|
await panel
|
||||||
.getByRole('button', {
|
.getByRole('button', {
|
||||||
name: 'Sort the pads by creation date descendent',
|
name: 'Sort the documents by creation date descendent',
|
||||||
})
|
})
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ test.describe('Pads Panel', () => {
|
|||||||
|
|
||||||
test('checks the infinite scroll', async ({ page, browserName }) => {
|
test('checks the infinite scroll', async ({ page, browserName }) => {
|
||||||
test.setTimeout(90000);
|
test.setTimeout(90000);
|
||||||
const panel = page.getByLabel('Pads panel').first();
|
const panel = page.getByLabel('Documents panel').first();
|
||||||
|
|
||||||
const randomPads = await createPad(page, 'pad-infinite', browserName, 40);
|
const randomPads = await createPad(page, 'pad-infinite', browserName, 40);
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ test.describe('Pads Panel', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('checks the hover and selected state', async ({ page, browserName }) => {
|
test('checks the hover and selected state', async ({ page, browserName }) => {
|
||||||
const panel = page.getByLabel('Pads panel').first();
|
const panel = page.getByLabel('Documents panel').first();
|
||||||
await createPad(page, 'pad-hover', browserName, 2);
|
await createPad(page, 'pad-hover', browserName, 2);
|
||||||
|
|
||||||
const selectedPad = panel.locator('li').nth(0);
|
const selectedPad = panel.locator('li').nth(0);
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ test.describe('Pad Tools', () => {
|
|||||||
page.getByRole('checkbox', { name: 'Is it public ?' }),
|
page.getByRole('checkbox', { name: 'Is it public ?' }),
|
||||||
).toBeChecked();
|
).toBeChecked();
|
||||||
|
|
||||||
await page.getByText('Pad name').fill(`${randomPad}-updated`);
|
await page.getByText('Document name').fill(`${randomPad}-updated`);
|
||||||
await page.getByText('Is it public ?').click();
|
await page.getByText('Is it public ?').click();
|
||||||
|
|
||||||
await page
|
await page
|
||||||
@@ -86,7 +86,7 @@ test.describe('Pad Tools', () => {
|
|||||||
page.getByText('The document has been updated.'),
|
page.getByText('The document has been updated.'),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
|
|
||||||
const panel = page.getByLabel('Pads panel').first();
|
const panel = page.getByLabel('Documents panel').first();
|
||||||
await expect(
|
await expect(
|
||||||
panel.locator('li').getByText(`${randomPad}-updated`),
|
panel.locator('li').getByText(`${randomPad}-updated`),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
@@ -129,10 +129,10 @@ test.describe('Pad Tools', () => {
|
|||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
page.getByRole('button', { name: 'Create a new pad' }),
|
page.getByRole('button', { name: 'Create a new document' }),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
|
|
||||||
const panel = page.getByLabel('Pads panel').first();
|
const panel = page.getByLabel('Documents panel').first();
|
||||||
await expect(panel.locator('li').getByText(randomPad)).toBeHidden();
|
await expect(panel.locator('li').getByText(randomPad)).toBeHidden();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@ test.describe('Pad Tools', () => {
|
|||||||
|
|
||||||
await keyCloakSignIn(page, newBrowserName);
|
await keyCloakSignIn(page, newBrowserName);
|
||||||
|
|
||||||
const panel = page.getByLabel('Pads panel').first();
|
const panel = page.getByLabel('Documents panel').first();
|
||||||
await panel.getByText(padName).click();
|
await panel.getByText(padName).click();
|
||||||
|
|
||||||
await page.getByLabel('Open the document options').click();
|
await page.getByLabel('Open the document options').click();
|
||||||
|
|||||||
@@ -8,12 +8,8 @@ server {
|
|||||||
try_files $uri index.html $uri/ =404;
|
try_files $uri index.html $uri/ =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /pads/ {
|
location /docs/ {
|
||||||
error_page 404 /pads/[id]/;
|
error_page 404 /docs/[id]/;
|
||||||
}
|
|
||||||
|
|
||||||
location /templates/ {
|
|
||||||
error_page 404 /templates/[id]/;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
error_page 404 /404.html;
|
error_page 404 /404.html;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ describe('Page', () => {
|
|||||||
|
|
||||||
expect(
|
expect(
|
||||||
screen.getByRole('button', {
|
screen.getByRole('button', {
|
||||||
name: /Create a new pad/i,
|
name: /Create a new document/i,
|
||||||
}),
|
}),
|
||||||
).toBeInTheDocument();
|
).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export const CardCreatePad = () => {
|
|||||||
error,
|
error,
|
||||||
} = useCreatePad({
|
} = useCreatePad({
|
||||||
onSuccess: (pad) => {
|
onSuccess: (pad) => {
|
||||||
router.push(`/pads/${pad.id}`);
|
router.push(`/docs/${pad.id}`);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const [padName, setPadName] = useState('');
|
const [padName, setPadName] = useState('');
|
||||||
@@ -36,7 +36,7 @@ export const CardCreatePad = () => {
|
|||||||
$width="100%"
|
$width="100%"
|
||||||
$maxWidth="24rem"
|
$maxWidth="24rem"
|
||||||
$minWidth="22rem"
|
$minWidth="22rem"
|
||||||
aria-label={t('Create new pad card')}
|
aria-label={t('Create new document card')}
|
||||||
>
|
>
|
||||||
<Box $gap="1rem">
|
<Box $gap="1rem">
|
||||||
<Box $align="center">
|
<Box $align="center">
|
||||||
@@ -46,11 +46,11 @@ export const CardCreatePad = () => {
|
|||||||
aria-label={t('icon group')}
|
aria-label={t('icon group')}
|
||||||
/>
|
/>
|
||||||
<Text as="h3" $textAlign="center">
|
<Text as="h3" $textAlign="center">
|
||||||
{t('Name the pad')}
|
{t('Name the document')}
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<InputPadName
|
<InputPadName
|
||||||
label={t('Pad name')}
|
label={t('Document name')}
|
||||||
{...{ error, isError, isPending, setPadName }}
|
{...{ error, isError, isPending, setPadName }}
|
||||||
/>
|
/>
|
||||||
<Switch
|
<Switch
|
||||||
@@ -67,7 +67,7 @@ export const CardCreatePad = () => {
|
|||||||
onClick={() => createPad({ title: padName, is_public: padPublic })}
|
onClick={() => createPad({ title: padName, is_public: padPublic })}
|
||||||
disabled={!padName}
|
disabled={!padName}
|
||||||
>
|
>
|
||||||
{t('Create the pad')}
|
{t('Create the document')}
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export const ModalUpdatePad = ({ onClose, pad }: ModalUpdatePadProps) => {
|
|||||||
|
|
||||||
<Box $gap="1rem">
|
<Box $gap="1rem">
|
||||||
<InputPadName
|
<InputPadName
|
||||||
label={t('Pad name')}
|
label={t('Document name')}
|
||||||
defaultValue={title}
|
defaultValue={title}
|
||||||
{...{ error, isError, isPending, setPadName: setTitle }}
|
{...{ error, isError, isPending, setPadName: setTitle }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ describe('PanelPads', () => {
|
|||||||
|
|
||||||
expect(
|
expect(
|
||||||
await screen.findByText(
|
await screen.findByText(
|
||||||
'Create your first pad by clicking on the "Create a new pad" button.',
|
'Create your first document by clicking on the "Create a new document" button.',
|
||||||
),
|
),
|
||||||
).toBeInTheDocument();
|
).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
@@ -126,7 +126,7 @@ describe('PanelPads', () => {
|
|||||||
).toBeInTheDocument();
|
).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders with pad panel open', async () => {
|
it('renders with doc panel open', async () => {
|
||||||
fetchMock.mock(`end:/api/documents/?page=1&ordering=-created_at`, {
|
fetchMock.mock(`end:/api/documents/?page=1&ordering=-created_at`, {
|
||||||
count: 1,
|
count: 1,
|
||||||
results: [],
|
results: [],
|
||||||
@@ -135,13 +135,13 @@ describe('PanelPads', () => {
|
|||||||
render(<Panel />, { wrapper: AppWrapper });
|
render(<Panel />, { wrapper: AppWrapper });
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
screen.getByRole('button', { name: 'Close the pads panel' }),
|
screen.getByRole('button', { name: 'Close the documents panel' }),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
|
|
||||||
expect(await screen.findByText('Documents')).toBeVisible();
|
expect(await screen.findByText('Documents')).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('closes and opens the pad panel', async () => {
|
it('closes and opens the doc panel', async () => {
|
||||||
fetchMock.mock(`end:/api/documents/?page=1&ordering=-created_at`, {
|
fetchMock.mock(`end:/api/documents/?page=1&ordering=-created_at`, {
|
||||||
count: 1,
|
count: 1,
|
||||||
results: [],
|
results: [],
|
||||||
@@ -153,7 +153,7 @@ describe('PanelPads', () => {
|
|||||||
|
|
||||||
await userEvent.click(
|
await userEvent.click(
|
||||||
screen.getByRole('button', {
|
screen.getByRole('button', {
|
||||||
name: 'Close the pads panel',
|
name: 'Close the documents panel',
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ describe('PanelPads', () => {
|
|||||||
|
|
||||||
await userEvent.click(
|
await userEvent.click(
|
||||||
screen.getByRole('button', {
|
screen.getByRole('button', {
|
||||||
name: 'Open the pads panel',
|
name: 'Open the documents panel',
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export const PadItem = ({ pad }: PadItemProps) => {
|
|||||||
${isActive ? activeStyle : hoverStyle}
|
${isActive ? activeStyle : hoverStyle}
|
||||||
`}
|
`}
|
||||||
>
|
>
|
||||||
<StyledLink className="p-s pt-t pb-t" href={`/pads/${pad.id}`}>
|
<StyledLink className="p-s pt-t pb-t" href={`/docs/${pad.id}`}>
|
||||||
<Box $align="center" $direction="row" $gap="0.5rem">
|
<Box $align="center" $direction="row" $gap="0.5rem">
|
||||||
{hasMembers ? (
|
{hasMembers ? (
|
||||||
<IconGroup
|
<IconGroup
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ const PadListState = ({ isLoading, isError, pads }: PanelTeamsStateProps) => {
|
|||||||
</Text>
|
</Text>
|
||||||
<Text as="p" $theme="greyscale" $variation="500">
|
<Text as="p" $theme="greyscale" $variation="500">
|
||||||
{t(
|
{t(
|
||||||
'Create your first pad by clicking on the "Create a new pad" button.',
|
'Create your first document by clicking on the "Create a new document" button.',
|
||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -32,13 +32,15 @@ export const Panel = () => {
|
|||||||
transition: ${transition};
|
transition: ${transition};
|
||||||
`}
|
`}
|
||||||
$height="inherit"
|
$height="inherit"
|
||||||
aria-label="Pads panel"
|
aria-label="Documents panel"
|
||||||
{...closedOverridingStyles}
|
{...closedOverridingStyles}
|
||||||
>
|
>
|
||||||
<BoxButton
|
<BoxButton
|
||||||
className="material-icons"
|
className="material-icons"
|
||||||
aria-label={
|
aria-label={
|
||||||
isOpen ? t('Close the pads panel') : t('Open the pads panel')
|
isOpen
|
||||||
|
? t('Close the documents panel')
|
||||||
|
: t('Open the documents panel')
|
||||||
}
|
}
|
||||||
$background="white"
|
$background="white"
|
||||||
$color={colorsTokens()['primary-600']}
|
$color={colorsTokens()['primary-600']}
|
||||||
|
|||||||
@@ -33,22 +33,26 @@ export const PanelActions = () => {
|
|||||||
<BoxButton
|
<BoxButton
|
||||||
aria-label={
|
aria-label={
|
||||||
isSortAsc
|
isSortAsc
|
||||||
? t('Sort the pads by creation date descendent')
|
? t('Sort the documents by creation date descendent')
|
||||||
: t('Sort the pads by creation date ascendent')
|
: t('Sort the documents by creation date ascendent')
|
||||||
}
|
}
|
||||||
onClick={changeOrdering}
|
onClick={changeOrdering}
|
||||||
$radius="100%"
|
$radius="100%"
|
||||||
$background={isSortAsc ? colorsTokens()['primary-200'] : 'transparent'}
|
$background={isSortAsc ? colorsTokens()['primary-200'] : 'transparent'}
|
||||||
$color={colorsTokens()['primary-600']}
|
$color={colorsTokens()['primary-600']}
|
||||||
>
|
>
|
||||||
<IconSort width={30} height={30} aria-label={t('Sort pads icon')} />
|
<IconSort
|
||||||
|
width={30}
|
||||||
|
height={30}
|
||||||
|
aria-label={t('Sort documents icon')}
|
||||||
|
/>
|
||||||
</BoxButton>
|
</BoxButton>
|
||||||
<StyledLink href="/pads/create">
|
<StyledLink href="/docs/create">
|
||||||
<BoxButton
|
<BoxButton
|
||||||
aria-label={t('Add a pad')}
|
aria-label={t('Add a document')}
|
||||||
$color={colorsTokens()['primary-600']}
|
$color={colorsTokens()['primary-600']}
|
||||||
>
|
>
|
||||||
<IconAdd width={30} height={30} aria-label={t('Add pad icon')} />
|
<IconAdd width={30} height={30} aria-label={t('Add document icon')} />
|
||||||
</BoxButton>
|
</BoxButton>
|
||||||
</StyledLink>
|
</StyledLink>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -3,56 +3,66 @@
|
|||||||
"fr": {
|
"fr": {
|
||||||
"translation": {
|
"translation": {
|
||||||
"0 group to display.": "0 groupe à afficher.",
|
"0 group to display.": "0 groupe à afficher.",
|
||||||
"Add a pad": "Ajouter un pad",
|
"Accessibility": "Accessibilité",
|
||||||
"Add a template": "Ajouter un template",
|
"Add a document": "Ajouter un document",
|
||||||
"Add pad icon": "Icône ajout de pad",
|
"Add document icon": "Icône ajouter un document",
|
||||||
"Add template icon": "Icône ajout de template",
|
"Are you sure you want to delete the document \"{{title}}\"?": "Êtes-vous sûr de vouloir supprimer le document \"{{title}} \" ?",
|
||||||
|
"Back to home page": "Retour à l'accueil",
|
||||||
"Cancel": "Annuler",
|
"Cancel": "Annuler",
|
||||||
"Close the pads panel": "Fermer le panneau des pads",
|
"Close the docs panel": "Fermer le panneau des docs",
|
||||||
"Close the templates panel": "Fermer le panneau des templates",
|
"Close the modal": "Fermer la modale",
|
||||||
"Create new pad card": "Créer une nouvelle carte pad",
|
"Coming soon ...": "Coming soon ...",
|
||||||
"Create new template card": "Carte créer un nouveau template",
|
"Confirm deletion": "Confirmer la suppression",
|
||||||
"Create a new pad": "Créer un nouveau pad",
|
"Content modal to delete document": "Contenu modal pour supprimer le document",
|
||||||
"Create the pad": "Créer le pad",
|
"Content modal to generate a PDF": "Contenu modal pour générer un PDF",
|
||||||
"Create the template": "Créer le template",
|
"Content modal to update the document": "Contenu modal pour mettre à jour le groupe",
|
||||||
"Create your first pad by clicking on the \"Create a new pad\" button.": "Créez votre premier pad en cliquant sur le bouton \"Créer un nouveau pad\".",
|
"Create a new document": "Créer un nouveau document",
|
||||||
"Create your first template by clicking on the \"Create a new template\" button.": "Créez votre premier template en cliquant sur le bouton \"Créer un nouveau template\".",
|
"Create new document card": "Carte créer un nouveau groupe",
|
||||||
|
"Create the document": "Créer le document",
|
||||||
|
"Create your first document by clicking on the \"Create a new document\" button.": "Créez votre premier document en cliquant sur le bouton \"Créer un nouveau document\".",
|
||||||
|
"Delete document": "Supprimer le document",
|
||||||
|
"Deleting the document \"{{title}}\"": "Suppression du document \"{{title}}\"",
|
||||||
|
"Docs": "Docs",
|
||||||
|
"Docs Description": "Description de Docs",
|
||||||
|
"Docs Logo": "Logo Docs",
|
||||||
|
"Document icon": "Icône du document",
|
||||||
|
"Document name": "Nom du document",
|
||||||
|
"Documents": "Documents",
|
||||||
|
"Download": "Télécharger",
|
||||||
"Empty pads icon": "Icône des pads vides",
|
"Empty pads icon": "Icône des pads vides",
|
||||||
"Empty templates icon": "Icône de template vide",
|
"Enter the new name of the selected document.": "Entrez le nouveau nom du document sélectionné.",
|
||||||
"Freedom Equality Fraternity Logo": "Logo Liberté Égalité Fraternité",
|
"Freedom Equality Fraternity Logo": "Logo Liberté Égalité Fraternité",
|
||||||
"Generate PDF": "Générer PDF",
|
"Generate PDF": "Générer PDF",
|
||||||
"Impress": "Impress",
|
"Generate a PDF from your document, it will be inserted in the selected template.": "Générez un PDF à partir de votre document, il sera inséré dans le modèle sélectionné.",
|
||||||
"Impress Logo": "Impress logo",
|
|
||||||
"Is it public ?": "Est-ce public?",
|
"Is it public ?": "Est-ce public?",
|
||||||
|
"It seems that the page you are looking for does not exist or cannot be displayed correctly.": "Il semble que la page que vous cherchez n'existe pas ou ne puisse pas être affichée correctement.",
|
||||||
"Language": "Langue",
|
"Language": "Langue",
|
||||||
"Language Icon": "Icône de langue",
|
"Language Icon": "Icône de langue",
|
||||||
|
"Legal Notice": "Mentions Legales",
|
||||||
|
"Legal notice": "Mention légale",
|
||||||
|
"Logout": "Se déconnecter",
|
||||||
"Marianne Logo": "Logo Marianne",
|
"Marianne Logo": "Logo Marianne",
|
||||||
"Name the pad": "Nommer le pad",
|
"My account": "Mon compte",
|
||||||
"Name the template": "Nommer le template",
|
"Name the document": "Nommer le document",
|
||||||
"No editor found": "Pas d'éditeur trouvé",
|
"No editor found": "Pas d'éditeur trouvé",
|
||||||
"Open the pads panel": "Ouvrir le panneau des pads",
|
"Open the docs panel": "Ouvrir le panneau des docs",
|
||||||
"Open the templates panel": "Ouvrir le panneau des templates",
|
"Open the document options": "Ouvrir les options du document",
|
||||||
"Pad": "Pad",
|
"Ouch !": "Aïe !",
|
||||||
"Pad name": "Nom du pad",
|
|
||||||
"Pads icon": "Icône de pads",
|
"Pads icon": "Icône de pads",
|
||||||
"Profile picture": "Photo du profil",
|
"Personal data and cookies": "Données personnelles et cookies",
|
||||||
"Recents": "Récents",
|
|
||||||
"Something bad happens, please refresh the page.": "Une erreur inattendue s'est produite, rechargez la page.",
|
"Something bad happens, please refresh the page.": "Une erreur inattendue s'est produite, rechargez la page.",
|
||||||
"Something bad happens, please retry.": "Une erreur inattendue s'est produite, veuillez réessayer.",
|
"Something bad happens, please retry.": "Une erreur inattendue s'est produite, veuillez réessayer.",
|
||||||
"Sort pads icon": "Icône trier les pads",
|
"Sort documents icon": "Icône trier les documents",
|
||||||
"Sort templates icon": "Icône trier les templates",
|
"Sort the documents by creation date ascendent": "Trier les documents par date de création ascendante",
|
||||||
"Sort the pads by creation date ascendent": "Trier les pads par date de création ascendante",
|
"Sort the documents by creation date descendent": "Trier les documents par date de création descendante",
|
||||||
"Sort the pads by creation date descendent": "Trier les pads par date de création décroissante",
|
|
||||||
"Sort the templates by creation date ascendent": "Trier les templates par date de création ascendante",
|
|
||||||
"Sort the templates by creation date descendent": "Trier les templates par date de création décroissante",
|
|
||||||
"Template": "Template",
|
"Template": "Template",
|
||||||
"Template name": "Nom du template",
|
"The document has been deleted.": "Le document a bien été supprimé.",
|
||||||
"Template save successfully": "Template sauvegardé avec succès",
|
"The document has been updated.": "Le document a été mis à jour.",
|
||||||
"Templates icon": "Icône des templates",
|
"Update document": "Mettre à jour le document",
|
||||||
|
"Update document \"{{documentTitle}}\"": "Mettre à jour le document \"{{documentTitle}}\"",
|
||||||
|
"Validate the modification": "Valider les modifications",
|
||||||
"Your pdf was downloaded succesfully": "Votre pdf a été téléchargé avec succès",
|
"Your pdf was downloaded succesfully": "Votre pdf a été téléchargé avec succès",
|
||||||
"icon group": "icône groupe",
|
"icon group": "icône groupe"
|
||||||
"{{label}} button": "Bouton {{label}}",
|
|
||||||
"{{label}} icon": "Icône {{label}}"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ const Page: NextPageWithLayout = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box $align="center" $justify="center" $height="inherit">
|
<Box $align="center" $justify="center" $height="inherit">
|
||||||
<StyledLink href="/pads/create">
|
<StyledLink href="/docs/create">
|
||||||
<StyledButton>{t('Create a new pad')}</StyledButton>
|
<StyledButton>{t('Create a new document')}</StyledButton>
|
||||||
</StyledLink>
|
</StyledLink>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
@@ -3,7 +3,7 @@ import type { ReactElement } from 'react';
|
|||||||
import { PadLayout } from '@/layouts';
|
import { PadLayout } from '@/layouts';
|
||||||
import { NextPageWithLayout } from '@/types/next';
|
import { NextPageWithLayout } from '@/types/next';
|
||||||
|
|
||||||
import Pads from './pads/';
|
import Pads from './docs';
|
||||||
|
|
||||||
const Page: NextPageWithLayout = () => {
|
const Page: NextPageWithLayout = () => {
|
||||||
return <Pads />;
|
return <Pads />;
|
||||||
|
|||||||
Reference in New Issue
Block a user