Skip to content

Commit e7d25a9

Browse files
authored
Merge pull request #33 from testdrivenio/updates
Updates
2 parents e4f2f70 + b64881e commit e7d25a9

38 files changed

+78
-120
lines changed

buildspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 0.2
33
env:
44
variables:
55
AWS_REGION: "us-west-1"
6-
REACT_APP_API_SERVICE_URL: "http://flask-react-alb-1132421372.us-west-1.elb.amazonaws.com"
6+
REACT_APP_API_SERVICE_URL: "http://flask-react-alb-166710978.us-west-1.elb.amazonaws.com"
77

88
phases:
99
pre_build:

services/client/.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
node_modules
22
coverage
33
build
4-
.dockerignore
54
Dockerfile
65
Dockerfile.prod

services/client/.eslintrc.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
{
2-
"parser": "babel-eslint",
2+
"parser": "@babel/eslint-parser",
33
"parserOptions": {
44
"ecmaVersion": 2018,
55
"ecmaFeatures": {
66
"jsx": true
77
},
8-
"sourceType": "module"
8+
"sourceType": "module",
9+
"requireConfigFile": false,
10+
"babelOptions": {
11+
"presets": ["@babel/preset-react"]
12+
}
913
},
1014
"settings": {
1115
"react": {
12-
"version": "16.0"
16+
"version": "17.0"
1317
}
1418
},
1519
"plugins": [

services/client/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pull official base image
2-
FROM node:16-alpine
2+
FROM node:17-alpine
33

44
# set working directory
55
WORKDIR /usr/src/app
@@ -11,7 +11,7 @@ ENV PATH /usr/src/app/node_modules/.bin:$PATH
1111
COPY package.json .
1212
COPY package-lock.json .
1313
RUN npm ci
14-
RUN npm install react-scripts@4.0.3 -g --silent
14+
RUN npm install react-scripts@5.0.0 -g --silent
1515

1616
# start app
1717
CMD ["npm", "start"]

services/client/Dockerfile.prod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
###########
44

55
# pull official base image
6-
FROM node:16-alpine as builder
6+
FROM node:17-alpine as builder
77

88
# set working directory
99
WORKDIR /usr/src/app
@@ -15,7 +15,7 @@ ENV PATH /usr/src/app/node_modules/.bin:$PATH
1515
COPY package.json .
1616
COPY package-lock.json .
1717
RUN npm ci
18-
RUN npm install react-scripts@4.0.3 --silent
18+
RUN npm install react-scripts@5.0.0 --silent
1919

2020

2121
# set environment variables

services/client/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ In the project directory, you can run:
99
### `npm start`
1010

1111
Runs the app in the development mode.\
12-
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
12+
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
1313

14-
The page will reload if you make edits.\
15-
You will also see any lint errors in the console.
14+
The page will reload when you make changes.\
15+
You may also see any lint errors in the console.
1616

1717
### `npm test`
1818

@@ -31,13 +31,13 @@ See the section about [deployment](https://facebook.github.io/create-react-app/d
3131

3232
### `npm run eject`
3333

34-
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
34+
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
3535

36-
If you arent 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.
36+
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.
3737

38-
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 youre on your own.
38+
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.
3939

40-
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
40+
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.
4141

4242
## Learn More
4343

services/client/package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@testing-library/jest-dom": "^5.12.0",
7-
"@testing-library/user-event": "^12.8.3",
8-
"axios": "^0.21.0",
6+
"@testing-library/jest-dom": "^5.16.1",
7+
"@testing-library/user-event": "^13.5.0",
8+
"axios": "^0.24.0",
99
"eslint-config-standard-jsx": "^10.0.0",
10-
"formik": "^2.2.8",
11-
"prop-types": "^15.7.2",
10+
"formik": "^2.2.9",
11+
"prop-types": "^15.8.1",
1212
"react": "^17.0.2",
1313
"react-dom": "^17.0.2",
14-
"react-modal": "^3.13.1",
15-
"react-router-dom": "^5.2.0",
16-
"react-scripts": "4.0.3",
17-
"web-vitals": "^1.1.2",
18-
"yup": "^0.32.9"
14+
"react-modal": "^3.14.4",
15+
"react-router-dom": "^6.2.1",
16+
"react-scripts": "5.0.0",
17+
"web-vitals": "^2.1.2",
18+
"yup": "^0.32.11"
1919
},
2020
"scripts": {
2121
"start": "react-scripts start",
@@ -45,8 +45,8 @@
4545
]
4646
},
4747
"devDependencies": {
48-
"@testing-library/react": "^11.2.7",
49-
"eslint": "^7.27.0",
50-
"prettier": "^2.3.0"
48+
"@testing-library/react": "^12.1.2",
49+
"eslint": "^8.6.0",
50+
"prettier": "^2.5.1"
5151
}
5252
}

