Adding transactions to account page #152
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Addressing issue #149)
Disclaimer:
You may notice more changes in files than there are actually, since I just noticed that my Editor automatically formats code so in some cases lines are just reformatted and nothing is really changed. Hence, I will try to be specific on the main changes I made to the code. However if you feel like this is an issue I can close this PR and open a new one.
Overview:
To address this issue, we need to work with both the frontend of the app (i.e. find the correct widget to represent the transactions) and its backend (i.e. retrieve from the database the transactions from a specific bank account and define the providers that the widget can watch). So, moving from bottom to top of the stack, what I did was:
In commit fe9eec3 I added a method to
bankAccountMethods()
so that I can interrogate the db to get the last n transactions from a particular accountIn commit a3c7714 I defined the provider (
selectedAccountLastTransactions
) that will be exposed to the account page widget to update the transaction list.Note: Here I hardcoded that the widget will retrieve just the last 50 transactions (due to efficiency reasons). This is ugly, I admit, but for the time being it should be ok.
As a widget I chose the same widget used to represent transactions in the home page. However, I didn't want to repeat for each transaction which account belong to (since it seemed redundant to me), so I just removed in the widget the bang operator (
!
), hence allowing for empty names in the bank account name field (commit 78f361b)Finally, I added the transaction list to the account page. Moreover, I changed the color of the back arrow, since it had the same color of the background (commit f29f92e)