Remove cloud projects feature flag (#4673)

Don't show in changelog
This commit is contained in:
AlexandreS
2022-12-12 17:37:09 +01:00
committed by GitHub
parent 52742cfa10
commit 40fb6e4874
5 changed files with 16 additions and 89 deletions

View File

@@ -30,7 +30,6 @@ import CloudStorageProvider from './ProjectsStorage/CloudStorageProvider';
import UrlStorageProvider from './ProjectsStorage/UrlStorageProvider';
import LocalResourceMover from './ProjectsStorage/ResourceMover/LocalResourceMover';
import LocalResourceFetcher from './ProjectsStorage/ResourceFetcher/LocalResourceFetcher';
import FakeCloudStorageProvider from './ProjectsStorage/FakeCloudStorageProvider';
const gd: libGDevelop = global.gd;
@@ -40,10 +39,6 @@ export const create = (authentication: Authentication) => {
const appArguments = Window.getArguments();
const isDev = Window.isDev();
// Search "activate cloud projects" in the codebase for everything to
// remove once cloud projects are activated for the desktop app.
const supportsCloudProjects = Window.isDev();
return (
<Providers
authentication={authentication}
@@ -58,9 +53,7 @@ export const create = (authentication: Authentication) => {
storageProviders={[
LocalFileStorageProvider,
UrlStorageProvider,
supportsCloudProjects
? CloudStorageProvider
: FakeCloudStorageProvider,
CloudStorageProvider,
]}
defaultStorageProvider={LocalFileStorageProvider}
>

View File

@@ -8,24 +8,16 @@ import AlertMessage from '../../../../UI/AlertMessage';
import { Line, Column } from '../../../../UI/Grid';
import { type Limits } from '../../../../Utils/GDevelopServices/Usage';
import { type AuthenticatedUser } from '../../../../Profile/AuthenticatedUserContext';
import Window from '../../../../Utils/Window';
import optionalRequire from '../../../../Utils/OptionalRequire';
const electron = optionalRequire('electron');
type Props = {|
onUpgrade: () => void,
limits: Limits,
|};
// Search "activate cloud projects" in the codebase for everything to
// remove once cloud projects are activated for the desktop app.
const supportsCloudProjects = !electron || Window.isDev();
export const checkIfHasTooManyCloudProjects = (
authenticatedUser: AuthenticatedUser
) => {
if (!authenticatedUser.authenticated) return false;
if (!supportsCloudProjects) return false;
const { limits, cloudProjects } = authenticatedUser;

View File

@@ -48,7 +48,6 @@ import { type WidthType } from '../../../../UI/Reponsive/ResponsiveWindowMeasure
import Add from '../../../../UI/CustomSvgIcons/Add';
import ImageTileRow from '../../../../UI/ImageTileRow';
import { prepareExamples } from '../../../../AssetStore/ExampleStore';
import Window from '../../../../Utils/Window';
import Skeleton from '@material-ui/lab/Skeleton';
import BackgroundText from '../../../../UI/BackgroundText';
import Paper from '../../../../UI/Paper';
@@ -160,10 +159,6 @@ const BuildSection = React.forwardRef<Props, BuildSectionInterface>(
const windowWidth = useResponsiveWindowWidth();
const forceUpdate = useForceUpdate();
// Search "activate cloud projects" in the codebase for everything to
// remove once cloud projects are activated for the desktop app.
const supportsCloudProjects = !electron || Window.isDev();
const iconClasses = useStylesForListItemIcon();
React.useImperativeHandle(ref, () => ({
@@ -174,8 +169,7 @@ const BuildSection = React.forwardRef<Props, BuildSectionInterface>(
file => file.fileMetadata
);
// Show cloud projects on the web app only.
if (supportsCloudProjects && cloudProjects) {
if (cloudProjects) {
projectFiles = projectFiles.concat(
cloudProjects
.map(cloudProject => {

View File

@@ -1,46 +0,0 @@
// @flow
import { t } from '@lingui/macro';
import * as React from 'react';
import Cloud from '../../UI/CustomSvgIcons/Cloud';
import {
type StorageProvider,
type FileMetadata,
type SaveAsLocation,
} from '../index';
/**
* A storage that is announcing the upcoming Cloud storage on the desktop app.
*/
const FakeCloudStorageProvider = ({
internalName: 'FakeCloud',
name: t`GDevelop cloud storage (coming soon)`,
disabled: true,
renderIcon: props => <Cloud fontSize={props.size} />,
onRenderNewProjectSaveAsLocationChooser: () => null,
createOperations: () => {
return {
doesInitialOpenRequireUserInteraction: true,
onOpen: (
fileMetadata: FileMetadata
): Promise<{|
content: Object,
|}> => {
return Promise.reject(new Error('Unimplemented'));
},
onOpenWithPicker: (): Promise<?FileMetadata> => {
return Promise.reject(new Error('Unimplemented'));
},
onSaveProject: (project: gdProject, fileMetadata: FileMetadata) => {
return Promise.reject(new Error('Unimplemented'));
},
onSaveProjectAs: (
project: gdProject,
saveAsLocation: ?SaveAsLocation
) => {
return Promise.reject(new Error('Unimplemented'));
},
};
},
}: StorageProvider);
export default FakeCloudStorageProvider;

View File

@@ -46,10 +46,6 @@ const ResourceStoreChooser = ({
);
};
// Search "activate cloud projects" in the codebase for everything to
// remove once cloud projects are activated for the desktop app.
const supportsCloudProjects = Window.isDev();
const localResourceSources: Array<ResourceSource> = [
// Have the local resource sources first, so they are used by default/shown first when
// the project is saved locally.
@@ -151,22 +147,20 @@ const localResourceSources: Array<ResourceSource> = [
// Have the "asset store" source before the "file(s) from your device" source,
// for cloud projects, so that the asset store is opened by default when clicking
// on a button without opening a menu showing all sources.
...(supportsCloudProjects
? allResourceKindsAndMetadata.map(({ kind, createNewResource }) => ({
name: `resource-store-${kind}`,
displayName: t`Choose from asset store`,
displayTab: 'standalone',
kind,
renderComponent: (props: ResourceSourceComponentProps) => (
<ResourceStoreChooser
createNewResource={createNewResource}
onChooseResources={props.onChooseResources}
options={props.options}
key={`resource-store-${kind}`}
/>
),
}))
: []),
...allResourceKindsAndMetadata.map(({ kind, createNewResource }) => ({
name: `resource-store-${kind}`,
displayName: t`Choose from asset store`,
displayTab: 'standalone',
kind,
renderComponent: (props: ResourceSourceComponentProps) => (
<ResourceStoreChooser
createNewResource={createNewResource}
onChooseResources={props.onChooseResources}
options={props.options}
key={`resource-store-${kind}`}
/>
),
})),
...allResourceKindsAndMetadata.map(({ kind, createNewResource }) => ({
name: `upload-${kind}`,
displayName: t`File(s) from your device`,