Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
62ee79b
create CRUD component for Nonprofit partner
AndresMartin510 May 13, 2021
5c2caec
creating new crud elements for student
AndresMartin510 May 13, 2021
3894324
created visible buggy crud components for student
AndresMartin510 May 13, 2021
aceb4f3
added a comma
AndresMartin510 May 13, 2021
16ee0d7
fixed typos and made donors crud
AndresMartin510 May 19, 2021
e5a7dc6
fixed submit bug
AndresMartin510 May 19, 2021
8666529
added zizos corrections to events crud
AndresMartin510 May 20, 2021
93e4dae
Got donors crud to work
AndresMartin510 May 20, 2021
37eb33c
merged andres-donor-branch-3 with main
AndresMartin510 May 20, 2021
7373a4d
fixed bugs while merging with main
AndresMartin510 May 20, 2021
d4d9e4c
[IN-PROGRESS] Tested out all the new features and created an account,…
ZizoGithub May 21, 2021
144ee8c
Created the form for the user to continue signing up as a program dir…
ZizoGithub May 22, 2021
0d844e0
Added an email input in organizations list
ZizoGithub May 22, 2021
a608c2b
added the application submission page for the user after they finish …
ZizoGithub May 23, 2021
bbad313
Change return button to a Link tag
francisli May 23, 2021
72e337d
Create ProgramDirector record after Organization record is created
francisli May 23, 2021
9a82966
added a logo to register for fairPlay and extra buttons
ZizoGithub May 23, 2021
f278ab4
merged branches
ZizoGithub May 23, 2021
0a689fc
merged branches again
ZizoGithub May 23, 2021
dd73b1b
added small change
ZizoGithub May 23, 2021
1e9e474
Created the home page, added a new logo to our register page, added a…
ZizoGithub May 24, 2021
e8acf24
fixed minor bug causing margin in every page
ZizoGithub May 24, 2021
ee0af56
added link to donor crud in the header of home
AndresMartin510 May 24, 2021
b6ba9e3
added link to donor crud in home header
AndresMartin510 May 24, 2021
4c9d313
fixed donor crud bugs + added stuff
AndresMartin510 May 24, 2021
9eb0286
made FairPlay in header bold and added some minor tweaks to home page
ZizoGithub May 25, 2021
78c1abf
completed the footer to look like figma
ZizoGithub May 25, 2021
1271188
Merge branch 'main' into home-page-design
cesar-ca May 25, 2021
300ae3b
add JSON stringify
cesar-ca May 25, 2021
c3a8570
Merge branch 'main' into andres-donor-branch-3
cesar-ca May 25, 2021
ed18fdb
students and nonprofitpartners added to App.js
cesar-ca May 25, 2021
80ca2d5
Merge branch 'home-page-design' into andres-donor-branch-3
cesar-ca May 25, 2021
f1e0b17
creating the look of the donor sign up and bugs
AndresMartin510 May 26, 2021
62c672c
Merge branch 'andres-donor-branch-3'
AndresMartin510 May 26, 2021
e34ebc8
fixed merge bugs
AndresMartin510 May 26, 2021
d9f818b
Merge branch 'main' into andres-donor-branch-3
AndresMartin510 May 26, 2021
23842b3
tried fixing bugs
AndresMartin510 May 26, 2021
fa60046
Merge branch 'main' into andres-donor-branch-3
cesar-ca May 27, 2021
8d132ff
fix(route for npp list): [FAIR-1]
cesar-ca May 27, 2021
61970f7
fix(student form... ?)
cesar-ca May 27, 2021
5d92b4a
fix(correct naming conventions)
cesar-ca May 27, 2021
3b273de
got the donor form looking presentable
AndresMartin510 May 27, 2021
8e7a915
Merge branch 'andres-donor-branch-3'
AndresMartin510 May 27, 2021
3ac4a8e
Merge branch 'main' of https://github.com/dev-mission/techequity into…
cesar-ca Jul 4, 2021
1f781c9
Merge branch 'andres-donor-branch-3' of https://github.com/dev-missio…
cesar-ca Jul 4, 2021
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
13 changes: 12 additions & 1 deletion client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ import './App.scss';

