Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent accounts terminology (For budget / Budgeted --> On-budget) #3903

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/desktop-client/e2e/accounts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ test.describe('Accounts', () => {
await expect(page).toMatchThemeScreenshots();
});

test.describe('Budgeted Accounts', () => {
test.describe('On-Budget Accounts', () => {
// Reset filters
test.afterEach(async () => {
await accountPage.removeFilter(0);
});

test('creates a transfer from two existing transactions', async () => {
accountPage = await navigation.goToAccountPage('For budget');
accountPage = await navigation.goToAccountPage('On-budget');
joel-jeremy marked this conversation as resolved.
Show resolved Hide resolved
await accountPage.waitFor();

await expect(accountPage.accountName).toHaveText('Budgeted Accounts');
await expect(accountPage.accountName).toHaveText('On-Budget Accounts');

await accountPage.filterByNote('Test Acc Transfer');

Expand Down
4 changes: 2 additions & 2 deletions packages/desktop-client/e2e/budget.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ test.describe('Budget', () => {
test('renders the summary information: available funds, overspent, budgeted and for next month', async () => {
const summary = budgetPage.budgetSummary.first();

await expect(summary.getByText('Available Funds')).toBeVisible({
await expect(summary.getByText('Available funds')).toBeVisible({
timeout: 10000,
});
await expect(summary.getByText(/^Overspent in /)).toBeVisible();
await expect(summary.getByText('Budgeted')).toBeVisible();
await expect(summary.getByText('For Next Month')).toBeVisible();
await expect(summary.getByText('For next month')).toBeVisible();
joel-jeremy marked this conversation as resolved.
Show resolved Hide resolved
await expect(page).toMatchThemeScreenshots();
});

Expand Down
4 changes: 2 additions & 2 deletions packages/desktop-client/e2e/page-models/mobile-budget-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class MobileBudgetPage {
name: 'Saved',
});
this.projectedSavingsButton = this.budgetTableHeader.getByRole('button', {
name: 'Projected Savings',
name: 'Projected savings',
});
this.overspentButton = this.budgetTableHeader.getByRole('button', {
name: 'Overspent',
Expand Down Expand Up @@ -294,7 +294,7 @@ export class MobileBudgetPage {
}

throw new Error(
'None of “Saved”, “Projected Savings”, or “Overspent” buttons could be located on the page',
'None of “Saved”, “Projected savings”, or “Overspent” buttons could be located on the page',
);
}

Expand Down
12 changes: 6 additions & 6 deletions packages/desktop-client/src/components/accounts/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function getField(field?: string) {
}

type AccountInternalProps = {
accountId?: AccountEntity['id'] | 'budgeted' | 'offbudget' | 'uncategorized';
accountId?: AccountEntity['id'] | 'onbudget' | 'offbudget' | 'uncategorized';
filterConditions: RuleConditionEntity[];
showBalances?: boolean;
setShowBalances: (newValue: boolean) => void;
Expand Down Expand Up @@ -841,10 +841,10 @@ class AccountInternal extends PureComponent<
}

if (!account) {
if (id === 'budgeted') {
return t('Budgeted Accounts');
if (id === 'onbudget') {
return t('On-Budget Accounts');
} else if (id === 'offbudget') {
return t('Off Budget Accounts');
return t('Off-Budget Accounts');
} else if (id === 'uncategorized') {
return t('Uncategorized');
} else if (!id) {
Expand Down Expand Up @@ -1662,7 +1662,7 @@ class AccountInternal extends PureComponent<

const isNameEditable =
accountId &&
accountId !== 'budgeted' &&
accountId !== 'onbudget' &&
accountId !== 'offbudget' &&
accountId !== 'uncategorized';

Expand Down Expand Up @@ -1767,7 +1767,7 @@ class AccountInternal extends PureComponent<
showAccount={
!accountId ||
accountId === 'offbudget' ||
accountId === 'budgeted' ||
accountId === 'onbudget' ||
accountId === 'uncategorized'
}
isAdding={this.state.isAdding}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ function AccountList({
item.closed
? t('Closed Accounts')
: item.offbudget
? t('Off Budget')
: t('For Budget')
? t('Off-budget')
: t('On-budget')
}`;

lastItem = item;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ export function TotalsList({ prevMonthName, style }: TotalsListProps) {
</View>

<View>
<Block>Available Funds</Block>
<Block>Available funds</Block>
<Block>Overspent in {prevMonthName}</Block>
<Block>Budgeted</Block>
<Block>For Next Month</Block>
<Block>For next month</Block>
</View>
</View>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function Saved({ projected, style }: SavedProps) {
<View style={{ alignItems: 'center', fontSize: 14, ...style }}>
{projected ? (
<Text style={{ color: theme.pageTextLight }}>
<Trans>Projected Savings:</Trans>
<Trans>Projected savings:</Trans>
</Text>
) : (
<View style={{ color: theme.pageTextLight }}>
Expand All @@ -46,7 +46,7 @@ export function Saved({ projected, style }: SavedProps) {
content={
<>
<AlignedText
left={t('Projected Savings:')}
left={t('Projected savings:')}
right={
<Text
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export function Account() {

function accountNameFromId(id: string | undefined) {
switch (id) {
case 'budgeted':
return 'Budgeted Accounts';
case 'onbudget':
return 'On-Budget Accounts';
case 'offbudget':
return 'Off Budget Accounts';
return 'Off-Budget Accounts';
case 'uncategorized':
return 'Uncategorized';
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ export function AccountTransactions({
accountName,
}: {
readonly account?: AccountEntity;
readonly accountId?: string;
readonly accountId?:
| AccountEntity['id']
| 'onbudget'
| 'offbudget'
| 'uncategorized';
readonly accountName: string;
}) {
const schedulesQuery = useMemo(
Expand Down Expand Up @@ -216,7 +220,7 @@ function TransactionListWithPreviews({
readonly account?: AccountEntity;
readonly accountId?:
| AccountEntity['id']
| 'budgeted'
| 'onbudget'
| 'offbudget'
| 'uncategorized';
readonly accountName: AccountEntity['name'] | string;
Expand Down Expand Up @@ -338,13 +342,13 @@ function queriesFromAccountId(
entity: AccountEntity | undefined,
) {
switch (id) {
case 'budgeted':
case 'onbudget':
return {
balance: queries.budgetedAccountBalance(),
balance: queries.onBudgetAccountBalance(),
};
case 'offbudget':
return {
balance: queries.offbudgetAccountBalance(),
balance: queries.offBudgetAccountBalance(),
};
case 'uncategorized':
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ type AccountListProps = {
accounts: AccountEntity[];
updatedAccounts: Array<AccountEntity['id']>;
getBalanceQuery: (account: AccountEntity) => Binding<'account', 'balance'>;
getOnBudgetBalance: () => Binding<'account', 'budgeted-accounts-balance'>;
getOnBudgetBalance: () => Binding<'account', 'onbudget-accounts-balance'>;
getOffBudgetBalance: () => Binding<'account', 'offbudget-accounts-balance'>;
joel-jeremy marked this conversation as resolved.
Show resolved Hide resolved
onAddAccount: () => void;
onSelectAccount: (id: string) => void;
Expand Down Expand Up @@ -226,7 +226,7 @@ function AccountList({
<PullToRefresh onRefresh={onSync}>
<View aria-label="Account list" style={{ margin: 10 }}>
{budgetedAccounts.length > 0 && (
<AccountHeader name="For Budget" amount={getOnBudgetBalance()} />
<AccountHeader name="On Budget" amount={getOnBudgetBalance()} />
joel-jeremy marked this conversation as resolved.
Show resolved Hide resolved
)}
{budgetedAccounts.map(acct => (
<AccountCard
Expand All @@ -243,7 +243,7 @@ function AccountList({

{offbudgetAccounts.length > 0 && (
<AccountHeader
name="Off Budget"
name="Off-budget"
amount={getOffBudgetBalance()}
style={{ marginTop: 30 }}
/>
Expand Down Expand Up @@ -300,8 +300,8 @@ export function Accounts() {
accounts={accounts.filter(account => !account.closed)}
updatedAccounts={updatedAccounts}
getBalanceQuery={queries.accountBalance}
getOnBudgetBalance={queries.budgetedAccountBalance}
getOffBudgetBalance={queries.offbudgetAccountBalance}
getOnBudgetBalance={queries.onBudgetAccountBalance}
getOffBudgetBalance={queries.offBudgetAccountBalance}
onAddAccount={onAddAccount}
onSelectAccount={onSelectAccount}
onSync={onSync}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function Saved({ projected, onPress, show3Cols }) {
minFontSizePx={6}
maxFontSizePx={12}
mode="oneline"
title="Projected Savings"
title="Projected savings"
style={{
color: theme.formInputText,
textAlign: 'left',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ const TransactionEditInner = memo(function TransactionEditInner({
const getCategory = useCallback(
(trans, isOffBudget) => {
if (isOffBudget) {
return 'Off Budget';
return 'Off-budget';
} else if (isBudgetTransfer(trans)) {
return 'Transfer';
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function TransactionListItem({
transferAccount,
});
const specialCategory = account?.offbudget
? 'Off Budget'
? 'Off-budget'
: transferAccount && !transferAccount.offbudget
? 'Transfer'
: isParent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export function CloseAccountModal({
{needsCategory(account, transferAccountId, accounts) && (
<View style={{ marginBottom: 15 }}>
<Paragraph>
Since you are transferring the balance from a budgeted
Since you are transferring the balance from an on-budget
account to an off-budget account, this transaction must
be categorized. Select a category:
</Paragraph>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ const transferCategory: UncategorizedEntity = {
};
const offBudgetCategory: UncategorizedEntity = {
id: '',
name: t('Off Budget'),
name: t('Off-budget'),
uncategorized_id: 'off_budget',
hidden: false,
};
Expand All @@ -271,7 +271,7 @@ type UncategorizedGroupEntity = Pick<
};

const uncategorizedGroup: UncategorizedGroupEntity = {
name: t('Uncategorized & Off Budget'),
name: t('Uncategorized & Off-budget'),
id: 'uncategorized',
hidden: false,
uncategorized_id: 'all',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,8 @@ export function ReportSidebar({
},
{
name: 'show-off-budget',
text: 'Show off budget',
tooltip: 'Show off budget accounts',
text: 'Show off-budget',
tooltip: 'Show off-budget accounts',
toggle: customReportItems.showOffBudget,
},
{
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/sidebar/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export function Account<FieldName extends SheetFields<'account'>>({

<AlignedText
style={
(name === 'Off budget' || name === 'For budget') && {
(name === 'Off-budget' || name === 'On-budget') && {
borderBottom: `1.5px solid rgba(255,255,255,0.4)`,
paddingBottom: '3px',
}
Expand Down
18 changes: 9 additions & 9 deletions packages/desktop-client/src/components/sidebar/Accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { type State } from 'loot-core/src/client/state-types';
import { type AccountEntity } from 'loot-core/types/models';

import { useAccounts } from '../../hooks/useAccounts';
import { useBudgetedAccounts } from '../../hooks/useBudgetedAccounts';
import { useClosedAccounts } from '../../hooks/useClosedAccounts';
import { useFailedAccounts } from '../../hooks/useFailedAccounts';
import { useLocalPref } from '../../hooks/useLocalPref';
import { useOffBudgetAccounts } from '../../hooks/useOffBudgetAccounts';
import { useOnBudgetAccounts } from '../../hooks/useOnBudgetAccounts';
import { useUpdatedAccounts } from '../../hooks/useUpdatedAccounts';
import { theme } from '../../style';
import { View } from '../common/View';
Expand All @@ -30,7 +30,7 @@ export function Accounts() {
const failedAccounts = useFailedAccounts();
const updatedAccounts = useUpdatedAccounts();
const offbudgetAccounts = useOffBudgetAccounts();
const budgetedAccounts = useBudgetedAccounts();
const onBudgetAccounts = useOnBudgetAccounts();
const closedAccounts = useClosedAccounts();
const syncingAccountIds = useSelector(
(state: State) => state.account.accountsSyncing,
Expand Down Expand Up @@ -100,11 +100,11 @@ export function Accounts() {
style={{ fontWeight, marginTop: 15 }}
/>

{budgetedAccounts.length > 0 && (
{onBudgetAccounts.length > 0 && (
<Account
name={t('For budget')}
to="/accounts/budgeted"
query={queries.budgetedAccountBalance()}
name={t('On-budget')}
to="/accounts/onbudget"
query={queries.onBudgetAccountBalance()}
style={{
fontWeight,
marginTop: 13,
Expand All @@ -113,7 +113,7 @@ export function Accounts() {
/>
)}

{budgetedAccounts.map((account, i) => (
{onBudgetAccounts.map((account, i) => (
<Account
key={account.id}
name={account.name}
Expand All @@ -132,9 +132,9 @@ export function Accounts() {

{offbudgetAccounts.length > 0 && (
<Account
name={t('Off budget')}
name={t('Off-budget')}
to="/accounts/offbudget"
query={queries.offbudgetAccountBalance()}
query={queries.offBudgetAccountBalance()}
style={{
fontWeight,
marginTop: 13,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type Spreadsheets = {
balance: number;
[key: `balance-${string}-cleared`]: number | null;
'accounts-balance': number;
'budgeted-accounts-balance': number;
'onbudget-accounts-balance': number;
'offbudget-accounts-balance': number;
balanceCleared: number;
balanceUncleared: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@ const Transaction = memo(function Transaction({
isParent
? 'Split'
: isOffBudget
? 'Off Budget'
? 'Off-budget'
: isBudgetTransfer
? 'Transfer'
: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMemo } from 'react';

import { useAccounts } from './useAccounts';

export function useBudgetedAccounts() {
export function useOnBudgetAccounts() {
const accounts = useAccounts();
return useMemo(
() =>
Expand Down
2 changes: 1 addition & 1 deletion packages/loot-core/src/client/data-hooks/schedules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export function useCachedSchedules() {
}

export function accountSchedulesQuery(
accountId?: AccountEntity['id'] | 'budgeted' | 'offbudget' | 'uncategorized',
accountId?: AccountEntity['id'] | 'onbudget' | 'offbudget' | 'uncategorized',
) {
const filterByAccount = accountFilter(accountId, '_account');
const filterByPayee = accountFilter(accountId, '_payee.transfer_acct');
Expand Down
Loading
Loading