Skip to content

Commit

Permalink
fix(dashboard): Missing filter card styles (#23256)
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje authored Mar 2, 2023
1 parent 1f3eb56 commit 9d0eea9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions superset-frontend/src/dashboard/containers/DashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/
import React, { FC, useEffect, useMemo, useRef } from 'react';
import { Global } from '@emotion/react';
import { useHistory } from 'react-router-dom';
import {
CategoricalColorNamespace,
Expand All @@ -25,6 +26,7 @@ import {
isFeatureEnabled,
SharedLabelColorSource,
t,
useTheme,
} from '@superset-ui/core';
import pick from 'lodash/pick';
import { useDispatch, useSelector } from 'react-redux';
Expand Down Expand Up @@ -57,6 +59,7 @@ import { DashboardContextForExplore } from 'src/types/DashboardContextForExplore
import shortid from 'shortid';
import { RootState } from '../types';
import { getActiveFilters } from '../util/activeDashboardFilters';
import { filterCardPopoverStyle, headerStyles } from '../styles';

export const DashboardPageIdContext = React.createContext('');

Expand Down Expand Up @@ -140,6 +143,7 @@ const useSyncDashboardStateWithLocalStorage = () => {
};

export const DashboardPage: FC<PageProps> = ({ idOrSlug }: PageProps) => {
const theme = useTheme();
const dispatch = useDispatch();
const history = useHistory();
const dashboardPageId = useSyncDashboardStateWithLocalStorage();
Expand Down Expand Up @@ -274,9 +278,12 @@ export const DashboardPage: FC<PageProps> = ({ idOrSlug }: PageProps) => {
if (!readyToRender) return <Loading />;

return (
<DashboardPageIdContext.Provider value={dashboardPageId}>
<DashboardContainer />
</DashboardPageIdContext.Provider>
<>
<Global styles={[filterCardPopoverStyle(theme), headerStyles(theme)]} />
<DashboardPageIdContext.Provider value={dashboardPageId}>
<DashboardContainer />
</DashboardPageIdContext.Provider>
</>
);
};

Expand Down

0 comments on commit 9d0eea9

Please sign in to comment.