Skip to content
Snippets Groups Projects
Unverified Commit d1ecb3db authored by Joel Jeremy Marquez's avatar Joel Jeremy Marquez Committed by GitHub
Browse files

Fix privacy filter (#3472)

* Fix privacy filter

* Release notes

* Coderabbit suggestion

* VRT

* VRT

* Revert VRT

* VRT

* VRT

* VRT

* VRT

* Delete VRT

* VRT

* Revert VRT
parent 90e2fe60
No related branches found
No related tags found
No related merge requests found
...@@ -174,21 +174,19 @@ export function Balances({ ...@@ -174,21 +174,19 @@ export function Balances({
> >
<CellValue binding={{ ...balanceQuery, value: 0 }} type="financial"> <CellValue binding={{ ...balanceQuery, value: 0 }} type="financial">
{props => ( {props => (
<PrivacyFilter blurIntensity={5}> <CellValueText
<CellValueText {...props}
{...props} style={{
style={{ fontSize: 22,
fontSize: 22, fontWeight: 400,
fontWeight: 400, color:
color: props.value < 0
props.value < 0 ? theme.errorText
? theme.errorText : props.value > 0
: props.value > 0 ? theme.noticeTextLight
? theme.noticeTextLight : theme.pageTextSubdued,
: theme.pageTextSubdued, }}
}} />
/>
</PrivacyFilter>
)} )}
</CellValue> </CellValue>
......
...@@ -6,6 +6,8 @@ import React, { ...@@ -6,6 +6,8 @@ import React, {
} from 'react'; } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { css } from 'glamor';
import { useFeatureFlag } from '../../hooks/useFeatureFlag'; import { useFeatureFlag } from '../../hooks/useFeatureFlag';
import { SvgArrowThinRight } from '../../icons/v1'; import { SvgArrowThinRight } from '../../icons/v1';
import { type CSSProperties, theme, styles } from '../../style'; import { type CSSProperties, theme, styles } from '../../style';
...@@ -177,16 +179,18 @@ export function BalanceWithCarryover({ ...@@ -177,16 +179,18 @@ export function BalanceWithCarryover({
type={type} type={type}
name={name} name={name}
value={balanceValue} value={balanceValue}
style={{ className={String(
...getBalanceStyle(balanceValue), css({
overflow: 'hidden', ...getBalanceStyle(balanceValue),
textOverflow: 'ellipsis', overflow: 'hidden',
textAlign: 'right', textOverflow: 'ellipsis',
...(!disabled && { textAlign: 'right',
cursor: 'pointer', ...(!disabled && {
cursor: 'pointer',
}),
':hover': { textDecoration: 'underline' },
}), }),
':hover': { textDecoration: 'underline' }, )}
}}
/> />
</Tooltip> </Tooltip>
)} )}
......
import React, { type ComponentProps, memo, useRef, useState } from 'react'; import React, { type ComponentProps, memo, useRef, useState } from 'react';
import { css } from 'glamor';
import { envelopeBudget } from 'loot-core/src/client/queries'; import { envelopeBudget } from 'loot-core/src/client/queries';
import { evalArithmetic } from 'loot-core/src/shared/arithmetic'; import { evalArithmetic } from 'loot-core/src/shared/arithmetic';
import * as monthUtils from 'loot-core/src/shared/months'; import * as monthUtils from 'loot-core/src/shared/months';
...@@ -359,11 +361,13 @@ export const ExpenseCategoryMonth = memo(function ExpenseCategoryMonth({ ...@@ -359,11 +361,13 @@ export const ExpenseCategoryMonth = memo(function ExpenseCategoryMonth({
{props => ( {props => (
<CellValueText <CellValueText
{...props} {...props}
style={{ className={String(
cursor: 'pointer', css({
':hover': { textDecoration: 'underline' }, cursor: 'pointer',
...makeAmountGrey(props.value), ':hover': { textDecoration: 'underline' },
}} ...makeAmountGrey(props.value),
}),
)}
/> />
)} )}
</EnvelopeCellValue> </EnvelopeCellValue>
...@@ -472,10 +476,12 @@ export function IncomeCategoryMonth({ ...@@ -472,10 +476,12 @@ export function IncomeCategoryMonth({
{props => ( {props => (
<CellValueText <CellValueText
{...props} {...props}
style={{ className={String(
cursor: 'pointer', css({
':hover': { textDecoration: 'underline' }, cursor: 'pointer',
}} ':hover': { textDecoration: 'underline' },
}),
)}
/> />
)} )}
</EnvelopeCellValue> </EnvelopeCellValue>
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
import React, { type ComponentProps, memo, useRef, useState } from 'react'; import React, { type ComponentProps, memo, useRef, useState } from 'react';
import { Trans } from 'react-i18next'; import { Trans } from 'react-i18next';
import { css } from 'glamor';
import { trackingBudget } from 'loot-core/src/client/queries'; import { trackingBudget } from 'loot-core/src/client/queries';
import { evalArithmetic } from 'loot-core/src/shared/arithmetic'; import { evalArithmetic } from 'loot-core/src/shared/arithmetic';
import * as monthUtils from 'loot-core/src/shared/months'; import * as monthUtils from 'loot-core/src/shared/months';
...@@ -370,13 +372,15 @@ export const CategoryMonth = memo(function CategoryMonth({ ...@@ -370,13 +372,15 @@ export const CategoryMonth = memo(function CategoryMonth({
{props => ( {props => (
<CellValueText <CellValueText
{...props} {...props}
style={{ className={String(
cursor: 'pointer', css({
':hover': { cursor: 'pointer',
textDecoration: 'underline', ':hover': {
}, textDecoration: 'underline',
...makeAmountGrey(props.value), },
}} ...makeAmountGrey(props.value),
}),
)}
/> />
)} )}
</TrackingCellValue> </TrackingCellValue>
......
...@@ -3,6 +3,7 @@ import React, { type ComponentPropsWithoutRef, type ReactNode } from 'react'; ...@@ -3,6 +3,7 @@ import React, { type ComponentPropsWithoutRef, type ReactNode } from 'react';
import { type CSSProperties, styles } from '../../style'; import { type CSSProperties, styles } from '../../style';
import { Text } from '../common/Text'; import { Text } from '../common/Text';
import { PrivacyFilter } from '../PrivacyFilter';
import { type FormatType, useFormat } from './useFormat'; import { type FormatType, useFormat } from './useFormat';
import { useSheetName } from './useSheetName'; import { useSheetName } from './useSheetName';
...@@ -51,6 +52,8 @@ export function CellValue< ...@@ -51,6 +52,8 @@ export function CellValue<
); );
} }
const PRIVACY_FILTER_TYPES = ['financial', 'financial-with-sign'];
type CellValueTextProps< type CellValueTextProps<
SheetName extends SheetNames, SheetName extends SheetNames,
FieldName extends SheetFields<SheetName>, FieldName extends SheetFields<SheetName>,
...@@ -87,7 +90,9 @@ export function CellValueText< ...@@ -87,7 +90,9 @@ export function CellValueText<
data-cellname={name} data-cellname={name}
{...props} {...props}
> >
{formatter ? formatter(value, type) : format(value, type)} <PrivacyFilter activationFilters={[PRIVACY_FILTER_TYPES.includes(type)]}>
{formatter ? formatter(value, type) : format(value, type)}
</PrivacyFilter>
</Text> </Text>
); );
} }
---
category: Bugfix
authors: [joel-jeremy]
---
Fix privacy filters not activating
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment