From c1b6ba67e283ee5ce12bc8cfcae04ab76aeb75ef Mon Sep 17 00:00:00 2001 From: istott Date: Fri, 4 Dec 2020 00:27:31 -0700 Subject: [PATCH] feat: clean up code, delete console logs update libraries and dependencies, clean up warnings in console. --- wmp/package-lock.json | 92 ++++++++++++++++---------- wmp/package.json | 8 +-- wmp/src/actions/PlantAction.js | 1 - wmp/src/components/AddPlantPage.js | 7 +- wmp/src/components/LoginForm.js | 1 - wmp/src/components/NavBar.js | 3 +- wmp/src/components/PlantCard.js | 1 - wmp/src/components/PlantCardList.js | 7 +- wmp/src/components/RegistrationForm.js | 1 - 9 files changed, 67 insertions(+), 54 deletions(-) diff --git a/wmp/package-lock.json b/wmp/package-lock.json index 7b18821a..89fd5446 100644 --- a/wmp/package-lock.json +++ b/wmp/package-lock.json @@ -4589,9 +4589,9 @@ "integrity": "sha512-IdbjgCEqDvcU/1kUQa6C49I2NZOY3SBmU9Eus7mdFdJJBqn0Lg1Epfi/T4nqVcxTNBEGhcjwMhY1EysMBsXZrw==" }, "elliptic": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", - "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", "requires": { "bn.js": "^4.4.0", "brorand": "^1.0.1", @@ -7766,9 +7766,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" }, "lodash-es": { "version": "4.17.15", @@ -8316,9 +8316,9 @@ } }, "node-forge": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.0.tgz", - "integrity": "sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==" + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==" }, "node-int64": { "version": "0.4.0", @@ -10118,9 +10118,9 @@ } }, "property-expr": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/property-expr/-/property-expr-2.0.2.tgz", - "integrity": "sha512-bc/5ggaYZxNkFKj374aLbEDqVADdYaLcFo8XBkishUWbaAdjlphaBFns9TvRA2pUseVL/wMFmui9X3IdNDU37g==" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/property-expr/-/property-expr-2.0.4.tgz", + "integrity": "sha512-sFPkHQjVKheDNnPvotjQmm3KD3uk1fWKUN7CrpdbwmUx3CrG3QiM8QpTSimvig5vTXmTvjz7+TDvXOI9+4rkcg==" }, "proxy-addr": { "version": "2.0.6", @@ -10279,9 +10279,9 @@ } }, "react": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react/-/react-16.13.1.tgz", - "integrity": "sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==", + "version": "16.14.0", + "resolved": "https://registry.npmjs.org/react/-/react-16.14.0.tgz", + "integrity": "sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", @@ -10535,9 +10535,9 @@ } }, "react-dom": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.13.1.tgz", - "integrity": "sha512-81PIMmVLnCNLO/fFOQxdQkvEq/+Hfpv24XNJfpyZhTRfO0QcmQIF/PgCa1zCOj2w1hrn12MFLyaJ/G0+Mxtfag==", + "version": "16.14.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.14.0.tgz", + "integrity": "sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", @@ -10556,15 +10556,25 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "react-redux": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.0.tgz", - "integrity": "sha512-EvCAZYGfOLqwV7gh849xy9/pt55rJXPwmYvI4lilPM5rUT/1NxuuN59ipdBksRVSvz0KInbPnp4IfoXJXCqiDA==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.2.tgz", + "integrity": "sha512-8+CQ1EvIVFkYL/vu6Olo7JFLWop1qRUeb46sGtIMDCSpgwPQq8fPLpirIB0iTqFe9XYEFPHssdX8/UwN6pAkEA==", "requires": { - "@babel/runtime": "^7.5.5", - "hoist-non-react-statics": "^3.3.0", + "@babel/runtime": "^7.12.1", + "hoist-non-react-statics": "^3.3.2", "loose-envify": "^1.4.0", "prop-types": "^15.7.2", - "react-is": "^16.9.0" + "react-is": "^16.13.1" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", + "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", + "requires": { + "regenerator-runtime": "^0.13.4" + } + } } }, "react-router": { @@ -11306,11 +11316,11 @@ "integrity": "sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=" }, "selfsigned": { - "version": "1.10.7", - "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.7.tgz", - "integrity": "sha512-8M3wBCzeWIJnQfl43IKwOmC4H/RAp50S8DF60znzjW5GVqTcSe2vWclt7hmYVPkKPlHWOu5EaWOMZ2Y6W8ZXTA==", + "version": "1.10.8", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.8.tgz", + "integrity": "sha512-2P4PtieJeEwVgTU9QEcwIRDQ/mXJLX8/+I3ur+Pg16nS8oNbrGxEso9NyYWy8NAmXiNl4dlAp5MwoNeCWzON4w==", "requires": { - "node-forge": "0.9.0" + "node-forge": "^0.10.0" } }, "semver": { @@ -12277,9 +12287,9 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" }, "synchronous-promise": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/synchronous-promise/-/synchronous-promise-2.0.13.tgz", - "integrity": "sha512-R9N6uDkVsghHePKh1TEqbnLddO2IY25OcsksyFp/qBe7XYd0PVbKEWxhcdMhpLzE1I6skj5l4aEZ3CRxcbArlA==" + "version": "2.0.15", + "resolved": "https://registry.npmjs.org/synchronous-promise/-/synchronous-promise-2.0.15.tgz", + "integrity": "sha512-k8uzYIkIVwmT+TcglpdN50pS2y1BDcUnBPK9iJeGu0Pl1lOI8pD6wtzgw91Pjpe+RxtTncw32tLxs/R0yNL2Mg==" }, "table": { "version": "5.4.6", @@ -14033,17 +14043,27 @@ } }, "yup": { - "version": "0.29.1", - "resolved": "https://registry.npmjs.org/yup/-/yup-0.29.1.tgz", - "integrity": "sha512-U7mPIbgfQWI6M3hZCJdGFrr+U0laG28FxMAKIgNvgl7OtyYuUoc4uy9qCWYHZjh49b8T7Ug8NNDdiMIEytcXrQ==", + "version": "0.29.3", + "resolved": "https://registry.npmjs.org/yup/-/yup-0.29.3.tgz", + "integrity": "sha512-RNUGiZ/sQ37CkhzKFoedkeMfJM0vNQyaz+wRZJzxdKE7VfDeVKH8bb4rr7XhRLbHJz5hSjoDNwMEIaKhuMZ8gQ==", "requires": { - "@babel/runtime": "^7.9.6", + "@babel/runtime": "^7.10.5", "fn-name": "~3.0.0", "lodash": "^4.17.15", "lodash-es": "^4.17.11", "property-expr": "^2.0.2", - "synchronous-promise": "^2.0.10", + "synchronous-promise": "^2.0.13", "toposort": "^2.0.2" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", + "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", + "requires": { + "regenerator-runtime": "^0.13.4" + } + } } } } diff --git a/wmp/package.json b/wmp/package.json index 5930349f..f2095598 100644 --- a/wmp/package.json +++ b/wmp/package.json @@ -7,14 +7,14 @@ "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^7.1.2", "axios": "^0.19.2", - "react": "^16.13.1", - "react-dom": "^16.13.1", - "react-redux": "^7.2.0", + "react": "^16.14.0", + "react-dom": "^16.14.0", + "react-redux": "^7.2.2", "react-router-dom": "^5.2.0", "react-scripts": "3.4.1", "redux": "^4.0.5", "redux-thunk": "^2.3.0", - "yup": "^0.29.1" + "yup": "^0.29.3" }, "scripts": { "start": "react-scripts start", diff --git a/wmp/src/actions/PlantAction.js b/wmp/src/actions/PlantAction.js index 11c0512f..08bb0447 100644 --- a/wmp/src/actions/PlantAction.js +++ b/wmp/src/actions/PlantAction.js @@ -14,7 +14,6 @@ export const getPlant = userId => dispatch => { axiosWithAuth() .get(`/api/plants/`) .then(res => { - console.log('get', res) dispatch({ type: FETCH_PLANT_SUCCESS, payload: res.data }); }) .catch(error => diff --git a/wmp/src/components/AddPlantPage.js b/wmp/src/components/AddPlantPage.js index b27efd6c..afe07db8 100644 --- a/wmp/src/components/AddPlantPage.js +++ b/wmp/src/components/AddPlantPage.js @@ -35,18 +35,18 @@ const AddPlant = props => { const handleSelectChanges = e => { const valueSelected = e.target.value; setPlant({ ...plant, [e.target.name]: valueSelected }); - console.log('fluffy', e.target.name, valueSelected, plant); + }; const handleChanges = e => { setPlant({ ...plant, [e.target.name]: e.target.value }); - console.log(plant); + }; const submitForm = e => { e.preventDefault(); - console.log(plant); + if(props.isEditing === true){ props.editPlant(props.plantToEdit.id, plant) @@ -55,7 +55,6 @@ const AddPlant = props => { axiosWithAuth() .post(`/api/plants/`, plant) .then(res => { - console.log(res) history.push("/home"); }) .catch(err => console.log(err)); diff --git a/wmp/src/components/LoginForm.js b/wmp/src/components/LoginForm.js index 76aba638..c1d2eb2c 100644 --- a/wmp/src/components/LoginForm.js +++ b/wmp/src/components/LoginForm.js @@ -32,7 +32,6 @@ const LoginForm = (props) => { axiosWithAuth() .post('/api/auth/login', userCredentials) .then(res => { - console.log(res); props.setUserId(res.data.id); window.localStorage.setItem("token", res.data.token); window.localStorage.setItem("userId", res.data.id); diff --git a/wmp/src/components/NavBar.js b/wmp/src/components/NavBar.js index 05f3d8d0..63defaf2 100644 --- a/wmp/src/components/NavBar.js +++ b/wmp/src/components/NavBar.js @@ -20,7 +20,6 @@ const Navbar = () => { axiosWithAuth() .get('/api/user') .then(res => { - console.log('getuser', res.data.username) setName(res.data.username) }) .catch(err => console.log(err)) @@ -41,7 +40,7 @@ const Navbar = () => {

