Skip to content

Instantly share code, notes, and snippets.

@pllearns
Last active January 9, 2017 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pllearns/4b5d91d825a34db20b3832c03ec3b4a0 to your computer and use it in GitHub Desktop.
Save pllearns/4b5d91d825a34db20b3832c03ec3b4a0 to your computer and use it in GitHub Desktop.
Coach-Que MVP-Week
Prepare coach-que for MVP status
- Getting JWT to work without hard code to the console. (idm)
- Check functionality of assigning a new appointment.
- No appointments after hours/weekends.
- Pinging the customer feedback form.
- Final QA of appointment setting and feedback initiation.
- Incorporate coach feedback report.
- Finalize how we want to do feedback/typeform api.
router.get('/coach-schedule', (request, response) => {
const coach_handle = request.idmUser.handle
findAllAppointmentByCoachId(coach_handle)
.then(appointments => {
console.log('Coach Appointments', appointments);
response.json(appointments)
})
})
import React, {Component} from 'react'
import {Card, CardText} from 'material-ui/Card'
import moment from 'moment'
import {Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn} from 'material-ui/Table';
export default class CoachApptList extends Component{
render() {
const coachAppointments = this.props.coachAppointments
const appointmentRows = coachAppointments.sort((apptA, apptB) => {
return moment(apptB.appointment_end) - moment(apptA.appointment_end)})
.map(appointment => {
const startTime = moment(appointment.appointment_start).format('h:mm a')
const endTime = moment(appointment.appointment_end).format('h:mm a')
const apptDate = moment(appointment.appointment_start).format('MMMM Do YYYY')
const mentees = appointment.mentee_handles.join(", ")
return <TableRow>
<TableRowColumn>{mentees}</TableRowColumn>
<TableRowColumn>{appointment.appointment_length}</TableRowColumn>
<TableRowColumn>{apptDate}</TableRowColumn>
<TableRowColumn>{startTime}</TableRowColumn>
<TableRowColumn>{endTime}</TableRowColumn>
</TableRow>
})
return <Table>
<TableHeader displaySelectAll={false}
adjustForCheckbox={false}>
<TableRow>
<TableHeaderColumn>Mentees</TableHeaderColumn>
<TableHeaderColumn>Length</TableHeaderColumn>
<TableHeaderColumn>Date</TableHeaderColumn>
<TableHeaderColumn>Start Time</TableHeaderColumn>
<TableHeaderColumn>End Time</TableHeaderColumn>
</TableRow>
</TableHeader>
<TableBody displayRowCheckbox={false}>{appointmentRows}</TableBody>
</Table>
}
}
import React, {Component} from 'react'
import RaisedButton from 'material-ui/RaisedButton'
import fetchMethod from './fetchMethod'
import {Link} from 'react-router'
import CoachApptList from './CoachApptList'
import ActivateCoach from './ActivateCoach'
export default class CoachLanding extends Component {
constructor() {
super()
this.state = {
coachAppointments:[],
fetchExcuted: false,
clickedOnGoogle: false
}
}
appointmentList() {
const path = '/api/v1/appointments/coach-schedule'
const callback = appointment => {
this.setState({
fetchExcuted: true,
coachAppointments: appointment
})
}
return fetchMethod('GET', path, null).then(callback)
}
renderAppointmentList() {
const coachAppointments = this.state.coachAppointments
return this.state.fetchExcuted
? <CoachApptList coachAppointments={coachAppointments} />
: null
}
clickedOnGoogle() {
this.setState({
clickedOnGoogle: true
})
}
render(){
let button
if(this.state.clickedOnGoogle) {
button = <ActivateCoach />
} else {
button = <Link to="/google/auth" target="_blank">
<RaisedButton label="Login to Google Calendar"
onClick={this.clickedOnGoogle.bind(this)}/>
</Link>
}
return <center>
{button}
<div></div>
<RaisedButton label="See Your Appointments"
onClick={this.appointmentList.bind(this)}
/>
<div>{this.renderAppointmentList()}</div>
</center>
}
}
##USER GUIDE
This is a brief step by step guide to using Coach-Que your way to get coaching assistance during your project cycles at the guild!
We start at the home page. If you are not a coach, go ahead and click on ```Schedule an Appointment```
![ScreenShot](https://farm1.staticflickr.com/723/31835486320_1520480dc1_b.jpg)
Then type in your partner's github user name and click ```request a coach```
![ScreenShot](https://farm1.staticflickr.com/760/32173036566_cb64e2b36c_b.jpg)
Once you request a coach, then you will see a confirmation of your appointment.
![ScreenShot](https://farm1.staticflickr.com/304/32211312845_f13a39c5f4_b.jpg)
You can also see a list of all the appointments that you have scheduled.
![ScreenShot](https://farm1.staticflickr.com/532/31369860194_07ccb33624_c.jpg)
You can also see who is coaching for the day!
![ScreenShot](https://farm1.staticflickr.com/645/31835885380_f9be3cc2c2_b.jpg)
Now, if you are a coach, you start by clicking ```I'm a coach```
![ScreenShot](https://farm1.staticflickr.com/723/31835486320_1520480dc1_b.jpg)
Then you are taken to a landing page, go ahead and click the ```Login to Google Calendar`` button
![ScreenShot](https://farm1.staticflickr.com/448/32173036276_3ce61a21b5_b.jpg)
Then you will be taken to a google calendar auth page, where you will authorize offline access.
![ScreenShot](https://farm1.staticflickr.com/544/32211312565_965b778fa2_b.jpg)
Once you do that, you will be taken to a coach landing page, where you can activate yourself as a coach for the day.
![ScreenShot](https://farm1.staticflickr.com/273/32173036086_30768ef07a_b.jpg)
Once you are ```activated``` then you can see your appointments.
![ScreenShot](https://farm1.staticflickr.com/318/31369859954_ec585e140c_c.jpg)
That's it for now, there are going to be updates very soon, and if you have any issues, please go ahead and send them over by echo, or create an issue on the repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment