mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
Merge branch 'master' into fix/lost-entrance-of-quick-search
This commit is contained in:
@@ -7,6 +7,21 @@ if (process.env.NODE_ENV === 'development' || process.env.COVERAGE === 'true') {
|
||||
plugins.push('istanbul');
|
||||
}
|
||||
|
||||
plugins.push([
|
||||
'@emotion',
|
||||
{
|
||||
// See https://emotion.sh/docs/@emotion/babel-plugin
|
||||
importMap: {
|
||||
'@/styles': {
|
||||
styled: {
|
||||
canonicalImport: ['@emotion/styled', 'default'],
|
||||
styledBaseImport: ['@/styles', 'styled'],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
module.exports = {
|
||||
presets: ['next/babel'],
|
||||
plugins,
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
"dependencies": {
|
||||
"@affine/datacenter": "workspace:*",
|
||||
"@affine/i18n": "workspace:*",
|
||||
"@blocksuite/blocks": "0.4.0-20230203030233-b22bea7",
|
||||
"@blocksuite/editor": "0.4.0-20230203030233-b22bea7",
|
||||
"@blocksuite/blocks": "0.4.0-20230205175611-17a62e3",
|
||||
"@blocksuite/editor": "0.4.0-20230205175611-17a62e3",
|
||||
"@blocksuite/icons": "^2.0.2",
|
||||
"@blocksuite/store": "0.4.0-20230203030233-b22bea7",
|
||||
"@blocksuite/store": "0.4.0-20230205175611-17a62e3",
|
||||
"@emotion/css": "^11.10.0",
|
||||
"@emotion/react": "^11.10.4",
|
||||
"@emotion/server": "^11.10.0",
|
||||
@@ -39,6 +39,7 @@
|
||||
"yjs": "^13.5.44"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@emotion/babel-plugin": "^11.10.5",
|
||||
"@types/node": "18.7.18",
|
||||
"@types/react": "18.0.20",
|
||||
"@types/react-dom": "18.0.6",
|
||||
@@ -50,7 +51,7 @@
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"next-pwa": "^5.6.0",
|
||||
"raw-loader": "^4.0.2",
|
||||
"typescript": "4.8.3"
|
||||
"typescript": "^4.9.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
|
||||
@@ -14,7 +14,6 @@ export const PageListEmpty = (props: { listType?: string }) => {
|
||||
{listType === 'all' && <p>{t('emptyAllPages')}</p>}
|
||||
{listType === 'favorite' && <p>{t('emptyFavourite')}</p>}
|
||||
{listType === 'trash' && <p>{t('emptyTrash')}</p>}
|
||||
<p>{t('still designed')}</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -23,6 +23,7 @@ export const WorkspaceCard = ({
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<StyledCard
|
||||
data-testid="workspace-card"
|
||||
onClick={() => {
|
||||
onClick(workspaceData);
|
||||
}}
|
||||
|
||||
@@ -32,7 +32,6 @@ import { EnableWorkspaceButton } from '@/components/enable-workspace';
|
||||
export const MembersPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
|
||||
const [isInviteModalShow, setIsInviteModalShow] = useState(false);
|
||||
const { members, removeMember, loaded } = useMembers();
|
||||
|
||||
const { t } = useTranslation();
|
||||
const { confirm } = useConfirm();
|
||||
|
||||
@@ -94,41 +93,45 @@ export const MembersPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
|
||||
: t('Pending')}
|
||||
</StyledMemberRoleContainer>
|
||||
<StyledMoreVerticalButton>
|
||||
<Menu
|
||||
content={
|
||||
<>
|
||||
<MenuItem
|
||||
onClick={async () => {
|
||||
const confirmRemove = await confirm({
|
||||
title: t('Delete Member?'),
|
||||
content: t('will delete member'),
|
||||
confirmText: t('Delete'),
|
||||
confirmType: 'danger',
|
||||
});
|
||||
{member.type === 99 ? (
|
||||
<></>
|
||||
) : (
|
||||
<Menu
|
||||
content={
|
||||
<>
|
||||
<MenuItem
|
||||
onClick={async () => {
|
||||
const confirmRemove = await confirm({
|
||||
title: t('Delete Member?'),
|
||||
content: t('will delete member'),
|
||||
confirmText: t('Delete'),
|
||||
confirmType: 'danger',
|
||||
});
|
||||
|
||||
if (!confirmRemove) {
|
||||
return;
|
||||
}
|
||||
await removeMember(member.id);
|
||||
toast(
|
||||
t('Member has been removed', {
|
||||
name: user.name,
|
||||
})
|
||||
);
|
||||
}}
|
||||
icon={<TrashIcon />}
|
||||
>
|
||||
{t('Delete')}
|
||||
</MenuItem>
|
||||
</>
|
||||
}
|
||||
placement="bottom-end"
|
||||
disablePortal={true}
|
||||
>
|
||||
<IconButton>
|
||||
<MoreVerticalIcon />
|
||||
</IconButton>
|
||||
</Menu>
|
||||
if (!confirmRemove) {
|
||||
return;
|
||||
}
|
||||
await removeMember(member.id);
|
||||
toast(
|
||||
t('Member has been removed', {
|
||||
name: user.name,
|
||||
})
|
||||
);
|
||||
}}
|
||||
icon={<TrashIcon />}
|
||||
>
|
||||
{t('Delete')}
|
||||
</MenuItem>
|
||||
</>
|
||||
}
|
||||
placement="bottom-end"
|
||||
disablePortal={true}
|
||||
>
|
||||
<IconButton>
|
||||
<MoreVerticalIcon />
|
||||
</IconButton>
|
||||
</Menu>
|
||||
)}
|
||||
</StyledMoreVerticalButton>
|
||||
</StyledMemberListItem>
|
||||
);
|
||||
|
||||
@@ -32,13 +32,13 @@ export const WorkspaceSelector = () => {
|
||||
>
|
||||
<WorkspaceUnitAvatar
|
||||
size={28}
|
||||
name={currentWorkspace?.name ?? 'AFFiNE'}
|
||||
name={currentWorkspace?.name ?? 'AFFiNE Test'}
|
||||
workspaceUnit={currentWorkspace}
|
||||
/>
|
||||
</div>
|
||||
</Avatar>
|
||||
<WorkspaceName data-testid="workspace-name">
|
||||
{currentWorkspace?.name ?? 'AFFiNE'}
|
||||
{currentWorkspace?.name ?? 'AFFiNE Test'}
|
||||
</WorkspaceName>
|
||||
</SelectorWrapper>
|
||||
<WorkspaceModal
|
||||
|
||||
@@ -67,8 +67,8 @@ const App = ({ Component, pageProps }: AppPropsWithLayout) => {
|
||||
};
|
||||
|
||||
const AppDefender = ({ children }: PropsWithChildren) => {
|
||||
const { synced } = useAppState();
|
||||
const router = useRouter();
|
||||
const { synced } = useAppState();
|
||||
|
||||
useEffect(() => {
|
||||
if (router.asPath === '/') {
|
||||
@@ -76,6 +76,11 @@ const AppDefender = ({ children }: PropsWithChildren) => {
|
||||
}
|
||||
}, [router]);
|
||||
|
||||
// if you visit /404, you will see the children directly
|
||||
if (router.route === '/404') {
|
||||
return <div>{children}</div>;
|
||||
}
|
||||
|
||||
return <div>{synced ? children : <PageLoading />}</div>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DataCenter } from '@affine/datacenter';
|
||||
|
||||
const DEFAULT_WORKSPACE_NAME = 'affine';
|
||||
const DEFAULT_WORKSPACE_NAME = 'AFFiNE Test';
|
||||
|
||||
export const createDefaultWorkspace = async (dataCenter: DataCenter) => {
|
||||
return dataCenter.createWorkspace({
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
"main": "dist/src/index.js",
|
||||
"types": "dist/src/index.d.ts",
|
||||
"exports": {
|
||||
"./src/*": "./dist/src/*.js",
|
||||
".": "./dist/src/index.js"
|
||||
},
|
||||
"scripts": {
|
||||
@@ -23,12 +22,12 @@
|
||||
"@playwright/test": "^1.29.1",
|
||||
"@types/debug": "^4.1.7",
|
||||
"fake-indexeddb": "4.0.1",
|
||||
"typescript": "^4.8.4",
|
||||
"typescript": "^4.9.5",
|
||||
"yjs": "^13.5.44"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blocksuite/blocks": "0.4.0-20230203030233-b22bea7",
|
||||
"@blocksuite/store": "0.4.0-20230203030233-b22bea7",
|
||||
"@blocksuite/blocks": "0.4.0-20230205175611-17a62e3",
|
||||
"@blocksuite/store": "0.4.0-20230205175611-17a62e3",
|
||||
"debug": "^4.3.4",
|
||||
"encoding": "^0.1.13",
|
||||
"firebase": "^9.15.0",
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
"type": "module",
|
||||
"types": "dist/src/index.d.ts",
|
||||
"exports": {
|
||||
"./src/*": "./dist/src/*.js",
|
||||
".": "./dist/src/index.js"
|
||||
},
|
||||
"scripts": {
|
||||
@@ -28,6 +27,6 @@
|
||||
"devDependencies": {
|
||||
"@types/prettier": "^2.7.2",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.8.4"
|
||||
"typescript": "^4.9.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
"main": "dist/src/index.js",
|
||||
"types": "dist/src/index.d.ts",
|
||||
"exports": {
|
||||
"./src/*": "./dist/src/*.js",
|
||||
".": "./dist/src/index.js"
|
||||
},
|
||||
"scripts": {
|
||||
@@ -24,6 +23,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.0.21",
|
||||
"typescript": "^4.8.4"
|
||||
"typescript": "^4.9.5"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user