Update standard fields (#6532)

In this PR:
- adding Favorites to Tasks and Notes
- fixing inconsistencies between custom object creation and sync of
standard fields of custom objects
- fixing workspaceCacheVersion not used to invalidate existing
datasource
This commit is contained in:
Charles Bochet
2024-08-04 23:22:41 +02:00
committed by GitHub
parent 03204021cb
commit 2b311b5f7b
14 changed files with 112 additions and 40 deletions

View File

@ -1,7 +1,10 @@
import styled from '@emotion/styled';
import { currentUserState } from '@/auth/states/currentUserState';
import { useIsPrefetchLoading } from '@/prefetch/hooks/useIsPrefetchLoading';
import { NavigationDrawerSectionTitleSkeletonLoader } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSectionTitleSkeletonLoader';
import { useRecoilValue } from 'recoil';
import { isDefined } from 'twenty-ui';
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
type NavigationDrawerSectionTitleProps = {
@ -32,9 +35,10 @@ export const NavigationDrawerSectionTitle = ({
onClick,
label,
}: NavigationDrawerSectionTitleProps) => {
const currentUser = useRecoilValue(currentUserState);
const loading = useIsPrefetchLoading();
if (loading) {
if (loading && isDefined(currentUser)) {
return <NavigationDrawerSectionTitleSkeletonLoader />;
}
return <StyledTitle onClick={onClick}>{label}</StyledTitle>;