Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(product-analytics): Hide filtering by dashboard if there are none #19530

36 changes: 19 additions & 17 deletions frontend/src/scenes/saved-insights/SavedInsightsFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,25 @@ export function SavedInsightsFilters(): JSX.Element {
value={search || ''}
/>
<div className="flex items-center gap-2 flex-wrap">
<div className="flex items-center gap-2">
<span>On dashboard:</span>
<LemonSelect
size="small"
options={nameSortedDashboards.map((nsd) => ({
value: nsd.id,
label: nsd.name,
}))}
value={dashboardId}
onChange={(newValue) => {
setSavedInsightsFilters({ dashboardId: newValue })
}}
dropdownMatchSelectWidth={false}
data-attr="insight-on-dashboard"
allowClear={true}
/>
</div>
{nameSortedDashboards.length > 0 && (
<div className="flex items-center gap-2">
<span>On dashboard:</span>
<LemonSelect
size="small"
options={nameSortedDashboards.map((nsd) => ({
value: nsd.id,
label: nsd.name,
}))}
value={dashboardId}
onChange={(newValue) => {
setSavedInsightsFilters({ dashboardId: newValue })
}}
dropdownMatchSelectWidth={false}
data-attr="insight-on-dashboard"
allowClear={true}
/>
</div>
)}
<div className="flex items-center gap-2">
<span>Type:</span>
<LemonSelect
Expand Down
Loading