Skip to content

Commit

Permalink
Merge remote-tracking branch 'FiWell/master' into enchance/just-portu…
Browse files Browse the repository at this point in the history
…guese
  • Loading branch information
lelemm committed Feb 10, 2025
2 parents 46848c2 + 5f1fadb commit 9c8b945
Show file tree
Hide file tree
Showing 121 changed files with 390 additions and 607 deletions.
26 changes: 26 additions & 0 deletions .github/actions/bump-package-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
set -euo pipefail

version="${1#v}"

files_to_bump=(
packages/api/package.json
packages/desktop-client/package.json
packages/desktop-electron/package.json
)

for file in "${files_to_bump[@]}"; do
if [ -z "$version" ]; then
# version format: YY.MM.patch
# logic: if before the 25th, bump patch, else set minor/major to next month
version="$(jq -r .version "$file" | perl -e '($y,$m,$p)=split/\./,<>;$d=(localtime)[3];$d>25?($p=0,++$m,$m>12&&($m=1,++$y)):$p++;print"$y.$m.$p\n"')"
if [ -z "$version" ]; then
echo "Error: Failed to calculate new version" >&2
exit 1
fi
fi

echo "Bumping $file to version $version"
jq '.version = "'"$version"'"' "$file" > "$file.tmp"
mv "$file.tmp" "$file"
done
35 changes: 35 additions & 0 deletions .github/workflows/generate-release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Generate release PR

on:
workflow_dispatch:
inputs:
ref:
description: 'Commit or branch to release'
required: true
default: 'master'
version:
description: 'Version number for the release (optional)'
required: false
default: ''

jobs:
generate-release-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- name: Bump package versions
id: bump_package_versions
shell: bash
run: |
.github/actions/bump-package-versions ${{ github.event.inputs.version }}
echo "version=$(jq -r .version packages/desktop-client/package.json)" > $GITHUB_OUTPUT
- name: Create PR
uses: peter-evans/create-pull-request@v7
with:
commit-message: '🔖 (${{ steps.bump_package_versions.outputs.version }})'
title: '🔖 (${{ steps.bump_package_versions.outputs.version }})'
body: 'Generated by [generate-release-pr.yml](../tree/master/.github/workflows/generate-release-pr.yml)'
branch: 'release/v${{ steps.bump_package_versions.outputs.version }}'
10 changes: 10 additions & 0 deletions bin/package-electron
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ fi

yarn workspace loot-core build:node

# Get translations
echo "Updating translations..."
if ! [ -d packages/desktop-client/locale ]; then
git clone https://github.com/actualbudget/translations packages/desktop-client/locale
fi
pushd packages/desktop-client/locale > /dev/null
git pull
popd > /dev/null
packages/desktop-client/bin/remove-untranslated-languages

yarn workspace @actual-app/web build --mode=desktop # electron specific build

yarn workspace desktop-electron update-client
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@actual-app/api",
"version": "25.1.0",
"version": "25.2.1",
"license": "MIT",
"description": "An API for Actual",
"engines": {
Expand Down
78 changes: 78 additions & 0 deletions packages/desktop-client/e2e/data/ynab5-demo-budget.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,39 @@
"name": "Hidden Categories",
"hidden": false,
"deleted": false
},
{
"id": "F5751985-3290-41E7-B17F-6DBE979F315D",
"name": "Bills",
"hidden": true,
"deleted": false
}
],
"categories": [
{
"id": "36120000-6c61-4402-985a-891a8d267858",
"category_group_id": "F5751985-3290-41E7-B17F-6DBE979F315D",
"name": "Under extra Bills",
"hidden": false,
"original_category_group_id": null,
"note": null,
"budgeted": 0,
"activity": 0,
"balance": 0,
"goal_type": null,
"goal_day": null,
"goal_cadence": null,
"goal_cadence_frequency": null,
"goal_creation_month": null,
"goal_target": 0,
"goal_target_month": null,
"goal_percentage_complete": null,
"goal_months_to_budget": null,
"goal_under_funded": null,
"goal_overall_funded": null,
"goal_overall_left": null,
"deleted": false
},
{
"id": "36120d44-6c61-4402-985a-891a8d267858",
"category_group_id": "d5c355c2-3b77-4a7f-b8b3-c832b10cfec9",
Expand Down Expand Up @@ -240,6 +270,30 @@
"goal_overall_left": null,
"deleted": false
},
{
"id": "54280000-b567-4cff-8a94-d9d65491990f",
"category_group_id": "53c9d1fc-dc5b-4021-8255-463fa19065e4",
"name": "Sneaky Category",
"hidden": true,
"original_category_group_id": null,
"note": null,
"budgeted": 0,
"activity": 0,
"balance": 0,
"goal_type": "NEED",
"goal_day": null,
"goal_cadence": 1,
"goal_cadence_frequency": 1,
"goal_creation_month": null,
"goal_target": 0,
"goal_target_month": null,
"goal_percentage_complete": null,
"goal_months_to_budget": null,
"goal_under_funded": null,
"goal_overall_funded": null,
"goal_overall_left": null,
"deleted": false
},
{
"id": "ca7f02c3-7801-4a5a-a07d-ab90ca1e6360",
"category_group_id": "53c9d1fc-dc5b-4021-8255-463fa19065e4",
Expand Down Expand Up @@ -576,6 +630,30 @@
"goal_overall_left": null,
"deleted": false
},
{
"id": "6a45b700-0624-4673-a705-830732976846",
"category_group_id": "ce2bff41-c8a3-4845-b14d-3f72f48075ed",
"name": "Hobbies",
"hidden": true,
"original_category_group_id": null,
"note": null,
"budgeted": 0,
"activity": 0,
"balance": 0,
"goal_type": "NEED",
"goal_day": null,
"goal_cadence": 1,
"goal_cadence_frequency": 1,
"goal_creation_month": null,
"goal_target": 0,
"goal_target_month": null,
"goal_percentage_complete": null,
"goal_months_to_budget": null,
"goal_under_funded": null,
"goal_overall_funded": null,
"goal_overall_left": null,
"deleted": false
},
{
"id": "0431a8df-183f-4820-acc4-255138918710",
"category_group_id": "ce2bff41-c8a3-4845-b14d-3f72f48075ed",
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@actual-app/web",
"version": "25.1.0",
"version": "25.2.1",
"license": "MIT",
"files": [
"build"
Expand Down
4 changes: 3 additions & 1 deletion packages/desktop-client/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ function AppInner() {
}

initAll().catch(showErrorBoundary);
}, [cloudFileId, dispatch, showErrorBoundary, t]);
// Removed cloudFileId from dependencies to prevent hard crash when closing budget in Electron
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [dispatch, showErrorBoundary, t]);

