-
Notifications
You must be signed in to change notification settings - Fork 606
feat: add visual indicator for resources pending deletion #4704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
| * limitations under the License. | ||
| */ | ||
|
|
||
| import { Icon } from '@iconify/react'; | ||
| import Box from '@mui/material/Box'; | ||
| import MenuItem from '@mui/material/MenuItem'; | ||
| import { useTheme } from '@mui/material/styles'; | ||
|
|
@@ -51,6 +52,7 @@ import { useLocalStorageState } from '../../globalSearch/useLocalStorageState'; | |
| import { DateLabel } from '../Label'; | ||
| import Link from '../Link'; | ||
| import Table, { TableColumn } from '../Table'; | ||
| import { LightTooltip } from '../Tooltip'; | ||
| import DeleteButton from './DeleteButton'; | ||
| import EditButton from './EditButton'; | ||
| import ResourceTableMultiActions from './ResourceTableMultiActions'; | ||
|
|
@@ -443,8 +445,31 @@ function ResourceTableContent<RowItem extends KubeObject>(props: ResourceTablePr | |
| header: t('translation|Name'), | ||
| gridTemplate: 'auto', | ||
| accessorFn: (item: RowItem) => item.metadata.name, | ||
| Cell: ({ row }: { row: MRT_Row<RowItem> }) => | ||
| row.original && <Link kubeObject={row.original} />, | ||
| Cell: ({ row }: { row: MRT_Row<RowItem> }) => { | ||
| if (!row.original) { | ||
| return null; | ||
| } | ||
|
|
||
| const isDeleting = !!row.original.metadata?.deletionTimestamp; | ||
|
|
||
| return ( | ||
| <Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}> | ||
| {isDeleting && ( | ||
| <LightTooltip title={t('translation|Deleting')}> | ||
| <Box component="span" sx={{ display: 'flex', color: 'text.secondary' }}> | ||
| <Icon | ||
| icon="mdi:trash-can-outline" | ||
| width="1rem" | ||
| height="1rem" | ||
| color={theme.palette.error.main} | ||
| /> | ||
|
Comment on lines
+458
to
+465
|
||
| </Box> | ||
| </LightTooltip> | ||
| )} | ||
| <Link kubeObject={row.original} /> | ||
| </Box> | ||
| ); | ||
| }, | ||
| }; | ||
| case 'age': | ||
| return { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t('translation|Deleting')appears to rely on a "Deleting" translation key, butfrontend/src/i18n/locales/*/translation.jsondon’t define a plain "Deleting" entry (only longer strings like "Deleting item {{ itemName }}…"). This will likely show the raw key in non-English locales. Reuse an existing translated string (e.g., "Deleting item…" withitemName) or add a dedicated key (e.g., "Deleting"/"Pending deletion") to the locale files.