From cb0bca0ba5d2427e99605a70299feff40de1477a Mon Sep 17 00:00:00 2001 From: Mayur Date: Thu, 11 Nov 2021 16:20:12 +0530 Subject: [PATCH] fix(dashboard): don't show report modal for anonymous user (#17106) * Added sunburst echart * fix(dashboard):Hide reports modal for anonymous users * Address comments * Make prettier happy Co-authored-by: Mayur --- .../ReportModal/HeaderReportActionsDropdown/index.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/superset-frontend/src/components/ReportModal/HeaderReportActionsDropdown/index.tsx b/superset-frontend/src/components/ReportModal/HeaderReportActionsDropdown/index.tsx index 78fb6bb0c73f8..aa4d0c20d8167 100644 --- a/superset-frontend/src/components/ReportModal/HeaderReportActionsDropdown/index.tsx +++ b/superset-frontend/src/components/ReportModal/HeaderReportActionsDropdown/index.tsx @@ -61,10 +61,8 @@ export default function HeaderReportActionsDropDown({ any, UserWithPermissionsAndRoles >(state => state.user || state.explore?.user); - const [ - currentReportDeleting, - setCurrentReportDeleting, - ] = useState(null); + const [currentReportDeleting, setCurrentReportDeleting] = + useState(null); const theme = useTheme(); const [showModal, setShowModal] = useState(false); const toggleActiveKey = async (data: AlertObject, checked: boolean) => { @@ -82,7 +80,7 @@ export default function HeaderReportActionsDropDown({ if (!isFeatureEnabled(FeatureFlag.ALERT_REPORTS)) { return false; } - if (!user) { + if (!user?.userId) { // this is in the case that there is an anonymous user. return false; }