Skip to content

Commit

Permalink
chore: upgrade @fn-sphere/filter to version 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lawvs committed Sep 30, 2024
1 parent e6c4ac5 commit 94b9dfb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@blocksuite/sync": "^0.17.14",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@fn-sphere/filter": "^0.5.0",
"@fn-sphere/filter": "^0.6.0",
"@mui/material": "^5.16.7",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
Expand Down
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

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

20 changes: 10 additions & 10 deletions src/components/filter-sphere.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,19 @@ export type SingleFilterRuleProps = {
rule: SingleFilter;
};

const createFilterWithPreset = () =>
createSingleFilter({
name: "equals",
path: ["type"],
});

export const createFlattenFilterGroup = () =>
createFilterGroup({
op: "or",
conditions: [
createFilterGroup({
op: "and",
conditions: [
createSingleFilter({
name: "Equals",
path: ["type"],
}),
],
conditions: [createFilterWithPreset()],
}),
],
});
Expand All @@ -168,10 +169,9 @@ const SingleFilterView = ({ rule }: SingleFilterRuleProps) => {
removeRule,
appendRule,
} = useFilterRule(rule);
const { numberOfRules, getRootRule, updateRootRule } = useRootRule();
const { rootRule, numberOfRules, setRootRule } = useRootRule();
const { Button: ButtonView } = useView("components");
const { FieldSelect, FilterSelect, FilterDataInput } = useView("templates");
const rootRule = getRootRule();

const isLastRuleInGroup =
isLastRule &&
Expand All @@ -196,10 +196,10 @@ const SingleFilterView = ({ rule }: SingleFilterRuleProps) => {
rootRule.conditions.push(
createFilterGroup({
op: "and",
conditions: [createSingleFilter()],
conditions: [createFilterWithPreset()],
}),
);
updateRootRule(rootRule);
setRootRule(rootRule);
}}
>
Or
Expand Down

0 comments on commit 94b9dfb

Please sign in to comment.