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

jcj-17-retrieve-user-version2 #6

Open
wants to merge 43 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
7b771a4
style: reformated home page code
josecabrerajr7 Jun 25, 2021
bcdc9aa
style: manifest.json
josecabrerajr7 Jun 25, 2021
0eb2930
style: formated code tab 4 size template.css, temlate.js
josecabrerajr7 Jun 25, 2021
eb78ff0
style: formated code and removed react-router-dom because it was neve…
josecabrerajr7 Jun 25, 2021
ea7fbc3
style: formated code and removed react-router-dom because it was neve…
josecabrerajr7 Jun 25, 2021
91c256e
style: formated code and removed react-router-dom because it was neve…
josecabrerajr7 Jun 25, 2021
61febec
style: formated code for login user
josecabrerajr7 Jun 25, 2021
413a418
style: formated code for login
josecabrerajr7 Jun 25, 2021
8ff66f1
style: formated template.js
josecabrerajr7 Jun 25, 2021
c056e87
style: formated main code
josecabrerajr7 Jun 25, 2021
64c622e
style: formated nav code
josecabrerajr7 Jun 25, 2021
1c27d5e
style: formated orderForm.js
josecabrerajr7 Jun 25, 2021
3b4af9a
style: formated viewOrders.js
josecabrerajr7 Jun 25, 2021
93f2335
style: formated application index.js
josecabrerajr7 Jun 25, 2021
22f7936
style: formated authActions.js
josecabrerajr7 Jun 25, 2021
93f9e02
style: formated authReducer.js
josecabrerajr7 Jun 25, 2021
1f6266e
style: formated reducers/index.js
josecabrerajr7 Jun 25, 2021
3d628fa
style: formated reducers/tempReducer.js
josecabrerajr7 Jun 25, 2021
999a404
style: formated redux/store.js
josecabrerajr7 Jun 25, 2021
45d594c
style: formated router/appRouter.js
josecabrerajr7 Jun 25, 2021
33e4a36
style: formated application/src/App.js
josecabrerajr7 Jun 25, 2021
7a56d74
style: formated application/src/App.test.js
josecabrerajr7 Jun 25, 2021
f7738e4
style: formated application/src/index.css
josecabrerajr7 Jun 25, 2021
9d8fcb6
style: formated application/src/index.js
josecabrerajr7 Jun 25, 2021
b0722d1
style: formated application/src/oldApp.css
josecabrerajr7 Jun 25, 2021
6634e59
style: formated application/src/oldApp.js
josecabrerajr7 Jun 25, 2021
cf2ebcd
style: formated application/src/serviceWorker.js
josecabrerajr7 Jun 25, 2021
3976eec
style: order.model.js
josecabrerajr7 Jun 25, 2021
77fb2b4
style: formated auth.routes.js
josecabrerajr7 Jun 25, 2021
0a2d4e9
style: formated public.routes.js
josecabrerajr7 Jun 25, 2021
11b33fb
style: formated index.js
josecabrerajr7 Jun 25, 2021
18edfe6
understanding docker-compose.yml
josecabrerajr7 Jun 25, 2021
5728512
docker file needs to be formated different
josecabrerajr7 Jun 25, 2021
1406921
change exteneded to true
josecabrerajr7 Jun 25, 2021
e3ebf2b
added double quotes
josecabrerajr7 Jun 25, 2021
2be9a96
chore: update dependencies to the latest version
josecabrerajr7 Jun 26, 2021
f275ef6
chore: update docker node version to latest
josecabrerajr7 Jun 26, 2021
7f6a44b
fix: added ipv4 local ip address
josecabrerajr7 Jun 26, 2021
022eb88
chore: updated docker node to latest
josecabrerajr7 Jun 26, 2021
a0ea11d
fixed(tempReducer.js and authReducer.js): Assign arrow function to a …
josecabrerajr7 Jun 26, 2021
6f92dcb
DeprecationWarning: current Server Discovery and Monitoring engine is…
josecabrerajr7 Jun 26, 2021
a2af603
fix: updated my network IPv4
josecabrerajr7 Jun 26, 2021
5398c67
rename item to order_item
josecabrerajr7 Jun 26, 2021
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
2 changes: 1 addition & 1 deletion application/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:11
FROM node:latest

WORKDIR /home/node/application

Expand Down
16 changes: 8 additions & 8 deletions application/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.19.0",
"bootstrap": "^4.3.1",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-redux": "^7.1.0",
"react-router-dom": "^5.0.1",
"react-scripts": "3.0.1",
"redux": "^4.0.1",
"axios": "^0.21.1",
"bootstrap": "^5.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "^7.2.4",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"redux": "^4.1.0",
"redux-thunk": "^2.3.0"
},
"scripts": {
Expand Down
59 changes: 24 additions & 35 deletions application/public/index.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<!--
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>React App</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>
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<!-- 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>React App</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>
26 changes: 13 additions & 13 deletions application/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
24 changes: 12 additions & 12 deletions application/src/App.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import AppRouter from './router/appRouter';
import store from './redux/store';
import './App.css';
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import AppRouter from './router/appRouter';
import store from './redux/store';
import './App.css';

class App extends Component {
render() {
return (
<Provider store={store}>
<AppRouter />
</Provider>
)
}
render() {
return (
<Provider store={store}>
<AppRouter />
</Provider>
)
}
}

export default App;
12 changes: 6 additions & 6 deletions application/src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
});
32 changes: 16 additions & 16 deletions application/src/components/common/template.css
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
.bg-layer {
background: #7A5114;
min-height: 100vh;
width: 100%;
background: #7A5114;
min-height: 100vh;
width: 100%;
}

