Skip to content

Commit

Permalink
Merge branch 'master' into in-out_column
Browse files Browse the repository at this point in the history
  • Loading branch information
MatissJanis authored Nov 5, 2023
2 parents 2b91dc6 + a6dae39 commit 3e8b297
Show file tree
Hide file tree
Showing 14 changed files with 192 additions and 82 deletions.
63 changes: 62 additions & 1 deletion packages/desktop-client/e2e/data/ynab5-demo-budget.json
Original file line number Diff line number Diff line change
Expand Up @@ -1671,9 +1671,70 @@
"import_payee_name_original": null,
"debt_transaction_type": null,
"deleted": false
},
{
"id": "213526fc-ba49-4790-8a96-cc2a50182728",
"date": "2023-09-04",
"amount": -100000,
"memo": "Test transaction",
"cleared": "cleared",
"approved": true,
"flag_color": null,
"account_id": "bc1d862f-bab0-41c3-bd1e-6cee8c688e32",
"payee_id": "2a20470a-634f-4efa-a7f6-f1c0b0bdda41",
"category_id": "36120d44-6c61-4402-985a-891a8d267858",
"transfer_account_id": null,
"transfer_transaction_id": null,
"matched_transaction_id": null,
"import_id": null,
"import_payee_name": null,
"import_payee_name_original": null,
"debt_transaction_type": null,
"deleted": false
},
{
"id": "024494a1-f1e0-4667-9fc0-91e4a4262193",
"date": "2023-09-04",
"amount": 50000,
"memo": "split part b",
"cleared": "cleared",
"approved": true,
"flag_color": null,
"account_id": "125f339b-2a63-481e-84c0-f04d898905d2",
"payee_id": "",
"category_id": null,
"transfer_account_id": "bc1d862f-bab0-41c3-bd1e-6cee8c688e32",
"transfer_transaction_id": "213526fc-ba49-4790-8a96-cc2a50182728",
"matched_transaction_id": "",
"import_id": null,
"import_payee_name": null,
"import_payee_name_original": null,
"debt_transaction_type": null,
"deleted": false
}
],
"subtransactions": [
{
"id": "d8ec8c84-5033-4f7e-8485-66bfe19a70d6",
"transaction_id": "213526fc-ba49-4790-8a96-cc2a50182728",
"amount": -50000,
"memo": "split part a",
"payee_id": "2a20470a-634f-4efa-a7f6-f1c0b0bdda41",
"category_id": "36120d44-6c61-4402-985a-891a8d267858",
"transfer_account_id": null,
"deleted": false
},
{
"id": "870d8780-79cf-4197-a341-47d24b2b5a59",
"transaction_id": "213526fc-ba49-4790-8a96-cc2a50182728",
"amount": -50000,
"memo": "split part b",
"payee_id": "2a20470a-634f-4efa-a7f6-f1c0b0bdda41",
"category_id": null,
"transfer_account_id": "125f339b-2a63-481e-84c0-f04d898905d2",
"deleted": false
}
],
"subtransactions": [],
"scheduled_transactions": [],
"scheduled_subtransactions": []
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/desktop-client/e2e/onboarding.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ test.describe('Onboarding', () => {
await expect(budgetPage.budgetTable).toBeVisible({ timeout: 30000 });

const accountPage = await navigation.goToAccountPage('Checking');
await expect(accountPage.accountBalance).toHaveText('700.00');
await expect(accountPage.accountBalance).toHaveText('600.00');

await navigation.goToAccountPage('Saving');
await expect(accountPage.accountBalance).toHaveText('200.00');
await expect(accountPage.accountBalance).toHaveText('250.00');
});

test('creates a new budget file by importing Actual budget', async () => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ class Budget extends Component {
onReorderGroup={this.onReorderGroup}
onOpenActionSheet={() => {}} //this.onOpenActionSheet}
onBudgetAction={applyBudgetAction}
onRefresh={onRefresh}
savePrefs={savePrefs}
/>
)}
Expand Down
156 changes: 80 additions & 76 deletions packages/desktop-client/src/components/budget/MobileBudgetTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import Label from '../common/Label';
import Menu from '../common/Menu';
import Text from '../common/Text';
import View from '../common/View';
import PullToRefresh from '../responsive/PullToRefresh';
import { useServerURL } from '../ServerContext';
import CellValue from '../spreadsheet/CellValue';
import NamespaceContext from '../spreadsheet/NamespaceContext';
Expand Down Expand Up @@ -1526,6 +1527,7 @@ export function BudgetTable(props) {
onShowBudgetDetails,
// onOpenActionSheet,
onBudgetAction,
onRefresh,
savePrefs,
} = props;

