diff --git a/packages/app/src/app/graphql/types.ts b/packages/app/src/app/graphql/types.ts index 3e6ebc85843..b7184576868 100644 --- a/packages/app/src/app/graphql/types.ts +++ b/packages/app/src/app/graphql/types.ts @@ -3938,50 +3938,7 @@ export type AddToFolderMutationVariables = Exact<{ export type AddToFolderMutation = { __typename?: 'RootMutationType'; - addToCollectionOrTeam: Array<{ - __typename?: 'Sandbox'; - id: string; - alias: string | null; - title: string | null; - description: string | null; - lastAccessedAt: any; - insertedAt: string; - updatedAt: string; - removedAt: string | null; - privacy: number; - isFrozen: boolean; - screenshotUrl: string | null; - viewCount: number; - likeCount: number; - isV2: boolean; - draft: boolean; - restricted: boolean; - authorId: any | null; - teamId: any | null; - source: { __typename?: 'Source'; template: string | null }; - customTemplate: { - __typename?: 'Template'; - id: any | null; - iconUrl: string | null; - } | null; - forkedTemplate: { - __typename?: 'Template'; - id: any | null; - color: string | null; - iconUrl: string | null; - } | null; - collection: { - __typename?: 'Collection'; - path: string; - id: any | null; - } | null; - author: { __typename?: 'User'; username: string } | null; - permissions: { - __typename?: 'SandboxProtectionSettings'; - preventSandboxLeaving: boolean; - preventSandboxExport: boolean; - } | null; - } | null>; + addToCollectionOrTeam: Array<{ __typename?: 'Sandbox'; id: string } | null>; }; export type MoveToTrashMutationVariables = Exact<{ @@ -3990,50 +3947,7 @@ export type MoveToTrashMutationVariables = Exact<{ export type MoveToTrashMutation = { __typename?: 'RootMutationType'; - deleteSandboxes: Array<{ - __typename?: 'Sandbox'; - id: string; - alias: string | null; - title: string | null; - description: string | null; - lastAccessedAt: any; - insertedAt: string; - updatedAt: string; - removedAt: string | null; - privacy: number; - isFrozen: boolean; - screenshotUrl: string | null; - viewCount: number; - likeCount: number; - isV2: boolean; - draft: boolean; - restricted: boolean; - authorId: any | null; - teamId: any | null; - source: { __typename?: 'Source'; template: string | null }; - customTemplate: { - __typename?: 'Template'; - id: any | null; - iconUrl: string | null; - } | null; - forkedTemplate: { - __typename?: 'Template'; - id: any | null; - color: string | null; - iconUrl: string | null; - } | null; - collection: { - __typename?: 'Collection'; - path: string; - id: any | null; - } | null; - author: { __typename?: 'User'; username: string } | null; - permissions: { - __typename?: 'SandboxProtectionSettings'; - preventSandboxLeaving: boolean; - preventSandboxExport: boolean; - } | null; - }>; + deleteSandboxes: Array<{ __typename?: 'Sandbox'; id: string }>; }; export type ChangePrivacyMutationVariables = Exact<{ @@ -4043,50 +3957,7 @@ export type ChangePrivacyMutationVariables = Exact<{ export type ChangePrivacyMutation = { __typename?: 'RootMutationType'; - setSandboxesPrivacy: Array<{ - __typename?: 'Sandbox'; - id: string; - alias: string | null; - title: string | null; - description: string | null; - lastAccessedAt: any; - insertedAt: string; - updatedAt: string; - removedAt: string | null; - privacy: number; - isFrozen: boolean; - screenshotUrl: string | null; - viewCount: number; - likeCount: number; - isV2: boolean; - draft: boolean; - restricted: boolean; - authorId: any | null; - teamId: any | null; - source: { __typename?: 'Source'; template: string | null }; - customTemplate: { - __typename?: 'Template'; - id: any | null; - iconUrl: string | null; - } | null; - forkedTemplate: { - __typename?: 'Template'; - id: any | null; - color: string | null; - iconUrl: string | null; - } | null; - collection: { - __typename?: 'Collection'; - path: string; - id: any | null; - } | null; - author: { __typename?: 'User'; username: string } | null; - permissions: { - __typename?: 'SandboxProtectionSettings'; - preventSandboxLeaving: boolean; - preventSandboxExport: boolean; - } | null; - }>; + setSandboxesPrivacy: Array<{ __typename?: 'Sandbox'; id: string }>; }; export type ChangeFrozenMutationVariables = Exact<{ @@ -4096,50 +3967,7 @@ export type ChangeFrozenMutationVariables = Exact<{ export type ChangeFrozenMutation = { __typename?: 'RootMutationType'; - setSandboxesFrozen: Array<{ - __typename?: 'Sandbox'; - id: string; - alias: string | null; - title: string | null; - description: string | null; - lastAccessedAt: any; - insertedAt: string; - updatedAt: string; - removedAt: string | null; - privacy: number; - isFrozen: boolean; - screenshotUrl: string | null; - viewCount: number; - likeCount: number; - isV2: boolean; - draft: boolean; - restricted: boolean; - authorId: any | null; - teamId: any | null; - source: { __typename?: 'Source'; template: string | null }; - customTemplate: { - __typename?: 'Template'; - id: any | null; - iconUrl: string | null; - } | null; - forkedTemplate: { - __typename?: 'Template'; - id: any | null; - color: string | null; - iconUrl: string | null; - } | null; - collection: { - __typename?: 'Collection'; - path: string; - id: any | null; - } | null; - author: { __typename?: 'User'; username: string } | null; - permissions: { - __typename?: 'SandboxProtectionSettings'; - preventSandboxLeaving: boolean; - preventSandboxExport: boolean; - } | null; - }>; + setSandboxesFrozen: Array<{ __typename?: 'Sandbox'; id: string }>; }; export type _RenameSandboxMutationVariables = Exact<{ @@ -4149,50 +3977,7 @@ export type _RenameSandboxMutationVariables = Exact<{ export type _RenameSandboxMutation = { __typename?: 'RootMutationType'; - renameSandbox: { - __typename?: 'Sandbox'; - id: string; - alias: string | null; - title: string | null; - description: string | null; - lastAccessedAt: any; - insertedAt: string; - updatedAt: string; - removedAt: string | null; - privacy: number; - isFrozen: boolean; - screenshotUrl: string | null; - viewCount: number; - likeCount: number; - isV2: boolean; - draft: boolean; - restricted: boolean; - authorId: any | null; - teamId: any | null; - source: { __typename?: 'Source'; template: string | null }; - customTemplate: { - __typename?: 'Template'; - id: any | null; - iconUrl: string | null; - } | null; - forkedTemplate: { - __typename?: 'Template'; - id: any | null; - color: string | null; - iconUrl: string | null; - } | null; - collection: { - __typename?: 'Collection'; - path: string; - id: any | null; - } | null; - author: { __typename?: 'User'; username: string } | null; - permissions: { - __typename?: 'SandboxProtectionSettings'; - preventSandboxLeaving: boolean; - preventSandboxExport: boolean; - } | null; - }; + renameSandbox: { __typename?: 'Sandbox'; id: string }; }; export type _PermanentlyDeleteSandboxesMutationVariables = Exact<{ @@ -4203,67 +3988,14 @@ export type _PermanentlyDeleteSandboxesMutation = { __typename?: 'RootMutationType'; permanentlyDeleteSandboxes: Array<{ __typename?: 'Sandbox'; id: string }>; }; - -export type _AcceptTeamInvitationMutationVariables = Exact<{ - teamId: Scalars['UUID4']; -}>; - -export type _AcceptTeamInvitationMutation = { - __typename?: 'RootMutationType'; - acceptTeamInvitation: { - __typename?: 'Team'; - id: any; - name: string; - description: string | null; - avatarUrl: string | null; - insertedAt: string; - settings: { - __typename?: 'WorkspaceSandboxSettings'; - minimumPrivacy: number; - } | null; - userAuthorizations: Array<{ - __typename?: 'UserAuthorization'; - userId: any; - authorization: TeamMemberAuthorization; - teamManager: boolean; - }>; - users: Array<{ - __typename?: 'User'; - id: any; - name: string | null; - username: string; - avatarUrl: string; - }>; - invitees: Array<{ - __typename?: 'User'; - id: any; - name: string | null; - username: string; - avatarUrl: string; - }>; - subscription: { - __typename?: 'ProSubscription'; - origin: SubscriptionOrigin | null; - type: SubscriptionType; - status: SubscriptionStatus; - paymentProvider: SubscriptionPaymentProvider | null; - } | null; - featureFlags: { - __typename?: 'TeamFeatureFlags'; - ubbBeta: boolean; - friendOfCsb: boolean; - }; - limits: { - __typename?: 'TeamLimits'; - includedPublicSandboxes: number; - includedPrivateSandboxes: number; - }; - usage: { - __typename?: 'TeamUsage'; - publicSandboxesQuantity: number; - privateSandboxesQuantity: number; - }; - }; + +export type _AcceptTeamInvitationMutationVariables = Exact<{ + teamId: Scalars['UUID4']; +}>; + +export type _AcceptTeamInvitationMutation = { + __typename?: 'RootMutationType'; + acceptTeamInvitation: { __typename?: 'Team'; id: any }; }; export type _RejectTeamInvitationMutationVariables = Exact<{ @@ -4300,60 +4032,7 @@ export type _SetTeamNameMutationVariables = Exact<{ export type _SetTeamNameMutation = { __typename?: 'RootMutationType'; - setTeamName: { - __typename?: 'Team'; - id: any; - name: string; - description: string | null; - avatarUrl: string | null; - insertedAt: string; - settings: { - __typename?: 'WorkspaceSandboxSettings'; - minimumPrivacy: number; - } | null; - userAuthorizations: Array<{ - __typename?: 'UserAuthorization'; - userId: any; - authorization: TeamMemberAuthorization; - teamManager: boolean; - }>; - users: Array<{ - __typename?: 'User'; - id: any; - name: string | null; - username: string; - avatarUrl: string; - }>; - invitees: Array<{ - __typename?: 'User'; - id: any; - name: string | null; - username: string; - avatarUrl: string; - }>; - subscription: { - __typename?: 'ProSubscription'; - origin: SubscriptionOrigin | null; - type: SubscriptionType; - status: SubscriptionStatus; - paymentProvider: SubscriptionPaymentProvider | null; - } | null; - featureFlags: { - __typename?: 'TeamFeatureFlags'; - ubbBeta: boolean; - friendOfCsb: boolean; - }; - limits: { - __typename?: 'TeamLimits'; - includedPublicSandboxes: number; - includedPrivateSandboxes: number; - }; - usage: { - __typename?: 'TeamUsage'; - publicSandboxesQuantity: number; - privateSandboxesQuantity: number; - }; - }; + setTeamName: { __typename?: 'Team'; id: any }; }; export type DeleteWorkspaceMutationVariables = Exact<{ @@ -4571,60 +4250,7 @@ export type SetTeamMetadataMutationVariables = Exact<{ export type SetTeamMetadataMutation = { __typename?: 'RootMutationType'; - setTeamMetadata: { - __typename?: 'Team'; - id: any; - name: string; - description: string | null; - avatarUrl: string | null; - insertedAt: string; - settings: { - __typename?: 'WorkspaceSandboxSettings'; - minimumPrivacy: number; - } | null; - userAuthorizations: Array<{ - __typename?: 'UserAuthorization'; - userId: any; - authorization: TeamMemberAuthorization; - teamManager: boolean; - }>; - users: Array<{ - __typename?: 'User'; - id: any; - name: string | null; - username: string; - avatarUrl: string; - }>; - invitees: Array<{ - __typename?: 'User'; - id: any; - name: string | null; - username: string; - avatarUrl: string; - }>; - subscription: { - __typename?: 'ProSubscription'; - origin: SubscriptionOrigin | null; - type: SubscriptionType; - status: SubscriptionStatus; - paymentProvider: SubscriptionPaymentProvider | null; - } | null; - featureFlags: { - __typename?: 'TeamFeatureFlags'; - ubbBeta: boolean; - friendOfCsb: boolean; - }; - limits: { - __typename?: 'TeamLimits'; - includedPublicSandboxes: number; - includedPrivateSandboxes: number; - }; - usage: { - __typename?: 'TeamUsage'; - publicSandboxesQuantity: number; - privateSandboxesQuantity: number; - }; - }; + setTeamMetadata: { __typename?: 'Team'; id: any }; }; export type JoinEligibleWorkspaceMutationVariables = Exact<{ @@ -6078,31 +5704,7 @@ export type AddToCollectionMutationVariables = Exact<{ export type AddToCollectionMutation = { __typename?: 'RootMutationType'; - addToCollectionOrTeam: Array<{ - __typename?: 'Sandbox'; - id: string; - alias: string | null; - title: string | null; - description: string | null; - insertedAt: string; - updatedAt: string; - removedAt: string | null; - privacy: number; - screenshotUrl: string | null; - teamId: any | null; - source: { __typename?: 'Source'; template: string | null }; - customTemplate: { __typename?: 'Template'; id: any | null } | null; - forkedTemplate: { - __typename?: 'Template'; - id: any | null; - color: string | null; - } | null; - collection: { - __typename?: 'Collection'; - path: string; - teamId: any | null; - } | null; - } | null>; + addToCollectionOrTeam: Array<{ __typename?: 'Sandbox'; id: string } | null>; }; export type DeleteSandboxesMutationVariables = Exact<{ @@ -6111,31 +5713,7 @@ export type DeleteSandboxesMutationVariables = Exact<{ export type DeleteSandboxesMutation = { __typename?: 'RootMutationType'; - deleteSandboxes: Array<{ - __typename?: 'Sandbox'; - id: string; - alias: string | null; - title: string | null; - description: string | null; - insertedAt: string; - updatedAt: string; - removedAt: string | null; - privacy: number; - screenshotUrl: string | null; - teamId: any | null; - source: { __typename?: 'Source'; template: string | null }; - customTemplate: { __typename?: 'Template'; id: any | null } | null; - forkedTemplate: { - __typename?: 'Template'; - id: any | null; - color: string | null; - } | null; - collection: { - __typename?: 'Collection'; - path: string; - teamId: any | null; - } | null; - }>; + deleteSandboxes: Array<{ __typename?: 'Sandbox'; id: string }>; }; export type SetSandboxesPrivacyMutationVariables = Exact<{ @@ -6145,31 +5723,7 @@ export type SetSandboxesPrivacyMutationVariables = Exact<{ export type SetSandboxesPrivacyMutation = { __typename?: 'RootMutationType'; - setSandboxesPrivacy: Array<{ - __typename?: 'Sandbox'; - id: string; - alias: string | null; - title: string | null; - description: string | null; - insertedAt: string; - updatedAt: string; - removedAt: string | null; - privacy: number; - screenshotUrl: string | null; - teamId: any | null; - source: { __typename?: 'Source'; template: string | null }; - customTemplate: { __typename?: 'Template'; id: any | null } | null; - forkedTemplate: { - __typename?: 'Template'; - id: any | null; - color: string | null; - } | null; - collection: { - __typename?: 'Collection'; - path: string; - teamId: any | null; - } | null; - }>; + setSandboxesPrivacy: Array<{ __typename?: 'Sandbox'; id: string }>; }; export type RenameSandboxMutationVariables = Exact<{ @@ -6179,31 +5733,7 @@ export type RenameSandboxMutationVariables = Exact<{ export type RenameSandboxMutation = { __typename?: 'RootMutationType'; - renameSandbox: { - __typename?: 'Sandbox'; - id: string; - alias: string | null; - title: string | null; - description: string | null; - insertedAt: string; - updatedAt: string; - removedAt: string | null; - privacy: number; - screenshotUrl: string | null; - teamId: any | null; - source: { __typename?: 'Source'; template: string | null }; - customTemplate: { __typename?: 'Template'; id: any | null } | null; - forkedTemplate: { - __typename?: 'Template'; - id: any | null; - color: string | null; - } | null; - collection: { - __typename?: 'Collection'; - path: string; - teamId: any | null; - } | null; - }; + renameSandbox: { __typename?: 'Sandbox'; id: string }; }; export type PermanentlyDeleteSandboxesMutationVariables = Exact<{ @@ -6321,41 +5851,6 @@ export type RecentSandboxesQuery = { } | null; }; -export type SearchSandboxesQueryVariables = Exact<{ [key: string]: never }>; - -export type SearchSandboxesQuery = { - __typename?: 'RootQueryType'; - me: { - __typename?: 'CurrentUser'; - id: any; - sandboxes: Array<{ - __typename?: 'Sandbox'; - id: string; - alias: string | null; - title: string | null; - description: string | null; - insertedAt: string; - updatedAt: string; - removedAt: string | null; - privacy: number; - screenshotUrl: string | null; - teamId: any | null; - source: { __typename?: 'Source'; template: string | null }; - customTemplate: { __typename?: 'Template'; id: any | null } | null; - forkedTemplate: { - __typename?: 'Template'; - id: any | null; - color: string | null; - } | null; - collection: { - __typename?: 'Collection'; - path: string; - teamId: any | null; - } | null; - }>; - } | null; -}; - export type DeletedSandboxesQueryVariables = Exact<{ [key: string]: never }>; export type DeletedSandboxesQuery = { @@ -6430,27 +5925,7 @@ export type AcceptTeamInvitationMutationVariables = Exact<{ export type AcceptTeamInvitationMutation = { __typename?: 'RootMutationType'; - acceptTeamInvitation: { - __typename?: 'Team'; - id: any; - name: string; - inviteToken: string; - description: string | null; - users: Array<{ - __typename?: 'User'; - id: any; - name: string | null; - username: string; - avatarUrl: string; - }>; - invitees: Array<{ - __typename?: 'User'; - id: any; - name: string | null; - username: string; - avatarUrl: string; - }>; - }; + acceptTeamInvitation: { __typename?: 'Team'; id: any }; }; export type RejectTeamInvitationMutationVariables = Exact<{ diff --git a/packages/app/src/app/overmind/effects/gql/dashboard/mutations.ts b/packages/app/src/app/overmind/effects/gql/dashboard/mutations.ts index 013cf1b4200..213f082678c 100644 --- a/packages/app/src/app/overmind/effects/gql/dashboard/mutations.ts +++ b/packages/app/src/app/overmind/effects/gql/dashboard/mutations.ts @@ -73,7 +73,6 @@ import { gql, Query } from 'overmind-graphql'; import { teamFragmentDashboard, sidebarCollectionDashboard, - sandboxFragmentDashboard, } from './fragments'; export const createTeam: Query< @@ -150,10 +149,9 @@ export const addSandboxToFolder: Query< teamId: $teamId privacy: $privacy ) { - ...sandboxFragmentDashboard + id } } - ${sandboxFragmentDashboard} `; export const deleteSandboxes: Query< @@ -162,10 +160,9 @@ export const deleteSandboxes: Query< > = gql` mutation MoveToTrash($sandboxIds: [ID!]!) { deleteSandboxes(sandboxIds: $sandboxIds) { - ...sandboxFragmentDashboard + id } } - ${sandboxFragmentDashboard} `; export const changePrivacy: Query< @@ -174,10 +171,9 @@ export const changePrivacy: Query< > = gql` mutation changePrivacy($sandboxIds: [ID!]!, $privacy: Int!) { setSandboxesPrivacy(sandboxIds: $sandboxIds, privacy: $privacy) { - ...sandboxFragmentDashboard + id } } - ${sandboxFragmentDashboard} `; export const changeFrozen: Query< @@ -186,10 +182,9 @@ export const changeFrozen: Query< > = gql` mutation changeFrozen($sandboxIds: [ID!]!, $isFrozen: Boolean!) { setSandboxesFrozen(sandboxIds: $sandboxIds, isFrozen: $isFrozen) { - ...sandboxFragmentDashboard + id } } - ${sandboxFragmentDashboard} `; export const renameSandbox: Query< @@ -198,10 +193,9 @@ export const renameSandbox: Query< > = gql` mutation _RenameSandbox($id: ID!, $title: String!) { renameSandbox(id: $id, title: $title) { - ...sandboxFragmentDashboard + id } } - ${sandboxFragmentDashboard} `; export const permanentlyDeleteSandboxes: Query< @@ -221,10 +215,9 @@ export const acceptTeamInvitation: Query< > = gql` mutation _AcceptTeamInvitation($teamId: UUID4!) { acceptTeamInvitation(teamId: $teamId) { - ...teamFragmentDashboard + id } } - ${teamFragmentDashboard} `; export const rejectTeamInvitation: Query< @@ -264,10 +257,9 @@ export const setTeamName: Query< > = gql` mutation _SetTeamName($teamId: UUID4!, $name: String!) { setTeamName(teamId: $teamId, name: $name) { - ...teamFragmentDashboard + id } } - ${teamFragmentDashboard} `; export const deleteWorkspace: Query< @@ -528,10 +520,9 @@ export const setTeamMetadata: Query< > = gql` mutation SetTeamMetadata($teamId: UUID4!, $useCases: [String!]!) { setTeamMetadata(teamId: $teamId, metadata: { useCases: $useCases }) { - ...teamFragmentDashboard + id } } - ${teamFragmentDashboard} `; export const joinEligibleWorkspace: Query< diff --git a/packages/app/src/app/pages/Dashboard/queries.ts b/packages/app/src/app/pages/Dashboard/queries.ts index 5b9a47c9c1f..7830bd65139 100644 --- a/packages/app/src/app/pages/Dashboard/queries.ts +++ b/packages/app/src/app/pages/Dashboard/queries.ts @@ -152,37 +152,33 @@ export const ADD_SANDBOXES_TO_FOLDER_MUTATION = gql` sandboxIds: $sandboxIds teamId: $teamId ) { - ...Sandbox + id } } - ${SANDBOX_FRAGMENT} `; export const DELETE_SANDBOXES_MUTATION = gql` mutation DeleteSandboxes($sandboxIds: [ID!]!) { deleteSandboxes(sandboxIds: $sandboxIds) { - ...Sandbox + id } } - ${SANDBOX_FRAGMENT} `; export const SET_SANDBOXES_PRIVACY_MUTATION = gql` mutation SetSandboxesPrivacy($sandboxIds: [ID!]!, $privacy: Int!) { setSandboxesPrivacy(sandboxIds: $sandboxIds, privacy: $privacy) { - ...Sandbox + id } } - ${SANDBOX_FRAGMENT} `; export const RENAME_SANDBOX_MUTATION = gql` mutation RenameSandbox($id: ID!, $title: String!) { renameSandbox(id: $id, title: $title) { - ...Sandbox + id } } - ${SANDBOX_FRAGMENT} `; export const PERMANENTLY_DELETE_SANDBOXES_MUTATION = gql` @@ -261,19 +257,6 @@ export const RECENT_SANDBOXES_CONTENT_QUERY = gql` ${RECENT_SANDBOX_FRAGMENT} `; -export const SEARCH_SANDBOXES_QUERY = gql` - query SearchSandboxes { - me { - id - - sandboxes(orderBy: { field: "updated_at", direction: DESC }) { - ...Sandbox - } - } - } - ${SANDBOX_FRAGMENT} -`; - export const DELETED_SANDBOXES_CONTENT_QUERY = gql` query DeletedSandboxes { me { @@ -384,7 +367,6 @@ export function deleteSandboxes(selectedSandboxes, collections = []) { 'DeletedSandboxes', 'PathedSandboxes', 'RecentSandboxes', - 'SearchSandboxes', ], update: cache => { if (collections) { @@ -463,10 +445,9 @@ export const TEAM_QUERY = gql` export const ACCEPT_TEAM_INVITATION = gql` mutation AcceptTeamInvitation($teamId: UUID4!) { acceptTeamInvitation(teamId: $teamId) { - ...Team + id } } - ${TEAM_FRAGMENT} `; export const REJECT_TEAM_INVITATION = gql`