mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-27 02:42:25 +08:00
chore: clean up runtime flags and envs (#7454)
This commit is contained in:
@@ -1,14 +1,8 @@
|
|||||||
ENABLE_PLUGIN=
|
|
||||||
ENABLE_TEST_PROPERTIES=
|
|
||||||
ENABLE_BC_PROVIDER=
|
|
||||||
CHANGELOG_URL=
|
CHANGELOG_URL=
|
||||||
ENABLE_PRELOADING=
|
ENABLE_PRELOADING=
|
||||||
ENABLE_NEW_SETTING_MODAL=
|
|
||||||
ENABLE_SQLITE_PROVIDER=
|
|
||||||
ENABLE_NEW_SETTING_UNSTABLE_API=
|
ENABLE_NEW_SETTING_UNSTABLE_API=
|
||||||
ENABLE_NOTIFICATION_CENTER=
|
ENABLE_CAPTCHA=
|
||||||
ENABLE_CLOUD=
|
CAPTCHA_SITE_KEY=
|
||||||
ENABLE_MOVE_DATABASE=
|
ENABLE_ENHANCE_SHARE_MODE=
|
||||||
SHOULD_REPORT_TRACE=
|
ALLOW_LOCAL_WORKSPACE=
|
||||||
TRACE_REPORT_ENDPOINT=
|
DEBUG_JOTAI=
|
||||||
CAPTCHA_SITE_KEY=
|
|
||||||
2
.github/workflows/build-server-image.yml
vendored
2
.github/workflows/build-server-image.yml
vendored
@@ -58,7 +58,6 @@ jobs:
|
|||||||
run: yarn nx build @affine/web --skip-nx-cache
|
run: yarn nx build @affine/web --skip-nx-cache
|
||||||
env:
|
env:
|
||||||
BUILD_TYPE: ${{ github.event.inputs.flavor }}
|
BUILD_TYPE: ${{ github.event.inputs.flavor }}
|
||||||
SHOULD_REPORT_TRACE: false
|
|
||||||
PUBLIC_PATH: '/'
|
PUBLIC_PATH: '/'
|
||||||
SELF_HOSTED: true
|
SELF_HOSTED: true
|
||||||
MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN }}
|
MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN }}
|
||||||
@@ -86,7 +85,6 @@ jobs:
|
|||||||
run: yarn nx build @affine/admin --skip-nx-cache
|
run: yarn nx build @affine/admin --skip-nx-cache
|
||||||
env:
|
env:
|
||||||
BUILD_TYPE: ${{ github.event.inputs.flavor }}
|
BUILD_TYPE: ${{ github.event.inputs.flavor }}
|
||||||
SHOULD_REPORT_TRACE: false
|
|
||||||
PUBLIC_PATH: '/admin/'
|
PUBLIC_PATH: '/admin/'
|
||||||
SELF_HOSTED: true
|
SELF_HOSTED: true
|
||||||
MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN }}
|
MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN }}
|
||||||
|
|||||||
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
@@ -45,8 +45,6 @@ jobs:
|
|||||||
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
||||||
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
||||||
BUILD_TYPE: ${{ github.event.inputs.flavor }}
|
BUILD_TYPE: ${{ github.event.inputs.flavor }}
|
||||||
SHOULD_REPORT_TRACE: true
|
|
||||||
TRACE_REPORT_ENDPOINT: ${{ secrets.TRACE_REPORT_ENDPOINT }}
|
|
||||||
CAPTCHA_SITE_KEY: ${{ secrets.CAPTCHA_SITE_KEY }}
|
CAPTCHA_SITE_KEY: ${{ secrets.CAPTCHA_SITE_KEY }}
|
||||||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
||||||
SENTRY_PROJECT: 'affine-web'
|
SENTRY_PROJECT: 'affine-web'
|
||||||
@@ -79,8 +77,6 @@ jobs:
|
|||||||
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
||||||
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
||||||
BUILD_TYPE: ${{ github.event.inputs.flavor }}
|
BUILD_TYPE: ${{ github.event.inputs.flavor }}
|
||||||
SHOULD_REPORT_TRACE: true
|
|
||||||
TRACE_REPORT_ENDPOINT: ${{ secrets.TRACE_REPORT_ENDPOINT }}
|
|
||||||
CAPTCHA_SITE_KEY: ${{ secrets.CAPTCHA_SITE_KEY }}
|
CAPTCHA_SITE_KEY: ${{ secrets.CAPTCHA_SITE_KEY }}
|
||||||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
||||||
SENTRY_PROJECT: 'affine-admin'
|
SENTRY_PROJECT: 'affine-admin'
|
||||||
|
|||||||
33
packages/common/env/src/global.ts
vendored
33
packages/common/env/src/global.ts
vendored
@@ -6,26 +6,6 @@ import { isDesktop, isServer } from './constant.js';
|
|||||||
import { UaHelper } from './ua-helper.js';
|
import { UaHelper } from './ua-helper.js';
|
||||||
|
|
||||||
export const runtimeFlagsSchema = z.object({
|
export const runtimeFlagsSchema = z.object({
|
||||||
enableTestProperties: z.boolean(),
|
|
||||||
enableBroadcastChannelProvider: z.boolean(),
|
|
||||||
enableDebugPage: z.boolean(),
|
|
||||||
githubUrl: z.string(),
|
|
||||||
changelogUrl: z.string(),
|
|
||||||
downloadUrl: z.string(),
|
|
||||||
// see: tools/workers
|
|
||||||
imageProxyUrl: z.string(),
|
|
||||||
linkPreviewUrl: z.string(),
|
|
||||||
enablePreloading: z.boolean(),
|
|
||||||
enableNewSettingModal: z.boolean(),
|
|
||||||
enableNewSettingUnstableApi: z.boolean(),
|
|
||||||
enableCloud: z.boolean(),
|
|
||||||
enableCaptcha: z.boolean(),
|
|
||||||
enableEnhanceShareMode: z.boolean(),
|
|
||||||
enablePayment: z.boolean(),
|
|
||||||
enablePageHistory: z.boolean(),
|
|
||||||
enableExperimentalFeature: z.boolean(),
|
|
||||||
enableInfoModal: z.boolean(),
|
|
||||||
allowLocalWorkspace: z.boolean(),
|
|
||||||
// this is for the electron app
|
// this is for the electron app
|
||||||
serverUrlPrefix: z.string(),
|
serverUrlPrefix: z.string(),
|
||||||
appVersion: z.string(),
|
appVersion: z.string(),
|
||||||
@@ -37,6 +17,19 @@ export const runtimeFlagsSchema = z.object({
|
|||||||
z.literal('canary'),
|
z.literal('canary'),
|
||||||
]),
|
]),
|
||||||
isSelfHosted: z.boolean().optional(),
|
isSelfHosted: z.boolean().optional(),
|
||||||
|
githubUrl: z.string(),
|
||||||
|
changelogUrl: z.string(),
|
||||||
|
downloadUrl: z.string(),
|
||||||
|
// see: tools/workers
|
||||||
|
imageProxyUrl: z.string(),
|
||||||
|
linkPreviewUrl: z.string(),
|
||||||
|
allowLocalWorkspace: z.boolean(),
|
||||||
|
enablePreloading: z.boolean(),
|
||||||
|
enableNewSettingUnstableApi: z.boolean(),
|
||||||
|
enableCaptcha: z.boolean(),
|
||||||
|
enableEnhanceShareMode: z.boolean(),
|
||||||
|
enableExperimentalFeature: z.boolean(),
|
||||||
|
enableInfoModal: z.boolean(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type RuntimeConfig = z.infer<typeof runtimeFlagsSchema>;
|
export type RuntimeConfig = z.infer<typeof runtimeFlagsSchema>;
|
||||||
|
|||||||
@@ -29,12 +29,6 @@ export default {
|
|||||||
target: 'ES2022',
|
target: 'ES2022',
|
||||||
},
|
},
|
||||||
define: {
|
define: {
|
||||||
'process.env': {},
|
|
||||||
'process.env.COVERAGE': JSON.stringify(!!process.env.COVERAGE),
|
|
||||||
'process.env.SHOULD_REPORT_TRACE': `${Boolean(
|
|
||||||
process.env.SHOULD_REPORT_TRACE === 'true'
|
|
||||||
)}`,
|
|
||||||
'process.env.TRACE_REPORT_ENDPOINT': `"${process.env.TRACE_REPORT_ENDPOINT}"`,
|
|
||||||
'process.env.CAPTCHA_SITE_KEY': `"${process.env.CAPTCHA_SITE_KEY}"`,
|
'process.env.CAPTCHA_SITE_KEY': `"${process.env.CAPTCHA_SITE_KEY}"`,
|
||||||
runtimeConfig: getRuntimeConfig({
|
runtimeConfig: getRuntimeConfig({
|
||||||
distribution: 'browser',
|
distribution: 'browser',
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import type { ActiveTab } from '../components/affine/setting-modal/types';
|
|||||||
export const openWorkspacesModalAtom = atom(false);
|
export const openWorkspacesModalAtom = atom(false);
|
||||||
export const openCreateWorkspaceModalAtom = atom<CreateWorkspaceMode>(false);
|
export const openCreateWorkspaceModalAtom = atom<CreateWorkspaceMode>(false);
|
||||||
export const openSignOutModalAtom = atom(false);
|
export const openSignOutModalAtom = atom(false);
|
||||||
export const openPaymentDisableAtom = atom(false);
|
|
||||||
export const openQuotaModalAtom = atom(false);
|
export const openQuotaModalAtom = atom(false);
|
||||||
export const openStarAFFiNEModalAtom = atom(false);
|
export const openStarAFFiNEModalAtom = atom(false);
|
||||||
export const openIssueFeedbackModalAtom = atom(false);
|
export const openIssueFeedbackModalAtom = atom(false);
|
||||||
@@ -51,8 +50,6 @@ export const authAtom = atom<AuthAtom>({
|
|||||||
emailType: 'changeEmail',
|
emailType: 'changeEmail',
|
||||||
});
|
});
|
||||||
|
|
||||||
export const openDisableCloudAlertModalAtom = atom(false);
|
|
||||||
|
|
||||||
export type AllPageFilterOption = 'docs' | 'collections' | 'tags';
|
export type AllPageFilterOption = 'docs' | 'collections' | 'tags';
|
||||||
export const allPageFilterSelectAtom = atom<AllPageFilterOption>('docs');
|
export const allPageFilterSelectAtom = atom<AllPageFilterOption>('docs');
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Avatar, Input, Switch, toast } from '@affine/component';
|
import { Avatar, Input, Switch, toast } from '@affine/component';
|
||||||
import type { ConfirmModalProps } from '@affine/component/ui/modal';
|
import type { ConfirmModalProps } from '@affine/component/ui/modal';
|
||||||
import { ConfirmModal, Modal } from '@affine/component/ui/modal';
|
import { ConfirmModal, Modal } from '@affine/component/ui/modal';
|
||||||
import { authAtom, openDisableCloudAlertModalAtom } from '@affine/core/atoms';
|
import { authAtom } from '@affine/core/atoms';
|
||||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||||
import { DebugLogger } from '@affine/debug';
|
import { DebugLogger } from '@affine/debug';
|
||||||
import { apis } from '@affine/electron-api';
|
import { apis } from '@affine/electron-api';
|
||||||
@@ -61,20 +61,14 @@ const NameWorkspaceContent = ({
|
|||||||
const session = useService(AuthService).session;
|
const session = useService(AuthService).session;
|
||||||
const loginStatus = useLiveData(session.status$);
|
const loginStatus = useLiveData(session.status$);
|
||||||
|
|
||||||
const setDisableCloudOpen = useSetAtom(openDisableCloudAlertModalAtom);
|
|
||||||
|
|
||||||
const setOpenSignIn = useSetAtom(authAtom);
|
const setOpenSignIn = useSetAtom(authAtom);
|
||||||
|
|
||||||
const openSignInModal = useCallback(() => {
|
const openSignInModal = useCallback(() => {
|
||||||
if (!runtimeConfig.enableCloud) {
|
setOpenSignIn(state => ({
|
||||||
setDisableCloudOpen(true);
|
...state,
|
||||||
} else {
|
openModal: true,
|
||||||
setOpenSignIn(state => ({
|
}));
|
||||||
...state,
|
}, [setOpenSignIn]);
|
||||||
openModal: true,
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}, [setDisableCloudOpen, setOpenSignIn]);
|
|
||||||
|
|
||||||
const onSwitchChange = useCallback(
|
const onSwitchChange = useCallback(
|
||||||
(checked: boolean) => {
|
(checked: boolean) => {
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
import { OverlayModal } from '@affine/component';
|
import { OverlayModal } from '@affine/component';
|
||||||
import {
|
import { openHistoryTipsModalAtom } from '@affine/core/atoms';
|
||||||
openDisableCloudAlertModalAtom,
|
|
||||||
openHistoryTipsModalAtom,
|
|
||||||
} from '@affine/core/atoms';
|
|
||||||
import { useEnableCloud } from '@affine/core/hooks/affine/use-enable-cloud';
|
import { useEnableCloud } from '@affine/core/hooks/affine/use-enable-cloud';
|
||||||
import { useI18n } from '@affine/i18n';
|
import { useI18n } from '@affine/i18n';
|
||||||
import { useService, WorkspaceService } from '@toeverything/infra';
|
import { useService, WorkspaceService } from '@toeverything/infra';
|
||||||
import { useAtom, useSetAtom } from 'jotai';
|
import { useAtom } from 'jotai';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
|
|
||||||
import TopSvg from './top-svg';
|
import TopSvg from './top-svg';
|
||||||
@@ -15,17 +12,12 @@ export const HistoryTipsModal = () => {
|
|||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
const currentWorkspace = useService(WorkspaceService).workspace;
|
const currentWorkspace = useService(WorkspaceService).workspace;
|
||||||
const [open, setOpen] = useAtom(openHistoryTipsModalAtom);
|
const [open, setOpen] = useAtom(openHistoryTipsModalAtom);
|
||||||
const setTempDisableCloudOpen = useSetAtom(openDisableCloudAlertModalAtom);
|
|
||||||
const confirmEnableCloud = useEnableCloud();
|
const confirmEnableCloud = useEnableCloud();
|
||||||
|
|
||||||
const handleConfirm = useCallback(() => {
|
const handleConfirm = useCallback(() => {
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
if (runtimeConfig.enableCloud) {
|
confirmEnableCloud(currentWorkspace);
|
||||||
confirmEnableCloud(currentWorkspace);
|
}, [confirmEnableCloud, currentWorkspace, setOpen]);
|
||||||
return;
|
|
||||||
}
|
|
||||||
return setTempDisableCloudOpen(true);
|
|
||||||
}, [confirmEnableCloud, currentWorkspace, setOpen, setTempDisableCloudOpen]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<OverlayModal
|
<OverlayModal
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
import { ConfirmModal } from '@affine/component/ui/modal';
|
|
||||||
import { useI18n } from '@affine/i18n';
|
|
||||||
import { useAtom } from 'jotai';
|
|
||||||
import { useCallback } from 'react';
|
|
||||||
|
|
||||||
import { openPaymentDisableAtom } from '../../../atoms';
|
|
||||||
import * as styles from './style.css';
|
|
||||||
|
|
||||||
export const PaymentDisableModal = () => {
|
|
||||||
const [open, setOpen] = useAtom(openPaymentDisableAtom);
|
|
||||||
const t = useI18n();
|
|
||||||
|
|
||||||
const onClickCancel = useCallback(() => {
|
|
||||||
setOpen(false);
|
|
||||||
}, [setOpen]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ConfirmModal
|
|
||||||
title={t['com.affine.payment.disable-payment.title']()}
|
|
||||||
cancelText=""
|
|
||||||
cancelButtonOptions={{ style: { display: 'none' } }}
|
|
||||||
confirmButtonOptions={{
|
|
||||||
type: 'primary',
|
|
||||||
children: t['Got it'](),
|
|
||||||
}}
|
|
||||||
onConfirm={onClickCancel}
|
|
||||||
open={open}
|
|
||||||
onOpenChange={setOpen}
|
|
||||||
>
|
|
||||||
<p className={styles.paymentDisableModalContent}>
|
|
||||||
{t['com.affine.payment.disable-payment.description']()}
|
|
||||||
</p>
|
|
||||||
</ConfirmModal>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import { cssVar } from '@toeverything/theme';
|
|
||||||
import { style } from '@vanilla-extract/css';
|
|
||||||
export const paymentDisableModalContent = style({
|
|
||||||
color: cssVar('textPrimaryColor'),
|
|
||||||
});
|
|
||||||
@@ -9,12 +9,11 @@ import { Trans, useI18n } from '@affine/i18n';
|
|||||||
import { DoneIcon } from '@blocksuite/icons/rc';
|
import { DoneIcon } from '@blocksuite/icons/rc';
|
||||||
import { useLiveData, useService } from '@toeverything/infra';
|
import { useLiveData, useService } from '@toeverything/infra';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import { useAtom, useSetAtom } from 'jotai';
|
import { useSetAtom } from 'jotai';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
||||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
|
|
||||||
import { openPaymentDisableAtom } from '../../../../../atoms';
|
|
||||||
import { authAtom } from '../../../../../atoms/index';
|
import { authAtom } from '../../../../../atoms/index';
|
||||||
import { mixpanel } from '../../../../../utils';
|
import { mixpanel } from '../../../../../utils';
|
||||||
import { CancelAction, ResumeAction } from './actions';
|
import { CancelAction, ResumeAction } from './actions';
|
||||||
@@ -280,13 +279,7 @@ export const Upgrade = ({
|
|||||||
return;
|
return;
|
||||||
}, [isOpenedExternalWindow, subscriptionService]);
|
}, [isOpenedExternalWindow, subscriptionService]);
|
||||||
|
|
||||||
const [, openPaymentDisableModal] = useAtom(openPaymentDisableAtom);
|
|
||||||
const upgrade = useAsyncCallback(async () => {
|
const upgrade = useAsyncCallback(async () => {
|
||||||
if (!runtimeConfig.enablePayment) {
|
|
||||||
openPaymentDisableModal(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setMutating(true);
|
setMutating(true);
|
||||||
mixpanel.track('PlanUpgradeStarted', {
|
mixpanel.track('PlanUpgradeStarted', {
|
||||||
segment: 'settings panel',
|
segment: 'settings panel',
|
||||||
@@ -306,7 +299,7 @@ export const Upgrade = ({
|
|||||||
setIdempotencyKey(nanoid());
|
setIdempotencyKey(nanoid());
|
||||||
popupWindow(link);
|
popupWindow(link);
|
||||||
setOpenedExternalWindow(true);
|
setOpenedExternalWindow(true);
|
||||||
}, [openPaymentDisableModal, subscriptionService, recurring, idempotencyKey]);
|
}, [subscriptionService, recurring, idempotencyKey]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -196,11 +196,8 @@ export const SettingSidebar = ({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={style.sidebarFooter}>
|
<div className={style.sidebarFooter}>
|
||||||
{runtimeConfig.enableCloud && loginStatus === 'unauthenticated' ? (
|
{loginStatus === 'unauthenticated' ? <SignInButton /> : null}
|
||||||
<SignInButton />
|
{loginStatus === 'authenticated' ? (
|
||||||
) : null}
|
|
||||||
|
|
||||||
{runtimeConfig.enableCloud && loginStatus === 'authenticated' ? (
|
|
||||||
<Suspense>
|
<Suspense>
|
||||||
<UserInfo
|
<UserInfo
|
||||||
onAccountSettingClick={onAccountSettingClick}
|
onAccountSettingClick={onAccountSettingClick}
|
||||||
|
|||||||
@@ -11,10 +11,9 @@ import {
|
|||||||
WorkspaceService,
|
WorkspaceService,
|
||||||
} from '@toeverything/infra';
|
} from '@toeverything/infra';
|
||||||
import { useSetAtom } from 'jotai';
|
import { useSetAtom } from 'jotai';
|
||||||
import { useCallback, useState } from 'react';
|
import { useCallback } from 'react';
|
||||||
|
|
||||||
import { openSettingModalAtom } from '../../../../../atoms';
|
import { openSettingModalAtom } from '../../../../../atoms';
|
||||||
import { TmpDisableAffineCloudModal } from '../../../tmp-disable-affine-cloud-modal';
|
|
||||||
|
|
||||||
export interface PublishPanelProps {
|
export interface PublishPanelProps {
|
||||||
workspace: Workspace | null;
|
workspace: Workspace | null;
|
||||||
@@ -30,8 +29,6 @@ export const EnableCloudPanel = () => {
|
|||||||
|
|
||||||
const setSettingModal = useSetAtom(openSettingModalAtom);
|
const setSettingModal = useSetAtom(openSettingModalAtom);
|
||||||
|
|
||||||
const [open, setOpen] = useState(false);
|
|
||||||
|
|
||||||
const confirmEnableCloudAndClose = useCallback(() => {
|
const confirmEnableCloudAndClose = useCallback(() => {
|
||||||
if (!workspace) return;
|
if (!workspace) return;
|
||||||
confirmEnableCloud(workspace, {
|
confirmEnableCloud(workspace, {
|
||||||
@@ -46,30 +43,25 @@ export const EnableCloudPanel = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<SettingRow
|
||||||
<SettingRow
|
name={t['Workspace saved locally']({
|
||||||
name={t['Workspace saved locally']({
|
name: name ?? UNTITLED_WORKSPACE_NAME,
|
||||||
name: name ?? UNTITLED_WORKSPACE_NAME,
|
})}
|
||||||
})}
|
desc={t['Enable cloud hint']()}
|
||||||
desc={t['Enable cloud hint']()}
|
spreadCol={false}
|
||||||
spreadCol={false}
|
style={{
|
||||||
style={{
|
padding: '10px',
|
||||||
padding: '10px',
|
background: 'var(--affine-background-secondary-color)',
|
||||||
background: 'var(--affine-background-secondary-color)',
|
}}
|
||||||
}}
|
>
|
||||||
|
<Button
|
||||||
|
data-testid="publish-enable-affine-cloud-button"
|
||||||
|
type="primary"
|
||||||
|
onClick={confirmEnableCloudAndClose}
|
||||||
|
style={{ marginTop: '12px' }}
|
||||||
>
|
>
|
||||||
<Button
|
{t['Enable AFFiNE Cloud']()}
|
||||||
data-testid="publish-enable-affine-cloud-button"
|
</Button>
|
||||||
type="primary"
|
</SettingRow>
|
||||||
onClick={confirmEnableCloudAndClose}
|
|
||||||
style={{ marginTop: '12px' }}
|
|
||||||
>
|
|
||||||
{t['Enable AFFiNE Cloud']()}
|
|
||||||
</Button>
|
|
||||||
</SettingRow>
|
|
||||||
{runtimeConfig.enableCloud ? null : (
|
|
||||||
<TmpDisableAffineCloudModal open={open} onOpenChange={setOpen} />
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
import { Empty } from '@affine/component';
|
|
||||||
import type { ModalProps } from '@affine/component/ui/modal';
|
|
||||||
import { Modal } from '@affine/component/ui/modal';
|
|
||||||
import { Trans, useI18n } from '@affine/i18n';
|
|
||||||
import { useCallback } from 'react';
|
|
||||||
|
|
||||||
import {
|
|
||||||
StyleButton,
|
|
||||||
StyleButtonContainer,
|
|
||||||
StyleImage,
|
|
||||||
StyleTips,
|
|
||||||
} from './style';
|
|
||||||
|
|
||||||
export const TmpDisableAffineCloudModal = (props: ModalProps) => {
|
|
||||||
const t = useI18n();
|
|
||||||
const onClose = useCallback(() => {
|
|
||||||
props.onOpenChange?.(false);
|
|
||||||
}, [props]);
|
|
||||||
return (
|
|
||||||
<Modal
|
|
||||||
title={t['com.affine.cloudTempDisable.title']()}
|
|
||||||
contentOptions={{
|
|
||||||
['data-testid' as string]: 'disable-affine-cloud-modal',
|
|
||||||
}}
|
|
||||||
width={480}
|
|
||||||
{...props}
|
|
||||||
>
|
|
||||||
<StyleTips>
|
|
||||||
<Trans i18nKey="com.affine.cloudTempDisable.description">
|
|
||||||
We are upgrading the AFFiNE Cloud service and it is temporarily
|
|
||||||
unavailable on the client side. If you wish to stay updated on the
|
|
||||||
progress and be notified on availability, you can fill out the
|
|
||||||
<a
|
|
||||||
href="https://6dxre9ihosp.typeform.com/to/B8IHwuyy"
|
|
||||||
rel="noreferrer"
|
|
||||||
target="_blank"
|
|
||||||
style={{
|
|
||||||
color: 'var(--affine-link-color)',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
AFFiNE Cloud Signup
|
|
||||||
</a>
|
|
||||||
.
|
|
||||||
</Trans>
|
|
||||||
</StyleTips>
|
|
||||||
<StyleImage>
|
|
||||||
<Empty
|
|
||||||
containerStyle={{
|
|
||||||
width: '200px',
|
|
||||||
height: '112px',
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</StyleImage>
|
|
||||||
<StyleButtonContainer>
|
|
||||||
<StyleButton type="primary" onClick={onClose}>
|
|
||||||
{t['Got it']()}
|
|
||||||
</StyleButton>
|
|
||||||
</StyleButtonContainer>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
import { displayFlex, styled } from '@affine/component';
|
|
||||||
import { Button } from '@affine/component/ui/button';
|
|
||||||
|
|
||||||
export const Header = styled('div')({
|
|
||||||
height: '44px',
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'row-reverse',
|
|
||||||
paddingRight: '10px',
|
|
||||||
paddingTop: '10px',
|
|
||||||
flexShrink: 0,
|
|
||||||
});
|
|
||||||
|
|
||||||
export const Content = styled('div')({
|
|
||||||
padding: '0 40px',
|
|
||||||
});
|
|
||||||
|
|
||||||
export const ContentTitle = styled('h1')(() => {
|
|
||||||
return {
|
|
||||||
marginTop: 44,
|
|
||||||
fontSize: 'var(--affine-font-h6)',
|
|
||||||
lineHeight: '28px',
|
|
||||||
fontWeight: 600,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
export const StyleTips = styled('div')(() => {
|
|
||||||
return {
|
|
||||||
margin: '0 0 20px 0',
|
|
||||||
a: {
|
|
||||||
color: 'var(--affine-primary-color)',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
export const StyleButton = styled(Button)({
|
|
||||||
textAlign: 'center',
|
|
||||||
borderRadius: '8px',
|
|
||||||
backgroundColor: 'var(--affine-primary-color)',
|
|
||||||
span: {
|
|
||||||
margin: '0',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
export const StyleButtonContainer = styled('div')(() => {
|
|
||||||
return {
|
|
||||||
width: '100%',
|
|
||||||
marginTop: 20,
|
|
||||||
...displayFlex('flex-end', 'center'),
|
|
||||||
};
|
|
||||||
});
|
|
||||||
export const StyleImage = styled('div')(() => {
|
|
||||||
return {
|
|
||||||
...displayFlex('center', 'center'),
|
|
||||||
};
|
|
||||||
});
|
|
||||||
@@ -245,7 +245,7 @@ export const PageHeaderMenuButton = ({
|
|||||||
{t['com.affine.header.option.add-tag']()}
|
{t['com.affine.header.option.add-tag']()}
|
||||||
</MenuItem> */}
|
</MenuItem> */}
|
||||||
<MenuSeparator />
|
<MenuSeparator />
|
||||||
{runtimeConfig.enableInfoModal ? (
|
{runtimeConfig.enableInfoModal && (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
preFix={
|
preFix={
|
||||||
<MenuIcon>
|
<MenuIcon>
|
||||||
@@ -258,21 +258,19 @@ export const PageHeaderMenuButton = ({
|
|||||||
>
|
>
|
||||||
{t['com.affine.page-properties.page-info.view']()}
|
{t['com.affine.page-properties.page-info.view']()}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
) : null}
|
)}
|
||||||
{runtimeConfig.enablePageHistory ? (
|
<MenuItem
|
||||||
<MenuItem
|
preFix={
|
||||||
preFix={
|
<MenuIcon>
|
||||||
<MenuIcon>
|
<HistoryIcon />
|
||||||
<HistoryIcon />
|
</MenuIcon>
|
||||||
</MenuIcon>
|
}
|
||||||
}
|
data-testid="editor-option-menu-history"
|
||||||
data-testid="editor-option-menu-history"
|
onSelect={openHistoryModal}
|
||||||
onSelect={openHistoryModal}
|
style={menuItemStyle}
|
||||||
style={menuItemStyle}
|
>
|
||||||
>
|
{t['com.affine.history.view-history-version']()}
|
||||||
{t['com.affine.history.view-history-version']()}
|
</MenuItem>
|
||||||
</MenuItem>
|
|
||||||
) : null}
|
|
||||||
<MenuSeparator />
|
<MenuSeparator />
|
||||||
{!isJournal && (
|
{!isJournal && (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
@@ -301,7 +299,6 @@ export const PageHeaderMenuButton = ({
|
|||||||
{t['Import']()}
|
{t['Import']()}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<Export exportHandler={exportHandler} pageMode={currentMode} />
|
<Export exportHandler={exportHandler} pageMode={currentMode} />
|
||||||
|
|
||||||
<MenuSeparator />
|
<MenuSeparator />
|
||||||
<MoveToTrash
|
<MoveToTrash
|
||||||
data-testid="editor-option-menu-delete"
|
data-testid="editor-option-menu-delete"
|
||||||
|
|||||||
@@ -12,11 +12,7 @@ import {
|
|||||||
import { useSetAtom } from 'jotai';
|
import { useSetAtom } from 'jotai';
|
||||||
import { Suspense, useCallback } from 'react';
|
import { Suspense, useCallback } from 'react';
|
||||||
|
|
||||||
import {
|
import { authAtom, openCreateWorkspaceModalAtom } from '../../../../atoms';
|
||||||
authAtom,
|
|
||||||
openCreateWorkspaceModalAtom,
|
|
||||||
openDisableCloudAlertModalAtom,
|
|
||||||
} from '../../../../atoms';
|
|
||||||
import { mixpanel } from '../../../../utils';
|
import { mixpanel } from '../../../../utils';
|
||||||
import { AddWorkspace } from './add-workspace';
|
import { AddWorkspace } from './add-workspace';
|
||||||
import * as styles from './index.css';
|
import * as styles from './index.css';
|
||||||
@@ -24,8 +20,6 @@ import { UserAccountItem } from './user-account';
|
|||||||
import { AFFiNEWorkspaceList } from './workspace-list';
|
import { AFFiNEWorkspaceList } from './workspace-list';
|
||||||
|
|
||||||
export const SignInItem = () => {
|
export const SignInItem = () => {
|
||||||
const setDisableCloudOpen = useSetAtom(openDisableCloudAlertModalAtom);
|
|
||||||
|
|
||||||
const setOpen = useSetAtom(authAtom);
|
const setOpen = useSetAtom(authAtom);
|
||||||
|
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
@@ -34,15 +28,11 @@ export const SignInItem = () => {
|
|||||||
mixpanel.track('Button', {
|
mixpanel.track('Button', {
|
||||||
resolve: 'SignIn',
|
resolve: 'SignIn',
|
||||||
});
|
});
|
||||||
if (!runtimeConfig.enableCloud) {
|
setOpen(state => ({
|
||||||
setDisableCloudOpen(true);
|
...state,
|
||||||
} else {
|
openModal: true,
|
||||||
setOpen(state => ({
|
}));
|
||||||
...state,
|
}, [setOpen]);
|
||||||
openModal: true,
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}, [setOpen, setDisableCloudOpen]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
@@ -88,20 +78,15 @@ const UserWithWorkspaceListInner = ({
|
|||||||
const isAuthenticated = session.status === 'authenticated';
|
const isAuthenticated = session.status === 'authenticated';
|
||||||
|
|
||||||
const setOpenCreateWorkspaceModal = useSetAtom(openCreateWorkspaceModalAtom);
|
const setOpenCreateWorkspaceModal = useSetAtom(openCreateWorkspaceModalAtom);
|
||||||
const setDisableCloudOpen = useSetAtom(openDisableCloudAlertModalAtom);
|
|
||||||
|
|
||||||
const setOpenSignIn = useSetAtom(authAtom);
|
const setOpenSignIn = useSetAtom(authAtom);
|
||||||
|
|
||||||
const openSignInModal = useCallback(() => {
|
const openSignInModal = useCallback(() => {
|
||||||
if (!runtimeConfig.enableCloud) {
|
setOpenSignIn(state => ({
|
||||||
setDisableCloudOpen(true);
|
...state,
|
||||||
} else {
|
openModal: true,
|
||||||
setOpenSignIn(state => ({
|
}));
|
||||||
...state,
|
}, [setOpenSignIn]);
|
||||||
openModal: true,
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}, [setDisableCloudOpen, setOpenSignIn]);
|
|
||||||
|
|
||||||
const onNewWorkspace = useCallback(() => {
|
const onNewWorkspace = useCallback(() => {
|
||||||
if (!isAuthenticated && !runtimeConfig.allowLocalWorkspace) {
|
if (!isAuthenticated && !runtimeConfig.allowLocalWorkspace) {
|
||||||
|
|||||||
@@ -192,17 +192,15 @@ export const RootAppSidebar = memo(
|
|||||||
<AppSidebarJournalButton
|
<AppSidebarJournalButton
|
||||||
docCollection={currentWorkspace.docCollection}
|
docCollection={currentWorkspace.docCollection}
|
||||||
/>
|
/>
|
||||||
{runtimeConfig.enableNewSettingModal ? (
|
<MenuItem
|
||||||
<MenuItem
|
data-testid="slider-bar-workspace-setting-button"
|
||||||
data-testid="slider-bar-workspace-setting-button"
|
icon={<SettingsIcon />}
|
||||||
icon={<SettingsIcon />}
|
onClick={onOpenSettingModal}
|
||||||
onClick={onOpenSettingModal}
|
>
|
||||||
>
|
<span data-testid="settings-modal-trigger">
|
||||||
<span data-testid="settings-modal-trigger">
|
{t['com.affine.settingSidebar.title']()}
|
||||||
{t['com.affine.settingSidebar.title']()}
|
</span>
|
||||||
</span>
|
</MenuItem>
|
||||||
</MenuItem>
|
|
||||||
) : null}
|
|
||||||
</SidebarContainer>
|
</SidebarContainer>
|
||||||
<SidebarScrollableContainer>
|
<SidebarScrollableContainer>
|
||||||
<FavoriteList docCollection={docCollection} />
|
<FavoriteList docCollection={docCollection} />
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import {
|
|||||||
} from '@affine/component';
|
} from '@affine/component';
|
||||||
import {
|
import {
|
||||||
authAtom,
|
authAtom,
|
||||||
openDisableCloudAlertModalAtom,
|
|
||||||
openSettingModalAtom,
|
openSettingModalAtom,
|
||||||
openSignOutModalAtom,
|
openSignOutModalAtom,
|
||||||
} from '@affine/core/atoms';
|
} from '@affine/core/atoms';
|
||||||
@@ -65,13 +64,11 @@ const AuthorizedUserInfo = ({ account }: { account: AuthAccountInfo }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const UnauthorizedUserInfo = () => {
|
const UnauthorizedUserInfo = () => {
|
||||||
const setDisableCloudOpen = useSetAtom(openDisableCloudAlertModalAtom);
|
|
||||||
const setOpen = useSetAtom(authAtom);
|
const setOpen = useSetAtom(authAtom);
|
||||||
|
|
||||||
const openSignInModal = useCallback(() => {
|
const openSignInModal = useCallback(() => {
|
||||||
if (!runtimeConfig.enableCloud) setDisableCloudOpen(true);
|
setOpen(state => ({ ...state, openModal: true }));
|
||||||
else setOpen(state => ({ ...state, openModal: true }));
|
}, [setOpen]);
|
||||||
}, [setDisableCloudOpen, setOpen]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ export const useEnableCloud = () => {
|
|||||||
const confirmEnableCloud = useCallback(
|
const confirmEnableCloud = useCallback(
|
||||||
(ws: Workspace, options?: ConfirmEnableCloudOptions) => {
|
(ws: Workspace, options?: ConfirmEnableCloudOptions) => {
|
||||||
const { onSuccess, onFinished } = options ?? {};
|
const { onSuccess, onFinished } = options ?? {};
|
||||||
if (!runtimeConfig.enableCloud) return;
|
|
||||||
|
|
||||||
const closeOnSuccess = () => {
|
const closeOnSuccess = () => {
|
||||||
closeConfirmModal();
|
closeConfirmModal();
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ export function useRegisterBlocksuiteEditorCommands() {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
if (runtimeConfig.enablePageHistory && isCloudWorkspace) {
|
if (isCloudWorkspace) {
|
||||||
unsubs.push(
|
unsubs.push(
|
||||||
registerAffineCommand({
|
registerAffineCommand({
|
||||||
id: `editor:${mode}-page-history`,
|
id: `editor:${mode}-page-history`,
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import type { SettingAtom } from '../atoms';
|
|||||||
import {
|
import {
|
||||||
authAtom,
|
authAtom,
|
||||||
openCreateWorkspaceModalAtom,
|
openCreateWorkspaceModalAtom,
|
||||||
openDisableCloudAlertModalAtom,
|
|
||||||
openSettingModalAtom,
|
openSettingModalAtom,
|
||||||
openSignOutModalAtom,
|
openSignOutModalAtom,
|
||||||
} from '../atoms';
|
} from '../atoms';
|
||||||
@@ -25,7 +24,6 @@ import { AiLoginRequiredModal } from '../components/affine/auth/ai-login-require
|
|||||||
import { CreateWorkspaceModal } from '../components/affine/create-workspace-modal';
|
import { CreateWorkspaceModal } from '../components/affine/create-workspace-modal';
|
||||||
import { HistoryTipsModal } from '../components/affine/history-tips-modal';
|
import { HistoryTipsModal } from '../components/affine/history-tips-modal';
|
||||||
import { IssueFeedbackModal } from '../components/affine/issue-feedback-modal';
|
import { IssueFeedbackModal } from '../components/affine/issue-feedback-modal';
|
||||||
import { PaymentDisableModal } from '../components/affine/payment-disable';
|
|
||||||
import {
|
import {
|
||||||
CloudQuotaModal,
|
CloudQuotaModal,
|
||||||
LocalQuotaModal,
|
LocalQuotaModal,
|
||||||
@@ -33,7 +31,6 @@ import {
|
|||||||
import { SettingModal } from '../components/affine/setting-modal';
|
import { SettingModal } from '../components/affine/setting-modal';
|
||||||
import { SignOutModal } from '../components/affine/sign-out-modal';
|
import { SignOutModal } from '../components/affine/sign-out-modal';
|
||||||
import { StarAFFiNEModal } from '../components/affine/star-affine-modal';
|
import { StarAFFiNEModal } from '../components/affine/star-affine-modal';
|
||||||
import { TmpDisableAffineCloudModal } from '../components/affine/tmp-disable-affine-cloud-modal';
|
|
||||||
import { MoveToTrash } from '../components/page-list';
|
import { MoveToTrash } from '../components/page-list';
|
||||||
import { useTrashModalHelper } from '../hooks/affine/use-trash-modal-helper';
|
import { useTrashModalHelper } from '../hooks/affine/use-trash-modal-helper';
|
||||||
import { useAsyncCallback } from '../hooks/affine-async-hooks';
|
import { useAsyncCallback } from '../hooks/affine-async-hooks';
|
||||||
@@ -137,9 +134,6 @@ export const AuthModal = (): ReactElement => {
|
|||||||
|
|
||||||
export function CurrentWorkspaceModals() {
|
export function CurrentWorkspaceModals() {
|
||||||
const currentWorkspace = useService(WorkspaceService).workspace;
|
const currentWorkspace = useService(WorkspaceService).workspace;
|
||||||
const [openDisableCloudAlertModal, setOpenDisableCloudAlertModal] = useAtom(
|
|
||||||
openDisableCloudAlertModalAtom
|
|
||||||
);
|
|
||||||
|
|
||||||
const { trashModal, setTrashModal, handleOnConfirm } = useTrashModalHelper(
|
const { trashModal, setTrashModal, handleOnConfirm } = useTrashModalHelper(
|
||||||
currentWorkspace.docCollection
|
currentWorkspace.docCollection
|
||||||
@@ -158,10 +152,6 @@ export function CurrentWorkspaceModals() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<TmpDisableAffineCloudModal
|
|
||||||
open={openDisableCloudAlertModal}
|
|
||||||
onOpenChange={setOpenDisableCloudAlertModal}
|
|
||||||
/>
|
|
||||||
<StarAFFiNEModal />
|
<StarAFFiNEModal />
|
||||||
<IssueFeedbackModal />
|
<IssueFeedbackModal />
|
||||||
{currentWorkspace ? <Setting /> : null}
|
{currentWorkspace ? <Setting /> : null}
|
||||||
@@ -256,7 +246,6 @@ export const AllWorkspaceModals = (): ReactElement => {
|
|||||||
/>
|
/>
|
||||||
<AuthModal />
|
<AuthModal />
|
||||||
<SignOutConfirmModal />
|
<SignOutConfirmModal />
|
||||||
<PaymentDisableModal />
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1031,8 +1031,6 @@
|
|||||||
"com.affine.payment.lifetime.benefit-4": "Dedicated Discord support with AFFiNE makers",
|
"com.affine.payment.lifetime.benefit-4": "Dedicated Discord support with AFFiNE makers",
|
||||||
"com.affine.payment.contact-sales": "Contact Sales",
|
"com.affine.payment.contact-sales": "Contact Sales",
|
||||||
"com.affine.payment.current-plan": "Current Plan",
|
"com.affine.payment.current-plan": "Current Plan",
|
||||||
"com.affine.payment.disable-payment.description": "This is a special testing(Canary) version of AFFiNE. Account upgrades are not supported in this version. If you want to experience the full service, please download the stable version from our website.",
|
|
||||||
"com.affine.payment.disable-payment.title": "Account Upgrade Unavailable",
|
|
||||||
"com.affine.payment.discount-amount": "{{amount}}% off",
|
"com.affine.payment.discount-amount": "{{amount}}% off",
|
||||||
"com.affine.payment.downgrade": "Downgrade",
|
"com.affine.payment.downgrade": "Downgrade",
|
||||||
"com.affine.payment.downgraded-tooltip": "You have successfully downgraded. After the current billing period ends, your account will automatically switch to the Free plan.",
|
"com.affine.payment.downgraded-tooltip": "You have successfully downgraded. After the current billing period ends, your account will automatically switch to the Free plan.",
|
||||||
|
|||||||
@@ -986,8 +986,6 @@
|
|||||||
"com.affine.payment.cloud.team.title": "Contacter le service commercial\n\n\n\n\n\n",
|
"com.affine.payment.cloud.team.title": "Contacter le service commercial\n\n\n\n\n\n",
|
||||||
"com.affine.payment.contact-sales": "Contacter le service commercial\n\n\n\n\n\n",
|
"com.affine.payment.contact-sales": "Contacter le service commercial\n\n\n\n\n\n",
|
||||||
"com.affine.payment.current-plan": "Abonnement actuel",
|
"com.affine.payment.current-plan": "Abonnement actuel",
|
||||||
"com.affine.payment.disable-payment.description": "Il s'agit d'une version prévue pour le test (Canary) d'AFFiNE. Les comptes payants ne sont pas pris en charge dans cette version. Si vous souhaitez bénéficier de tous les services, veuillez télécharger la version stable sur notre site web.",
|
|
||||||
"com.affine.payment.disable-payment.title": "Compte payant non disponible",
|
|
||||||
"com.affine.payment.discount-amount": "{{amount}}% de réduction\n",
|
"com.affine.payment.discount-amount": "{{amount}}% de réduction\n",
|
||||||
"com.affine.payment.downgrade": "Rétrograder",
|
"com.affine.payment.downgrade": "Rétrograder",
|
||||||
"com.affine.payment.downgraded-tooltip": "Vous avez rétrogradé avec succès. Une fois la période de facturation actuelle terminée, votre compte basculera automatiquement vers l'abonnement gratuit.",
|
"com.affine.payment.downgraded-tooltip": "Vous avez rétrogradé avec succès. Une fois la période de facturation actuelle terminée, votre compte basculera automatiquement vers l'abonnement gratuit.",
|
||||||
|
|||||||
@@ -813,8 +813,6 @@
|
|||||||
"com.affine.payment.change-to": "{{to}}로 결제를 변경",
|
"com.affine.payment.change-to": "{{to}}로 결제를 변경",
|
||||||
"com.affine.payment.contact-sales": "Contact Sales",
|
"com.affine.payment.contact-sales": "Contact Sales",
|
||||||
"com.affine.payment.current-plan": "현재 플랜",
|
"com.affine.payment.current-plan": "현재 플랜",
|
||||||
"com.affine.payment.disable-payment.description": "AFFiNE의 특별 테스트(Canary) 버전입니다. 이 버전에서는 계정 업그레이드가 지원되지 않습니다. 정식 서비스를 경험하고 싶으시면 웹사이트에서 안정 버전을 다운로드하세요.",
|
|
||||||
"com.affine.payment.disable-payment.title": "계정 업그레이드 불가",
|
|
||||||
"com.affine.payment.discount-amount": "{{amount}}% 할인",
|
"com.affine.payment.discount-amount": "{{amount}}% 할인",
|
||||||
"com.affine.payment.downgrade": "다운그레이드",
|
"com.affine.payment.downgrade": "다운그레이드",
|
||||||
"com.affine.payment.downgraded-tooltip": "성공적으로 다운그레이드했습니다. 현재 청구 기간이 종료되면 계정이 자동으로 무료 요금제로 전환됩니다.",
|
"com.affine.payment.downgraded-tooltip": "성공적으로 다운그레이드했습니다. 현재 청구 기간이 종료되면 계정이 자동으로 무료 요금제로 전환됩니다.",
|
||||||
|
|||||||
@@ -1005,8 +1005,6 @@
|
|||||||
"com.affine.payment.cloud.team.title": "Связаться с отделом продаж",
|
"com.affine.payment.cloud.team.title": "Связаться с отделом продаж",
|
||||||
"com.affine.payment.contact-sales": "Связаться с отделом продаж",
|
"com.affine.payment.contact-sales": "Связаться с отделом продаж",
|
||||||
"com.affine.payment.current-plan": "Текущий план",
|
"com.affine.payment.current-plan": "Текущий план",
|
||||||
"com.affine.payment.disable-payment.description": "Это специальная тестовая (Canary) версия AFFiNE. Обновления аккаунта не поддерживаются в этой версии. Если вы хотите воспользоваться всеми возможностями сервиса, пожалуйста, загрузите стабильную версию с нашего сайта.",
|
|
||||||
"com.affine.payment.disable-payment.title": "Обновление аккаунта недоступно",
|
|
||||||
"com.affine.payment.discount-amount": "{{amount}}% скидка",
|
"com.affine.payment.discount-amount": "{{amount}}% скидка",
|
||||||
"com.affine.payment.downgrade": "Понизить",
|
"com.affine.payment.downgrade": "Понизить",
|
||||||
"com.affine.payment.downgraded-tooltip": "Вы успешно понизили тариф. После окончания текущего периода оплаты ваш аккаунт автоматически перейдет на Free план.",
|
"com.affine.payment.downgraded-tooltip": "Вы успешно понизили тариф. После окончания текущего периода оплаты ваш аккаунт автоматически перейдет на Free план.",
|
||||||
|
|||||||
@@ -1011,8 +1011,6 @@
|
|||||||
"com.affine.payment.cloud.team.title": "联系销售",
|
"com.affine.payment.cloud.team.title": "联系销售",
|
||||||
"com.affine.payment.contact-sales": "联系销售",
|
"com.affine.payment.contact-sales": "联系销售",
|
||||||
"com.affine.payment.current-plan": "当前计划",
|
"com.affine.payment.current-plan": "当前计划",
|
||||||
"com.affine.payment.disable-payment.description": "这是 AFFiNE 的特别测试(Canary)版本。此版本不支持账户升级。如果您想体验完整服务,请从我们的官网下载稳定版本。",
|
|
||||||
"com.affine.payment.disable-payment.title": "账户升级不可用",
|
|
||||||
"com.affine.payment.discount-amount": "{{amount}}% 折扣",
|
"com.affine.payment.discount-amount": "{{amount}}% 折扣",
|
||||||
"com.affine.payment.downgrade": "降级",
|
"com.affine.payment.downgrade": "降级",
|
||||||
"com.affine.payment.downgraded-tooltip": "您已成功降级。当前计费周期结束后,您的账户将自动切换到免费计划。",
|
"com.affine.payment.downgraded-tooltip": "您已成功降级。当前计费周期结束后,您的账户将自动切换到免费计划。",
|
||||||
|
|||||||
@@ -50,12 +50,6 @@
|
|||||||
{
|
{
|
||||||
"env": "CAPTCHA_SITE_KEY"
|
"env": "CAPTCHA_SITE_KEY"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"env": "SHOULD_REPORT_TRACE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"env": "TRACE_REPORT_ENDPOINT"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"env": "R2_ACCOUNT_ID"
|
"env": "R2_ACCOUNT_ID"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -333,15 +333,7 @@ export const createConfiguration: (
|
|||||||
}),
|
}),
|
||||||
new VanillaExtractPlugin(),
|
new VanillaExtractPlugin(),
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env': JSON.stringify({}),
|
|
||||||
'process.env.COVERAGE': JSON.stringify(!!buildFlags.coverage),
|
|
||||||
'process.env.NODE_ENV': JSON.stringify(buildFlags.mode),
|
'process.env.NODE_ENV': JSON.stringify(buildFlags.mode),
|
||||||
'process.env.SHOULD_REPORT_TRACE': JSON.stringify(
|
|
||||||
Boolean(process.env.SHOULD_REPORT_TRACE === 'true')
|
|
||||||
),
|
|
||||||
'process.env.TRACE_REPORT_ENDPOINT': JSON.stringify(
|
|
||||||
process.env.TRACE_REPORT_ENDPOINT
|
|
||||||
),
|
|
||||||
'process.env.CAPTCHA_SITE_KEY': JSON.stringify(
|
'process.env.CAPTCHA_SITE_KEY': JSON.stringify(
|
||||||
process.env.CAPTCHA_SITE_KEY
|
process.env.CAPTCHA_SITE_KEY
|
||||||
),
|
),
|
||||||
@@ -350,6 +342,7 @@ export const createConfiguration: (
|
|||||||
'process.env.MIXPANEL_TOKEN': JSON.stringify(
|
'process.env.MIXPANEL_TOKEN': JSON.stringify(
|
||||||
process.env.MIXPANEL_TOKEN
|
process.env.MIXPANEL_TOKEN
|
||||||
),
|
),
|
||||||
|
'process.env.DEBUG_JOTAI': JSON.stringify(process.env.DEBUG_JOTAI),
|
||||||
runtimeConfig: JSON.stringify(runtimeConfig),
|
runtimeConfig: JSON.stringify(runtimeConfig),
|
||||||
}),
|
}),
|
||||||
buildFlags.distribution === 'admin'
|
buildFlags.distribution === 'admin'
|
||||||
|
|||||||
@@ -5,71 +5,56 @@ import type { BuildFlags } from '../config';
|
|||||||
|
|
||||||
export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig {
|
export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig {
|
||||||
const buildPreset: Record<BuildFlags['channel'], RuntimeConfig> = {
|
const buildPreset: Record<BuildFlags['channel'], RuntimeConfig> = {
|
||||||
stable: {
|
get stable() {
|
||||||
enableTestProperties: false,
|
return {
|
||||||
enableBroadcastChannelProvider: true,
|
appBuildType: 'stable' as const,
|
||||||
enableDebugPage: true,
|
serverUrlPrefix: 'https://app.affine.pro',
|
||||||
githubUrl: 'https://github.com/toeverything/AFFiNE',
|
appVersion: packageJson.version,
|
||||||
changelogUrl: 'https://affine.pro/what-is-new',
|
editorVersion: packageJson.devDependencies['@blocksuite/presets'],
|
||||||
downloadUrl: 'https://affine.pro/download',
|
githubUrl: 'https://github.com/toeverything/AFFiNE',
|
||||||
imageProxyUrl: '/api/worker/image-proxy',
|
changelogUrl: 'https://affine.pro/what-is-new',
|
||||||
linkPreviewUrl: '/api/worker/link-preview',
|
downloadUrl: 'https://affine.pro/download',
|
||||||
enablePreloading: true,
|
imageProxyUrl: '/api/worker/image-proxy',
|
||||||
enableNewSettingModal: true,
|
linkPreviewUrl: '/api/worker/link-preview',
|
||||||
enableNewSettingUnstableApi: false,
|
enablePreloading: true,
|
||||||
enableCloud: true,
|
enableCaptcha: true,
|
||||||
enableCaptcha: true,
|
enableExperimentalFeature: true,
|
||||||
enableEnhanceShareMode: false,
|
allowLocalWorkspace:
|
||||||
enablePayment: true,
|
buildFlags.distribution === 'desktop' ? true : false,
|
||||||
enablePageHistory: true,
|
|
||||||
enableExperimentalFeature: false,
|
// TODO(@forehalo): enable in next release and canary
|
||||||
enableInfoModal: false,
|
enableInfoModal: false,
|
||||||
allowLocalWorkspace: buildFlags.distribution === 'desktop' ? true : false,
|
|
||||||
serverUrlPrefix: 'https://app.affine.pro',
|
// CAUTION(@forehalo): product not ready, do not enable it
|
||||||
appVersion: packageJson.version,
|
enableNewSettingUnstableApi: false,
|
||||||
editorVersion: packageJson.devDependencies['@blocksuite/presets'],
|
enableEnhanceShareMode: false,
|
||||||
appBuildType: 'stable',
|
};
|
||||||
},
|
},
|
||||||
get beta() {
|
get beta() {
|
||||||
return {
|
return {
|
||||||
...this.stable,
|
...this.stable,
|
||||||
enablePageHistory: true,
|
|
||||||
serverUrlPrefix: 'https://insider.affine.pro',
|
|
||||||
appBuildType: 'beta' as const,
|
appBuildType: 'beta' as const,
|
||||||
|
serverUrlPrefix: 'https://insider.affine.pro',
|
||||||
|
changelogUrl: 'https://github.com/toeverything/AFFiNE/releases',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
get internal() {
|
get internal() {
|
||||||
return {
|
return {
|
||||||
...this.stable,
|
...this.stable,
|
||||||
serverUrlPrefix: 'https://insider.affine.pro',
|
|
||||||
appBuildType: 'internal' as const,
|
appBuildType: 'internal' as const,
|
||||||
|
serverUrlPrefix: 'https://insider.affine.pro',
|
||||||
|
changelogUrl: 'https://github.com/toeverything/AFFiNE/releases',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
// canary will be aggressive and enable all features
|
// canary will be aggressive and enable all features
|
||||||
canary: {
|
get canary() {
|
||||||
enableTestProperties: true,
|
return {
|
||||||
enableBroadcastChannelProvider: true,
|
...this.stable,
|
||||||
enableDebugPage: true,
|
appBuildType: 'canary' as const,
|
||||||
githubUrl: 'https://github.com/toeverything/AFFiNE',
|
serverUrlPrefix: 'https://affine.fail',
|
||||||
changelogUrl: 'https://github.com/toeverything/AFFiNE/releases',
|
changelogUrl: 'https://github.com/toeverything/AFFiNE/releases',
|
||||||
downloadUrl: 'https://affine.pro/download',
|
enableInfoModal: true,
|
||||||
imageProxyUrl: '/api/worker/image-proxy',
|
};
|
||||||
linkPreviewUrl: '/api/worker/link-preview',
|
|
||||||
enablePreloading: true,
|
|
||||||
enableNewSettingModal: true,
|
|
||||||
enableNewSettingUnstableApi: false,
|
|
||||||
enableCloud: true,
|
|
||||||
enableCaptcha: true,
|
|
||||||
enableEnhanceShareMode: false,
|
|
||||||
enablePayment: true,
|
|
||||||
enablePageHistory: true,
|
|
||||||
enableExperimentalFeature: true,
|
|
||||||
enableInfoModal: true,
|
|
||||||
allowLocalWorkspace: buildFlags.distribution === 'desktop' ? true : false,
|
|
||||||
serverUrlPrefix: 'https://affine.fail',
|
|
||||||
appVersion: packageJson.version,
|
|
||||||
editorVersion: packageJson.devDependencies['@blocksuite/presets'],
|
|
||||||
appBuildType: 'canary',
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -82,25 +67,13 @@ export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig {
|
|||||||
const currentBuildPreset = buildPreset[currentBuild];
|
const currentBuildPreset = buildPreset[currentBuild];
|
||||||
|
|
||||||
const environmentPreset = {
|
const environmentPreset = {
|
||||||
enableTestProperties: process.env.ENABLE_TEST_PROPERTIES
|
|
||||||
? process.env.ENABLE_TEST_PROPERTIES === 'true'
|
|
||||||
: currentBuildPreset.enableTestProperties,
|
|
||||||
enableBroadcastChannelProvider: process.env.ENABLE_BC_PROVIDER
|
|
||||||
? process.env.ENABLE_BC_PROVIDER !== 'false'
|
|
||||||
: currentBuildPreset.enableBroadcastChannelProvider,
|
|
||||||
changelogUrl: process.env.CHANGELOG_URL ?? currentBuildPreset.changelogUrl,
|
changelogUrl: process.env.CHANGELOG_URL ?? currentBuildPreset.changelogUrl,
|
||||||
enablePreloading: process.env.ENABLE_PRELOADING
|
enablePreloading: process.env.ENABLE_PRELOADING
|
||||||
? process.env.ENABLE_PRELOADING === 'true'
|
? process.env.ENABLE_PRELOADING === 'true'
|
||||||
: currentBuildPreset.enablePreloading,
|
: currentBuildPreset.enablePreloading,
|
||||||
enableNewSettingModal: process.env.ENABLE_NEW_SETTING_MODAL
|
|
||||||
? process.env.ENABLE_NEW_SETTING_MODAL === 'true'
|
|
||||||
: currentBuildPreset.enableNewSettingModal,
|
|
||||||
enableNewSettingUnstableApi: process.env.ENABLE_NEW_SETTING_UNSTABLE_API
|
enableNewSettingUnstableApi: process.env.ENABLE_NEW_SETTING_UNSTABLE_API
|
||||||
? process.env.ENABLE_NEW_SETTING_UNSTABLE_API === 'true'
|
? process.env.ENABLE_NEW_SETTING_UNSTABLE_API === 'true'
|
||||||
: currentBuildPreset.enableNewSettingUnstableApi,
|
: currentBuildPreset.enableNewSettingUnstableApi,
|
||||||
enableCloud: process.env.ENABLE_CLOUD
|
|
||||||
? process.env.ENABLE_CLOUD === 'true'
|
|
||||||
: currentBuildPreset.enableCloud,
|
|
||||||
enableCaptcha: process.env.ENABLE_CAPTCHA
|
enableCaptcha: process.env.ENABLE_CAPTCHA
|
||||||
? process.env.ENABLE_CAPTCHA === 'true'
|
? process.env.ENABLE_CAPTCHA === 'true'
|
||||||
: buildFlags.mode === 'development'
|
: buildFlags.mode === 'development'
|
||||||
@@ -109,16 +82,6 @@ export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig {
|
|||||||
enableEnhanceShareMode: process.env.ENABLE_ENHANCE_SHARE_MODE
|
enableEnhanceShareMode: process.env.ENABLE_ENHANCE_SHARE_MODE
|
||||||
? process.env.ENABLE_ENHANCE_SHARE_MODE === 'true'
|
? process.env.ENABLE_ENHANCE_SHARE_MODE === 'true'
|
||||||
: currentBuildPreset.enableEnhanceShareMode,
|
: currentBuildPreset.enableEnhanceShareMode,
|
||||||
enablePayment: process.env.ENABLE_PAYMENT
|
|
||||||
? process.env.ENABLE_PAYMENT !== 'false'
|
|
||||||
: buildFlags.mode === 'development'
|
|
||||||
? true
|
|
||||||
: currentBuildPreset.enablePayment,
|
|
||||||
enablePageHistory: process.env.ENABLE_PAGE_HISTORY
|
|
||||||
? process.env.ENABLE_PAGE_HISTORY === 'true'
|
|
||||||
: buildFlags.mode === 'development'
|
|
||||||
? true
|
|
||||||
: currentBuildPreset.enablePageHistory,
|
|
||||||
allowLocalWorkspace: process.env.ALLOW_LOCAL_WORKSPACE
|
allowLocalWorkspace: process.env.ALLOW_LOCAL_WORKSPACE
|
||||||
? process.env.ALLOW_LOCAL_WORKSPACE === 'true'
|
? process.env.ALLOW_LOCAL_WORKSPACE === 'true'
|
||||||
: buildFlags.mode === 'development'
|
: buildFlags.mode === 'development'
|
||||||
|
|||||||
Reference in New Issue
Block a user