Blueprints Table: Clear selection button now a <Button>

As per discussion with UX, change the `Clear selection` card to a button
(link variant).
This commit is contained in:
lucasgarfield 2024-03-06 10:02:44 +01:00 committed by Lucas Garfield
parent 68e4cba9a3
commit d204d4c5dc
2 changed files with 7 additions and 19 deletions

View file

@ -3,9 +3,6 @@ import React, { useState, useCallback } from 'react';
import {
Bullseye,
Button,
Card,
CardHeader,
CardTitle,
EmptyState,
EmptyStateActions,
EmptyStateBody,
@ -106,23 +103,14 @@ const BlueprintsSidebar = ({
/>
</StackItem>
<StackItem>
<Card
ouiaId={`blueprint-card-all`}
isCompact
isClickable
<Button
ouiaId={`clear-selected-blueprint-button`}
variant="link"
isDisabled={!selectedBlueprint}
onClick={() => setSelectedBlueprint(undefined)}
>
<CardHeader
selectableActions={{
selectableActionId: 'show-all-card',
name: 'blueprints',
variant: 'single',
onClickAction: () => setSelectedBlueprint(undefined),
}}
>
<CardTitle component="a">Clear selection</CardTitle>
</CardHeader>
</Card>
Clear selection
</Button>
</StackItem>
</>
)}

View file

@ -195,7 +195,7 @@ describe('Blueprints', () => {
// wait for debounce
await waitFor(() => {
expect(screen.getAllByRole('radio')).toHaveLength(2);
expect(screen.getAllByRole('radio')).toHaveLength(1);
});
});
});