From eac073219a5155d5382fadf3ca3a2e5f41c07d2e Mon Sep 17 00:00:00 2001 From: Ivan Vasilov Date: Thu, 1 Feb 2024 00:17:12 +0100 Subject: [PATCH] fix: Enable APSE (#20909) * Revert some of the changes in 20982 and 20987. * The default env for staging should be Singapore. --- .../interfaces/ProjectCreation/RegionSelector.tsx | 3 --- .../InstanceConfiguration.constants.ts | 3 +-- apps/studio/lib/constants/infrastructure.ts | 11 ++--------- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsx b/apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsx index e82d80bdb14..dc0e81b0deb 100644 --- a/apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsx +++ b/apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsx @@ -31,9 +31,6 @@ export const RegionSelector = ({ useEffect(() => { // only pick a region if one hasn't already been selected if (isSuccess && region && !selectedRegion) { - // [Joshen] TEMP FIX BLOCK APSE 1 ON PROD - if (process.env.NEXT_PUBLIC_ENVIRONMENT === 'prod' && region === 'Southeast Asia (Singapore)') - return onSelectRegion(region) } else if (isError && !selectedRegion) { // if an error happened, and the user haven't selected a region, just select the default one for him diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.constants.ts b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.constants.ts index bebc7fd92fd..38b928c56af 100644 --- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.constants.ts +++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.constants.ts @@ -54,8 +54,7 @@ export const AVAILABLE_REPLICA_REGIONS: Region[] = Object.keys(AWS_REGIONS) .map((key) => { return { key: key as AWS_REGIONS_KEYS, - // [Joshen] TEMP FIX BLOCK APSE 1 ON PROD, remove ternary - name: AWS_REGIONS?.[key as AWS_REGIONS_KEYS] ?? '', + name: AWS_REGIONS?.[key as AWS_REGIONS_KEYS], region: AWS_REGIONS_VALUES[key], coordinates: AWS_REGIONS_COORDINATES[key], } diff --git a/apps/studio/lib/constants/infrastructure.ts b/apps/studio/lib/constants/infrastructure.ts index 6a795b2ff01..ba8fe0f49dd 100644 --- a/apps/studio/lib/constants/infrastructure.ts +++ b/apps/studio/lib/constants/infrastructure.ts @@ -1,5 +1,4 @@ import { components } from 'data/api' -import { IS_PLATFORM } from '.' export type CloudProvider = 'FLY' | 'AWS' export type Region = typeof AWS_REGIONS | typeof FLY_REGIONS @@ -17,10 +16,7 @@ export const AWS_REGIONS = { // 'North EU': 'North EU', CENTRAL_EU: 'Central EU (Frankfurt)', SOUTH_ASIA: 'South Asia (Mumbai)', - // [Joshen] TEMP FIX BLOCK APSE 1 ON PROD - ...(process.env.NEXT_PUBLIC_ENVIRONMENT !== 'prod' - ? { SOUTHEAST_ASIA: 'Southeast Asia (Singapore)' } - : {}), + SOUTHEAST_ASIA: 'Southeast Asia (Singapore)', NORTHEAST_ASIA: 'Northeast Asia (Tokyo)', NORTHEAST_ASIA_2: 'Northeast Asia (Seoul)', OCEANIA: 'Oceania (Sydney)', @@ -34,11 +30,8 @@ export const FLY_REGIONS = { SOUTHEAST_ASIA: 'Singapore', } as const -// [Joshen] TEMP FIX BLOCK APSE 1 ON PROD, remove as string export const AWS_REGIONS_DEFAULT = - process.env.NEXT_PUBLIC_ENVIRONMENT !== 'prod' - ? (AWS_REGIONS.SOUTHEAST_ASIA as string) - : AWS_REGIONS.WEST_US + process.env.NEXT_PUBLIC_ENVIRONMENT !== 'prod' ? AWS_REGIONS.SOUTHEAST_ASIA : AWS_REGIONS.WEST_US // TO DO, change default to US region for prod const FLY_REGIONS_DEFAULT = FLY_REGIONS.SOUTHEAST_ASIA