diff --git a/frontend/src/component/common/BreadcrumbNav/BreadcrumbNav.tsx b/frontend/src/component/common/BreadcrumbNav/BreadcrumbNav.tsx index 1aff6f9064..0cb6e401fa 100644 --- a/frontend/src/component/common/BreadcrumbNav/BreadcrumbNav.tsx +++ b/frontend/src/component/common/BreadcrumbNav/BreadcrumbNav.tsx @@ -40,7 +40,10 @@ const BreadcrumbNav = () => { 1} show={ - + {paths.map((path, index) => { const lastItem = index === paths.length - 1; if (lastItem) { diff --git a/frontend/src/component/common/FormTemplate/FormTemplate.tsx b/frontend/src/component/common/FormTemplate/FormTemplate.tsx index 1a62abe201..2a1efecd89 100644 --- a/frontend/src/component/common/FormTemplate/FormTemplate.tsx +++ b/frontend/src/component/common/FormTemplate/FormTemplate.tsx @@ -84,7 +84,7 @@ const FormTemplate: React.FC = ({ show={} elseShow={ <> -

{title}

+

{title}

{children} } @@ -98,14 +98,14 @@ const FormTemplate: React.FC = ({ documentationLink={documentationLink} documentationLinkLabel={documentationLinkLabel} > -

+

API Command{' '} -

+ } diff --git a/frontend/src/component/common/HeaderTitle/HeaderTitle.jsx b/frontend/src/component/common/HeaderTitle/HeaderTitle.jsx index e510c8f878..740959fa73 100644 --- a/frontend/src/component/common/HeaderTitle/HeaderTitle.jsx +++ b/frontend/src/component/common/HeaderTitle/HeaderTitle.jsx @@ -22,7 +22,7 @@ const HeaderTitle = ({
{title} diff --git a/frontend/src/component/common/SearchField/SearchField.tsx b/frontend/src/component/common/SearchField/SearchField.tsx index de6b9e52c3..d724fbadc4 100644 --- a/frontend/src/component/common/SearchField/SearchField.tsx +++ b/frontend/src/component/common/SearchField/SearchField.tsx @@ -46,7 +46,7 @@ export const SearchField = ({ }; return ( -
+
} /> -
+ ); }; diff --git a/frontend/src/component/feature/FeatureToggleList/__snapshots__/FeatureToggleList.test.jsx.snap b/frontend/src/component/feature/FeatureToggleList/__snapshots__/FeatureToggleList.test.jsx.snap index 2bd38f1383..1fb5a3cae3 100644 --- a/frontend/src/component/feature/FeatureToggleList/__snapshots__/FeatureToggleList.test.jsx.snap +++ b/frontend/src/component/feature/FeatureToggleList/__snapshots__/FeatureToggleList.test.jsx.snap @@ -5,8 +5,9 @@ exports[`renders correctly with one feature 1`] = `
-
-
+ -

Features -

+
-
-
+
-

Features -

+
{
{' '} -

+

{capitalize(type || '')} toggle -

+
diff --git a/frontend/src/component/feature/FeatureView/FeatureView.tsx b/frontend/src/component/feature/FeatureView/FeatureView.tsx index 866f1791ca..7d7f3e54cd 100644 --- a/frontend/src/component/feature/FeatureView/FeatureView.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureView.tsx @@ -119,12 +119,12 @@ export const FeatureView = () => {
-

{feature.name}{' '} -

+ } diff --git a/frontend/src/component/layout/MainLayout/MainLayout.tsx b/frontend/src/component/layout/MainLayout/MainLayout.tsx index f03a963927..4379fd9ca4 100644 --- a/frontend/src/component/layout/MainLayout/MainLayout.tsx +++ b/frontend/src/component/layout/MainLayout/MainLayout.tsx @@ -37,7 +37,7 @@ export const MainLayout = ({ children }: IMainLayoutProps) => { <>
-
+
{ }} />
-
+
diff --git a/frontend/src/component/menu/__tests__/apiDetails.test.tsx b/frontend/src/component/menu/Footer/ApiDetails/ApiDetails.test.tsx similarity index 61% rename from frontend/src/component/menu/__tests__/apiDetails.test.tsx rename to frontend/src/component/menu/Footer/ApiDetails/ApiDetails.test.tsx index 8e6027143c..d758d70121 100644 --- a/frontend/src/component/menu/__tests__/apiDetails.test.tsx +++ b/frontend/src/component/menu/Footer/ApiDetails/ApiDetails.test.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import renderer from 'react-test-renderer'; -import { ApiDetails } from '../Footer/ApiDetails/ApiDetails'; +import { ApiDetails } from 'component/menu/Footer/ApiDetails/ApiDetails'; +import { render } from 'utils/testRenderer'; test('renders correctly with empty version', () => { const uiConfig = { @@ -10,8 +10,8 @@ test('renders correctly with empty version', () => { version: '', }; - const tree = renderer.create().toJSON(); - expect(tree).toMatchSnapshot(); + render(); + expect(document.body).toMatchSnapshot(); }); test('renders correctly with ui-config', () => { @@ -22,8 +22,8 @@ test('renders correctly with ui-config', () => { version: '1.1.0', }; - const tree = renderer.create().toJSON(); - expect(tree).toMatchSnapshot(); + render(); + expect(document.body).toMatchSnapshot(); }); test('renders correctly without uiConfig', () => { @@ -32,8 +32,8 @@ test('renders correctly without uiConfig', () => { version: '1.1.0', }; - const tree = renderer.create().toJSON(); - expect(tree).toMatchSnapshot(); + render(); + expect(document.body).toMatchSnapshot(); }); test('renders correctly with versionInfo', () => { @@ -48,6 +48,6 @@ test('renders correctly with versionInfo', () => { }, }; - const tree = renderer.create().toJSON(); - expect(tree).toMatchSnapshot(); + render(); + expect(document.body).toMatchSnapshot(); }); diff --git a/frontend/src/component/menu/Footer/ApiDetails/ApiDetails.tsx b/frontend/src/component/menu/Footer/ApiDetails/ApiDetails.tsx index 5b656bee7d..9588928b05 100644 --- a/frontend/src/component/menu/Footer/ApiDetails/ApiDetails.tsx +++ b/frontend/src/component/menu/Footer/ApiDetails/ApiDetails.tsx @@ -5,6 +5,7 @@ import { formatUpdateNotification, IPartialUiConfig, } from './apidetails.helpers'; +import { FooterTitle } from 'component/menu/Footer/FooterTitle'; interface IApiDetailsProps { uiConfig: IPartialUiConfig; @@ -18,13 +19,13 @@ export const ApiDetails = (props: IApiDetailsProps): ReactElement => { return (
-

+ {currentVersion}{' '} ({environment})} /> -

+ +
+
+

+ Unleash + + + ( + test + ) + +

+
+ + We are the best! + +
+
+
+ +`; + +exports[`renders correctly with ui-config 1`] = ` + +
+
+

+ Unleash 1.1.0 + + + ( + test + ) + +

+
+ + We are the best! + +
+
+
+ +`; + +exports[`renders correctly with versionInfo 1`] = ` + +
+
+

+ Unleash 1.2.3 + +

+ + Upgrade available - Latest Enterprise release: 1.2.4 +
+
+
+ +
+ + 1 + +
+
+ +`; + +exports[`renders correctly without uiConfig 1`] = ` + +
+
+

+ Unleash 1.1.0 + +

+
+ +
+
+
+ +`; diff --git a/frontend/src/component/menu/Footer/Footer.jsx b/frontend/src/component/menu/Footer/Footer.jsx index e8ee99dc83..e7ac677a08 100644 --- a/frontend/src/component/menu/Footer/Footer.jsx +++ b/frontend/src/component/menu/Footer/Footer.jsx @@ -4,6 +4,7 @@ import { List, ListItem, ListItemText, Grid } from '@material-ui/core'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import { ApiDetails } from './ApiDetails/ApiDetails'; import { useStyles } from './Footer.styles'; +import { FooterTitle } from './FooterTitle'; export const Footer = () => { const styles = useStyles(); @@ -24,7 +25,7 @@ export const Footer = () => {
-

Server SDKs

+ Server SDKs {
-

Frontend SDKs

+ Frontend SDKs {
-

About

+ About ({ + title: { + all: 'unset', + display: 'block', + margin: '1rem 0', + fontSize: '1rem', + fontWeight: theme.fontWeight.bold, + }, +})); diff --git a/frontend/src/component/menu/Footer/FooterTitle.tsx b/frontend/src/component/menu/Footer/FooterTitle.tsx new file mode 100644 index 0000000000..d82ebfe843 --- /dev/null +++ b/frontend/src/component/menu/Footer/FooterTitle.tsx @@ -0,0 +1,12 @@ +import { ReactNode } from 'react'; +import { useStyles } from 'component/menu/Footer/FooterTitle.styles'; + +interface IFooterTitleProps { + children: ReactNode; +} + +export const FooterTitle = ({ children }: IFooterTitleProps) => { + const styles = useStyles(); + + return

{children}

; +}; diff --git a/frontend/src/component/menu/Header/Header.styles.ts b/frontend/src/component/menu/Header/Header.styles.ts index 410b6787e6..f95cb9167b 100644 --- a/frontend/src/component/menu/Header/Header.styles.ts +++ b/frontend/src/component/menu/Header/Header.styles.ts @@ -28,6 +28,11 @@ export const useStyles = makeStyles(theme => ({ padding: '0', }, }, + nav: { + display: 'flex', + alignItems: 'center', + flexGrow: 1, + }, drawerButton: { color: '#000', }, diff --git a/frontend/src/component/menu/Header/Header.tsx b/frontend/src/component/menu/Header/Header.tsx index 9a86913e47..845e3697ad 100644 --- a/frontend/src/component/menu/Header/Header.tsx +++ b/frontend/src/component/menu/Header/Header.tsx @@ -59,123 +59,107 @@ const Header = () => { adminRoutes: routes.adminRoutes.filter(filterByFlags(flags)), }; - return ( - <> - - - - - - - - } - elseShow={ - + + + + - - - } - /> + + + + +
+ +
+
+
+ + ); + } - + + + - - Projects - Feature toggles + +
+ + + + + - - - - - - - - setAnchorEl( - e.currentTarget - ) - } - > - - - + + + setAnchorEl(e.currentTarget) } - /> - - + > + + + } /> + {' '}
- - - + + + ); }; diff --git a/frontend/src/component/menu/__tests__/__snapshots__/apiDetails.test.tsx.snap b/frontend/src/component/menu/__tests__/__snapshots__/apiDetails.test.tsx.snap deleted file mode 100644 index 5ced02acef..0000000000 --- a/frontend/src/component/menu/__tests__/__snapshots__/apiDetails.test.tsx.snap +++ /dev/null @@ -1,78 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renders correctly with empty version 1`] = ` -
-

- Unleash - - - ( - test - ) - -

-
- - We are the best! - -
-
-`; - -exports[`renders correctly with ui-config 1`] = ` -
-

- Unleash 1.1.0 - - - ( - test - ) - -

-
- - We are the best! - -
-
-`; - -exports[`renders correctly with versionInfo 1`] = ` -
-

- Unleash 1.2.3 - -

- - Upgrade available - Latest Enterprise release: 1.2.4 -
-
-
- -
- - 1 - -
-`; - -exports[`renders correctly without uiConfig 1`] = ` -
-

- Unleash 1.1.0 - -

-
- -
-
-`; diff --git a/frontend/src/component/menu/__tests__/__snapshots__/breadcrumbTest.jsx.snap b/frontend/src/component/menu/__tests__/__snapshots__/breadcrumbTest.jsx.snap deleted file mode 100644 index f6be065f6d..0000000000 --- a/frontend/src/component/menu/__tests__/__snapshots__/breadcrumbTest.jsx.snap +++ /dev/null @@ -1,43 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`breadcrumb for /features 1`] = ` - - - Feature Toggles - - -`; - -exports[`breadcrumb for /features/view/Demo 1`] = ` - - - Feature Toggles - - - - › - - - Demo - - - -`; - -exports[`breadcrumb for /strategies 1`] = ` - - - Strategies - - -`; diff --git a/frontend/src/component/menu/__tests__/__snapshots__/footerTest.jsx.snap b/frontend/src/component/menu/__tests__/__snapshots__/footerTest.jsx.snap index 4cdd16dbce..35ccdc4e26 100644 --- a/frontend/src/component/menu/__tests__/__snapshots__/footerTest.jsx.snap +++ b/frontend/src/component/menu/__tests__/__snapshots__/footerTest.jsx.snap @@ -18,10 +18,12 @@ exports[`should render DrawerMenu 1`] = `
-

+

Unleash 3.x -

+
The enterprise ready feature toggle service. @@ -41,9 +43,11 @@ exports[`should render DrawerMenu 1`] = `
-

+

Server SDKs -

+
    @@ -210,9 +214,11 @@ exports[`should render DrawerMenu 1`] = `
    -

    +

    Frontend SDKs -

    +
      @@ -318,9 +324,11 @@ exports[`should render DrawerMenu 1`] = ` className="MuiGrid-root MuiGrid-item" >
      -

      +

      About -

      +
        @@ -446,10 +454,12 @@ exports[`should render DrawerMenu with "features" selected 1`] = `
        -

        +

        Unleash 3.x -

        +
        The enterprise ready feature toggle service. @@ -469,9 +479,11 @@ exports[`should render DrawerMenu with "features" selected 1`] = `
        -

        +

        Server SDKs -

        +
          @@ -638,9 +650,11 @@ exports[`should render DrawerMenu with "features" selected 1`] = `
          -

          +

          Frontend SDKs -

          +
            @@ -746,9 +760,11 @@ exports[`should render DrawerMenu with "features" selected 1`] = ` className="MuiGrid-root MuiGrid-item" >
            -

            +

            About -

            +
              diff --git a/frontend/src/component/menu/__tests__/breadcrumbTest.jsx b/frontend/src/component/menu/__tests__/breadcrumbTest.jsx deleted file mode 100644 index 1417583355..0000000000 --- a/frontend/src/component/menu/__tests__/breadcrumbTest.jsx +++ /dev/null @@ -1,34 +0,0 @@ -import React from 'react'; -import renderer from 'react-test-renderer'; -import { MemoryRouter } from 'react-router-dom'; -import Breadcrumb from '../breadcrumb'; - -test('breadcrumb for /features', () => { - const tree = renderer.create( - - - - ); - - expect(tree).toMatchSnapshot(); -}); - -test('breadcrumb for /features/view/Demo', () => { - const tree = renderer.create( - - - - ); - - expect(tree).toMatchSnapshot(); -}); - -test('breadcrumb for /strategies', () => { - const tree = renderer.create( - - - - ); - - expect(tree).toMatchSnapshot(); -}); diff --git a/frontend/src/component/menu/breadcrumb.jsx b/frontend/src/component/menu/breadcrumb.jsx deleted file mode 100644 index 92ae8b00ea..0000000000 --- a/frontend/src/component/menu/breadcrumb.jsx +++ /dev/null @@ -1,68 +0,0 @@ -import React from 'react'; -import { Link, Route, Switch } from 'react-router-dom'; - -import { routes, getRoute } from './routes'; - -import styles from '../styles.module.scss'; - -const renderDoubleBread = (currentTitle, parentRoute) => { - document.title = `${currentTitle} - ${parentRoute.title} - Unleash`; - return ( - - - {parentRoute.title} - - - - {currentTitle} - - - ); -}; - -const renderBread = route => { - document.title = `${route.title} - Unleash`; - return ( - - {route.title} - - ); -}; - -const renderRoute = (params, route) => { - if (!route) { - return null; - } - const title = route.title.startsWith(':') - ? params[route.title.substring(1)] - : route.title; - return route.parent - ? renderDoubleBread(title, getRoute(route.parent)) - : renderBread(route); -}; - -/* - Render the breadcrumb. - - We only support two levels. - - Examples: - - Features - - Features > Create - - Features > SomeToggle - */ -const Breadcrumb = () => ( - - {routes.map(route => ( - - renderRoute(params, route) - } - /> - ))} - -); - -export default Breadcrumb; diff --git a/frontend/src/component/menu/drawer.jsx b/frontend/src/component/menu/drawer.jsx index f42f05f8ef..c8cd15421c 100644 --- a/frontend/src/component/menu/drawer.jsx +++ b/frontend/src/component/menu/drawer.jsx @@ -4,9 +4,8 @@ import PropTypes from 'prop-types'; import GitHubIcon from '@material-ui/icons/GitHub'; import LibraryBooksIcon from '@material-ui/icons/LibraryBooks'; import ExitToApp from '@material-ui/icons/ExitToApp'; - +import { Link } from 'react-router-dom'; import styles from './drawer.module.scss'; - import { ReactComponent as LogoIcon } from 'assets/icons/logoBg.svg'; import NavigationLink from './Header/NavigationLink/NavigationLink'; import ConditionallyRender from 'component/common/ConditionallyRender'; @@ -49,16 +48,23 @@ export const DrawerMenu = ({ toggleDrawer()} + anchor="left" + onClose={toggleDrawer} > -
              +
              -
+ ); }; diff --git a/frontend/src/component/menu/drawer.module.scss b/frontend/src/component/menu/drawer.module.scss index 730d8c3497..1f1ae94ce3 100644 --- a/frontend/src/component/menu/drawer.module.scss +++ b/frontend/src/component/menu/drawer.module.scss @@ -6,6 +6,8 @@ .drawerTitle { display: flex; align-items: center; + color: inherit; + text-decoration: none; } .drawerContainer { diff --git a/frontend/src/component/strategies/StrategiesList/__snapshots__/StrategiesList.test.jsx.snap b/frontend/src/component/strategies/StrategiesList/__snapshots__/StrategiesList.test.jsx.snap index feaeb1ce04..12aa045c51 100644 --- a/frontend/src/component/strategies/StrategiesList/__snapshots__/StrategiesList.test.jsx.snap +++ b/frontend/src/component/strategies/StrategiesList/__snapshots__/StrategiesList.test.jsx.snap @@ -20,11 +20,11 @@ exports[`renders correctly with one strategy 1`] = ` className="" data-loading={true} > -

Strategies -

+
-

Strategies -

+
-

Tag Types -

+
-

Tag Types -

+