Skip to content
Snippets Groups Projects
Commit f15d4775 authored by Tom Robinson's avatar Tom Robinson
Browse files

Fix collection_id (except for root, pending endpoint fix)

parent aa78f200
No related merge requests found
......@@ -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 />;
}
......
......@@ -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>
);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment