Files
twenty_crm/packages/twenty-front/src/modules/object-metadata/utils/isWorkflowSubObjectMetadata.ts
Thomas Trompette c055d167f2 Make workflow objects read only in frontend (#7545)
Expected behavior:
- workflows can be added and deleted. Only name field is editable
- versions and runs cannot be added nor deleted. No fields are editable

Added two new utils for those needs:
- `isReadOnlyObject` the similar logic between remote objects, versions
and runs
- `isFieldReadonlyFromObjectMetadataName` to easily block field edition
from object context
2024-10-10 15:29:43 +02:00

8 lines
323 B
TypeScript

import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
export const isWorkflowSubObjectMetadata = (
objectMetadataNameSingular?: string,
) =>
objectMetadataNameSingular === CoreObjectNameSingular.WorkflowVersion ||
objectMetadataNameSingular === CoreObjectNameSingular.WorkflowRun;