Compare commits

...

16 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
16 changed files with 62 additions and 66516 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

@ -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';
@ -670,30 +671,46 @@ const AccountHeader = React.memo(
/>
</InitialFocus>
) : isNameEditable ? (
<Button
bare
<View
style={{
fontSize: 25,
fontWeight: 500,
marginLeft: -5,
marginTop: -5,
backgroundColor: 'transparent',
'& svg': { display: 'none' },
'&:hover svg': { display: 'unset' }
flexDirection: 'row',
alignItems: 'center',
gap: 3,
'& .hover-visible': {
opacity: 0,
transition: 'opacity .25s'
},
'&:hover .hover-visible': {
opacity: 1
}
}}
onClick={() => onExposeName(true)}
>
{accountName}
<Pencil1
<View
style={{
width: 11,
height: 11,
marginLeft: 5,
color: colors.n4
fontSize: 25,
fontWeight: 500,
marginRight: 5,
marginBottom: 5
}}
/>
</Button>
>
{accountName}
</View>
<NotesButton id={`account-${account.id}`} />
<Button
bare
className="hover-visible"
onClick={() => onExposeName(true)}
>
<Pencil1
style={{
width: 11,
height: 11,
color: colors.n8
}}
/>
</Button>
</View>
) : (
<View
style={{ fontSize: 25, fontWeight: 500, marginBottom: 5 }}

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

@ -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

@ -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

@ -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:
}
}