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

removing commented and unused code #75

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 0 additions & 25 deletions backend/src/main/java/com/village/rest/DbConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;;

public class DbConnection {

Expand All @@ -15,32 +14,8 @@ 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 protected]')";
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);
}

public void callProcedure(String procedureCall) throws SQLException{
Connection connection = DriverManager.getConnection(url, username, password);
Statement statement = connection.createStatement();
statement.executeQuery(procedureCall);
}
}
20 changes: 0 additions & 20 deletions backend/src/main/java/com/village/rest/HelloWorldService.java

This file was deleted.

40 changes: 0 additions & 40 deletions backend/src/main/java/com/village/rest/SearchWebService.java

This file was deleted.

7 changes: 0 additions & 7 deletions backend/src/main/java/com/village/rest/WebService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
99 changes: 2 additions & 97 deletions my-app/src/AccountPersonalization.js
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down Expand Up @@ -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();
Expand All @@ -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 (
<div className={classes.root}>
<AppBar position="fixed" color='primary' className={classes.appBar}>
Expand All @@ -190,12 +110,9 @@ function AccountPersonalization() {
<Grid>
<Paper style={{width: 350, height: 510}} className={classes.paper} >
<Grid className={classes.elems} align='center'>
<Avatar style={{backgroundColor: '#0077c0'}}>

</Avatar>
<Avatar style={{backgroundColor: '#0077c0'}}></Avatar>
<Button>Change Profile Picture</Button>
<h1>It Takes a Village</h1>

<Paper className={classes.paper}>
<Typography align="left">Name: {fname} {lname}</Typography>
<Typography align="left">Bio: {bio}</Typography>
Expand All @@ -220,33 +137,21 @@ function AccountPersonalization() {
</TableCell>
<TableCell align="center" className={classes.myavail} style={{paddingLeft: 0, paddingTop: 85}}>
<Grid style={{paddingRight: 0, paddingLeft: 0}}>

<Paper style={{width: 590, height: 510, paddingLeft: 0, backgroundColor: '#E1EBEE'}} className={classes.times}>
<center><h3 className={classes.avail}>Open Tasks</h3></center>

<Paper className={classes.mytimes} style={{width: 530, height: 412, right: 10, backgroundColor: '#E1EBEE'}}>

<div id="taskcontainer">
<Tasks/>

</div>
<tr></tr>
</Paper>
</Paper>
</Grid>
</TableCell>



</TableRow>
<VillageNavBar page="account"/>

</div>


</div>
);
}



export default AccountPersonalization;
1 change: 0 additions & 1 deletion my-app/src/Container.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export class Container extends Component {
};
closeModal = () => {
this.setState({ isShown: false });
//this.TriggerButton.focus();
this.toggleScrollLock();
};
onKeyDown = (event) => {
Expand Down
Loading