mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 02:01:42 +03:00
chore: add build flag for change log (#1792)
This commit is contained in:
parent
fcf5d5602d
commit
196b9f2dbb
@ -16,6 +16,7 @@ ENABLE_BC_PROVIDER=1
|
|||||||
EXPOSE_INTERNAL=1
|
EXPOSE_INTERNAL=1
|
||||||
ENABLE_DEBUG_PAGE=
|
ENABLE_DEBUG_PAGE=
|
||||||
ENABLE_SUBPAGE=
|
ENABLE_SUBPAGE=
|
||||||
|
ENABLE_CHANGELOG=
|
||||||
|
|
||||||
# Sentry
|
# Sentry
|
||||||
SENTRY_AUTH_TOKEN=
|
SENTRY_AUTH_TOKEN=
|
||||||
|
@ -11,5 +11,6 @@ const config = {
|
|||||||
process.env.ENABLE_DEBUG_PAGE ?? process.env.NODE_ENV === 'development'
|
process.env.ENABLE_DEBUG_PAGE ?? process.env.NODE_ENV === 'development'
|
||||||
),
|
),
|
||||||
enableSubpage: Boolean(process.env.ENABLE_SUBPAGE),
|
enableSubpage: Boolean(process.env.ENABLE_SUBPAGE),
|
||||||
|
enableChangeLog: Boolean(process.env.ENABLE_CHANGELOG),
|
||||||
};
|
};
|
||||||
export default config;
|
export default config;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { MuiFade, Tooltip } from '@affine/component';
|
import { MuiFade, Tooltip } from '@affine/component';
|
||||||
|
import { config } from '@affine/env';
|
||||||
import { useTranslation } from '@affine/i18n';
|
import { useTranslation } from '@affine/i18n';
|
||||||
import { CloseIcon, DoneIcon } from '@blocksuite/icons';
|
import { CloseIcon, DoneIcon } from '@blocksuite/icons';
|
||||||
import dynamic from 'next/dynamic';
|
import dynamic from 'next/dynamic';
|
||||||
@ -12,7 +13,6 @@ import {
|
|||||||
StyledIsland,
|
StyledIsland,
|
||||||
StyledTriggerWrapper,
|
StyledTriggerWrapper,
|
||||||
} from './style';
|
} from './style';
|
||||||
|
|
||||||
const ContactModal = dynamic(
|
const ContactModal = dynamic(
|
||||||
() =>
|
() =>
|
||||||
import('@affine/component/contact-modal').then(({ ContactModal }) => ({
|
import('@affine/component/contact-modal').then(({ ContactModal }) => ({
|
||||||
@ -25,7 +25,9 @@ const ContactModal = dynamic(
|
|||||||
|
|
||||||
export type IslandItemNames = 'whatNew' | 'contact' | 'shortcuts';
|
export type IslandItemNames = 'whatNew' | 'contact' | 'shortcuts';
|
||||||
export const HelpIsland = ({
|
export const HelpIsland = ({
|
||||||
showList = ['whatNew', 'contact', 'shortcuts'],
|
showList = config.enableChangeLog
|
||||||
|
? ['whatNew', 'contact', 'shortcuts']
|
||||||
|
: ['contact', 'shortcuts'],
|
||||||
}: {
|
}: {
|
||||||
showList?: IslandItemNames[];
|
showList?: IslandItemNames[];
|
||||||
}) => {
|
}) => {
|
||||||
|
@ -109,7 +109,7 @@ export const WorkSpaceSliderBar: React.FC<WorkSpaceSliderBarProps> = ({
|
|||||||
currentWorkspace={currentWorkspace}
|
currentWorkspace={currentWorkspace}
|
||||||
onClick={onOpenWorkspaceListModal}
|
onClick={onOpenWorkspaceListModal}
|
||||||
/>
|
/>
|
||||||
<ChangeLog />
|
{config.enableChangeLog && <ChangeLog />}
|
||||||
<StyledListItem
|
<StyledListItem
|
||||||
data-testid="slider-bar-quick-search-button"
|
data-testid="slider-bar-quick-search-button"
|
||||||
onClick={useCallback(() => {
|
onClick={useCallback(() => {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { DebugLogger } from '@affine/debug';
|
import { DebugLogger } from '@affine/debug';
|
||||||
|
import { config } from '@affine/env';
|
||||||
import { setUpLanguage, useTranslation } from '@affine/i18n';
|
import { setUpLanguage, useTranslation } from '@affine/i18n';
|
||||||
import { createAffineGlobalChannel } from '@affine/workspace/affine/sync';
|
import { createAffineGlobalChannel } from '@affine/workspace/affine/sync';
|
||||||
import { jotaiWorkspacesAtom } from '@affine/workspace/atom';
|
import { jotaiWorkspacesAtom } from '@affine/workspace/atom';
|
||||||
@ -339,7 +340,11 @@ export const WorkspaceLayoutInner: React.FC<React.PropsWithChildren> = ({
|
|||||||
{!isPublicWorkspace && (
|
{!isPublicWorkspace && (
|
||||||
<HelpIsland
|
<HelpIsland
|
||||||
showList={
|
showList={
|
||||||
router.query.pageId ? undefined : ['whatNew', 'contact']
|
router.query.pageId
|
||||||
|
? undefined
|
||||||
|
: config.enableChangeLog
|
||||||
|
? ['whatNew', 'contact']
|
||||||
|
: ['contact']
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
1
packages/env/src/index.ts
vendored
1
packages/env/src/index.ts
vendored
@ -111,6 +111,7 @@ export const publicRuntimeConfigSchema = z.object({
|
|||||||
// expose internal api to globalThis, **development only**
|
// expose internal api to globalThis, **development only**
|
||||||
exposeInternal: z.boolean(),
|
exposeInternal: z.boolean(),
|
||||||
enableSubpage: z.boolean(),
|
enableSubpage: z.boolean(),
|
||||||
|
enableChangeLog: z.boolean(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type PublicRuntimeConfig = z.infer<typeof publicRuntimeConfigSchema>;
|
export type PublicRuntimeConfig = z.infer<typeof publicRuntimeConfigSchema>;
|
||||||
|
@ -74,6 +74,8 @@ const config: PlaywrightTestConfig = {
|
|||||||
env: {
|
env: {
|
||||||
COVERAGE: process.env.COVERAGE || 'false',
|
COVERAGE: process.env.COVERAGE || 'false',
|
||||||
ENABLE_DEBUG_PAGE: '1',
|
ENABLE_DEBUG_PAGE: '1',
|
||||||
|
ENABLE_SUBPAGE: '1',
|
||||||
|
ENABLE_CHANGELOG: '1',
|
||||||
NODE_API_SERVER: 'local',
|
NODE_API_SERVER: 'local',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -13,6 +13,7 @@ export default function getConfig() {
|
|||||||
prefetchWorkspace: false,
|
prefetchWorkspace: false,
|
||||||
exposeInternal: true,
|
exposeInternal: true,
|
||||||
enableSubpage: true,
|
enableSubpage: true,
|
||||||
|
enableChangeLog: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user