Skip to content

Commit

Permalink
refactor: [M3-7736] - Clean up regionDropdown feature flag (#10148)
Browse files Browse the repository at this point in the history
* remove `regionDropdown` feature flag

* Added changeset: Clean up `regionDropdown` feature flag

* improve placeholder @mjac0bs

---------

Co-authored-by: Banks Nussman <banks@nussman.us>
  • Loading branch information
bnussman-akamai and bnussman authored Feb 7, 2024
1 parent 3bb8475 commit c80abf4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tech Stories
---

Clean up `regionDropdown` feature flag ([#10148](https://github.com/linode/manager/pull/10148))
1 change: 0 additions & 1 deletion packages/manager/src/featureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export interface Flags {
promotionalOffers: PromotionalOffer[];
recharts: boolean;
referralBannerText: ReferralBannerText;
regionDropdown: boolean;
selfServeBetas: boolean;
soldOutChips: boolean;
taxBanner: TaxBanner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { ActionsPanel } from 'src/components/ActionsPanel/ActionsPanel';
import EnhancedSelect, { Item } from 'src/components/EnhancedSelect/Select';
import { Notice } from 'src/components/Notice/Notice';
import { TextField } from 'src/components/TextField';
import { useFlags } from 'src/hooks/useFlags';
import { useAccount, useMutateAccount } from 'src/queries/account';
import { useNotificationsQuery } from 'src/queries/accountNotifications';
import { getErrorMap } from 'src/utilities/errorUtils';
Expand All @@ -28,7 +27,6 @@ const UpdateContactInformationForm = ({ focusEmail, onClose }: Props) => {
const { error, isLoading, mutateAsync } = useMutateAccount();
const { data: notifications, refetch } = useNotificationsQuery();
const { classes } = useStyles();
const flags = useFlags();
const emailRef = React.useRef<HTMLInputElement>();

const formik = useFormik({
Expand Down Expand Up @@ -241,15 +239,16 @@ const UpdateContactInformationForm = ({ focusEmail, onClose }: Props) => {
onChange={(item) => formik.setFieldValue('country', item.value)}
options={countryResults}
placeholder="Select a Country"
required={flags.regionDropdown}
required
/>
</Grid>
<Grid sm={6} xs={12}>
{flags.regionDropdown &&
(formik.values.country === 'US' || formik.values.country == 'CA') ? (
{formik.values.country === 'US' || formik.values.country == 'CA' ? (
<EnhancedSelect
placeholder={
formik.values.country === 'US' ? 'state' : 'province'
formik.values.country === 'US'
? 'Enter state'
: 'Enter province'
}
textFieldProps={{
dataAttrs: {
Expand All @@ -266,7 +265,7 @@ const UpdateContactInformationForm = ({ focusEmail, onClose }: Props) => {
label={`${formik.values.country === 'US' ? 'State' : 'Province'}`}
onChange={(item) => formik.setFieldValue('state', item.value)}
options={filteredRegionResults}
required={flags.regionDropdown}
required
/>
) : (
<TextField
Expand All @@ -276,7 +275,7 @@ const UpdateContactInformationForm = ({ focusEmail, onClose }: Props) => {
name="state"
onChange={formik.handleChange}
placeholder="Enter region"
required={flags.regionDropdown}
required
value={formik.values.state}
/>
)}
Expand Down

0 comments on commit c80abf4

Please sign in to comment.