refactor(core): doc property (#8465)

doc property upgraded to use orm.

The visibility of the property are simplified to three types: `always show`, `always hide`, `hide when empty`, and the default is `always show`.

![CleanShot 2024-10-14 at 15 34 52](https://github.com/user-attachments/assets/748b8b80-061f-4d6a-8579-52e59df717c2)

Added a sidebar view to manage properties
![CleanShot 2024-10-14 at 15 35 58](https://github.com/user-attachments/assets/bffa9b1a-a1a5-4708-b2e8-4963120f3af9)

new property ui in workspace settings
![CleanShot 2024-10-14 at 15 36 44](https://github.com/user-attachments/assets/572d8dcc-9b3d-462a-9bcc-5f5fa8e622da)

Property lists can be collapsed
![CleanShot 2024-10-14 at 15 37 59](https://github.com/user-attachments/assets/2b20be1a-8141-478a-8fe7-405aff6d04fd)
This commit is contained in:
EYHN
2024-10-15 10:17:11 +00:00
parent 13b24eb823
commit 24e0c5797c
88 changed files with 3151 additions and 3617 deletions

View File

@@ -44,8 +44,6 @@ test('New a page and open it ,then open info modal in the title bar', async ({
const infoModal = page.getByTestId('info-modal');
await expect(infoModal).toBeVisible();
const tagRow = page.getByTestId('info-modal-tags-row');
await expect(tagRow).toBeVisible();
const title = page.getByTestId('info-modal-title');
await expect(title).toHaveText('this is a new page');
});
@@ -58,8 +56,6 @@ test('New a page and open it ,then open info modal in the title bar more action
const infoModal = page.getByTestId('info-modal');
await expect(infoModal).toBeVisible();
const tagRow = page.getByTestId('info-modal-tags-row');
await expect(tagRow).toBeVisible();
const title = page.getByTestId('info-modal-title');
await expect(title).toHaveText('this is a new page');
});
@@ -75,8 +71,6 @@ test('New a page, then open info modal from all doc', async ({ page }) => {
const infoModal = page.getByTestId('info-modal');
await expect(infoModal).toBeVisible();
const tagRow = page.getByTestId('info-modal-tags-row');
await expect(tagRow).toBeVisible();
const title = page.getByTestId('info-modal-title');
await expect(title).toHaveText('this is a new page');
});
@@ -105,8 +99,6 @@ test('New a page and add to favourites, then open info modal from sidebar', asyn
const infoModal = page.getByTestId('info-modal');
await expect(infoModal).toBeVisible();
const tagRow = page.getByTestId('info-modal-tags-row');
await expect(tagRow).toBeVisible();
const title = page.getByTestId('info-modal-title');
await expect(title).toHaveText('this is a new page');
});
@@ -116,16 +108,16 @@ test('allow create tag', async ({ page }) => {
const infoModal = page.getByTestId('info-modal');
await expect(infoModal).toBeVisible();
await page.getByTestId('info-modal-tags-value').click();
await infoModal.getByTestId('property-tags-value').click();
await searchAndCreateTag(page, 'Test1');
await searchAndCreateTag(page, 'Test2');
await closeTagsEditor(page);
await expectTagsVisible(page, ['Test1', 'Test2']);
await expectTagsVisible(infoModal, ['Test1', 'Test2']);
await page.getByTestId('info-modal-tags-value').click();
await infoModal.getByTestId('property-tags-value').click();
await removeSelectedTag(page, 'Test1');
await closeTagsEditor(page);
await expectTagsVisible(page, ['Test2']);
await expectTagsVisible(infoModal, ['Test2']);
});
test('add custom property', async ({ page }) => {
@@ -133,10 +125,10 @@ test('add custom property', async ({ page }) => {
const infoModal = page.getByTestId('info-modal');
await expect(infoModal).toBeVisible();
await addCustomProperty(page, 'Text');
await addCustomProperty(page, 'Number');
await addCustomProperty(page, 'Date');
await addCustomProperty(page, 'Checkbox');
await addCustomProperty(page, 'Created by');
await addCustomProperty(page, 'Last edited by');
await addCustomProperty(page, infoModal, 'text');
await addCustomProperty(page, infoModal, 'number');
await addCustomProperty(page, infoModal, 'date');
await addCustomProperty(page, infoModal, 'checkbox');
await addCustomProperty(page, infoModal, 'createdBy');
await addCustomProperty(page, infoModal, 'updatedBy');
});