Skip to content
Snippets Groups Projects
Commit a6b9ba58 authored by Auke Klazema's avatar Auke Klazema
Browse files

TMSS-213: Merge branch 'TMSS-231' into 'master'

TMSS-231: Initial Commit of TMSS Webapp with base code and navigation route.

Closes TMSS-231

See merge request !174
parents c60dfc19 a4eda308
No related branches found
No related tags found
1 merge request!174TMSS-231: Initial Commit of TMSS Webapp with base code and navigation route.
Showing
with 587 additions and 0 deletions
......@@ -20,3 +20,5 @@ SAS/OTB/jRSP/autoconf_share
SAS/OTB/jRSP/bootstrap
SAS/OTB/jRSP/configure.in
**/.idea
SAS/TMSS/frontend/tmss_webapp/package-lock.json
SAS/TMSS/frontend/tmss_webapp/node_modules/
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `yarn start`
Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.<br />
You will also see any lint errors in the console.
### `yarn test`
Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `yarn build`
Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `yarn eject`
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
### Analyzing the Bundle Size
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
### Making a Progressive Web App
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
### Advanced Configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
### Deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
### `yarn build` fails to minify
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
{
"name": "tmss_gui",
"version": "0.1.0",
"private": true,
"dependencies": {
"@json-editor/json-editor": "^2.3.0",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"axios": "^0.19.2",
"font-awesome": "^4.7.0",
"history": "^5.0.0",
"node-sass": "^4.12.0",
"primeflex": "^1.3.0",
"primeicons": "^4.0.0",
"primereact": "^4.2.2",
"react": "^16.13.1",
"react-app-polyfill": "^1.0.6",
"react-bootstrap": "^1.0.1",
"react-bootstrap-datetimepicker": "0.0.22",
"react-dom": "^16.13.1",
"react-frame-component": "^4.1.2",
"react-json-view": "^1.19.1",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1",
"react-transition-group": "^1.2.1",
"typescript": "^3.9.5",
"yup": "^0.29.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
SAS/TMSS/frontend/tmss_webapp/public/favicon.ico

11.4 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Telescope Manager Specification System"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>TMSS</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
.App {
/* text-align: center; */
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #303d59;
height: 50px;
display: flex;
flex-direction: column;
/* align-items: center; */
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
padding-left: 10px;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
import React, {Component} from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import {AppTopbar} from './layout/components/AppTopbar';
import {AppMenu} from './layout/components/AppMenu';
import { AppFooter } from './layout/components/AppFooter';
import {RoutedContent} from './routes';
// import {Dashboard} from './routes/dashboard/dashboard';
import './layout/layout.scss';
// import './App.css';
class App extends Component {
constructor() {
super();
this.state = {
currentMenu: '',
currentPath: '/'
}
this.onMenuItemClick = this.onMenuItemClick.bind(this)
this.menu = [
{label: 'Dashboard', icon: 'pi pi-fw pi-home', to:'/dashboard'},
{label: 'Scheduling Units', icon: 'pi pi-fw pi-calendar', to:'/scheduling'}
];
// this.menuComponent = {'Dashboard': Dashboard}
}
onMenuItemClick(event) {
console.log(event);
this.setState({currentMenu:event.item.label, currentPath: event.item.path});
}
render() {
return (
<React.Fragment>
<div className="App">
<AppTopbar></AppTopbar>
<Router basename={ this.state.currentPath }>
<AppMenu model={this.menu} onMenuItemClick={this.onMenuItemClick} />
<div className="layout-wrapper layout-static layout-static-sidebar-active">
<div className="layout-main">
<RoutedContent />
</div>
</div>
</Router>
<AppFooter></AppFooter>
</div>
</React.Fragment>
);
}
}
export default App;
import React from 'react';
import { render } from '@testing-library/react';
import App from './App';
test('renders ASTRON in footer', () => {
const { getByText } = render(<App />);
const linkElement = getByText("ASTRON");
expect(linkElement).toBeInTheDocument();
});
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
//Suggested location to add your overrides so that migration would be easy by just updating the SASS folder in the future
\ No newline at end of file
/* General */
$fontSize:14px;
$bodyBgColor:#edf0f5;
$textColor:#333333;
$textSecondaryColor:#707070;
$borderRadius:3px;
$dividerColor:#e3e3e3;
$transitionDuration:.2s;
$maskBgColor:#424242;
/* Menu Common */
$menuitemBadgeBgColor:#007be5;
$menuitemBadgeColor:#ffffff;
$submenuFontSize:13px;
$menuitemActiveRouteColor:#1fa1fc;
/* Menu Light */
$menuBgColorFirst:#f3f4f9;
$menuBgColorLast:#d7dbe8;
$menuitemColor:#232428;
$menuitemHoverColor:#0388e5;
$menuitemActiveColor:#0388e5;
$menuitemActiveBgColor:#ffffff;
$menuitemBorderColor:rgba(207, 211, 224, 0.6);
/* Menu Dark */
$menuDarkBgColorFirst:#ffffff;
$menuDarkBgColorLast:#ffffff;
$menuitemDarkColor:#0388e5;
$menuitemDarkHoverColor:#0388e5;
$menuitemDarkActiveColor:#0388e5;
$menuitemDarkActiveBgColor:#ffffff;
$menuitemDarkBorderColor:rgba(246, 248, 252, 0.918);
/* Topbar */
$topbarLeftBgColor:#3d4977;
$topbarRightBgColor:#3d4977;
$topbarItemBadgeBgColor:#ef6262;
$topbarItemBadgeColor:#ffffff;
$topbarItemColor:#ffffff;
$topbarItemHoverColor:#c3e8fb;
$topbarSearchInputBorderBottomColor:#ffffff;
$topbarSearchInputColor:#ffffff;
/* Footer */
$footerBgColor:#ffffff;
\ No newline at end of file
import React, { Component } from 'react';
export class AppFooter extends Component {
render() {
return (
<div className="layout-footer">
<span className="footer-text" style={{'marginRight': '5px'}}><strong>TMSS</strong> by <strong>ASTRON</strong></span>
</div>
);
}
}
export default AppFooter;
\ No newline at end of file
import React from 'react';
import { render } from '@testing-library/react';
import AppFooter from './AppFooter';
test('renders ASTRON in footer', () => {
const { getByText } = render(<AppFooter />);
const linkElement = getByText("ASTRON");
expect(linkElement).toBeInTheDocument();
});
import React, { Component } from 'react';
import {NavLink} from 'react-router-dom'
import PropTypes from 'prop-types';
import classNames from 'classnames';
class AppSubmenu extends Component {
static defaultProps = {
className: null,
items: null,
onMenuItemClick: null,
root: false,
permissions: null
}
static propTypes = {
className: PropTypes.string,
items: PropTypes.array,
onMenuItemClick: PropTypes.func,
root: PropTypes.bool,
permissions: PropTypes.array
}
constructor(props) {
super(props);
this.state = {activeIndex: null};
}
onMenuItemClick(event, item, index) {
//avoid processing disabled items
if(item.disabled) {
event.preventDefault();
return true;
}
//execute command
if(item.command) {
item.command({originalEvent: event, item: item});
}
if(index === this.state.activeIndex)
this.setState({activeIndex: null});
else
this.setState({activeIndex: index});
if(this.props.onMenuItemClick) {
this.props.onMenuItemClick({
originalEvent: event,
item: item
});
}
}
renderLinkContent(item) {
let submenuIcon = item.items && <i className="pi pi-fw pi-angle-down menuitem-toggle-icon"></i>;
let badge = item.badge && <span className="menuitem-badge">{item.badge}</span>;
return (
<React.Fragment>
<i className={item.icon}></i>
<span>{item.label}</span>
{submenuIcon}
{badge}
</React.Fragment>
);
}
renderLink(item, i) {
let content = this.renderLinkContent(item);
if (item.to) {
return (
<NavLink activeClassName="active-route" to={item.to} onClick={(e) => this.onMenuItemClick(e, item, i)} exact target={item.target}>
{content}
</NavLink>
)
}
else {
return (
<a href={item.url} onClick={(e) => this.onMenuItemClick(e, item, i)} target={item.target}>
{content}
</a>
);
}
}
render() {
let items = this.props.items && this.props.items.map((item, i) => {
let active = this.state.activeIndex === i;
// let styleClass = classNames(item.badgeStyleClass, {'active-menuitem': active && !item.to});
let styleClass = classNames(item.badgeStyleClass, {'active-menuitem': active && item.to});
console.log(item.badgeStyleClass);
console.log(i);
console.log(this.state.activeIndex);
console.log(active);
console.log(styleClass);
return (
<li className={styleClass} key={i}>
{item.items && this.props.root===true && <div className='arrow'></div>}
{this.renderLink(item, i)}
<AppSubmenu items={item.items} onMenuItemClick={this.props.onMenuItemClick}/>
</li>
);
});
return items ? <ul className={this.props.className}>{items}</ul> : null;
}
}
export class AppMenu extends Component {
static defaultProps = {
model: null,
onMenuItemClick: null
}
static propTypes = {
model: PropTypes.array,
onMenuItemClick: PropTypes.func
}
render() {
// console.log(authenticationService.currentUserValue);
return (
<div className={'layout-sidebar layout-sidebar-light'} >
<div className="layout-menu-container">
{/* <AppSubmenu items={this.props.model} permissions={authenticationService.currentUserValue.permissions} className="layout-menu" onMenuItemClick={this.props.onMenuItemClick} root={true}/> */}
<AppSubmenu items={this.props.model} className="layout-menu" onMenuItemClick={this.props.onMenuItemClick} root={true}/>
</div>
</div>
);
}
}
\ No newline at end of file
import React, {Component} from 'react';
import 'primeicons/primeicons.css';
import 'primereact/resources/themes/nova-light/theme.css';
import 'primereact/resources/primereact.css';
import 'primeflex/primeflex.css';
// import { PropTypes } from 'prop-types';
export class AppTopbar extends Component {
// constructor(props) {
// super(props);
// }
// static defaultProps = {
// onToggleMenu: null
// }
// static propTypes = {
// onToggleMenu: PropTypes.func
// }
render() {
return (
<React.Fragment>
<div className="layout-wrapper layout-static layout-static-sidebar-inactive">
<div className="layout-topbar clearfix">
<button className="p-link layout-menu-button"><i className="pi pi-bars"></i></button>
<span className="header-title">TMSS</span>
</div>
</div>
</React.Fragment>
)
}
}
@import "./_variables";
@import "./sass/_layout";
@import "./_overrides";
\ No newline at end of file
.layout-main {
@include transition(margin-left $transitionDuration);
padding: 60px 16px 16px 16px;
min-height: 95vh;
background-color: white;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment