Skip to content

Commit 103603a

Browse files
authored
fix(context-menu): use parent privacy on fork (#8447)
* fix(context-menu): use parent privacy on fork * fix type
1 parent 00553e6 commit 103603a

File tree

4 files changed

+101
-18
lines changed

4 files changed

+101
-18
lines changed

packages/app/src/app/graphql/types.ts

Lines changed: 95 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4551,7 +4551,11 @@ export type SandboxFragmentDashboardFragment = {
45514551
color: string | null;
45524552
iconUrl: string | null;
45534553
} | null;
4554-
collection: { __typename?: 'Collection'; path: string } | null;
4554+
collection: {
4555+
__typename?: 'Collection';
4556+
path: string;
4557+
id: any | null;
4558+
} | null;
45554559
permissions: {
45564560
__typename?: 'SandboxProtectionSettings';
45574561
preventSandboxLeaving: boolean;
@@ -4610,7 +4614,11 @@ export type RepoFragmentDashboardFragment = {
46104614
color: string | null;
46114615
iconUrl: string | null;
46124616
} | null;
4613-
collection: { __typename?: 'Collection'; path: string } | null;
4617+
collection: {
4618+
__typename?: 'Collection';
4619+
path: string;
4620+
id: any | null;
4621+
} | null;
46144622
permissions: {
46154623
__typename?: 'SandboxProtectionSettings';
46164624
preventSandboxLeaving: boolean;
@@ -4676,7 +4684,11 @@ export type TemplateFragmentDashboardFragment = {
46764684
color: string | null;
46774685
iconUrl: string | null;
46784686
} | null;
4679-
collection: { __typename?: 'Collection'; path: string } | null;
4687+
collection: {
4688+
__typename?: 'Collection';
4689+
path: string;
4690+
id: any | null;
4691+
} | null;
46804692
permissions: {
46814693
__typename?: 'SandboxProtectionSettings';
46824694
preventSandboxLeaving: boolean;
@@ -5133,7 +5145,11 @@ export type AddToFolderMutation = {
51335145
color: string | null;
51345146
iconUrl: string | null;
51355147
} | null;
5136-
collection: { __typename?: 'Collection'; path: string } | null;
5148+
collection: {
5149+
__typename?: 'Collection';
5150+
path: string;
5151+
id: any | null;
5152+
} | null;
51375153
permissions: {
51385154
__typename?: 'SandboxProtectionSettings';
51395155
preventSandboxLeaving: boolean;
@@ -5182,7 +5198,11 @@ export type MoveToTrashMutation = {
51825198
color: string | null;
51835199
iconUrl: string | null;
51845200
} | null;
5185-
collection: { __typename?: 'Collection'; path: string } | null;
5201+
collection: {
5202+
__typename?: 'Collection';
5203+
path: string;
5204+
id: any | null;
5205+
} | null;
51865206
permissions: {
51875207
__typename?: 'SandboxProtectionSettings';
51885208
preventSandboxLeaving: boolean;
@@ -5232,7 +5252,11 @@ export type ChangePrivacyMutation = {
52325252
color: string | null;
52335253
iconUrl: string | null;
52345254
} | null;
5235-
collection: { __typename?: 'Collection'; path: string } | null;
5255+
collection: {
5256+
__typename?: 'Collection';
5257+
path: string;
5258+
id: any | null;
5259+
} | null;
52365260
permissions: {
52375261
__typename?: 'SandboxProtectionSettings';
52385262
preventSandboxLeaving: boolean;
@@ -5282,7 +5306,11 @@ export type ChangeFrozenMutation = {
52825306
color: string | null;
52835307
iconUrl: string | null;
52845308
} | null;
5285-
collection: { __typename?: 'Collection'; path: string } | null;
5309+
collection: {
5310+
__typename?: 'Collection';
5311+
path: string;
5312+
id: any | null;
5313+
} | null;
52865314
permissions: {
52875315
__typename?: 'SandboxProtectionSettings';
52885316
preventSandboxLeaving: boolean;
@@ -5332,7 +5360,11 @@ export type _RenameSandboxMutation = {
53325360
color: string | null;
53335361
iconUrl: string | null;
53345362
} | null;
5335-
collection: { __typename?: 'Collection'; path: string } | null;
5363+
collection: {
5364+
__typename?: 'Collection';
5365+
path: string;
5366+
id: any | null;
5367+
} | null;
53365368
permissions: {
53375369
__typename?: 'SandboxProtectionSettings';
53385370
preventSandboxLeaving: boolean;
@@ -5753,6 +5785,16 @@ export type SetTeamMetadataMutation = {
57535785
ubbBeta: boolean;
57545786
friendOfCsb: boolean;
57555787
};
5788+
limits: {
5789+
__typename?: 'TeamLimits';
5790+
includedPublicSandboxes: number;
5791+
includedPrivateSandboxes: number;
5792+
};
5793+
usage: {
5794+
__typename?: 'TeamUsage';
5795+
publicSandboxesQuantity: number;
5796+
privateSandboxesQuantity: number;
5797+
};
57565798
};
57575799
};
57585800

@@ -5809,7 +5851,11 @@ export type RecentlyDeletedTeamSandboxesQuery = {
58095851
color: string | null;
58105852
iconUrl: string | null;
58115853
} | null;
5812-
collection: { __typename?: 'Collection'; path: string } | null;
5854+
collection: {
5855+
__typename?: 'Collection';
5856+
path: string;
5857+
id: any | null;
5858+
} | null;
58135859
permissions: {
58145860
__typename?: 'SandboxProtectionSettings';
58155861
preventSandboxLeaving: boolean;
@@ -5873,7 +5919,11 @@ export type SandboxesByPathQuery = {
58735919
color: string | null;
58745920
iconUrl: string | null;
58755921
} | null;
5876-
collection: { __typename?: 'Collection'; path: string } | null;
5922+
collection: {
5923+
__typename?: 'Collection';
5924+
path: string;
5925+
id: any | null;
5926+
} | null;
58775927
permissions: {
58785928
__typename?: 'SandboxProtectionSettings';
58795929
preventSandboxLeaving: boolean;
@@ -5929,7 +5979,11 @@ export type TeamDraftsQuery = {
59295979
color: string | null;
59305980
iconUrl: string | null;
59315981
} | null;
5932-
collection: { __typename?: 'Collection'; path: string } | null;
5982+
collection: {
5983+
__typename?: 'Collection';
5984+
path: string;
5985+
id: any | null;
5986+
} | null;
59335987
permissions: {
59345988
__typename?: 'SandboxProtectionSettings';
59355989
preventSandboxLeaving: boolean;
@@ -6018,7 +6072,11 @@ export type GetTeamReposQuery = {
60186072
color: string | null;
60196073
iconUrl: string | null;
60206074
} | null;
6021-
collection: { __typename?: 'Collection'; path: string } | null;
6075+
collection: {
6076+
__typename?: 'Collection';
6077+
path: string;
6078+
id: any | null;
6079+
} | null;
60226080
permissions: {
60236081
__typename?: 'SandboxProtectionSettings';
60246082
preventSandboxLeaving: boolean;
@@ -6092,7 +6150,11 @@ export type TeamTemplatesQuery = {
60926150
color: string | null;
60936151
iconUrl: string | null;
60946152
} | null;
6095-
collection: { __typename?: 'Collection'; path: string } | null;
6153+
collection: {
6154+
__typename?: 'Collection';
6155+
path: string;
6156+
id: any | null;
6157+
} | null;
60966158
permissions: {
60976159
__typename?: 'SandboxProtectionSettings';
60986160
preventSandboxLeaving: boolean;
@@ -6216,7 +6278,11 @@ export type _SearchTeamSandboxesQuery = {
62166278
color: string | null;
62176279
iconUrl: string | null;
62186280
} | null;
6219-
collection: { __typename?: 'Collection'; path: string } | null;
6281+
collection: {
6282+
__typename?: 'Collection';
6283+
path: string;
6284+
id: any | null;
6285+
} | null;
62206286
permissions: {
62216287
__typename?: 'SandboxProtectionSettings';
62226288
preventSandboxLeaving: boolean;
@@ -6270,7 +6336,11 @@ export type RecentlyAccessedSandboxesQuery = {
62706336
color: string | null;
62716337
iconUrl: string | null;
62726338
} | null;
6273-
collection: { __typename?: 'Collection'; path: string } | null;
6339+
collection: {
6340+
__typename?: 'Collection';
6341+
path: string;
6342+
id: any | null;
6343+
} | null;
62746344
permissions: {
62756345
__typename?: 'SandboxProtectionSettings';
62766346
preventSandboxLeaving: boolean;
@@ -6353,7 +6423,11 @@ export type SharedWithMeSandboxesQuery = {
63536423
color: string | null;
63546424
iconUrl: string | null;
63556425
} | null;
6356-
collection: { __typename?: 'Collection'; path: string } | null;
6426+
collection: {
6427+
__typename?: 'Collection';
6428+
path: string;
6429+
id: any | null;
6430+
} | null;
63576431
permissions: {
63586432
__typename?: 'SandboxProtectionSettings';
63596433
preventSandboxLeaving: boolean;
@@ -6943,7 +7017,11 @@ export type TeamSidebarDataQuery = {
69437017
color: string | null;
69447018
iconUrl: string | null;
69457019
} | null;
6946-
collection: { __typename?: 'Collection'; path: string } | null;
7020+
collection: {
7021+
__typename?: 'Collection';
7022+
path: string;
7023+
id: any | null;
7024+
} | null;
69477025
permissions: {
69487026
__typename?: 'SandboxProtectionSettings';
69497027
preventSandboxLeaving: boolean;

packages/app/src/app/overmind/effects/gql/dashboard/fragments.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export const sandboxFragmentDashboard = gql`
3838
3939
collection {
4040
path
41+
id
4142
}
4243
4344
authorId

packages/app/src/app/overmind/namespaces/editor/actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ export const forkExternalSandbox = async (
766766
customVMTier?: number;
767767
redirectAfterFork?: boolean;
768768
body?: {
769-
collectionId: string;
769+
collectionId?: string;
770770
alias?: string;
771771
v2?: boolean;
772772
title?: string;

packages/app/src/app/pages/Dashboard/Components/Selection/ContextMenus/SandboxMenu.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ export const SandboxMenu: React.FC<SandboxMenuProps> = ({
156156
openInNewWindow: true,
157157
hasBetaEditorExperiment,
158158
redirectAfterFork: true,
159+
body: {
160+
privacy: sandbox.draft ? 2 : (sandbox.privacy as 2 | 1 | 0),
161+
collectionId: sandbox.draft ? undefined : sandbox.collection.id,
162+
},
159163
});
160164
}}
161165
disabled={restrictedFork}

0 commit comments

Comments
 (0)