Skip to content

Commit d28bc73

Browse files
authored
Merge pull request #127 from Vincent440/development-testing
Development testing
2 parents c0b87f8 + abfe057 commit d28bc73

Some content is hidden

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

65 files changed

+16676
-2430
lines changed

client/package.json

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,22 @@
55
"private": true,
66
"proxy": "http://localhost:3001/",
77
"dependencies": {
8-
"axios": "^0.19.0",
9-
"browserslist": "^4.6.3",
10-
"core-js": "^3.1.4",
11-
"dependency": "0.0.1",
12-
"file-saver": "^2.0.2",
13-
"final-form": "^4.18.2",
8+
"axios": "^0.19.2",
149
"greensock": "^1.20.2",
1510
"gsap": "^2.1.3",
1611
"moment": "^2.24.0",
17-
"react": "^16.8.6",
18-
"react-background-slider": "^1.2.0",
19-
"react-bootstrap": "^1.0.0-beta.9",
12+
"react": "^16.13.1",
13+
"react-background-slider": "^2.0.0",
14+
"react-bootstrap": "^1.3.0",
2015
"react-credit-card-input": "^1.1.5",
21-
"react-dates": "^20.2.5",
2216
"react-day-picker": "^7.3.0",
23-
"react-dom": "^16.8.6",
24-
"react-final-form": "^6.3.0",
25-
"react-fontawesome": "^1.6.1",
17+
"react-dom": "^16.13.1",
2618
"react-grid-system": "^4.4.10",
27-
"react-helmet": "^5.2.1",
28-
"react-image": "^2.1.3",
29-
"react-moment": "^0.9.2",
3019
"react-number-format": "^4.0.8",
31-
"react-open-weather": "^0.4.0",
3220
"react-particles-js": "^2.6.0",
33-
"react-router-dom": "^5.0.1",
34-
"react-scripts": "^3.0.1",
35-
"react-select": "^3.0.4",
36-
"styled-components": "^4.3.2"
21+
"react-router-dom": "^5.2.0",
22+
"react-scripts": "^3.4.1",
23+
"styled-components": "^5.1.1"
3724
},
3825
"scripts": {
3926
"start": "react-scripts start",

client/public/index.html

Lines changed: 23 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,25 @@
11
<!doctype html>
22
<html lang="en">
3-
4-
<head>
5-
<meta charset="utf-8">
6-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7-
<meta name="theme-color" content="#000000">
8-
<!-- Bootstrap CSS -->
9-
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
10-
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
11-
<!-- CDNs for jQuery, Popper.js and Bootstrap JS -->
12-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
13-
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
14-
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
15-
crossorigin="anonymous"></script>
16-
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
17-
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
18-
crossorigin="anonymous"></script>
19-
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.0.2/TweenMax.min.js"></script>
20-
<script src="https://cdn.rawgit.com/progers/pathseg/master/pathseg.js"></script>
21-
<script src="https://cdn.jsdelivr.net/momentjs/2.12.0/moment.min.js"></script>
22-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
23-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/weather-icons/2.0.9/css/weather-icons.min.css"
24-
type="text/css" />
25-
<link href="https://fonts.googleapis.com/css?family=Barlow&display=swap" rel="stylesheet">
26-
<link href="https://fonts.googleapis.com/css?family=Nanum+Myeongjo:700&display=swap" rel="stylesheet">
27-
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
28-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
29-
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
30-
<!-- CDNs for fontawesome -->
31-
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"
32-
integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
33-
<title>Hotel Worx</title>
34-
</head>
35-
36-
<body>
37-
<noscript>
38-
You need to enable JavaScript to run this app.
39-
</noscript>
40-
<div id="root"></div>
41-
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
42-
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
43-
crossorigin="anonymous"></script>
44-
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
45-
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
46-
crossorigin="anonymous"></script>
47-
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
48-
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
49-
crossorigin="anonymous"></script>
50-
</body>
51-
52-
</html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6+
<meta name="theme-color" content="#000000">
7+
<!-- Bootstrap 4.3.1 CSS -->
8+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
9+
<!-- Google Fonts CDNS -->
10+
<link href="https://fonts.googleapis.com/css?family=Nanum+Myeongjo:700&display=swap" rel="stylesheet">
11+
<!-- CDNs for Font Awesome 5.8.2 -->
12+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
13+
<title>Hotel Worx</title>
14+
</head>
15+
<body>
16+
<noscript>
17+
You need to enable JavaScript to run this app.
18+
</noscript>
19+
<div id="root"></div>
20+
<!-- Bootstrap 4.3.1 CDNs for jQuery, Popper.js and Bootstrap JS -->
21+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
22+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
23+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
24+
</body>
25+
</html>

client/src/App.js

Lines changed: 82 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
import React, { Component } from "react";
2-
import { BrowserRouter as Router, Route, Switch, Redirect } from "react-router-dom";
3-
import { Row, Col } from 'react-grid-system';
4-
import Container from "react-bootstrap/Container";
5-
import Particles from "react-particles-js";
6-
import UserContext from "./UserContext";
7-
import InfoPart from "./components/infoPart";
8-
import authapi from "./utils/authapi";
9-
import ReserveNew from "./pages/newreservation/newreservation";
10-
import ReserveUpdate from "./pages/updatereservation/updatereservation";
11-
import Dashboard from "./pages/dashboard/dashboard";
12-
import UpdateReservation from "./pages/allreservations/allreservations";
13-
import Arrivals from "./pages/arrivals/arrivals";
14-
import Billing from "./pages/billing/billing";
15-
import Payment from "./pages/payment/payment";
16-
import Inhouse from "./pages/inhouse/inhouse";
17-
import Login from "./pages/login/login";
18-
import ReservationTest from "./pages/newreservation/reservationTest";
19-
import Housekeeping from "./pages/housekeeping/housekeeping";
20-
import DetailedAvailability from "./pages/detailedAvailability/detailedAvailability";
21-
import HouseStatus from "./pages/houseStatus/houseStatus";
22-
import Maintenance from "./pages/maintenance/maintenance";
1+
import React, { Component } from 'react'
2+
import { BrowserRouter as Router, Route, Switch, Redirect } from 'react-router-dom'
3+
import { Row, Col } from 'react-grid-system'
4+
import Container from 'react-bootstrap/Container'
5+
import Particles from 'react-particles-js'
6+
import UserContext from './UserContext'
7+
import InfoPart from './components/infoPart'
8+
import authapi from './utils/authapi'
9+
import ReserveNew from './pages/newreservation/newreservation'
10+
import ReserveUpdate from './pages/updatereservation/updatereservation'
11+
import Dashboard from './pages/dashboard/dashboard'
12+
import UpdateReservation from './pages/allreservations/allreservations'
13+
import Arrivals from './pages/arrivals/arrivals'
14+
import Billing from './pages/billing/billing'
15+
import Payment from './pages/payment/payment'
16+
import Inhouse from './pages/inhouse/inhouse'
17+
import Login from './pages/login/login'
18+
import ReservationTest from './pages/newreservation/reservationTest'
19+
import Housekeeping from './pages/housekeeping/housekeeping'
20+
import DetailedAvailability from './pages/detailedAvailability/detailedAvailability'
21+
import HouseStatus from './pages/houseStatus/houseStatus'
22+
import Maintenance from './pages/maintenance/maintenance'
2323

24-
const particleOptions = { particles: { number: { value: 120, density: { enable: true, value_area: 1000 } } } };
24+
const particleOptions = { particles: { number: { value: 120, density: { enable: true, value_area: 1000 } } } }
2525

2626
const PrivateAccessRoute = ({ component: Component, aId, ...rest }) => (
2727
<UserContext.Consumer>
@@ -34,102 +34,101 @@ const PrivateAccessRoute = ({ component: Component, aId, ...rest }) => (
3434
) : (
3535
<Redirect
3636
to={{
37-
pathname: "/",
37+
pathname: '/',
3838
state: { from: props.location }
3939
}}
4040
/>
41-
)
42-
}
41+
)}
4342
/>
4443
)}
4544
</UserContext.Consumer>
46-
);
45+
)
4746

