Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upcoming: [M3-8364] - Use React Hook Form instead of Formik for Create Bucket #10699

Merged
merged 14 commits into from
Jul 27, 2024
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Replaced Formik with React Hook Form for Create Bucket Drawer ([#10699](https://github.com/linode/manager/pull/10699))
4 changes: 2 additions & 2 deletions packages/manager/src/components/PrimaryNav/PrimaryNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import {
} from 'src/queries/objectStorage';
import { useRegionsQuery } from 'src/queries/regions/regions';
import { useMarketplaceAppsQuery } from 'src/queries/stackscripts';
import { isFeatureEnabled } from 'src/utilities/accountCapabilities';
import { isFeatureEnabledV2 } from 'src/utilities/accountCapabilities';

import useStyles from './PrimaryNav.styles';
import { linkIsActive } from './utils';
Expand Down Expand Up @@ -104,7 +104,7 @@ export const PrimaryNav = (props: PrimaryNavProps) => {

const { _isManagedAccount, account } = useAccountManagement();

const isObjMultiClusterEnabled = isFeatureEnabled(
const isObjMultiClusterEnabled = isFeatureEnabledV2(
'Object Storage Access Key Regions',
Boolean(flags.objMultiCluster),
account?.capabilities ?? []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
useObjectStorageClusters,
} from 'src/queries/objectStorage';
import { useRegionsQuery } from 'src/queries/regions/regions';
import { isFeatureEnabled } from 'src/utilities/accountCapabilities';
import { isFeatureEnabledV2 } from 'src/utilities/accountCapabilities';

import { EnableObjectStorageModal } from '../EnableObjectStorageModal';
import { confirmObjectStorage } from '../utilities';
Expand Down Expand Up @@ -98,7 +98,7 @@ export const AccessKeyDrawer = (props: AccessKeyDrawerProps) => {
const flags = useFlags();
const { data: regions } = useRegionsQuery();

const isObjMultiClusterEnabled = isFeatureEnabled(
const isObjMultiClusterEnabled = isFeatureEnabledV2(
'Object Storage Access Key Regions',
Boolean(flags.objMultiCluster),
account?.capabilities ?? []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { useOpenClose } from 'src/hooks/useOpenClose';
import { usePagination } from 'src/hooks/usePagination';
import { useAccountSettings } from 'src/queries/account/settings';
import { useObjectStorageAccessKeys } from 'src/queries/objectStorage';
import { isFeatureEnabled } from 'src/utilities/accountCapabilities';
import { isFeatureEnabledV2 } from 'src/utilities/accountCapabilities';
import {
sendCreateAccessKeyEvent,
sendEditAccessKeyEvent,
Expand Down Expand Up @@ -89,7 +89,7 @@ export const AccessKeyLanding = (props: Props) => {
const flags = useFlags();
const { account } = useAccountManagement();

const isObjMultiClusterEnabled = isFeatureEnabled(
const isObjMultiClusterEnabled = isFeatureEnabledV2(
'Object Storage Access Key Regions',
Boolean(flags.objMultiCluster),
account?.capabilities ?? []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Hidden } from 'src/components/Hidden';
import { InlineMenuAction } from 'src/components/InlineMenuAction/InlineMenuAction';
import { useAccountManagement } from 'src/hooks/useAccountManagement';
import { useFlags } from 'src/hooks/useFlags';
import { isFeatureEnabled } from 'src/utilities/accountCapabilities';
import { isFeatureEnabledV2 } from 'src/utilities/accountCapabilities';

import { OpenAccessDrawer } from '../types';

Expand All @@ -27,7 +27,7 @@ export const AccessKeyActionMenu = ({
const flags = useFlags();
const { account } = useAccountManagement();

const isObjMultiClusterEnabled = isFeatureEnabled(
const isObjMultiClusterEnabled = isFeatureEnabledV2(
'Object Storage Access Key Regions',
Boolean(flags.objMultiCluster),
account?.capabilities ?? []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { TableHead } from 'src/components/TableHead';
import { TableRow } from 'src/components/TableRow';
import { useAccountManagement } from 'src/hooks/useAccountManagement';
import { useFlags } from 'src/hooks/useFlags';
import { isFeatureEnabled } from 'src/utilities/accountCapabilities';
import { isFeatureEnabledV2 } from 'src/utilities/accountCapabilities';

import { HostNamesDrawer } from '../HostNamesDrawer';
import { OpenAccessDrawer } from '../types';
Expand Down Expand Up @@ -46,7 +46,7 @@ export const AccessKeyTable = (props: AccessKeyTableProps) => {
const flags = useFlags();
const { account } = useAccountManagement();

const isObjMultiClusterEnabled = isFeatureEnabled(
const isObjMultiClusterEnabled = isFeatureEnabledV2(
'Object Storage Access Key Regions',
Boolean(flags.objMultiCluster),
account?.capabilities ?? []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { TableRow } from 'src/components/TableRow';
import { Typography } from 'src/components/Typography';
import { useAccountManagement } from 'src/hooks/useAccountManagement';
import { useFlags } from 'src/hooks/useFlags';
import { isFeatureEnabled } from 'src/utilities/accountCapabilities';
import { isFeatureEnabledV2 } from 'src/utilities/accountCapabilities';

import { OpenAccessDrawer } from '../types';
import { AccessKeyActionMenu } from './AccessKeyActionMenu';
Expand All @@ -35,7 +35,7 @@ export const AccessKeyTableRow = ({
const { account } = useAccountManagement();
const flags = useFlags();

const isObjMultiClusterEnabled = isFeatureEnabled(
const isObjMultiClusterEnabled = isFeatureEnabledV2(
'Object Storage Access Key Regions',
Boolean(flags.objMultiCluster),
account?.capabilities ?? []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TooltipIcon } from 'src/components/TooltipIcon';
import { Typography } from 'src/components/Typography';
import { useAccountManagement } from 'src/hooks/useAccountManagement';
import { useFlags } from 'src/hooks/useFlags';
import { isFeatureEnabled } from 'src/utilities/accountCapabilities';
import { isFeatureEnabledV2 } from 'src/utilities/accountCapabilities';

import { AccessTable } from './AccessTable';
import { BucketPermissionsTable } from './BucketPermissionsTable';
Expand Down Expand Up @@ -43,7 +43,7 @@ export const LimitedAccessControls = React.memo((props: Props) => {
const flags = useFlags();
const { account } = useAccountManagement();

const isObjMultiClusterEnabled = isFeatureEnabled(
const isObjMultiClusterEnabled = isFeatureEnabledV2(
'Object Storage Access Key Regions',
Boolean(flags.objMultiCluster),
account?.capabilities ?? []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { useFlags } from 'src/hooks/useFlags';
import { useAccountSettings } from 'src/queries/account/settings';
import { useObjectStorageBuckets } from 'src/queries/objectStorage';
import { useRegionsQuery } from 'src/queries/regions/regions';
import { isFeatureEnabled } from 'src/utilities/accountCapabilities';
import { isFeatureEnabledV2 } from 'src/utilities/accountCapabilities';
import { getRegionsByRegionId } from 'src/utilities/regions';
import { sortByString } from 'src/utilities/sort-by';

Expand Down Expand Up @@ -115,7 +115,7 @@ export const OMC_AccessKeyDrawer = (props: AccessKeyDrawerProps) => {
const { account } = useAccountManagement();
const flags = useFlags();

const isObjMultiClusterEnabled = isFeatureEnabled(
const isObjMultiClusterEnabled = isFeatureEnabledV2(
'Object Storage Access Key Regions',
Boolean(flags.objMultiCluster),
account?.capabilities ?? []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Drawer } from 'src/components/Drawer';
import { Typography } from 'src/components/Typography';
import { useAccountManagement } from 'src/hooks/useAccountManagement';
import { useFlags } from 'src/hooks/useFlags';
import { isFeatureEnabled } from 'src/utilities/accountCapabilities';
import { isFeatureEnabledV2 } from 'src/utilities/accountCapabilities';

import { AccessTable } from './AccessTable';
import { BucketPermissionsTable } from './BucketPermissionsTable';
Expand All @@ -24,7 +24,7 @@ export const ViewPermissionsDrawer: React.FC<CombinedProps> = (props) => {
const flags = useFlags();
const { account } = useAccountManagement();

const isObjMultiClusterEnabled = isFeatureEnabled(
const isObjMultiClusterEnabled = isFeatureEnabledV2(
'Object Storage Access Key Regions',
Boolean(flags.objMultiCluster),
account?.capabilities ?? []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
useObjectStorageClusters,
} from 'src/queries/objectStorage';
import { useRegionsQuery } from 'src/queries/regions/regions';
import { isFeatureEnabled } from 'src/utilities/accountCapabilities';
import { isFeatureEnabledV2 } from 'src/utilities/accountCapabilities';
import { sendDownloadObjectEvent } from 'src/utilities/analytics/customEventAnalytics';
import { getQueryParamFromQueryString } from 'src/utilities/queryParams';
import { truncateMiddle } from 'src/utilities/truncate';
Expand Down Expand Up @@ -84,7 +84,7 @@ export const BucketDetail = () => {
const flags = useFlags();
const { data: account } = useAccount();

const isObjMultiClusterEnabled = isFeatureEnabled(
const isObjMultiClusterEnabled = isFeatureEnabledV2(
'Object Storage Access Key Regions',
Boolean(flags.objMultiCluster),
account?.capabilities ?? []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { useFlags } from 'src/hooks/useFlags';
import { useObjectStorageClusters } from 'src/queries/objectStorage';
import { useProfile } from 'src/queries/profile/profile';
import { useRegionsQuery } from 'src/queries/regions/regions';
import { isFeatureEnabled } from 'src/utilities/accountCapabilities';
import { isFeatureEnabledV2 } from 'src/utilities/accountCapabilities';
import { formatDate } from 'src/utilities/formatDate';
import { pluralize } from 'src/utilities/pluralize';
import { truncateMiddle } from 'src/utilities/truncate';
Expand Down Expand Up @@ -54,7 +54,7 @@ export const BucketDetailsDrawer = React.memo(
const flags = useFlags();
const { account } = useAccountManagement();

const isObjMultiClusterEnabled = isFeatureEnabled(
const isObjMultiClusterEnabled = isFeatureEnabledV2(
'Object Storage Access Key Regions',
Boolean(flags.objMultiCluster),
account?.capabilities ?? []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
} from 'src/queries/objectStorage';
import { useProfile } from 'src/queries/profile/profile';
import { useRegionsQuery } from 'src/queries/regions/regions';
import { isFeatureEnabled } from 'src/utilities/accountCapabilities';
import { isFeatureEnabledV2 } from 'src/utilities/accountCapabilities';
import {
sendDeleteBucketEvent,
sendDeleteBucketFailedEvent,
Expand All @@ -54,7 +54,7 @@ export const BucketLanding = () => {
const { account } = useAccountManagement();
const flags = useFlags();

const isObjMultiClusterEnabled = isFeatureEnabled(
const isObjMultiClusterEnabled = isFeatureEnabledV2(
'Object Storage Access Key Regions',
Boolean(flags.objMultiCluster),
account?.capabilities ?? []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useAccountManagement } from 'src/hooks/useAccountManagement';
import { useFlags } from 'src/hooks/useFlags';
import { useObjectStorageClusters } from 'src/queries/objectStorage';
import { useRegionsQuery } from 'src/queries/regions/regions';
import { isFeatureEnabled } from 'src/utilities/accountCapabilities';
import { isFeatureEnabledV2 } from 'src/utilities/accountCapabilities';
import { getRegionsByRegionId } from 'src/utilities/regions';
import { readableBytes } from 'src/utilities/unitConversions';

Expand Down Expand Up @@ -47,7 +47,7 @@ export const BucketTableRow = (props: BucketTableRowProps) => {
const flags = useFlags();
const { account } = useAccountManagement();

const isObjMultiClusterEnabled = isFeatureEnabled(
const isObjMultiClusterEnabled = isFeatureEnabledV2(
'Object Storage Access Key Regions',
Boolean(flags.objMultiCluster),
account?.capabilities ?? []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface Props {
onBlur: (e: any) => void;
onChange: (value: string) => void;
required?: boolean;
selectedCluster: string;
selectedCluster: string | undefined;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RegionSelect for which this is a wrapper has the value as string | undefined which I believe to be correct.

}

export const ClusterSelect: React.FC<Props> = (props) => {
Expand Down Expand Up @@ -55,7 +55,7 @@ export const ClusterSelect: React.FC<Props> = (props) => {
placeholder="Select a Region"
regions={regionOptions ?? []}
required={required}
value={selectedCluster}
value={selectedCluster ?? undefined}
/>
);
};
Expand Down
Loading
Loading