Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.9.x-staging #4456

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a04d761
v0.9.0-beta.0
Brooooooklyn Sep 22, 2023
bade539
fix(electron): missing video (#4451)
himself65 Sep 22, 2023
818476d
refactor: workspace list (#4432)
JimmFly Sep 22, 2023
32ffa36
chore: bump components version (#4454)
pengx17 Sep 22, 2023
07c2083
docs: update README.md
himself65 Sep 22, 2023
3c5a36e
docs: upload LICENSE.md
himself65 Sep 22, 2023
86ca624
refactor(infra): simplify `currentWorkspaceAtom` (#4462)
himself65 Sep 22, 2023
15e1803
test: fix flaky (#4463)
himself65 Sep 22, 2023
2418e2c
fix(server): missing dependency in sync app (#4465)
Brooooooklyn Sep 22, 2023
d67facb
fix(core): error state for non early access user while signing in wit…
Brooooooklyn Sep 23, 2023
3075a29
0.9.0-beta.1
Brooooooklyn Sep 23, 2023
08c65b1
fix: register command re-rendering (#4476)
pengx17 Sep 25, 2023
eab5ad3
fix: unexpected hover behavior of collection sidebar (#4490)
JimmFly Sep 25, 2023
37c6e81
fix(component): background animation is different (#4495)
joooye34 Sep 25, 2023
8e98723
fix: unexpected pop ups (#4468)
JimmFly Sep 26, 2023
184ede6
fix: adjust 404 page style (#4491)
JimmFly Sep 26, 2023
b7df15b
fix(core): page update date (#4502)
himself65 Sep 26, 2023
a7e79c6
fix: current page atom (#4515)
himself65 Sep 26, 2023
bd64ee3
fix(server): wrong member count query (#4506)
forehalo Sep 26, 2023
bef184c
feat(component): add private copy link button (#4508)
JimmFly Sep 27, 2023
148db56
fix(core): setting ui regression (#4525)
forehalo Sep 27, 2023
ae3087a
fix(component): content should subtract height of the header (#4507)
joooye34 Sep 28, 2023
ea04873
fix: spacing issue in getting-started template (#4540)
wfnuser Sep 30, 2023
a5df724
chore: reword template galleries introduction (#4548)
l2dy Oct 6, 2023
cf8b62d
chore: bump electron from 26.2.2 to 26.3.0 (#4564)
dependabot[bot] Oct 9, 2023
46f8e3a
v0.9.0-beta.2
Brooooooklyn Oct 10, 2023
5acd6bf
fix(electron): app image icon (#4442)
pengx17 Oct 16, 2023
9b376cb
refactor(native): remove unused code (#4651)
himself65 Oct 17, 2023
1fa48a8
feat(core): change favicon (#4663)
joooye34 Oct 19, 2023
fcb12a8
v0.9.0-beta.3
Brooooooklyn Oct 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/build-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,25 @@ jobs:
path: ./apps/core/dist
if-no-files-found: error

build-native:
name: Build Native
runs-on: ubuntu-latest
environment: development
needs: build-core
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Build AFFiNE native
uses: ./.github/actions/build-rust
with:
target: x86_64-unknown-linux-gnu
package: '@affine/native'
nx_token: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Run tests
run: yarn test
working-directory: ./packages/native

desktop-test:
name: Desktop Test
runs-on: ${{ matrix.spec.os }}
Expand Down
13 changes: 1 addition & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,7 @@ We would also like to give thanks to open-source projects that make AFFiNE possi

Thanks a lot to the community for providing such powerful and simple libraries, so that we can focus more on the implementation of the product logic, and we hope that in the future our projects will also provide a more easy-to-use knowledge base for everyone.

# Contributors

## Current Core members

Team members who are currently maintaining the project:

- [JimmFly](https://github.com/JimmFly) - Jinfei Yang <[email protected]> (he/him)
- [pengx17](https://github.com/pengx17) - Peng Xiao <[email protected]> (he/him)
- [QiShaoXuan](https://github.com/QiSHaoXuan) - Shaoxuan Qi <[email protected]> (he/him)
- [himself65](https://github.com/himself65) - Zeyu "Alex" Yang <[email protected]> (he/him)

## All Contributors
## Contributors

We would like to express our gratitude to all the individuals who have already contributed to AFFiNE! If you have any AFFiNE-related project, documentation, tool or template, please feel free to contribute it by submitting a pull request to our curated list on GitHub: [awesome-affine](https://github.com/toeverything/awesome-affine).

Expand Down
2 changes: 1 addition & 1 deletion apps/core/.webpack/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export const createConfiguration: (
exclude: [/node_modules/],
},
{
test: /\.(png|jpg|gif|svg|webp)$/,
test: /\.(png|jpg|gif|svg|webp|mp4)$/,
type: 'asset/resource',
},
{
Expand Down
4 changes: 2 additions & 2 deletions apps/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@affine/core",
"type": "module",
"private": true,
"version": "0.9.0-canary.13",
"version": "0.9.0-beta.3",
"scripts": {
"build": "yarn -T run build-core",
"dev": "yarn -T run dev-core",
Expand Down Expand Up @@ -39,7 +39,7 @@
"@mui/material": "^5.14.7",
"@radix-ui/react-select": "^1.2.2",
"@react-hookz/web": "^23.1.0",
"@toeverything/components": "^0.0.42",
"@toeverything/components": "^0.0.43",
"async-call-rpc": "^6.3.1",
"cmdk": "^0.2.0",
"css-spring": "^4.1.0",
Expand Down
Binary file modified apps/core/public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/core/public/favicon-144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/core/public/favicon-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/core/public/favicon-36.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/core/public/favicon-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/core/public/favicon-72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/core/public/favicon-96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/core/public/favicon.ico
Binary file not shown.
6 changes: 3 additions & 3 deletions apps/core/src/bootstrap/plugins/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from '@toeverything/infra/__internal__/plugin';
import {
contentLayoutAtom,
currentPageAtom,
currentPageIdAtom,
currentWorkspaceAtom,
} from '@toeverything/infra/atom';
import { atom } from 'jotai';
Expand Down Expand Up @@ -129,7 +129,7 @@ export function createSetup(rootStore: ReturnType<typeof createStore>) {

function createSetupImpl(rootStore: ReturnType<typeof createStore>) {
// clean up plugin windows when switching to other pages
rootStore.sub(currentPageAtom, () => {
rootStore.sub(currentPageIdAtom, () => {
rootStore.set(contentLayoutAtom, 'editor');
});

Expand All @@ -149,7 +149,7 @@ function createSetupImpl(rootStore: ReturnType<typeof createStore>) {
'@affine/sdk/entry': {
rootStore,
currentWorkspaceAtom: currentWorkspaceAtom,
currentPageAtom: currentPageAtom,
currentPageIdAtom: currentPageIdAtom,
pushLayoutAtom: pushLayoutAtom,
deleteLayoutAtom: deleteLayoutAtom,
},
Expand Down
23 changes: 21 additions & 2 deletions apps/core/src/components/affine/auth/sign-in.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import {
CountDownRender,
ModalHeader,
} from '@affine/component/auth-components';
import { getUserQuery } from '@affine/graphql';
import { type GetUserQuery, getUserQuery } from '@affine/graphql';
import { Trans } from '@affine/i18n';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { useMutation } from '@affine/workspace/affine/gql';
import { ArrowDownBigIcon, GoogleDuotoneIcon } from '@blocksuite/icons';
import { Button } from '@toeverything/components/button';
import { GraphQLError } from 'graphql';
import { type FC, useState } from 'react';
import { useCallback } from 'react';

Expand Down Expand Up @@ -56,7 +57,25 @@ export const SignIn: FC<AuthPanelProps> = ({
}

setIsValidEmail(true);
const { user } = await verifyUser({ email });
// 0 for no access for internal beta
let user: GetUserQuery['user'] | null | 0 = null;
await verifyUser({ email })
.then(({ user: u }) => {
user = u;
})
.catch(err => {
const e = err?.[0];
if (e instanceof GraphQLError && e.extensions?.code === 402) {
setAuthState('noAccess');
user = 0;
} else {
throw err;
}
});

if (user === 0) {
return;
}
setAuthEmail(email);

if (user) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ import { Tooltip } from '@toeverything/components/tooltip';
import clsx from 'clsx';
import { useSetAtom } from 'jotai';
import type { ReactElement } from 'react';
import { Suspense, useCallback, useMemo, useState } from 'react';
import {
Suspense,
useCallback,
useLayoutEffect,
useMemo,
useRef,
useState,
} from 'react';
import { ErrorBoundary } from 'react-error-boundary';

import type { CheckedUser } from '../../../hooks/affine/use-current-user';
Expand Down Expand Up @@ -96,6 +103,20 @@ export const CloudWorkspaceMembersPanel = ({
[invite, pushNotification, t]
);

const listContainerRef = useRef<HTMLDivElement | null>(null);
const [memberListHeight, setMemberListHeight] = useState<number | null>(null);

useLayoutEffect(() => {
if (
memberCount > COUNT_PER_PAGE &&
listContainerRef.current &&
memberListHeight === null
) {
const rect = listContainerRef.current.getBoundingClientRect();
setMemberListHeight(rect.height);
}
}, [listContainerRef, memberCount, memberListHeight]);

const onRevoke = useCallback<OnRevoke>(
async memberId => {
const res = await revokeMemberPermission(memberId);
Expand Down Expand Up @@ -129,7 +150,11 @@ export const CloudWorkspaceMembersPanel = ({
) : null}
</SettingRow>

<div className={style.membersPanel}>
<div
className={style.membersPanel}
ref={listContainerRef}
style={memberListHeight ? { height: memberListHeight } : {}}
>
<Suspense fallback={<MemberListFallback memberCount={memberCount} />}>
<MemberList
workspaceId={workspaceId}
Expand All @@ -139,11 +164,13 @@ export const CloudWorkspaceMembersPanel = ({
/>
</Suspense>

<Pagination
totalCount={memberCount}
countPerPage={COUNT_PER_PAGE}
onPageChange={onPageChange}
/>
{memberCount > COUNT_PER_PAGE && (
<Pagination
totalCount={memberCount}
countPerPage={COUNT_PER_PAGE}
onPageChange={onPageChange}
/>
)}
</div>
</>
);
Expand Down Expand Up @@ -186,7 +213,7 @@ const MemberList = ({
const currentUser = useCurrentUser();

return (
<>
<div className={style.memberList}>
{members.map(member => (
<MemberItem
key={member.id}
Expand All @@ -196,7 +223,7 @@ const MemberList = ({
onRevoke={onRevoke}
/>
))}
</>
</div>
);
};

Expand Down Expand Up @@ -225,54 +252,56 @@ const MemberItem = ({
}, [currentUser.id, isOwner, member.id, t]);

return (
<>
<div key={member.id} className={style.listItem} data-testid="member-item">
<Avatar
size={36}
url={member.avatarUrl}
name={(member.emailVerified ? member.name : member.email) as string}
/>
<div className={style.memberContainer}>
{member.emailVerified ? (
<>
<div className={style.memberName}>{member.name}</div>
<div className={style.memberEmail}>{member.email}</div>
</>
) : (
<div className={style.memberName}>{member.email}</div>
)}
</div>
<div
className={clsx(style.roleOrStatus, {
pending: !member.accepted,
})}
>
{member.accepted
? member.permission === Permission.Owner
? 'Workspace Owner'
: 'Member'
: 'Pending'}
</div>
<Menu
items={
<MenuItem data-member-id={member.id} onClick={handleRevoke}>
{operationButtonInfo.leaveOrRevokeText}
</MenuItem>
}
>
<IconButton
disabled={!operationButtonInfo.show}
type="plain"
style={{
visibility: operationButtonInfo.show ? 'visible' : 'hidden',
flexShrink: 0,
}}
>
<MoreVerticalIcon />
</IconButton>
</Menu>
<div
key={member.id}
className={style.memberListItem}
data-testid="member-item"
>
<Avatar
size={36}
url={member.avatarUrl}
name={(member.emailVerified ? member.name : member.email) as string}
/>
<div className={style.memberContainer}>
{member.emailVerified ? (
<>
<div className={style.memberName}>{member.name}</div>
<div className={style.memberEmail}>{member.email}</div>
</>
) : (
<div className={style.memberName}>{member.email}</div>
)}
</div>
</>
<div
className={clsx(style.roleOrStatus, {
pending: !member.accepted,
})}
>
{member.accepted
? member.permission === Permission.Owner
? 'Workspace Owner'
: 'Member'
: 'Pending'}
</div>
<Menu
items={
<MenuItem data-member-id={member.id} onClick={handleRevoke}>
{operationButtonInfo.leaveOrRevokeText}
</MenuItem>
}
>
<IconButton
disabled={!operationButtonInfo.show}
type="plain"
style={{
visibility: operationButtonInfo.show ? 'visible' : 'hidden',
flexShrink: 0,
}}
>
<MoreVerticalIcon />
</IconButton>
</Menu>
</div>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,17 @@ export const membersFallback = style({
color: 'var(--affine-primary-color)',
});
export const membersPanel = style({
marginTop: '24px',
padding: '4px',
borderRadius: '12px',
background: 'var(--affine-background-primary-color)',
border: '1px solid var(--affine-border-color)',
display: 'flex',
flexDirection: 'column',
justifyContent: 'space-between',
});

export const listItem = style({
export const memberList = style({});
export const memberListItem = style({
padding: '0 4px 0 16px',
height: '58px',
display: 'flex',
Expand Down Expand Up @@ -155,7 +158,7 @@ export const memberEmail = style({
});
export const iconButton = style({});

globalStyle(`${listItem}:hover ${iconButton}`, {
globalStyle(`${memberListItem}:hover ${iconButton}`, {
opacity: 1,
pointerEvents: 'all',
});
Expand Down
Loading
Loading