diff --git a/frontend/src/metabase/components/CollectionLanding.jsx b/frontend/src/metabase/components/CollectionLanding.jsx index 91fd17974bcb41836e7e5b4d55a0f373df506326..5f19ab36eb8ee2e538d634175dc24063fb82f697 100644 --- a/frontend/src/metabase/components/CollectionLanding.jsx +++ b/frontend/src/metabase/components/CollectionLanding.jsx @@ -22,7 +22,7 @@ import CollectionEmptyState from "metabase/components/CollectionEmptyState"; import EntityMenu from "metabase/components/EntityMenu"; import CollectionListLoader from "metabase/containers/CollectionListLoader"; -import CollectionLoader from "metabase/containers/CollectionItemsLoader"; +import CollectionLoader from "metabase/containers/CollectionLoader"; import { entityListLoader } from "metabase/entities/containers/EntityListLoader"; import Collections from "metabase/entities/collections"; @@ -86,7 +86,12 @@ const CollectionList = () => { ); }; -@connect((state, { collectionId }) => ({ entityQuery: { collectionId } })) +@connect((state, { collectionId }) => ({ + entityQuery: + collectionId === "root" + ? {} // FIXME /api/search doesn't yet support root collection + : { collection_id: collectionId }, +})) @entityListLoader({ entityType: "search", wrapped: true, @@ -116,7 +121,7 @@ class DefaultLanding extends React.Component { <Box w={2 / 3}> <Box> <CollectionLoader collectionId={collectionId || "root"}> - {({ collection }) => { + {({ object: collection }) => { if (list.length === 0) { return <CollectionEmptyState />; } diff --git a/frontend/src/metabase/entities/containers/EntityListLoader.jsx b/frontend/src/metabase/entities/containers/EntityListLoader.jsx index 17f7ed1228055323e96f2f99613b2dec4801f7ad..94bf9c16067a2d5f1b2ba3743f84c500b8a3f2f2 100644 --- a/frontend/src/metabase/entities/containers/EntityListLoader.jsx +++ b/frontend/src/metabase/entities/containers/EntityListLoader.jsx @@ -107,7 +107,7 @@ export const entityListLoader = (ellProps: Props) => (ComposedComponent: any) => // eslint-disable-next-line react/display-name (props: Props) => ( - <EntityListLoader {...ellProps}> + <EntityListLoader {...props} {...ellProps}> {childProps => <ComposedComponent {...props} {...childProps} />} </EntityListLoader> );