diff --git a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellDisplayMode.tsx b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellDisplayMode.tsx index af331be2b0..9b8833db15 100644 --- a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellDisplayMode.tsx +++ b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellDisplayMode.tsx @@ -1,5 +1,6 @@ import styled from '@emotion/styled'; +import { FieldContext } from '@/object-record/record-field/ui/contexts/FieldContext'; import { useIsFieldEmpty } from '@/object-record/record-field/ui/hooks/useIsFieldEmpty'; import { useIsFieldInputOnly } from '@/object-record/record-field/ui/hooks/useIsFieldInputOnly'; import { @@ -9,6 +10,7 @@ import { import { RecordInlineCellButton } from '@/object-record/record-inline-cell/components/RecordInlineCellEditButton'; import { css } from '@emotion/react'; import { useLingui } from '@lingui/react/macro'; +import { useContext } from 'react'; const StyledRecordInlineCellNormalModeOuterContainer = styled.div< Pick< @@ -75,6 +77,8 @@ export const RecordInlineCellDisplayMode = ({ const { editModeContentOnly, label, buttonIcon, readonly } = useRecordInlineCellContext(); + const { isForbidden } = useContext(FieldContext); + const isFieldEmpty = useIsFieldEmpty(); const showEditButton = buttonIcon && @@ -87,9 +91,9 @@ export const RecordInlineCellDisplayMode = ({ const emptyPlaceHolder = label ?? t`Empty`; - const shouldShowValue = !isFieldEmpty || isFieldInputOnly; + const shouldShowValue = !isFieldEmpty || isFieldInputOnly || isForbidden; - const shouldShowEmptyPlaceholder = isFieldEmpty; + const shouldShowEmptyPlaceholder = isFieldEmpty && !isForbidden; return ( <> diff --git a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellValue.tsx b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellValue.tsx index ba5dfc37a5..bb84725723 100644 --- a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellValue.tsx +++ b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellValue.tsx @@ -1,11 +1,8 @@ import { css } from '@emotion/react'; import styled from '@emotion/styled'; -import { useContext } from 'react'; import { FieldDisplay } from '@/object-record/record-field/ui/components/FieldDisplay'; -import { FieldContext } from '@/object-record/record-field/ui/contexts/FieldContext'; import { useFieldFocus } from '@/object-record/record-field/ui/hooks/useFieldFocus'; -import { ForbiddenFieldDisplay } from '@/object-record/record-field/ui/meta-types/display/components/ForbiddenFieldDisplay'; import { useRecordInlineCellContext } from '@/object-record/record-inline-cell/components/RecordInlineCellContext'; import { RecordInlineCellDisplayMode } from '@/object-record/record-inline-cell/components/RecordInlineCellDisplayMode'; import { RecordInlineCellSkeletonLoader } from '@/object-record/record-inline-cell/components/RecordInlineCellSkeletonLoader'; @@ -36,16 +33,11 @@ export const RecordInlineCellValue = () => { const { readonly, loading, isCentered, onOpenEditMode } = useRecordInlineCellContext(); const { isFocused } = useFieldFocus(); - const { isForbidden } = useContext(FieldContext); if (loading === true) { return ; } - if (isForbidden === true) { - return ; - } - return (