Skip to content
This repository has been archived by the owner on Apr 9, 2022. It is now read-only.

Commit

Permalink
Ref #284 Detailed overview of single event
Browse files Browse the repository at this point in the history
  • Loading branch information
anniegw2 committed Jul 7, 2019
1 parent 70c25e2 commit 6f71d32
Show file tree
Hide file tree
Showing 4 changed files with 189 additions and 78 deletions.
8 changes: 3 additions & 5 deletions frontend/src/components/interviewSectionModular.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ class InterviewSectionModular extends Component {
name="Time Commitment"
id="time-commitment-input"
>
{options.map(option => (
<option value={option.value}>{option.name}</option>
))}
{options.map(option => <option value={option.value}>{option.name}</option>)}
</Input>
)
}
Expand Down Expand Up @@ -96,8 +94,8 @@ class InterviewSectionModular extends Component {
{this.props.type == 'notes'
? null
: this.props.type == 'dropdown'
? this.mapOptionsDropdown(options)
: this.mapOptionsMultipleChoice(options)}
? this.mapOptionsDropdown(options)
: this.mapOptionsMultipleChoice(options)}
{this.props.type != 'notes' && this.props.notesPrompt ? (
<>
<br />
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ var sortByMultipleProperties = function(property1, property2) {
return x[property1][property2] === y[property1][property2]
? 0
: x[property1][property2] > y[property1][property2]
? 1
: -1
? 1
: -1
}
}

Expand Down
109 changes: 109 additions & 0 deletions frontend/src/pages/eventdetails.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import React from 'react'
import { Table, Row, Button, Col, FormGroup, Label, Input, Container } from 'reactstrap'
import ActionButton from '../components/actionButton'
import Nav from '../components/nav'

class Events extends React.Component<Props> {
constructor(props) {
super(props)
this.state = {
events: []
}
}

async componentDidMount() {
// const events = await getEvents() // api call
// if (events !== undefined) {
// this.setState({
// events
// });
// }
// }
this.setState({
events: [
{
name: "Alice's Event",
date: 'July 1',
startTime: 5,
endTime: 7,
location: 'Brew Lab',
attendees: 30,
fbLink: 'https://www.brewlab.coffee/'
}
]
})
}

render() {
return (
<>
<Nav />
<div className="page-content-wrapper">
<Container fluid>
<Table>
<thead>
<h2>Event Name</h2>
<tr>
<th>Date</th>
<th>Start Time</th>
<th>End Time</th>
<th>Location</th>
<th>Total Attendees</th>
<th>Facebook Event Page</th>
<th />
</tr>
</thead>
<tbody>
{this.state.events.map(event => (
<tr>
<td>{event.date}</td>
<td>{event.startTime}</td>
<td>{event.endTime}</td>
<td>{event.location}</td>
<td>{event.attendees}</td>
<td>{event.fbLink}</td>
<td />
</tr>
))}
</tbody>
</Table>
<Table>
<thead>
<h4> Attendees List </h4>
</thead>
<tbody>
<Row style={{ marginBottom: '25px', marginTop: '30px' }}>
<ActionButton text="Strawberry" link="/interviewlist" />
<ActionButton text="Peach" link="/interviewlist" />
<ActionButton text="Mango" link="/interviewlist" />
<ActionButton text="Boba" link="/interviewlist" />
<ActionButton text="Pizza" link="/interviewlist" />
<ActionButton text="Snow" link="/interviewlist" />
<ActionButton text="Mango" link="/interviewlist" />
</Row>
<Row style={{ marginBottom: '25px', marginTop: '30px' }}>
<ActionButton text="Lime" link="/interviewlist" />
<ActionButton text="Orange" link="/interviewlist" />
<ActionButton text="Blueberry" link="/interviewlist" />
<ActionButton text="Hotdog" link="/interviewlist" />
<ActionButton text="Ice Cream" link="/interviewlist" />
<ActionButton text="Sorbet" link="/interviewlist" />
</Row>
<Row style={{ marginBottom: '25px', marginTop: '30px' }}>
<ActionButton text="Durian" link="/interviewlist" />
<ActionButton text="Strawberry" link="/interviewlist" />
<ActionButton text="Raspberry" link="/interviewlist" />
<ActionButton text="Pineapple" link="/interviewlist" />
<ActionButton text="Grapes" link="/interviewlist" />
<ActionButton text="Tomato" link="/interviewlist" />
</Row>
</tbody>
</Table>
</Container>
</div>
</>
)
}
}

export default Events
146 changes: 75 additions & 71 deletions frontend/src/pages/interviewlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,16 @@ class InterviewListPage extends React.Component<Props> {
<h5 style={{ display: 'block' }}>Candidates in {category}</h5>
</Row>
<div className="m-2">
{this.state.interviewingInterviews.map(interview =>
interviewGetCategorySection(interview) !== null &&
interviewGetCategorySection(interview).response.text === category ? (
<li>
<Link href={`/candidate?id=${interview.candidate_id}`}>
{interview.candidate_name}
</Link>
</li>
) : null
{this.state.interviewingInterviews.map(
interview =>
interviewGetCategorySection(interview) !== null &&
interviewGetCategorySection(interview).response.text === category ? (
<li>
<Link href={`/candidate?id=${interview.candidate_id}`}>
{interview.candidate_name}
</Link>
</li>
) : null
)}
</div>
</Container>
Expand All @@ -116,72 +117,75 @@ class InterviewListPage extends React.Component<Props> {
</Row>
) : (
<Row className="candidate-list-box">
{candidates.map(candidate =>
candidate.interviews.length === 0 ? null : (
<>
<CandidateInterviewsModal
isOpen={this.state.modalOpen}
candidateId={candidate._id}
exitModal={this.toggleModal}
candidateName={currentCandidate === undefined ? '' : currentCandidate.name}
/>
<CardCol key={candidate._id}>
<Card className="candidate-card h-100">
<CardTitle style={{ margin: '15px 0 0 0' }}>
{candidate.name ? (
<>
<Link href={{ pathname: '/candidate', query: { id: candidate._id } }}>
<a className="m-3 card-title inline">{candidate.name}</a>
</Link>
<p
className="text-muted"
style={{
float: 'right',
marginBottom: 0,
paddingRight: '5px',
fontSize: '12px'
}}
>
Avg Score: {avgInterviewScore(candidate.interviews)}
<br />
interviews: {candidate.interviews.length}
</p>
</>
) : (
<></>
)}
</CardTitle>
<CardBody>
<p>
<b>Graduating: </b>
{candidate.graduationDate}
</p>
{this.state.interviews
.filter(interview => interview.candidate_id == candidate._id)
.map(interview => (
<div className="pb-1">
<p className="no-buffer">
<b>Interviewer: </b>
{interview.interviewer_name}
{candidates.map(
candidate =>
candidate.interviews.length === 0 ? null : (
<>
<CandidateInterviewsModal
isOpen={this.state.modalOpen}
candidateId={candidate._id}
exitModal={this.toggleModal}
candidateName={currentCandidate === undefined ? '' : currentCandidate.name}
/>
<CardCol key={candidate._id}>
<Card className="candidate-card h-100">
<CardTitle style={{ margin: '15px 0 0 0' }}>
{candidate.name ? (
<>
<Link
href={{ pathname: '/candidate', query: { id: candidate._id } }}
>
<a className="m-3 card-title inline">{candidate.name}</a>
</Link>
<p
className="text-muted"
style={{
float: 'right',
marginBottom: 0,
paddingRight: '5px',
fontSize: '12px'
}}
>
Avg Score: {avgInterviewScore(candidate.interviews)}
<br />
interviews: {candidate.interviews.length}
</p>
<div style={{ paddingLeft: '5px' }}>
</>
) : (
<></>
)}
</CardTitle>
<CardBody>
<p>
<b>Graduating: </b>
{candidate.graduationDate}
</p>
{this.state.interviews
.filter(interview => interview.candidate_id == candidate._id)
.map(interview => (
<div className="pb-1">
<p className="no-buffer">
<i>Category: </i> {interview.category}
<br />
<i>Score: </i> {interview.overall_score}
<b>Interviewer: </b>
{interview.interviewer_name}
</p>
<div style={{ paddingLeft: '5px' }}>
<p className="no-buffer">
<i>Category: </i> {interview.category}
<br />
<i>Score: </i> {interview.overall_score}
</p>
</div>
</div>
</div>
))}
<ActionLink
text="View interviews"
onClick={() => this.toggleModal(candidate._id)}
/>
</CardBody>
</Card>
</CardCol>
</>
)
))}
<ActionLink
text="View interviews"
onClick={() => this.toggleModal(candidate._id)}
/>
</CardBody>
</Card>
</CardCol>
</>
)
)}
</Row>
)}
Expand Down

0 comments on commit 6f71d32

Please sign in to comment.