mirror of
https://github.com/apache/superset.git
synced 2024-09-07 06:17:45 -04:00
chore(Embedded): Avoid creating a filter key for guest users (#26312)
Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
This commit is contained in:
parent
5f5a656835
commit
fe9fbadade
@ -47,6 +47,7 @@ import { useTabId } from 'src/hooks/useTabId';
|
||||
import { logEvent } from 'src/logger/actions';
|
||||
import { LOG_ACTIONS_CHANGE_DASHBOARD_FILTER } from 'src/logger/LogUtils';
|
||||
import { FilterBarOrientation, RootState } from 'src/dashboard/types';
|
||||
import { UserWithPermissionsAndRoles } from 'src/types/bootstrapTypes';
|
||||
import { checkIsApplyDisabled } from './utils';
|
||||
import { FiltersBarProps } from './types';
|
||||
import {
|
||||
@ -149,6 +150,10 @@ const FilterBar: React.FC<FiltersBarProps> = ({
|
||||
const canEdit = useSelector<RootState, boolean>(
|
||||
({ dashboardInfo }) => dashboardInfo.dash_edit_perm,
|
||||
);
|
||||
const user: UserWithPermissionsAndRoles = useSelector<
|
||||
RootState,
|
||||
UserWithPermissionsAndRoles
|
||||
>(state => state.user);
|
||||
|
||||
const [filtersInScope] = useSelectFiltersInScope(nativeFilterValues);
|
||||
|
||||
@ -220,7 +225,10 @@ const FilterBar: React.FC<FiltersBarProps> = ({
|
||||
}, [dataMaskAppliedText, setDataMaskSelected]);
|
||||
|
||||
useEffect(() => {
|
||||
publishDataMask(history, dashboardId, updateKey, dataMaskApplied, tabId);
|
||||
// embedded users can't persist filter combinations
|
||||
if (user?.userId) {
|
||||
publishDataMask(history, dashboardId, updateKey, dataMaskApplied, tabId);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [dashboardId, dataMaskAppliedText, history, updateKey, tabId]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user