diff --git a/frontend/src/metabase/dashboard/containers/AutomaticDashboardApp.jsx b/frontend/src/metabase/dashboard/containers/AutomaticDashboardApp.jsx index a642330254a7a17cf92b3acde7290e3e6459b8fe..fcd147d2457dbddd0b605a43fcf9867e611a8886 100644 --- a/frontend/src/metabase/dashboard/containers/AutomaticDashboardApp.jsx +++ b/frontend/src/metabase/dashboard/containers/AutomaticDashboardApp.jsx @@ -14,6 +14,7 @@ import Filter from "metabase/query_builder/components/Filter"; import cxs from "cxs"; import { t } from "c-3po"; +import _ from "underscore"; import { Dashboard } from "metabase/dashboard/containers/Dashboard"; import DashboardData from "metabase/dashboard/hoc/DashboardData"; @@ -96,7 +97,7 @@ class AutomaticDashboardApp extends React.Component { // pull out "more" related items for displaying as a button at the bottom of the dashboard const more = dashboard && dashboard.more; const related = dashboard && dashboard.related; - const hasSidebar = related && related.length > 0; + const hasSidebar = _.any(related || {}, list => list.length > 0); return ( <div className="relative"> @@ -250,7 +251,9 @@ const SuggestionsSidebar = ({ related }) => ( <div className="py2 text-centered my3"> <h3 className="text-grey-3">More X-rays</h3> </div> - <SuggestionsList section="related" suggestions={related} /> + {Object.entries(related).map(([section, suggestions]) => ( + <SuggestionsList section={section} suggestions={suggestions} /> + ))} </div> );