Commit Graph

513 Commits

Author SHA1 Message Date
Matiss Janis Aboltins
67c3be97a1 ♻️ move all feature flags to use useFeatureFlag hook (#786)
Refactored all feature flags to use the new `useFeatureFlag` hook.

Also added a new functionality to this feature flag: ability to define
custom "default" value for a feature flag. This will allow us to enable
the new autocomplete component for everyone using Netlify builds
eventually (need to address some issues before doing so).
2023-03-18 18:41:45 +00:00
Jed Fox
8def8393da Remove a few unused class components, convert a few components to functions (#783) 2023-03-18 10:59:24 -04:00
Matiss Janis Aboltins
c3c2861dbd ♻️ further autocomplete refactors (#778)
Further iterations on the new autocomplete.

1. Created `AccountAutocomplete`
2. Started using new autocomplete in `GenericInput` (used for notes
field)
3. Extracted common functionality between the three new autocompletes to
a generic component: `Autocomplete`
2023-03-18 14:25:24 +00:00
Jed Fox
97b1b6f815 Improve handling of large currency amounts (#725)
- Add a “hide decimal places” setting to visually hide the `.xx` from
currency values globally
- When hiding the fractional digits, slightly decrease character spacing
to allow more digits to show up

Ref: #327

New settings:
<img width="566" alt="Screenshot_2023-03-17 14 19 46"
src="https://user-images.githubusercontent.com/25517624/225986815-b884b93d-02f9-48b3-a73d-d27f90b678cf.png">


Before/after:
<img width="149" alt="Screenshot_2023-02-27 21 47 07"
src="https://user-images.githubusercontent.com/25517624/222916856-21ab4f03-56c6-4b24-8fc1-ac4b883138b7.png"><img
width="131" alt="Screenshot_2023-02-27 22 02 01"
src="https://user-images.githubusercontent.com/25517624/222916859-cf882ca3-6087-4994-818e-239c3374e412.png">
2023-03-18 09:41:38 -04:00
Matiss Janis Aboltins
7063af9e58 revert change to useTableNavigator (#775) 2023-03-18 13:28:31 +00:00
Jed Fox
beef97d7b8 Move the welcome modal to an interstitial, add import button (#762)
I noticed that the first run flow is suboptimal for people who want to
import an existing file from Actual/YNAB. I’ve moved the welcome modal
into the management app and set it up to appear when there are no
budgets available (which also has the benefit of allowing people to see
the modal again!)

I think there’s some weirdness around getting the modal to reappear when
deleting a budget file which I want to work out before merging this.

This PR also reorganizes the management app a bit to reduce usage of
modals (currently, hitting escape while the budget list is open leaves
you with a blank page).

<img width="539" alt="Screenshot_2023-03-18 08 53 54"
src="https://user-images.githubusercontent.com/25517624/226107462-b2b88791-1015-4397-b290-c64e7fcc0f41.png">

- [x] Ensure modal consistently appears when needed (no longer a modal!)
- [x] Fix e2e tests
2023-03-18 09:21:53 -04:00
Matiss Janis Aboltins
98948744ca change unit test usage of notes field (#780)
Added an extra `waitFor` after a flaky unit test step.

I'm not really super happy with this workaround.. but it does make the
test much more stable (re-ran 5x and no failures:
https://github.com/actualbudget/actual/actions/runs/4455134799).

I think there is some internal timeout happening somewhere which is
causing this issue.. But not really sure where. And this will hopefully
get auto-fixed once we migrate to a new table. 🤞
2023-03-18 12:44:55 +00:00
Matiss Janis Aboltins
2903fd0037 🔥 remove unused tableNavigatorOpts code-path (#781)
Just cleaning up things: removing an unused code-path.
2023-03-18 12:16:24 +00:00
Matiss Janis Aboltins
ce40e61ab7 🐛 (TransactionsTable) bring back missing onHover (#777)
Brining back `onHover`. This is a small regression.
2023-03-18 11:09:03 +00:00
Matiss Janis Aboltins
fc9ca18f1c ⬆️ finish react v18 upgrade: react-dom change (#776)
Finishing off the React v18 upgrade by doing a change in `react-dom`.
Effectively this upgrades from v17 to v18.

https://react.dev/blog/2022/03/08/react-18-upgrade-guide
2023-03-17 23:19:35 +00:00
Matiss Janis Aboltins
141035cdf0 ♻️ (autocomplete) refactor PayeeAutocomplete to react-select (#741) 2023-03-17 22:36:53 +00:00
Matiss Janis Aboltins
610a044f5f ♻️ (TransactionsTable) port to react hooks (#769) 2023-03-17 21:20:20 +00:00
Matiss Janis Aboltins
26363ed82d ⬆️ upgrade fast-check to improve unit test perf (#772)
Upgraded `fast-check` to improve unit test performance.
2023-03-17 21:20:01 +00:00
Matiss Janis Aboltins
815413e48c reducing flakiness of tests by removing randomization (#771)
This is not a full fix for the flakiness. One of the test cases will
still be flaky. But at least this fixes the other test cases thus
improving stability.
2023-03-17 18:37:02 +00:00
Jed Fox
4a3fe1d9fb node-libofx: add transaction_acct_name function (#670)
I am currently not working on adding support for importing to multiple
accounts, but I wanted to give anyone who takes that on a starting point
by updating the underlying C library to provide access to the account
name field.
2023-03-17 14:00:35 -04:00
Jed Fox
c5c4cbbeb2 Update wording across the UI to clarify that we don’t own any servers (#768) 2023-03-17 13:59:10 -04:00
Matiss Janis Aboltins
5d7ead44aa ⬆️ upgrade React from v16 to v18 (#696) 2023-03-17 12:10:40 +00:00
Matiss Janis Aboltins
d9bc64e792 🐛 making desktop-client tests independent (#765)
Tests cases should be independent. You should be able to run them in
whatever order you want. And they should still pass.

Currently this is not the case. The order of the tests is very important
due to the "pseudo" randomization algorithm.

This PR makes the mock data IDs truly unique thus better exposing the
issue in our tests. Also this PR fixes the dependency issues thus making
each test case truly independent.

---------

Co-authored-by: Jed Fox <git@jedfox.com>
2023-03-16 23:49:43 +00:00
Jed Fox
d166d8f8e8 Disable ESLint when building in CI (#763)
This way formatting issues won’t prevent the preview from building (and
it should build a bit faster due to not having to run ESLint).
2023-03-16 14:41:57 -04:00
Matiss Janis Aboltins
ad08494899 🔥 remove Debugger, perf-deets and codemirror (#755)
Removing
- Debugger
- `perf-deeets`
- `codemirror`
2023-03-16 18:36:15 +00:00
Jed Fox
2762495a68 Fix end-to-end testing workflow (#758) 2023-03-14 19:33:15 -04:00
Jed Fox
d25c31089c Make goal template keywords case insensitive (#756) 2023-03-14 16:02:06 -04:00
Jed Fox
96c7af0c8d Fix #template 0 causing an error (#751)
Thanks @kidglove57 for spotting this issue and helping me track down the
cause!

---------

Co-authored-by: Matiss Janis Aboltins <matiss@mja.lv>
2023-03-14 14:52:12 -04:00
Jed Fox
319679fd65 Add support for automatically generating release notes (#746)
See https://github.com/actualbudget/docs/pull/129 for more details. If
this is accepted, I’ll fill in release notes for the PRs that have been
submitted since the last release and submit a corresponding PR to
`actual-server`.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-14 14:18:14 -04:00
Jed Fox
c7e531a26c Reduce client build size by 1MB (#750)
before:

```
kcab.worker.4bdc73a8d45eb2115156.js (2.1 MiB)
xfo.kcab.worker.4bdc73a8d45eb2115156.js (1010 KiB)
```

after:

```
kcab.worker.39f5fba82d7bc7477962.js (1.41 MiB)
xfo.kcab.worker.39f5fba82d7bc7477962.js (1000 KiB)
```

What’s changed:

- `loot-core` did not have a `browserslist` config, so
`@babel/preset-env` assumes we want to [transpile all the way back to
ES5](https://babeljs.io/docs/options#no-targets). I’ve removed the
`browserslist` config from each of the `package.json` files and moved it
to the root so this doesn’t happen again.
- I updated the target from `electron 3.0` to `electron 12.0` to match
our Electron dependency
- I’ve added `defaults` (currently equivalent to `> 0.5%, last 2
versions, Firefox ESR, not dead`) which is [recommended by
browserslist](https://browsersl.ist/#q=defaults). We could consider
tightening this, but it doesn’t offer a ton of space savings at this
point to just target Electron 12.
- Since much less transpilation will be happening, stack traces (dev and
prod) will be much easier to read!
2023-03-14 13:55:39 -04:00
Waseem Hassan Shahid
21f0644987 fix(nordigen/sync): Use bookingDate as fallback during sync (#754)
Fixes
https://github.com/actualbudget/actual/issues/724#issuecomment-1468453526

And add the missing fallback condition that wasn't catered in
https://github.com/actualbudget/actual/pull/745
2023-03-14 17:50:25 +00:00
Matiss Janis Aboltins
ec89279509 🔖 (23.3.2) nordigen fixes (#747)
Why not `23.3.1`? Because we already released that version for
`actual-server`
v23.3.2
2023-03-13 18:39:34 +00:00
Matiss Janis Aboltins
6e7c95b5be 🐛 (nordigen) check server status before linking accs (#742)
Related to:
https://github.com/actualbudget/actual/issues/724#issuecomment-1455160250

Depends on https://github.com/actualbudget/docs/pull/126 to be merged
first.

Two changes here:
1. show "link account" only if actual-server is used (user is "online");
2. allow linking accounts only if Nordigen is configured (using new API
to get the status for it);

Also ported the `CreateAccount` modal to a functional component.
2023-03-13 18:27:45 +00:00
Matiss Janis Aboltins
0e61bfc47a 🐛 (nordigen) fallback to bookingDate if valueDate is not set (#743)
Fallback to `bookingDate` if `valueDate` is empty.

Fix for:
https://github.com/actualbudget/actual/issues/724#issuecomment-1464914546
2023-03-13 18:21:10 +00:00
Matiss Janis Aboltins
25d49dc4f1 Remove year from the LICENSE (#665) 2023-03-13 10:06:37 -04:00
James Long
df8f5853e8 Route aggregate queries in transaction grouped mode through the correct layer to remove deleted transactions (#247)
I recently migrated my personal usage of Actual over to the open-source
version and imported a bunch of transactions. I have a _lot_ of history
in Actual, including a lot of weird edge cases like deleted split
transactions. While reconciling I noticed that my account balance shown
at the top was incorrect, even though the running balance was current.

Digging into this, I discovered that we aren't correctly handling
aggregate queries when querying transactions in the "grouped" mode.
Aggregate queries don't make sense in the "grouped" mode. Grouped means
that you want a list of transactions that include both the parent and
child transactions (when they are split). If you are summing up all the
amount, you only want to consider non-parent transactions. So we switch
it back to "inline" mode, but the way we did this previously was to
manually stitch the query together.

Even though was add SQL to ignore deleted transactions, we still
possibly include them. A child transaction may not be marked as deleted,
even though the parent transaction is deleted. When a parent transaction
is deleted, all child transactions should be considered deleted as well,
regardless of their tombstone status. This is what the
`v_transactions_internal_alive` view does. Previously we weren't going
through this view though, so we could still potentially include split
transactions even though they've been deleted.

This is little hacky, but it fixes the immediate problem. We fall back
to the inline mode by modifying the where clause, and we also adjust the
view that it queries to use the correct one.
2023-03-12 23:00:15 +00:00
Jakub Kuczys
a5a1c81eaf 🐛 (nordigen) fallback to array version of remittanceInformationUnstructured if necessary (#745)
Try falling back to `remittanceInformationUnstructuredArray.join(', ')`
when neither `debtor/creditorName` nor
`remittanceInformationUnstructured` fields are present.

Addresses a suggestion from
https://github.com/actualbudget/actual/issues/724#issuecomment-1464907064
2023-03-12 21:07:26 +00:00
Jakub Kuczys
0baccfd728 🐛 (nordigen) fix detection of -0.00 "debited" transactions (#744)
Check if the transaction amount is a positive 0 rather than -0.
I went for casting the string with `Number` but I could instead replace
the whole condition with `!trans.amount.startsWith('-')` or with
`trans.amount > 0 || trans.amount == '0.00'` if either of these variants
are preferred.

Fix for
https://github.com/actualbudget/actual/issues/724#issuecomment-1464907064
2023-03-12 16:53:10 -04:00
Jed Fox
b8d7e39110 Set the filename/filetype before attempting to parse (#738)
Fixes #19 by setting the file type before attempting the parse. You’ll
now be able to change the import options even if the first import
attempt failed.

<img width="826" alt="Screenshot_2023-03-10 07 40 23"
src="https://user-images.githubusercontent.com/25517624/224318498-565e1835-8820-4eaf-9e58-df33bb46d744.png">
2023-03-11 16:31:37 -05:00
Matiss Janis Aboltins
0bae379c17 🔖 (5.1.0) upgrade better-sqlite3 to v8.2 (#735)
A new release for `api` too so we could start using `better-sqlite3` v8
in `actual-server`.
v23.3.0
2023-03-09 19:31:00 +00:00
Matiss Janis Aboltins
da9d016550 🔖 (23.3.0) experimental bank-sync integration, maintenace, fixes (#734)
23.3.0

Docs: https://github.com/actualbudget/docs/pull/119
2023-03-09 19:07:58 +00:00
Jed Fox
a82300e20f Remove outdated part of the postinstall script (#733) 2023-03-09 07:36:52 -05:00
Vincent Schmandt
497b2a2009 Implement outdated version indicator (#463) (#621)
This implements a simple indicator showing the user if the currently
used version is outdated by utilising GitHub tags to track the latest
version.
Closes #463

---------

Co-authored-by: Jed Fox <git@jedfox.com>
2023-03-07 22:48:12 -05:00
Jed Fox
2793beab6f Create an artifact with the built web UI for each commit (#729)
Part of fixing the horrendously slow Docker build for the server edge
images.
2023-03-06 16:57:50 -05:00
Matiss Janis Aboltins
f6e6537834 (bank-sync) use full bank list + autocomplete (#727)
Related to: https://github.com/actualbudget/actual-server/pull/144

See the above PR for more details.

---

<img width="577" alt="Screenshot 2023-03-05 at 17 54 10"
src="https://user-images.githubusercontent.com/886567/222977363-605f8b1e-be7d-4594-93c7-dfaa6cb15ac3.png">
2023-03-06 20:45:25 +00:00
Jed Fox
49eda0f4a0 Enable most of the disabled ESLint rules (#720) 2023-03-05 09:23:12 -05:00
Matiss Janis Aboltins
7faed79530 ⬆️ upgrade react-modal to v3.16.1 and remove the patch (#718) 2023-03-05 13:46:13 +00:00
Filip Stybel
5bb4f4b279 Nordigen integration - account sync (#457)
* Update gitignore about .idea folder

The .idea folder is generated by IntelliJ IDEA

* Add integration with Nordigen

* Fix linter

* Use longer access to the account

* Move normalizatoin of accounts to the backend side

* Fix possibility to force remove account

* Move normalization of transactions to the backend side

* Fix Settings.js after merge

* fix enableing bank sync

* delete old Settings component

* Use camelCase for nordigen/remove-account call

* WIP refactor

* Fix auto-selecting existing accounts

* Fix unlinking accounts

* Align to backend changes for Nordigen integration

* Fix AnimatedLoading

* Code review changes

* Fix TZ date issue

* rm mobile package

* rm BankSync settings section

* rm console.log

* rm comment

* applies some alignments from code review

* applies some alignments from code review

* Add prefix for nordigen specific functionality

* Use arrow char

* Add prefix for nordigen functionalities

* Fix linter

* Display only open accounts

* Update packages/desktop-client/src/nordigen.js

Co-authored-by: Jed Fox <git@jedfox.com>

* Fix incorrect calc of TZ for endDate

* Improved error checking

* Fix throwing invalid-schema error

* Fix for syncing large batches in Safari

---------

Co-authored-by: Filip Stybel <filip.stybel@ynd.co>
Co-authored-by: Leon Ebel <24588023+ebelleon@users.noreply.github.com>
Co-authored-by: Jed Fox <git@jedfox.com>
2023-03-03 19:41:07 -05:00
Jed Fox
ec91effe96 Remove code in loot-core/src/server/spreadsheet that uses escodegen (#721) 2023-03-02 12:04:55 -05:00
Matiss Janis Aboltins
28b5124dd8 🚨 re-enable react-hooks/rules-of-hooks eslint rule (#715) 2023-03-02 17:03:11 +00:00
Matiss Janis Aboltins
08b997a791 🔥 remove dead code: budget-sheets-old (#708) 2023-03-02 17:03:02 +00:00
Matiss Janis Aboltins
7d2adfa02e 👷 upgrade github actions (#711)
* 👷  upgrade github actions

* Upgrade actions/checkout
2023-03-02 17:02:50 +00:00
Jed Fox
4e59bdf632 Fix e2e test to not assume it’s been run on Feb 28, 2023 (#717) 2023-03-01 15:08:35 -05:00
Neil
de69e1582c Added option to include exchange rate multiplier during import (#690)
* Addd option to include exchange rate during import

* Added changes to multipler option within form

* Use Input component

* build fixes

* Fix parsing errors

* lint fixes

* Update packages/loot-design/src/components/modals/ImportTransactions.js

Co-authored-by: Matiss Janis Aboltins <matiss@mja.lv>

* Update packages/loot-design/src/components/modals/ImportTransactions.js

Co-authored-by: Matiss Janis Aboltins <matiss@mja.lv>

* Update packages/loot-design/src/components/modals/ImportTransactions.js

Co-authored-by: Matiss Janis Aboltins <matiss@mja.lv>

* Variable name updates

* Record a trace when retrying failing tests

---------

Co-authored-by: Matiss Janis Aboltins <matiss@mja.lv>
Co-authored-by: Jed Fox <git@jedfox.com>
2023-03-01 14:49:48 -05:00
Jed Fox
9ead7d509d Intelligently adjust field for newly added action (#680)
* Intelligently adjust field for newly added action

* Remove unnecessary switch case

* Dedupe list of fields

* Remove unnecessary conditionFields prop

* Intelligently adjust field for newly added condition

* Use a less specific condition
2023-02-28 16:59:33 -05:00