Skip to content

Commit

Permalink
Merging
Browse files Browse the repository at this point in the history
  • Loading branch information
jjoyce0510 committed Mar 11, 2021
1 parent 9be8174 commit 09c27ae
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion datahub-frontend/run/frontend.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Server Port
PORT=9001
PORT=9002

# Secret Key
DATAHUB_SECRET="YouKnowNothing"
Expand Down
1 change: 0 additions & 1 deletion datahub-web-react/src/app/shared/NoPageFound.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { useReactiveVar } from '@apollo/client';
import { Redirect } from 'react-router';

import { isLoggedInVar } from '../auth/checkAuthStatus';
import { PageRoutes } from '../../conf/Global';

Expand Down
18 changes: 17 additions & 1 deletion datahub-web-react/src/utils/test-utils/TestPageContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { EntityRegistryContext } from '../../entityRegistryContext';
import { TagEntity } from '../../app/entity/tag/Tag';

import defaultThemeConfig from '../../conf/theme/theme_light.config.json';
import { Theme } from '../../conf/theme/types';

type Props = {
children: React.ReactNode;
Expand All @@ -25,8 +26,23 @@ export function getTestEntityRegistry() {

export default ({ children, initialEntries }: Props) => {
const entityRegistry = useMemo(() => getTestEntityRegistry(), []);

const theme: Theme = useMemo(() => {
const overridesWithoutPrefix: { [key: string]: any } = {};
const themeConfig = defaultThemeConfig;
Object.assign(overridesWithoutPrefix, themeConfig.styles);
Object.keys(overridesWithoutPrefix).forEach((key) => {
overridesWithoutPrefix[key.substring(1)] = overridesWithoutPrefix[key];
delete overridesWithoutPrefix[key];
});
return {
...themeConfig,
styles: overridesWithoutPrefix as Theme['styles'],
};
}, []);

return (
<ThemeProvider theme={defaultThemeConfig}>
<ThemeProvider theme={theme}>
<MemoryRouter initialEntries={initialEntries}>
<EntityRegistryContext.Provider value={entityRegistry}>{children}</EntityRegistryContext.Provider>
</MemoryRouter>
Expand Down

0 comments on commit 09c27ae

Please sign in to comment.