Expand Down Expand Up @@ -1742,83 +1744,85 @@ export function BudgetTable(props) {
</View>
</View>
<View style={{ overflowY: 'auto' }}>
{!editMode ? (
// <ScrollView
// ref={el => (this.list = el)}
// keyboardShouldPersistTaps="always"
// refreshControl={refreshControl}
// style={{ backgroundColor: colors.n10 }}
// automaticallyAdjustContentInsets={false}
// >
<View>
<BudgetGroups
type={type}
categoryGroups={categoryGroups}
showBudgetedCol={showBudgetedCol}
show3Cols={show3Cols}
showHiddenCategories={showHiddenCategories}
// gestures={gestures}
month={month}
editMode={editMode}
editingGroupId={editingGroupId}
onEditGroup={onEditGroup}
editingCategoryId={editingCategoryId}
onEditCategory={onEditCategory}
editingBudgetCategoryId={editingBudgetCategoryId}
onEditCategoryBudget={onEditCategoryBudget}
openBudgetActionMenuId={openBudgetActionMenuId}
onOpenBudgetActionMenu={onOpenBudgetActionMenu}
onSaveCategory={onSaveCategory}
onDeleteCategory={onDeleteCategory}
onAddCategory={onAddCategory}
onAddGroup={onAddGroup}
onSaveGroup={onSaveGroup}
onDeleteGroup={onDeleteGroup}
onReorderCategory={onReorderCategory}
onReorderGroup={onReorderGroup}
onBudgetAction={onBudgetAction}
/>
</View>
) : (
// </ScrollView>
// <DragDrop>
// {({
// dragging,
// onGestureEvent,
// onHandlerStateChange,
// scrollRef,
// onScroll
// }) => (
<View>
<BudgetGroups
type={type}
categoryGroups={categoryGroups}
showBudgetedCol={showBudgetedCol}
show3Cols={show3Cols}
showHiddenCategories={showHiddenCategories}
// gestures={gestures}
editMode={editMode}
editingGroupId={editingGroupId}
onEditGroup={onEditGroup}
editingCategoryId={editingCategoryId}
onEditCategory={onEditCategory}
editingBudgetCategoryId={editingBudgetCategoryId}
onEditCategoryBudget={onEditCategoryBudget}
onSaveCategory={onSaveCategory}
onDeleteCategory={onDeleteCategory}
onAddCategory={onAddCategory}
onAddGroup={onAddGroup}
onSaveGroup={onSaveGroup}
onDeleteGroup={onDeleteGroup}
onReorderCategory={onReorderCategory}
onReorderGroup={onReorderGroup}
onBudgetAction={onBudgetAction}
/>
</View>
<PullToRefresh onRefresh={onRefresh}>
{!editMode ? (
// <ScrollView
// ref={el => (this.list = el)}
// keyboardShouldPersistTaps="always"
// refreshControl={refreshControl}
// style={{ backgroundColor: colors.n10 }}
// automaticallyAdjustContentInsets={false}
// >
<View>
<BudgetGroups
type={type}
categoryGroups={categoryGroups}
showBudgetedCol={showBudgetedCol}
show3Cols={show3Cols}
showHiddenCategories={showHiddenCategories}
// gestures={gestures}
month={month}
editMode={editMode}
editingGroupId={editingGroupId}
onEditGroup={onEditGroup}
editingCategoryId={editingCategoryId}
onEditCategory={onEditCategory}
editingBudgetCategoryId={editingBudgetCategoryId}
onEditCategoryBudget={onEditCategoryBudget}
openBudgetActionMenuId={openBudgetActionMenuId}
onOpenBudgetActionMenu={onOpenBudgetActionMenu}
onSaveCategory={onSaveCategory}
onDeleteCategory={onDeleteCategory}
onAddCategory={onAddCategory}
onAddGroup={onAddGroup}
onSaveGroup={onSaveGroup}
onDeleteGroup={onDeleteGroup}
onReorderCategory={onReorderCategory}
onReorderGroup={onReorderGroup}
onBudgetAction={onBudgetAction}
/>
</View>
) : (
// </ScrollView>
// <DragDrop>
// {({
// dragging,
// onGestureEvent,
// onHandlerStateChange,
// scrollRef,
// onScroll
// }) => (
<View>
<BudgetGroups
type={type}
categoryGroups={categoryGroups}
showBudgetedCol={showBudgetedCol}
show3Cols={show3Cols}
showHiddenCategories={showHiddenCategories}
// gestures={gestures}
editMode={editMode}
editingGroupId={editingGroupId}
onEditGroup={onEditGroup}
editingCategoryId={editingCategoryId}
onEditCategory={onEditCategory}
editingBudgetCategoryId={editingBudgetCategoryId}
onEditCategoryBudget={onEditCategoryBudget}
onSaveCategory={onSaveCategory}
onDeleteCategory={onDeleteCategory}
onAddCategory={onAddCategory}
onAddGroup={onAddGroup}
onSaveGroup={onSaveGroup}
onDeleteGroup={onDeleteGroup}
onReorderCategory={onReorderCategory}
onReorderGroup={onReorderGroup}
onBudgetAction={onBudgetAction}
/>
</View>

// <DragDropHighlight />
// </DragDrop>
)}
// <DragDropHighlight />
// </DragDrop>
)}
</PullToRefresh>
</View>
</View>
</NamespaceContext.Provider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ export default function EncryptionSettings() {
<strong>End-to-end encryption</strong> is not available when running
without a server. Budget files are always kept unencrypted locally, and
encryption is only applied when sending data to a server.{' '}
<ExternalLink to="https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption">
<ExternalLink
to="https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption"
linkColor="purple"
>
Learn more…
</ExternalLink>
</Text>
Expand Down
5 changes: 4 additions & 1 deletion packages/desktop-client/src/components/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ function About() {
</Text>
)}
<Text>
<ExternalLink to="https://actualbudget.org/docs/releases">
<ExternalLink
to="https://actualbudget.org/docs/releases"
linkColor="purple"
>
Release Notes
</ExternalLink>
</Text>
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/style/themes/dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export const formInputShadowSelected = colorPalette.purple200;
export const altFormInputShadowSelected = formInputShadowSelected;
export const formInputTextHighlight = colorPalette.purple400;

export const pillBackground = colorPalette.navy600;
export const pillBackground = colorPalette.navy800;
export const pillText = colorPalette.navy200;
export const pillTextHighlighted = colorPalette.purple500;
export const pillBorder = colorPalette.navy700;
Expand Down
2 changes: 2 additions & 0 deletions packages/loot-core/src/server/importers/ynab5-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export namespace YNAB5 {
id: string;
name: string;
deleted: boolean;
transfer_acct?: string;
}

interface CategoryGroup {
Expand Down Expand Up @@ -61,6 +62,7 @@ export namespace YNAB5 {
category_id: string;
memo: string;
amount: number;
transfer_account_id: string;
}

interface Month {
Expand Down
18 changes: 18 additions & 0 deletions packages/loot-core/src/server/importers/ynab5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ async function importTransactions(
let transactionsGrouped = groupBy(data.transactions, 'account_id');
let subtransactionsGrouped = groupBy(data.subtransactions, 'transaction_id');

const payeesByTransferAcct = payees
.filter((payee: YNAB5.Payee) => payee?.transfer_acct)
.map((payee: YNAB5.Payee) => [payee.transfer_acct, payee]);
const payeeTransferAcctHashMap = new Map<string, YNAB5.Payee>(
payeesByTransferAcct,
);

// Go ahead and generate ids for all of the transactions so we can
// reliably resolve transfers
for (let transaction of data.transactions) {
Expand Down Expand Up @@ -178,11 +185,22 @@ async function importTransactions(
entityIdMap.get(transaction.transfer_transaction_id) || null,
subtransactions: subtransactions
? subtransactions.map(subtrans => {
let payee = null;
if (subtrans.transfer_account_id) {
const mappedTransferAccountId = entityIdMap.get(
subtrans.transfer_account_id,
);
payee = payeeTransferAcctHashMap.get(
mappedTransferAccountId,
)?.id;
}

return {
id: entityIdMap.get(subtrans.id),
amount: amountFromYnab(subtrans.amount),
category: entityIdMap.get(subtrans.category_id) || null,
notes: subtrans.memo,
payee,
};
})
: null,
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/1765.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [Evomatic]
---

Dark mode - darker tint for pageTextLink.
6 changes: 6 additions & 0 deletions upcoming-release-notes/1836.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [Marethyu1]
---

UPDATES NYNAB import to support importing transactions that contain sub transactions that are account transfers
6 changes: 6 additions & 0 deletions upcoming-release-notes/1858.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [joel-jeremy]
---

Mobile budget pull down to sync.

0 comments on commit 3e8b297

Please sign in to comment.