🐛(frontend) fix crash share modal on grid options
The share modal in the DocsGridItem component was crashing when opened due to a provider not initialized.
This commit is contained in:
@@ -13,6 +13,7 @@ and this project adheres to
|
|||||||
- 🌐(frontend) keep simple tag during export #1154
|
- 🌐(frontend) keep simple tag during export #1154
|
||||||
- 🐛(back) manage can-edit endpoint without created room in the ws
|
- 🐛(back) manage can-edit endpoint without created room in the ws
|
||||||
- 🐛(frontend) fix action buttons not clickable #1162
|
- 🐛(frontend) fix action buttons not clickable #1162
|
||||||
|
- 🐛(frontend) fix crash share modal on grid options #1174
|
||||||
|
|
||||||
## [3.4.0] - 2025-07-09
|
## [3.4.0] - 2025-07-09
|
||||||
|
|
||||||
|
|||||||
@@ -91,6 +91,22 @@ test.describe('Document grid item options', () => {
|
|||||||
await page.goto('/');
|
await page.goto('/');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('it checks the share modal', async ({ page, browserName }) => {
|
||||||
|
const [docTitle] = await createDoc(page, `check share modal`, browserName);
|
||||||
|
|
||||||
|
await page.goto('/');
|
||||||
|
|
||||||
|
await expect(page.getByText(docTitle)).toBeVisible();
|
||||||
|
const row = await getGridRow(page, docTitle);
|
||||||
|
await row.getByText(`more_horiz`).click();
|
||||||
|
|
||||||
|
await page.getByRole('menuitem', { name: 'Share' }).click();
|
||||||
|
|
||||||
|
await expect(
|
||||||
|
page.getByRole('dialog').getByText('Share the document'),
|
||||||
|
).toBeVisible();
|
||||||
|
});
|
||||||
|
|
||||||
test('it pins a document', async ({ page, browserName }) => {
|
test('it pins a document', async ({ page, browserName }) => {
|
||||||
const [docTitle] = await createDoc(page, `Favorite doc`, browserName);
|
const [docTitle] = await createDoc(page, `Favorite doc`, browserName);
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { TreeProvider } from '@gouvfr-lasuite/ui-kit';
|
||||||
import { Tooltip, useModal } from '@openfun/cunningham-react';
|
import { Tooltip, useModal } from '@openfun/cunningham-react';
|
||||||
import { DateTime } from 'luxon';
|
import { DateTime } from 'luxon';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@@ -143,7 +144,9 @@ export const DocsGridItem = ({ doc, dragMode = false }: DocsGridItemProps) => {
|
|||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
{shareModal.isOpen && (
|
{shareModal.isOpen && (
|
||||||
<DocShareModal doc={doc} onClose={shareModal.close} />
|
<TreeProvider initialNodeId={doc.id}>
|
||||||
|
<DocShareModal doc={doc} onClose={shareModal.close} />
|
||||||
|
</TreeProvider>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user