services/client/public/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
Learn how to configure a non-root public URL by running `npm run build`.
2626
-->
2727
<title>React App</title>
28-
<link
29-
href="//cdnjs.cloudflare.com/ajax/libs/bulma/0.9.2/css/bulma.min.css"
28+
<link
29+
href="//cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css"
3030
rel="stylesheet"
3131
>
3232
</head>

services/client/src/App.jsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React, { Component } from "react";
22
import axios from "axios";
3-
import { Route, Switch } from "react-router-dom";
3+
import { Route, Routes } from "react-router-dom";
4+
import Modal from "react-modal";
45

5-
import AddUser from "./components/AddUser";
66
import About from "./components/About";
7+
import AddUser from "./components/AddUser";
78
import LoginForm from "./components/LoginForm";
89
import Message from "./components/Message";
9-
import Modal from "react-modal";
1010
import NavBar from "./components/NavBar";
1111
import RegisterForm from "./components/RegisterForm";
1212
import UsersList from "./components/UsersList";
@@ -39,9 +39,9 @@ class App extends Component {
3939
};
4040
}
4141

42-
componentDidMount = () => {
42+
componentDidMount() {
4343
this.getUsers();
44-
};
44+
}
4545

4646
addUser = (data) => {
4747
axios
@@ -191,11 +191,11 @@ class App extends Component {
191191
<div className="columns">
192192
<div className="column is-half">
193193
<br />
194-
<Switch>
194+
<Routes>
195195
<Route
196196
exact
197197
path="/"
198-
render={() => (
198+
element={
199199
<div>
200200
<h1 className="title is-1">Users</h1>
201201
<hr />
@@ -237,42 +237,42 @@ class App extends Component {
237237
isAuthenticated={this.isAuthenticated}
238238
/>
239239
</div>
240-
)}
240+
}
241241
/>
242-
<Route exact path="/about" component={About} />
242+
<Route exact path="/about" element={<About />} />
243243
<Route
244244
exact
245245
path="/register"
246-
render={() => (
246+
element={
247247
<RegisterForm
248248
// eslint-disable-next-line react/jsx-handler-names
249249
handleRegisterFormSubmit={this.handleRegisterFormSubmit}
250250
isAuthenticated={this.isAuthenticated}
251251
/>
252-
)}
252+
}
253253
/>
254254
<Route
255255
exact
256256
path="/login"
257-
render={() => (
257+
element={
258258
<LoginForm
259259
// eslint-disable-next-line react/jsx-handler-names
260260
handleLoginFormSubmit={this.handleLoginFormSubmit}
261261
isAuthenticated={this.isAuthenticated}
262262
/>
263-
)}
263+
}
264264
/>
265265
<Route
266266
exact
267267
path="/status"
268-
render={() => (
268+
element={
269269
<UserStatus
270270
accessToken={this.state.accessToken}
271271
isAuthenticated={this.isAuthenticated}
272272
/>
273-
)}
273+
}
274274
/>
275-
</Switch>
275+
</Routes>
276276
</div>
277277
</div>
278278
</div>

services/client/src/components/LoginForm.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import React from "react";
22
import PropTypes from "prop-types";
33
import { Formik } from "formik";
44
import * as Yup from "yup";
5-
import { Redirect } from "react-router-dom";
5+
import { Navigate } from "react-router-dom";
66

77
import "./form.css";
88

99
const LoginForm = (props) => {
1010
if (props.isAuthenticated()) {
11-
return <Redirect to="/" />;
11+
return <Navigate to="/" replace />;
1212
}
1313
return (
1414
<div>

0 commit comments

Comments
 (0)