From b6d9b8464e68183cc0f3f79a9ac8ad1f59467bd4 Mon Sep 17 00:00:00 2001 From: Tyler Scaramastro Date: Tue, 16 Nov 2021 10:10:59 -0500 Subject: [PATCH 1/2] removing commented and unused code --- .../java/com/village/rest/DbConnection.java | 18 --- .../com/village/rest/HelloWorldService.java | 20 --- .../java/com/village/rest/WebService.java | 7 - my-app/src/AccountPersonalization.js | 99 +----------- my-app/src/Container.js | 1 - my-app/src/CreateAccount.js | 115 +------------- my-app/src/CreateTask.js | 144 ------------------ my-app/src/ForgotPassword.js | 1 - my-app/src/Form.js | 16 -- my-app/src/Login.js | 10 +- my-app/src/SearchScreen.js | 8 - my-app/src/TaskItems.js | 2 - my-app/src/Tasks.js | 8 - my-app/src/UpdateAccount.js | 20 --- my-app/src/dashboard.js | 7 - my-app/src/index.js | 5 - 16 files changed, 4 insertions(+), 477 deletions(-) delete mode 100644 backend/src/main/java/com/village/rest/HelloWorldService.java delete mode 100644 my-app/src/CreateTask.js diff --git a/backend/src/main/java/com/village/rest/DbConnection.java b/backend/src/main/java/com/village/rest/DbConnection.java index 8681241..dd9ee27 100644 --- a/backend/src/main/java/com/village/rest/DbConnection.java +++ b/backend/src/main/java/com/village/rest/DbConnection.java @@ -15,24 +15,6 @@ public DbConnection() { } public static void main(String[] args) { - /* - try { - Connection connection = DriverManager.getConnection(url, username, password); - System.out.println("Connected successfully"); - String sql = "Call register_parent(?, 'pass1234567890', 'Alyssa', 'Behrend', '30308','GA','Atlanta','77 Ferst Drive', '594-438-8495', 'email@email.com')"; - PreparedStatement statement = connection.prepareStatement(sql); - statement.setString(1, "sbehrend"); - statement.execute(); - ResultSet rs2 = statement.executeQuery("Select username from app_user"); - while ( rs2.next() ) { - String firstName = rs2.getString("username"); - System.out.println(firstName); - } - } catch (Exception e) { - System.out.println("Error"); - e.printStackTrace(); - } - */ } public Connection getConnection() throws SQLException { return DriverManager.getConnection(url, username, password); diff --git a/backend/src/main/java/com/village/rest/HelloWorldService.java b/backend/src/main/java/com/village/rest/HelloWorldService.java deleted file mode 100644 index 5b8588e..0000000 --- a/backend/src/main/java/com/village/rest/HelloWorldService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.village.rest; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.core.Response; - -@Path("hello") -public class HelloWorldService { - - @GET - @Path("/{name}") - public Response getMsg(@PathParam("name") String name) { - - String output = "Welcome : " + name; - - return Response.status(200).entity(output).build(); - - } -} \ No newline at end of file diff --git a/backend/src/main/java/com/village/rest/WebService.java b/backend/src/main/java/com/village/rest/WebService.java index b12a345..d6e30a0 100644 --- a/backend/src/main/java/com/village/rest/WebService.java +++ b/backend/src/main/java/com/village/rest/WebService.java @@ -21,13 +21,6 @@ public class WebService { public static TaskService taskService = new TaskService(); public static Gson g = new Gson(); - // @POST - // @Path("/create") - // @Consumes(MediaType.APPLICATION_JSON) - // @Produces(MediaType.APPLICATION_JSON) - // public void createUser(User user) throws SQLException{ - // userService.createUser(user); - // } // ----------------------------- Account Methods --------------------------------------- @POST @Path("/create") diff --git a/my-app/src/AccountPersonalization.js b/my-app/src/AccountPersonalization.js index 2ac028d..129da03 100644 --- a/my-app/src/AccountPersonalization.js +++ b/my-app/src/AccountPersonalization.js @@ -1,38 +1,17 @@ import React, { useState, Fragment } from "react"; -import { nanoid } from "nanoid"; import './AccountPersonalization.css'; import { Typography } from '@material-ui/core'; import VillageNavBar from './VillageNavBar'; -import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; -import RaisedButton from 'material-ui/RaisedButton'; -import TextField from 'material-ui/TextField'; import {Grid, Paper, Select, Avatar, Button, FormControl, InputLabel} from "@material-ui/core"; import './Login.css'; import { useHistory} from "react-router-dom"; import {Helmet} from 'react-helmet' -import { positions } from '@material-ui/system'; import { makeStyles } from '@material-ui/core/styles'; import AppBar from '@material-ui/core/AppBar'; import Toolbar from '@material-ui/core/Toolbar'; -import Box from "@material-ui/core/Box"; -import MultiThemeProvider from 'material-ui/styles/MuiThemeProvider'; -import LockedOutlinedIcon from '@material-ui/icons/LockOutlined'; -import Table from "@material-ui/core/Table"; -import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; -import TableContainer from "@material-ui/core/TableContainer"; import TableRow from "@material-ui/core/TableRow"; -import MenuItem from '@material-ui/core/MenuItem'; -import { Checkbox } from '@material-ui/core'; -import TimeRangePicker from '@wojtekmaj/react-timerange-picker' -import data from "./mock-data.json"; import Tasks from "./Tasks" -import TaskItems from "./TaskItems"; -import { Container } from './Container'; -import { myDate } from "./Form"; - - - const useStyles = makeStyles((theme) => ({ root: { @@ -81,27 +60,21 @@ container: { account: { }, times: { - - }, profile: { paddingRight: 0, - }, myGrid: { - }, avail: { paddingTop: "10px", }, mytimes: { marginLeft: "25px", - }, myavail: { paddingTop: "60px", }, - })); function AccountPersonalization() { const classes = useStyles(); @@ -110,62 +83,9 @@ function AccountPersonalization() { const fname = history.location.state.get("user").firstName; const lname = history.location.state.get("user").lastName; - const rating = "5.0"; const bio = history.location.state.get("user").bio; - const goToCreateTask = () => history.push('/createtask'); const goToUpdateAccount = () => history.push('/updateaccount', history.location.state); - - - const index = 3; - const [timeRange, setTimeRange] = useState(new Map([["start", ""], ["end", ""]])); - var obj = { - table: [] - }; - const [contacts, setContacts] = useState(data); - const [addFormData, setAddFormData] = useState({ - Row: "", - Day: "", - start: "", - end: "", - }); - const [editFormData, setEditFormData] = useState({ - row: "", - day: "", - start: "", - end: "", - }); - const [editContactId, setEditContactId] = useState(null); - - - const handleAddTime = () => { - - - if (timeRange.get('start').length != 0 && timeRange.get('end').length != 0) { - const newContact = { - row: index, - day: document.getElementById("weekday").value, - start: timeRange.get("start"), - end: timeRange.get("end"), - }; - - const newContacts = [...contacts, newContact]; - setContacts(newContacts); - } - }; - const triggerText = 'Open form'; - const onSubmit = (event) => { - event.preventDefault(event); - console.log(myDate); - - /* - event.preventDefault(event); - console.log(event.target.name.value); - console.log(event.target.mydate.value); - */ - - }; - return (
@@ -190,12 +110,9 @@ function AccountPersonalization() { - - - +

It Takes a Village

- Name: {fname} {lname} Bio: {bio} @@ -220,33 +137,21 @@ function AccountPersonalization() { -

Open Tasks

- -
-
- - - - -
- - + ); } - - export default AccountPersonalization; \ No newline at end of file diff --git a/my-app/src/Container.js b/my-app/src/Container.js index 9bb7085..a4df217 100644 --- a/my-app/src/Container.js +++ b/my-app/src/Container.js @@ -12,7 +12,6 @@ export class Container extends Component { }; closeModal = () => { this.setState({ isShown: false }); - //this.TriggerButton.focus(); this.toggleScrollLock(); }; onKeyDown = (event) => { diff --git a/my-app/src/CreateAccount.js b/my-app/src/CreateAccount.js index 62b9bb7..048e39b 100644 --- a/my-app/src/CreateAccount.js +++ b/my-app/src/CreateAccount.js @@ -12,7 +12,6 @@ import {Helmet} from 'react-helmet' function CreateAccount() { const history = useHistory(); const [tempInfo, setUserInfo] = useState(new Map([["username", ""], ["firstName", ""], ["lastName", ""], ["password", ""], ["conf_password", ""], ["cell", ""], ["email", ""], ["city", ""], ["street", ""], ["state", ""], ["zip", ""], ["type", ""]])); - const [userInfo, setUser2Info] = useState(new Map([["user", ""], ["connections", ""], ["requests", ""]])); const goToLogin = () => history.goBack(); const [errorValue, setErrorValue] = useState("") @@ -44,7 +43,7 @@ function CreateAccount() { } function createUser() { - // ValidateCredentials() + ValidateCredentials() const defaultValues = { "id": 10, "username": "pleasework", @@ -129,115 +128,3 @@ function CreateAccount() { ); } export default CreateAccount; -// // All necessary imports; -// import React, {useState} from 'react'; -// import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; -// import RaisedButton from 'material-ui/RaisedButton'; -// import TextField from 'material-ui/TextField'; -// import {Grid, Paper, Select, Button, FormControl, InputLabel} from "@material-ui/core"; -// import './CreateAccount.css'; -// import { useHistory} from "react-router-dom"; -// import {Alert} from '@mui/material'; -// import {Helmet} from 'react-helmet' - -// function CreateAccount() { -// const history = useHistory(); -// const goToLogin = () => history.goBack(); -// const goToDashboard = () => history.push('/dashboard', history.location.state); - -// const [usernameValue, setUsernameValue] = useState("") -// const [passwordValue, setPasswordValue] = useState("") -// const [confirmPassValue, setConfirmPassValue] = useState("") -// const [firstNameValue, setFirstNameValue] = useState("") -// const [lastNameValue, setLastNameValue] = useState("") -// const [emailValue, setEmailValue] = useState("") -// const [cellValue, setCellValue] = useState("") -// const [streetValue, setStreetValue] = useState("") -// const [cityValue, setCityValue] = useState("") -// const [stateValue, setStateValue] = useState("") -// const [zipValue, setZipValue] = useState("") - -// const [errorValue, setErrorValue] = useState("") - - // function ValidateCredentials() { - // if (usernameValue.length === 0) { - // setErrorValue("Invalid Username.") - // } else if (passwordValue.length === 0) { - // setErrorValue("Invalid Password.") - // } else if (confirmPassValue != passwordValue) { - // setErrorValue("Password and confirm password do not match.") - // } else if (firstNameValue.length === 0) { - // setErrorValue("No first name has been entered.") - // } else if (lastNameValue.length === 0) { - // setErrorValue("No last name has been entered.") - // } else if (emailValue.length === 0) { - // setErrorValue("Invalid email.") - // } else if (cellValue.length === 0) { - // setErrorValue("Invalid cell number.") - // } else if (streetValue.length === 0) { - // setErrorValue("Invalid street.") - // } else if (cityValue.length === 0) { - // setErrorValue("Invalid city.") - // } else if (stateValue.length === 0) { - // setErrorValue("Invalid state.") - // } else if (zipValue.length === 0) { - // setErrorValue("Invalid zip code.") - // } else { - // goToDashboard() - // } - // } - -// return ( -//
-// {errorValue && {errorValue}} -// -// ItTakesAVillage -// -// -// -// -// -//

Create Account

-//
-// setUsernameValue(e.target.value)} label='Username' hintText='Enter Username' required fullWidth/> -// setPasswordValue(e.target.value)} label='Password' hintText='Enter Password' required fullWidth/> -// setConfirmPassValue(e.target.value)} label='Password' hintText='Confirm Password' required fullWidth/> -// setFirstNameValue(e.target.value)} label='First Name' hintText='First Name' required fullWidth/> -// setLastNameValue(e.target.value)} label='Last Name' hintText='Last Name' required fullWidth/> -// setEmailValue(e.target.value)} label='Email' hintText='Email' required fullWidth/> -// setCellValue(e.target.value)} label='Cell' hintText='Cell Number' required fullWidth/> -// setStreetValue(e.target.value)} label='Street' hintText='Street' required fullWidth/> -// setCityValue(e.target.value)} label='City' hintText='City' required fullWidth/> -// setStateValue(e.target.value)} label='State' hintText='State' required fullWidth/> -// setZipValue(e.target.value)} label='Zip' hintText='Zip' required fullWidth/> -// -// Type -// -// -// -// -//
-//
-//
-//
-// ); -// } -// export default CreateAccount; \ No newline at end of file diff --git a/my-app/src/CreateTask.js b/my-app/src/CreateTask.js deleted file mode 100644 index dc80e0f..0000000 --- a/my-app/src/CreateTask.js +++ /dev/null @@ -1,144 +0,0 @@ -import React, { useState } from "react"; -import { makeStyles, Paper, Grid } from '@material-ui/core'; -import Table from "@material-ui/core/Table"; -import TableBody from "@material-ui/core/TableBody"; -import TableCell from "@material-ui/core/TableCell"; -import TableContainer from "@material-ui/core/TableContainer"; -import TableRow from "@material-ui/core/TableRow"; -import InputLabel from '@material-ui/core/InputLabel'; -import MenuItem from '@material-ui/core/MenuItem'; -import FormControl from '@material-ui/core/FormControl'; -import Select from '@material-ui/core/Select'; -import Button from '@material-ui/core/Button'; -import VillageNavBar from './VillageNavBar'; -import { useHistory } from "react-router-dom"; -import Toolbar from '@material-ui/core/Toolbar'; -import { Typography } from '@material-ui/core'; -import AppBar from '@material-ui/core/AppBar'; -import DatePicker from 'react-date-picker'; -import TimePicker from 'react-time-picker' -import moment from 'moment'; -import {$,jQuery} from 'jquery'; -import TimeRangePicker from '@wojtekmaj/react-timerange-picker'; -import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; -import RaisedButton from 'material-ui/RaisedButton'; -import TextField from 'material-ui/TextField'; - - -const useStyles = makeStyles((theme) => ({ - root: { - display: 'flex', - background: 'white', - height:'550px' - }, - toolbar: { - paddingRight: 24, // keep right padding when drawer closed - }, - appBar: { - background: "#0077c0", - zIndex: theme.zIndex.drawer + 1, - transition: theme.transitions.create(['width', 'margin'], { - easing: theme.transitions.easing.sharp, - duration: theme.transitions.duration.leavingScreen, - }), - }, - title: { - flexgrow: 1 - }, - container: { - paddingTop: '80px' - }, - grid: { - padding: theme.spacing(1), - }, - fixedHeight: { - height: 24, - }, - logout: { - marginLeft: "auto", - marginRight: -12 - }, - paper: { - padding: theme.spacing(30), - display: 'flex', - overflow: 'auto', - flexDirection: 'column', - backgroundColor: '#E8E8E8' - }, - table: { - minWidth: 200, - maxWidth: 200, - marginTop: 150, - paddingRight: 100, - marginLeft: 500, - }, -})); - - - -function CreateTask() { - - const classes = useStyles(); - const history = useHistory(); - const goToAccountPersonalization = () => history.push('/accountpersonalization', history.location.state); - const goToLogin = () => history.push('/'); - const [startDate, onChange] = useState(new Date()); - const [value, setValue] = useState([new Date(), new Date()]); - - - return ( -
- - - - It Takes a Village -
- -
-
-
- - -

What Help is Needed?

- - Position - - - -

Select Time Range

-
setValue(value)} - value={value} - />
- -

Select Date

-
- - - - -
-
-
- -
- )} - -export default CreateTask; \ No newline at end of file diff --git a/my-app/src/ForgotPassword.js b/my-app/src/ForgotPassword.js index c39fca9..bcaea7d 100644 --- a/my-app/src/ForgotPassword.js +++ b/my-app/src/ForgotPassword.js @@ -5,7 +5,6 @@ import RaisedButton from 'material-ui/RaisedButton'; import TextField from 'material-ui/TextField'; import {Grid, Paper, Button} from "@material-ui/core"; import { useHistory} from "react-router-dom"; -import './Login.css'; function ForgotPassword() { const history = useHistory(); diff --git a/my-app/src/Form.js b/my-app/src/Form.js index 28bfbd6..3cb3ff4 100644 --- a/my-app/src/Form.js +++ b/my-app/src/Form.js @@ -1,19 +1,12 @@ import React, { useState,Component } from 'react'; -import Button from "@material-ui/core/Button"; import DatePicker from "react-datepicker"; import TimeRangePicker from '@wojtekmaj/react-timerange-picker' import {FormControl} from "@material-ui/core"; import TableRow from "@material-ui/core/TableRow"; import TableCell from "@material-ui/core/TableCell"; -import { Checkbox } from '@material-ui/core'; -import { Typography } from '@material-ui/core'; import "react-datepicker/dist/react-datepicker.css"; -import Dropdown from 'react-dropdown'; import 'react-dropdown/style.css'; import RaisedButton from 'material-ui/RaisedButton'; -import date from "./AccountPersonalization"; -import moment from "moment"; -import Banner from 'react-js-banner'; import alert from 'alert' import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; export var title = ""; @@ -22,10 +15,7 @@ export var end= ""; export var myDate = ""; export var day= new Date(); - - export class Form extends Component { - //

Your time is: {moment(startDate).format("LL")}

constructor(props) { super(props); day = new Date(); @@ -62,12 +52,6 @@ export class Form extends Component { } - onTaskSubmit = () => { - - - //date = moment(startDate).format("LL"); - //console.log(date); - } render() { return ( diff --git a/my-app/src/Login.js b/my-app/src/Login.js index dc461c1..3e3eb95 100644 --- a/my-app/src/Login.js +++ b/my-app/src/Login.js @@ -8,11 +8,7 @@ import {Alert} from '@mui/material'; import LockedOutlinedIcon from '@material-ui/icons/LockOutlined'; import './CreateAccount.css'; import { useHistory, BrowserRouter as Router, Route } from "react-router-dom"; -import ReactDOM from 'react-dom'; -import ForgotPassword from "./ForgotPassword"; -import CreateAccount from "./CreateAccount"; import {Helmet} from 'react-helmet'; -import { green } from '@material-ui/core/colors'; import { makeStyles } from '@material-ui/core/styles'; const useStyles = makeStyles((theme) => ({ @@ -66,8 +62,6 @@ function Login() { } } - // const {fname, lname} = userInfo; - // onClick={() => setUserInfo({fname: "Meg", lname: "K"} return (
{errorValue && {errorValue}} @@ -79,9 +73,7 @@ function Login() { - - - +

It Takes a Village

diff --git a/my-app/src/SearchScreen.js b/my-app/src/SearchScreen.js index 7659eb4..e45eff0 100644 --- a/my-app/src/SearchScreen.js +++ b/my-app/src/SearchScreen.js @@ -1,10 +1,6 @@ import React, { useState } from "react"; import { makeStyles, Paper, Grid } from '@material-ui/core'; -import Table from "@material-ui/core/Table"; -import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; -import TableContainer from "@material-ui/core/TableContainer"; -import TableRow from "@material-ui/core/TableRow"; import InputLabel from '@material-ui/core/InputLabel'; import MenuItem from '@material-ui/core/MenuItem'; import FormControl from '@material-ui/core/FormControl'; @@ -16,13 +12,9 @@ import Toolbar from '@material-ui/core/Toolbar'; import { Typography } from '@material-ui/core'; import AppBar from '@material-ui/core/AppBar'; import DatePicker from 'react-date-picker'; -import TimePicker from 'react-time-picker' -import moment from 'moment'; -import {$,jQuery} from 'jquery'; import TimeRangePicker from '@wojtekmaj/react-timerange-picker'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; import RaisedButton from 'material-ui/RaisedButton'; -import TextField from 'material-ui/TextField'; const useStyles = makeStyles((theme) => ({ diff --git a/my-app/src/TaskItems.js b/my-app/src/TaskItems.js index 100f5a5..a50f3b9 100644 --- a/my-app/src/TaskItems.js +++ b/my-app/src/TaskItems.js @@ -1,7 +1,5 @@ import React, { Component } from "react"; import FlipMove from "react-flip-move"; -import {start, chooseday} from "./AccountPersonalization"; -import {myDate} from "./Form"; class TodoItems extends Component { diff --git a/my-app/src/Tasks.js b/my-app/src/Tasks.js index a81ff85..8534011 100644 --- a/my-app/src/Tasks.js +++ b/my-app/src/Tasks.js @@ -1,7 +1,6 @@ import React, { Component } from "react"; import TaskItems from "./TaskItems"; import "./Tasks.css"; -import FlipMove from "react-flip-move"; import {title, start, end, day} from "./Form"; import moment from "moment"; import { Container } from './Container'; @@ -18,13 +17,6 @@ class Tasks extends Component { } onSubmit = (event) => { event.preventDefault(event); - - - /* - event.preventDefault(event); - console.log(event.target.name.value); - console.log(event.target.mydate.value); - */ }; addItem(e) { var newItem = { diff --git a/my-app/src/UpdateAccount.js b/my-app/src/UpdateAccount.js index c9ee420..2180176 100644 --- a/my-app/src/UpdateAccount.js +++ b/my-app/src/UpdateAccount.js @@ -46,10 +46,6 @@ function UpdateAccount() { } } - const goToAccountPersonalizationChanged = () => { - history.push('/accountpersonalization', user2Info); - } - const [errorValue, setErrorValue] = useState("") const [successValue, setSuccessValue] = useState("") @@ -84,21 +80,6 @@ function UpdateAccount() { function applyUpdates() { // apply account updates here var changed = ValidateCredentials(); - // const defaultValues = { - // "id": history.location.state.get("user").id, - // "username": tempInfo.get("username"), - // "password": "", - // "firstName": tempInfo.get("fname"), - // "lastName": tempInfo.get("lname"), - // "zipcode": tempInfo.get("zip"), - // "state": tempInfo.get("state"), - // "city": tempInfo.get("city"), - // "street": tempInfo.get("street"), - // "cell": tempInfo.get("cell"), - // "email": tempInfo.get("email"), - // "bio": tempInfo.get("bio"), - // "userType": history.location.state.get("user").userType - // }; const id = history.location.state.get("user").id const type = history.location.state.get("user").userType const defaultValues = { @@ -132,7 +113,6 @@ function UpdateAccount() { }) setSuccessValue("Account Information Changed!") } - // goToAccountPersonalizationChanged(); } return (
diff --git a/my-app/src/dashboard.js b/my-app/src/dashboard.js index 46e6e33..fb6ac14 100644 --- a/my-app/src/dashboard.js +++ b/my-app/src/dashboard.js @@ -8,14 +8,11 @@ import VillageNavBar from './VillageNavBar'; import { useHistory } from "react-router-dom"; import './dashboard.css'; import React, { useEffect, useState } from 'react' -import Container from '@material-ui/core/Container' import Grid from '@material-ui/core/Grid' import UserCard from './UserCard' import UserCard2 from './UserCard2' import GridList from '@material-ui/core/GridList'; import GridListTile from '@material-ui/core/GridListTile'; -import { width } from '@mui/system'; - const useStyles = makeStyles((theme) => ({ root: { @@ -79,11 +76,8 @@ function Dashboard() { const history = useHistory(); const goToLogin = () => history.push('/'); //need to define fname as the names which match the search/ want to match/ have already etc. - const fname = 'paige'; let notes2 = [{fname: "Paige", lname: "Thompson", note: "hi"}, {fname: "Bob", lname: "Allen", note: "hi"}, {fname: "Sarah", lname: "Fisher", note: "hi"}, {fname: "Dan", lname: "Brown", note: "hi"}]; - - return (
@@ -136,7 +130,6 @@ function Dashboard() {
- ); } export default Dashboard; diff --git a/my-app/src/index.js b/my-app/src/index.js index fae5232..2c492aa 100644 --- a/my-app/src/index.js +++ b/my-app/src/index.js @@ -12,7 +12,6 @@ import SearchScreen from './SearchScreen'; import ProfileView from './ProfileView'; import SpecificProfileView from './SpecificProfileView'; import SpecificProfileView2 from './SpecificProfileView2'; -import CreateTask from './CreateTask'; import UpdateAccount from './UpdateAccount'; ReactDOM.render( @@ -21,7 +20,6 @@ ReactDOM.render( - @@ -33,7 +31,4 @@ ReactDOM.render( document.getElementById('root') ); -// If you want to start measuring performance in your app, pass a function -// to log results (for example: reportWebVitals(console.log)) -// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals reportWebVitals(); From 8c6e96376c84e50e5b18b517573e9f7d04a5e845 Mon Sep 17 00:00:00 2001 From: Alyssa Behrend Date: Mon, 29 Nov 2021 12:54:05 -0500 Subject: [PATCH 2/2] later cleanup --- .../java/com/village/rest/DbConnection.java | 7 ---- .../com/village/rest/SearchWebService.java | 40 ------------------- my-app/src/UserCard.js | 32 +-------------- my-app/src/UserCard2.js | 32 +-------------- 4 files changed, 4 insertions(+), 107 deletions(-) delete mode 100644 backend/src/main/java/com/village/rest/SearchWebService.java diff --git a/backend/src/main/java/com/village/rest/DbConnection.java b/backend/src/main/java/com/village/rest/DbConnection.java index dd9ee27..c7e2577 100644 --- a/backend/src/main/java/com/village/rest/DbConnection.java +++ b/backend/src/main/java/com/village/rest/DbConnection.java @@ -3,7 +3,6 @@ import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; -import java.sql.Statement;; public class DbConnection { @@ -18,11 +17,5 @@ public static void main(String[] args) { } public Connection getConnection() throws SQLException { return DriverManager.getConnection(url, username, password); - } - - public void callProcedure(String procedureCall) throws SQLException{ - Connection connection = DriverManager.getConnection(url, username, password); - Statement statement = connection.createStatement(); - statement.executeQuery(procedureCall); } } \ No newline at end of file diff --git a/backend/src/main/java/com/village/rest/SearchWebService.java b/backend/src/main/java/com/village/rest/SearchWebService.java deleted file mode 100644 index a784a42..0000000 --- a/backend/src/main/java/com/village/rest/SearchWebService.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.village.rest; - -import java.sql.SQLException; -import java.util.List; - -import javax.websocket.server.PathParam; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import com.google.gson.Gson; - -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) -@Path("/search") -public class SearchWebService { - public static SearchService searchService = new SearchService(); - - @GET - @Path("/{username}") - @Produces(MediaType.APPLICATION_JSON) - public Response automaticSearchForParent(@PathParam("username") String username) throws SQLException { - Gson g = new Gson(); - List volunteers = searchService.automaticSearchForParent(username); - Response response = Response.status(200).entity(g.toJson(volunteers)) - .header("Access-Control-Allow-Origin", "*").build(); - return response; - } - - @GET - @Produces(MediaType.APPLICATION_JSON) - public Response test() { - Gson g = new Gson(); - return Response.status(200).entity(g.toJson("volunteers")) - .header("Access-Control-Allow-Origin", "*").build(); - } -} diff --git a/my-app/src/UserCard.js b/my-app/src/UserCard.js index 0ee0f30..9514e89 100644 --- a/my-app/src/UserCard.js +++ b/my-app/src/UserCard.js @@ -1,27 +1,13 @@ import React from "react"; import { useHistory } from "react-router-dom"; import Card from '@mui/material/Card'; -import CardActions from '@mui/material/CardActions'; -import CardContent from '@mui/material/CardContent'; -import CardMedia from '@mui/material/CardMedia'; -import Button from '@mui/material/Button'; -import Typography from '@mui/material/Typography'; -import CardHeader from '@material-ui/core/CardHeader' -import IconButton from '@material-ui/core/IconButton' -import PageviewIcon from '@material-ui/icons/Pageview'; -import DeleteOutlined from '@material-ui/icons/DeleteOutlined' +import CardHeader from '@material-ui/core/CardHeader'; import RaisedButton from 'material-ui/RaisedButton'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; import { Avatar } from "material-ui"; export default function UserCard({ note, handleDelete }) { const history = useHistory(); - // need to get the values in order to be able to input them into the cars - //I struggled with retrieving those from the database, hence the 'paige thompson's - // const fname = history.location.state.get("fname"); - // const lname = history.location.state.get("lname"); - // const rating = history.location.state.get("rating"); - // const bio = history.location.state.get("bio"); const goToSpecificView = () => history.push('/profileselection', history.location.state); return ( @@ -36,22 +22,8 @@ export default function UserCard({ note, handleDelete }) { action={ - } - - // handleDelete(note.id)}> - // - // onClick={goToSpecificView}> - // - // - - // going to need some type of implementaiton of this button but - // obiosuly not on every single card if they don't have a connection - // action={ - //
diff --git a/my-app/src/UserCard2.js b/my-app/src/UserCard2.js index d16948f..ef3f07d 100644 --- a/my-app/src/UserCard2.js +++ b/my-app/src/UserCard2.js @@ -1,27 +1,13 @@ import React from "react"; import { useHistory } from "react-router-dom"; import Card from '@mui/material/Card'; -import CardActions from '@mui/material/CardActions'; -import CardContent from '@mui/material/CardContent'; -import CardMedia from '@mui/material/CardMedia'; -import Button from '@mui/material/Button'; -import Typography from '@mui/material/Typography'; -import CardHeader from '@material-ui/core/CardHeader' -import IconButton from '@material-ui/core/IconButton' -import PageviewIcon from '@material-ui/icons/Pageview'; -import DeleteOutlined from '@material-ui/icons/DeleteOutlined' +import CardHeader from '@material-ui/core/CardHeader'; import RaisedButton from 'material-ui/RaisedButton'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; import { Avatar } from "material-ui"; export default function UserCard2({ note, handleDelete }) { const history = useHistory(); - // need to get the values in order to be able to input them into the cars - //I struggled with retrieving those from the database, hence the 'paige thompson's - // const fname = history.location.state.get("fname"); - // const lname = history.location.state.get("lname"); - // const rating = history.location.state.get("rating"); - // const bio = history.location.state.get("bio"); const goToSpecificView = () => history.push('/profileselection2', history.location.state); return ( @@ -36,22 +22,8 @@ export default function UserCard2({ note, handleDelete }) { action={ - } - - // handleDelete(note.id)}> - // - // onClick={goToSpecificView}> - // - // - - // going to need some type of implementaiton of this button but - // obiosuly not on every single card if they don't have a connection - // action={ - //