mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 06:47:02 +08:00
feat(core): impl team workspace (#8920)
AF-1738 AF-1735 AF-1731 AF-1721 AF-1717 AF-1736 AF-1727 AF-1719 AF-1877 UI for team workspaces : - add upgrade to team & successful upgrade page ( `/upgrade-to-team` & `/upgrade-success/team`) - update team plans on pricing page ( settings —> pricing plans ) - update reaching the usage/member limit modal - update invite member modal - update member CRUD options
This commit is contained in:
3
packages/frontend/graphql/src/graphql/get-is-admin.gql
Normal file
3
packages/frontend/graphql/src/graphql/get-is-admin.gql
Normal file
@@ -0,0 +1,3 @@
|
||||
query getIsAdmin($workspaceId: String!) {
|
||||
isAdmin(workspaceId: $workspaceId)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
query getWorkspaceInfo($workspaceId: String!) {
|
||||
isAdmin(workspaceId: $workspaceId)
|
||||
isOwner(workspaceId: $workspaceId)
|
||||
workspace(id: $workspaceId) {
|
||||
team
|
||||
}
|
||||
}
|
||||
@@ -400,6 +400,17 @@ query getInviteInfo($inviteId: String!) {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getIsAdminQuery = {
|
||||
id: 'getIsAdminQuery' as const,
|
||||
operationName: 'getIsAdmin',
|
||||
definitionName: 'isAdmin',
|
||||
containsFile: false,
|
||||
query: `
|
||||
query getIsAdmin($workspaceId: String!) {
|
||||
isAdmin(workspaceId: $workspaceId)
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getIsOwnerQuery = {
|
||||
id: 'getIsOwnerQuery' as const,
|
||||
operationName: 'getIsOwner',
|
||||
@@ -611,6 +622,21 @@ query getWorkspaceFeatures($workspaceId: String!) {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getWorkspaceInfoQuery = {
|
||||
id: 'getWorkspaceInfoQuery' as const,
|
||||
operationName: 'getWorkspaceInfo',
|
||||
definitionName: 'isAdmin,isOwner,workspace',
|
||||
containsFile: false,
|
||||
query: `
|
||||
query getWorkspaceInfo($workspaceId: String!) {
|
||||
isAdmin(workspaceId: $workspaceId)
|
||||
isOwner(workspaceId: $workspaceId)
|
||||
workspace(id: $workspaceId) {
|
||||
team
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getWorkspacePageMetaByIdQuery = {
|
||||
id: 'getWorkspacePageMetaByIdQuery' as const,
|
||||
operationName: 'getWorkspacePageMetaById',
|
||||
@@ -1307,6 +1333,25 @@ mutation inviteByEmail($workspaceId: String!, $email: String!, $permission: Perm
|
||||
}`,
|
||||
};
|
||||
|
||||
export const inviteByEmailsMutation = {
|
||||
id: 'inviteByEmailsMutation' as const,
|
||||
operationName: 'inviteByEmails',
|
||||
definitionName: 'inviteBatch',
|
||||
containsFile: false,
|
||||
query: `
|
||||
mutation inviteByEmails($workspaceId: String!, $emails: [String!]!, $sendInviteMail: Boolean) {
|
||||
inviteBatch(
|
||||
workspaceId: $workspaceId
|
||||
emails: $emails
|
||||
sendInviteMail: $sendInviteMail
|
||||
) {
|
||||
email
|
||||
inviteId
|
||||
sentSuccess
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const acceptInviteByInviteIdMutation = {
|
||||
id: 'acceptInviteByInviteIdMutation' as const,
|
||||
operationName: 'acceptInviteByInviteId',
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
mutation inviteByEmails(
|
||||
$workspaceId: String!
|
||||
$emails: [String!]!
|
||||
$sendInviteMail: Boolean
|
||||
) {
|
||||
inviteBatch(
|
||||
workspaceId: $workspaceId
|
||||
emails: $emails
|
||||
sendInviteMail: $sendInviteMail
|
||||
) {
|
||||
email
|
||||
inviteId
|
||||
sentSuccess
|
||||
}
|
||||
}
|
||||
@@ -891,6 +891,8 @@ export interface Query {
|
||||
error: ErrorDataUnion;
|
||||
/** send workspace invitation */
|
||||
getInviteInfo: InvitationType;
|
||||
/** Get is admin of workspace */
|
||||
isAdmin: Scalars['Boolean']['output'];
|
||||
/** Get is owner of workspace */
|
||||
isOwner: Scalars['Boolean']['output'];
|
||||
/**
|
||||
@@ -936,6 +938,10 @@ export interface QueryGetInviteInfoArgs {
|
||||
inviteId: Scalars['String']['input'];
|
||||
}
|
||||
|
||||
export interface QueryIsAdminArgs {
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}
|
||||
|
||||
export interface QueryIsOwnerArgs {
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}
|
||||
@@ -1738,6 +1744,12 @@ export type GetInviteInfoQuery = {
|
||||
};
|
||||
};
|
||||
|
||||
export type GetIsAdminQueryVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type GetIsAdminQuery = { __typename?: 'Query'; isAdmin: boolean };
|
||||
|
||||
export type GetIsOwnerQueryVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}>;
|
||||
@@ -1922,6 +1934,17 @@ export type GetWorkspaceFeaturesQuery = {
|
||||
workspace: { __typename?: 'WorkspaceType'; features: Array<FeatureType> };
|
||||
};
|
||||
|
||||
export type GetWorkspaceInfoQueryVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type GetWorkspaceInfoQuery = {
|
||||
__typename?: 'Query';
|
||||
isAdmin: boolean;
|
||||
isOwner: boolean;
|
||||
workspace: { __typename?: 'WorkspaceType'; team: boolean };
|
||||
};
|
||||
|
||||
export type GetWorkspacePageMetaByIdQueryVariables = Exact<{
|
||||
id: Scalars['String']['input'];
|
||||
pageId: Scalars['String']['input'];
|
||||
@@ -2542,6 +2565,22 @@ export type InviteByEmailMutationVariables = Exact<{
|
||||
|
||||
export type InviteByEmailMutation = { __typename?: 'Mutation'; invite: string };
|
||||
|
||||
export type InviteByEmailsMutationVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
emails: Array<Scalars['String']['input']> | Scalars['String']['input'];
|
||||
sendInviteMail?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
}>;
|
||||
|
||||
export type InviteByEmailsMutation = {
|
||||
__typename?: 'Mutation';
|
||||
inviteBatch: Array<{
|
||||
__typename?: 'InviteResult';
|
||||
email: string;
|
||||
inviteId: string | null;
|
||||
sentSuccess: boolean;
|
||||
}>;
|
||||
};
|
||||
|
||||
export type AcceptInviteByInviteIdMutationVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
inviteId: Scalars['String']['input'];
|
||||
@@ -2684,6 +2723,11 @@ export type Queries =
|
||||
variables: GetInviteInfoQueryVariables;
|
||||
response: GetInviteInfoQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getIsAdminQuery';
|
||||
variables: GetIsAdminQueryVariables;
|
||||
response: GetIsAdminQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getIsOwnerQuery';
|
||||
variables: GetIsOwnerQueryVariables;
|
||||
@@ -2744,6 +2788,11 @@ export type Queries =
|
||||
variables: GetWorkspaceFeaturesQueryVariables;
|
||||
response: GetWorkspaceFeaturesQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getWorkspaceInfoQuery';
|
||||
variables: GetWorkspaceInfoQueryVariables;
|
||||
response: GetWorkspaceInfoQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getWorkspacePageMetaByIdQuery';
|
||||
variables: GetWorkspacePageMetaByIdQueryVariables;
|
||||
@@ -3061,6 +3110,11 @@ export type Mutations =
|
||||
variables: InviteByEmailMutationVariables;
|
||||
response: InviteByEmailMutation;
|
||||
}
|
||||
| {
|
||||
name: 'inviteByEmailsMutation';
|
||||
variables: InviteByEmailsMutationVariables;
|
||||
response: InviteByEmailsMutation;
|
||||
}
|
||||
| {
|
||||
name: 'acceptInviteByInviteIdMutation';
|
||||
variables: AcceptInviteByInviteIdMutationVariables;
|
||||
|
||||
Reference in New Issue
Block a user