diff --git a/superset-frontend/src/components/ReportModal/HeaderReportActionsDropdown/index.tsx b/superset-frontend/src/components/ReportModal/HeaderReportActionsDropdown/index.tsx index 6e42b07531b4c..f9fdca066556e 100644 --- a/superset-frontend/src/components/ReportModal/HeaderReportActionsDropdown/index.tsx +++ b/superset-frontend/src/components/ReportModal/HeaderReportActionsDropdown/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useState, useEffect } from 'react'; +import React, { useState, useEffect, useRef } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { t, SupersetTheme, css, useTheme } from '@superset-ui/core'; import Icons from 'src/components/Icons'; @@ -55,14 +55,13 @@ export default function HeaderReportActionsDropDown({ >(state => state.user || state.explore?.user); const reportsIds = Object.keys(reports || []); const report: AlertObject = reports?.[reportsIds[0]]; - console.log(report); const [ currentReportDeleting, setCurrentReportDeleting, ] = useState(null); const theme = useTheme(); const [showModal, setShowModal] = useState(false); - + const dashboardIdRef = useRef(dashboardId); const toggleActiveKey = async (data: AlertObject, checked: boolean) => { if (data?.id) { toggleActive(data, checked); @@ -104,6 +103,23 @@ export default function HeaderReportActionsDropDown({ } }, []); + useEffect(() => { + if ( + canAddReports() && + dashboardId && + dashboardId !== dashboardIdRef.current + ) { + dispatch( + fetchUISpecificReport({ + userId: user.userId, + filterField: 'dashboard_id', + creationMethod: 'dashboards', + resourceId: dashboardId, + }), + ); + } + }, [dashboardId]); + const menu = () => ( diff --git a/superset-frontend/src/explore/components/DataTablesPane/index.tsx b/superset-frontend/src/explore/components/DataTablesPane/index.tsx index 1b0aa9c0db11a..2712135b4b47b 100644 --- a/superset-frontend/src/explore/components/DataTablesPane/index.tsx +++ b/superset-frontend/src/explore/components/DataTablesPane/index.tsx @@ -295,7 +295,6 @@ export const DataTablesPane = ({ }, [queryFormData, columnNames], ); - console.log(queryFormData); useEffect(() => { setItem(LocalStorageKeys.is_datapanel_open, panelOpen); }, [panelOpen]);