mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
fix: a serise of ui issues of new setting (#2920)
Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
@@ -19,7 +19,7 @@ export const blockSuiteFeatureFlags = {
|
||||
*/
|
||||
const buildPreset = {
|
||||
stable: {
|
||||
enableAllPageFilter: true,
|
||||
enableAllPageSaving: false,
|
||||
enablePlugin: false,
|
||||
enableTestProperties: false,
|
||||
enableBroadcastChannelProvider: true,
|
||||
@@ -28,13 +28,14 @@ const buildPreset = {
|
||||
changelogUrl: 'https://affine.pro/blog/what-is-new-affine-0620',
|
||||
enablePreloading: true,
|
||||
enableNewSettingModal: false,
|
||||
enableNewSettingUnstableApi: false,
|
||||
enableSQLiteProvider: false,
|
||||
},
|
||||
beta: {},
|
||||
internal: {},
|
||||
// canary will be aggressive and enable all features
|
||||
canary: {
|
||||
enableAllPageFilter: true,
|
||||
enableAllPageSaving: true,
|
||||
enablePlugin: true,
|
||||
enableTestProperties: true,
|
||||
enableBroadcastChannelProvider: true,
|
||||
@@ -43,6 +44,7 @@ const buildPreset = {
|
||||
changelogUrl: 'https://github.com/toeverything/AFFiNE/releases',
|
||||
enablePreloading: true,
|
||||
enableNewSettingModal: true,
|
||||
enableNewSettingUnstableApi: false,
|
||||
enableSQLiteProvider: false,
|
||||
},
|
||||
};
|
||||
@@ -51,36 +53,43 @@ const buildPreset = {
|
||||
buildPreset.beta = buildPreset.stable;
|
||||
buildPreset.internal = buildPreset.stable;
|
||||
|
||||
const currentBuild = process.env.BUILD_ENV || 'stable';
|
||||
const currentBuild = process.env.BUILD_TYPE || 'stable';
|
||||
|
||||
if (process.env.CI && !process.env.BUILD_TYPE) {
|
||||
throw new Error('BUILD_ENV is required in CI');
|
||||
}
|
||||
|
||||
const currentBuildPreset = buildPreset[currentBuild];
|
||||
|
||||
const environmentPreset = {
|
||||
enablePlugin: process.env.ENABLE_PLUGIN
|
||||
? process.env.ENABLE_PLUGIN === 'true'
|
||||
: buildPreset.canary.enablePlugin,
|
||||
enableAllPageFilter: process.env.ENABLE_ALL_PAGE_FILTER
|
||||
: currentBuildPreset.enablePlugin,
|
||||
enableAllPageSaving: process.env.ENABLE_ALL_PAGE_SAVING
|
||||
? process.env.ENABLE_ALL_PAGE_FILTER === 'true'
|
||||
: buildPreset.canary.enableAllPageFilter,
|
||||
: currentBuildPreset.enableAllPageSaving,
|
||||
enableTestProperties: process.env.ENABLE_TEST_PROPERTIES
|
||||
? process.env.ENABLE_TEST_PROPERTIES === 'true'
|
||||
: buildPreset.canary.enableTestProperties,
|
||||
: currentBuildPreset.enableTestProperties,
|
||||
enableLegacyCloud: process.env.ENABLE_LEGACY_PROVIDER
|
||||
? process.env.ENABLE_LEGACY_PROVIDER === 'true'
|
||||
: buildPreset.canary.enableLegacyCloud,
|
||||
: currentBuildPreset.enableLegacyCloud,
|
||||
enableBroadcastChannelProvider: process.env.ENABLE_BC_PROVIDER
|
||||
? process.env.ENABLE_BC_PROVIDER !== 'false'
|
||||
: buildPreset.canary.enableBroadcastChannelProvider,
|
||||
changelogUrl: process.env.CHANGELOG_URL ?? buildPreset.canary.changelogUrl,
|
||||
: currentBuildPreset.enableBroadcastChannelProvider,
|
||||
changelogUrl: process.env.CHANGELOG_URL ?? currentBuildPreset.changelogUrl,
|
||||
enablePreloading: process.env.ENABLE_PRELOADING
|
||||
? process.env.ENABLE_PRELOADING === 'true'
|
||||
: buildPreset.canary.enablePreloading,
|
||||
: currentBuildPreset.enablePreloading,
|
||||
enableNewSettingModal: process.env.ENABLE_NEW_SETTING_MODAL
|
||||
? process.env.ENABLE_NEW_SETTING_MODAL === 'true'
|
||||
: buildPreset.canary.enableNewSettingModal,
|
||||
: currentBuildPreset.enableNewSettingModal,
|
||||
enableSQLiteProvider: process.env.ENABLE_SQLITE_PROVIDER
|
||||
? process.env.ENABLE_SQLITE_PROVIDER === 'true'
|
||||
: buildPreset.canary.enableSQLiteProvider,
|
||||
: currentBuildPreset.enableSQLiteProvider,
|
||||
enableNewSettingUnstableApi: process.env.ENABLE_NEW_SETTING_UNSTABLE_API
|
||||
? process.env.ENABLE_NEW_SETTING_UNSTABLE_API === 'true'
|
||||
: currentBuildPreset.enableNewSettingUnstableApi,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -91,7 +100,7 @@ const buildFlags = {
|
||||
// environment preset will overwrite current build preset
|
||||
// this environment variable is for debug proposes only
|
||||
// do not put them into CI
|
||||
...environmentPreset,
|
||||
...(process.env.CI ? {} : environmentPreset),
|
||||
};
|
||||
|
||||
export { buildFlags };
|
||||
|
||||
@@ -137,9 +137,7 @@ const PublishPanelLocal: FC<PublishPanelLocalProps> = ({
|
||||
}}
|
||||
style={{ marginTop: '12px' }}
|
||||
>
|
||||
{runtimeConfig.enableLegacyCloud
|
||||
? t['Enable AFFiNE Cloud']()
|
||||
: 'Disable AFFiNE Cloud'}
|
||||
{t['Enable AFFiNE Cloud']()}
|
||||
</Button>
|
||||
</SettingRow>
|
||||
<FakePublishPanelAffine workspace={workspace} />
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
// Some settings are not implemented yet, but need to show in the setting modal when boss is watching.
|
||||
export const IS_EXHIBITION = true;
|
||||
@@ -8,7 +8,6 @@ import { ArrowRightSmallIcon, OpenInNewIcon } from '@blocksuite/icons';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { type AppSetting, useAppSetting } from '../../../../../atoms/settings';
|
||||
import { IS_EXHIBITION } from '../../config';
|
||||
import { communityItem, communityWrapper, link } from './style.css';
|
||||
|
||||
export const AboutAffine = () => {
|
||||
@@ -23,7 +22,7 @@ export const AboutAffine = () => {
|
||||
return (
|
||||
<>
|
||||
<SettingHeader title={t['About AFFiNE']()} subtitle={t['None yet']()} />
|
||||
{IS_EXHIBITION && environment.isDesktop ? (
|
||||
{runtimeConfig.enableNewSettingUnstableApi && environment.isDesktop ? (
|
||||
<SettingWrapper title={t['Version']()}>
|
||||
<SettingRow
|
||||
name={t['Check for updates']()}
|
||||
|
||||
@@ -12,7 +12,6 @@ import {
|
||||
windowFrameStyleOptions,
|
||||
} from '../../../../../atoms/settings';
|
||||
import { LanguageMenu } from '../../../language-menu';
|
||||
import { IS_EXHIBITION } from '../../config';
|
||||
import { DateFormatSetting } from './date-format-setting';
|
||||
import { settingWrapper } from './style.css';
|
||||
|
||||
@@ -70,7 +69,7 @@ export const AppearanceSettings = () => {
|
||||
<LanguageMenu />
|
||||
</div>
|
||||
</SettingRow>
|
||||
{IS_EXHIBITION && environment.isDesktop ? (
|
||||
{runtimeConfig.enableNewSettingUnstableApi && environment.isDesktop ? (
|
||||
<SettingRow
|
||||
name={t['Client Border Style']()}
|
||||
desc={t['Customize the appearance of the client.']()}
|
||||
@@ -91,7 +90,7 @@ export const AppearanceSettings = () => {
|
||||
onChange={checked => changeSwitch('fullWidthLayout', checked)}
|
||||
/>
|
||||
</SettingRow>
|
||||
{IS_EXHIBITION && environment.isDesktop ? (
|
||||
{runtimeConfig.enableNewSettingUnstableApi && environment.isDesktop ? (
|
||||
<SettingRow
|
||||
name={t['Window frame style']()}
|
||||
desc={t['Customize appearance of Windows Client.']()}
|
||||
@@ -114,7 +113,7 @@ export const AppearanceSettings = () => {
|
||||
</SettingRow>
|
||||
) : null}
|
||||
</SettingWrapper>
|
||||
{IS_EXHIBITION ? (
|
||||
{runtimeConfig.enableNewSettingUnstableApi ? (
|
||||
<SettingWrapper title={t['Date']()}>
|
||||
<SettingRow
|
||||
name={t['Date Format']()}
|
||||
@@ -154,9 +153,9 @@ export const AppearanceSettings = () => {
|
||||
desc={t['None yet']()}
|
||||
>
|
||||
<Switch
|
||||
checked={appSettings.disableBlurBackground}
|
||||
checked={!appSettings.disableBlurBackground}
|
||||
onChange={checked =>
|
||||
changeSwitch('disableBlurBackground', checked)
|
||||
changeSwitch('disableBlurBackground', !checked)
|
||||
}
|
||||
/>
|
||||
</SettingRow>
|
||||
|
||||
@@ -3,7 +3,8 @@ import { globalStyle, style } from '@vanilla-extract/css';
|
||||
export const settingContent = style({
|
||||
flexGrow: '1',
|
||||
height: '100%',
|
||||
padding: '40px 0',
|
||||
padding: '40px 15px 20px',
|
||||
overflowX: 'auto',
|
||||
});
|
||||
|
||||
globalStyle(`${settingContent} .wrapper`, {
|
||||
|
||||
@@ -39,7 +39,7 @@ export function WorkspaceHeader({
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
{runtimeConfig.enableAllPageFilter && (
|
||||
{runtimeConfig.enableAllPageSaving && (
|
||||
<div>
|
||||
{setting.currentView.id !== NIL ||
|
||||
(setting.currentView.id === NIL &&
|
||||
|
||||
Reference in New Issue
Block a user