Sync remote object (#4713)
* Sync objects * Generate data for isRemote * Add cache version update * Add label identifier + fix field metadata input --------- Co-authored-by: Thomas Trompette <thomast@twenty.com>
This commit is contained in:
@ -17,6 +17,7 @@ export const FIND_MANY_OBJECT_METADATA_ITEMS = gql`
|
||||
description
|
||||
icon
|
||||
isCustom
|
||||
isRemote
|
||||
isActive
|
||||
isSystem
|
||||
createdAt
|
||||
|
||||
@ -17,6 +17,7 @@ export const query = gql`
|
||||
description
|
||||
icon
|
||||
isCustom
|
||||
isRemote
|
||||
isActive
|
||||
isSystem
|
||||
createdAt
|
||||
|
||||
@ -13,6 +13,7 @@ export const getObjectMetadataItemsMock = () => {
|
||||
description: 'A webhook',
|
||||
icon: 'IconRobot',
|
||||
isCustom: false,
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
createdAt: '2023-11-30T11:13:15.206Z',
|
||||
@ -30,6 +31,7 @@ export const getObjectMetadataItemsMock = () => {
|
||||
description: 'An api key',
|
||||
icon: 'IconRobot',
|
||||
isCustom: false,
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
createdAt: '2023-11-30T11:13:15.206Z',
|
||||
@ -150,6 +152,7 @@ export const getObjectMetadataItemsMock = () => {
|
||||
description: '(System) View Sorts',
|
||||
icon: 'IconArrowsSort',
|
||||
isCustom: false,
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
createdAt: '2023-11-30T11:13:15.206Z',
|
||||
@ -282,6 +285,7 @@ export const getObjectMetadataItemsMock = () => {
|
||||
description: 'A calendar event',
|
||||
icon: 'IconCalendarEvent',
|
||||
isCustom: false,
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
createdAt: '2023-11-30T11:13:15.206Z',
|
||||
@ -299,6 +303,7 @@ export const getObjectMetadataItemsMock = () => {
|
||||
description: 'An opportunity',
|
||||
icon: 'IconTargetArrow',
|
||||
isCustom: false,
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
createdAt: '2023-11-30T11:13:15.206Z',
|
||||
@ -617,6 +622,7 @@ export const getObjectMetadataItemsMock = () => {
|
||||
description: 'A person',
|
||||
icon: 'IconUser',
|
||||
isCustom: false,
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
createdAt: '2023-11-30T11:13:15.206Z',
|
||||
@ -1013,6 +1019,7 @@ export const getObjectMetadataItemsMock = () => {
|
||||
description: 'A workspace member',
|
||||
icon: 'IconUserCircle',
|
||||
isCustom: false,
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
createdAt: '2023-11-30T11:13:15.206Z',
|
||||
|
||||
@ -15,6 +15,7 @@ export const objectMetadataItemSchema = z.object({
|
||||
imageIdentifierFieldMetadataId: z.string().uuid().nullable(),
|
||||
isActive: z.boolean(),
|
||||
isCustom: z.boolean(),
|
||||
isRemote: z.boolean(),
|
||||
isSystem: z.boolean(),
|
||||
labelIdentifierFieldMetadataId: z.string().uuid().nullable(),
|
||||
labelPlural: z.string().trim().min(1),
|
||||
|
||||
@ -29,6 +29,10 @@ export const useFindManyParams = (
|
||||
objectMetadataItem?.fields ?? [],
|
||||
);
|
||||
|
||||
if (objectMetadataItem?.isRemote) {
|
||||
return { objectNameSingular, filter };
|
||||
}
|
||||
|
||||
const orderBy = turnSortsIntoOrderBy(
|
||||
tableSorts,
|
||||
objectMetadataItem?.fields ?? [],
|
||||
|
||||
Reference in New Issue
Block a user