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

Fix privacy filter #3472

Merged
merged 13 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
28 changes: 13 additions & 15 deletions packages/desktop-client/src/components/accounts/Balance.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,19 @@ export function Balances({
>
<CellValue binding={{ ...balanceQuery, value: 0 }} type="financial">
{props => (
<PrivacyFilter blurIntensity={5}>
<CellValueText
{...props}
style={{
fontSize: 22,
fontWeight: 400,
color:
props.value < 0
? theme.errorText
: props.value > 0
? theme.noticeTextLight
: theme.pageTextSubdued,
}}
/>
</PrivacyFilter>
<CellValueText
{...props}
style={{
fontSize: 22,
fontWeight: 400,
color:
props.value < 0
? theme.errorText
: props.value > 0
? theme.noticeTextLight
: theme.pageTextSubdued,
}}
/>
)}
</CellValue>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import React, {
} from 'react';
import { useTranslation } from 'react-i18next';

import { css } from 'glamor';

import { useFeatureFlag } from '../../hooks/useFeatureFlag';
import { SvgArrowThinRight } from '../../icons/v1';
import { type CSSProperties, theme, styles } from '../../style';
Expand Down Expand Up @@ -177,16 +179,18 @@ export function BalanceWithCarryover({
type={type}
name={name}
value={balanceValue}
style={{
...getBalanceStyle(balanceValue),
overflow: 'hidden',
textOverflow: 'ellipsis',
textAlign: 'right',
...(!disabled && {
cursor: 'pointer',
className={String(
css({
...getBalanceStyle(balanceValue),
overflow: 'hidden',
textOverflow: 'ellipsis',
textAlign: 'right',
...(!disabled && {
cursor: 'pointer',
}),
':hover': { textDecoration: 'underline' },
}),
':hover': { textDecoration: 'underline' },
}}
)}
/>
</Tooltip>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { type ComponentProps, memo, useRef, useState } from 'react';

import { css } from 'glamor';

import { envelopeBudget } from 'loot-core/src/client/queries';
import { evalArithmetic } from 'loot-core/src/shared/arithmetic';
import * as monthUtils from 'loot-core/src/shared/months';
Expand Down Expand Up @@ -359,11 +361,13 @@ export const ExpenseCategoryMonth = memo(function ExpenseCategoryMonth({
{props => (
<CellValueText
{...props}
style={{
cursor: 'pointer',
':hover': { textDecoration: 'underline' },
...makeAmountGrey(props.value),
}}
className={String(
css({
cursor: 'pointer',
':hover': { textDecoration: 'underline' },
...makeAmountGrey(props.value),
}),
)}
/>
)}
</EnvelopeCellValue>
Expand Down Expand Up @@ -472,10 +476,12 @@ export function IncomeCategoryMonth({
{props => (
<CellValueText
{...props}
style={{
cursor: 'pointer',
':hover': { textDecoration: 'underline' },
}}
className={String(
css({
cursor: 'pointer',
':hover': { textDecoration: 'underline' },
}),
)}
/>
)}
</EnvelopeCellValue>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import React, { type ComponentProps, memo, useRef, useState } from 'react';
import { Trans } from 'react-i18next';

import { css } from 'glamor';

import { trackingBudget } from 'loot-core/src/client/queries';
import { evalArithmetic } from 'loot-core/src/shared/arithmetic';
import * as monthUtils from 'loot-core/src/shared/months';
Expand Down Expand Up @@ -370,13 +372,15 @@ export const CategoryMonth = memo(function CategoryMonth({
{props => (
<CellValueText
{...props}
style={{
cursor: 'pointer',
':hover': {
textDecoration: 'underline',
},
...makeAmountGrey(props.value),
}}
className={String(
css({
cursor: 'pointer',
':hover': {
textDecoration: 'underline',
},
...makeAmountGrey(props.value),
}),
)}
matt-fidd marked this conversation as resolved.
Show resolved Hide resolved
/>
)}
</TrackingCellValue>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { type ComponentPropsWithoutRef, type ReactNode } from 'react';

import { type CSSProperties, styles } from '../../style';
import { Text } from '../common/Text';
import { PrivacyFilter } from '../PrivacyFilter';

import { type FormatType, useFormat } from './useFormat';
import { useSheetName } from './useSheetName';
Expand Down Expand Up @@ -51,6 +52,8 @@ export function CellValue<
);
}

const PRIVACY_FILTER_TYPES = ['financial', 'financial-with-sign'];

type CellValueTextProps<
SheetName extends SheetNames,
FieldName extends SheetFields<SheetName>,
Expand Down Expand Up @@ -87,7 +90,9 @@ export function CellValueText<
data-cellname={name}
{...props}
>
{formatter ? formatter(value, type) : format(value, type)}
<PrivacyFilter activationFilters={[PRIVACY_FILTER_TYPES.includes(type)]}>
{formatter ? formatter(value, type) : format(value, type)}
</PrivacyFilter>
</Text>
);
}
6 changes: 6 additions & 0 deletions upcoming-release-notes/3472.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [joel-jeremy]
---

Fix privacy filters not activating
Loading