mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-22 21:31:32 +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
|
||||
ENABLE_DEBUG_PAGE=
|
||||
ENABLE_SUBPAGE=
|
||||
ENABLE_CHANGELOG=
|
||||
|
||||
# Sentry
|
||||
SENTRY_AUTH_TOKEN=
|
||||
|
@ -11,5 +11,6 @@ const config = {
|
||||
process.env.ENABLE_DEBUG_PAGE ?? process.env.NODE_ENV === 'development'
|
||||
),
|
||||
enableSubpage: Boolean(process.env.ENABLE_SUBPAGE),
|
||||
enableChangeLog: Boolean(process.env.ENABLE_CHANGELOG),
|
||||
};
|
||||
export default config;
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { MuiFade, Tooltip } from '@affine/component';
|
||||
import { config } from '@affine/env';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
import { CloseIcon, DoneIcon } from '@blocksuite/icons';
|
||||
import dynamic from 'next/dynamic';
|
||||
@ -12,7 +13,6 @@ import {
|
||||
StyledIsland,
|
||||
StyledTriggerWrapper,
|
||||
} from './style';
|
||||
|
||||
const ContactModal = dynamic(
|
||||
() =>
|
||||
import('@affine/component/contact-modal').then(({ ContactModal }) => ({
|
||||
@ -25,7 +25,9 @@ const ContactModal = dynamic(
|
||||
|
||||
export type IslandItemNames = 'whatNew' | 'contact' | 'shortcuts';
|
||||
export const HelpIsland = ({
|
||||
showList = ['whatNew', 'contact', 'shortcuts'],
|
||||
showList = config.enableChangeLog
|
||||
? ['whatNew', 'contact', 'shortcuts']
|
||||
: ['contact', 'shortcuts'],
|
||||
}: {
|
||||
showList?: IslandItemNames[];
|
||||
}) => {
|
||||
|
@ -109,7 +109,7 @@ export const WorkSpaceSliderBar: React.FC<WorkSpaceSliderBarProps> = ({
|
||||
currentWorkspace={currentWorkspace}
|
||||
onClick={onOpenWorkspaceListModal}
|
||||
/>
|
||||
<ChangeLog />
|
||||
{config.enableChangeLog && <ChangeLog />}
|
||||
<StyledListItem
|
||||
data-testid="slider-bar-quick-search-button"
|
||||
onClick={useCallback(() => {
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import { config } from '@affine/env';
|
||||
import { setUpLanguage, useTranslation } from '@affine/i18n';
|
||||
import { createAffineGlobalChannel } from '@affine/workspace/affine/sync';
|
||||
import { jotaiWorkspacesAtom } from '@affine/workspace/atom';
|
||||
@ -339,7 +340,11 @@ export const WorkspaceLayoutInner: React.FC<React.PropsWithChildren> = ({
|
||||
{!isPublicWorkspace && (
|
||||
<HelpIsland
|
||||
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**
|
||||
exposeInternal: z.boolean(),
|
||||
enableSubpage: z.boolean(),
|
||||
enableChangeLog: z.boolean(),
|
||||
});
|
||||
|
||||
export type PublicRuntimeConfig = z.infer<typeof publicRuntimeConfigSchema>;
|
||||
|
@ -74,6 +74,8 @@ const config: PlaywrightTestConfig = {
|
||||
env: {
|
||||
COVERAGE: process.env.COVERAGE || 'false',
|
||||
ENABLE_DEBUG_PAGE: '1',
|
||||
ENABLE_SUBPAGE: '1',
|
||||
ENABLE_CHANGELOG: '1',
|
||||
NODE_API_SERVER: 'local',
|
||||
},
|
||||
},
|
||||
|
@ -13,6 +13,7 @@ export default function getConfig() {
|
||||
prefetchWorkspace: false,
|
||||
exposeInternal: true,
|
||||
enableSubpage: true,
|
||||
enableChangeLog: true,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user