.fg-layer {
background: #ECEAEA;
min-height: 100vh;
margin-left: 20%;
margin-right: 20%;
background: #ECEAEA;
min-height: 100vh;
margin-left: 20%;
margin-right: 20%;
}

.logo {
display: block;
font-family: "Optima";
font-size: 4em;
padding-left: 20%;
padding-right: 20%;
padding-top: 5%;
text-align: center;
text-decoration: underline;
text-decoration-color: #A43F3F;
display: block;
font-family: "Optima";
font-size: 4em;
padding-left: 20%;
padding-right: 20%;
padding-top: 5%;
text-align: center;
text-decoration: underline;
text-decoration-color: #A43F3F;
}
25 changes: 13 additions & 12 deletions application/src/components/common/template.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import React from 'react';
import { Nav } from '../../components';
import './template.css';
import React from 'react';
import { Nav } from '../../components';
import './template.css';

const Template = props => {
return (
<div className="bg-layer">
<div className="fg-layer">
<label className="logo">Bruce's Diner</label>
<Nav />
{props.children}
</div>
</div>
);
return (
<div className="bg-layer">
<div className="fg-layer">
<label className="logo">Bruce's Diner</label>
{/* display nav component */}
<Nav />
{ props.children }
</div>
</div>
);
}

export default Template;
23 changes: 11 additions & 12 deletions application/src/components/dashboard/dashboard.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import './Dasboard.css';
import { connect } from 'react-redux';
import './Dasboard.css';

const mapStateToProps = state => ({
temp: state.temp
temp: state.temp
});

class Dashboard extends Component {
render() {
console.log('props', this.props);
return (
<div className="main-body">
<h1>Dashboard</h1>
</div>
)
}
render() {
console.log('props from the dashboard', this.props);
return (
<div className="main-body">
<h1>Dashboard</h1>
</div>
)
}
}

export default connect(mapStateToProps, null)(Dashboard);
12 changes: 6 additions & 6 deletions application/src/components/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Login from './login/login';
import Main from './main/main';
import Nav from './nav/nav';
import OrderForm from './order-form/orderForm';
import Template from './common/template';
import ViewOrders from './view-orders/viewOrders';
import Login from './login/login';
import Main from './main/main';
import Nav from './nav/nav';
import OrderForm from './order-form/orderForm';
import Template from './common/template';
import ViewOrders from './view-orders/viewOrders';

export { Login, OrderForm, Main, Nav, Template, ViewOrders };
80 changes: 45 additions & 35 deletions application/src/components/login/login-form/loginForm.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,56 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { loginUser } from '../../../redux/actions/authActions'
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { loginUser } from '../../../redux/actions/authActions'

const mapActionsToProps = dispatch => ({
commenceLogin(email, password) {
dispatch(loginUser(email, password))
}
commenceLogin(email, password) {
dispatch(loginUser(email, password))
}
})

class LoginForm extends Component {
state = {
email: "",
password: "",
}
state = {
email: "",
password: "",
}

login(e) {
e.preventDefault();
this.props.commenceLogin(this.state.email, this.state.password);
this.props.onLogin();
}
login(e) {
e.preventDefault();
this.props.commenceLogin(this.state.email, this.state.password);
this.props.onLogin();
}

onChange(key, val) {
this.setState({ [key]: val });
}
onChange(key, val) {
this.setState({ [key]: val });
}

render() {
return (
<form>
<div className="form-group">
<label htmlFor="inputEmail">Email</label>
<input type="text" className="form-control" placeholder="[email protected]" value={this.state.email} onChange={e => this.onChange('email', e.target.value)}></input>
</div>
<div className="form-group">
<label htmlFor="inputPassword">Password</label>
<input type="password" className="form-control" id="inputPassword" value={this.state.password} onChange={e => this.onChange('password', e.target.value)}></input>
</div>
<div className="d-flex justify-content-center">
<button onClick={e => this.login(e)} type="submit" className="btn btn-primary">Login</button>
</div>
</form>
);
}
render() {
return (
// need form validation form email and password to let user know if they typed in a correct email or if there account exist in the database
<form>
<div className="form-group">
<label htmlFor="inputEmail">Email</label>
<input type="text"
className="form-control"
placeholder="[email protected]"
value={this.state.email}
onChange={e => this.onChange('email', e.target.value)}></input>
</div>
<div className="form-group">
<label htmlFor="inputPassword">Password</label>
<input type="password"
className="form-control"
id="inputPassword"
value={this.state.password}
onChange={e => this.onChange('password', e.target.value)}></input>
</div>
<div className="d-flex justify-content-center">
<button onClick={e => this.login(e)}
type="submit" className="btn btn-primary">Login</button>
</div>
</form>
);
}
}

export default connect(null, mapActionsToProps)(LoginForm);
Loading