(frontend) feature versioning

We can now see the version of the document
and navigate to different versions.
Collaboration is possible per version.
This commit is contained in:
Anthony LC
2024-07-17 15:30:52 +02:00
committed by Anthony LC
parent 1ed20c3896
commit a9383212a3
23 changed files with 671 additions and 216 deletions

View File

@@ -140,3 +140,34 @@ export const goToGridDoc = async (
return docTitle as string;
};
export const mockedDocument = async (page: Page, json: object) => {
await page.route('**/documents/**/', async (route) => {
const request = route.request();
if (request.method().includes('GET') && !request.url().includes('page=')) {
await route.fulfill({
json: {
id: 'b0df4343-c8bd-4c20-9ff6-fbf94fc94egg',
content: '',
title: 'Mocked document',
accesses: [],
abilities: {
destroy: false, // Means not owner
versions_destroy: false,
versions_list: true,
versions_retrieve: true,
manage_accesses: false, // Means not admin
update: false,
partial_update: false, // Means not editor
retrieve: true,
},
is_public: false,
created_at: '2021-09-01T09:00:00Z',
...json,
},
});
} else {
await route.continue();
}
});
};