Skip to content

Commit

Permalink
upcoming: [M3-8062] - Replace PG feature flag restriction with `useIs…
Browse files Browse the repository at this point in the history
…PlacementGroupsEnabled` (#10431)

* upcoming: [M3-8062] - Replace PG feature flag restriction with useIsPlacementGroupsEnabled

* Add changeset
  • Loading branch information
carrillo-erik authored May 2, 2024
1 parent 96a4051 commit 429c01c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Replace remaining feature flag implementation with useIsPlacementGroupsEnabled utility function ([#10431](https://github.com/linode/manager/pull/10431))
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { RegionSelect } from 'src/components/RegionSelect/RegionSelect';
import { sxEdgeIcon } from 'src/components/RegionSelect/RegionSelect.styles';
import { TooltipIcon } from 'src/components/TooltipIcon';
import { Typography } from 'src/components/Typography';
import { useIsPlacementGroupsEnabled } from 'src/features/PlacementGroups/utils';
import { useFlags } from 'src/hooks/useFlags';
import { useRegionsQuery } from 'src/queries/regions/regions';
import { useTypeQuery } from 'src/queries/types';
Expand Down Expand Up @@ -57,7 +58,7 @@ export const ConfigureForm = React.memo((props: Props) => {
} = props;

const flags = useFlags();
const showPlacementGroups = Boolean(flags.placementGroups?.enabled);
const { isPlacementGroupsEnabled } = useIsPlacementGroupsEnabled();
const { data: regions } = useRegionsQuery();

const { data: currentLinodeType } = useTypeQuery(
Expand Down Expand Up @@ -194,7 +195,7 @@ export const ConfigureForm = React.memo((props: Props) => {
{...panelPrice(selectedRegion, selectedRegionPrice, 'new')}
/>
)}
{showPlacementGroups && (
{isPlacementGroupsEnabled && (
<PlacementGroupsSelect
handlePlacementGroupChange={(placementGroup) => {
handlePlacementGroupSelection(placementGroup);
Expand Down

0 comments on commit 429c01c

Please sign in to comment.