geido commented on a change in pull request #16987:
URL: https://github.com/apache/superset/pull/16987#discussion_r724021071
##########
File path:
superset-frontend/src/components/ReportModal/HeaderReportActionsDropdown/index.tsx
##########
@@ -49,8 +49,13 @@ export default function HeaderReportActionsDropDown({
const reports: Record<number, AlertObject> = useSelector<any, AlertObject>(
state => state.reports,
);
- const report: AlertObject = Object.values(reports)[0];
- const hasReport = !!report;
+ const report: AlertObject = Object.values(reports).filter(report => {
+ if (dashboardId) {
+ return report.dashboard_id === dashboardId;
+ }
+ return report.chart_id === chart?.id;
+ })[0];
+ console.log(report);
Review comment:
```suggestion
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]