[FE] handle restricted objects 2 (#12437)

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Weiko
2025-06-05 15:49:22 +02:00
committed by GitHub
parent ad804ebecd
commit 3f30964523
109 changed files with 904 additions and 306 deletions

View File

@ -50,6 +50,7 @@ export const initialFavorites: Favorite[] = [
key: mockId,
labelIdentifier: 'favoriteLabel',
avatarUrl: 'example.com',
company: { id: '5', name: 'Company Test 2' },
avatarType: 'squared' as AvatarType,
link: 'example.com',
recordId: '1',
@ -86,17 +87,17 @@ export const sortedFavorites = [
__typename: 'Favorite',
},
{
id: '3',
position: 2,
key: '8f3b2121-f194-4ba4-9fbf-2d5a37126806',
labelIdentifier: 'favoriteLabel',
avatarUrl: 'example.com',
link: 'example.com',
recordId: '1',
__typename: 'Favorite',
avatarType: 'squared',
avatarUrl: undefined,
favoriteFolderId: '1',
forWorkspaceMemberId: '1',
__typename: 'Favorite',
id: '3',
labelIdentifier: 'Company Test 2',
link: '/object/company/5',
objectNameSingular: 'company',
position: 2,
recordId: '5',
},
];

View File

@ -95,9 +95,8 @@ export const sortFavorites = (
} as ProcessedFavorite;
}
}
return {
...favorite,
} as ProcessedFavorite;
return null;
})
.filter(isDefined)
.sort((a, b) => a.position - b.position);
};