Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test subpage for training mockup implementation #6

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/main/webapp/app/modules/test/test-website.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Row } from 'reactstrap';
import React from 'react';

export const TestWebsite = () => {
return (
<>
<Row>
<h2 style={{ textAlign: 'center' }}>Here you can add your mockup implementation. Good luck :)</h2>
</Row>
<Row>
<h3 style={{ textAlign: 'center' }}>Remember to change "TestWebsite" module and header component to the proper name</h3>
</Row>
</>
);
};

export default TestWebsite;
9 changes: 9 additions & 0 deletions src/main/webapp/app/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import PrivateRoute from 'app/shared/auth/private-route';
import ErrorBoundaryRoutes from 'app/shared/error/error-boundary-routes';
import PageNotFound from 'app/shared/error/page-not-found';
import { AUTHORITIES } from 'app/config/constants';
import TestWebsite from 'app/modules/test/test-website';

const loading = <div>loading ...</div>;

Expand All @@ -34,6 +35,14 @@ const AppRoutes = () => {
<Route index element={<Home />} />
<Route path="login" element={<Login />} />
<Route path="logout" element={<Logout />} />
<Route
path="test-website"
element={
<PrivateRoute hasAnyAuthorities={[AUTHORITIES.ADMIN, AUTHORITIES.USER]}>
<TestWebsite />
</PrivateRoute>
}
/>
<Route path="account">
<Route
path="*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@ export const Home = () => (
</NavLink>
</NavItem>
);

export const TestWebsite = () => (
<NavItem>
<NavLink tag={Link} to="/test-website" className="d-flex align-items-center">
<span>Test Website</span>
</NavLink>
</NavItem>
);
3 changes: 2 additions & 1 deletion src/main/webapp/app/shared/layout/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React, { useState } from 'react';
import { Navbar, Nav, NavbarToggler, Collapse } from 'reactstrap';
import LoadingBar from 'react-redux-loading-bar';

import { Home, Brand } from './header-components';
import { Home, Brand, TestWebsite } from './header-components';
import { AdminMenu, EntitiesMenu, AccountMenu } from '../menus';

export interface IHeaderProps {
Expand Down Expand Up @@ -40,6 +40,7 @@ const Header = (props: IHeaderProps) => {
<Collapse isOpen={menuOpen} navbar>
<Nav id="header-tabs" className="ms-auto" navbar>
<Home />
{props.isAuthenticated && <TestWebsite />}
{props.isAuthenticated && <EntitiesMenu />}
{props.isAuthenticated && props.isAdmin && (
<AdminMenu showOpenAPI={props.isOpenAPIEnabled} showDatabase={!props.isInProduction} />
Expand Down