Water My Plants

-

Welcome {name}
🥝

+

Welcome {name}
🥝

diff --git a/wmp/src/components/PlantCard.js b/wmp/src/components/PlantCard.js index 0f0d4877..c4a94046 100644 --- a/wmp/src/components/PlantCard.js +++ b/wmp/src/components/PlantCard.js @@ -18,7 +18,6 @@ import { getPlant, deletePlant, startEdit } from '../actions/PlantAction' const PlantCard = props => { - // console.log('plantcardy', props) const {push} = useHistory(); diff --git a/wmp/src/components/PlantCardList.js b/wmp/src/components/PlantCardList.js index 70251ef4..7a38cc1c 100644 --- a/wmp/src/components/PlantCardList.js +++ b/wmp/src/components/PlantCardList.js @@ -8,7 +8,6 @@ import { connect } from 'react-redux'; import { getPlant } from '../actions/PlantAction' const PlantCardList = props => { - console.log('plantcardlist', props) return (
@@ -22,13 +21,13 @@ const PlantCardList = props => { ))}
- : (

No Plants 🌱

)} + : (

No Plants 🌱

)}
) : ( -

Fetching Plants ... 🌱

+

Fetching Plants ... 🌱

) ) : ( -

Welcome! Add A Plant To Begin 🌱

+

Welcome! Add A Plant To Begin 🌱

)}
); diff --git a/wmp/src/components/RegistrationForm.js b/wmp/src/components/RegistrationForm.js index 884132f0..32b9f7b1 100644 --- a/wmp/src/components/RegistrationForm.js +++ b/wmp/src/components/RegistrationForm.js @@ -58,7 +58,6 @@ const RegistrationForm = (props) => { axiosWithAuth() .post('/api/auth/register', userCredentials) .then(res => { - console.log(res) history.push("/"); }) .catch( err => console.log(err) );