From b8478640a44efd8996d8bceddf6ce87a53348afd Mon Sep 17 00:00:00 2001 From: Alban Bailly <130582365+abailly-akamai@users.noreply.github.com> Date: Tue, 6 Feb 2024 11:19:15 -0500 Subject: [PATCH] Tech Story: [M3-7360] - DC Get Well - Cleanup/Remove feature flag logic (#10146) * Cleanup feature flag data * Added changeset: DC Get Well - Cleanup/Remove feature flag logic --- .../.changeset/pr-10146-tech-stories-1707162412490.md | 5 +++++ .../src/components/RegionSelect/RegionMultiSelect.tsx | 8 ++------ .../manager/src/components/RegionSelect/RegionOption.tsx | 5 +---- .../manager/src/components/RegionSelect/RegionSelect.tsx | 8 ++------ packages/manager/src/dev-tools/FeatureFlagTool.tsx | 1 - packages/manager/src/featureFlags.ts | 1 - 6 files changed, 10 insertions(+), 18 deletions(-) create mode 100644 packages/manager/.changeset/pr-10146-tech-stories-1707162412490.md diff --git a/packages/manager/.changeset/pr-10146-tech-stories-1707162412490.md b/packages/manager/.changeset/pr-10146-tech-stories-1707162412490.md new file mode 100644 index 00000000000..8e5fc42a957 --- /dev/null +++ b/packages/manager/.changeset/pr-10146-tech-stories-1707162412490.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Tech Stories +--- + +DC Get Well - Cleanup/Remove feature flag logic ([#10146](https://github.com/linode/manager/pull/10146)) diff --git a/packages/manager/src/components/RegionSelect/RegionMultiSelect.tsx b/packages/manager/src/components/RegionSelect/RegionMultiSelect.tsx index b9acc2d0a1e..4b37ee42435 100644 --- a/packages/manager/src/components/RegionSelect/RegionMultiSelect.tsx +++ b/packages/manager/src/components/RegionSelect/RegionMultiSelect.tsx @@ -2,7 +2,6 @@ import React, { useEffect, useMemo, useState } from 'react'; import { Autocomplete } from 'src/components/Autocomplete/Autocomplete'; import { StyledListItem } from 'src/components/Autocomplete/Autocomplete.styles'; -import { useFlags } from 'src/hooks/useFlags'; import { useAccountAvailabilitiesQueryUnpaginated } from 'src/queries/accountAvailability'; import { RegionOption } from './RegionOption'; @@ -36,11 +35,10 @@ export const RegionMultiSelect = React.memo((props: RegionMultiSelectProps) => { width, } = props; - const flags = useFlags(); const { data: accountAvailability, isLoading: accountAvailabilityLoading, - } = useAccountAvailabilitiesQueryUnpaginated(flags.dcGetWell); + } = useAccountAvailabilitiesQueryUnpaginated(); const [selectedRegions, setSelectedRegions] = useState( getSelectedRegionsByIds({ @@ -93,9 +91,6 @@ export const RegionMultiSelect = React.memo((props: RegionMultiSelectProps) => { <> - Boolean(flags.dcGetWell) && Boolean(option.unavailable) - } groupBy={(option: RegionSelectOption) => { return option?.data?.region; }} @@ -134,6 +129,7 @@ export const RegionMultiSelect = React.memo((props: RegionMultiSelectProps) => { disableClearable={!isClearable} disabled={disabled} errorText={errorText} + getOptionDisabled={(option: RegionSelectOption) => option.unavailable} label={label ?? 'Regions'} loading={accountAvailabilityLoading} multiple diff --git a/packages/manager/src/components/RegionSelect/RegionOption.tsx b/packages/manager/src/components/RegionSelect/RegionOption.tsx index 5b4279666b5..38fe2feaccd 100644 --- a/packages/manager/src/components/RegionSelect/RegionOption.tsx +++ b/packages/manager/src/components/RegionSelect/RegionOption.tsx @@ -5,7 +5,6 @@ import { Box } from 'src/components/Box'; import { Flag } from 'src/components/Flag'; import { Link } from 'src/components/Link'; import { Tooltip } from 'src/components/Tooltip'; -import { useFlags } from 'src/hooks/useFlags'; import { SelectedIcon, @@ -23,9 +22,7 @@ type Props = { }; export const RegionOption = ({ option, props, selected }: Props) => { - const flags = useFlags(); - const isDisabledMenuItem = - Boolean(flags.dcGetWell) && Boolean(option.unavailable); + const isDisabledMenuItem = option.unavailable; return ( { width, } = props; - const flags = useFlags(); const { data: accountAvailability, isLoading: accountAvailabilityLoading, - } = useAccountAvailabilitiesQueryUnpaginated(flags.dcGetWell); + } = useAccountAvailabilitiesQueryUnpaginated(); const regionFromSelectedId: RegionSelectOption | null = getSelectedRegionById({ @@ -84,9 +82,6 @@ export const RegionSelect = React.memo((props: RegionSelectProps) => { return ( - Boolean(flags.dcGetWell) && Boolean(option.unavailable) - } isOptionEqualToValue={( option: RegionSelectOption, { value }: RegionSelectOption @@ -127,6 +122,7 @@ export const RegionSelect = React.memo((props: RegionSelectProps) => { disableClearable={!isClearable} disabled={disabled} errorText={errorText} + getOptionDisabled={(option: RegionSelectOption) => option.unavailable} groupBy={(option: RegionSelectOption) => option.data.region} label={label ?? 'Region'} loading={accountAvailabilityLoading} diff --git a/packages/manager/src/dev-tools/FeatureFlagTool.tsx b/packages/manager/src/dev-tools/FeatureFlagTool.tsx index af174364a63..7a5b7586832 100644 --- a/packages/manager/src/dev-tools/FeatureFlagTool.tsx +++ b/packages/manager/src/dev-tools/FeatureFlagTool.tsx @@ -14,7 +14,6 @@ const MOCK_FEATURE_FLAGS_STORAGE_KEY = 'devTools/mock-feature-flags'; const options: { flag: keyof Flags; label: string }[] = [ { flag: 'aclb', label: 'ACLB' }, { flag: 'aclbFullCreateFlow', label: 'ACLB Full Create Flow' }, - { flag: 'dcGetWell', label: 'DC Get Well' }, { flag: 'linodeCloneUIChanges', label: 'Linode Clone UI Changes' }, { flag: 'metadata', label: 'Metadata' }, { flag: 'parentChildAccountAccess', label: 'Parent/Child Account' }, diff --git a/packages/manager/src/featureFlags.ts b/packages/manager/src/featureFlags.ts index 0c2127f8336..c622dda8443 100644 --- a/packages/manager/src/featureFlags.ts +++ b/packages/manager/src/featureFlags.ts @@ -46,7 +46,6 @@ export interface Flags { databaseBeta: boolean; databaseScaleUp: boolean; databases: boolean; - dcGetWell: boolean; firewallNodebalancer: boolean; ipv6Sharing: boolean; linodeCloneUIChanges: boolean;