4847
class App extends Component {
49-
constructor(props) {
50-
super(props);
48+
constructor (props) {
49+
super(props)
5150
this.postUserLogin = userData => {
5251
if (userData) {
5352
authapi.postUserLogin(userData, (err, res) => {
5453
if (err === true) {
55-
return console.log("Failed to log in");
54+
return console.log('Failed to log in')
5655
}
57-
this.setState({ user: res.user });
58-
});
56+
this.setState({ user: res.user })
57+
})
5958
}
60-
};
59+
}
6160
this.getUserLogout = event => {
62-
event.preventDefault();
63-
authapi.getLoggedOut().then(this.getUserStatus);
64-
};
61+
event.preventDefault()
62+
authapi.getLoggedOut().then(this.getUserStatus)
63+
}
6564
this.getUserStatus = () => {
6665
authapi.getLoginStatus().then(res => {
6766
if (res) {
68-
this.setState(()=>(
67+
this.setState(() => (
6968
{ user: res.user }
70-
)
71-
);
69+
)
70+
)
7271
}
73-
});
74-
};
72+
})
73+
}
7574
this.state = {
7675
user: {
7776
access_id: 0,
78-
type: "Guest",
77+
type: 'Guest',
7978
user_id: 0,
80-
username: "guest"
79+
username: 'guest'
8180
},
8281
getUserStatus: this.getUserStatus,
8382
getUserLogout: this.getUserLogout,
8483
postUserLogin: this.postUserLogin
85-
};
84+
}
8685
}
87-
render() {
88-
let { user } = this.state;
86+
87+
render () {
88+
const { user } = this.state
8989
return (
9090
<UserContext.Provider value={this.state}>
91-
<Router>
92-
{ user.access_id === 0 ? (
91+
<Router>
92+
{user.access_id === 0 ? (
9393
<div>
94-
<Redirect to="/" />
94+
<Redirect to='/' />
9595
<Login />
96-
</div> ) :
97-
(
98-
<Container className="m-0 p-0">
99-
<Particles params={particleOptions} />
100-
<Row className="m-0 py-2">
101-
<Col xs={6} sm={4} md={3} lg={3} xl={2} >
102-
<Row className="pt-3"><span></span></Row>
96+
</div>)
97+
: (
98+
<Container className='m-0 p-0'>
99+
<Particles params={particleOptions} />
100+
<Row className='m-0 py-2'>
101+
<Col xs={6} sm={4} md={3} lg={3} xl={2}>
102+
<Row className='pt-3'><span /></Row>
103103
<InfoPart />
104-
</Col>
105-
<Col xs={6} sm={8} md={9} lg={9} xl={10}>
106-
<Row className="pt-3"><span></span></Row>
107-
<div className="pl-2 m-0 py-0">
108-
<Switch>
109-
<PrivateAccessRoute exact strict path="/" component={Dashboard} aId="1" />
110-
<PrivateAccessRoute exact path="/reserve/new" component={ReserveNew} aId="1" />
111-
<PrivateAccessRoute exact path="/reserve/allreservations" component={UpdateReservation} aId="1" />
112-
<PrivateAccessRoute exact path="/reserve/testUpdatereservation" component={ReserveUpdate} aId="1" />
113-
<PrivateAccessRoute exact path="/reserve/testreservation" component={ReservationTest} aId="1" />
114-
<PrivateAccessRoute exact path="/frontdesk/arrivals" component={Arrivals} aId="1" />
115-
<PrivateAccessRoute exact path="/frontdesk/inhouse" component={Inhouse} aId="1" />
116-
<PrivateAccessRoute exact path="/frontdesk/maintenance" component={Maintenance} aId="1" />
117-
<PrivateAccessRoute exact path="/cashiering/billing" component={Billing} aId="1" />
118-
<PrivateAccessRoute exact path="/cashiering/payment" component={Payment} aId="1" />
119-
<PrivateAccessRoute exact path="/reports/housekeeping" component={Housekeeping} aId="1" />
120-
<PrivateAccessRoute exact path="/reports/detailedAvailability" component={DetailedAvailability} aId="1" />
121-
<PrivateAccessRoute exact path="/reports/houseStatus" component={HouseStatus} aId="1" />
122-
</Switch>
123-
</div>
124-
</Col>
125-
</Row>
126-
</Container>
127-
)
128-
}
104+
</Col>
105+
<Col xs={6} sm={8} md={9} lg={9} xl={10}>
106+
<Row className='pt-3'><span /></Row>
107+
<div className='pl-2 m-0 py-0'>
108+
<Switch>
109+
<PrivateAccessRoute exact strict path='/' component={Dashboard} aId='1' />
110+
<PrivateAccessRoute exact path='/reserve/new' component={ReserveNew} aId='1' />
111+
<PrivateAccessRoute exact path='/reserve/allreservations' component={UpdateReservation} aId='1' />
112+
<PrivateAccessRoute exact path='/reserve/testUpdatereservation' component={ReserveUpdate} aId='1' />
113+
<PrivateAccessRoute exact path='/reserve/testreservation' component={ReservationTest} aId='1' />
114+
<PrivateAccessRoute exact path='/frontdesk/arrivals' component={Arrivals} aId='1' />
115+
<PrivateAccessRoute exact path='/frontdesk/inhouse' component={Inhouse} aId='1' />
116+
<PrivateAccessRoute exact path='/frontdesk/maintenance' component={Maintenance} aId='1' />
117+
<PrivateAccessRoute exact path='/cashiering/billing' component={Billing} aId='1' />
118+
<PrivateAccessRoute exact path='/cashiering/payment' component={Payment} aId='1' />
119+
<PrivateAccessRoute exact path='/reports/housekeeping' component={Housekeeping} aId='1' />
120+
<PrivateAccessRoute exact path='/reports/detailedAvailability' component={DetailedAvailability} aId='1' />
121+
<PrivateAccessRoute exact path='/reports/houseStatus' component={HouseStatus} aId='1' />
122+
</Switch>
123+
</div>
124+
</Col>
125+
</Row>
126+
</Container>
127+
)}
129128
</Router>
130129
</UserContext.Provider>
131-
);
130+
)
132131
}
133132
}
134133

135-
export default App;
134+
export default App

client/src/App.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React from "react";
2-
import ReactDOM from "react-dom";
3-
import App from "./App";
1+
import React from 'react'
2+
import ReactDOM from 'react-dom'
3+
import App from './App'
44

5-
it("renders without crashing", () => {
6-
const div = document.createElement("div");
7-
ReactDOM.render(<App />, div);
8-
});
5+
it('renders without crashing', () => {
6+
const div = document.createElement('div')
7+
ReactDOM.render(<App />, div)
8+
})

client/src/UserContext.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import React from "react";
1+
import React from 'react'
22

33
// Make sure the shape of the default value passed to
44
// createContext matches the shape that the consumers expect!
55
const UserContext = React.createContext({
66
user: {
77
access_id: 0,
8-
type: "Guest",
8+
type: 'Guest',
99
user_id: 0,
10-
username: "guest"
10+
username: 'guest'
1111
},
1212
getUserStatus: () => {},
1313
postUserLogin: () => {},
14-
getUserLogout: () => {},
15-
});
16-
export default UserContext;
14+
getUserLogout: () => {}
15+
})
16+
export default UserContext

0 commit comments

Comments
 (0)