Skip to content

Commit

Permalink
Filter fix when alternating all <-> any (#3278)
Browse files Browse the repository at this point in the history
  • Loading branch information
lelemm authored Aug 24, 2024
1 parent 7769d03 commit 1750cd9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/desktop-client/src/components/accounts/Account.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1113,10 +1113,10 @@ class AccountInternal extends PureComponent {
);
};

onConditionsOpChange = (value, conditions) => {
onConditionsOpChange = value => {
this.setState({ filterConditionsOp: value });
this.setState({ filterId: { ...this.state.filterId, status: 'changed' } });
this.applyFilters([...conditions]);
this.applyFilters([...this.state.filterConditions]);
if (this.state.search !== '') {
this.onSearch(this.state.search);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function FiltersStack({
onReloadSavedFilter: (savedFilter: SavedFilter, value?: string) => void;
filterId: SavedFilter;
savedFilters: TransactionFilterEntity[];
onConditionsOpChange: () => void;
onConditionsOpChange: (value: 'and' | 'or') => void;
}) {
return (
<View>
Expand Down
12 changes: 8 additions & 4 deletions packages/desktop-client/src/components/modals/EditRule.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function FieldSelect({ fields, style, value, onChange }) {
bare
options={fields}
value={value}
onChange={value => onChange('field', value)}
onChange={onChange}
buttonStyle={{ color: theme.pageTextPositive }}
/>
</View>
Expand Down Expand Up @@ -260,7 +260,11 @@ function ConditionEditor({

return (
<Editor style={editorStyle} error={error}>
<FieldSelect fields={conditionFields} value={field} onChange={onChange} />
<FieldSelect
fields={conditionFields}
value={field}
onChange={value => onChange('field', value)}
/>
<OpSelect ops={ops} value={op} type={type} onChange={onChange} />

<View style={{ flex: 1 }}>{valueEditor}</View>
Expand Down Expand Up @@ -373,7 +377,7 @@ function ActionEditor({ action, editorStyle, onChange, onDelete, onAdd }) {
<FieldSelect
fields={options?.splitIndex ? splitActionFields : actionFields}
value={field}
onChange={onChange}
onChange={value => onChange('field', value)}
/>

<View style={{ flex: 1 }}>
Expand Down Expand Up @@ -838,7 +842,7 @@ export function EditRule({ defaultRule, onSave: originalOnSave }) {
setStage(stage);
}

function onChangeConditionsOp(name, value) {
function onChangeConditionsOp(value) {
setConditionsOp(value);
}

Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3278.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [lelemm]
---

Filter fix when alternating all <-> any

0 comments on commit 1750cd9

Please sign in to comment.