import {AuthContextProvider, AuthProtectedRoute} from './AuthContext';
import Events from './Events/Events';
import Donors from './Donors/Donors';
import Header from './Header';
import FooterPage from './FooterPage';
import Home from './Home';
import Login from './Login';
import Passwords from './Passwords';
import Register from './Register';
import Students from './Students/Students';
import NonProfitPartners from './NonProfitPartner/NonProfitPartners';
import Donors from './Donors/Donors';
import Organizations from './Organizations/Organizations';
import ProgramDirectors from './ProgramDirectors/ProgramDirectors';
import Setup from './Setup/Setup';
Expand All @@ -37,6 +39,15 @@ function App() {
<Route path="/events">
<Events />
</Route>
<Route path="/students">
<Students />
</Route>
<Route path="/donors">
<Donors />
</Route>
<Route path="/nonprofitpartners">
<NonProfitPartners />
</Route>
<Route path="/organizations">
<Organizations />
</Route>
Expand Down
21 changes: 21 additions & 0 deletions client/src/Donor.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.heading{
color: #212529;
}
.requiredResponse{
color: red;
}
.description{
color: #212529;
}
.form-control{
margin-bottom: 0em;
}
.form{
background: #F8F9FA;
border-radius:24px ;
margin-bottom: 5em;
height: 100%;
}
button{
margin-bottom: 2em;
}
1 change: 0 additions & 1 deletion client/src/Donors/Donors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Route, Switch, useRouteMatch } from "react-router-dom";

import DonorsList from './DonorsList';
import DonorsForm from './DonorsForm';

