-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
132 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 15 additions & 17 deletions
32
packages/desktop-client/src/components/filters/subfieldFromFilter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 17 additions & 7 deletions
24
packages/desktop-client/src/components/filters/subfieldToOptions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,34 @@ | ||
import { type RuleConditionEntity } from 'loot-core/src/types/models'; | ||
|
||
export function subfieldToOptions(field: string, subfield: string) { | ||
let setOptions: RuleConditionEntity['options']; | ||
switch (field) { | ||
case 'amount': | ||
switch (subfield) { | ||
case 'amount-inflow': | ||
return { inflow: true }; | ||
setOptions = { ...setOptions, inflow: true }; | ||
break; | ||
case 'amount-outflow': | ||
return { outflow: true }; | ||
setOptions = { ...setOptions, outflow: true }; | ||
break; | ||
default: | ||
return null; | ||
break; | ||
} | ||
break; | ||
case 'date': | ||
switch (subfield) { | ||
case 'month': | ||
return { month: true }; | ||
setOptions = { ...setOptions, month: true }; | ||
break; | ||
case 'year': | ||
return { year: true }; | ||
setOptions = { ...setOptions, year: true }; | ||
break; | ||
default: | ||
return null; | ||
break; | ||
} | ||
break; | ||
default: | ||
return null; | ||
break; | ||
} | ||
return setOptions; | ||
} |
3 changes: 2 additions & 1 deletion
3
packages/desktop-client/src/components/filters/updateFilterReducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.