diff --git a/CHANGELOG.md b/CHANGELOG.md index c4adb2c0810..37aa4225237 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,58 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [2023-05-01] - v1.92.0 + +### Added: +- No Results section for Marketplace Search #8999 +- Private IP checkbox when cloning a Linode #9039 +- Metadata migrate warning #9033 + +### Changed: +- Region Select will dynamically get country flags and group all countries based on API data #8996 +- Removed MongoDB Marketplace Apps #9071 + +### Fixed: +- Kubernetes Delete Dialog clears when it is re-opened #9000 +- HTML showing up in event messages #9003 +- Inability to edit and save Linode Configurations #9053 +- Marketplace One Click Cluster UDF caching issue #8997 +- Prevent IP transfer & sharing modals form submission if no action selected #9026 +- Increase radio button padding to fix hover effect shape #9031 +- Blank Kubernetes Node Pool plan selection #9009 + +### Tech Stories: +- MUI v5 Migration - `Components > CircleProgress` #9028 +- MUI v5 Migration - `Components > StatusIcon` #9014 +- MUI v5 Migration - `Components > TagsInput, TagsPanel` #8995 +- MUI v5 Migration - Grid v2 for Features #8985 +- MUI v5 Migration - `Components > Dialog` #9020 +- MUI v5 Migration - `Components > DeletionDialog` #9047 +- MUI v5 Migration - `Components > Currency` #9030 +- MUI v5 Migration - `Components > DisplayPrice` #9022 +- MUI v5 Migration - `Components > CreateLinodeDisabled` #9015 +- MUI v5 Migration - `Components > DateTimeDisplay, DebouncedSearchTextField` #9007 +- MUI v5 Migration - `Components > ConfirmationDialog` #9016 +- MUI v5 Migration - `Components > CopyTooltip` #9040 +- MUI v5 Migration - `Components > CheckoutBar` #9051 +- MUI v5 Migration - `Components > CreateLinodeDisabled` #9015 +- MUI v5 Migration - `Components > ColorPalette` #9013 +- MUI v5 Migration - `Components > Tile` #9001 +- MUI v5 Migration - `Components > TagsInput, TagsPanel` #8995 +- MUI v5 Migration - `Components > DismissibleBanner` #8998 +- MUI v5 Migration - `Components > SupportLink, TextTooltip` #8993 +- MUI v5 Migration - `Components > Toggle` #8990 +- MUI v5 Migration - `Components > SplashScreen` #8994 +- Remove `ConditionalWrapper` #9002 +- Upgrade New Relic to v1230 #9005 +- Add basic Adobe Analytics tracking #8989 +- Add more eslint rules #9043 +- @linode/validation version badge Label in `README.md` #9011 +- Improve Firewall ports regex to prevent exponential backtracking #9010 +- Fix code scanning alert that DOM text is reinterpreted as HTML #9032 +- Fix the typesafety of the ` diff --git a/packages/manager/src/components/EnhancedSelect/Select.styles.ts b/packages/manager/src/components/EnhancedSelect/Select.styles.ts index 36eddbd1c2a..3dc88dd5a7b 100644 --- a/packages/manager/src/components/EnhancedSelect/Select.styles.ts +++ b/packages/manager/src/components/EnhancedSelect/Select.styles.ts @@ -1,345 +1,318 @@ -import { createStyles } from '@mui/styles'; +import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; -export type ClassNames = - | 'root' - | 'input' - | 'noOptionsMessage' - | 'divider' - | 'suggestionRoot' - | 'highlight' - | 'suggestionItem' - | 'suggestionIcon' - | 'suggestionTitle' - | 'suggestionDescription' - | 'resultContainer' - | 'tagContainer' - | 'selectedMenuItem' - | 'medium' - | 'small' - | 'noMarginTop' - | 'inline' - | 'hideLabel' - | 'algoliaRoot' - | 'label' - | 'source' - | 'icon' - | 'row' - | 'finalLink'; - -export const styles = (theme: Theme) => - createStyles({ - '@keyframes dash': { - to: { - 'stroke-dashoffset': 0, - }, +export const useStyles = makeStyles((theme: Theme) => ({ + '@keyframes dash': { + to: { + 'stroke-dashoffset': 0, }, - root: { - width: '100%', - position: 'relative', - '& .react-select__control': { - borderRadius: 0, - boxShadow: 'none', - border: `1px solid transparent`, - backgroundColor: theme.bg.white, - minHeight: `calc(${theme.spacing(5)} - 2)`, - '&:hover': { - border: `1px dotted #ccc`, - cursor: 'text', - }, - '&--is-focused, &--is-focused:hover': { - border: `1px dotted #999`, - }, + }, + root: { + width: '100%', + position: 'relative', + '& .react-select__control': { + borderRadius: 0, + boxShadow: 'none', + border: `1px solid transparent`, + backgroundColor: theme.bg.white, + minHeight: `calc(${theme.spacing(5)} - 2)`, + '&:hover': { + border: `1px dotted #ccc`, + cursor: 'text', }, - '& .react-select__value-container': { - width: '100%', - '& > div': { - width: '100%', - }, - '&.react-select__value-container--is-multi': { - '& > div, & .react-select__input': { - width: 'auto', - }, - }, + '&--is-focused, &--is-focused:hover': { + border: `1px dotted #999`, }, - '& .react-select__input': { + }, + '& .react-select__value-container': { + width: '100%', + '& > div': { width: '100%', - color: theme.palette.text.primary, - }, - '& .react-select__menu': { - margin: '-1px 0 0 0', - borderRadius: 0, - boxShadow: 'none', - border: `1px solid ${theme.palette.primary.main}`, - maxWidth: 415, - zIndex: 100, }, - '& .react-select__group': { - width: '100%', - '&:last-child': { - paddingBottom: 0, + '&.react-select__value-container--is-multi': { + '& > div, & .react-select__input': { + width: 'auto', }, }, - '& .react-select__group-heading': { - textTransform: 'initial', - fontSize: '1rem', - color: theme.color.headline, - fontFamily: theme.font.bold, - paddingLeft: 10, - paddingRight: 10, - }, - '& .react-select__menu-list': { - zIndex: 100, - padding: theme.spacing(0.5), - backgroundColor: theme.bg.white, - height: '101%', - overflow: 'auto', - maxHeight: 285, - '&::-webkit-scrollbar': { - appearance: 'none', - }, - '&::-webkit-scrollbar:vertical': { - width: 8, - }, - '&::-webkit-scrollbar-thumb': { - borderRadius: 8, - backgroundColor: '#ccc', - }, - }, - '& .react-select__option': { - transition: theme.transitions.create(['background-color', 'color']), - color: theme.palette.text.primary, - backgroundColor: theme.bg.white, - cursor: 'pointer', - padding: '10px', - fontSize: '0.9rem', - [theme.breakpoints.only('xs')]: { - fontSize: '1rem', - }, - '& svg': { - marginTop: 2, - }, - }, - '& .react-select__option--is-focused': { - backgroundColor: theme.palette.primary.main, - color: 'white', - }, - '& .react-select__option--is-selected': { - color: theme.palette.primary.main, - '&.react-select__option--is-focused': { - backgroundColor: theme.bg.white, - }, - }, - '& .react-select__option--is-disabled': { - opacity: 0.5, - cursor: 'initial', - }, - '& .react-select__single-value': { - color: theme.palette.text.primary, - overflow: 'hidden', - }, - '& .react-select__indicator-separator': { - display: 'none', - }, - '& .react-select__multi-value': { - borderRadius: 4, - backgroundColor: theme.bg.lightBlue1, - alignItems: 'center', - }, - '& .react-select__multi-value__label': { - color: theme.palette.text.primary, - fontSize: '.8rem', - height: 20, - marginTop: 2, - marginBottom: 2, - marginRight: 4, - paddingLeft: 6, - paddingRight: 0, + }, + '& .react-select__input': { + width: '100%', + color: theme.palette.text.primary, + }, + '& .react-select__menu': { + margin: '-1px 0 0 0', + borderRadius: 0, + boxShadow: 'none', + border: `1px solid ${theme.palette.primary.main}`, + maxWidth: 415, + zIndex: 100, + }, + '& .react-select__group': { + width: '100%', + '&:last-child': { + paddingBottom: 0, }, - '& .react-select__clear-indicator': { - padding: 0, - '& svg': { - color: theme.color.grey4, - '&:hover': { - color: theme.palette.primary.main, - }, - }, + }, + '& .react-select__group-heading': { + textTransform: 'initial', + fontSize: '1rem', + color: theme.color.headline, + fontFamily: theme.font.bold, + paddingLeft: 10, + paddingRight: 10, + }, + '& .react-select__menu-list': { + zIndex: 100, + padding: theme.spacing(0.5), + backgroundColor: theme.bg.white, + height: '101%', + overflow: 'auto', + maxHeight: 285, + '&::-webkit-scrollbar': { + appearance: 'none', }, - '& .react-select__multi-value__remove': { - backgroundColor: 'transparent', - borderRadius: '50%', - padding: 2, - marginLeft: 4, - marginRight: 4, - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - '& svg': { - color: theme.palette.text.primary, - width: 12, - height: 12, - }, - '&:hover': { - backgroundColor: theme.palette.primary.main, - '& svg': { - color: 'white', - }, - }, + '&::-webkit-scrollbar:vertical': { + width: 8, }, - '& .react-select__dropdown-indicator': {}, - '& [class*="MuiFormHelperText-error"]': { - paddingBottom: theme.spacing(1), + '&::-webkit-scrollbar-thumb': { + borderRadius: 8, + backgroundColor: '#ccc', }, }, - input: { + '& .react-select__option': { + transition: theme.transitions.create(['background-color', 'color']), + color: theme.palette.text.primary, + backgroundColor: theme.bg.white, + cursor: 'pointer', + padding: '10px', fontSize: '0.9rem', [theme.breakpoints.only('xs')]: { fontSize: '1rem', }, - padding: 0, - display: 'flex', - color: theme.palette.text.primary, - cursor: 'pointer', - minHeight: `calc(${theme.spacing(5)} - 6)`, - // From the AutoSizeInput documentation: (https://github.com/JedWatson/react-input-autosize/blob/master/README.md#csp-and-the-ie-clear-indicator) - // "The input will automatically inject a stylesheet that hides IE/Edge's "clear" indicator, - // which otherwise breaks the UI. This has the downside of being incompatible with some CSP policies. - // To work around this, you can pass the injectStyles={false} prop, but if you do this I strongly - // recommend targeting the input element in your own stylesheet with the following rule:" - '::-ms-clear': { display: 'none' }, - }, - noOptionsMessage: { - padding: `${theme.spacing(1)} ${theme.spacing(2)}`, + '& svg': { + marginTop: 2, + }, }, - divider: { - height: theme.spacing(2), + '& .react-select__option--is-focused': { + backgroundColor: theme.palette.primary.main, + color: 'white', }, - suggestionRoot: { - cursor: 'pointer', - width: 'calc(100% + 2px)', - alignItems: 'space-between', - justifyContent: 'space-between', - borderBottom: `1px solid ${theme.palette.divider}`, - [theme.breakpoints.up('md')]: { - display: 'flex', - }, - '&:last-child': { - borderBottom: 0, + '& .react-select__option--is-selected': { + color: theme.palette.primary.main, + '&.react-select__option--is-focused': { + backgroundColor: theme.bg.white, }, }, - highlight: { - color: theme.palette.primary.main, + '& .react-select__option--is-disabled': { + opacity: 0.5, + cursor: 'initial', }, - suggestionItem: { - padding: theme.spacing(), + '& .react-select__single-value': { + color: theme.palette.text.primary, + overflow: 'hidden', }, - suggestionIcon: { - display: 'flex', + '& .react-select__indicator-separator': { + display: 'none', + }, + '& .react-select__multi-value': { + borderRadius: 4, + backgroundColor: theme.bg.lightBlue1, alignItems: 'center', - justifyContent: 'center', - marginLeft: theme.spacing(1.5), }, - suggestionTitle: { - fontSize: '1rem', + '& .react-select__multi-value__label': { color: theme.palette.text.primary, - wordBreak: 'break-all', - fontWeight: 600, - }, - suggestionDescription: { - color: theme.color.headline, - fontSize: '.75rem', + fontSize: '.8rem', + height: 20, marginTop: 2, + marginBottom: 2, + marginRight: 4, + paddingLeft: 6, + paddingRight: 0, }, - resultContainer: { - display: 'flex', - flexFlow: 'row nowrap', + '& .react-select__clear-indicator': { + padding: 0, + '& svg': { + color: theme.color.grey4, + '&:hover': { + color: theme.palette.primary.main, + }, + }, }, - tagContainer: { + '& .react-select__multi-value__remove': { + backgroundColor: 'transparent', + borderRadius: '50%', + padding: 2, + marginLeft: 4, + marginRight: 4, display: 'flex', - flexWrap: 'wrap', - paddingRight: 8, - justifyContent: 'flex-end', alignItems: 'center', - '& > div': { - margin: '2px', - }, - }, - selectedMenuItem: { - backgroundColor: `${theme.bg.main} !important`, - '& .tag': { - backgroundColor: theme.bg.lightBlue1, + justifyContent: 'center', + '& svg': { color: theme.palette.text.primary, - '&:hover': { - backgroundColor: theme.palette.primary.main, + width: 12, + height: 12, + }, + '&:hover': { + backgroundColor: theme.palette.primary.main, + '& svg': { color: 'white', }, }, }, - medium: { - minHeight: 40, + '& .react-select__dropdown-indicator': {}, + '& [class*="MuiFormHelperText-error"]': { + paddingBottom: theme.spacing(1), }, - small: { - minHeight: 35, - minWidth: 'auto', + }, + input: { + fontSize: '0.9rem', + [theme.breakpoints.only('xs')]: { + fontSize: '1rem', }, - inline: { - display: 'inline-flex', - flexDirection: 'row', - alignItems: 'center', - '& label': { - marginRight: theme.spacing(1), - whiteSpace: 'nowrap', - position: 'relative', - top: 1, - }, + padding: 0, + display: 'flex', + color: theme.palette.text.primary, + cursor: 'pointer', + minHeight: `calc(${theme.spacing(5)} - 6)`, + // From the AutoSizeInput documentation: (https://github.com/JedWatson/react-input-autosize/blob/master/README.md#csp-and-the-ie-clear-indicator) + // "The input will automatically inject a stylesheet that hides IE/Edge's "clear" indicator, + // which otherwise breaks the UI. This has the downside of being incompatible with some CSP policies. + // To work around this, you can pass the injectStyles={false} prop, but if you do this I strongly + // recommend targeting the input element in your own stylesheet with the following rule:" + '::-ms-clear': { display: 'none' }, + }, + noOptionsMessage: { + padding: `${theme.spacing(1)} ${theme.spacing(2)}`, + }, + divider: { + height: theme.spacing(2), + }, + suggestionRoot: { + cursor: 'pointer', + width: 'calc(100% + 2px)', + alignItems: 'space-between', + justifyContent: 'space-between', + borderBottom: `1px solid ${theme.palette.divider}`, + [theme.breakpoints.up('md')]: { + display: 'flex', }, - hideLabel: { - '& label': { ...theme.visually.hidden }, + '&:last-child': { + borderBottom: 0, }, - algoliaRoot: { - width: '100%', - cursor: 'pointer', - padding: `calc(${theme.spacing(1)} / 2 + 2)`, - '& em': { - fontStyle: 'normal', - color: theme.color.blueDTwhite, - }, + }, + highlight: { + color: theme.palette.primary.main, + }, + suggestionItem: { + padding: theme.spacing(), + }, + suggestionIcon: { + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + marginLeft: theme.spacing(1.5), + }, + suggestionTitle: { + fontSize: '1rem', + color: theme.palette.text.primary, + wordBreak: 'break-all', + fontWeight: 600, + }, + suggestionDescription: { + color: theme.color.headline, + fontSize: '.75rem', + marginTop: 2, + }, + resultContainer: { + display: 'flex', + flexFlow: 'row nowrap', + }, + tagContainer: { + display: 'flex', + flexWrap: 'wrap', + paddingRight: 8, + justifyContent: 'flex-end', + alignItems: 'center', + '& > div': { + margin: '2px', }, - label: { - display: 'inline', + }, + selectedMenuItem: { + backgroundColor: `${theme.bg.main} !important`, + '& .tag': { + backgroundColor: theme.bg.lightBlue1, color: theme.palette.text.primary, - maxWidth: '95%', + '&:hover': { + backgroundColor: theme.palette.primary.main, + color: 'white', + }, }, - icon: { - display: 'inline-block', - width: 12, - height: 12, + }, + medium: { + minHeight: 40, + }, + small: { + minHeight: 35, + minWidth: 'auto', + }, + inline: { + display: 'inline-flex', + flexDirection: 'row', + alignItems: 'center', + '& label': { + marginRight: theme.spacing(1), + whiteSpace: 'nowrap', position: 'relative', - top: 5, - marginLeft: theme.spacing(0.5), - marginRight: theme.spacing(0.5), - color: theme.palette.primary.main, - }, - source: { - marginTop: `calc(${theme.spacing(1)} / 4)`, - color: theme.color.headline, - paddingLeft: theme.spacing(1), - margin: 0, - }, - row: { - display: 'flex', - width: '100%', - alignItems: 'center', - justifyContent: 'space-between', - paddingLeft: theme.spacing(1), + top: 1, }, - finalLink: { - display: 'flex', - alignItems: 'center', - fontSize: '1.2em', - paddingLeft: theme.spacing(1), + }, + hideLabel: { + '& label': { ...theme.visually.hidden }, + }, + algoliaRoot: { + width: '100%', + cursor: 'pointer', + padding: `calc(${theme.spacing(1)} / 2 + 2)`, + '& em': { + fontStyle: 'normal', + color: theme.color.blueDTwhite, }, - }); + }, + label: { + display: 'inline', + color: theme.palette.text.primary, + maxWidth: '95%', + }, + icon: { + display: 'inline-block', + width: 12, + height: 12, + position: 'relative', + top: 5, + marginLeft: theme.spacing(0.5), + marginRight: theme.spacing(0.5), + color: theme.palette.primary.main, + }, + source: { + marginTop: `calc(${theme.spacing(1)} / 4)`, + color: theme.color.headline, + paddingLeft: theme.spacing(1), + margin: 0, + }, + row: { + display: 'flex', + width: '100%', + alignItems: 'center', + justifyContent: 'space-between', + paddingLeft: theme.spacing(1), + }, + finalLink: { + display: 'flex', + alignItems: 'center', + fontSize: '1.2em', + paddingLeft: theme.spacing(1), + }, +})); // @todo @tdt: Replace the class name based styles above with these. They're (mostly) copied over, // as they're needed for one specific case: where a Select component appears on a Dialog. To reduce diff --git a/packages/manager/src/components/EnhancedSelect/Select.tsx b/packages/manager/src/components/EnhancedSelect/Select.tsx index 3e4d3a4a7e2..1cc43122ae1 100644 --- a/packages/manager/src/components/EnhancedSelect/Select.tsx +++ b/packages/manager/src/components/EnhancedSelect/Select.tsx @@ -1,14 +1,15 @@ -import classNames from 'classnames'; import * as React from 'react'; -import ReactSelect, { Props as SelectProps } from 'react-select'; +import classNames from 'classnames'; +import ReactSelect, { + ActionMeta, + NamedProps as SelectProps, + ValueType, +} from 'react-select'; import CreatableSelect, { - Props as CreatableSelectProps, + CreatableProps as CreatableSelectProps, } from 'react-select/creatable'; -import { withStyles, WithStyles, withTheme, WithTheme } from '@mui/styles'; import { Props as TextFieldProps } from 'src/components/TextField'; import { convertToKebabCase } from 'src/utilities/convertToKebobCase'; -/* TODO will be refactoring enhanced select to be an abstraction. -Styles added in this file and the below imports will be utilized for the abstraction. */ import DropdownIndicator from './components/DropdownIndicator'; import Input from './components/Input'; import LoadingIndicator from './components/LoadingIndicator'; @@ -19,7 +20,8 @@ import NoOptionsMessage from './components/NoOptionsMessage'; import Option from './components/Option'; import Control from './components/SelectControl'; import Placeholder from './components/SelectPlaceholder'; -import { ClassNames, styles, reactSelectStyles } from './Select.styles'; +import { reactSelectStyles, useStyles } from './Select.styles'; +import { Theme, useTheme } from '@mui/material'; export interface Item { value: T; @@ -32,17 +34,6 @@ export interface GroupType { options: Item[]; } -export interface SelectState { - data: any; - isDisabled: boolean; - isFocused: boolean; - isSelected: boolean; -} - -interface ActionMeta { - action: string; -} - export interface NoOptionsMessageProps { inputValue: string; } @@ -62,26 +53,18 @@ const _components = { Input, }; -interface OwnProps { - // Set this prop to `true` when using a to the - // document body directly, so the overflow is visible over the edge of the modal. - overflowPortal?: boolean; -} - -type CombinedProps = OwnProps & - WithStyles & - BaseSelectProps & - CreatableProps & - WithTheme; - // We extend TexFieldProps to still be able to pass // the required label to Select and not duplicated it to TextFieldProps interface ModifiedTextFieldProps extends Omit { label?: string; } -export interface BaseSelectProps - extends Omit, 'onChange' | 'value' | 'onFocus'> { +export interface BaseSelectProps< + I extends Item, + IsMulti extends boolean = false, + Clearable extends boolean = false +> extends Omit, 'onChange'>, + CreatableSelectProps { classes?: any; /* textFieldProps isn't native to react-select @@ -97,18 +80,18 @@ export interface BaseSelectProps /** * We require label for accessibility purpose */ - label: string; - /** alias for isDisabled */ - disabled?: boolean; - /** retyped this */ - value?: Item | Item[] | null; - /** making this required */ - onChange: (selected: Item | Item[] | null, actionMeta?: ActionMeta) => void; - /** alias for onCreateOption */ - createNew?: (inputValue: string) => void; - loadOptions?: (inputValue: string) => Promise | undefined; - onFocus?: any; + label?: string; + + /** onChange is called when the user selectes a new value / new values */ + onChange: Clearable extends true // if the Select is NOT clearable, the value passed in the onChange function must be defined + ? Exclude['onChange'], undefined> + : ( + value: Exclude, null | undefined>, + action: ActionMeta + ) => void; + /** the rest are props we've added ourselves */ + disabled?: boolean; medium?: boolean; small?: boolean; noMarginTop?: boolean; @@ -120,11 +103,54 @@ export interface BaseSelectProps required?: boolean; creatable?: boolean; variant?: 'creatable'; + isClearable?: Clearable; + // Set this prop to `true` when using a to the + // document body directly, so the overflow is visible over the edge of the modal. + overflowPortal?: boolean; } -interface CreatableProps extends CreatableSelectProps {} +const Select = < + I extends Item, + IsMulti extends boolean = false, + Clearable extends boolean = false +>( + props: BaseSelectProps +) => { + const theme = useTheme(); + const classes = useStyles(); + const { + className, + components, + errorText, + filterOption, + label, + isClearable, + isMulti, + isLoading, + placeholder, + onChange, + onInputChange, + options, + value, + noOptionsMessage, + onMenuClose, + onBlur, + blurInputOnSelect, + medium, + small, + noMarginTop, + textFieldProps, + inline, + hideLabel, + errorGroup, + onFocus, + inputId, + overflowPortal, + required, + creatable, + ...restOfProps + } = props; -class Select extends React.PureComponent { // React-Select changed the behavior of clearing isMulti Selects in v3. // Previously, once the Select was empty, the value was `[]`. Now, it is `null`. // This breaks many of our components, which rely on e.g. mapping through the value (which is @@ -132,157 +158,112 @@ class Select extends React.PureComponent { // // This essentially reverts the behavior of the v3 React-Select update. Long term, we should // probably re-write our component handlers to expect EITHER an array OR `null`. - _onChange = (selected: Item | Item[] | null, actionMeta?: ActionMeta) => { - const { isMulti, onChange } = this.props; - + const _onChange = ( + selected: ValueType, + actionMeta: ActionMeta + ) => { if (isMulti && !selected) { - return onChange([], actionMeta); + // @ts-expect-error I'm sorry, but trust me I made this component much better + onChange([], actionMeta); + } else { + // @ts-expect-error I'm sorry, but trust me I made this component much better + onChange(selected, actionMeta); } - - onChange(selected, actionMeta); }; - render() { - const { - classes, - className, - components, - createNew, - disabled, - errorText, - filterOption, - label, - loadOptions, - isClearable, - isMulti, - isLoading, - placeholder, - onChange, - onInputChange, - options, - value, - noOptionsMessage, - onMenuClose, - onBlur, - blurInputOnSelect, - medium, - small, - noMarginTop, - textFieldProps, - inline, - hideLabel, - errorGroup, - onFocus, - inputId, - overflowPortal, - theme, - required, - creatable, - ...restOfProps - } = this.props; - - /* - * By default, we use the built-in Option component from React-Select, along with several Material-UI based - * components (listed in the _components variable above). To customize the select in a particular instance - * (for example, to render more complicated options for search bars), provide the component to use in a prop - * Object. Specify the name of the component to override as the object key, with the component to use in its - * place as the value. Full list of available components to override is available at - * http://react-select.com/components#replaceable-components. As an example, to provide a custom option component, use: - * to the document body directly, none of our CSS - // targeting will work, so we have to supply the styles as a prop. - restOfProps.styles = reactSelectStyles(theme); - } + if (creatable) { + restOfProps.variant = 'creatable'; + } - return ( - 'No results')} - menuPlacement={this.props.menuPlacement || 'auto'} - onMenuClose={onMenuClose} - onFocus={onFocus} - /> - ); + if (overflowPortal) { + restOfProps.menuPortalTarget = document.body; + // Since we're attaching the - Boolean(option.disabledMessage) + const onChange = React.useCallback( + (selection: RegionItem | null) => { + if (selection === null) { + handleSelection(''); + return; } - styles={styles || selectStyles} - textFieldProps={{ - tooltipText: helperText, - }} - required={required} - {...restOfReactSelectProps} - /> - - ); -}; + if (selection.disabledMessage) { + // React Select's disabled state should prevent anything + // from firing, this is basic paranoia. + return; + } + handleSelection(selection?.value); + }, + [handleSelection] + ); + + const options = React.useMemo(() => getRegionOptions(regions), [regions]); -export default React.memo(SelectRegionPanel); + return ( +
+ - - ) : null} - - ); + // Add "Show All" to the list of options if the consumer has so specified. + if (showAll) { + finalOptions.push({ label: 'Show All', value: Infinity }); } -} -export default withStyles(styles)(PaginationFooter); + const defaultPagination = finalOptions.find((eachOption) => { + return eachOption.value === pageSize; + }); + + // If "Show All" is currently selected, pageSize is `Infinity`. + const isShowingAll = pageSize === Infinity; + + return ( + + + {!isShowingAll && ( + + )} + + {!fixedSize ? ( + + = (props) => { errorText={error} value={value} onChange={onChange} - createNew={createTag} + onCreateOption={createTag} noOptionsMessage={getEmptyMessage} - disabled={disabled} + isDisabled={disabled} menuPlacement={menuPlacement} /> ); }; -export default TagsInput; +export { TagsInput }; diff --git a/packages/manager/src/components/TagsInput/index.ts b/packages/manager/src/components/TagsInput/index.ts deleted file mode 100644 index e6d270c9c2e..00000000000 --- a/packages/manager/src/components/TagsInput/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import TagsInput, { Props as _TagsInputProps, Tag as _Tag } from './TagsInput'; -/* tslint:disable */ -export interface TagsInputProps extends _TagsInputProps {} -export interface Tag extends _Tag {} -export default TagsInput; diff --git a/packages/manager/src/components/TagsPanel/TagsPanel.stories.mdx b/packages/manager/src/components/TagsPanel/TagsPanel.stories.mdx index 9f22739bb72..8e8da9b4056 100644 --- a/packages/manager/src/components/TagsPanel/TagsPanel.stories.mdx +++ b/packages/manager/src/components/TagsPanel/TagsPanel.stories.mdx @@ -1,6 +1,6 @@ import { ArgsTable, Canvas, Meta, Story } from '@storybook/addon-docs'; import Typography from 'src/components/core/Typography'; -import TagsPanel from './TagsPanel'; +import { TagsPanel } from './TagsPanel'; import { useArgs } from '@storybook/client-api'; ({ +const useStyles = makeStyles()((theme: Theme) => ({ '@keyframes fadeIn': { from: { opacity: 0, @@ -37,7 +36,6 @@ const useStyles = makeStyles((theme: Theme) => ({ animation: '$fadeIn 225ms linear forwards', borderLeft: `5px solid ${theme.palette.error.dark}`, '& .noticeText': { - ...theme.typography.body1, fontFamily: '"LatoWeb", sans-serif', }, marginTop: 20, @@ -124,22 +122,21 @@ interface ActionMeta { action: string; } -export interface Props { +export interface TagsPanelProps { align?: 'left' | 'right'; tags: string[]; updateTags: (tags: string[]) => Promise; disabled?: boolean; } -const TagsPanel: React.FC = (props) => { - const classes = useStyles(); +const TagsPanel = (props: TagsPanelProps) => { + const { classes, cx } = useStyles(); const { tags, disabled, updateTags } = props; const queryClient = useQueryClient(); const [tagError, setTagError] = React.useState(''); const [isCreatingTag, setIsCreatingTag] = React.useState(false); - const [tagInputValue, setTagInputValue] = React.useState(''); const [tagsLoading, setTagsLoading] = React.useState(false); const { data: profile } = useProfile(); @@ -227,8 +224,6 @@ const TagsPanel: React.FC = (props) => { setTagsLoading(true); updateTags([...tags, value.label].sort()) .then(() => { - // set the input value to blank on submit - setTagInputValue(''); if (userTags) { updateTagsSuggestionsData([...userTags, value], queryClient); } @@ -257,7 +252,6 @@ const TagsPanel: React.FC = (props) => { placeholder="Create or Select a Tag" label="Create or Select a Tag" hideLabel - value={tagInputValue} createOptionPosition="first" className={classes.selectTag} escapeClearsValue @@ -268,9 +262,9 @@ const TagsPanel: React.FC = (props) => { /> ) : (
0, })} > diff --git a/packages/manager/src/features/Account/EnableManaged.tsx b/packages/manager/src/features/Account/EnableManaged.tsx index a6d24f8bf8b..84e2a859676 100644 --- a/packages/manager/src/features/Account/EnableManaged.tsx +++ b/packages/manager/src/features/Account/EnableManaged.tsx @@ -4,11 +4,11 @@ import * as React from 'react'; import Accordion from 'src/components/Accordion'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; -import ConfirmationDialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import Typography from 'src/components/core/Typography'; import ExternalLink from 'src/components/ExternalLink'; -import Grid from 'src/components/Grid'; -import SupportLink from 'src/components/SupportLink'; +import Grid from '@mui/material/Unstable_Grid2'; +import { SupportLink } from 'src/components/SupportLink'; import withLinodes, { DispatchProps, } from 'src/containers/withLinodes.container'; @@ -44,8 +44,8 @@ export const ManagedContent = (props: ContentProps) => { } return ( - - + + Linode Managed includes Backups, Longview Pro, cPanel, and round-the-clock monitoring to help keep your systems up and running. @@ -57,7 +57,7 @@ export const ManagedContent = (props: ContentProps) => { /> - + diff --git a/packages/manager/src/features/Account/EnableObjectStorage.tsx b/packages/manager/src/features/Account/EnableObjectStorage.tsx index cef3dcedc6c..9a5113c3eff 100644 --- a/packages/manager/src/features/Account/EnableObjectStorage.tsx +++ b/packages/manager/src/features/Account/EnableObjectStorage.tsx @@ -6,12 +6,12 @@ import { Link } from 'react-router-dom'; import Accordion from 'src/components/Accordion'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; -import ConfirmationDialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import Notice from 'src/components/Notice'; import TypeToConfirm from 'src/components/TypeToConfirm'; import Typography from 'src/components/core/Typography'; import ExternalLink from 'src/components/ExternalLink'; -import Grid from 'src/components/Grid'; +import Grid from '@mui/material/Unstable_Grid2'; import { updateAccountSettingsData } from 'src/queries/accountSettings'; import { usePreferences } from 'src/queries/preferences'; import { useProfile } from 'src/queries/profile'; @@ -31,15 +31,15 @@ export const ObjectStorageContent = (props: ContentProps) => { if (object_storage !== 'disabled') { return ( - - + + Object Storage is enabled on your account. Upon cancellation, all Object Storage Access Keys will be revoked, all buckets will be removed, and their objects deleted. - + - + diff --git a/packages/manager/src/features/Billing/BillingDetail.tsx b/packages/manager/src/features/Billing/BillingDetail.tsx index f67895c96a3..4da7fecadc3 100644 --- a/packages/manager/src/features/Billing/BillingDetail.tsx +++ b/packages/manager/src/features/Billing/BillingDetail.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import CircleProgress from 'src/components/CircleProgress'; +import { CircleProgress } from 'src/components/CircleProgress'; import { DocumentTitleSegment } from 'src/components/DocumentTitle'; import ErrorState from 'src/components/ErrorState'; import Grid from '@mui/material/Unstable_Grid2'; diff --git a/packages/manager/src/features/Billing/BillingPanels/BillingActivityPanel/BillingActivityPanel.tsx b/packages/manager/src/features/Billing/BillingPanels/BillingActivityPanel/BillingActivityPanel.tsx index 6348f67dc6a..614c6cad35c 100644 --- a/packages/manager/src/features/Billing/BillingPanels/BillingActivityPanel/BillingActivityPanel.tsx +++ b/packages/manager/src/features/Billing/BillingPanels/BillingActivityPanel/BillingActivityPanel.tsx @@ -12,9 +12,9 @@ import { Theme } from '@mui/material/styles'; import TableBody from 'src/components/core/TableBody'; import TableHead from 'src/components/core/TableHead'; import Typography from 'src/components/core/Typography'; -import TextTooltip from 'src/components/TextTooltip/TextTooltip'; -import Currency from 'src/components/Currency'; -import DateTimeDisplay from 'src/components/DateTimeDisplay'; +import { TextTooltip } from 'src/components/TextTooltip'; +import { Currency } from 'src/components/Currency'; +import { DateTimeDisplay } from 'src/components/DateTimeDisplay'; import Select, { Item } from 'src/components/EnhancedSelect/Select'; import InlineMenuAction from 'src/components/InlineMenuAction'; import Link from 'src/components/Link'; diff --git a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/BillingSummary.tsx b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/BillingSummary.tsx index cbb03a3f77d..6d7a0769992 100644 --- a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/BillingSummary.tsx +++ b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/BillingSummary.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import Box from 'src/components/core/Box'; import Button from 'src/components/Button'; -import Currency from 'src/components/Currency'; +import { Currency } from 'src/components/Currency'; import Divider from 'src/components/core/Divider'; import Grid from '@mui/material/Unstable_Grid2'; import PaymentDrawer from './PaymentDrawer'; diff --git a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/GooglePayButton.tsx b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/GooglePayButton.tsx index 8c99ca7021c..08b931803f0 100644 --- a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/GooglePayButton.tsx +++ b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/GooglePayButton.tsx @@ -1,7 +1,7 @@ import { APIWarning } from '@linode/api-v4/lib/types'; import * as React from 'react'; import GooglePayIcon from 'src/assets/icons/payment/gPayButton.svg'; -import CircleProgress from 'src/components/CircleProgress'; +import { CircleProgress } from 'src/components/CircleProgress'; import { makeStyles } from 'tss-react/mui'; import { Theme } from '@mui/material/styles'; import Tooltip from 'src/components/core/Tooltip'; diff --git a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/PayPalButton.tsx b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/PayPalButton.tsx index ccd020b9573..b8d4d5f9de2 100644 --- a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/PayPalButton.tsx +++ b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/PayPalButton.tsx @@ -10,7 +10,7 @@ import { import * as React from 'react'; import { makeStyles } from 'tss-react/mui'; import Tooltip from 'src/components/core/Tooltip'; -import CircleProgress from 'src/components/CircleProgress'; +import { CircleProgress } from 'src/components/CircleProgress'; import Grid from '@mui/material/Unstable_Grid2'; import { reportException } from 'src/exceptionReporting'; import { queryKey as accountBillingKey } from 'src/queries/accountBilling'; diff --git a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/PaymentBits/CreditCardDialog.tsx b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/PaymentBits/CreditCardDialog.tsx index 45af500cd6d..416f3804933 100644 --- a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/PaymentBits/CreditCardDialog.tsx +++ b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/PaymentBits/CreditCardDialog.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { compose } from 'recompose'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; -import ConfirmationDialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import Typography from 'src/components/core/Typography'; import Notice from 'src/components/Notice'; diff --git a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/PaymentBits/PaypalDialog.tsx b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/PaymentBits/PaypalDialog.tsx index 38cc4106c4d..462e6805cb9 100644 --- a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/PaymentBits/PaypalDialog.tsx +++ b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/PaymentBits/PaypalDialog.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { compose } from 'recompose'; -import ConfirmationDialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import Typography from 'src/components/core/Typography'; import DialogActions, { Props as ActionsProps, diff --git a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/PaymentDrawer.tsx b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/PaymentDrawer.tsx index e9cdf27a616..9fa9ba15e22 100644 --- a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/PaymentDrawer.tsx +++ b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/PaymentDrawer.tsx @@ -9,14 +9,14 @@ import InputAdornment from 'src/components/core/InputAdornment'; import { makeStyles } from 'tss-react/mui'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; -import Currency from 'src/components/Currency'; +import { Currency } from 'src/components/Currency'; import Drawer from 'src/components/Drawer'; import ErrorState from 'src/components/ErrorState'; import Grid from '@mui/material/Unstable_Grid2'; import { TooltipIcon } from 'src/components/TooltipIcon/TooltipIcon'; import LinearProgress from 'src/components/LinearProgress'; import Notice from 'src/components/Notice'; -import SupportLink from 'src/components/SupportLink'; +import { SupportLink } from 'src/components/SupportLink'; import TextField from 'src/components/TextField'; import PayPalErrorBoundary from 'src/features/Billing/BillingPanels/PaymentInfoPanel/PayPalErrorBoundary'; import { useAccount } from 'src/queries/account'; diff --git a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PromoDialog.tsx b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PromoDialog.tsx index 728c0fe1f95..52880a8dda7 100644 --- a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PromoDialog.tsx +++ b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PromoDialog.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; -import ConfirmationDialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import { makeStyles } from 'tss-react/mui'; import Typography from 'src/components/core/Typography'; import Notice from 'src/components/Notice'; diff --git a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PromoDisplay.tsx b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PromoDisplay.tsx index 222ea410d86..c42ddf3bab5 100644 --- a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PromoDisplay.tsx +++ b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/PromoDisplay.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import Box from 'src/components/core/Box'; -import Currency from 'src/components/Currency'; -import DateTimeDisplay from 'src/components/DateTimeDisplay'; +import { Currency } from 'src/components/Currency'; +import { DateTimeDisplay } from 'src/components/DateTimeDisplay'; import { TooltipIcon } from 'src/components/TooltipIcon/TooltipIcon'; import Typography from 'src/components/core/Typography'; import { useTheme } from '@mui/material/styles'; diff --git a/packages/manager/src/features/Billing/BillingPanels/ContactInfoPanel/UpdateContactInformationForm/UpdateContactInformationForm.tsx b/packages/manager/src/features/Billing/BillingPanels/ContactInfoPanel/UpdateContactInformationForm/UpdateContactInformationForm.tsx index d880c94c060..b73552bb0fa 100644 --- a/packages/manager/src/features/Billing/BillingPanels/ContactInfoPanel/UpdateContactInformationForm/UpdateContactInformationForm.tsx +++ b/packages/manager/src/features/Billing/BillingPanels/ContactInfoPanel/UpdateContactInformationForm/UpdateContactInformationForm.tsx @@ -228,9 +228,7 @@ const UpdateContactInformationForm = ({ onClose, focusEmail }: Props) => { label="Country" errorText={errorMap.country} isClearable={false} - onChange={(item: Item) => - formik.setFieldValue('country', item.value) - } + onChange={(item) => formik.setFieldValue('country', item.value)} options={countryResults} placeholder="Select a Country" required={flags.regionDropdown} @@ -251,9 +249,7 @@ const UpdateContactInformationForm = ({ onClose, focusEmail }: Props) => { label={`${formik.values.country === 'US' ? 'State' : 'Province'}`} errorText={errorMap.state} isClearable={false} - onChange={(item: Item) => - formik.setFieldValue('state', item.value) - } + onChange={(item) => formik.setFieldValue('state', item.value)} options={filteredRegionResults} placeholder={ formik.values.country === 'US' ? 'state' : 'province' @@ -262,10 +258,12 @@ const UpdateContactInformationForm = ({ onClose, focusEmail }: Props) => { value={ filteredRegionResults.find( ({ value }) => value === formik.values.state - ) ?? '' + ) ?? null } textFieldProps={{ - 'data-qa-contact-state-province': true, + dataAttrs: { + 'data-qa-contact-state-province': true, + }, }} /> ) : ( diff --git a/packages/manager/src/features/Billing/BillingPanels/PaymentInfoPanel/AddPaymentMethodDrawer/AddPaymentMethodDrawer.tsx b/packages/manager/src/features/Billing/BillingPanels/PaymentInfoPanel/AddPaymentMethodDrawer/AddPaymentMethodDrawer.tsx index 70e45712835..a1e8995a637 100644 --- a/packages/manager/src/features/Billing/BillingPanels/PaymentInfoPanel/AddPaymentMethodDrawer/AddPaymentMethodDrawer.tsx +++ b/packages/manager/src/features/Billing/BillingPanels/PaymentInfoPanel/AddPaymentMethodDrawer/AddPaymentMethodDrawer.tsx @@ -80,7 +80,7 @@ export const AddPaymentMethodDrawer = (props: Props) => { {isProcessing ? ( ; - -export const InvoiceDetail = (props: CombinedProps) => { +export const InvoiceDetail = () => { + const { invoiceId } = useParams<{ invoiceId: string }>(); const theme = useTheme(); const csvRef = React.useRef(); @@ -51,11 +49,6 @@ export const InvoiceDetail = (props: CombinedProps) => { const flags = useFlags(); const requestData = () => { - const { - match: { - params: { invoiceId }, - }, - } = props; setLoading(true); const getAllInvoiceItems = getAll((params, filter) => @@ -235,9 +228,7 @@ export const InvoiceDetail = (props: CombinedProps) => { ); }; -const enhanced = compose(withRouter); - -export default enhanced(InvoiceDetail); +export default InvoiceDetail; const csvHeaders = [ { label: 'Description', key: 'label' }, diff --git a/packages/manager/src/features/Billing/InvoiceDetail/InvoiceTable.tsx b/packages/manager/src/features/Billing/InvoiceDetail/InvoiceTable.tsx index 6d126bca71f..9160aa79173 100644 --- a/packages/manager/src/features/Billing/InvoiceDetail/InvoiceTable.tsx +++ b/packages/manager/src/features/Billing/InvoiceDetail/InvoiceTable.tsx @@ -5,8 +5,8 @@ import { makeStyles } from 'tss-react/mui'; import { Theme } from '@mui/material/styles'; import TableBody from 'src/components/core/TableBody'; import TableHead from 'src/components/core/TableHead'; -import Currency from 'src/components/Currency'; -import DateTimeDisplay from 'src/components/DateTimeDisplay'; +import { Currency } from 'src/components/Currency'; +import { DateTimeDisplay } from 'src/components/DateTimeDisplay'; import Paginate from 'src/components/Paginate'; import PaginationFooter from 'src/components/PaginationFooter'; import Table from 'src/components/Table'; diff --git a/packages/manager/src/features/Databases/DatabaseCreate/DatabaseCreate.tsx b/packages/manager/src/features/Databases/DatabaseCreate/DatabaseCreate.tsx index edc12e35a25..8ecf303cb22 100644 --- a/packages/manager/src/features/Databases/DatabaseCreate/DatabaseCreate.tsx +++ b/packages/manager/src/features/Databases/DatabaseCreate/DatabaseCreate.tsx @@ -19,7 +19,7 @@ import MySQLIcon from 'src/assets/icons/mysql.svg'; import PostgreSQLIcon from 'src/assets/icons/postgresql.svg'; import { BetaChip } from 'src/components/BetaChip/BetaChip'; import Button from 'src/components/Button'; -import CircleProgress from 'src/components/CircleProgress'; +import { CircleProgress } from 'src/components/CircleProgress'; import Divider from 'src/components/core/Divider'; import FormControl from 'src/components/core/FormControl'; import FormControlLabel from 'src/components/core/FormControlLabel'; @@ -28,10 +28,10 @@ import RadioGroup from 'src/components/core/RadioGroup'; import Typography from 'src/components/core/Typography'; import SingleValue from 'src/components/EnhancedSelect/components/SingleValue'; import Select, { Item } from 'src/components/EnhancedSelect/Select'; -import RegionSelect from 'src/components/EnhancedSelect/variants/RegionSelect'; +import { RegionSelect } from 'src/components/EnhancedSelect/variants/RegionSelect'; import RegionOption from 'src/components/EnhancedSelect/variants/RegionSelect/RegionOption'; import ErrorState from 'src/components/ErrorState'; -import Grid from 'src/components/Grid'; +import Grid from '@mui/material/Unstable_Grid2'; import LandingHeader from 'src/components/LandingHeader'; import Link from 'src/components/Link'; import MultipleIPInput from 'src/components/MultipleIPInput'; @@ -462,7 +462,7 @@ const DatabaseCreate = () => { /> {createError ? : null} - + Name Your Cluster { /> - + Select Engine and Region = React.memo((props) => { handlePolicyChange(selected.value) } /> - - + + ); }); diff --git a/packages/manager/src/features/Firewalls/FirewallDetail/Rules/FirewallRulesLanding.tsx b/packages/manager/src/features/Firewalls/FirewallDetail/Rules/FirewallRulesLanding.tsx index cb8987b4864..880c7449fd5 100644 --- a/packages/manager/src/features/Firewalls/FirewallDetail/Rules/FirewallRulesLanding.tsx +++ b/packages/manager/src/features/Firewalls/FirewallDetail/Rules/FirewallRulesLanding.tsx @@ -7,7 +7,7 @@ import { APIError } from '@linode/api-v4/lib/types'; import * as React from 'react'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; -import ConfirmationDialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; diff --git a/packages/manager/src/features/Firewalls/FirewallDetail/Rules/firewallRuleEditor.ts b/packages/manager/src/features/Firewalls/FirewallDetail/Rules/firewallRuleEditor.ts index 2d74a85548d..b2f59f5a01c 100644 --- a/packages/manager/src/features/Firewalls/FirewallDetail/Rules/firewallRuleEditor.ts +++ b/packages/manager/src/features/Firewalls/FirewallDetail/Rules/firewallRuleEditor.ts @@ -126,14 +126,6 @@ const ruleEditorReducer = ( // Errors might no longer apply to the modified rule, so we delete them. delete lastRevision.errors; - if (!action.modifiedRule.label) { - delete lastRevision.label; - } - - if (!action.modifiedRule.description) { - delete lastRevision.description; - } - draft[action.idx].push({ ...lastRevision, ...action.modifiedRule, diff --git a/packages/manager/src/features/Firewalls/FirewallDetail/index.tsx b/packages/manager/src/features/Firewalls/FirewallDetail/index.tsx index 46c93cc27cb..72d5e4573a1 100644 --- a/packages/manager/src/features/Firewalls/FirewallDetail/index.tsx +++ b/packages/manager/src/features/Firewalls/FirewallDetail/index.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import CircleProgress from 'src/components/CircleProgress'; +import { CircleProgress } from 'src/components/CircleProgress'; import TabPanels from 'src/components/core/ReachTabPanels'; import Tabs from 'src/components/core/ReachTabs'; import { DocumentTitleSegment } from 'src/components/DocumentTitle'; diff --git a/packages/manager/src/features/Firewalls/FirewallLanding/FirewallDialog.tsx b/packages/manager/src/features/Firewalls/FirewallLanding/FirewallDialog.tsx index 85748770296..99416e1a531 100644 --- a/packages/manager/src/features/Firewalls/FirewallLanding/FirewallDialog.tsx +++ b/packages/manager/src/features/Firewalls/FirewallLanding/FirewallDialog.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; -import Dialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import { useDeleteFirewall, useMutateFirewall } from 'src/queries/firewalls'; import { capitalize } from 'src/utilities/capitalize'; @@ -59,7 +59,7 @@ const FirewallDialog = (props: Props) => { }; return ( - { } > Are you sure you want to {mode} this Firewall? - + ); }; diff --git a/packages/manager/src/features/Firewalls/FirewallLanding/FirewallLanding.tsx b/packages/manager/src/features/Firewalls/FirewallLanding/FirewallLanding.tsx index 5deedbafa60..52afb293125 100644 --- a/packages/manager/src/features/Firewalls/FirewallLanding/FirewallLanding.tsx +++ b/packages/manager/src/features/Firewalls/FirewallLanding/FirewallLanding.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useHistory, useRouteMatch } from 'react-router-dom'; -import CircleProgress from 'src/components/CircleProgress'; +import { CircleProgress } from 'src/components/CircleProgress'; import LandingHeader from 'src/components/LandingHeader'; import { useFirewallsQuery } from 'src/queries/firewalls'; import CreateFirewallDrawer from './CreateFirewallDrawer'; diff --git a/packages/manager/src/features/Firewalls/FirewallLanding/FirewallRow.tsx b/packages/manager/src/features/Firewalls/FirewallLanding/FirewallRow.tsx index 002791ffcfd..2be5800e7be 100644 --- a/packages/manager/src/features/Firewalls/FirewallLanding/FirewallRow.tsx +++ b/packages/manager/src/features/Firewalls/FirewallLanding/FirewallRow.tsx @@ -5,11 +5,11 @@ import { Link } from 'react-router-dom'; import Hidden from 'src/components/core/Hidden'; import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; -import StatusIcon from 'src/components/StatusIcon'; +import { StatusIcon } from 'src/components/StatusIcon/StatusIcon'; import TableCell from 'src/components/TableCell'; import TableRow from 'src/components/TableRow'; import { useAllFirewallDevicesQuery } from 'src/queries/firewalls'; -import capitalize from 'src/utilities/capitalize'; +import { capitalize } from 'src/utilities/capitalize'; import ActionMenu, { ActionHandlers } from './FirewallActionMenu'; const useStyles = makeStyles((theme: Theme) => ({ diff --git a/packages/manager/src/features/Footer/Footer.tsx b/packages/manager/src/features/Footer/Footer.tsx index 8995275eb26..4fdc388e356 100644 --- a/packages/manager/src/features/Footer/Footer.tsx +++ b/packages/manager/src/features/Footer/Footer.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import ExternalLink from 'src/components/ExternalLink'; -import Grid from 'src/components/Grid'; +import Grid from '@mui/material/Unstable_Grid2'; import packageJson from '../../../package.json'; interface Props { @@ -31,7 +31,6 @@ const useStyles = makeStyles((theme: Theme) => ({ }, }, version: { - marginLeft: theme.spacing(2), '&.MuiGrid-item': { paddingLeft: 0, }, @@ -86,11 +85,8 @@ export const Footer: React.FC = (props) => { [classes.desktopMenuIsOpen]: desktopMenuIsOpen, })} > - - {renderVersion(classes.link)} - + {renderVersion(classes.link)} = (props) => { { return ( - + {text} { hideLabel className={classes.enhancedSelectWrapper} styles={selectStyles} - value={false} />
diff --git a/packages/manager/src/features/Help/Panels/OtherWays.tsx b/packages/manager/src/features/Help/Panels/OtherWays.tsx index 8eafa9107ef..745af72d999 100644 --- a/packages/manager/src/features/Help/Panels/OtherWays.tsx +++ b/packages/manager/src/features/Help/Panels/OtherWays.tsx @@ -6,8 +6,8 @@ import Support from 'src/assets/icons/support.svg'; import { createStyles, withStyles, WithStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; -import Grid from 'src/components/Grid'; -import Tile from 'src/components/Tile'; +import { Tile } from 'src/components/Tile/Tile'; +import Grid from '@mui/material/Unstable_Grid2'; type ClassNames = 'root' | 'wrapper' | 'heading'; @@ -40,8 +40,8 @@ export class OtherWays extends React.Component { Other Ways to Get Help - - + + { link="https://linode.com/docs/" /> - + { link="https://linode.com/community/questions" /> - + { link="https://status.linode.com" /> - + ({ root: { @@ -26,8 +26,11 @@ const useStyles = makeStyles((theme: Theme) => ({ }, withSeparator: { borderLeft: `1px solid ${theme.palette.divider}`, - '&.MuiGrid-item': { - paddingLeft: theme.spacing(4), + paddingLeft: theme.spacing(4), + [theme.breakpoints.down('sm')]: { + borderLeft: 'none', + paddingLeft: 0, + marginTop: theme.spacing(4), }, }, })); @@ -100,14 +103,13 @@ const PopularPosts: React.FC = () => { return ( - + Most Popular Documentation: {renderPopularDocs()} }, heading: { textAlign: 'center', - marginBottom: theme.spacing(2), + marginBottom: theme.spacing(1), }, card: { display: 'flex', @@ -94,15 +94,21 @@ export class OtherWays extends React.Component { const { drawerOpen } = this.state; return ( - - - + <> + + Didn’t find what you need? Get help. - - + + { link="https://linode.com/community/" /> - + - - - - 1 ? `Search results for "${query}"` : 'Search' - } - data-qa-support-search-landing-title - /> - - - - + + 1 ? `Search results for "${query}"` : 'Search' + } + data-qa-support-search-landing-title + /> + + {searchError && {searchError}} - - + + - - + + - - - - + + ); } diff --git a/packages/manager/src/features/Images/ImageSelect.tsx b/packages/manager/src/features/Images/ImageSelect.tsx index c7db72e7c93..7c65c6b1c1b 100644 --- a/packages/manager/src/features/Images/ImageSelect.tsx +++ b/packages/manager/src/features/Images/ImageSelect.tsx @@ -1,44 +1,37 @@ import { Image } from '@linode/api-v4/lib/images'; import { clone, propOr } from 'ramda'; import * as React from 'react'; -import { makeStyles } from '@mui/styles'; -import { Theme } from '@mui/material/styles'; import Select, { GroupType, Item } from 'src/components/EnhancedSelect/Select'; -import Grid from 'src/components/Grid'; +import Box from '@mui/material/Box'; import { TooltipIcon } from 'src/components/TooltipIcon/TooltipIcon'; import { useAllImagesQuery } from 'src/queries/images'; import { getAPIErrorOrDefault } from 'src/utilities/errorUtils'; import { groupImages } from 'src/utilities/images'; -const useStyles = makeStyles((theme: Theme) => ({ - root: { - width: '100%', - }, - selectContainer: { - width: `calc(415px + ${theme.spacing(2)})`, - [theme.breakpoints.down('sm')]: { - width: '100%', - }, - }, -})); - -interface Props { +interface BaseProps { images: Image[]; imageError?: string; imageFieldError?: string; - isMulti?: boolean; - helperText?: string; - value?: Item | Item[]; disabled?: boolean; - onSelect: (selected: Item | Item[]) => void; label?: string; required?: boolean; anyAllOption?: boolean; + helperText?: string; } -type CombinedProps = Props; +interface Props extends BaseProps { + isMulti?: false; + value?: Item; + onSelect: (selected: Item) => void; +} + +interface MultiProps extends BaseProps { + isMulti: true; + value?: Item[]; + onSelect: (selected: Item[]) => void; +} -export const ImageSelect: React.FC = (props) => { +export const ImageSelect = (props: Props | MultiProps) => { const { helperText, images, @@ -53,8 +46,6 @@ export const ImageSelect: React.FC = (props) => { anyAllOption, } = props; - const classes = useStyles(); - const { isLoading: imagesLoading, isError, error } = useAllImagesQuery( {}, {} @@ -84,15 +75,18 @@ export const ImageSelect: React.FC = (props) => { } return ( - - + { onChange={(selected: Item) => setVersion(selected)} isClearable={false} /> - +
- + { typesLoading, classes, ]} - isOnCreate /> - + diff --git a/packages/manager/src/features/Kubernetes/CreateCluster/NodePoolPanel.test.tsx b/packages/manager/src/features/Kubernetes/CreateCluster/NodePoolPanel.test.tsx new file mode 100644 index 00000000000..8d6cff609b5 --- /dev/null +++ b/packages/manager/src/features/Kubernetes/CreateCluster/NodePoolPanel.test.tsx @@ -0,0 +1,22 @@ +import * as React from 'react'; +import { renderWithTheme } from 'src/utilities/testHelpers'; +import NodePoolPanel from './NodePoolPanel'; +import { extendedTypes } from 'src/__data__'; + +const props = { + clusterId: 0, + clusterLabel: 'test', + open: true, + onClose: jest.fn(), + types: extendedTypes, + typesLoading: false, + addNodePool: jest.fn(), +}; + +describe('NodePoolPanel', () => { + it('should render plan heading', async () => { + const { findByText } = renderWithTheme(); + + await findByText('Dedicated CPU'); + }); +}); diff --git a/packages/manager/src/features/Kubernetes/CreateCluster/NodePoolPanel.tsx b/packages/manager/src/features/Kubernetes/CreateCluster/NodePoolPanel.tsx index 19b69d1165c..656e6a21acc 100644 --- a/packages/manager/src/features/Kubernetes/CreateCluster/NodePoolPanel.tsx +++ b/packages/manager/src/features/Kubernetes/CreateCluster/NodePoolPanel.tsx @@ -1,35 +1,25 @@ import { KubeNodePoolResponse } from '@linode/api-v4'; import * as React from 'react'; import { compose } from 'recompose'; -import CircleProgress from 'src/components/CircleProgress'; -import Grid from 'src/components/core/Grid'; +import { CircleProgress } from 'src/components/CircleProgress'; +import Grid from '@mui/material/Unstable_Grid2'; import ErrorState from 'src/components/ErrorState'; import renderGuard, { RenderGuardProps } from 'src/components/RenderGuard'; -import SelectPlanQuantityPanel, { - ExtendedTypeWithCount, -} from 'src/features/linodes/LinodesCreate/SelectPlanQuantityPanel'; -import { ExtendedType } from 'src/utilities/extendType'; +import SelectPlanQuantityPanel from 'src/features/linodes/LinodesCreate/SelectPlanQuantityPanel'; +import { ExtendedType, extendType } from 'src/utilities/extendType'; + +const DEFAULT_PLAN_COUNT = 3; interface Props { types: ExtendedType[]; typesLoading: boolean; typesError?: string; apiError?: string; - isOnCreate?: boolean; addNodePool: (pool: Partial) => any; // Has to accept both extended and non-extended pools } type CombinedProps = Props; -export const addCountToTypes = ( - types: ExtendedType[] -): ExtendedTypeWithCount[] => { - return types.map((thisType) => ({ - ...thisType, - count: 3, - })); -}; - export const NodePoolPanel: React.FunctionComponent = ( props ) => { @@ -53,13 +43,15 @@ const RenderLoadingOrContent: React.FunctionComponent = ( }; const Panel: React.FunctionComponent = (props) => { - const { addNodePool, apiError, types, isOnCreate } = props; + const { addNodePool, apiError, types } = props; - const [_types, setNewType] = React.useState( - addCountToTypes(types) + const [typeCountMap, setTypeCountMap] = React.useState>( + new Map() ); const [selectedType, setSelectedType] = React.useState(); + const extendedTypes = types.map(extendType); + const submitForm = (selectedPlanType: string, nodeCount: number) => { /** * Add pool and reset form state. @@ -74,31 +66,27 @@ const Panel: React.FunctionComponent = (props) => { }; const updatePlanCount = (planId: string, newCount: number) => { - const newTypes = _types.map((thisType: ExtendedTypeWithCount) => { - if (thisType.id === planId) { - return { ...thisType, count: newCount }; - } - return thisType; - }); - setNewType(newTypes); + setTypeCountMap(new Map(typeCountMap).set(planId, newCount)); setSelectedType(planId); }; return ( - + t.class !== 'nanode' && t.class !== 'gpu' )} // No Nanodes or GPUs in clusters + getTypeCount={(planId) => + typeCountMap.get(planId) ?? DEFAULT_PLAN_COUNT + } selectedID={selectedType} onSelect={(newType: string) => setSelectedType(newType)} error={apiError} header="Add Node Pools" copy="Add groups of Linodes to your cluster. You can have a maximum of 100 Linodes per node pool." updatePlanCount={updatePlanCount} - submitForm={submitForm} - isOnCreate={isOnCreate} + onAdd={submitForm} resetValues={() => null} // In this flow we don't want to clear things on tab changes /> diff --git a/packages/manager/src/features/Kubernetes/KubeCheckoutBar/HACheckbox.tsx b/packages/manager/src/features/Kubernetes/KubeCheckoutBar/HACheckbox.tsx index b0ad64fc649..4213a3602d6 100644 --- a/packages/manager/src/features/Kubernetes/KubeCheckoutBar/HACheckbox.tsx +++ b/packages/manager/src/features/Kubernetes/KubeCheckoutBar/HACheckbox.tsx @@ -4,7 +4,7 @@ import Box from 'src/components/core/Box'; import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; -import DisplayPrice from 'src/components/DisplayPrice'; +import { DisplayPrice } from 'src/components/DisplayPrice'; import Link from 'src/components/Link'; import { HIGH_AVAILABILITY_PRICE } from 'src/constants'; diff --git a/packages/manager/src/features/Kubernetes/KubeCheckoutBar/KubeCheckoutBar.tsx b/packages/manager/src/features/Kubernetes/KubeCheckoutBar/KubeCheckoutBar.tsx index 5b21caa4f8d..7342dd82f12 100644 --- a/packages/manager/src/features/Kubernetes/KubeCheckoutBar/KubeCheckoutBar.tsx +++ b/packages/manager/src/features/Kubernetes/KubeCheckoutBar/KubeCheckoutBar.tsx @@ -1,7 +1,7 @@ import { KubeNodePoolResponse } from '@linode/api-v4'; import * as React from 'react'; -import CheckoutBar from 'src/components/CheckoutBar'; -import CircleProgress from 'src/components/CircleProgress'; +import { CheckoutBar } from 'src/components/CheckoutBar/CheckoutBar'; +import { CircleProgress } from 'src/components/CircleProgress'; import Divider from 'src/components/core/Divider'; import Notice from 'src/components/Notice'; import renderGuard from 'src/components/RenderGuard'; @@ -14,11 +14,11 @@ import { useAccount } from 'src/queries/account'; import { useAccountAgreements } from 'src/queries/accountAgreements'; import { useProfile } from 'src/queries/profile'; import { useSpecificTypes } from 'src/queries/types'; +import { extendTypesQueryResult } from 'src/utilities/extendType'; import { isEURegion } from 'src/utilities/formatRegion'; import { getTotalClusterPrice, nodeWarning } from '../kubeUtils'; import HACheckbox from './HACheckbox'; import NodePoolSummary from './NodePoolSummary'; -import { extendTypesQueryResult } from 'src/utilities/extendType'; export interface Props { pools: KubeNodePoolResponse[]; diff --git a/packages/manager/src/features/Kubernetes/KubeCheckoutBar/NodePoolSummary.tsx b/packages/manager/src/features/Kubernetes/KubeCheckoutBar/NodePoolSummary.tsx index a788868a750..1101b73372e 100644 --- a/packages/manager/src/features/Kubernetes/KubeCheckoutBar/NodePoolSummary.tsx +++ b/packages/manager/src/features/Kubernetes/KubeCheckoutBar/NodePoolSummary.tsx @@ -5,7 +5,7 @@ import Divider from 'src/components/core/Divider'; import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; -import DisplayPrice from 'src/components/DisplayPrice'; +import { DisplayPrice } from 'src/components/DisplayPrice'; import EnhancedNumberInput from 'src/components/EnhancedNumberInput'; import IconButton from 'src/components/IconButton'; import { ExtendedType } from 'src/utilities/extendType'; diff --git a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/DeleteKubernetesClusterDialog.tsx b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/DeleteKubernetesClusterDialog.tsx index 23b5e955927..e9d764f92f1 100644 --- a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/DeleteKubernetesClusterDialog.tsx +++ b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/DeleteKubernetesClusterDialog.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; -import ConfirmationDialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import Typography from 'src/components/core/Typography'; import TypeToConfirm from 'src/components/TypeToConfirm'; import Notice from 'src/components/Notice'; @@ -38,6 +38,12 @@ export const DeleteKubernetesClusterDialog = (props: Props) => { const disabled = preferences?.type_to_confirm !== false && confirmText !== clusterLabel; + React.useEffect(() => { + if (open && confirmText !== '') { + setConfirmText(''); + } + }, [open]); + const onDelete = () => { deleteCluster({ id: clusterId }).then(() => { onClose(); diff --git a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubeClusterSpecs.tsx b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubeClusterSpecs.tsx index ed97cc435d4..2a4ef654149 100644 --- a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubeClusterSpecs.tsx +++ b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubeClusterSpecs.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; -import Grid from 'src/components/Grid'; +import Grid from '@mui/material/Unstable_Grid2'; import { useAllKubernetesNodePoolQuery } from 'src/queries/kubernetes'; import { useSpecificTypes } from 'src/queries/types'; import { extendTypesQueryResult } from 'src/utilities/extendType'; @@ -84,12 +84,11 @@ export const KubeClusterSpecs = (props: Props) => { return ( - + {spec} @@ -97,13 +96,9 @@ export const KubeClusterSpecs = (props: Props) => { }; return ( - - - {kubeSpecsLeft.map(kubeSpecItem)} - - - {kubeSpecsRight.map(kubeSpecItem)} - + + {kubeSpecsLeft.map(kubeSpecItem)} + {kubeSpecsRight.map(kubeSpecItem)} ); }; diff --git a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubeConfigDisplay.tsx b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubeConfigDisplay.tsx index ea34d747afe..936db24ecba 100644 --- a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubeConfigDisplay.tsx +++ b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubeConfigDisplay.tsx @@ -2,7 +2,8 @@ import * as React from 'react'; import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; -import Grid from 'src/components/Grid'; +import Grid from '@mui/material/Unstable_Grid2'; +import Box from '@mui/material/Box'; import DetailsIcon from 'src/assets/icons/code-file.svg'; import DownloadIcon from 'src/assets/icons/lke-download.svg'; import ResetIcon from 'src/assets/icons/reset.svg'; @@ -129,7 +130,7 @@ export const KubeConfigDisplay = (props: Props) => { return ( <> - + Kubernetes API Endpoint: @@ -143,13 +144,12 @@ export const KubeConfigDisplay = (props: Props) => { )} - + Kubeconfig:
- @@ -160,17 +160,12 @@ export const KubeConfigDisplay = (props: Props) => { {`${clusterLabel}-kubeconfig.yaml`} - - + + View - - + setResetKubeConfigDialogOpen(true)} className={classes.kubeconfigElement} > @@ -188,7 +183,7 @@ export const KubeConfigDisplay = (props: Props) => { > Reset - +
diff --git a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubeConfigDrawer.tsx b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubeConfigDrawer.tsx index 843d6b15916..b7ae0d2713f 100644 --- a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubeConfigDrawer.tsx +++ b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubeConfigDrawer.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import Download from 'src/assets/icons/download.svg'; -import CopyTooltip from 'src/components/CopyTooltip'; -import Grid from 'src/components/core/Grid'; +import { CopyTooltip } from 'src/components/CopyTooltip/CopyTooltip'; +import Grid from '@mui/material/Unstable_Grid2'; import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; @@ -66,10 +66,10 @@ export const KubeConfigDrawer = (props: Props) => { loading={isLoading} > - + {clusterLabel} - + - + diff --git a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubernetesClusterDetail.tsx b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubernetesClusterDetail.tsx index 2b2f511fabd..5fa6792d234 100644 --- a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubernetesClusterDetail.tsx +++ b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubernetesClusterDetail.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { useLocation, useParams } from 'react-router-dom'; -import CircleProgress from 'src/components/CircleProgress'; -import Grid from 'src/components/core/Grid'; +import { CircleProgress } from 'src/components/CircleProgress'; +import Grid from '@mui/material/Unstable_Grid2'; import { DocumentTitleSegment } from 'src/components/DocumentTitle'; import ErrorState from 'src/components/ErrorState'; import { getKubeHighAvailability } from 'src/features/Kubernetes/kubeUtils'; @@ -73,7 +73,7 @@ export const KubernetesClusterDetail = () => { return ( <> - + { : undefined } /> - + - + { + it('should render plan heading', async () => { + const { findByText } = renderWithTheme(); + + await findByText('Dedicated CPU'); + }); +}); diff --git a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/NodePoolsDisplay/AddNodePoolDrawer.tsx b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/NodePoolsDisplay/AddNodePoolDrawer.tsx index a087c77bb82..a3baeddd751 100644 --- a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/NodePoolsDisplay/AddNodePoolDrawer.tsx +++ b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/NodePoolsDisplay/AddNodePoolDrawer.tsx @@ -7,10 +7,7 @@ import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; import Drawer from 'src/components/Drawer'; import Notice from 'src/components/Notice'; -import { addCountToTypes } from 'src/features/Kubernetes/CreateCluster/NodePoolPanel'; -import SelectPlanQuantityPanel, { - ExtendedTypeWithCount, -} from 'src/features/linodes/LinodesCreate/SelectPlanQuantityPanel'; +import SelectPlanQuantityPanel from 'src/features/linodes/LinodesCreate/SelectPlanQuantityPanel'; import { useCreateNodePoolMutation } from 'src/queries/kubernetes'; import { useAllTypes } from 'src/queries/types'; import { extendType } from 'src/utilities/extendType'; @@ -84,18 +81,22 @@ export const AddNodePoolDrawer = (props: Props) => { } = useCreateNodePoolMutation(clusterId); // Only want to use current types here. - const typesData = filterCurrentTypes(types?.map(extendType)); + const extendedTypes = filterCurrentTypes(types?.map(extendType)); - const [selectedType, setSelectedType] = React.useState( - undefined - ); - const [_types, setNewType] = React.useState( - addCountToTypes(typesData || []) + const [selectedTypeInfo, setSelectedTypeInfo] = React.useState< + { planId: string; count: number } | undefined + >(undefined); + + const getTypeCount = React.useCallback( + (planId: string) => + planId === selectedTypeInfo?.planId ? selectedTypeInfo.count : 0, + [selectedTypeInfo] ); - const _selectedType = _types.find((thisType) => thisType.id === selectedType); - const currentCount = _selectedType?.count ?? 0; - const pricePerNode = _selectedType?.price?.monthly ?? 0; + const selectedType = selectedTypeInfo + ? extendedTypes.find((thisType) => thisType.id === selectedTypeInfo.planId) + : undefined; + const pricePerNode = selectedType?.price?.monthly ?? 0; React.useEffect(() => { if (open) { @@ -110,38 +111,21 @@ export const AddNodePoolDrawer = (props: Props) => { }, [error]); const resetDrawer = () => { - const newTypes = _types.map((thisType) => { - return { - ...thisType, - count: 0, - }; - }); - setNewType(newTypes); - setSelectedType(undefined); + setSelectedTypeInfo(undefined); }; const updatePlanCount = (planId: string, newCount: number) => { - const newTypes = _types.map((thisType: any) => { - if (thisType.id === planId) { - return { ...thisType, count: newCount }; - } - return { ...thisType, count: 0 }; - }); - setNewType(newTypes); - // If everything's empty, we need to reset the selected type. - if (newTypes.every((thisType) => thisType.count === 0)) { - setSelectedType(undefined); - } else { - setSelectedType(planId); - } + setSelectedTypeInfo(newCount > 0 ? { planId, count: newCount } : undefined); }; const handleAdd = () => { - const type = _types.find((thisType) => thisType.id === selectedType); - if (!type || !selectedType) { + if (!selectedTypeInfo) { return; } - return createPool({ type: type.id, count: type.count }).then(() => { + return createPool({ + type: selectedTypeInfo.planId, + count: selectedTypeInfo.count, + }).then(() => { onClose(); }); }; @@ -159,39 +143,47 @@ export const AddNodePoolDrawer = (props: Props) => {
t.class !== 'nanode' && t.class !== 'gpu' )} - selectedID={selectedType} - onSelect={(newType: string) => setSelectedType(newType)} + getTypeCount={getTypeCount} + selectedID={selectedTypeInfo?.planId} + onSelect={(newType: string) => { + if (selectedTypeInfo?.planId !== newType) { + setSelectedTypeInfo({ planId: newType, count: 1 }); + } + }} updatePlanCount={updatePlanCount} addPool={handleAdd} isSubmitting={isLoading} resetValues={resetDrawer} /> - {currentCount > 0 && currentCount < 3 && ( - - )} + {selectedTypeInfo && + selectedTypeInfo.count > 0 && + selectedTypeInfo.count < 3 && ( + + )} 0 ? 'space-between' : 'flex-end'} + justifyContent={selectedTypeInfo ? 'space-between' : 'flex-end'} className={classes.boxOuter} > - {currentCount > 0 && ( + {selectedTypeInfo && ( This pool will add{' '} - ${currentCount * pricePerNode}/month ( - {pluralize('node', 'nodes', currentCount)} at ${pricePerNode} + ${selectedTypeInfo.count * pricePerNode}/month ( + {pluralize('node', 'nodes', selectedTypeInfo.count)} at $ + {pricePerNode} /month) {' '} to this cluster. @@ -199,8 +191,8 @@ export const AddNodePoolDrawer = (props: Props) => { )} + {autoscaler.enabled ? ( + + {`(Min ${autoscaler.min} / Max ${autoscaler.max})`} + + ) : null} + + + +
+ +
+
+ - - {typeLabel} - - - - {autoscaler.enabled ? ( - - {`(Min ${autoscaler.min} / Max ${autoscaler.max})`} - - ) : null} - - - -
- -
-
-
+
- - + ); }; diff --git a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/NodePoolsDisplay/NodePoolsDisplay.tsx b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/NodePoolsDisplay/NodePoolsDisplay.tsx index fdc30ea3631..e4429177e5b 100644 --- a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/NodePoolsDisplay/NodePoolsDisplay.tsx +++ b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/NodePoolsDisplay/NodePoolsDisplay.tsx @@ -5,7 +5,7 @@ import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; import ErrorState from 'src/components/ErrorState'; -import Grid from 'src/components/Grid'; +import Grid from '@mui/material/Unstable_Grid2'; import { RecycleNodePoolDialog } from '../RecycleNodePoolDialog'; import { AddNodePoolDrawer } from './AddNodePoolDrawer'; import { ResizeNodePoolDrawer } from './ResizeNodePoolDrawer'; @@ -15,17 +15,13 @@ import { DeleteNodePoolDialog } from './DeleteNodePoolDialog'; import { AutoscalePoolDialog } from './AutoscalePoolDialog'; import Button from 'src/components/Button'; import { useAllKubernetesNodePoolQuery } from 'src/queries/kubernetes'; -import CircleProgress from 'src/components/CircleProgress'; +import { CircleProgress } from 'src/components/CircleProgress'; import { RecycleClusterDialog } from '../RecycleClusterDialog'; import classNames from 'classnames'; import { useSpecificTypes } from 'src/queries/types'; import { extendTypesQueryResult } from 'src/utilities/extendType'; const useStyles = makeStyles((theme: Theme) => ({ - root: { - padding: theme.spacing(0), - paddingTop: '4px', - }, button: { marginBottom: theme.spacing(), marginLeft: theme.spacing(), @@ -53,9 +49,6 @@ const useStyles = makeStyles((theme: Theme) => ({ display: 'flex', alignItems: 'center', }, - nodePool: { - marginBottom: theme.spacing(3), - }, })); export interface Props { @@ -65,7 +58,6 @@ export interface Props { export const NodePoolsDisplay = (props: Props) => { const { clusterID, clusterLabel } = props; - const classes = useStyles(); const { @@ -124,9 +116,9 @@ export const NodePoolsDisplay = (props: Props) => { container alignItems="center" justifyContent="space-between" - updateFor={[classes]} + spacing={2} > - + { Node Pools - + - + {poolsError ? ( ) : ( - + {_pools?.map((thisPool) => { const { id, nodes } = thisPool; @@ -168,7 +160,7 @@ export const NodePoolsDisplay = (props: Props) => { thisPoolType?.formattedLabel ?? 'Unknown type'; return ( -
+
= React.memo((props) => { - + {linodeLink ? ( {displayLabel} diff --git a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/NodePoolsDisplay/RecycleNodeDialog.tsx b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/NodePoolsDisplay/RecycleNodeDialog.tsx index b84c292fed2..09ccdcb3a32 100644 --- a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/NodePoolsDisplay/RecycleNodeDialog.tsx +++ b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/NodePoolsDisplay/RecycleNodeDialog.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; -import ConfirmationDialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import Typography from 'src/components/core/Typography'; import { localStorageWarning } from 'src/features/Kubernetes/kubeUtils'; import { useRecycleNodeMutation } from 'src/queries/kubernetes'; diff --git a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/NodePoolsDisplay/ResizeNodePoolDrawer.tsx b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/NodePoolsDisplay/ResizeNodePoolDrawer.tsx index 1cb2f223744..80255c40d5e 100644 --- a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/NodePoolsDisplay/ResizeNodePoolDrawer.tsx +++ b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/NodePoolsDisplay/ResizeNodePoolDrawer.tsx @@ -2,7 +2,7 @@ import { KubeNodePoolResponse } from '@linode/api-v4'; import * as React from 'react'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; -import CircleProgress from 'src/components/CircleProgress'; +import { CircleProgress } from 'src/components/CircleProgress'; import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; diff --git a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/RecycleClusterDialog.tsx b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/RecycleClusterDialog.tsx index c9eaea6e7da..5a53a6e887b 100644 --- a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/RecycleClusterDialog.tsx +++ b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/RecycleClusterDialog.tsx @@ -2,7 +2,7 @@ import { useSnackbar } from 'notistack'; import * as React from 'react'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; -import ConfirmationDialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import Typography from 'src/components/core/Typography'; import { localStorageWarning, diff --git a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/RecycleNodePoolDialog.tsx b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/RecycleNodePoolDialog.tsx index 9f9434a1d32..77c0698a4ee 100644 --- a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/RecycleNodePoolDialog.tsx +++ b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/RecycleNodePoolDialog.tsx @@ -2,7 +2,7 @@ import { useSnackbar } from 'notistack'; import * as React from 'react'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; -import ConfirmationDialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import Typography from 'src/components/core/Typography'; import { localStorageWarning, diff --git a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/UpgradeClusterDialog.tsx b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/UpgradeClusterDialog.tsx index 23c307ed405..6b41a87c5fb 100644 --- a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/UpgradeClusterDialog.tsx +++ b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/UpgradeClusterDialog.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; import CheckBox from 'src/components/CheckBox'; -import ConfirmationDialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import Typography from 'src/components/core/Typography'; import Notice from 'src/components/Notice'; import { makeStyles } from '@mui/styles'; diff --git a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/UpgradeKubernetesVersionBanner.tsx b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/UpgradeKubernetesVersionBanner.tsx index 29ef8151c16..cbda166ce1d 100644 --- a/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/UpgradeKubernetesVersionBanner.tsx +++ b/packages/manager/src/features/Kubernetes/KubernetesClusterDetail/UpgradeKubernetesVersionBanner.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import Button from 'src/components/Button'; import Typography from 'src/components/core/Typography'; import DismissibleBanner from 'src/components/DismissibleBanner'; -import Grid from 'src/components/Grid'; +import Grid from '@mui/material/Unstable_Grid2'; import { useKubernetesVersionQuery } from 'src/queries/kubernetes'; import { getNextVersion } from '../kubeUtils'; import UpgradeVersionModal from '../UpgradeVersionModal'; @@ -33,12 +33,12 @@ export const UpgradeKubernetesVersionBanner = (props: Props) => { alignItems="center" justifyContent="space-between" > - + A new version of Kubernetes is available ({nextVersion}). - + diff --git a/packages/manager/src/features/Kubernetes/KubernetesLanding/KubernetesLanding.tsx b/packages/manager/src/features/Kubernetes/KubernetesLanding/KubernetesLanding.tsx index e60cc9314fd..5e6b620c9b9 100644 --- a/packages/manager/src/features/Kubernetes/KubernetesLanding/KubernetesLanding.tsx +++ b/packages/manager/src/features/Kubernetes/KubernetesLanding/KubernetesLanding.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import CircleProgress from 'src/components/CircleProgress'; +import { CircleProgress } from 'src/components/CircleProgress'; import Hidden from 'src/components/core/Hidden'; import TableBody from 'src/components/core/TableBody'; import TableHead from 'src/components/core/TableHead'; diff --git a/packages/manager/src/features/Kubernetes/UpgradeVersionModal.tsx b/packages/manager/src/features/Kubernetes/UpgradeVersionModal.tsx index 8430aed63a9..7c243afead1 100644 --- a/packages/manager/src/features/Kubernetes/UpgradeVersionModal.tsx +++ b/packages/manager/src/features/Kubernetes/UpgradeVersionModal.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; -import Dialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import Typography from 'src/components/core/Typography'; import { recycleClusterNodes } from '@linode/api-v4/lib/kubernetes'; import { useSnackbar } from 'notistack'; @@ -120,7 +120,7 @@ export const UpgradeDialog = (props: Props) => { ); return ( - { )} - + ); }; diff --git a/packages/manager/src/features/Lish/Glish.tsx b/packages/manager/src/features/Lish/Glish.tsx index 14ddb28845e..f144208d2b7 100644 --- a/packages/manager/src/features/Lish/Glish.tsx +++ b/packages/manager/src/features/Lish/Glish.tsx @@ -4,7 +4,7 @@ import { Linode } from '@linode/api-v4/lib/linodes'; import { VncScreen, VncScreenHandle } from 'react-vnc'; import { getLishSchemeAndHostname, resizeViewPort } from './lishUtils'; import { makeStyles } from '@mui/styles'; -import CircleProgress from 'src/components/CircleProgress'; +import { CircleProgress } from 'src/components/CircleProgress'; import ErrorState from 'src/components/ErrorState'; const useStyles = makeStyles(() => ({ diff --git a/packages/manager/src/features/Lish/Lish.tsx b/packages/manager/src/features/Lish/Lish.tsx index d736174e9cc..a265557ca33 100644 --- a/packages/manager/src/features/Lish/Lish.tsx +++ b/packages/manager/src/features/Lish/Lish.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useHistory, useParams } from 'react-router-dom'; -import CircleProgress from 'src/components/CircleProgress'; +import { CircleProgress } from 'src/components/CircleProgress'; import TabPanels from 'src/components/core/ReachTabPanels'; import Tabs from 'src/components/core/ReachTabs'; import { makeStyles } from '@mui/styles'; diff --git a/packages/manager/src/features/Lish/Weblish.tsx b/packages/manager/src/features/Lish/Weblish.tsx index 6535a5f123b..cf411275ca1 100644 --- a/packages/manager/src/features/Lish/Weblish.tsx +++ b/packages/manager/src/features/Lish/Weblish.tsx @@ -1,7 +1,7 @@ /* eslint-disable scanjs-rules/call_addEventListener */ import * as React from 'react'; import ErrorState from 'src/components/ErrorState'; -import CircleProgress from 'src/components/CircleProgress'; +import { CircleProgress } from 'src/components/CircleProgress'; import { Linode } from '@linode/api-v4/lib/linodes'; import { Terminal } from 'xterm'; import { getLishSchemeAndHostname, resizeViewPort } from './lishUtils'; diff --git a/packages/manager/src/features/Longview/LongviewDetail/DetailTabs/IconSection.tsx b/packages/manager/src/features/Longview/LongviewDetail/DetailTabs/IconSection.tsx index 62506d6ee11..69b9dd91000 100644 --- a/packages/manager/src/features/Longview/LongviewDetail/DetailTabs/IconSection.tsx +++ b/packages/manager/src/features/Longview/LongviewDetail/DetailTabs/IconSection.tsx @@ -10,7 +10,7 @@ import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; import Grid from 'src/components/Grid'; -import IconTextLink from 'src/components/IconTextLink'; +import { IconTextLink } from 'src/components/IconTextLink/IconTextLink'; import { Props as LVDataProps } from 'src/containers/longview.stats.container'; import { formatUptime } from 'src/utilities/formatUptime'; import { readableBytes } from 'src/utilities/unitConversions'; diff --git a/packages/manager/src/features/Longview/LongviewDetail/DetailTabs/Network/NetworkGraphs.tsx b/packages/manager/src/features/Longview/LongviewDetail/DetailTabs/Network/NetworkGraphs.tsx index 7cbed60355f..ad18501da71 100644 --- a/packages/manager/src/features/Longview/LongviewDetail/DetailTabs/Network/NetworkGraphs.tsx +++ b/packages/manager/src/features/Longview/LongviewDetail/DetailTabs/Network/NetworkGraphs.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import CircleProgress from 'src/components/CircleProgress'; +import { CircleProgress } from 'src/components/CircleProgress'; import { withTheme, WithTheme } from '@mui/styles'; import ErrorState from 'src/components/ErrorState'; import LongviewLineGraph from 'src/components/LongviewLineGraph'; diff --git a/packages/manager/src/features/Longview/LongviewDetail/LongviewDetail.tsx b/packages/manager/src/features/Longview/LongviewDetail/LongviewDetail.tsx index 51ca977f875..38fe4f2f408 100644 --- a/packages/manager/src/features/Longview/LongviewDetail/LongviewDetail.tsx +++ b/packages/manager/src/features/Longview/LongviewDetail/LongviewDetail.tsx @@ -3,7 +3,7 @@ import { pathOr } from 'ramda'; import * as React from 'react'; import { matchPath, RouteComponentProps } from 'react-router-dom'; import { compose } from 'recompose'; -import CircleProgress from 'src/components/CircleProgress'; +import { CircleProgress } from 'src/components/CircleProgress'; import Paper from 'src/components/core/Paper'; import TabPanels from 'src/components/core/ReachTabPanels'; import Tabs from 'src/components/core/ReachTabs'; diff --git a/packages/manager/src/features/Longview/LongviewLanding/LongviewClients.tsx b/packages/manager/src/features/Longview/LongviewLanding/LongviewClients.tsx index 48ebfcafc5e..5d11bb23fca 100644 --- a/packages/manager/src/features/Longview/LongviewLanding/LongviewClients.tsx +++ b/packages/manager/src/features/Longview/LongviewLanding/LongviewClients.tsx @@ -12,7 +12,7 @@ import { compose } from 'recompose'; import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; -import Search from 'src/components/DebouncedSearchTextField'; +import { DebouncedSearchTextField } from 'src/components/DebouncedSearchTextField'; import { DocumentTitleSegment } from 'src/components/DocumentTitle'; import Select, { Item } from 'src/components/EnhancedSelect/Select'; import Grid from 'src/components/Grid'; @@ -235,7 +235,7 @@ export const LongviewClients: React.FC = (props) => { - = (props) => { }; return ( - = (props) => { } > Are you sure you want to delete this Longview Client? - + ); }; diff --git a/packages/manager/src/features/Longview/LongviewLanding/LongviewList.tsx b/packages/manager/src/features/Longview/LongviewLanding/LongviewList.tsx index 229cfca323e..5790afa777d 100644 --- a/packages/manager/src/features/Longview/LongviewLanding/LongviewList.tsx +++ b/packages/manager/src/features/Longview/LongviewLanding/LongviewList.tsx @@ -1,7 +1,7 @@ import { LongviewClient } from '@linode/api-v4/lib/longview/types'; import * as React from 'react'; import { compose } from 'recompose'; -import CircleProgress from 'src/components/CircleProgress'; +import { CircleProgress } from 'src/components/CircleProgress'; import Box from 'src/components/core/Box'; import Paper from 'src/components/core/Paper'; import { makeStyles } from '@mui/styles'; diff --git a/packages/manager/src/features/Longview/LongviewLanding/LongviewPlans.tsx b/packages/manager/src/features/Longview/LongviewLanding/LongviewPlans.tsx index 91a5c03d311..6670464f1fc 100644 --- a/packages/manager/src/features/Longview/LongviewLanding/LongviewPlans.tsx +++ b/packages/manager/src/features/Longview/LongviewLanding/LongviewPlans.tsx @@ -17,7 +17,7 @@ import TableHead from 'src/components/core/TableHead'; import { DocumentTitleSegment } from 'src/components/DocumentTitle'; import Notice from 'src/components/Notice'; import Radio from 'src/components/Radio'; -import SupportLink from 'src/components/SupportLink'; +import { SupportLink } from 'src/components/SupportLink'; import Table from 'src/components/Table'; import TableCell from 'src/components/TableCell'; import TableRow from 'src/components/TableRow'; diff --git a/packages/manager/src/features/Longview/LongviewLanding/SubscriptionDialog.tsx b/packages/manager/src/features/Longview/LongviewLanding/SubscriptionDialog.tsx index a488ea4b420..1a64e3bf5f0 100644 --- a/packages/manager/src/features/Longview/LongviewLanding/SubscriptionDialog.tsx +++ b/packages/manager/src/features/Longview/LongviewLanding/SubscriptionDialog.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; -import Dialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import Typography from 'src/components/core/Typography'; import { managedText } from './LongviewPlans'; @@ -39,14 +39,14 @@ export const SubscriptionDialog: React.FC = (props) => { ); return ( - {text} - + ); }; diff --git a/packages/manager/src/features/Longview/shared/InstallationInstructions.tsx b/packages/manager/src/features/Longview/shared/InstallationInstructions.tsx index a01348ac562..b94543a5567 100644 --- a/packages/manager/src/features/Longview/shared/InstallationInstructions.tsx +++ b/packages/manager/src/features/Longview/shared/InstallationInstructions.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; -import CopyTooltip from 'src/components/CopyTooltip'; +import { CopyTooltip } from 'src/components/CopyTooltip/CopyTooltip'; import Typography from 'src/components/core/Typography'; import Grid from 'src/components/Grid'; diff --git a/packages/manager/src/features/Longview/shared/TimeRangeSelect.tsx b/packages/manager/src/features/Longview/shared/TimeRangeSelect.tsx index a506d3c6a4f..703b2d78763 100644 --- a/packages/manager/src/features/Longview/shared/TimeRangeSelect.tsx +++ b/packages/manager/src/features/Longview/shared/TimeRangeSelect.tsx @@ -8,7 +8,11 @@ import Select, { } from 'src/components/EnhancedSelect/Select'; import { useMutatePreferences, usePreferences } from 'src/queries/preferences'; -interface Props extends Omit { +interface Props + extends Omit< + BaseSelectProps, false>, + 'onChange' | 'defaultValue' + > { handleStatsChange?: (start: number, end: number) => void; defaultValue?: Labels; } diff --git a/packages/manager/src/features/Managed/Contacts/Contacts.tsx b/packages/manager/src/features/Managed/Contacts/Contacts.tsx index c2e63e7fc6a..743d7ae3977 100644 --- a/packages/manager/src/features/Managed/Contacts/Contacts.tsx +++ b/packages/manager/src/features/Managed/Contacts/Contacts.tsx @@ -3,14 +3,14 @@ import { useSnackbar } from 'notistack'; import * as React from 'react'; import AddNewLink from 'src/components/AddNewLink'; import Hidden from 'src/components/core/Hidden'; -import { makeStyles } from '@mui/styles'; +import { makeStyles } from 'tss-react/mui'; import { Theme } from '@mui/material/styles'; import TableBody from 'src/components/core/TableBody'; import TableHead from 'src/components/core/TableHead'; import Typography from 'src/components/core/Typography'; -import DeletionDialog from 'src/components/DeletionDialog'; +import { DeletionDialog } from 'src/components/DeletionDialog/DeletionDialog'; import { DocumentTitleSegment } from 'src/components/DocumentTitle'; -import Grid from 'src/components/Grid'; +import Grid from '@mui/material/Unstable_Grid2'; import OrderBy from 'src/components/OrderBy'; import Paginate from 'src/components/Paginate'; import PaginationFooter from 'src/components/PaginationFooter'; @@ -29,7 +29,7 @@ import { ManagedContactGroup, Mode } from './common'; import ContactDrawer from './ContactsDrawer'; import ContactTableContact from './ContactsTableContent'; -const useStyles = makeStyles((theme: Theme) => ({ +const useStyles = makeStyles()((theme: Theme) => ({ copy: { fontSize: '0.875rem', marginBottom: theme.spacing(2), @@ -54,7 +54,7 @@ const useStyles = makeStyles((theme: Theme) => ({ })); const Contacts = () => { - const classes = useStyles(); + const { classes } = useStyles(); const { enqueueSnackbar } = useSnackbar(); const { @@ -119,8 +119,9 @@ const Contacts = () => { container alignItems="center" justifyContent="flex-end" + spacing={2} > - + { setContactDrawerMode('create'); diff --git a/packages/manager/src/features/Managed/Contacts/ContactsDrawer.tsx b/packages/manager/src/features/Managed/Contacts/ContactsDrawer.tsx index 7c789becb78..476ff879c18 100644 --- a/packages/manager/src/features/Managed/Contacts/ContactsDrawer.tsx +++ b/packages/manager/src/features/Managed/Contacts/ContactsDrawer.tsx @@ -6,8 +6,8 @@ import * as React from 'react'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; import Drawer from 'src/components/Drawer'; -import Select, { Item } from 'src/components/EnhancedSelect/Select'; -import Grid from 'src/components/Grid'; +import Select from 'src/components/EnhancedSelect/Select'; +import Grid from '@mui/material/Unstable_Grid2'; import Notice from 'src/components/Notice'; import TextField from 'src/components/TextField'; import { @@ -154,8 +154,8 @@ const ContactsDrawer: React.FC = (props) => { value={values.email} /> - - + + = (props) => { onBlur={handleBlur} /> - + = (props) => { value: values.group, label: values.group, } - : '' + : null } options={groups.map((group) => ({ label: group.groupName, value: group.groupName, }))} - onChange={(selectedGroup: Item) => - setFieldValue('group', selectedGroup.value) + onChange={(selectedGroup) => + setFieldValue('group', selectedGroup?.value) } errorText={errors.group} /> diff --git a/packages/manager/src/features/Managed/Credentials/CredentialList.tsx b/packages/manager/src/features/Managed/Credentials/CredentialList.tsx index 38e38c067aa..bc95615fba6 100644 --- a/packages/manager/src/features/Managed/Credentials/CredentialList.tsx +++ b/packages/manager/src/features/Managed/Credentials/CredentialList.tsx @@ -4,14 +4,14 @@ import { FormikBag } from 'formik'; import { useSnackbar } from 'notistack'; import * as React from 'react'; import AddNewLink from 'src/components/AddNewLink'; -import { makeStyles } from '@mui/styles'; +import { makeStyles } from 'tss-react/mui'; import { Theme } from '@mui/material/styles'; import TableBody from 'src/components/core/TableBody'; import TableHead from 'src/components/core/TableHead'; import Typography from 'src/components/core/Typography'; -import DeletionDialog from 'src/components/DeletionDialog'; +import { DeletionDialog } from 'src/components/DeletionDialog/DeletionDialog'; import { DocumentTitleSegment } from 'src/components/DocumentTitle'; -import Grid from 'src/components/Grid'; +import Grid from '@mui/material/Unstable_Grid2'; import OrderBy from 'src/components/OrderBy'; import Paginate from 'src/components/Paginate'; import PaginationFooter from 'src/components/PaginationFooter'; @@ -36,7 +36,7 @@ import AddCredentialDrawer from './AddCredentialDrawer'; import CredentialTableContent from './CredentialTableContent'; import UpdateCredentialDrawer from './UpdateCredentialDrawer'; -const useStyles = makeStyles((theme: Theme) => ({ +const useStyles = makeStyles()((theme: Theme) => ({ copy: { fontSize: '0.875rem', marginBottom: theme.spacing(2), @@ -63,7 +63,7 @@ const useStyles = makeStyles((theme: Theme) => ({ export type FormikProps = FormikBag<{}, CredentialPayload>; export const CredentialList = () => { - const classes = useStyles(); + const { classes } = useStyles(); const { enqueueSnackbar } = useSnackbar(); const { data, isLoading, error } = useAllManagedCredentialsQuery(); @@ -224,9 +224,12 @@ export const CredentialList = () => { container alignItems="center" justifyContent="flex-end" - updateFor={[credentials, error, isLoading]} + spacing={2} + sx={{ + paddingRight: 0, + }} > - + setDrawerOpen(true)} diff --git a/packages/manager/src/features/Managed/Credentials/CredentialRow.tsx b/packages/manager/src/features/Managed/Credentials/CredentialRow.tsx index e1d841cb15b..75e7aa817a8 100644 --- a/packages/manager/src/features/Managed/Credentials/CredentialRow.tsx +++ b/packages/manager/src/features/Managed/Credentials/CredentialRow.tsx @@ -2,7 +2,7 @@ import { ManagedCredential } from '@linode/api-v4/lib/managed'; import * as React from 'react'; import { createStyles, makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; -import DateTimeDisplay from 'src/components/DateTimeDisplay'; +import { DateTimeDisplay } from 'src/components/DateTimeDisplay'; import TableCell from 'src/components/TableCell'; import TableRow from 'src/components/TableRow'; import ActionMenu from './CredentialActionMenu'; diff --git a/packages/manager/src/features/Managed/ManagedDashboardCard/DashboardCard.tsx b/packages/manager/src/features/Managed/ManagedDashboardCard/DashboardCard.tsx index 6d274cc2c38..37cbdef613d 100644 --- a/packages/manager/src/features/Managed/ManagedDashboardCard/DashboardCard.tsx +++ b/packages/manager/src/features/Managed/ManagedDashboardCard/DashboardCard.tsx @@ -1,11 +1,10 @@ -import classNames from 'classnames'; import * as React from 'react'; -import { makeStyles } from '@mui/styles'; +import { makeStyles } from 'tss-react/mui'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; -import Grid from 'src/components/Grid'; +import Grid from '@mui/material/Unstable_Grid2'; -const useStyles = makeStyles((theme: Theme) => ({ +const useStyles = makeStyles()((theme: Theme) => ({ root: { width: '100% !important', }, @@ -34,7 +33,7 @@ interface Props { } const DashboardCard: React.FC = (props) => { - const classes = useStyles(); + const { classes, cx } = useStyles(); const { alignHeader, @@ -48,27 +47,29 @@ const DashboardCard: React.FC = (props) => { return ( {(title || headerAction) && ( - + {title && ( - + {title} )} {headerAction && ( - + = (props) => { )} - - {props.children} - + {props.children} ); }; diff --git a/packages/manager/src/features/Managed/ManagedDashboardCard/ManagedChartPanel.tsx b/packages/manager/src/features/Managed/ManagedDashboardCard/ManagedChartPanel.tsx index c20c72df340..32ac91ab296 100644 --- a/packages/manager/src/features/Managed/ManagedDashboardCard/ManagedChartPanel.tsx +++ b/packages/manager/src/features/Managed/ManagedDashboardCard/ManagedChartPanel.tsx @@ -1,6 +1,6 @@ import { DataSeries, ManagedStatsData } from '@linode/api-v4/lib/managed'; import * as React from 'react'; -import CircleProgress from 'src/components/CircleProgress'; +import { CircleProgress } from 'src/components/CircleProgress'; import { makeStyles, WithTheme, withTheme } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; diff --git a/packages/manager/src/features/Managed/ManagedDashboardCard/ManagedDashboardCard.tsx b/packages/manager/src/features/Managed/ManagedDashboardCard/ManagedDashboardCard.tsx index c2fc4e5c6fa..08baf393843 100644 --- a/packages/manager/src/features/Managed/ManagedDashboardCard/ManagedDashboardCard.tsx +++ b/packages/manager/src/features/Managed/ManagedDashboardCard/ManagedDashboardCard.tsx @@ -1,18 +1,18 @@ -import * as React from 'react'; -import Grid from 'src/components/Grid'; -import DashboardCard from './DashboardCard'; -import ManagedChartPanel from './ManagedChartPanel'; -import MonitorStatus from './MonitorStatus'; -import MonitorTickets from './MonitorTickets'; -import { makeStyles } from '@mui/styles'; +import Grid from '@mui/material/Unstable_Grid2'; import { Theme } from '@mui/material/styles'; +import { makeStyles } from '@mui/styles'; +import * as React from 'react'; +import { CircleProgress } from 'src/components/CircleProgress'; +import ErrorState from 'src/components/ErrorState/ErrorState'; import { useAllManagedIssuesQuery, useAllManagedMonitorsQuery, } from 'src/queries/managed/managed'; import { getAPIErrorOrDefault } from 'src/utilities/errorUtils'; -import ErrorState from 'src/components/ErrorState/ErrorState'; -import CircleProgress from 'src/components/CircleProgress/CircleProgress'; +import DashboardCard from './DashboardCard'; +import ManagedChartPanel from './ManagedChartPanel'; +import MonitorStatus from './MonitorStatus'; +import MonitorTickets from './MonitorTickets'; const useStyles = makeStyles((theme: Theme) => ({ root: { @@ -94,7 +94,6 @@ export const ManagedDashboardCard = () => { > { sm={5} className={classes.status} > - + - + - + diff --git a/packages/manager/src/features/Managed/ManagedDashboardCard/MonitorStatus.tsx b/packages/manager/src/features/Managed/ManagedDashboardCard/MonitorStatus.tsx index 8e439fe0ad5..b40c955c21b 100644 --- a/packages/manager/src/features/Managed/ManagedDashboardCard/MonitorStatus.tsx +++ b/packages/manager/src/features/Managed/ManagedDashboardCard/MonitorStatus.tsx @@ -7,7 +7,7 @@ import MonitorOK from 'src/assets/icons/monitor-ok.svg'; import { makeStyles, withTheme, WithTheme } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; -import Grid from 'src/components/Grid'; +import Grid from '@mui/material/Unstable_Grid2'; export const useStyles = makeStyles((theme: Theme) => ({ root: { @@ -68,10 +68,9 @@ export const MonitorStatus: React.FC = (props) => { alignItems="center" justifyContent="center" className={classes.root} - item > - - + + {failedMonitors.length === 0 ? ( ) : ( @@ -79,7 +78,7 @@ export const MonitorStatus: React.FC = (props) => { )} - + {failedMonitors.length === 0 ? 'All monitored services are up' @@ -89,7 +88,7 @@ export const MonitorStatus: React.FC = (props) => { {failedMonitors.length > 0 && ( - + {failedMonitors.map((thisMonitor, idx) => ( = (props) => { ))} )} - + View your list of service monitors {` `} diff --git a/packages/manager/src/features/Managed/ManagedDashboardCard/MonitorTickets.tsx b/packages/manager/src/features/Managed/ManagedDashboardCard/MonitorTickets.tsx index 24fe3864796..0fcc4135f5f 100644 --- a/packages/manager/src/features/Managed/ManagedDashboardCard/MonitorTickets.tsx +++ b/packages/manager/src/features/Managed/ManagedDashboardCard/MonitorTickets.tsx @@ -5,7 +5,7 @@ import Button from 'src/components/Button'; import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; -import Grid from 'src/components/Grid'; +import Grid from '@mui/material/Unstable_Grid2'; import { ExtendedIssue } from 'src/queries/managed/types'; const useStyles = makeStyles((theme: Theme) => ({ @@ -49,12 +49,11 @@ export const MonitorTickets: React.FC = (props) => { className={classes.root} > - + {hasIssues ? `${openIssues.length} open support ${ @@ -63,7 +62,7 @@ export const MonitorTickets: React.FC = (props) => { : 'No open support tickets'} - + {hasIssues ? ( View the Support tickets page for diff --git a/packages/manager/src/features/Managed/MonitorDrawer.tsx b/packages/manager/src/features/Managed/MonitorDrawer.tsx index 6d50a41f97a..c928c3b6e27 100644 --- a/packages/manager/src/features/Managed/MonitorDrawer.tsx +++ b/packages/manager/src/features/Managed/MonitorDrawer.tsx @@ -13,7 +13,7 @@ import Button from 'src/components/Button'; import InputAdornment from 'src/components/core/InputAdornment'; import Drawer from 'src/components/Drawer'; import Select, { Item } from 'src/components/EnhancedSelect/Select'; -import Grid from 'src/components/Grid'; +import Grid from '@mui/material/Unstable_Grid2'; import Notice from 'src/components/Notice'; import TextField from 'src/components/TextField'; @@ -182,8 +182,8 @@ const MonitorDrawer: React.FC = (props) => { }} /> - - + + - - Active health checks proactively check the health of back-end - nodes. {conditionalText} - - + + { {protocol === 'https' && ( - - - + + + { disabled={disabled} /> - + { )} {tcpSelected && ( - + { - + setIsPhoneInputFocused(true)} onBlur={() => setIsPhoneInputFocused(false)} styles={customStyles} @@ -256,16 +258,15 @@ export const PhoneVerification = () => { className={classes.select} id="iso_code" name="iso_code" - type="text" isClearable={false} value={{ value: sendCodeForm.values.iso_code, label: getCountryFlag(sendCodeForm.values.iso_code), }} - isOptionSelected={(option: Item) => + isOptionSelected={(option) => sendCodeForm.values.iso_code === option.value } - onChange={(item: Item) => + onChange={(item) => sendCodeForm.setFieldValue('iso_code', item.value) } options={countries.map((counrty) => ({ diff --git a/packages/manager/src/features/Profile/AuthenticationSettings/RevokeTrustedDevicesDialog.tsx b/packages/manager/src/features/Profile/AuthenticationSettings/RevokeTrustedDevicesDialog.tsx index 30dbdcb1941..1607ac80646 100644 --- a/packages/manager/src/features/Profile/AuthenticationSettings/RevokeTrustedDevicesDialog.tsx +++ b/packages/manager/src/features/Profile/AuthenticationSettings/RevokeTrustedDevicesDialog.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; -import ConfirmationDialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import Typography from 'src/components/core/Typography'; import { useRevokeTrustedDeviceMutation } from 'src/queries/profile'; diff --git a/packages/manager/src/features/Profile/AuthenticationSettings/SMSMessaging.tsx b/packages/manager/src/features/Profile/AuthenticationSettings/SMSMessaging.tsx index 3e4959a2256..e4cf760bfe5 100644 --- a/packages/manager/src/features/Profile/AuthenticationSettings/SMSMessaging.tsx +++ b/packages/manager/src/features/Profile/AuthenticationSettings/SMSMessaging.tsx @@ -3,7 +3,7 @@ import Button from 'src/components/Button'; import Box from 'src/components/core/Box'; import Typography from 'src/components/core/Typography'; import Notice from 'src/components/Notice'; -import ConfirmationDialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import ActionsPanel from 'src/components/ActionsPanel'; import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; diff --git a/packages/manager/src/features/Profile/AuthenticationSettings/SecurityQuestions/Question.tsx b/packages/manager/src/features/Profile/AuthenticationSettings/SecurityQuestions/Question.tsx index 5f92013ca1f..f5c04712e39 100644 --- a/packages/manager/src/features/Profile/AuthenticationSettings/SecurityQuestions/Question.tsx +++ b/packages/manager/src/features/Profile/AuthenticationSettings/SecurityQuestions/Question.tsx @@ -33,9 +33,9 @@ export const Question = (props: Props) => { const name = `security_questions[${index}].id`; const label = `Question ${index + 1}`; - const onChange = (item: Item) => { + const onChange = (item: Item) => { setFieldValue(`security_questions[${index}]`, { - id: Number.parseInt(item.value, 10), + id: item.value, question: item.label, response: '', }); @@ -61,7 +61,6 @@ export const Question = (props: Props) => { placeholder="Select a question" defaultValue={currentOption} isClearable={false} - height="36px" onChange={onChange} /> ); diff --git a/packages/manager/src/features/Profile/AuthenticationSettings/SecurityQuestions/SecurityQuestions.tsx b/packages/manager/src/features/Profile/AuthenticationSettings/SecurityQuestions/SecurityQuestions.tsx index 737e7b8f086..421033e8b73 100644 --- a/packages/manager/src/features/Profile/AuthenticationSettings/SecurityQuestions/SecurityQuestions.tsx +++ b/packages/manager/src/features/Profile/AuthenticationSettings/SecurityQuestions/SecurityQuestions.tsx @@ -12,7 +12,7 @@ import Box from 'src/components/core/Box'; import Typography from 'src/components/core/Typography'; import { SecurityQuestionsData } from '@linode/api-v4'; import { getAnsweredQuestions, securityQuestionsToItems } from './utilities'; -import CircleProgress from 'src/components/CircleProgress'; +import { CircleProgress } from 'src/components/CircleProgress'; import { useSnackbar } from 'notistack'; import { Link } from 'src/components/Link'; diff --git a/packages/manager/src/features/Profile/AuthenticationSettings/TPADialog.tsx b/packages/manager/src/features/Profile/AuthenticationSettings/TPADialog.tsx index 93bdfebbc7a..aeb0a407af5 100644 --- a/packages/manager/src/features/Profile/AuthenticationSettings/TPADialog.tsx +++ b/packages/manager/src/features/Profile/AuthenticationSettings/TPADialog.tsx @@ -2,7 +2,7 @@ import { TPAProvider } from '@linode/api-v4/lib/profile'; import * as React from 'react'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; -import ConfirmationDialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import { makeStyles } from '@mui/styles'; import Typography from 'src/components/core/Typography'; import { LOGIN_ROOT } from 'src/constants'; diff --git a/packages/manager/src/features/Profile/AuthenticationSettings/TPAProviders.tsx b/packages/manager/src/features/Profile/AuthenticationSettings/TPAProviders.tsx index 1994d15d425..d48ffddca92 100644 --- a/packages/manager/src/features/Profile/AuthenticationSettings/TPAProviders.tsx +++ b/packages/manager/src/features/Profile/AuthenticationSettings/TPAProviders.tsx @@ -13,7 +13,7 @@ import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; import ExternalLink from 'src/components/ExternalLink'; -import Grid from 'src/components/Grid'; +import Grid from '@mui/material/Unstable_Grid2'; import Link from 'src/components/Link'; import Notice from 'src/components/Notice'; import useFlags from 'src/hooks/useFlags'; @@ -149,13 +149,13 @@ export const TPAProviders: React.FC = (props) => { . We strongly recommend setting up Two-Factor Authentication (2FA). - + {providersIncludingLinode.map((thisProvider) => { const ProviderIcon = icons[thisProvider.name]; const isProviderEnabled = props.authType === thisProvider.name; return ( - +
) : null} @@ -191,6 +194,12 @@ export const Referrals: React.FC<{}> = () => { className={classes.limitNotice} spacingTop={8} spacingBottom={0} + sx={{ + '&&': { + // '&&' is only needed because Notice is using makeStyles + padding: '8px', + }, + }} > Spend $25 with Linode to activate your personal referral link @@ -201,20 +210,24 @@ export const Referrals: React.FC<{}> = () => { justifyContent="space-between" wrap="nowrap" className={classes.images} + sx={{ + width: '100%', + padding: 0, + }} > - + Share your referral link with friends and colleagues - + They sign up and receive a $100, 60-day credit - + You earn $25 after they make their first payment of $25 diff --git a/packages/manager/src/features/Profile/SSHKeys/DeleteSSHKeyDialog.tsx b/packages/manager/src/features/Profile/SSHKeys/DeleteSSHKeyDialog.tsx index 30b8a8116bc..b0c55ea0733 100644 --- a/packages/manager/src/features/Profile/SSHKeys/DeleteSSHKeyDialog.tsx +++ b/packages/manager/src/features/Profile/SSHKeys/DeleteSSHKeyDialog.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import ActionsPanel from 'src/components/ActionsPanel'; import Button from 'src/components/Button'; -import ConfirmationDialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import Typography from 'src/components/core/Typography'; import { useDeleteSSHKeyMutation } from 'src/queries/profile'; diff --git a/packages/manager/src/features/Profile/SSHKeys/SSHKeys.tsx b/packages/manager/src/features/Profile/SSHKeys/SSHKeys.tsx index 6b97e2a8412..0808b453983 100644 --- a/packages/manager/src/features/Profile/SSHKeys/SSHKeys.tsx +++ b/packages/manager/src/features/Profile/SSHKeys/SSHKeys.tsx @@ -7,7 +7,7 @@ import TableBody from 'src/components/core/TableBody'; import TableHead from 'src/components/core/TableHead'; import Typography from 'src/components/core/Typography'; import { DocumentTitleSegment } from 'src/components/DocumentTitle'; -import Grid from 'src/components/Grid'; +import Grid from '@mui/material/Unstable_Grid2'; import PaginationFooter from 'src/components/PaginationFooter'; import Table from 'src/components/Table'; import TableCell from 'src/components/TableCell'; @@ -119,8 +119,9 @@ const SSHKeys = () => { alignItems="flex-end" justifyContent="flex-end" className={classes.sshKeysHeader} + spacing={2} > - + setIsCreateDrawerOpen(true)} diff --git a/packages/manager/src/features/Profile/SecretTokenDialog/SecretTokenDialog.tsx b/packages/manager/src/features/Profile/SecretTokenDialog/SecretTokenDialog.tsx index 5ed7c010565..e82ac33bcb7 100644 --- a/packages/manager/src/features/Profile/SecretTokenDialog/SecretTokenDialog.tsx +++ b/packages/manager/src/features/Profile/SecretTokenDialog/SecretTokenDialog.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { ObjectStorageKey } from '@linode/api-v4/lib/object-storage'; import { makeStyles } from '@mui/styles'; import Notice from 'src/components/Notice'; -import ConfirmationDialog from 'src/components/ConfirmationDialog'; +import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import CopyableAndDownloadableTextField from 'src/components/CopyableAndDownloadableTextField'; import Box from 'src/components/core/Box'; import ActionsPanel from 'src/components/ActionsPanel'; @@ -62,6 +62,7 @@ export const SecretTokenDialog: React.FC = (props) => { onClose={onClose} disableEscapeKeyDown maxWidth="sm" + fullWidth actions={actions} > = (props) => { open={props.open} onClose={props.onClose} maxWidth="sm" + fullWidth > {errorMessage && } {successMessage && ( diff --git a/packages/manager/src/features/Profile/Settings/Settings.tsx b/packages/manager/src/features/Profile/Settings/Settings.tsx index 367ecde9f4d..347a3dace4a 100644 --- a/packages/manager/src/features/Profile/Settings/Settings.tsx +++ b/packages/manager/src/features/Profile/Settings/Settings.tsx @@ -5,9 +5,9 @@ import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Typography from 'src/components/core/Typography'; import { DocumentTitleSegment } from 'src/components/DocumentTitle'; -import Grid from 'src/components/Grid'; +import Grid from '@mui/material/Unstable_Grid2'; import PreferenceToggle, { ToggleProps } from 'src/components/PreferenceToggle'; -import Toggle from 'src/components/Toggle'; +import { Toggle } from 'src/components/Toggle'; import { useMutatePreferences, usePreferences } from 'src/queries/preferences'; import { useMutateProfile, useProfile } from 'src/queries/profile'; import { getQueryParam } from 'src/utilities/queryParams'; @@ -65,7 +65,7 @@ const ProfileSettings = () => { Notifications - + { - + Theme @@ -143,7 +143,7 @@ const ProfileSettings = () => { }: ToggleProps) => { return ( - + ({ - root: { - marginBottom: theme.spacing(3), - }, entityHeading: { marginBottom: theme.spacing(), [theme.breakpoints.down('md')]: { @@ -57,7 +54,7 @@ export const ResultGroup: React.FC = (props) => { results.length > groupSize ? splitAt(groupSize, results) : [results, []]; return ( - +