Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export const RegionMultiSelect = React.memo((props: RegionMultiSelectProps) => {
disabled,
disabledRegions: disabledRegionsFromProps,
errorText,
forcefullyShownRegionIds,
helperText,
isClearable,
isGeckoLAEnabled,
Expand All @@ -65,7 +64,6 @@ export const RegionMultiSelect = React.memo((props: RegionMultiSelectProps) => {

const regionOptions = getRegionOptions({
currentCapability,
forcefullyShownRegionIds,
regions,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export const RegionSelect = <
disabled,
disabledRegions: disabledRegionsFromProps,
errorText,
forcefullyShownRegionIds,
helperText,
isGeckoLAEnabled,
label,
Expand All @@ -62,7 +61,6 @@ export const RegionSelect = <

const regionOptions = getRegionOptions({
currentCapability,
forcefullyShownRegionIds,
regionFilter,
regions,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ export interface RegionSelectProps<
* A key/value object for disabling regions by their ID.
*/
disabledRegions?: Record<string, DisableItemOption>;
/**
* Used to override filtering done by the `currentCapability` prop
* @todo Remove this after Object Storage Gen2.
*/
forcefullyShownRegionIds?: Set<string>;
helperText?: string;
/**
* `isGeckoLAEnabled` flag from `useIsGeckoEnabled` hook
Expand Down Expand Up @@ -73,11 +68,6 @@ export interface RegionMultiSelectProps
> {
currentCapability: Capabilities | undefined;
disabledRegions?: Record<string, DisableItemOption>;
/**
* Used to override filtering done by the `currentCapability` prop
* @todo Remove this after Object Storage Gen2.
*/
forcefullyShownRegionIds?: Set<string>;
helperText?: string;
isClearable?: boolean;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,17 @@ const NORTH_AMERICA = CONTINENT_CODE_TO_CONTINENT.NA;

interface RegionSelectOptions {
currentCapability: Capabilities | undefined;
forcefullyShownRegionIds?: Set<string>;
regionFilter?: RegionFilterValue;
regions: Region[];
}

export const getRegionOptions = ({
currentCapability,
forcefullyShownRegionIds,
regionFilter,
regions,
}: RegionSelectOptions) => {
return regions
.filter((region) => {
if (forcefullyShownRegionIds?.has(region.id)) {
return true;
}

if (
currentCapability &&
!region.capabilities.includes(currentCapability)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import { RegionMultiSelect } from 'src/components/RegionSelect/RegionMultiSelect
import { useObjectStorageRegions } from 'src/features/ObjectStorage/hooks/useObjectStorageRegions';
import { useFlags } from 'src/hooks/useFlags';

import { useIsObjectStorageGen2Enabled } from '../../hooks/useIsObjectStorageGen2Enabled';
import { WHITELISTED_REGIONS } from '../../utilities';

import type { Region } from '@linode/api-v4';

interface Props {
Expand All @@ -35,8 +32,6 @@ export const AccessKeyRegions = (props: Props) => {
const { allRegionsError, availableStorageRegions } =
useObjectStorageRegions();

const { isObjectStorageGen2Enabled } = useIsObjectStorageGen2Enabled();

// Error could be: 1. General Regions error, 2. Field error, 3. Nothing
const errorText = error || allRegionsError?.[0]?.reason;

Expand All @@ -45,9 +40,6 @@ export const AccessKeyRegions = (props: Props) => {
currentCapability="Object Storage"
disabled={disabled}
errorText={errorText}
forcefullyShownRegionIds={
isObjectStorageGen2Enabled ? WHITELISTED_REGIONS : undefined
}
isClearable={false}
isGeckoLAEnabled={isGeckoLAEnabled}
label="Regions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import { RegionSelect } from 'src/components/RegionSelect/RegionSelect';
import { useObjectStorageRegions } from 'src/features/ObjectStorage/hooks/useObjectStorageRegions';
import { useFlags } from 'src/hooks/useFlags';

import { useIsObjectStorageGen2Enabled } from '../hooks/useIsObjectStorageGen2Enabled';
import { WHITELISTED_REGIONS } from '../utilities';

interface Props {
disabled?: boolean;
error?: string;
Expand All @@ -23,8 +20,6 @@ export const BucketRegions = (props: Props) => {
const { allRegionsError, availableStorageRegions } =
useObjectStorageRegions();

const { isObjectStorageGen2Enabled } = useIsObjectStorageGen2Enabled();

const flags = useFlags();
const { isGeckoLAEnabled } = useIsGeckoEnabled(
flags.gecko2?.enabled,
Expand All @@ -40,9 +35,6 @@ export const BucketRegions = (props: Props) => {
disableClearable
disabled={disabled}
errorText={errorText}
forcefullyShownRegionIds={
isObjectStorageGen2Enabled ? WHITELISTED_REGIONS : undefined
}
isGeckoLAEnabled={isGeckoLAEnabled}
label="Region"
onBlur={onBlur}
Expand Down
9 changes: 0 additions & 9 deletions packages/manager/src/features/ObjectStorage/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,6 @@ export const objectACLHelperText: Record<string, string> = {
'public-read-write': 'Public Read/Write ACL',
};

// @TODO: OBJ Gen2: This should be removed once these regions obtain the `Object Storage` capability.
export const WHITELISTED_REGIONS = new Set([
'gb-lon',
'au-mel',
'in-bom-2',
'de-fra-2',
'sg-sin-2',
]);

/**
* For OBJ Gen2 users, filter regions based on available Object Storage endpoints.
* Otherwise, we return the regions as is.
Expand Down