Merge pull request #2000 from automatisch/AUT-1131
fix: prevent removing last filter criteria
This commit is contained in:
@@ -122,7 +122,7 @@ function FilterConditions(props) {
|
|||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Stack sx={{ width: '100%' }} direction="column" spacing={2} mt={2}>
|
<Stack sx={{ width: '100%' }} direction="column" spacing={2} mt={2}>
|
||||||
{groups?.map((group, groupIndex) => (
|
{groups?.map((group, groupIndex) => (
|
||||||
<>
|
<React.Fragment key={groupIndex}>
|
||||||
{groupIndex !== 0 && <Divider />}
|
{groupIndex !== 0 && <Divider />}
|
||||||
|
|
||||||
<Typography variant="subtitle2" gutterBottom>
|
<Typography variant="subtitle2" gutterBottom>
|
||||||
@@ -200,6 +200,7 @@ function FilterConditions(props) {
|
|||||||
edge="start"
|
edge="start"
|
||||||
onClick={() => removeGroupItem(groupIndex, groupItemIndex)}
|
onClick={() => removeGroupItem(groupIndex, groupItemIndex)}
|
||||||
sx={{ width: 61, height: 61 }}
|
sx={{ width: 61, height: 61 }}
|
||||||
|
disabled={groups.length === 1 && group.and.length === 1}
|
||||||
>
|
>
|
||||||
<RemoveIcon />
|
<RemoveIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
@@ -227,7 +228,7 @@ function FilterConditions(props) {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</React.Fragment>
|
||||||
))}
|
))}
|
||||||
</Stack>
|
</Stack>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
|
Reference in New Issue
Block a user