Skip to content

Commit 1f0844b

Browse files
Merge pull request #11451 from linode/staging
Release v1.133.2 - staging → master
2 parents b00ed18 + 5b0c1fc commit 1f0844b

File tree

9 files changed

+48
-23
lines changed

9 files changed

+48
-23
lines changed

packages/manager/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [2024-12-20] - v1.133.2
8+
9+
### Fixed:
10+
11+
- Incorrectly displayed region options ([#11449](https://github.com/linode/manager/pull/11449))
12+
13+
714
## [2024-12-19] - v1.133.1
815

916
### Fixed:

packages/manager/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "linode-manager",
33
"author": "Linode",
44
"description": "The Linode Manager website",
5-
"version": "1.133.1",
5+
"version": "1.133.2",
66
"private": true,
77
"type": "module",
88
"bugs": {

packages/manager/src/components/RegionSelect/RegionMultiSelect.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import CloseIcon from '@mui/icons-material/Close';
33
import React from 'react';
44

55
import { Flag } from 'src/components/Flag';
6-
import { useIsObjectStorageGen2Enabled } from 'src/features/ObjectStorage/hooks/useIsObjectStorageGen2Enabled';
76
import { useAllAccountAvailabilitiesQuery } from 'src/queries/account/availability';
87
import { getRegionCountryGroup } from 'src/utilities/formatRegion';
98

@@ -38,6 +37,7 @@ export const RegionMultiSelect = React.memo((props: RegionMultiSelectProps) => {
3837
disabled,
3938
disabledRegions: disabledRegionsFromProps,
4039
errorText,
40+
forcefullyShownRegionIds,
4141
helperText,
4242
isClearable,
4343
label,
@@ -51,16 +51,14 @@ export const RegionMultiSelect = React.memo((props: RegionMultiSelectProps) => {
5151
...rest
5252
} = props;
5353

54-
const { isObjectStorageGen2Enabled } = useIsObjectStorageGen2Enabled();
55-
5654
const {
5755
data: accountAvailability,
5856
isLoading: accountAvailabilityLoading,
5957
} = useAllAccountAvailabilitiesQuery();
6058

6159
const regionOptions = getRegionOptions({
6260
currentCapability,
63-
isObjectStorageGen2Enabled,
61+
forcefullyShownRegionIds,
6462
regions,
6563
});
6664

packages/manager/src/components/RegionSelect/RegionSelect.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import * as React from 'react';
44

55
import { Flag } from 'src/components/Flag';
66
import { useIsGeckoEnabled } from 'src/components/RegionSelect/RegionSelect.utils';
7-
import { useIsObjectStorageGen2Enabled } from 'src/features/ObjectStorage/hooks/useIsObjectStorageGen2Enabled';
87
import { useAllAccountAvailabilitiesQuery } from 'src/queries/account/availability';
98
import { getRegionCountryGroup } from 'src/utilities/formatRegion';
109

@@ -39,6 +38,7 @@ export const RegionSelect = <
3938
disabled,
4039
disabledRegions: disabledRegionsFromProps,
4140
errorText,
41+
forcefullyShownRegionIds,
4242
helperText,
4343
ignoreAccountAvailability,
4444
label,
@@ -54,7 +54,6 @@ export const RegionSelect = <
5454
} = props;
5555

5656
const { isGeckoLAEnabled } = useIsGeckoEnabled();
57-
const { isObjectStorageGen2Enabled } = useIsObjectStorageGen2Enabled();
5857

5958
const {
6059
data: accountAvailability,
@@ -63,7 +62,7 @@ export const RegionSelect = <
6362

6463
const regionOptions = getRegionOptions({
6564
currentCapability,
66-
isObjectStorageGen2Enabled,
65+
forcefullyShownRegionIds,
6766
regionFilter,
6867
regions,
6968
});

packages/manager/src/components/RegionSelect/RegionSelect.types.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ export interface RegionSelectProps<
3838
* A key/value object for disabling regions by their ID.
3939
*/
4040
disabledRegions?: Record<string, DisableItemOption>;
41+
/**
42+
* Used to override filtering done by the `currentCapability` prop
43+
* @todo Remove this after Object Storage Gen2.
44+
*/
45+
forcefullyShownRegionIds?: Set<string>;
4146
helperText?: string;
4247
/**
4348
* Ignores account availability information when rendering region options
@@ -67,6 +72,11 @@ export interface RegionMultiSelectProps
6772
}>;
6873
currentCapability: Capabilities | undefined;
6974
disabledRegions?: Record<string, DisableItemOption>;
75+
/**
76+
* Used to override filtering done by the `currentCapability` prop
77+
* @todo Remove this after Object Storage Gen2.
78+
*/
79+
forcefullyShownRegionIds?: Set<string>;
7080
helperText?: string;
7181
isClearable?: boolean;
7282
label?: string;

packages/manager/src/components/RegionSelect/RegionSelect.utils.tsx

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,20 @@ const NORTH_AMERICA = CONTINENT_CODE_TO_CONTINENT.NA;
1515

1616
interface RegionSelectOptionsOptions {
1717
currentCapability: Capabilities | undefined;
18-
/**
19-
* @TODO: This is a temporary property to gate the whitelisted regions to Gen2 users
20-
*/
21-
isObjectStorageGen2Enabled?: boolean;
18+
forcefullyShownRegionIds?: Set<string>;
2219
regionFilter?: RegionFilterValue;
2320
regions: Region[];
2421
}
2522

26-
// @TODO: OBJ Gen2: This should be removed once these regions obtain the `Object Storage` capability.
27-
const WHITELISTED_REGIONS = new Set([
28-
'gb-lon',
29-
'au-mel',
30-
'in-bom-2',
31-
'de-fra-2',
32-
'sg-sin-2',
33-
]);
34-
3523
export const getRegionOptions = ({
3624
currentCapability,
37-
isObjectStorageGen2Enabled,
25+
forcefullyShownRegionIds,
3826
regionFilter,
3927
regions,
4028
}: RegionSelectOptionsOptions) => {
4129
return regions
4230
.filter((region) => {
43-
if (isObjectStorageGen2Enabled && WHITELISTED_REGIONS.has(region.id)) {
31+
if (forcefullyShownRegionIds?.has(region.id)) {
4432
return true;
4533
}
4634

packages/manager/src/features/ObjectStorage/AccessKeyLanding/AccessKeyRegions/AccessKeyRegions.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { useObjectStorageRegions } from 'src/features/ObjectStorage/hooks/useObj
55
import { sortByString } from 'src/utilities/sort-by';
66

77
import type { Region } from '@linode/api-v4';
8+
import { useIsObjectStorageGen2Enabled } from '../../hooks/useIsObjectStorageGen2Enabled';
9+
import { WHITELISTED_REGIONS } from '../../utilities';
810

911
interface Props {
1012
disabled?: boolean;
@@ -27,11 +29,16 @@ export const AccessKeyRegions = (props: Props) => {
2729
availableStorageRegions,
2830
} = useObjectStorageRegions();
2931

32+
const { isObjectStorageGen2Enabled } = useIsObjectStorageGen2Enabled();
33+
3034
// Error could be: 1. General Regions error, 2. Field error, 3. Nothing
3135
const errorText = error || allRegionsError?.[0]?.reason;
3236

3337
return (
3438
<RegionMultiSelect
39+
forcefullyShownRegionIds={
40+
isObjectStorageGen2Enabled ? WHITELISTED_REGIONS : undefined
41+
}
3542
placeholder={
3643
selectedRegion.length > 0 ? '' : 'Select regions or type to search'
3744
}

packages/manager/src/features/ObjectStorage/BucketLanding/BucketRegions.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import * as React from 'react';
22

33
import { RegionSelect } from 'src/components/RegionSelect/RegionSelect';
44
import { useObjectStorageRegions } from 'src/features/ObjectStorage/hooks/useObjectStorageRegions';
5+
import { useIsObjectStorageGen2Enabled } from '../hooks/useIsObjectStorageGen2Enabled';
6+
import { WHITELISTED_REGIONS } from '../utilities';
57

68
interface Props {
79
disabled?: boolean;
@@ -20,11 +22,16 @@ export const BucketRegions = (props: Props) => {
2022
availableStorageRegions,
2123
} = useObjectStorageRegions();
2224

25+
const { isObjectStorageGen2Enabled } = useIsObjectStorageGen2Enabled();
26+
2327
// Error could be: 1. General Regions error, 2. Field error, 3. Nothing
2428
const errorText = error || allRegionsError?.[0]?.reason;
2529

2630
return (
2731
<RegionSelect
32+
forcefullyShownRegionIds={
33+
isObjectStorageGen2Enabled ? WHITELISTED_REGIONS : undefined
34+
}
2835
currentCapability="Object Storage"
2936
disableClearable
3037
disabled={disabled}

packages/manager/src/features/ObjectStorage/utilities.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,15 @@ export const objectACLHelperText: Record<ACLType, string> = {
172172
'public-read-write': 'Public Read/Write ACL',
173173
};
174174

175+
// @TODO: OBJ Gen2: This should be removed once these regions obtain the `Object Storage` capability.
176+
export const WHITELISTED_REGIONS = new Set([
177+
'gb-lon',
178+
'au-mel',
179+
'in-bom-2',
180+
'de-fra-2',
181+
'sg-sin-2',
182+
]);
183+
175184
/**
176185
* For OBJ Gen2 users, filter regions based on available Object Storage endpoints.
177186
* Otherwise, we return the regions as is.

0 commit comments

Comments
 (0)