feat: remove old setting page by default (#2980)

This commit is contained in:
Alex Yang 2023-07-03 18:59:23 +08:00 committed by GitHub
parent 18874d0d1e
commit 0f1c5163a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 22 deletions

View File

@ -28,7 +28,7 @@ const buildPreset = {
enableLegacyCloud: false,
changelogUrl: 'https://affine.pro/blog/whats-new-affine-0630',
enablePreloading: true,
enableNewSettingModal: false,
enableNewSettingModal: true,
enableNewSettingUnstableApi: false,
enableSQLiteProvider: false,
enableNotificationCenter: false,

View File

@ -175,30 +175,20 @@ export const RootAppSidebar = ({
>
<span data-testid="all-pages">{t['All pages']()}</span>
</RouteMenuLinkItem>
<RouteMenuLinkItem
data-testid="slider-bar-workspace-setting-button"
icon={<SettingsIcon />}
currentPath={currentPath}
path={currentWorkspaceId && paths.setting(currentWorkspaceId)}
>
<span data-testid="settings">{t['Settings']()}</span>
</RouteMenuLinkItem>
{!runtimeConfig.enableNewSettingModal && (
<RouteMenuLinkItem
data-testid="slider-bar-workspace-setting-button"
icon={<SettingsIcon />}
currentPath={currentPath}
path={currentWorkspaceId && paths.setting(currentWorkspaceId)}
>
<span data-testid="settings">{t['Settings']()}</span>
</RouteMenuLinkItem>
)}
{runtimeConfig.enableNewSettingModal ? (
<MenuItem icon={<SettingsIcon />} onClick={onOpenSettingModal}>
<span data-testid="settings-modal-trigger">
{t['Settings']()}
<i
style={{
background: 'var(--affine-palette-line-blue)',
borderRadius: '2px',
fontSize: '8px',
padding: '0 5px',
color: 'var(--affine-white)',
marginLeft: '15px',
}}
>
NEW
</i>
</span>
</MenuItem>
) : null}

View File

@ -17,10 +17,12 @@ test('should create a page with a local first avatar', async ({ page }) => {
await page.getByTestId('create-workspace-create-button').click();
await page.getByTestId('workspace-name').click();
await page.getByTestId('workspace-card').nth(1).click();
await page.getByTestId('slider-bar-workspace-setting-button').click();
await page.getByTestId('settings-modal-trigger').click();
await page.getByText('current').click();
await page
.getByTestId('upload-avatar')
.setInputFiles('./tests/fixtures/smile.png');
await page.mouse.click(0, 0);
await page.getByTestId('workspace-name').click();
await page.getByTestId('workspace-card').nth(0).click();
await page.waitForTimeout(1000);