6a14b1c6d6
## Query depth deprecation I'm deprecating depth parameter in our graphql query / cache tooling. They were obsolete since we introduce the possibility to provide RecordGqlFields ## Refactor combinedFindManyRecordHook The hook can now take an array of operationSignatures ## Fix tasks issues Fix optimistic rendering issue. Note that we still haven't handle optimisticEffect on creation properly
26 lines
838 B
TypeScript
26 lines
838 B
TypeScript
import React from 'react';
|
|
import { useRecoilValue } from 'recoil';
|
|
|
|
import { ObjectMetadataItemsLoadEffect } from '@/object-metadata/components/ObjectMetadataItemsLoadEffect';
|
|
import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';
|
|
import { RelationPickerScope } from '@/object-record/relation-picker/scopes/RelationPickerScope';
|
|
|
|
export const ObjectMetadataItemsProvider = ({
|
|
children,
|
|
}: React.PropsWithChildren) => {
|
|
const objectMetadataItems = useRecoilValue(objectMetadataItemsState);
|
|
|
|
const shouldDisplayChildren = objectMetadataItems.length > 0;
|
|
|
|
return (
|
|
<>
|
|
<ObjectMetadataItemsLoadEffect />
|
|
{shouldDisplayChildren && (
|
|
<RelationPickerScope relationPickerScopeId="relation-picker">
|
|
{children}
|
|
</RelationPickerScope>
|
|
)}
|
|
</>
|
|
);
|
|
};
|