Skip to content

Commit ee74cb7

Browse files
feat: [M3-10454] - Show toast notification for disk_delete failures (linode#12673)
* show toast for failed `disk_delete` events * fix wrapping in disk row * Added changeset: Toast notification for failed disk deletion events * Added changeset: Unexpected wrapping in Linode disk table row --------- Co-authored-by: Banks Nussman <[email protected]>
1 parent 8f75cfc commit ee74cb7

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Added
3+
---
4+
5+
Toast notification for failed disk deletion events ([#12673](https://github.com/linode/manager/pull/12673))
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Fixed
3+
---
4+
5+
Unexpected wrapping in Linode disk table row ([#12673](https://github.com/linode/manager/pull/12673))

packages/manager/src/features/Events/asyncToasts.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const createToast = (options: ToastOptions) => {
7474
*/
7575
export const toasts: Toasts = {
7676
backups_restore: createToast({ failure: { persist: true } }),
77-
disk_delete: createToast({ failure: false, success: true }),
77+
disk_delete: createToast({ failure: true, success: true }),
7878
disk_imagize: createToast({ failure: { persist: true }, success: true }),
7979
disk_resize: createToast({ failure: { persist: true }, success: true }),
8080
image_delete: createToast({ failure: true, success: true }),

packages/manager/src/features/Linodes/LinodesDetail/LinodeStorage/LinodeDiskRow.tsx

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { Hidden } from '@linode/ui';
2-
import { useTheme } from '@mui/material/styles';
3-
import * as React from 'react';
1+
import { Hidden, Stack } from '@linode/ui';
2+
import React from 'react';
43

54
import { BarPercent } from 'src/components/BarPercent';
65
import { DateTimeDisplay } from 'src/components/DateTimeDisplay';
@@ -24,7 +23,6 @@ interface Props {
2423

2524
export const LinodeDiskRow = React.memo((props: Props) => {
2625
const { data: events } = useInProgressEvents();
27-
const theme = useTheme();
2826
const {
2927
disk,
3028
linodeId,
@@ -55,25 +53,16 @@ export const LinodeDiskRow = React.memo((props: Props) => {
5553
<TableCell sx={{ width: '10%' }}>{disk.filesystem}</TableCell>
5654
<TableCell sx={{ width: '15%' }}>
5755
{event ? (
58-
<div
59-
style={{
60-
alignItems: 'center',
61-
display: 'flex',
62-
flexFlow: 'row nowrap',
63-
}}
64-
>
56+
<Stack direction="row" gap={2} whiteSpace="nowrap">
6557
{diskEventLabelMap[event.action]} ({event.percent_complete}%)
6658
<BarPercent
6759
max={100}
6860
narrow
6961
rounded
70-
sx={{
71-
paddingLeft: theme.spacing(),
72-
width: 250,
73-
}}
62+
sx={{ minWidth: 250 }}
7463
value={event?.percent_complete ?? 0}
7564
/>
76-
</div>
65+
</Stack>
7766
) : (
7867
`${disk.size} MB`
7968
)}

0 commit comments

Comments
 (0)