useEffect(() => {
global.Actual.updateAppMenu(budgetId);
Expand Down
14 changes: 9 additions & 5 deletions packages/desktop-client/src/components/ManageRules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ import * as undo from 'loot-core/src/platform/client/undo';
import { getNormalisedString } from 'loot-core/src/shared/normalisation';
import { mapField, friendlyOp } from 'loot-core/src/shared/rules';
import { describeSchedule } from 'loot-core/src/shared/schedules';
import { type NewRuleEntity } from 'loot-core/src/types/models';
import {
type RuleEntity,
type NewRuleEntity,
} from 'loot-core/src/types/models';

import { useAccounts } from '../hooks/useAccounts';
import { useCategories } from '../hooks/useCategories';
Expand Down Expand Up @@ -110,7 +113,7 @@ export function ManageRules({
payeeId,
setLoading = () => {},
}: ManageRulesProps) {
const [allRules, setAllRules] = useState([]);
const [allRules, setAllRules] = useState<RuleEntity[]>([]);
const [page, setPage] = useState(0);
const [filter, setFilter] = useState('');
const dispatch = useDispatch();
Expand Down Expand Up @@ -147,7 +150,7 @@ export function ManageRules({
)
).slice(0, 100 + page * 50);
}, [allRules, filter, filterData, page]);
const selectedInst = useSelected('manage-rules', allRules, []);
const selectedInst = useSelected('manage-rules', filteredRules, []);
const [hoveredRule, setHoveredRule] = useState(null);

const onSearchChange = useCallback(
Expand Down Expand Up @@ -197,8 +200,9 @@ export function ManageRules({
setPage(page => page + 1);
}

async function onDeleteSelected() {
const onDeleteSelected = useCallback(async () => {
setLoading(true);

const { someDeletionsFailed } = await send('rule-delete-all', [
...selectedInst.items,
]);
Expand All @@ -212,7 +216,7 @@ export function ManageRules({
await loadRules();
selectedInst.dispatch({ type: 'select-none' });
setLoading(false);
}
}, [selectedInst]);

async function onDeleteRule(id: string) {
setLoading(true);
Expand Down
14 changes: 11 additions & 3 deletions packages/desktop-client/src/components/manager/subscribe/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { Link } from '../../common/Link';
import { Select } from '../../common/Select';
import { Text } from '../../common/Text';
import { View } from '../../common/View';
import { useResponsive } from '../../responsive/ResponsiveProvider';
import { useAvailableLoginMethods, useLoginMethod } from '../../ServerContext';

import { useBootstrapped, Title } from './common';
Expand All @@ -28,6 +29,7 @@ function PasswordLogin({ setError, dispatch }) {
const [password, setPassword] = useState('');
const [loading, setLoading] = useState(false);
const { t } = useTranslation();
const { isNarrowWidth } = useResponsive();

async function onSubmitPassword() {
if (password === '' || loading) {
Expand All @@ -50,19 +52,25 @@ function PasswordLogin({ setError, dispatch }) {
}

return (
<View style={{ flexDirection: 'row', marginTop: 5 }}>
<View
style={{
flexDirection: isNarrowWidth ? 'column' : 'row',
marginTop: 5,
gap: '1rem',
}}
>
<BigInput
autoFocus={true}
placeholder={t('Password')}
type="password"
onChangeValue={newValue => setPassword(newValue)}
style={{ flex: 1, marginRight: 10 }}
style={{ flex: 1 }}
onEnter={onSubmitPassword}
/>
<ButtonWithLoading
variant="primary"
isLoading={loading}
style={{ fontSize: 15, width: 170 }}
style={{ fontSize: 15, width: isNarrowWidth ? '100%' : 170 }}
onPress={onSubmitPassword}
>
<Trans>Sign in</Trans>
Expand Down
Loading

0 comments on commit 9c8b945

Please sign in to comment.