Skip to content

Commit 708e1c6

Browse files
elstonayxmarcuajunusheva
authored
Reactify Frontend for orchestra (#606)
Co-authored-by: Adam Marcus <[email protected]> Co-authored-by: junusheva <[email protected]> Co-authored-by: junusheva <[email protected]>
1 parent cd4758d commit 708e1c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+13477
-3
lines changed

Diff for: .eslintrc.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
module.exports = {
22
"extends": "standard",
3-
"installedESLint": true,
43
"plugins": [
54
"standard",
65
"promise"

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ node_modules
3333

3434
# Testing
3535
*nosetests.xml
36+
37+
# VSCode
38+
.vscode/

Diff for: .yarnrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
save-prefix false
1+
save-prefix ""

Diff for: orchestra/frontend/.env

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SKIP_PREFLIGHT_CHECK=true

Diff for: orchestra/frontend/.eslintrc

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"plugins": [
3+
"@typescript-eslint/eslint-plugin"
4+
],
5+
"extends": ["plugin:@typescript-eslint/recommended", "plugin:react/recommended"],
6+
"parserOptions": {
7+
"project": "tsconfig.json"
8+
},
9+
"overrides": [
10+
{
11+
"files": ["*.ts", "*.tsx"],
12+
"rules": {
13+
"@typescript-eslint/explicit-function-return-type": "off"
14+
}
15+
}
16+
]
17+
}

Diff for: orchestra/frontend/.gitignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*

Diff for: orchestra/frontend/README-CRA.md

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2+
3+
## Available Scripts
4+
5+
In the project directory, you can run:
6+
7+
### `yarn start`
8+
9+
Runs the app in the development mode.<br />
10+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11+
12+
The page will reload if you make edits.<br />
13+
You will also see any lint errors in the console.
14+
15+
### `yarn test`
16+
17+
Launches the test runner in the interactive watch mode.<br />
18+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19+
20+
### `yarn build`
21+
22+
Builds the app for production to the `build` folder.<br />
23+
It correctly bundles React in production mode and optimizes the build for the best performance.
24+
25+
The build is minified and the filenames include the hashes.<br />
26+
Your app is ready to be deployed!
27+
28+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29+
30+
### `yarn eject`
31+
32+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33+
34+
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.
35+
36+
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.
37+
38+
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.
39+
40+
## Learn More
41+
42+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43+
44+
To learn React, check out the [React documentation](https://reactjs.org/).
45+
46+
### Code Splitting
47+
48+
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49+
50+
### Analyzing the Bundle Size
51+
52+
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53+
54+
### Making a Progressive Web App
55+
56+
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57+
58+
### Advanced Configuration
59+
60+
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61+
62+
### Deployment
63+
64+
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65+
66+
### `yarn build` fails to minify
67+
68+
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

Diff for: orchestra/frontend/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## About The Project
2+
3+
This folder contains the new frontend app for Orchestra, created in React.
4+
5+
### Built With
6+
* [create-react-app](https://create-react-app.dev/)
7+
* [TypeScript](https://www.typescriptlang.org/)
8+
* [Redux Toolkit](https://redux-toolkit.js.org/)
9+
10+
## Getting Started
11+
12+
To run this project, use `yarn watch`. The compiled files will be placed in `./orchestra/static/dist2/`.
13+
14+
15+
## Usage
16+
17+
Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.
18+
19+
20+
## Data Modelling with Redux Tookit
21+
22+
We use slices for each feature that requires the state to be saved in Redux. Each slice represents a piece of related information. As an example, the timer slice, where all timer-related actions and and slice information lives in the `/state/slice/timer.ts` file. Selectors will live in the `/state/selectors/` folder.

Diff for: orchestra/frontend/config-overrides.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const path = require('path');
2+
const { override, babelInclude } = require('customize-cra');
3+
4+
module.exports = override(
5+
babelInclude([
6+
// TODO(elstonayx): Remove customize-cra after compiling and exporting metronome as a proper package.
7+
// This temporarily fixes the usage of metronome, as cra does not compile files in node modules, and
8+
// the metronome design system has not been compiled before exporting.
9+
path.resolve('node_modules/@b12/metronome'),
10+
path.resolve('src/')
11+
])
12+
)
13+

Diff for: orchestra/frontend/package.json

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"name": "frontend",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"@b12/metronome": "^1.0.0",
7+
"@reduxjs/toolkit": "1.3.0",
8+
"@testing-library/jest-dom": "^4.2.4",
9+
"@testing-library/react": "^9.3.2",
10+
"@testing-library/user-event": "^7.1.2",
11+
"@types/jest": "^25.1.4",
12+
"@types/node": "^13.9.3",
13+
"@types/react": "^16.9.25",
14+
"@types/react-dom": "^16.9.5",
15+
"@types/react-redux": "7.1.9",
16+
"axios": "0.19.2",
17+
"moment-timezone": "0.5.28",
18+
"node-sass": "4.13.1",
19+
"react": "^16.13.1",
20+
"react-dom": "^16.13.1",
21+
"react-redux": "7.2.0",
22+
"react-router-dom": "5.1.2",
23+
"react-scripts": "3.4.1",
24+
"redux": "4.0.5",
25+
"redux-thunk": "2.3.0",
26+
"typescript": "^3.8.3",
27+
"watch": "^1.0.2"
28+
},
29+
"scripts": {
30+
"start": "react-app-rewired start",
31+
"build": "react-app-rewired build",
32+
"test": "react-scripts test",
33+
"eject": "react-scripts eject",
34+
"watch": "watch 'yarn build' ./src --wait=1"
35+
},
36+
"eslintConfig": {
37+
"extends": "react-app"
38+
},
39+
"browserslist": {
40+
"production": [
41+
">0.2%",
42+
"not dead",
43+
"not op_mini all"
44+
],
45+
"development": [
46+
"last 1 chrome version",
47+
"last 1 firefox version",
48+
"last 1 safari version"
49+
]
50+
},
51+
"homepage": "/static/dist2/",
52+
"devDependencies": {
53+
"@typescript-eslint/eslint-plugin-tslint": "2.25.0",
54+
"customize-cra": "^0.9.1",
55+
"eslint": "6.8.0",
56+
"react-app-rewired": "^2.1.5"
57+
}
58+
}

Diff for: orchestra/frontend/public/favicon.ico

14.7 KB
Binary file not shown.

Diff for: orchestra/frontend/public/index.html

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="An open-source Robotic Process Automation system to orchestrate teams of experts and machines"
11+
/>
12+
<!--
13+
Notice the use of %PUBLIC_URL% in the tags above.
14+
It will be replaced with the URL of the `public` folder during the build.
15+
Only files inside the `public` folder can be referenced from the HTML.
16+
17+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
18+
work correctly both with client-side routing and a non-root public URL.
19+
Learn how to configure a non-root public URL by running `npm run build`.
20+
-->
21+
<title>Orchestra</title>
22+
</head>
23+
<body>
24+
<noscript>You need to enable JavaScript to run this app.</noscript>
25+
<div id="root"></div>
26+
<!--
27+
This HTML file is a template.
28+
If you open it directly in the browser, you will see an empty page.
29+
30+
You can add webfonts, meta tags, or analytics to this file.
31+
The build step will place the bundled scripts into the <body> tag.
32+
33+
To begin the development, run `npm start` or `yarn start`.
34+
To create a production bundle, use `npm run build` or `yarn build`.
35+
-->
36+
</body>
37+
</html>

Diff for: orchestra/frontend/public/shuffle.svg

+21
Loading

Diff for: orchestra/frontend/src/App.scss

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@import "~@b12/metronome/style/base.scss";
2+
3+
.App {
4+
text-align: center;
5+
}
6+
7+
.App-logo {
8+
height: 40vmin;
9+
pointer-events: none;
10+
}

Diff for: orchestra/frontend/src/App.tsx

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React from 'react'
2+
import {
3+
HashRouter as Router,
4+
Switch,
5+
Route,
6+
} from 'react-router-dom'
7+
8+
import Navbar from './components/navbar/Navbar'
9+
import AvailableTasks from './views/available_tasks/AvailableTasks'
10+
import Dashboard from './views/dashboard/Dashboard'
11+
import Task from './views/task/Task'
12+
13+
import './App.scss'
14+
15+
function App () {
16+
return (
17+
<div className="App">
18+
<Router>
19+
<div>
20+
<Navbar />
21+
<Switch>
22+
<Route path="/task/:taskId" children={<Task />} />
23+
<Route path="/project/:projectId?" children={<div>Project management</div>} />
24+
<Route path="/timecard" children={<div>Timecard</div>} />
25+
<Route path="/communication/available-staffing-requests" children={<AvailableTasks />} />
26+
<Route path="/accounts/settings" children={<div>Account settings</div>} />
27+
<Route path="/accounts/logout_then_login" children={<div>Sign out</div>} />
28+
<Route path="/" children={<Dashboard />} />
29+
</Switch>
30+
</div>
31+
</Router>
32+
</div>
33+
);
34+
}
35+
36+
export default App

Diff for: orchestra/frontend/src/assets/AnimatedCircle.scss

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.animated-circle {
2+
-webkit-animation: spin 1s ease infinite;
3+
-moz-animation: spin 1s ease infinite;
4+
animation: spin 3s ease infinite;
5+
}
6+
7+
@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }

Diff for: orchestra/frontend/src/assets/AnimatedCircle.tsx

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react'
2+
import {
3+
RotateForward
4+
} from '@b12/metronome/components/Icons.es6.js'
5+
6+
import './AnimatedCircle.scss'
7+
8+
const AnimatedCircle = () => {
9+
return (
10+
<div className="animated-circle">
11+
<RotateForward />
12+
</div>
13+
)
14+
}
15+
16+
export default AnimatedCircle

Diff for: orchestra/frontend/src/assets/ShuffleIcon.tsx

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React from 'react';
2+
3+
const ShuffleIcon = () => {
4+
return (
5+
<svg width="24px" height="18px" viewBox="0 0 24 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink">
6+
<g id="Dashboard-–-Tabular" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
7+
<g transform="translate(-30.000000, -25.000000)" fill="#695FF6" fill-rule="nonzero" id="Header">
8+
<g>
9+
<g id="Group">
10+
<g transform="translate(30.000000, 23.000000)">
11+
<g id="shuffle-98" transform="translate(0.000000, 2.000000)">
12+
<path d="M0,5 L4.219,5 C5.069,5 5.881,5.362 6.448,5.993 L7.809,7.505 L9.154,6.01 L7.934,4.654 C6.989,3.604 5.635,3 4.219,3 L0,3 L0,5 Z" id="Path"></path>
13+
<path d="M24,4 L19,0 L19,3 L16.781,3 C15.365,3 14.01,3.604 13.065,4.655 L6.448,12.007 C5.881,12.638 5.068,13 4.219,13 L0,13 L0,15 L4.219,15 C5.635,15 6.99,14.396 7.935,13.345 L14.552,5.993 C15.119,5.362 15.932,5 16.781,5 L19,5 L19,8 L24,4 Z" id="Path"></path>
14+
<path d="M24,14 L19,10 L19,13 L16.781,13 C15.931,13 15.119,12.638 14.552,12.007 L13.191,10.495 L11.846,11.99 L13.066,13.345 C14.011,14.397 15.366,15 16.782,15 L19,15 L19,18 L24,14 Z" id="Path"></path>
15+
</g>
16+
</g>
17+
</g>
18+
</g>
19+
</g>
20+
</g>
21+
</svg>
22+
)
23+
}
24+
25+
export default ShuffleIcon

0 commit comments

Comments
 (0)