Compare commits

..

41 commits

Author SHA1 Message Date
James Long
3edf947145 Accidentally only build the sourcemap for API bundle 2022-12-08 15:59:12 -05:00
James Long
b34dfb15b2 @actual-app/api 4.1.4 2022-12-08 15:55:29 -05:00
James Long
8b1c5777ad Include the API bundle when publishing 2022-12-08 15:55:05 -05:00
James Long
94c195abb9 Fix API version 2022-12-03 23:34:31 -05:00
James Long
7c1c9bf03a Ignore API bundle 2022-12-03 23:32:57 -05:00
James Long
8f7625831f Prettier 2022-12-03 23:26:11 -05:00
James Long
15e2f2dce7 v22.12.03 2022-12-03 23:26:11 -05:00
Matiss Janis Aboltins
29fb2cc641 Update Account.js 2022-12-03 23:06:59 -05:00
Matiss Janis Aboltins
2566b950c2 feat: ability to add notes to accounts 2022-12-03 23:06:59 -05:00
shall0pass
ba71c1ba05 another 2022-12-03 23:03:19 -05:00
shall0pass
fcde52a9c7 cleanup 2022-12-03 23:03:19 -05:00
shall0pass
94dbbbc68b cleanup 2022-12-03 23:03:19 -05:00
shall0pass
16e01a8f58 fix 2022-12-03 23:03:19 -05:00
shall0pass
a9218e1625 removed additional function 2022-12-03 23:03:19 -05:00
shall0pass
0a61acdf8f Remove the hold for future months button 2022-12-03 23:03:19 -05:00
James Long
157b58a2dd Import only what's needed from the API for importer packages 2022-12-02 10:36:56 -05:00
Matiss Janis Aboltins
7b6909eaa6 fix: add default value to be even more secure against future regressions 2022-11-20 22:49:11 -05:00
Matiss Janis Aboltins
3133ddcda3 fix(useSheetValue): default value should be null not undefined
Fixes #393
2022-11-20 22:49:11 -05:00
James Long
4904da5006 Remove console 2022-11-14 18:01:08 -05:00
James Long
a72ee51e1a Always pull in API package from workspace (fixes #378) 2022-11-14 18:01:08 -05:00
Rich Howell
bf03dfc1cc
Merge pull request #272 from rickdoesdev/master
a11y: update cleared state display for clarity
2022-11-13 18:34:21 +00:00
James Long
a157679906 Fix test 2022-11-12 22:33:49 -05:00
James Long
a4a7803407 Fix lint 2022-11-12 22:33:49 -05:00
James Long
2d9b319e45 Move safeNumber to shared util and tweak implementation 2022-11-12 22:33:49 -05:00
Tom French
4b83552ddf feat: add explicit value checking on saving to / reading from budget 2022-11-12 22:33:49 -05:00
Tom French
5f0da9deb8 fix: replace last usages of | 0 2022-11-12 22:33:49 -05:00
Tom French
e903f5c20d fix: remove unnecessary conversion to 32 bit 2022-11-12 22:33:49 -05:00
Tom French
04aa1731b5 fix: use Math.round in place of truncating digits 2022-11-12 22:33:49 -05:00
Tom French
bb9c9927db fix: use Math.round in place of truncating digits 2022-11-12 22:33:49 -05:00
Tom French
696a094303 fix: replace custom isInteger function with Number.isInteger 2022-11-12 22:33:49 -05:00
Tom French
4421f2a173 fix: use 64bit compatible integer check in aql compiler 2022-11-12 22:33:49 -05:00
Tom French
f1b61cf6f1 fix: use integer check which doesn't require value to be 32 bit 2022-11-12 22:33:49 -05:00
Rich Howell
6075e846d3
Merge pull request #266 from j-f1/update-data-file-index
Update data-file-index.txt
2022-11-12 15:36:42 +00:00
Rich Howell
2857e65ccd
Merge pull request #218 from ezfe/master
Fix enter to create accounts
2022-11-12 15:34:57 +00:00
Rich Howell
29124f624b
Merge pull request #389 from shall0pass/help_button
Add a help button to the menu
2022-11-12 15:05:08 +00:00
shall0pass
aa97994ad2 fix linting error 2022-11-12 04:53:15 -06:00
shall0pass
be3dc26166 launch in separate tab 2022-11-11 18:24:28 -06:00
shall0pass
9ce6f9564c add help button 2022-11-11 18:06:49 -06:00
Rick Cuddy
603179dda1 a11y: update cleared state display for clarity
Create new CircleEmpty svg and set uncleared state to use new icon.

Add 'cursor: pointer' to the cleared field to aid in action awareness.
2022-10-12 19:22:24 +11:00
Jed Fox
fd3c0f9b18
Update data-file-index.txt 2022-10-07 12:05:23 -04:00
Ezekiel Elin
55b9a0e7ef Fix enter to create accounts 2022-08-29 23:47:07 -04:00
27 changed files with 106 additions and 66568 deletions

1
packages/api/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
app/bundle.api.js*

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,8 +1,7 @@
let bundle = require('./app/bundle.api.js');
let injected = require('./injected');
let methods = require('./methods');
let utils = require('./utils');
let injected = require('./injected');
let actualApp;
async function init({ budgetId, config } = {}) {

View file

@ -1,9 +1,18 @@
{
"name": "@actual-app/api",
"version": "4.0.2",
"version": "4.1.5",
"license": "MIT",
"description": "An API for Actual",
"main": "index.js",
"files": [
"app",
"default-db.sqlite",
"index.js",
"injected.js",
"methods.js",
"migrations",
"utils.js"
],
"dependencies": {
"better-sqlite3": "^7.5.0",
"node-fetch": "^1.6.3",

View file

@ -1,6 +1,6 @@
{
"name": "@actual-app/web",
"version": "22.10.25",
"version": "22.12.03",
"license": "MIT",
"files": [
"build"

View file

@ -1,4 +1,5 @@
default-db.sqlite
migrations/.force-copy-windows
migrations/1548957970627_remove-db-version.sql
migrations/1550601598648_payees.sql
migrations/1555786194328_remove_category_group_unique.sql
@ -14,4 +15,3 @@ migrations/1615745967948_meta.sql
migrations/1616167010796_accounts_order.sql
migrations/1618975177358_schedules.sql
migrations/1632571489012_remove_cache.js
migrations/.force-copy-windows

View file

@ -35,6 +35,7 @@ import {
Stack
} from 'loot-design/src/components/common';
import { KeyHandlers } from 'loot-design/src/components/KeyHandlers';
import NotesButton from 'loot-design/src/components/NotesButton';
import CellValue from 'loot-design/src/components/spreadsheet/CellValue';
import format from 'loot-design/src/components/spreadsheet/format';
import useSheetValue from 'loot-design/src/components/spreadsheet/useSheetValue';
@ -106,6 +107,7 @@ function EmptyMessage({ onAdd }) {
function ReconcilingMessage({ balanceQuery, targetBalance, onDone }) {
let cleared = useSheetValue({
name: balanceQuery.name + '-cleared',
value: 0,
query: balanceQuery.query.filter({ cleared: true })
});
let targetDiff = targetBalance - cleared;
@ -669,30 +671,46 @@ const AccountHeader = React.memo(
/>
</InitialFocus>
) : isNameEditable ? (
<Button
bare
<View
style={{
flexDirection: 'row',
alignItems: 'center',
gap: 3,
'& .hover-visible': {
opacity: 0,
transition: 'opacity .25s'
},
'&:hover .hover-visible': {
opacity: 1
}
}}
>
<View
style={{
fontSize: 25,
fontWeight: 500,
marginLeft: -5,
marginTop: -5,
backgroundColor: 'transparent',
'& svg': { display: 'none' },
'&:hover svg': { display: 'unset' }
marginRight: 5,
marginBottom: 5
}}
onClick={() => onExposeName(true)}
>
{accountName}
</View>
<NotesButton id={`account-${account.id}`} />
<Button
bare
className="hover-visible"
onClick={() => onExposeName(true)}
>
<Pencil1
style={{
width: 11,
height: 11,
marginLeft: 5,
color: colors.n4
color: colors.n8
}}
/>
</Button>
</View>
) : (
<View
style={{ fontSize: 25, fontWeight: 500, marginBottom: 5 }}

View file

@ -336,7 +336,7 @@ function StatusCell({
? colors.y5
: selected
? colors.b7
: colors.n6
: colors.n7
};
function onSelect() {
@ -362,7 +362,8 @@ function StatusCell({
':focus': {
border: '1px solid ' + props.color,
boxShadow: `0 1px 2px ${props.color}`
}
},
cursor: isClearedField ? 'pointer' : 'default'
},
isChild && { visibility: 'hidden' }

View file

@ -6,6 +6,7 @@ import { colors } from 'loot-design/src/style';
import AlertTriangle from 'loot-design/src/svg/v2/AlertTriangle';
import CalendarIcon from 'loot-design/src/svg/v2/Calendar';
import CheckCircle1 from 'loot-design/src/svg/v2/CheckCircle1';
import CheckCircleHollow from 'loot-design/src/svg/v2/CheckCircleHollow';
import EditSkull1 from 'loot-design/src/svg/v2/EditSkull1';
import FavoriteStar from 'loot-design/src/svg/v2/FavoriteStar';
import ValidationCheck from 'loot-design/src/svg/v2/ValidationCheck';
@ -49,10 +50,15 @@ export function getStatusProps(status) {
backgroundColor = colors.n11;
Icon = CalendarIcon;
break;
case 'cleared':
color = colors.g5;
backgroundColor = colors.n11;
Icon = CheckCircle1;
break;
default:
color = colors.n1;
backgroundColor = colors.n11;
Icon = CheckCircle1;
Icon = CheckCircleHollow;
break;
}

View file

@ -3,7 +3,7 @@
"productName": "Actual",
"author": "Shift Reset LLC",
"description": "A simple and powerful personal finance system",
"version": "22.10.25",
"version": "22.12.03",
"scripts": {
"clean": "rm -rf dist",
"build": "electron-builder",

View file

@ -1,9 +1,13 @@
// This is a special usage of the API because this package is embedded
// into Actual itself. We only want to pull in the methods in that
// case and ignore everything else; otherwise we'd be pulling in the
// entire backend bundle from the API
const actual = require('@actual-app/api/methods');
const { amountToInteger } = require('@actual-app/api/utils');
const AdmZip = require('adm-zip');
const d = require('date-fns');
const normalizePathSep = require('slash');
const uuid = require('uuid');
const AdmZip = require('adm-zip');
const actual = require('@actual-app/api');
const amountToInteger = actual.utils.amountToInteger;
// Utils

View file

@ -16,7 +16,7 @@
"bin": "./index.js",
"homepage": "https://github.com/actualbudget/actual/tree/master/packages/import-ynab4#readme",
"dependencies": {
"@actual-app/api": "^1.0.0",
"@actual-app/api": "*",
"adm-zip": "^0.5.9",
"date-fns": "2.0.0-alpha.27",
"slash": "3.0.0",

View file

@ -1,6 +1,10 @@
// This is a special usage of the API because this package is embedded
// into Actual itself. We only want to pull in the methods in that
// case and ignore everything else; otherwise we'd be pulling in the
// entire backend bundle from the API
const actual = require('@actual-app/api/methods');
const d = require('date-fns');
const uuid = require('uuid');
const actual = require('@actual-app/api');
function amountFromYnab(amount) {
// ynabs multiplies amount by 1000 and actual by 100

View file

@ -16,7 +16,7 @@
"bin": "./index.js",
"homepage": "https://github.com/actualbudget/actual/tree/master/packages/import-ynab5#readme",
"dependencies": {
"@actual-app/api": "^1.0.0",
"@actual-app/api": "*",
"date-fns": "2.0.0-alpha.27",
"uuid": "3.3.2"
}

View file

@ -24,21 +24,12 @@ export function applyBudgetAction(month, type, args) {
case 'set-3-avg':
await send('budget/set-3month-avg', { month });
break;
case 'set-all-future':
await send('budget/set-all-future', { startMonth: month });
break;
case 'hold':
await send('budget/hold-for-next-month', {
month,
amount: args.amount
});
break;
case 'hold-all-future':
await send('budget/hold-for-future-months', {
startMonth: month,
amount: args.amount
});
break;
case 'reset-hold':
await send('budget/reset-hold', { month });
break;

View file

@ -190,26 +190,6 @@ export async function set3MonthAvg({ month }) {
});
}
export async function setAllFuture({ startMonth }) {
if (!isReflectBudget()) {
throw new Error('setAllFuture only applies to report budget type');
}
let table = getBudgetTable();
let budgetData = await getBudgetData(table, dbMonth(startMonth));
let months = getAllMonths(monthUtils.addMonths(startMonth, 1));
batchMessages(() => {
for (let month of months) {
budgetData.forEach(budget => {
if (budget.is_income === 1 && !isReflectBudget()) {
return;
}
setBudget({ category: budget.category, month, amount: budget.amount });
});
}
});
}
export async function holdForNextMonth({ month, amount }) {
let row = await db.first(
'SELECT buffered FROM zero_budget_months WHERE id = ?',
@ -232,18 +212,6 @@ export async function holdForNextMonth({ month, amount }) {
return false;
}
export async function holdForFutureMonths({ startMonth, amount }) {
let months = getAllMonths(startMonth);
await batchMessages(async () => {
for (let month of months) {
if (!(await holdForNextMonth({ month, amount }))) {
break;
}
}
});
}
export async function resetHold({ month }) {
await setBuffer(month, 0);
}

View file

@ -12,15 +12,10 @@ app.method(
);
app.method('budget/set-zero', mutator(undoable(actions.setZero)));
app.method('budget/set-3month-avg', mutator(undoable(actions.set3MonthAvg)));
app.method('budget/set-all-future', mutator(undoable(actions.setAllFuture)));
app.method(
'budget/hold-for-next-month',
mutator(undoable(actions.holdForNextMonth))
);
app.method(
'budget/hold-for-future-months',
mutator(undoable(actions.holdForFutureMonths))
);
app.method('budget/reset-hold', mutator(undoable(actions.resetHold)));
app.method(
'budget/cover-overspending',

View file

@ -368,10 +368,6 @@ export default React.memo(function BudgetSummary({ month }) {
{
name: 'set-3-avg',
text: 'Set budgets to 3 month avg'
},
{
name: 'set-all-future',
text: 'Apply to all future budgets'
}
]}
/>

View file

@ -204,10 +204,6 @@ function ToBudget({ month, prevMonthName, collapsed, onBudgetAction }) {
name: 'buffer',
text: 'Hold for next month'
},
{
name: 'buffer-future',
text: 'Hold for all future months'
},
{
name: 'reset-buffer',
text: "Reset next month's buffer"
@ -224,14 +220,6 @@ function ToBudget({ month, prevMonthName, collapsed, onBudgetAction }) {
}}
/>
)}
{state.menuOpen === 'buffer-future' && (
<HoldTooltip
onClose={() => setState({ menuOpen: null })}
onSubmit={amount => {
onBudgetAction(month, 'hold-all-future', { amount });
}}
/>
)}
{state.menuOpen === 'transfer' && (
<TransferTooltip
initialAmountName="leftover"

View file

@ -938,10 +938,6 @@ export function ModalButtons({
style
]}
>
{/* Add a dummy button first so that when a user
presses "enter" they do a normal submit, instead of
activating the back button */}
<Button data-hidden={true} style={{ display: 'none' }} />
{leftContent}
<View style={{ flex: 1 }} />
{children}

View file

@ -146,7 +146,9 @@ function CreateLocalAccount({ modalProps, actions, history }) {
)}
<ModalButtons>
<Button onClick={() => modalProps.onBack()}>Back</Button>
<Button onClick={() => modalProps.onBack()} type="button">
Back
</Button>
<Button primary style={{ marginLeft: 10 }}>
Create
</Button>

View file

@ -397,6 +397,9 @@ const MenuButton = withRouter(function MenuButton({ history }) {
case 'settings':
history.push('/settings');
break;
case 'help':
window.open('https://actualbudget.github.io/docs', '_blank');
break;
case 'close':
dispatch(closeBudget());
break;
@ -411,6 +414,7 @@ const MenuButton = withRouter(function MenuButton({ history }) {
{ name: 'repair-splits', text: 'Repair split transactions' },
Menu.line,
{ name: 'settings', text: 'Settings' },
{ name: 'help', text: 'Help' },
{ name: 'close', text: 'Close File' }
];

View file

@ -41,7 +41,7 @@ export default function useSheetValue(binding, onChange) {
let spreadsheet = useContext(SpreadsheetContext);
let [result, setResult] = useState({
name: sheetName + '!' + binding.name,
value: binding.value,
value: binding.value === undefined ? null : binding.value,
query: binding.query
});
let latestOnChange = useRef(onChange);

View file

@ -0,0 +1,19 @@
import React from 'react';
const SvgCheckCircleHollow = props => (
<svg
{...props}
viewBox="0 0 24 24"
style={{
color: '#242134',
...props.style
}}
>
<path
d="M 12 0 C 1.3084197 0 -4.0435475 12.925204 3.515625 20.484375 C 11.074797 28.043547 24 22.69158 24 12 C 23.992285 5.3757944 18.624205 0.0077147446 12 0 z M 12.009766 1.9882812 C 17.531104 1.9947115 22.005288 6.4688953 22.011719 11.990234 C 22.011719 20.90177 11.238144 25.363144 4.9375 19.0625 C -1.3631434 12.761856 3.0982293 1.9882812 12.009766 1.9882812 z M 18.244141 6.5761719 A 1 1 0 0 0 17.316406 7.0175781 L 11.089844 15.46875 L 7.0136719 12.207031 A 1.0004882 1.0004882 0 1 0 5.7636719 13.769531 L 10.652344 17.677734 A 1.011 1.011 0 0 0 12.082031 17.488281 L 18.927734 8.1992188 A 1 1 0 0 0 18.244141 6.5761719 z "
fill="currentColor"
/>
</svg>
);
export default SvgCheckCircleHollow;

View file

@ -330,11 +330,6 @@ class Budget extends React.Component {
case 3:
this.onBudgetAction('set-3-avg');
break;
case 4:
if (budgetType === 'report') {
this.onBudgetAction('set-all-future');
break;
}
default:
}
}

View file

@ -22,21 +22,11 @@ __metadata:
languageName: unknown
linkType: soft
"@actual-app/api@npm:^1.0.0":
version: 1.1.3
resolution: "@actual-app/api@npm:1.1.3"
dependencies:
node-ipc: 9.1.1
uuid: 3.3.2
checksum: e7fccff7583d64ac908eb7a7c93226200fd75af92b9fe9718b6e3fe0d004d92d79d87485e212b0d3d86cb685827e6733c939ece799156eea64db886bf1457a94
languageName: node
linkType: hard
"@actual-app/import-ynab4@*, @actual-app/import-ynab4@workspace:packages/import-ynab4":
version: 0.0.0-use.local
resolution: "@actual-app/import-ynab4@workspace:packages/import-ynab4"
dependencies:
"@actual-app/api": ^1.0.0
"@actual-app/api": "*"
adm-zip: ^0.5.9
date-fns: 2.0.0-alpha.27
slash: 3.0.0
@ -50,7 +40,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@actual-app/import-ynab5@workspace:packages/import-ynab5"
dependencies:
"@actual-app/api": ^1.0.0
"@actual-app/api": "*"
date-fns: 2.0.0-alpha.27
uuid: 3.3.2
bin:
@ -8844,7 +8834,7 @@ __metadata:
languageName: node
linkType: hard
"easy-stack@npm:^1.0.0, easy-stack@npm:^1.0.1":
"easy-stack@npm:^1.0.1":
version: 1.0.1
resolution: "easy-stack@npm:1.0.1"
checksum: 161a99e497b3857b0be4ec9e1ebbe90b241ea9d84702f9881b8e5b3f6822065b8c4e33436996935103e191bffba3607de70712a792f4d406a050def48c6bc381
@ -13813,13 +13803,6 @@ jest-snapshot@test:
languageName: node
linkType: hard
"js-message@npm:1.0.5":
version: 1.0.5
resolution: "js-message@npm:1.0.5"
checksum: fd2fc8837a88a115aa2fa859bf5c13d9b335fd7eeba8426c44da6eb006b04c52cfe6675b3c27d6b112ffc51dadb8bc51d58340c3a3aa5c555d7da6bdc72ce9c0
languageName: node
linkType: hard
"js-message@npm:1.0.7":
version: 1.0.7
resolution: "js-message@npm:1.0.7"
@ -13827,15 +13810,6 @@ jest-snapshot@test:
languageName: node
linkType: hard
"js-queue@npm:2.0.0":
version: 2.0.0
resolution: "js-queue@npm:2.0.0"
dependencies:
easy-stack: ^1.0.0
checksum: 8f8e589cc20fd3bc3067db73ecaac77b55411c3ac58fdd6882868924ee19ab4203d19e68d3ec680c5c8f5e8282e30dafa377014dbec05c3f2d33be4596f4fb65
languageName: node
linkType: hard
"js-queue@npm:2.0.2":
version: 2.0.2
resolution: "js-queue@npm:2.0.2"
@ -16222,17 +16196,6 @@ jest-snapshot@test:
languageName: node
linkType: hard
"node-ipc@npm:9.1.1":
version: 9.1.1
resolution: "node-ipc@npm:9.1.1"
dependencies:
event-pubsub: 4.3.0
js-message: 1.0.5
js-queue: 2.0.0
checksum: 2b66099d1976e4328d34ae7fec853d3969ca337b52b5aefb48ae1d19387c37d6716c2b98d4a4934ec24aa79f0441721961d6c1beb858c294ad6a7a97ddf5460d
languageName: node
linkType: hard
"node-ipc@npm:9.1.4":
version: 9.1.4
resolution: "node-ipc@npm:9.1.4"