Skip to content

Commit

Permalink
Merge branch 'main' into unify-the-units
Browse files Browse the repository at this point in the history
  • Loading branch information
thangqp authored Jan 14, 2025
2 parents b88ce31 + 6048ada commit 680731f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gridsuite/commons-ui",
"version": "0.76.2",
"version": "0.77.0",
"description": "common react components for gridsuite applications",
"engines": {
"npm": ">=9",
Expand Down
3 changes: 0 additions & 3 deletions src/components/filter/expert/expertFilterUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,6 @@ export const queryValidator: QueryValidator = (query) => {
};
const validateGroup = (ruleGroup: RuleGroupTypeAny) => {
const reasons: any[] = [];
if (ruleGroup.rules.length === 0) {
reasons.push(RULES.EMPTY_GROUP);
}
if (ruleGroup.id) {
if (reasons.length) {
result[ruleGroup.id] = { valid: false, reasons };
Expand Down
6 changes: 2 additions & 4 deletions src/components/inputs/reactQueryBuilder/RemoveButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import IconButton from '@mui/material/IconButton';
import DeleteIcon from '@mui/icons-material/Delete';
import { useController } from 'react-hook-form';

import { getNumberOfSiblings, recursiveRemove } from '../../filter/expert/expertFilterUtils';
import { recursiveRemove } from '../../filter/expert/expertFilterUtils';

const EXPERT_FILTER_QUERY = 'rules';

Expand All @@ -26,11 +26,9 @@ export function RemoveButton(props: ActionWithRulesProps) {
onChange(recursiveRemove(query, path));
}

const isLastRuleOrGroup = path.toString() === [0].toString() && getNumberOfSiblings(path, query) === 1;

return (
<IconButton size="small" onClick={() => handleDelete()} className={className} title={title}>
{!isLastRuleOrGroup && <DeleteIcon />}
<DeleteIcon />
</IconButton>
);
}

0 comments on commit 680731f

Please sign in to comment.