Fix: Remove delete button from the list-view instead of disabling it

This commit is contained in:
Gustav Hansen 2023-07-20 12:58:17 +02:00
parent c3e1892955
commit cae957a571

View File

@ -342,21 +342,22 @@ export function ReviewWorkflowsListView() {
<Pencil /> <Pencil />
</ActionLink> </ActionLink>
<IconButton {workflows.length > 1 && canDelete && (
aria-label={formatMessage( <IconButton
{ aria-label={formatMessage(
id: 'Settings.review-workflows.list.page.list.column.actions.delete.label', {
defaultMessage: 'Delete {name}', id: 'Settings.review-workflows.list.page.list.column.actions.delete.label',
}, defaultMessage: 'Delete {name}',
{ name: 'Default workflow' } },
)} { name: 'Default workflow' }
disabled={workflows.length === 1 || !canDelete} )}
icon={<Trash />} icon={<Trash />}
noBorder noBorder
onClick={() => { onClick={() => {
handleDeleteWorkflow(workflow.id); handleDeleteWorkflow(workflow.id);
}} }}
/> />
)}
</Flex> </Flex>
</Td> </Td>
</Tr> </Tr>