You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by aa...@apache.org on 2022/03/11 18:55:11 UTC
[superset] 16/18: fix(dashboard): don't show report modal for anonymous user (#17106)
This is an automated email from the ASF dual-hosted git repository.
aafghahi pushed a commit to branch refactorReports
in repository https://gitbox.apache.org/repos/asf/superset.git
commit cb0bca0ba5d2427e99605a70299feff40de1477a
Author: Mayur <ma...@gmail.com>
AuthorDate: Thu Nov 11 16:20:12 2021 +0530
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 <ma...@kpmg.com>
---
.../components/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 78fb6bb..aa4d0c2 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<AlertObject | null>(null);
+ const [currentReportDeleting, setCurrentReportDeleting] =
+ useState<AlertObject | null>(null);
const theme = useTheme();
const [showModal, setShowModal] = useState<boolean>(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;
}