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

Merged
merged 11 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
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
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: 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');
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
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.
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
2 changes: 1 addition & 1 deletion packages/desktop-client/e2e/page-models/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class Navigation {
await this.page.getByLabel('Balance:').fill(String(data.balance));

if (data.offBudget) {
await this.page.getByLabel('Off-budget').click();
await this.page.getByLabel('Off budget').click();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Inconsistent terminology found across the codebase

The verification revealed inconsistent usage of "Off budget" terminology:

  • packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.jsx: Uses hyphenated form "off budget"
  • Other files use non-hyphenated form consistently
🔗 Analysis chain

LGTM! Terminology update aligns with PR objectives.

The change from "Off-budget" to "Off budget" is consistent with the standardization effort described in the PR objectives.

Let's verify other occurrences of this terminology in the codebase:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining hyphenated versions of the term
rg -i "off-budget|on-budget" --type ts --type tsx --type js --type jsx

Length of output: 100


Script:

#!/bin/bash
# Search for any remaining hyphenated versions of the term with correct file types
rg -i "off-budget|on-budget" --type js

# Also search for non-hyphenated versions to understand the context
rg -i "off budget|on budget" --type js

Length of output: 1373

}

await this.page
Expand Down
10 changes: 5 additions & 5 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,8 +841,8 @@ 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');
} else if (id === 'uncategorized') {
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,8 +29,8 @@ 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';
case 'uncategorized':
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 @@ -218,7 +222,7 @@ function TransactionListWithPreviews({
readonly account?: AccountEntity;
readonly accountId?:
| AccountEntity['id']
| 'budgeted'
| 'onbudget'
| 'offbudget'
| 'uncategorized';
readonly accountName: AccountEntity['name'] | string;
Expand Down Expand Up @@ -342,13 +346,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
22 changes: 11 additions & 11 deletions packages/desktop-client/src/components/mobile/accounts/Accounts.tsx
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 All @@ -197,8 +197,8 @@ function AccountList({
}: AccountListProps) {
const failedAccounts = useFailedAccounts();
const syncingAccountIds = useSelector(state => state.account.accountsSyncing);
const budgetedAccounts = accounts.filter(account => account.offbudget === 0);
const offbudgetAccounts = accounts.filter(account => account.offbudget === 1);
const onBudgetAccounts = accounts.filter(account => account.offbudget === 0);
const offBudgetAccounts = accounts.filter(account => account.offbudget === 1);

return (
<Page
Expand All @@ -225,10 +225,10 @@ function AccountList({
{accounts.length === 0 && <EmptyMessage />}
<PullToRefresh onRefresh={onSync}>
<View aria-label="Account list" style={{ margin: 10 }}>
{budgetedAccounts.length > 0 && (
<AccountHeader name="For Budget" amount={getOnBudgetBalance()} />
{onBudgetAccounts.length > 0 && (
<AccountHeader name="On budget" amount={getOnBudgetBalance()} />
)}
{budgetedAccounts.map(acct => (
{onBudgetAccounts.map(acct => (
<AccountCard
account={acct}
key={acct.id}
Expand All @@ -241,14 +241,14 @@ function AccountList({
/>
))}

{offbudgetAccounts.length > 0 && (
{offBudgetAccounts.length > 0 && (
<AccountHeader
name="Off Budget"
name="Off budget"
amount={getOffBudgetBalance()}
style={{ marginTop: 30 }}
/>
)}
{offbudgetAccounts.map(acct => (
{offBudgetAccounts.map(acct => (
<AccountCard
account={acct}
key={acct.id}
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 @@ -35,7 +35,7 @@ function needsCategory(
const isOffBudget = acct && acct.offbudget === 1;

// The user must select a category if transferring from a budgeted
// account to an off-budget account
// account to an off budget account
return account.offbudget === 0 && isOffBudget;
}

Expand Down Expand Up @@ -183,8 +183,8 @@ export function CloseAccountModal({
{needsCategory(account, transferAccountId, accounts) && (
<View style={{ marginBottom: 15 }}>
<Paragraph>
Since you are transferring the balance from a budgeted
account to an off-budget account, this transaction must
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 @@ -127,7 +127,7 @@ export function CreateLocalAccountModal() {
verticalAlign: 'center',
}}
>
{t('Off-budget')}
{t('Off budget')}
</label>
</View>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { TableHeader, Table, Row, Field } from '../table';
const addOnBudgetAccountOption = { id: 'new-on', name: 'Create new account' };
const addOffBudgetAccountOption = {
id: 'new-off',
name: 'Create new account (off-budget)',
name: 'Create new account (off budget)',
};

export function SelectLinkedAccountsModal({
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
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
Loading
Loading