Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5c305d0
refactor: [M3-9265] - Migrate Drawer to ui package
hasyed-akamai Mar 6, 2025
c56f2be
Merge branch 'develop' into M3-9265-migrate-drawer-to-ui
hasyed-akamai Mar 11, 2025
00ec085
cleanup
hasyed-akamai Mar 11, 2025
89daf0c
Added `NotFound` component as a prop
hasyed-akamai Mar 11, 2025
4bef062
remove api-v4 dependency
hasyed-akamai Mar 11, 2025
943c7c1
Remove `makeStyles` for `sx` components
hasyed-akamai Mar 12, 2025
b76f884
Merge branch 'develop' into M3-9265-migrate-drawer-to-ui
hasyed-akamai Mar 12, 2025
4fe2b3b
Added changeset: Migrate Drawer to ui package
hasyed-akamai Mar 12, 2025
a9f4b41
Added changeset: Migrate Drawer to ui package
hasyed-akamai Mar 12, 2025
81809ed
Merge branch 'develop' into M3-9265-migrate-drawer-to-ui
hasyed-akamai Mar 12, 2025
dab9057
Merge branch 'develop' into M3-9265-migrate-drawer-to-ui
hasyed-akamai Mar 13, 2025
a99f871
fix linting and remove duplicate identifier
hasyed-akamai Mar 13, 2025
82b0870
Added Story for Drawer with `NotFound` component
hasyed-akamai Mar 14, 2025
47efcef
Added `WithoutNotFoundComponent` story
hasyed-akamai Mar 14, 2025
6b54634
Merge branch 'develop' into M3-9265-migrate-drawer-to-ui
hasyed-akamai Mar 14, 2025
3c3697a
Added changeset: Migrate Drawer to ui package
hasyed-akamai Mar 14, 2025
edba774
update changeset
hasyed-akamai Mar 14, 2025
30cd2a0
Merge branch 'develop' into M3-9265-migrate-drawer-to-ui
hasyed-akamai Mar 18, 2025
e6950bb
Merge branch 'develop' into M3-9265-migrate-drawer-to-ui
hasyed-akamai Mar 18, 2025
572f3e2
Merge branch 'develop' into M3-9265-migrate-drawer-to-ui
hasyed-akamai Mar 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-11789-added-1741764243935.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Added
---

