Skip to content

Commit

Permalink
fix(QueryBuilder): link buttons not disabled in read only mode
Browse files Browse the repository at this point in the history
  • Loading branch information
MEsteves22 authored and francisco-guilherme committed Dec 21, 2023
1 parent 5181889 commit ecac2cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/core/src/QueryBuilder/QueryBuilder.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,14 @@ export const { useClasses, staticClasses } = createClasses("HvQueryBuilder", {
cursor: "pointer",
backgroundColor: "transparent",
padding: 0,

"&:disabled": { cursor: "not-allowed", pointerEvents: "none" },
},
createGroupButton: {
cursor: "pointer",
backgroundColor: "transparent",
padding: 0,

"&:disabled": { cursor: "not-allowed", pointerEvents: "none" },
},
});
3 changes: 2 additions & 1 deletion packages/core/src/QueryBuilder/RuleGroup/RuleGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { HvMultiButton } from "../../MultiButton";
import { HvTypography } from "../../Typography";
import { IconButton } from "../../utils/IconButton";
import { ExtractNames } from "../../utils/classes";

import { Rule } from "../Rule";
import { useQueryBuilderContext } from "../Context";
import { useClasses } from "../QueryBuilder.styles";
Expand Down Expand Up @@ -199,6 +198,7 @@ export const RuleGroup = ({
dispatchAction({ type: "add-rule", id });
}}
className={classes.createConditionButton}
disabled={readOnly}
>
{`${labels.empty?.createCondition}`}
</HvTypography>
Expand All @@ -212,6 +212,7 @@ export const RuleGroup = ({
dispatchAction({ type: "add-group", id });
}}
className={classes.createGroupButton}
disabled={readOnly}
>
{`${labels.empty?.createGroup}`}
</HvTypography>
Expand Down

0 comments on commit ecac2cc

Please sign in to comment.