Skip to content

Commit

Permalink
Merge branch 'master' into cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rugulous authored Feb 26, 2025
2 parents 88c17d2 + 5214549 commit c9bc598
Show file tree
Hide file tree
Showing 215 changed files with 78 additions and 30 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions packages/desktop-client/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ function AppInner() {
const dispatch = useDispatch();
const userData = useSelector(state => state.user.data);

useEffect(() => {
setI18NextLanguage(null);
}, []);

useEffect(() => {
const maybeUpdate = async <T,>(cb?: () => T): Promise<T> => {
if (global.Actual.isUpdateReadyForDownload()) {
Expand All @@ -67,8 +71,6 @@ function AppInner() {
};

async function init() {
setI18NextLanguage(null);

const socketName = await maybeUpdate(() =>
global.Actual.getServerSocket(),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
SvgWallet,
} from '../../icons/v1';
import { SvgReports } from '../../icons/v1/Reports';
import { SvgCalendar } from '../../icons/v2';
import { SvgCalendar3 } from '../../icons/v2';
import { theme } from '../../style';
import { useResponsive } from '../responsive/ResponsiveProvider';
import { useScrollListener } from '../ScrollProvider';
Expand Down Expand Up @@ -119,7 +119,7 @@ export function MobileNavTabs() {
name: t('Schedules (Soon)'),
path: '/schedules/soon',
style: navTabStyle,
Icon: SvgCalendar,
Icon: SvgCalendar3,
},
{
name: t('Payees (Soon)'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ const ExpenseGroupHeader = memo(function ExpenseGroupHeader({
showBudgetedCol,
collapsed,
onToggleCollapse,
style,
}) {
const opacity = blank ? 0 : 1;
const listItemRef = useRef();
Expand All @@ -814,9 +815,9 @@ const ExpenseGroupHeader = memo(function ExpenseGroupHeader({
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
backgroundColor: theme.tableRowHeaderBackground,
opacity: !!group.hidden ? 0.5 : undefined,
paddingLeft: 0,
...style,
}}
data-testid="category-group-row"
innerRef={listItemRef}
Expand Down Expand Up @@ -995,6 +996,7 @@ const IncomeGroupHeader = memo(function IncomeGroupHeader({
onEdit,
collapsed,
onToggleCollapse,
style,
}) {
const listItemRef = useRef();
const format = useFormat();
Expand All @@ -1007,9 +1009,9 @@ const IncomeGroupHeader = memo(function IncomeGroupHeader({
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
backgroundColor: theme.tableRowHeaderBackground,
opacity: !!group.hidden ? 0.5 : undefined,
paddingLeft: 0,
...style,
}}
innerRef={listItemRef}
data-testid="category-group-row"
Expand Down Expand Up @@ -1354,6 +1356,11 @@ const ExpenseGroup = memo(function ExpenseGroup({
collapsed={collapsed}
onToggleCollapse={onToggleCollapse}
// onReorderCategory={onReorderCategory}
style={{
backgroundColor: monthUtils.isCurrentMonth(month)
? theme.budgetHeaderCurrentMonth
: theme.budgetHeaderOtherMonth,
}}
/>

{group.categories
Expand Down Expand Up @@ -1400,7 +1407,9 @@ const ExpenseGroup = memo(function ExpenseGroup({
: envelopeBudget.catCarryover(category.id)
}
style={{
backgroundColor: theme.tableBackground,
backgroundColor: monthUtils.isCurrentMonth(month)
? theme.budgetCurrentMonth
: theme.budgetOtherMonth,
}}
showBudgetedCol={showBudgetedCol}
editMode={editMode}
Expand Down Expand Up @@ -1465,6 +1474,11 @@ function IncomeGroup({
onEdit={onEditGroup}
collapsed={collapsed}
onToggleCollapse={onToggleCollapse}
style={{
backgroundColor: monthUtils.isCurrentMonth(month)
? theme.budgetHeaderCurrentMonth
: theme.budgetHeaderOtherMonth,
}}
/>

{group.categories
Expand All @@ -1491,7 +1505,9 @@ function IncomeGroup({
: envelopeBudget.catSumAmount(category.id)
}
style={{
backgroundColor: theme.tableBackground,
backgroundColor: monthUtils.isCurrentMonth(month)
? theme.budgetCurrentMonth
: theme.budgetOtherMonth,
}}
editMode={editMode}
onEdit={onEditCategory}
Expand Down Expand Up @@ -1709,7 +1725,9 @@ export function BudgetTable({
aria-label={t('Today')}
style={{ margin: 10 }}
>
<SvgCalendar width={20} height={20} />
{!monthUtils.isCurrentMonth(month) && (
<SvgCalendar width={20} height={20} />
)}
</Button>
}
/>
Expand Down Expand Up @@ -1793,7 +1811,9 @@ function BudgetTableHeader({
flexShrink: 0,
padding: '10px 15px',
paddingLeft: 10,
backgroundColor: theme.tableRowHeaderBackground,
backgroundColor: monthUtils.isCurrentMonth(month)
? theme.budgetHeaderCurrentMonth
: theme.budgetHeaderOtherMonth,
borderBottomWidth: 1,
borderColor: theme.tableBorder,
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { usePayee } from '../../../hooks/usePayee';
import { SvgLeftArrow2, SvgRightArrow2, SvgSplit } from '../../../icons/v0';
import {
SvgArrowsSynchronize,
SvgCalendar,
SvgCalendar3,
SvgCheckCircle1,
SvgLockClosed,
} from '../../../icons/v2';
Expand Down Expand Up @@ -319,7 +319,7 @@ function PayeeIcons({ transaction, transferAccount }: PayeeIconsProps) {
(isScheduleRecurring ? (
<SvgArrowsSynchronize style={getScheduleIconStyle({ isPreview })} />
) : (
<SvgCalendar style={getScheduleIconStyle({ isPreview })} />
<SvgCalendar3 style={getScheduleIconStyle({ isPreview })} />
))}
{transferAccount &&
(transaction.amount > 0 ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { titleFirst } from 'loot-core/shared/util';

import {
SvgAlertTriangle,
SvgCalendar,
SvgCalendar3,
SvgCheckCircle1,
SvgCheckCircleHollow,
SvgEditSkull1,
Expand Down Expand Up @@ -38,7 +38,7 @@ export function getStatusProps(status: StatusTypes) {
return {
color: theme.upcomingText,
backgroundColor: theme.upcomingBackground,
Icon: SvgCalendar,
Icon: SvgCalendar3,
};
case 'paid':
return {
Expand All @@ -56,13 +56,13 @@ export function getStatusProps(status: StatusTypes) {
return {
color: theme.noticeTextLight,
backgroundColor: theme.noticeBackgroundLight,
Icon: SvgCalendar,
Icon: SvgCalendar3,
};
case 'scheduled':
return {
color: theme.tableRowHeaderText,
backgroundColor: theme.tableRowHeaderBackground,
Icon: SvgCalendar,
Icon: SvgCalendar3,
};
case 'cleared':
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
SvgTuning,
SvgWallet,
} from '../../icons/v1';
import { SvgCalendar } from '../../icons/v2';
import { SvgCalendar3 } from '../../icons/v2';

import { Item } from './Item';
import { SecondaryItem } from './SecondaryItem';
Expand Down Expand Up @@ -47,7 +47,7 @@ export function PrimaryButtons() {
<View style={{ flexShrink: 0 }}>
<Item title={t('Budget')} Icon={SvgWallet} to="/budget" />
<Item title={t('Reports')} Icon={SvgReports} to="/reports" />
<Item title={t('Schedules')} Icon={SvgCalendar} to="/schedules" />
<Item title={t('Schedules')} Icon={SvgCalendar3} to="/schedules" />
<Item
title={t('More')}
Icon={isOpen ? SvgCheveronDown : SvgCheveronRight}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import { SvgLeftArrow2, SvgRightArrow2, SvgSplit } from '../../icons/v0';
import { SvgArrowDown, SvgArrowUp, SvgCheveronDown } from '../../icons/v1';
import {
SvgArrowsSynchronize,
SvgCalendar,
SvgCalendar3,
SvgHyperlink2,
} from '../../icons/v2';
import { useDispatch } from '../../redux';
Expand Down Expand Up @@ -742,7 +742,7 @@ function PayeeIcons({
{recurring ? (
<SvgArrowsSynchronize style={scheduleIconStyle} />
) : (
<SvgCalendar style={scheduleIconStyle} />
<SvgCalendar3 style={scheduleIconStyle} />
)}
</Button>
)}
Expand Down
12 changes: 6 additions & 6 deletions packages/desktop-client/src/i18n.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ describe('setI18NextLanguage', () => {
});

test('should fallback to English if the provided language is unavailable', () => {
vi.spyOn(console, 'error');
vi.spyOn(console, 'info');

setI18NextLanguage('unknown');

expect(console.error).toHaveBeenCalledWith(
expect(console.info).toHaveBeenCalledWith(
'Unknown locale unknown, falling back to en',
);
expect(i18n.changeLanguage).toHaveBeenCalledWith('en');
Expand All @@ -58,22 +58,22 @@ describe('setI18NextLanguage', () => {
});

test('should fallback to base language if the provided language has an unknown region code', () => {
vi.spyOn(console, 'error');
vi.spyOn(console, 'info');

setI18NextLanguage('uk-ZZ');

expect(console.error).toHaveBeenCalledWith(
expect(console.info).toHaveBeenCalledWith(
'Unknown locale uk-ZZ, falling back to uk',
);
expect(i18n.changeLanguage).toHaveBeenCalledWith('uk');
});

test('should fallback to lowercase language if the provided language has uppercase letters', () => {
vi.spyOn(console, 'error');
vi.spyOn(console, 'info');

setI18NextLanguage('EN');

expect(console.error).toHaveBeenCalledWith(
expect(console.info).toHaveBeenCalledWith(
'Unknown locale EN, falling back to en',
);
expect(i18n.changeLanguage).toHaveBeenCalledWith('en');
Expand Down
6 changes: 3 additions & 3 deletions packages/desktop-client/src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,22 @@ export const setI18NextLanguage = (language: string) => {

if (language.includes('-')) {
const fallback = language.split('-')[0];
console.error(`Unknown locale ${language}, falling back to ${fallback}`);
console.info(`Unknown locale ${language}, falling back to ${fallback}`);
setI18NextLanguage(fallback);
return;
}

const lowercaseLanguage = language.toLowerCase();
if (lowercaseLanguage !== language) {
console.error(
console.info(
`Unknown locale ${language}, falling back to ${lowercaseLanguage}`,
);
setI18NextLanguage(lowercaseLanguage);
return;
}

// Fall back to English
console.error(`Unknown locale ${language}, falling back to en`);
console.info(`Unknown locale ${language}, falling back to en`);
setI18NextLanguage('en');
return;
}
Expand Down
4 changes: 3 additions & 1 deletion packages/loot-core/src/client/data-hooks/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ export function usePreviewTransactions(): UsePreviewTransactionsResult {
})
.flat()
.sort(
(a, b) => parseDate(b.date).getTime() - parseDate(a.date).getTime(),
(a, b) =>
parseDate(b.date).getTime() - parseDate(a.date).getTime() ||
a.amount - b.amount,
);
}, [isSchedulesLoading, schedules, statuses, upcomingLength]);

Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/4439.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [lelemm]
---

Fix the default language init for electron
6 changes: 6 additions & 0 deletions upcoming-release-notes/4448.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [joel-jeremy]
---

[Mobile] Change budget table colors when on non-current month
6 changes: 6 additions & 0 deletions upcoming-release-notes/4452.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [matt-fidd]
---

Sort upcoming schedules by date then amount so deposits come before payments
6 changes: 6 additions & 0 deletions upcoming-release-notes/4453.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [matt-fidd]
---

Change i18n errors to info

0 comments on commit c9bc598

Please sign in to comment.