Remove postition from Timeline Activities + fix workflow title placeholder (#18777)
- Position were not properly displayed because we never implemented a display for this - Untitled placeholder was not displayed anymore <img width="359" height="117" alt="Capture d’écran 2026-03-19 à 17 11 25" src="https://github.com/user-attachments/assets/64c90d81-8262-4176-ae25-804748e36b1e" />
This commit is contained in:
+3
-2
@@ -7,6 +7,7 @@ import { getRecordFieldInputInstanceId } from '@/object-record/utils/getRecordFi
|
||||
import { styled } from '@linaria/react';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { useContext } from 'react';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { OverflowingTextWithTooltip } from 'twenty-ui/display';
|
||||
import { themeCssVariables } from 'twenty-ui/theme-constants';
|
||||
|
||||
@@ -41,8 +42,8 @@ export const RecordTitleCellSingleTextDisplayMode = ({
|
||||
|
||||
const recordStore = useAtomFamilyStateValue(recordStoreFamilyState, recordId);
|
||||
|
||||
const isEmpty =
|
||||
recordStore?.[fieldDefinition.metadata.fieldName]?.trim() === '';
|
||||
const fieldValue = recordStore?.[fieldDefinition.metadata.fieldName];
|
||||
const isEmpty = !isDefined(fieldValue) || fieldValue.trim() === '';
|
||||
|
||||
const { openRecordTitleCell } = useRecordTitleCell();
|
||||
|
||||
|
||||
+51
@@ -1,3 +1,5 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { objectRecordChangedValues } from 'src/engine/core-modules/event-emitter/utils/object-record-changed-values';
|
||||
import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type';
|
||||
import { type FlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/types/flat-field-metadata.type';
|
||||
@@ -146,4 +148,53 @@ describe('objectRecordChangedValues', () => {
|
||||
|
||||
expect(result).toEqual(expectedChanges);
|
||||
});
|
||||
|
||||
it('ignores changes to POSITION fields', () => {
|
||||
const positionFieldId = 'position-field-id';
|
||||
const positionUniversalId = 'position-universal-id';
|
||||
|
||||
const objectMetadataWithPosition: FlatObjectMetadata = {
|
||||
...mockObjectMetadata,
|
||||
fieldIds: [positionFieldId],
|
||||
};
|
||||
|
||||
const flatFieldMetadataMapsWithPosition: FlatEntityMaps<FlatFieldMetadata> =
|
||||
{
|
||||
byUniversalIdentifier: {
|
||||
[positionUniversalId]: {
|
||||
id: positionFieldId,
|
||||
name: 'position',
|
||||
type: FieldMetadataType.POSITION,
|
||||
universalIdentifier: positionUniversalId,
|
||||
} as FlatFieldMetadata,
|
||||
},
|
||||
universalIdentifierById: {
|
||||
[positionFieldId]: positionUniversalId,
|
||||
},
|
||||
universalIdentifiersByApplicationId: {},
|
||||
};
|
||||
|
||||
const oldRecord = {
|
||||
id: '74316f58-29b0-4a6a-b8fa-d2b506d5516n',
|
||||
position: 1,
|
||||
name: 'Original',
|
||||
};
|
||||
const newRecord = {
|
||||
id: '74316f58-29b0-4a6a-b8fa-d2b506d5516n',
|
||||
position: 5,
|
||||
name: 'Updated',
|
||||
};
|
||||
|
||||
const result = objectRecordChangedValues(
|
||||
oldRecord,
|
||||
newRecord,
|
||||
objectMetadataWithPosition,
|
||||
flatFieldMetadataMapsWithPosition,
|
||||
);
|
||||
|
||||
expect(result).toEqual({
|
||||
name: { before: 'Original', after: 'Updated' },
|
||||
});
|
||||
expect(result).not.toHaveProperty('position');
|
||||
});
|
||||
});
|
||||
|
||||
+2
-1
@@ -56,7 +56,8 @@ export const objectRecordChangedValues = (
|
||||
if (
|
||||
key === 'updatedAt' ||
|
||||
key === 'searchVector' ||
|
||||
field?.type === FieldMetadataType.RELATION
|
||||
field?.type === FieldMetadataType.RELATION ||
|
||||
field?.type === FieldMetadataType.POSITION
|
||||
) {
|
||||
return acc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user