mirror of
https://github.com/lingble/twenty.git
synced 2025-10-30 12:22:29 +00:00
Fix currency input (#7469)
Fix https://github.com/twentyhq/twenty/issues/7458
This commit is contained in:
@@ -5,6 +5,7 @@ import { FieldCurrencyValue } from '@/object-record/record-field/types/FieldMeta
|
|||||||
import { SETTINGS_FIELD_CURRENCY_CODES } from '@/settings/data-model/constants/SettingsFieldCurrencyCodes';
|
import { SETTINGS_FIELD_CURRENCY_CODES } from '@/settings/data-model/constants/SettingsFieldCurrencyCodes';
|
||||||
import { formatAmount } from '~/utils/format/formatAmount';
|
import { formatAmount } from '~/utils/format/formatAmount';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from '~/utils/isDefined';
|
||||||
|
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||||
|
|
||||||
type CurrencyDisplayProps = {
|
type CurrencyDisplayProps = {
|
||||||
currencyValue: FieldCurrencyValue | null | undefined;
|
currencyValue: FieldCurrencyValue | null | undefined;
|
||||||
@@ -29,10 +30,9 @@ export const CurrencyDisplay = ({ currencyValue }: CurrencyDisplayProps) => {
|
|||||||
? SETTINGS_FIELD_CURRENCY_CODES[currencyValue?.currencyCode]?.Icon
|
? SETTINGS_FIELD_CURRENCY_CODES[currencyValue?.currencyCode]?.Icon
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
const amountToDisplay =
|
const amountToDisplay = isUndefinedOrNull(currencyValue?.amountMicros)
|
||||||
currencyValue?.amountMicros != null
|
? null
|
||||||
? currencyValue?.amountMicros / 1000000
|
: currencyValue?.amountMicros / 1000000;
|
||||||
: null;
|
|
||||||
|
|
||||||
if (!shouldDisplayCurrency) {
|
if (!shouldDisplayCurrency) {
|
||||||
return <StyledEllipsisDisplay>{0}</StyledEllipsisDisplay>;
|
return <StyledEllipsisDisplay>{0}</StyledEllipsisDisplay>;
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ export const CurrencyInput = ({
|
|||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
autoFocus={autoFocus}
|
autoFocus={autoFocus}
|
||||||
value={value}
|
value={value}
|
||||||
|
unmask
|
||||||
/>
|
/>
|
||||||
</StyledContainer>
|
</StyledContainer>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ export const shouldSeedWorkspaceFavorite = (
|
|||||||
objectMetadataMap,
|
objectMetadataMap,
|
||||||
): boolean =>
|
): boolean =>
|
||||||
objectMetadataId !==
|
objectMetadataId !==
|
||||||
objectMetadataMap[STANDARD_OBJECT_IDS.workflowVersion].id &&
|
objectMetadataMap[STANDARD_OBJECT_IDS.workflowVersion]?.id &&
|
||||||
objectMetadataId !== objectMetadataMap[STANDARD_OBJECT_IDS.workflowRun].id;
|
objectMetadataId !== objectMetadataMap[STANDARD_OBJECT_IDS.workflowRun]?.id;
|
||||||
|
|||||||
Reference in New Issue
Block a user