Skip to content

Commit

Permalink
Revert "fix(dashboard-css): make to stay custom css when reload (apac…
Browse files Browse the repository at this point in the history
…he#19084)"

This reverts commit 30c97ad.
  • Loading branch information
sadpandajoe committed Mar 23, 2022
1 parent 1113a55 commit 8f549b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { render, screen } from 'spec/helpers/testing-library';
import userEvent from '@testing-library/user-event';
import fetchMock from 'fetch-mock';
import { HeaderDropdownProps } from 'src/dashboard/components/Header/types';
import injectCustomCss from 'src/dashboard/util/injectCustomCss';
import HeaderActionsDropdown from '.';

const createProps = () => ({
Expand Down Expand Up @@ -181,9 +180,7 @@ test('should NOT render the "Refresh dashboard" menu item as disabled', async ()

test('should render with custom css', () => {
const mockedProps = createProps();
const { customCss } = mockedProps;
render(setup(mockedProps));
injectCustomCss(customCss);
expect(screen.getByRole('button')).toHaveStyle('margin-left: 100px');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ class HeaderActionsDropdown extends React.PureComponent {
}

UNSAFE_componentWillMount() {
injectCustomCss(this.state.css);

SupersetClient.get({ endpoint: '/csstemplateasyncmodelview/api/read' })
.then(({ json }) => {
const cssTemplates = json.result.map(row => ({
Expand Down

0 comments on commit 8f549b6

Please sign in to comment.