Skip to content

Commit

Permalink
Merge pull request #19 from michacurri/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
michacurri authored Dec 31, 2020
2 parents 7b006f8 + 2dc6706 commit 8925b7d
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 105 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

.eslintcache
File renamed without changes.
71 changes: 17 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,31 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
# **AERO workorder management tools**

## Available Scripts
AERO is a web application built to control the flow of work in a bicycle service shop.

In the project directory, you can run:

### `npm 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.

### `npm 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.

### `npm run 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.
### Profiles

### `npm run eject`
Profiles can be created by the user, or the administrator. As a user, you have access to create and edit your contact information, and to view workorders attached to your profile.

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
An administrator has access to all profiles, and can create, edit and delete them as required.

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.
### Workorders

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.
Workorders are created by the administrator upon intake of the bicycle. The workorder will set the expectations of work to be performed, at what cost, and for a specific due date.

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.
As a user, only workorders that are attached to your profile will be viewable.

## Learn More
## How to start Aero

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
In the project directory, you can run:

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
### `npm run start:client`

### Deployment
Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
The page will reload if you make edits.<br />
You will also see any lint errors in the console.

### `npm run build` fails to minify
### `npm run start:server`

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
Runs the server, and will automatically update using Nodemon.
60 changes: 10 additions & 50 deletions api/routes/workorderRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,53 +10,21 @@ const { createWorkorder } = require("../controllers/workorderController");
// @route GET/workorders
// @desc Returns all workorders
// @access Public
// router.get("/", async (req, res) => {
// try {
// const workorders = await Workorder.find();
// res.json(workorders);
// } catch (err) {
// res.json({ error: err });
// }
// });
router.get("/", async (req, res) => {
try {
const workorders = await Workorder.find();
res.json(workorders);
} catch (err) {
res.json({ error: err });
}
});

// TODO
// @route POST /workorders
// @route POST /api/workorders
// @desc Add a new workorder
// @access Public
// router.post("/create", async (req, res) => {
// // Create a new workorder from the information entered through req.body
// const {
// // dateIn,
// // dateOut,
// brand,
// model,
// colour,
// // service,
// // status,
// // parts,
// } = req.body;

// const newWorkorder = new Workorder({
// // dateIn,
// // dateOut,
// brand,
// model,
// colour,
// // service,
// // status,
// // parts,
// });
// router.post("/create/:userId", async (req, res) => {

// try {
// const workorder = await newWorkorder.save();
// res.json(workorder);
// } catch (err) {
// res.json({ error: err });
// }
// });

// cut and pasted from profileRoutes.js
// will need to be modified to not push, but create NEW
router
// .use(verifyToken)
.route("/create/:userId")
Expand All @@ -80,7 +48,6 @@ router
return;
}
try {
// const profile = await findProfileById(userId);
const newWorkorder = await createWorkorder({
// profile,
userId,
Expand All @@ -93,18 +60,11 @@ router
// status,
// parts,
});
// console.log(`|||| workorderRoutes:96 "newWorkorder": ${newWorkorder}`);
res.status(200).json({ newWorkorder });
} catch (err) {
console.log(err);
res.status(500).json({ message: "Internal server error" });
}
// try {
// const workorder = await newWorkorder.save();
// res.json(workorder);
// } catch (err) {
// res.json({ error: err });
// }
});

// TODO
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<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="viewport" content="minimum-scale=1, width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="aero workorder management tools"
Expand Down

0 comments on commit 8925b7d

Please sign in to comment.