Skip to content
Snippets Groups Projects
Unverified Commit 2b3f5276 authored by Simon Belak's avatar Simon Belak Committed by GitHub
Browse files

Merge pull request #8085 from metabase/xray-restore-related-sidebar

Restore xray related sidebar that was reverted in a recent merge
parents b769e0e2 d6042945
No related branches found
No related tags found
No related merge requests found
......@@ -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>
);
......
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