diff --git a/packages/twenty-front/src/modules/ui/field/display/components/CurrencyDisplay.tsx b/packages/twenty-front/src/modules/ui/field/display/components/CurrencyDisplay.tsx
index 25c5a27cf7..9c554fdfc1 100644
--- a/packages/twenty-front/src/modules/ui/field/display/components/CurrencyDisplay.tsx
+++ b/packages/twenty-front/src/modules/ui/field/display/components/CurrencyDisplay.tsx
@@ -23,8 +23,6 @@ export const CurrencyDisplay = ({
}: CurrencyDisplayProps) => {
const theme = useTheme();
- const shouldDisplayCurrency = isDefined(currencyValue?.currencyCode);
-
const CurrencyIcon = isDefined(currencyValue?.currencyCode)
? SETTINGS_FIELD_CURRENCY_CODES[currencyValue?.currencyCode]?.Icon
: null;
@@ -36,10 +34,6 @@ export const CurrencyDisplay = ({
const format = fieldDefinition.metadata.settings?.format;
const { formatNumber } = useNumberFormat();
- if (!shouldDisplayCurrency) {
- return {0};
- }
-
return (
{isDefined(CurrencyIcon) && amountToDisplay !== null && (
diff --git a/packages/twenty-shared/src/utils/variable-resolver.test.ts b/packages/twenty-shared/src/utils/variable-resolver.test.ts
index d629cca6fe..377f1d1f72 100644
--- a/packages/twenty-shared/src/utils/variable-resolver.test.ts
+++ b/packages/twenty-shared/src/utils/variable-resolver.test.ts
@@ -10,12 +10,31 @@ describe('resolveInput', () => {
theme: 'dark',
notifications: true,
},
+ specialValues: {
+ nullValue: null,
+ undefinedValue: undefined,
+ emptyString: '',
+ zero: 0,
+ booleanFalse: false,
+ booleanTrue: true,
+ },
};
it('should return null for null input', () => {
expect(resolveInput(null, context)).toBeNull();
});
+ it('should support special values', () => {
+ expect(resolveInput('{{specialValues.nullValue}}', context)).toBeNull();
+ expect(
+ resolveInput('{{specialValues.undefinedValue}}', context),
+ ).toBeUndefined();
+ expect(resolveInput('{{specialValues.emptyString}}', context)).toBe('');
+ expect(resolveInput('{{specialValues.zero}}', context)).toBe(0);
+ expect(resolveInput('{{specialValues.booleanFalse}}', context)).toBe(false);
+ expect(resolveInput('{{specialValues.booleanTrue}}', context)).toBe(true);
+ });
+
it('should return undefined for undefined input', () => {
expect(resolveInput(undefined, context)).toBeUndefined();
});
diff --git a/packages/twenty-shared/src/utils/variable-resolver.ts b/packages/twenty-shared/src/utils/variable-resolver.ts
index 6116da9635..92e5bcb208 100644
--- a/packages/twenty-shared/src/utils/variable-resolver.ts
+++ b/packages/twenty-shared/src/utils/variable-resolver.ts
@@ -99,7 +99,7 @@ const evalFromContext = (input: string, context: Record) => {
},
});
- return JSON.parse(inferredInput) ?? '';
+ return JSON.parse(inferredInput);
} catch {
return undefined;
}