fix: config checkbox selection in the admin panel

pull/147/head
Boaz Poolman 2024-10-12 19:44:39 +02:00
parent 00da5012d8
commit b14ee74c36
2 changed files with 8 additions and 12 deletions

View File

@ -1,5 +1,5 @@
import React from 'react';
import { Tr, Td, Checkbox, Typography } from '@strapi/design-system';
import { Tr, Td, Checkbox, Typography, Box } from '@strapi/design-system';
const CustomRow = ({ row, checked, updateValue, ...props }) => {
const { configName, configType, state, onClick } = row;
@ -39,26 +39,23 @@ const CustomRow = ({ row, checked, updateValue, ...props }) => {
if (e.target.type !== 'checkbox') {
onClick(configType, configName);
}
if (props.onClick) {
props.onClick(e);
}
}}
style={{ cursor: 'pointer' }}
>
<Td>
<Checkbox
aria-label={`Select ${configName}`}
value={checked}
onValueChange={updateValue}
checked={checked}
onCheckedChange={updateValue}
/>
</Td>
<Td>
<Td onClick={(e) => props.onClick(e)}>
<Typography variant="omega">{configName}</Typography>
</Td>
<Td>
<Td onClick={(e) => props.onClick(e)}>
<Typography variant="omega">{configType}</Typography>
</Td>
<Td>
<Td onClick={(e) => props.onClick(e)}>
<Typography variant="omega" style={stateStyle(state)}>{state}</Typography>
</Td>
</Tr>

View File

@ -123,9 +123,8 @@ const ConfigList = ({ diff, isLoading }) => {
<Th>
<Checkbox
aria-label={formatMessage({ id: 'config-sync.ConfigList.SelectAll' })}
indeterminate={isIndeterminate}
onValueChange={(value) => setCheckedItems(checkedItems.map(() => value))}
value={allChecked}
checked={isIndeterminate ? "indeterminate" : allChecked}
onCheckedChange={(value) => setCheckedItems(checkedItems.map(() => value))}
/>
</Th>
<Th>