Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
fd9db28
Added 404
Leonardo-Duenes Sep 19, 2020
272c405
update 404 page
Leonardo-Duenes Sep 19, 2020
85df71f
update 404 page
Leonardo-Duenes Sep 19, 2020
aa6b87c
cart page
Leonardo-Duenes Sep 25, 2020
432ddf6
added cart page/ download and remove button
Leonardo-Duenes Sep 26, 2020
cf239c3
added download all button
Leonardo-Duenes Oct 24, 2020
e25bc6a
Fixed issue with redux values not being mapped to filters correctly o…
gabriel-flynn Jan 29, 2021
a98db4c
Merge remote-tracking branch 'origin/cart-page' into prepare-for-release
gabriel-flynn Jan 29, 2021
26b1845
Center table
gabriel-flynn Jan 29, 2021
677b930
Added download functionality and remove functionality to the candidat…
gabriel-flynn Jan 29, 2021
96cc47d
Implemented download all functionality and added field for possible f…
gabriel-flynn Jan 29, 2021
05116ba
Fixed the way we check if a user is logged in and moved carousel imag…
gabriel-flynn Jan 29, 2021
cda8127
Add await to fetch statement
gabriel-flynn Jan 29, 2021
9cdd484
Update broken resume links on the demo page
gabriel-flynn Jan 29, 2021
1a57bde
Ran prettier on dummydata file
gabriel-flynn Jan 29, 2021
9c44bfd
Fix error with loading the site when not logged in. Added errors for …
gabriel-flynn Jan 29, 2021
93adb1a
Fix resume urls being saved as http instead of https. Fix some label …
gabriel-flynn Feb 2, 2021
512a468
Fix regex
gabriel-flynn Mar 15, 2021
ed286f3
Add loading indicator while authentication logic is occuring
gabriel-flynn Mar 15, 2021
c86a5ac
Added support for multiple verification codes
gabriel-flynn Mar 28, 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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "resumebook",
"version": "0.1.0",
"version": "1.22.10",
"private": true,
"dependencies": {
"@material-ui/core": "^4.9.14",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.56",
"@reduxjs/toolkit": "^1.3.6",
"file-saver": "^2.0.5",
"query-string": "^6.13.6",
"react": "^16.13.1",
"react-dom": "^16.13.1",
Expand Down
8 changes: 7 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Logout from './routes/logout/index'
import Upload from './routes/upload/index'
import Officer from './routes/officer/index'
import OfficerVerification from './routes/officer/verify'
import Cart from './routes/cart/index'
import NoMatch from './routes/404'
import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles'
import { green } from '@material-ui/core/colors'
Expand Down Expand Up @@ -191,11 +192,16 @@ function App() {
path="/logout"
render={(routerProps) => <Logout {...routerProps} classes={classes} />}
/>
<LoggedInRoute
<Route
exact
path="/upload"
render={(routerProps) => <Upload {...routerProps} classes={classes} />}
/>
<Route
exact
path="/cart"
render={(routeProps) => <Cart {...routeProps} classes={classes} />}
/>
<Route
render={(routerProps) => <NoMatch {...routerProps} classes={classes} />}
/>
Expand Down
18 changes: 10 additions & 8 deletions src/AuthWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { connect } from 'react-redux'
import PropTypes from 'prop-types'
import App from './App'
import React from 'react'
import LoadingIndicator from './components/LoadingIndicator'
import { ENDPOINT } from './utils/config'

// Parent
class AuthWrapper extends React.Component {
constructor(props) {
Expand All @@ -13,21 +16,20 @@ class AuthWrapper extends React.Component {
}

async componentDidMount() {
if (JSON.parse(localStorage.getItem('isLoggedIn')) === true) {
const verificationStatus =
JSON.parse(localStorage.getItem('verified')) === true ? true : false
const officerStatus =
JSON.parse(localStorage.getItem('officer')) === true ? true : false
await this.props.loginSuccess(verificationStatus, officerStatus)
}
await fetch(`${ENDPOINT}/auth/loginStatus`).then(async (res) => {
if (res.status === 200) {
res = await res.json()
await this.props.loginSuccess(res.verified, res.officer)
}
})
this.setState({ authVerified: true })
}

render() {
if (this.state.authVerified) {
return <App />
} else {
return null
return <LoadingIndicator />
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/components/CartNavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import PersonIcon from '@material-ui/icons/Person'
import Typography from '@material-ui/core/Typography'
import './styles/NavBar.sass'
import { withRouter } from 'react-router-dom'

class Cart extends React.Component {
constructor() {
Expand All @@ -12,7 +14,7 @@ class Cart extends React.Component {

render() {
return (
<div id="cart-navbar">
<div id="cart-navbar" onClick={() => this.props.history.push('/cart')}>
<Typography className={this.props.classes.cartText}>
{this.props.numInCart}
</Typography>
Expand All @@ -25,11 +27,12 @@ class Cart extends React.Component {
Cart.propTypes = {
classes: PropTypes.object.isRequired,
numInCart: PropTypes.number.isRequired,
history: PropTypes.any.isRequired,
}

const mapStateToProps = (state) => {
const { numInCart } = state.cart
return { numInCart: numInCart }
}

export default connect(mapStateToProps)(Cart)
export default connect(mapStateToProps)(withRouter(Cart))
97 changes: 97 additions & 0 deletions src/components/CartRow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import React, { useState } from 'react'
import PropTypes from 'prop-types'
import Collapse from '@material-ui/core/Collapse'
import TableCell from '@material-ui/core/TableCell'
import TableRow from '@material-ui/core/TableRow'
import Button from '@material-ui/core/Button'
import DownloadButton from '../components/DownloadButton'
import RemoveButton from '../components/RemoveButton'
import { PDFObject } from 'react-pdfobject'

import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles'
import './Row.css'

const greenTheme = createMuiTheme({
palette: { primary: { 500: '#28a745' } },
})

function ApprovalRow(props) {
const [expanded, setExpanded] = useState(false)

const details = expanded ? (
<TableRow>
<TableCell colSpan={4} id={`u${props.data._id}`}>
<Collapse in={expanded} unmountOnExit={true}>
<PDFObject
url={props.data.resume}
height="500px"
containerId={`u${props.data._id}`}
/>
</Collapse>
</TableCell>
</TableRow>
) : (
<React.Fragment />
)

return (
<React.Fragment>
<TableRow>
<TableCell component="th" scope="row">
{props.data.linkedin ? (
<a
style={{
textDecoration: 'none',
color: 'inherit',
display: 'inline',
}}
target="_blank"
rel="noopener noreferrer"
href={props.data.linkedin}
>
<i
className="fa fa-linkedin-square mr-1"
aria-hidden="true"
style={{
fontSize: '20px',
color: '#0077B5',
}}
></i>{' '}
<p>{props.data.name}</p>
</a>
) : (
<p>{props.data.name}</p>
)}
</TableCell>
<TableCell align="left">
<p>{props.data.major}</p>
</TableCell>
<TableCell align="left">
<p>{props.data.standing}</p>
</TableCell>
<TableCell align="left">
<Button
variant="outlined"
size="medium"
style={{ marginRight: '8px' }}
onClick={() => setExpanded(!expanded)}
color="primary"
>
View
</Button>
<MuiThemeProvider theme={greenTheme}>
<DownloadButton candidate={props.data} />
<RemoveButton candidate={`${props.data}`} />
</MuiThemeProvider>
</TableCell>
</TableRow>
{details}
</React.Fragment>
)
}

ApprovalRow.propTypes = {
data: PropTypes.object.isRequired,
}

export default ApprovalRow
33 changes: 33 additions & 0 deletions src/components/CartSearchBar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react'
import TextField from '@material-ui/core/TextField'
import { filterNameAdd, filterNameDel } from '../redux/actions'
import { useDispatch, useSelector } from 'react-redux'
import PropTypes from 'prop-types'

function CartSearchBar(props) {
const search = useSelector((state) => state.data.search)
const dispatch = useDispatch()

return (
<TextField
id="outlined-basic"
label="Search"
variant="outlined"
value={search}
margin="dense"
className={props.classes.searchBar}
onChange={(e) => {
const updatedSearch = e.target.value
updatedSearch.length > search.length
? dispatch(filterNameAdd(updatedSearch))
: dispatch(filterNameDel(updatedSearch))
}}
/>
)
}

CartSearchBar.propTypes = {
classes: PropTypes.object.isRequired,
}

export default CartSearchBar
Loading