Skip to content

Commit b14ee74

Browse files
committed
fix: config checkbox selection in the admin panel
1 parent 00da501 commit b14ee74

2 files changed

Lines changed: 8 additions & 12 deletions

File tree

admin/src/components/ConfigList/ConfigListRow/index.jsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Tr, Td, Checkbox, Typography } from '@strapi/design-system';
2+
import { Tr, Td, Checkbox, Typography, Box } from '@strapi/design-system';
33

44
const CustomRow = ({ row, checked, updateValue, ...props }) => {
55
const { configName, configType, state, onClick } = row;
@@ -39,26 +39,23 @@ const CustomRow = ({ row, checked, updateValue, ...props }) => {
3939
if (e.target.type !== 'checkbox') {
4040
onClick(configType, configName);
4141
}
42-
if (props.onClick) {
43-
props.onClick(e);
44-
}
4542
}}
4643
style={{ cursor: 'pointer' }}
4744
>
4845
<Td>
4946
<Checkbox
5047
aria-label={`Select ${configName}`}
51-
value={checked}
52-
onValueChange={updateValue}
48+
checked={checked}
49+
onCheckedChange={updateValue}
5350
/>
5451
</Td>
55-
<Td>
52+
<Td onClick={(e) => props.onClick(e)}>
5653
<Typography variant="omega">{configName}</Typography>
5754
</Td>
58-
<Td>
55+
<Td onClick={(e) => props.onClick(e)}>
5956
<Typography variant="omega">{configType}</Typography>
6057
</Td>
61-
<Td>
58+
<Td onClick={(e) => props.onClick(e)}>
6259
<Typography variant="omega" style={stateStyle(state)}>{state}</Typography>
6360
</Td>
6461
</Tr>

admin/src/components/ConfigList/index.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,8 @@ const ConfigList = ({ diff, isLoading }) => {
123123
<Th>
124124
<Checkbox
125125
aria-label={formatMessage({ id: 'config-sync.ConfigList.SelectAll' })}
126-
indeterminate={isIndeterminate}
127-
onValueChange={(value) => setCheckedItems(checkedItems.map(() => value))}
128-
value={allChecked}
126+
checked={isIndeterminate ? "indeterminate" : allChecked}
127+
onCheckedChange={(value) => setCheckedItems(checkedItems.map(() => value))}
129128
/>
130129
</Th>
131130
<Th>

0 commit comments

Comments
 (0)