mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-07 01:09:54 +08:00
chore(core): doc role telemetry (#10822)
This commit is contained in:
+1
-1
@@ -58,7 +58,7 @@ export const MembersPermission = ({
|
|||||||
async (docRole: DocRole) => {
|
async (docRole: DocRole) => {
|
||||||
try {
|
try {
|
||||||
track.$.sharePanel.$.modifyDocDefaultRole({
|
track.$.sharePanel.$.modifyDocDefaultRole({
|
||||||
control: docRole,
|
role: docRole,
|
||||||
});
|
});
|
||||||
await docGrantedUsersService.updateDocDefaultRole(docRole);
|
await docGrantedUsersService.updateDocDefaultRole(docRole);
|
||||||
shareInfoService.shareInfo.revalidate();
|
shareInfoService.shareInfo.revalidate();
|
||||||
|
|||||||
+1
-1
@@ -148,7 +148,7 @@ const Options = ({
|
|||||||
|
|
||||||
const updateUserRole = useCallback(
|
const updateUserRole = useCallback(
|
||||||
async (userId: string, role: DocRole) => {
|
async (userId: string, role: DocRole) => {
|
||||||
track.$.sharePanel.$.modifyUserDocRole({ control: role });
|
track.$.sharePanel.$.modifyUserDocRole({ control: 'Update', role });
|
||||||
try {
|
try {
|
||||||
const res = await docGrantedUsersService.updateUserRole(userId, role);
|
const res = await docGrantedUsersService.updateUserRole(userId, role);
|
||||||
if (res) {
|
if (res) {
|
||||||
|
|||||||
@@ -379,6 +379,7 @@ export enum DocRole {
|
|||||||
Editor = 'Editor',
|
Editor = 'Editor',
|
||||||
External = 'External',
|
External = 'External',
|
||||||
Manager = 'Manager',
|
Manager = 'Manager',
|
||||||
|
None = 'None',
|
||||||
Owner = 'Owner',
|
Owner = 'Owner',
|
||||||
Reader = 'Reader',
|
Reader = 'Reader',
|
||||||
}
|
}
|
||||||
@@ -510,6 +511,7 @@ export enum ErrorNames {
|
|||||||
FAILED_TO_UPSERT_SNAPSHOT = 'FAILED_TO_UPSERT_SNAPSHOT',
|
FAILED_TO_UPSERT_SNAPSHOT = 'FAILED_TO_UPSERT_SNAPSHOT',
|
||||||
GRAPHQL_BAD_REQUEST = 'GRAPHQL_BAD_REQUEST',
|
GRAPHQL_BAD_REQUEST = 'GRAPHQL_BAD_REQUEST',
|
||||||
INTERNAL_SERVER_ERROR = 'INTERNAL_SERVER_ERROR',
|
INTERNAL_SERVER_ERROR = 'INTERNAL_SERVER_ERROR',
|
||||||
|
INVALID_AUTH_STATE = 'INVALID_AUTH_STATE',
|
||||||
INVALID_CHECKOUT_PARAMETERS = 'INVALID_CHECKOUT_PARAMETERS',
|
INVALID_CHECKOUT_PARAMETERS = 'INVALID_CHECKOUT_PARAMETERS',
|
||||||
INVALID_EMAIL = 'INVALID_EMAIL',
|
INVALID_EMAIL = 'INVALID_EMAIL',
|
||||||
INVALID_EMAIL_TOKEN = 'INVALID_EMAIL_TOKEN',
|
INVALID_EMAIL_TOKEN = 'INVALID_EMAIL_TOKEN',
|
||||||
@@ -636,6 +638,10 @@ export interface GraphqlBadRequestDataType {
|
|||||||
message: Scalars['String']['output'];
|
message: Scalars['String']['output'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ImportUsersInput {
|
||||||
|
users: Array<CreateUserInput>;
|
||||||
|
}
|
||||||
|
|
||||||
export interface InvalidEmailDataType {
|
export interface InvalidEmailDataType {
|
||||||
__typename?: 'InvalidEmailDataType';
|
__typename?: 'InvalidEmailDataType';
|
||||||
email: Scalars['String']['output'];
|
email: Scalars['String']['output'];
|
||||||
@@ -750,6 +756,8 @@ export interface InviteUserType {
|
|||||||
* @deprecated useless
|
* @deprecated useless
|
||||||
*/
|
*/
|
||||||
createdAt: Maybe<Scalars['DateTime']['output']>;
|
createdAt: Maybe<Scalars['DateTime']['output']>;
|
||||||
|
/** User is disabled */
|
||||||
|
disabled: Maybe<Scalars['Boolean']['output']>;
|
||||||
/** User email */
|
/** User email */
|
||||||
email: Maybe<Scalars['String']['output']>;
|
email: Maybe<Scalars['String']['output']>;
|
||||||
/** User email verified */
|
/** User email verified */
|
||||||
@@ -891,6 +899,8 @@ export interface Mutation {
|
|||||||
addContextDoc: Array<CopilotContextListItem>;
|
addContextDoc: Array<CopilotContextListItem>;
|
||||||
addWorkspaceFeature: Scalars['Boolean']['output'];
|
addWorkspaceFeature: Scalars['Boolean']['output'];
|
||||||
approveMember: Scalars['Boolean']['output'];
|
approveMember: Scalars['Boolean']['output'];
|
||||||
|
/** Ban an user */
|
||||||
|
banUser: UserType;
|
||||||
cancelSubscription: SubscriptionType;
|
cancelSubscription: SubscriptionType;
|
||||||
changeEmail: UserType;
|
changeEmail: UserType;
|
||||||
changePassword: Scalars['Boolean']['output'];
|
changePassword: Scalars['Boolean']['output'];
|
||||||
@@ -922,11 +932,15 @@ export interface Mutation {
|
|||||||
/** Delete a user account */
|
/** Delete a user account */
|
||||||
deleteUser: DeleteAccount;
|
deleteUser: DeleteAccount;
|
||||||
deleteWorkspace: Scalars['Boolean']['output'];
|
deleteWorkspace: Scalars['Boolean']['output'];
|
||||||
|
/** Reenable an banned user */
|
||||||
|
enableUser: UserType;
|
||||||
/** Create a chat session */
|
/** Create a chat session */
|
||||||
forkCopilotSession: Scalars['String']['output'];
|
forkCopilotSession: Scalars['String']['output'];
|
||||||
generateLicenseKey: Scalars['String']['output'];
|
generateLicenseKey: Scalars['String']['output'];
|
||||||
grantDocUserRoles: Scalars['Boolean']['output'];
|
grantDocUserRoles: Scalars['Boolean']['output'];
|
||||||
grantMember: Scalars['Boolean']['output'];
|
grantMember: Scalars['Boolean']['output'];
|
||||||
|
/** import users */
|
||||||
|
importUsers: Array<UserImportResultType>;
|
||||||
invite: Scalars['String']['output'];
|
invite: Scalars['String']['output'];
|
||||||
inviteBatch: Array<InviteResult>;
|
inviteBatch: Array<InviteResult>;
|
||||||
leaveWorkspace: Scalars['Boolean']['output'];
|
leaveWorkspace: Scalars['Boolean']['output'];
|
||||||
@@ -969,7 +983,7 @@ export interface Mutation {
|
|||||||
/** update multiple server runtime configurable settings */
|
/** update multiple server runtime configurable settings */
|
||||||
updateRuntimeConfigs: Array<ServerRuntimeConfigType>;
|
updateRuntimeConfigs: Array<ServerRuntimeConfigType>;
|
||||||
updateSubscriptionRecurring: SubscriptionType;
|
updateSubscriptionRecurring: SubscriptionType;
|
||||||
/** Update a user */
|
/** Update an user */
|
||||||
updateUser: UserType;
|
updateUser: UserType;
|
||||||
/** update user enabled feature */
|
/** update user enabled feature */
|
||||||
updateUserFeatures: Array<FeatureType>;
|
updateUserFeatures: Array<FeatureType>;
|
||||||
@@ -1005,6 +1019,10 @@ export interface MutationApproveMemberArgs {
|
|||||||
workspaceId: Scalars['String']['input'];
|
workspaceId: Scalars['String']['input'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface MutationBanUserArgs {
|
||||||
|
id: Scalars['String']['input'];
|
||||||
|
}
|
||||||
|
|
||||||
export interface MutationCancelSubscriptionArgs {
|
export interface MutationCancelSubscriptionArgs {
|
||||||
idempotencyKey?: InputMaybe<Scalars['String']['input']>;
|
idempotencyKey?: InputMaybe<Scalars['String']['input']>;
|
||||||
plan?: InputMaybe<SubscriptionPlan>;
|
plan?: InputMaybe<SubscriptionPlan>;
|
||||||
@@ -1088,6 +1106,10 @@ export interface MutationDeleteWorkspaceArgs {
|
|||||||
id: Scalars['String']['input'];
|
id: Scalars['String']['input'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface MutationEnableUserArgs {
|
||||||
|
id: Scalars['String']['input'];
|
||||||
|
}
|
||||||
|
|
||||||
export interface MutationForkCopilotSessionArgs {
|
export interface MutationForkCopilotSessionArgs {
|
||||||
options: ForkChatSessionInput;
|
options: ForkChatSessionInput;
|
||||||
}
|
}
|
||||||
@@ -1106,6 +1128,10 @@ export interface MutationGrantMemberArgs {
|
|||||||
workspaceId: Scalars['String']['input'];
|
workspaceId: Scalars['String']['input'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface MutationImportUsersArgs {
|
||||||
|
input: ImportUsersInput;
|
||||||
|
}
|
||||||
|
|
||||||
export interface MutationInviteArgs {
|
export interface MutationInviteArgs {
|
||||||
email: Scalars['String']['input'];
|
email: Scalars['String']['input'];
|
||||||
permission?: InputMaybe<Permission>;
|
permission?: InputMaybe<Permission>;
|
||||||
@@ -1517,6 +1543,14 @@ export interface QueryTooLongDataType {
|
|||||||
max: Scalars['Int']['output'];
|
max: Scalars['Int']['output'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ReleaseVersionType {
|
||||||
|
__typename?: 'ReleaseVersionType';
|
||||||
|
changelog: Scalars['String']['output'];
|
||||||
|
publishedAt: Scalars['DateTime']['output'];
|
||||||
|
url: Scalars['String']['output'];
|
||||||
|
version: Scalars['String']['output'];
|
||||||
|
}
|
||||||
|
|
||||||
export interface RemoveAvatar {
|
export interface RemoveAvatar {
|
||||||
__typename?: 'RemoveAvatar';
|
__typename?: 'RemoveAvatar';
|
||||||
success: Scalars['Boolean']['output'];
|
success: Scalars['Boolean']['output'];
|
||||||
@@ -1553,6 +1587,8 @@ export interface SameSubscriptionRecurringDataType {
|
|||||||
|
|
||||||
export interface ServerConfigType {
|
export interface ServerConfigType {
|
||||||
__typename?: 'ServerConfigType';
|
__typename?: 'ServerConfigType';
|
||||||
|
/** fetch latest available upgradable release of server */
|
||||||
|
availableUpgrade: ReleaseVersionType;
|
||||||
/** Features for user that can be configured */
|
/** Features for user that can be configured */
|
||||||
availableUserFeatures: Array<FeatureType>;
|
availableUserFeatures: Array<FeatureType>;
|
||||||
/** server base url */
|
/** server base url */
|
||||||
@@ -1772,6 +1808,14 @@ export interface UpdateWorkspaceInput {
|
|||||||
public?: InputMaybe<Scalars['Boolean']['input']>;
|
public?: InputMaybe<Scalars['Boolean']['input']>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface UserImportFailedType {
|
||||||
|
__typename?: 'UserImportFailedType';
|
||||||
|
email: Scalars['String']['output'];
|
||||||
|
error: Scalars['String']['output'];
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UserImportResultType = UserImportFailedType | UserType;
|
||||||
|
|
||||||
export type UserOrLimitedUser = LimitedUserType | UserType;
|
export type UserOrLimitedUser = LimitedUserType | UserType;
|
||||||
|
|
||||||
export interface UserQuotaHumanReadableType {
|
export interface UserQuotaHumanReadableType {
|
||||||
@@ -1813,6 +1857,8 @@ export interface UserType {
|
|||||||
* @deprecated useless
|
* @deprecated useless
|
||||||
*/
|
*/
|
||||||
createdAt: Maybe<Scalars['DateTime']['output']>;
|
createdAt: Maybe<Scalars['DateTime']['output']>;
|
||||||
|
/** User is disabled */
|
||||||
|
disabled: Scalars['Boolean']['output'];
|
||||||
/** User email */
|
/** User email */
|
||||||
email: Scalars['String']['output'];
|
email: Scalars['String']['output'];
|
||||||
/** User email verified */
|
/** User email verified */
|
||||||
|
|||||||
@@ -443,14 +443,6 @@ type AttachmentEventArgs = {
|
|||||||
type: string; // file type
|
type: string; // file type
|
||||||
};
|
};
|
||||||
|
|
||||||
type DocRoleControlType =
|
|
||||||
| 'Owner'
|
|
||||||
| 'Editor'
|
|
||||||
| 'Manager'
|
|
||||||
| 'Reader'
|
|
||||||
| 'External'
|
|
||||||
| 'Remove';
|
|
||||||
|
|
||||||
type TabActionControlType =
|
type TabActionControlType =
|
||||||
| 'click'
|
| 'click'
|
||||||
| 'dnd'
|
| 'dnd'
|
||||||
@@ -546,12 +538,8 @@ export type EventArgs = {
|
|||||||
openAttachmentInNewTab: AttachmentEventArgs;
|
openAttachmentInNewTab: AttachmentEventArgs;
|
||||||
openAttachmentInPeekView: AttachmentEventArgs;
|
openAttachmentInPeekView: AttachmentEventArgs;
|
||||||
openAttachmentInSplitView: AttachmentEventArgs;
|
openAttachmentInSplitView: AttachmentEventArgs;
|
||||||
modifyUserDocRole: {
|
modifyUserDocRole: { role: string };
|
||||||
control: DocRoleControlType;
|
modifyDocDefaultRole: { role: string };
|
||||||
};
|
|
||||||
modifyDocDefaultRole: {
|
|
||||||
control: DocRoleControlType;
|
|
||||||
};
|
|
||||||
inviteUserDocRole: {
|
inviteUserDocRole: {
|
||||||
control: 'member list';
|
control: 'member list';
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user