Migrate Drawer to ui package ([#11789](https://github.com/linode/manager/pull/11789))
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Removed
---

Migrate Drawer to ui package ([#11789](https://github.com/linode/manager/pull/11789))
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* @file Cypress integration tests for OBJ enrollment and cancellation.
*/

import {
accountFactory,
accountSettingsFactory,
Expand Down
5 changes: 3 additions & 2 deletions packages/manager/src/components/TagCell/TagDrawer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Drawer } from '@linode/ui';
import * as React from 'react';

import { Drawer } from 'src/components/Drawer';

import { NotFound } from '../NotFound';
import { TagCell } from './TagCell';

export interface TagDrawerProps {
Expand All @@ -18,6 +18,7 @@ export const TagDrawer = (props: TagDrawerProps) => {

return (
<Drawer
NotFoundComponent={NotFound}
onClose={onClose}
open={open}
title={'Tags' + (entityLabel ? ` (${entityLabel})` : '')}
Expand Down
11 changes: 8 additions & 3 deletions packages/manager/src/features/Account/SwitchAccountDrawer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Notice, StyledLinkButton, Typography } from '@linode/ui';
import { Drawer, Notice, StyledLinkButton, Typography } from '@linode/ui';
import React from 'react';

import { DebouncedSearchTextField } from 'src/components/DebouncedSearchTextField';
import { Drawer } from 'src/components/Drawer';
import { NotFound } from 'src/components/NotFound';
import { PARENT_USER_SESSION_EXPIRED } from 'src/features/Account/constants';
import { useParentChildAuthentication } from 'src/features/Account/SwitchAccounts/useParentChildAuthentication';
import { setTokenInLocalStorage } from 'src/features/Account/SwitchAccounts/utils';
Expand Down Expand Up @@ -123,7 +123,12 @@ export const SwitchAccountDrawer = (props: Props) => {
}, [onClose, revokeToken, validateParentToken, updateCurrentToken]);

return (
<Drawer onClose={onClose} open={open} title="Switch Account">
<Drawer
NotFoundComponent={NotFound}
onClose={onClose}
open={open}
title="Switch Account"
>
{createTokenErrorReason && (
<Notice text={createTokenErrorReason} variant="error" />
)}
Expand Down
29 changes: 21 additions & 8 deletions packages/manager/src/features/Backups/BackupDrawer.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
import { ActionsPanel, Box, Notice, Stack, Typography } from '@linode/ui';
import {
useAccountSettings,
useAllLinodesQuery,
useMutateAccountSettings,
} from '@linode/queries';
import {
ActionsPanel,
Box,
Drawer,
Notice,
Stack,
Typography,
} from '@linode/ui';
import { isNumber, pluralize } from '@linode/utilities';
import { styled } from '@mui/material';
import { useSnackbar } from 'notistack';
import * as React from 'react';

import { DisplayPrice } from 'src/components/DisplayPrice';
import { Drawer } from 'src/components/Drawer';
import { Link } from 'src/components/Link';
import { NotFound } from 'src/components/NotFound';
import { Table } from 'src/components/Table';
import { TableBody } from 'src/components/TableBody';
import { TableCell } from 'src/components/TableCell';
import { TableHead } from 'src/components/TableHead';
import { TableRow } from 'src/components/TableRow';
import { TableRowError } from 'src/components/TableRowError/TableRowError';
import { TableRowLoading } from 'src/components/TableRowLoading/TableRowLoading';
import {
useAccountSettings,
useMutateAccountSettings,
useAllLinodesQuery,
} from '@linode/queries';
import { useAllTypes } from 'src/queries/types';
import { getTotalBackupsPrice } from 'src/utilities/pricing/backups';
import { UNKNOWN_PRICE } from 'src/utilities/pricing/constants';
Expand Down Expand Up @@ -141,7 +148,13 @@ all new Linodes will automatically be backed up.`
});

return (
<Drawer onClose={onClose} open={open} title="Enable All Backups" wide>
<Drawer
NotFoundComponent={NotFound}
onClose={onClose}
open={open}
title="Enable All Backups"
wide
>
<Stack spacing={2}>
<Typography variant="body1">
Three backup slots are executed and rotated automatically: a daily
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useGrants, useNotificationsQuery } from '@linode/queries';
import { Box, Button, Divider, TooltipIcon, Typography } from '@linode/ui';
import Grid from '@mui/material/Grid2';
import { useTheme } from '@mui/material/styles';
Expand All @@ -6,7 +7,6 @@ import { useHistory, useLocation, useRouteMatch } from 'react-router-dom';

import { Currency } from 'src/components/Currency';
import { useAccountManagement } from 'src/hooks/useAccountManagement';
import { useNotificationsQuery, useGrants } from '@linode/queries';
import { isWithinDays } from 'src/utilities/date';

import { BillingPaper } from '../../BillingDetail';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import userEvent from '@testing-library/user-event';
import * as React from 'react';

import { paymentFactory } from 'src/factories/billing';
import { http, HttpResponse, server } from 'src/mocks/testServer';
import { HttpResponse, http, server } from 'src/mocks/testServer';
import { wrapWithTheme } from 'src/utilities/testHelpers';

import PaymentDrawer, { getMinimumPayment } from './PaymentDrawer';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { makePayment } from '@linode/api-v4/lib/account';
import { accountQueries, useAccount, useProfile } from '@linode/queries';
import {
Typography,
Button,
Divider,
Drawer,
ErrorState,
InputAdornment,
Notice,
Stack,
TextField,
TooltipIcon,
Typography,
} from '@linode/ui';
import Grid from '@mui/material/Grid2';
import { useQueryClient } from '@tanstack/react-query';
Expand All @@ -17,12 +19,11 @@ import * as React from 'react';
import { makeStyles } from 'tss-react/mui';

import { Currency } from 'src/components/Currency';
import { Drawer } from 'src/components/Drawer';
import { LinearProgress } from 'src/components/LinearProgress';
import { NotFound } from 'src/components/NotFound';
import { SupportLink } from 'src/components/SupportLink';
import { getRestrictedResourceText } from 'src/features/Account/utils';
import { useRestrictedGlobalGrantCheck } from 'src/hooks/useRestrictedGlobalGrantCheck';
import { useAccount, accountQueries, useProfile } from '@linode/queries';
import { isCreditCardExpired } from 'src/utilities/creditCard';
import { getAPIErrorOrDefault } from 'src/utilities/errorUtils';

Expand Down Expand Up @@ -237,7 +238,12 @@ export const PaymentDrawer = (props: Props) => {
}

return (
<Drawer onClose={onClose} open={open} title="Make a Payment">
<Drawer
NotFoundComponent={NotFound}
onClose={onClose}
open={open}
title="Make a Payment"
>
<Stack spacing={2}>
{isReadOnly && (
<Notice
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Drawer } from '@linode/ui';
import * as React from 'react';
import { makeStyles } from 'tss-react/mui';

import { Drawer } from 'src/components/Drawer';
import { NotFound } from 'src/components/NotFound';

import UpdateContactInformationForm from './UpdateContactInformationForm';

Expand Down Expand Up @@ -29,6 +30,7 @@ export const BillingContactDrawer = (props: Props) => {

return (
<Drawer
NotFoundComponent={NotFound}
className={classes.drawer}
onClose={onClose}
open={open}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import { Box, Divider, Notice, TooltipIcon, Typography } from '@linode/ui';
import { useProfile } from '@linode/queries';
import {
Box,
Divider,
Drawer,
Notice,
TooltipIcon,
Typography,
} from '@linode/ui';
import Grid from '@mui/material/Grid2';
import * as React from 'react';

import { Drawer } from 'src/components/Drawer';
import { LinearProgress } from 'src/components/LinearProgress';
import { NotFound } from 'src/components/NotFound';
import { MAXIMUM_PAYMENT_METHODS } from 'src/constants';
import { getRestrictedResourceText } from 'src/features/Account/utils';
import { useRestrictedGlobalGrantCheck } from 'src/hooks/useRestrictedGlobalGrantCheck';
import { useProfile } from '@linode/queries';

import GooglePayChip from '../GooglePayChip';
import { PayPalChip } from '../PayPalChip';
Expand Down Expand Up @@ -86,7 +93,12 @@ export const AddPaymentMethodDrawer = (props: Props) => {
const disabled = isProcessing || hasMaxPaymentMethods || isReadOnly;

return (
<Drawer onClose={onClose} open={open} title="Add Payment Method">
<Drawer
NotFoundComponent={NotFound}
onClose={onClose}
open={open}
title="Add Payment Method"
>
{isProcessing ? (
<LinearProgress
sx={{
Expand Down Expand Up @@ -136,7 +148,6 @@ export const AddPaymentMethodDrawer = (props: Props) => {
</Grid>
{!isReadOnly && (
<Grid
container
size={{
md: 3,
xs: 4,
Expand All @@ -145,6 +156,7 @@ export const AddPaymentMethodDrawer = (props: Props) => {
alignContent: 'center',
justifyContent: 'flex-end',
}}
container
>
<GooglePayChip
disabled={disabled}
Expand Down Expand Up @@ -173,7 +185,6 @@ export const AddPaymentMethodDrawer = (props: Props) => {
</Grid>
{!isReadOnly && (
<Grid
container
size={{
md: 3,
xs: 4,
Expand All @@ -182,6 +193,7 @@ export const AddPaymentMethodDrawer = (props: Props) => {
alignContent: 'center',
justifyContent: 'flex-end',
}}
container
>
<PayPalErrorBoundary renderError={renderError}>
<PayPalChip
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { yupResolver } from '@hookform/resolvers/yup';
import { ActionsPanel, Autocomplete, Box, Typography } from '@linode/ui';
import {
ActionsPanel,
Autocomplete,
Box,
Drawer,
Typography,
} from '@linode/ui';
import Grid from '@mui/material/Grid';
import React from 'react';
import { Controller, FormProvider, useForm, useWatch } from 'react-hook-form';

import { Drawer } from 'src/components/Drawer';
import { NotFound } from 'src/components/NotFound';

import { channelTypeOptions } from '../../constants';
import { getAlertBoxStyles } from '../../Utils/utils';
Expand Down Expand Up @@ -95,7 +101,12 @@ export const AddNotificationChannelDrawer = (
};

return (
<Drawer onClose={resetDrawer} open={open} title="Add Notification Channel">
<Drawer
NotFoundComponent={NotFound}
onClose={resetDrawer}
open={open}
title="Add Notification Channel"
>
<FormProvider {...formMethods}>
<form onSubmit={onSubmit}>
<Box
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ActionsPanel, Notice, Typography } from '@linode/ui';
import { ActionsPanel, Drawer, Notice, Typography } from '@linode/ui';
import { useFormik } from 'formik';
import * as React from 'react';
import { makeStyles } from 'tss-react/mui';

import { Drawer } from 'src/components/Drawer';
import { Link } from 'src/components/Link';
import { MultipleIPInput } from 'src/components/MultipleIPInput/MultipleIPInput';
import { NotFound } from 'src/components/NotFound';
import {
ACCESS_CONTROLS_DRAWER_TEXT,
ACCESS_CONTROLS_DRAWER_TEXT_LEGACY,
Expand Down Expand Up @@ -182,7 +182,12 @@ const AddAccessControlDrawer = (props: CombinedProps) => {

const learnMoreLink = isDefaultDB ? LEARN_MORE_LINK : LEARN_MORE_LINK_LEGACY;
return (
<Drawer onClose={onClose} open={open} title="Manage Access">
<Drawer
NotFoundComponent={NotFound}
onClose={onClose}
open={open}
title="Manage Access"
>
<React.Fragment>
{error ? <Notice text={error} variant="error" /> : null}
{allowListErrors
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ActionsPanel, Divider, Notice, Typography } from '@linode/ui';
import { ActionsPanel, Divider, Drawer, Notice, Typography } from '@linode/ui';
import React, { useState } from 'react';

import { Drawer } from 'src/components/Drawer';
import { Link } from 'src/components/Link';
import { NotFound } from 'src/components/NotFound';

import { DatabaseConfigurationSelect } from './DatabaseConfigurationSelect';

Expand All @@ -24,7 +24,12 @@ export const DatabaseAdvancedConfigurationDrawer = (props: Props) => {
// The implementation will be updated in the second PR after UI work is completed.
const engineConfigs = undefined;
return (
<Drawer onClose={onClose} open={open} title="Advanced Configuration">
<Drawer
NotFoundComponent={NotFound}
onClose={onClose}
open={open}
title="Advanced Configuration"
>
<Typography>
Advanced parameters to configure your database cluster.
</Typography>
Expand Down
6 changes: 4 additions & 2 deletions packages/manager/src/features/Domains/CloneDomainDrawer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { useGrants, useProfile } from '@linode/queries';
import {
ActionsPanel,
Drawer,
FormControlLabel,
Notice,
Radio,
Expand All @@ -10,9 +12,8 @@ import { useNavigate } from '@tanstack/react-router';
import { useFormik } from 'formik';
import React from 'react';

import { Drawer } from 'src/components/Drawer';
import { NotFound } from 'src/components/NotFound';
import { useCloneDomainMutation } from 'src/queries/domains';
import { useGrants, useProfile } from '@linode/queries';

import type { Domain } from '@linode/api-v4';

Expand Down Expand Up @@ -57,6 +58,7 @@ export const CloneDomainDrawer = (props: CloneDomainDrawerProps) => {

return (
<Drawer
NotFoundComponent={NotFound}
isFetching={isFetching}
onClose={onClose}
open={open}
Expand Down
Loading