Skip to content

Commit

Permalink
fix(pci-workflow): creation radio button
Browse files Browse the repository at this point in the history
ref: DTCORE-2740
Signed-off-by: Florian Renaut <[email protected]>
  • Loading branch information
frenautvh committed Oct 10, 2024
1 parent c5efe74 commit 3eb3105
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
OsdsIcon,
OsdsPopover,
OsdsPopoverContent,
OsdsRadio,
OsdsRadioButton,
OsdsSearchBar,
OsdsSpinner,
Expand Down Expand Up @@ -45,25 +44,19 @@ const useDatagridColumn = (
id: 'actions',
cell: (instance: TWorkflowInstance) => (
<NotSupportedTooltipComponent region={instance.region}>
<OsdsRadio
value={instance.id}
name="instance"
disabled={isLocalZone(instance.region)}
{...(selectedInstance === instance && { checked: true })}
data-testid={`radio-${instance.id}`}
>
<OsdsRadioButton
color={ODS_THEME_COLOR_INTENT.primary}
size={ODS_RADIO_BUTTON_SIZE.xs}
data-testid={`radio-button-${instance.id}`}
className="mx-auto"
onClick={() => {
if (!isLocalZone(instance.region)) {
onSelectInstance(instance);
}
}}
/>
</OsdsRadio>
<OsdsRadioButton
checked={selectedInstance?.id === instance?.id || undefined}
color={ODS_THEME_COLOR_INTENT.primary}
size={ODS_RADIO_BUTTON_SIZE.xs}
data-testid={`radio-button-${instance.id}`}
disabled={isLocalZone(instance.region) || undefined}
className="mx-auto"
onClick={() => {
if (!isLocalZone(instance.region)) {
onSelectInstance(instance);
}
}}
/>
</NotSupportedTooltipComponent>
),
label: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('WorkflowResource Component', () => {
/>,
{ wrapper },
);
expect(getByTestId('radio-instance1')).toBeInTheDocument();
expect(getByTestId('radio-button-instance1')).toBeInTheDocument();
});

it('disables next button when no instance is selected', () => {
Expand Down

0 comments on commit 3eb3105

Please sign in to comment.