function Donors() {
const { path } = useRouteMatch();
return (
Expand Down
18 changes: 17 additions & 1 deletion client/src/Donors/DonorsForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Api from "../Api";
function DonorsForm() {
const {id} = useParams();
const history = useHistory();
const [users, setUsers] = useState([]);
const [aDonor, setDonor] = useState({
donorType: '',
companyName: '',
Expand All @@ -19,7 +20,22 @@ function DonorsForm() {
Api.donors.get(id).then((response) => setDonor(response.data));
}
}, []);

useEffect(function () {
Promise.all([Api.users.index()]).then((responses) => {
setUsers(responses[0].data);
if (id) {
Api.donors.get(id).then((response) => setDonor(response.data));
} else {
const newDonor = {
UserId: '',
};
if (responses[0].data.length > 0) {
newDonor.UserId = responses[0].data[0].id;
}
setDonor(newDonor);
}
});
}, [id]);
function onChange(donor) {
const newDonor= {...aDonor};
newDonor[donor.target.name] = donor.target.value;
Expand Down
10 changes: 4 additions & 6 deletions client/src/Donors/DonorsList.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { useAuthContext } from "../AuthContext";
import { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import Api from '../Api';

function DonorsList() {
const { user } = useAuthContext();
const [aDonor, setDonor] = useState([]);

useEffect(function () {
Api.donors.index().then(response => setDonor(response.data));
}, []);
Expand All @@ -26,7 +24,7 @@ function DonorsList() {
return (
<main className="container">
<h1>Donor Setup (Setting up your Profile)</h1>
<p>Hello {user && user.firstName}, thanks for joining FairPlay in our mission to bridge the digital divide. As a Donor, we will need some information from you. Please fill the following form. </p>


{/*
Not needed
Expand All @@ -41,12 +39,12 @@ function DonorsList() {
<ul>
{aDonor.map(s => (
<li>
<p><Link to={`/donors/${s.id}/edit`}>{s.donorType}, {s.webLink}, {s.createdAt}</Link></p>
<p><Link to={`/donors/${s.id}/edit`}>{s.firstName} {s.lastName} is a donor for {s.companyName}</Link></p>
<p><button onClick={() => onDelete(s)} type="button" className="btn btn-sm btn-danger">Delete</button></p>
</li>
))}
</ul>
</main>
);
}
export default DonorsList;
export default DonorsList;
4 changes: 4 additions & 0 deletions client/src/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ function Header() {
<li className="nav-item active">
<Link className="nav-link" aria-current="page" to="/programDirectors">Program Directors List</Link>
</li>
<li className="nav-item active">
<Link className="nav-link" aria-current="page" to="/donors">donors List</Link>
</li>

<div className="flex-grow-1 d-flex justify-content-end">
{user && (
<li className="nav-item">
Expand Down
57 changes: 57 additions & 0 deletions client/src/NonProfitPartner/NonProfitPartnerForm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { useState, useEffect } from "react";
import { useHistory, useParams} from "react-router-dom";
import Api from "../Api";

function NonProfitPartnersForm() {
const {id} = useParams();
const history = useHistory();
const [anNonProfitPartner, setNonProfitPartner] = useState({
directorType: '',
userOrgRole: '',
});

useEffect(function(){
if(id){
Api.nonprofitpartner.get(id).then((response) => setNonProfitPartner(response.data));
}
}, []);

function onChange(nonprofitpartner) {
const newNonProfitPartner= {...anNonProfitPartner};
newNonProfitPartner[nonprofitpartner.target.name] = nonprofitpartner.target.value;
setNonProfitPartner(newNonProfitPartner);
}

async function onSubmit(nonprofitpartner) {
nonprofitpartner.preventDefault();
try {
if(id){
await Api.nonprofitpartners.update(id, anNonProfitPartner);
}else{
await Api.nonprofitpartners.create(anNonProfitPartner);
}
history.push('/nonprofitpartners');
} catch (error) {
console.log(error);
}
}
return (
<main className="container">
<h1>Non-profit-partner Creation Form</h1>
<form onSubmit={onSubmit}>
<div className="mb-3">
<label className="form-label">Non-profit-partner Name</label>
<input className="form-control" type="text" name="directorType" value={anNonProfitPartner.directorType} onChange={onChange} />
</div>
<div className="mb-3">
<label className="form-label">Event Type</label>
<input className="form-control" type="text" name="userOrgRole" value={anNonProfitPartner.userOrgRole} onChange={onChange} />
</div>
<button className="btn btn-primary" type="submit">Submit</button>
</form>
<p>{JSON.stringify(anNonProfitPartner)}</p>
</main>
);
}

export default NonProfitPartnersForm;
39 changes: 39 additions & 0 deletions client/src/NonProfitPartner/NonProfitPartnerList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import Api from '../Api';

function NonProfitPartnersList() {
const [anNonProfitPartner, setNonProfitPartner] = useState([]);

useEffect(function () {
Api.nonprofitpartners.index().then(response => setNonProfitPartner(response.data));
}, []);

function onDelete(anNonProfitPartner){
if(window.confirm(`Are you sure you wish to delete ${anNonProfitPartner.directorType}?`)){
//we will execute code to delete the section
Api.nonprofitpartners.delete(anNonProfitPartner.id).then(function(){
/*Filtering the sections list, keeping every section
that does not match the one we are deleting*/
const newNonProfitPartner = anNonProfitPartner.filter(s => s.id !== anNonProfitPartner.id);
setNonProfitPartner(newNonProfitPartner);
});
}
}

return (
<main className="container">
<h1>NonProfitPartner List</h1>
<Link className="btn btn-primary" to="/nonprofitpartners/new">New</Link>
<ul>
{anNonProfitPartner.map(s => (
<li>
<p><Link to={`/nonprofitpartners/${s.id}/edit`}>{s.directorType}, {s.userOrgRole}</Link></p>
<p><button onClick={() => onDelete(s)} type="button" className="btn btn-sm btn-danger">Delete</button></p>
</li>
))}
</ul>
</main>
);
}
export default NonProfitPartnersList;
24 changes: 24 additions & 0 deletions client/src/NonProfitPartner/NonProfitPartners.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Route, Switch, useRouteMatch } from "react-router-dom";

//import NonProfitPartnerList from './NonProfitPartnerList';
import NonProfitPartnerForm from './NonProfitPartnerForm';

function NonProfitPartners() {
const { path } = useRouteMatch();
return (
<Switch>
<Route exact path={path}>
<NonProfitPartnerList />
</Route>
<Route path={`${path}/new`}>
<NonProfitPartnerForm />
</Route>
<Route path={`${path}/:id/edit`}>
<NonProfitPartnerForm />
</Route>
</Switch>

);
}

export default NonProfitPartners;
1 change: 1 addition & 0 deletions client/src/Register.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function Register() {
<option value="donor">Donor</option>
</select>
</div>

<div className="form-group">
<div className="row">
<div className="col-md-6">
Expand Down
Loading