Fix field item type tag (#16860)

# Introduction
This has been fixed on main already 1 hour ago, this PR now only passes
the field application id instead of the object applicationId that could
be different for example when creating a custom field on a standard
object

For the moment not introducing any logic around application integrity
directly and still relying on the isCustom and standardId definition
This will have to be refactored once we deprecate the standardId
This commit is contained in:
Paul Rastoin
2025-12-30 16:02:07 +01:00
committed by GitHub
parent aac70c679f
commit 1128331cc1
24 changed files with 62 additions and 147 deletions
@@ -1,62 +0,0 @@
import { isObjectMetadataSettingsReadOnly } from '@/object-record/read-only/utils/isObjectMetadataSettingsReadOnly';
describe('isObjectMetadataSettingsReadOnly', () => {
it('should return false if object can be updated and is not UI read only and is not remote', () => {
const result = isObjectMetadataSettingsReadOnly({
objectPermissions: {
canUpdateObjectRecords: true,
objectMetadataId: '123',
restrictedFields: {},
},
objectMetadataItem: {
isUIReadOnly: false,
isRemote: false,
},
});
expect(result).toBe(false);
});
it('should return true if object is remote', () => {
const result = isObjectMetadataSettingsReadOnly({
objectPermissions: {
canUpdateObjectRecords: true,
objectMetadataId: '123',
restrictedFields: {},
},
objectMetadataItem: {
isUIReadOnly: false,
isRemote: true,
},
});
expect(result).toBe(true);
});
it('should return true if object is UI read only', () => {
const result = isObjectMetadataSettingsReadOnly({
objectMetadataItem: {
isUIReadOnly: true,
isRemote: false,
},
});
expect(result).toBe(true);
});
it('should return false for standard/third-party objects (they are editable via standardOverrides)', () => {
const result = isObjectMetadataSettingsReadOnly({
objectPermissions: {
canUpdateObjectRecords: true,
objectMetadataId: '123',
restrictedFields: {},
},
objectMetadataItem: {
isUIReadOnly: false,
isRemote: false,
},
});
expect(result).toBe(false);
});
});
@@ -1,17 +0,0 @@
import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
import { isObjectMetadataReadOnly } from '@/object-record/read-only/utils/isObjectMetadataReadOnly';
import { type ObjectPermission } from '~/generated/graphql';
type IsObjectMetadataSettingsReadOnlyParams = {
objectPermissions?: ObjectPermission;
objectMetadataItem?: Pick<ObjectMetadataItem, 'isUIReadOnly' | 'isRemote'>;
};
// Returns true only for remote or UI read-only objects
// Standard and third-party app objects are editable (label/icon/description via standardOverrides)
export const isObjectMetadataSettingsReadOnly = ({
objectPermissions,
objectMetadataItem,
}: IsObjectMetadataSettingsReadOnlyParams) => {
return isObjectMetadataReadOnly({ objectPermissions, objectMetadataItem });
};