-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upcoming: [M3-7580] - Add list view for Linode Clone/Backup (#10182)
* Add Clone Linode power-off notice * Add new feature flag for Linode Clone UI updates * Added changeset: Clone Linode power-off notice * Reduce spacing between notices * Refactored DebouncedSearchTextField to enable external state management * Add search to SelectLinodePanel and autopopulate when cloning * Fix bug causing filter value to update every time a Linode is selected * Make clear icon blue on hover * Gate changes behind feature flag * Added changeset: Search filter in Clone Linode and Create Linode from Backup flows * Added -> upcoming * Add explanatory comment * Change InputAdornment to IconButton * Add missing useEffect dependencies * Fix unused customValue prop * Simplify export * Add table view to Clone and Backups flow * Add unit test for SelectLinodeRow * Switch to useOrder hook * Gate table view behind feature flag * Added changeset: List view for Linode Clone and Create from Backup * No clear icon when search field empty * Extract render functions to components * linodeID -> linodeId * Feedback * Remove unnecessary ExtendedLinodes interface and utility * Rename feature flag to camelcase * Add unit tests for SelectLinodePanel * Only show power off action for selected linodes * Feedback @bnussman-akamai * Bulleted notices * Don't show power actions for from backup * UX feedback: remove "Notice:" heading * Fix table column rendering inconsistencies
- Loading branch information
1 parent
1ceb91c
commit d9b5b92
Showing
20 changed files
with
1,021 additions
and
401 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-10182-upcoming-features-1707859324148.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Upcoming Features | ||
--- | ||
|
||
List view for Linode Clone and Create from Backup ([#10182](https://github.com/linode/manager/pull/10182)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
190 changes: 0 additions & 190 deletions
190
packages/manager/src/features/Linodes/LinodesCreate/SelectLinodePanel.tsx
This file was deleted.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
packages/manager/src/features/Linodes/LinodesCreate/SelectLinodePanel/SelectLinodeCard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Linode } from '@linode/api-v4'; | ||
import React from 'react'; | ||
|
||
import { SelectionCard } from 'src/components/SelectionCard/SelectionCard'; | ||
import { useImageQuery } from 'src/queries/images'; | ||
import { useRegionsQuery } from 'src/queries/regions'; | ||
import { useTypeQuery } from 'src/queries/types'; | ||
import { formatStorageUnits } from 'src/utilities/formatStorageUnits'; | ||
import { isNotNullOrUndefined } from 'src/utilities/nullOrUndefined'; | ||
|
||
interface Props { | ||
disabled?: boolean; | ||
handleSelection: () => void; | ||
linode: Linode; | ||
selected?: boolean; | ||
} | ||
|
||
export const SelectLinodeCard = ({ | ||
disabled, | ||
handleSelection, | ||
linode, | ||
selected, | ||
}: Props) => { | ||
const { data: regions } = useRegionsQuery(); | ||
|
||
const { data: linodeType } = useTypeQuery( | ||
linode?.type ?? '', | ||
Boolean(linode?.type) | ||
); | ||
|
||
const { data: linodeImage } = useImageQuery( | ||
linode?.image ?? '', | ||
Boolean(linode?.image) | ||
); | ||
|
||
const type = linodeType ? formatStorageUnits(linodeType?.label) : linode.type; | ||
const image = linodeImage?.label ?? linode.image; | ||
const region = | ||
regions?.find((region) => region.id == linode.region)?.label ?? | ||
linode.region; | ||
|
||
return ( | ||
<SelectionCard | ||
subheadings={[ | ||
[type, image, region].filter(isNotNullOrUndefined).join(', '), | ||
]} | ||
checked={selected} | ||
disabled={disabled} | ||
heading={linode.label} | ||
key={`selection-card-${linode.id}`} | ||
onClick={handleSelection} | ||
/> | ||
); | ||
}; |
26 changes: 26 additions & 0 deletions
26
packages/manager/src/features/Linodes/LinodesCreate/SelectLinodePanel/SelectLinodeCards.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Grid from '@mui/material/Unstable_Grid2'; | ||
import React from 'react'; | ||
|
||
import { SelectLinodeCard } from './SelectLinodeCard'; | ||
import { RenderLinodeProps } from './SelectLinodePanel'; | ||
|
||
export const SelectLinodeCards = ({ | ||
disabled, | ||
handleSelection, | ||
orderBy: { data: linodes }, | ||
selectedLinodeId, | ||
}: RenderLinodeProps) => ( | ||
<Grid container spacing={2}> | ||
{linodes.map((linode) => ( | ||
<SelectLinodeCard | ||
handleSelection={() => | ||
handleSelection(linode.id, linode.type, linode.specs.disk) | ||
} | ||
disabled={disabled} | ||
key={linode.id} | ||
linode={linode} | ||
selected={linode.id == selectedLinodeId} | ||
/> | ||
))} | ||
</Grid> | ||
); |
Oops, something went wrong.