Fix broken chips on timelin eActivity on show pages (#9057)
We were using RecordIndexContext in FieldDisplays components which is wrong as the FieldDisplays could be used in locations not providing this context (not being indexes pages). Instead, we are passing it within FieldContext which the context that will always be there for FieldDisplays and we need indexes to fill this FieldContext with their RecordIndexContext value when needed
This commit is contained in:
@ -128,7 +128,6 @@ export const getFieldDecorator =
|
||||
<FieldContext.Provider
|
||||
value={{
|
||||
recordId: record.id,
|
||||
basePathToShowPage: '/object-record/',
|
||||
isLabelIdentifier,
|
||||
fieldDefinition: formatFieldMetadataItemAsColumnDefinition({
|
||||
field: fieldMetadataItem,
|
||||
|
||||
@ -2,7 +2,6 @@ import { ReactNode } from 'react';
|
||||
|
||||
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
|
||||
import { formatFieldMetadataItemAsColumnDefinition } from '@/object-metadata/utils/formatFieldMetadataItemAsColumnDefinition';
|
||||
import { getBasePathToShowPage } from '@/object-metadata/utils/getBasePathToShowPage';
|
||||
import {
|
||||
FieldContext,
|
||||
RecordUpdateHook,
|
||||
@ -30,10 +29,6 @@ export const useMockFieldContext = ({
|
||||
objectNameSingular,
|
||||
});
|
||||
|
||||
const basePathToShowPage = getBasePathToShowPage({
|
||||
objectNameSingular,
|
||||
});
|
||||
|
||||
const fieldMetadataItem = objectMetadataItem?.fields.find(
|
||||
(field) => field.name === fieldMetadataName,
|
||||
);
|
||||
@ -50,9 +45,6 @@ export const useMockFieldContext = ({
|
||||
<FieldContext.Provider
|
||||
key={objectRecordId + fieldMetadataItem.id}
|
||||
value={{
|
||||
basePathToShowPage: isLabelIdentifier
|
||||
? basePathToShowPage
|
||||
: undefined,
|
||||
recordId: objectRecordId,
|
||||
recoilScopeId: objectRecordId + fieldMetadataItem.id,
|
||||
isLabelIdentifier,
|
||||
|
||||
Reference in New Issue
Block a user