Fix remote object read-only + remove relations (#4921)
- Set `readOnly` boolean in table row context. Preventing updates and deletion - Show page is null for remote objects. No need for complicated design since this is temporary? - Relation creations are now behind a feature flag for remote objects - Refetch objects and views after syncing objects --------- Co-authored-by: Thomas Trompette <thomast@twenty.com>
This commit is contained in:
@ -0,0 +1,39 @@
|
||||
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
|
||||
|
||||
export type ObjectTypeLabel =
|
||||
| StandardObjectTypeLabel
|
||||
| CustomObjectTypeLabel
|
||||
| RemoteObjectTypeLabel;
|
||||
|
||||
type StandardObjectTypeLabel = {
|
||||
labelText: 'Standard';
|
||||
labelColor: 'blue';
|
||||
};
|
||||
|
||||
type CustomObjectTypeLabel = {
|
||||
labelText: 'Custom';
|
||||
labelColor: 'orange';
|
||||
};
|
||||
|
||||
type RemoteObjectTypeLabel = {
|
||||
labelText: 'Remote';
|
||||
labelColor: 'green';
|
||||
};
|
||||
|
||||
export const getObjectTypeLabel = (
|
||||
objectMetadataItem: ObjectMetadataItem,
|
||||
): ObjectTypeLabel =>
|
||||
objectMetadataItem.isCustom
|
||||
? {
|
||||
labelText: 'Custom',
|
||||
labelColor: 'orange',
|
||||
}
|
||||
: objectMetadataItem.isRemote
|
||||
? {
|
||||
labelText: 'Remote',
|
||||
labelColor: 'green',
|
||||
}
|
||||
: {
|
||||
labelText: 'Standard',
|
||||
labelColor: 'blue',
|
||||
};
|
||||
Reference in New Issue
Block a user