Conversation
* adds multiple admin accounts * corrects variables * changes bootscript
* changes apt request approve function * changes aptRequests
* changes apt request approve function * changes aptRequests * changes time to display correctly in admin availability
* saving current stuff * made individual instructor pages and created e2e tests * made some changes to the circle config * changed start script * changed start script * added run build in the test script * imported moment package * made changes to nightmare test, created a student user, made changes individaul instructors components * added nightmare tests and deletes requested options from state * saving current stuff * made individual instructor pages and created e2e tests * made some changes to the circle config * changed start script * changed start script * added run build in the test script * imported moment package * made changes to nightmare test, created a student user, made changes individaul instructors components * added nightmare tests and deletes requested options from state
* adds multiple admin accounts * corrects variables * changes bootscript * Adds remove appointment on pending apppointment * adds instructor availability delete functionality * Deletes Slot and send email to pending request students * Fixes delete button * fixes delete button * fixes merge conflicts * adds instructor availability delete functionality * fixes merge conflict * Fixes delete button * fixes merge conflict * Adds remove appointment on pending apppointment * adds instructor availability delete functionality * Deletes Slot and send email to pending request students * Fixes delete button * fixes delete button * fixes merge conflicts * adds instructor availability delete functionality * fixes merge conflict * fixes instructor names * fixes merge conflict
* adds multiple admin accounts * corrects variables * changes bootscript * Sends instructor email on appointment request * Setting up google calendar * Merging conflicts * Merging conflicts * Routing api code to remote method * Routing api code to remote method * adds token to user model * Adds token to user model * Gets auth token for admin when logging in * fixes authorize * sets auth tokens to user models and refreshes token on login * Sends instructor email on appointment request * Setting up google calendar * Merging conflicts * Merging conflicts * Routing api code to remote method * Routing api code to remote method * adds token to user model * Adds token to user model * Gets auth token for admin when logging in * fixes authorize * sets auth tokens to user models and refreshes token on login * fixes merge conflicts * fixes merge conflicts * changes approve function and deletes extra googleAuth * Fixes emailAdmin on pending appointment * fixes rendering pending appointments * fixes merge issues * fixes merge issues * Merging conflicts * fixes merge issues * Routing api code to remote method * fixes merge issues * fixes merge issues * fixes merge issues * Gets auth token for admin when logging in * fixes authorize * fixes merge issues * fixes merge issues * Merging conflicts * Merging conflicts * fixes merge issues * fixes merge issues * fixes merge issues * fixes merge issues * fixes merge issues * fixes merge issues * sets auth tokens to user models and refreshes token on login * fixes merge issues * changes approve function and deletes extra googleAuth * fixes emailAdmin * fixes pendingAppointments
* removed confirmed apts * removed confirmed apts
| }; | ||
|
|
||
| BookedApt.remoteMethod('removedConfirmed', { | ||
| accepts: [{arg: 'email', type: 'string', required: true}, |
There was a problem hiding this comment.
Similar blocks of code found in 2 locations. Consider refactoring.
| }; | ||
|
|
||
| Aptrequest.remoteMethod('emailAdmin', { | ||
| accepts: [{arg: 'instructorEmail', type: 'string', required: true}, |
There was a problem hiding this comment.
Similar blocks of code found in 2 locations. Consider refactoring.
| <td>{e.issueDescription}</td> | ||
| <td>{moment(e.time).format('L')}</td> | ||
| <td>{moment(e.time).format('hh:mm a')}</td> | ||
| <td> |
There was a problem hiding this comment.
Similar blocks of code found in 2 locations. Consider refactoring.
| <td>{moment(e.timeSlot).format('L')}</td> | ||
| <td>{moment(e.timeSlot).format('hh:mm a')}</td> | ||
| <td>{e.duration}</td> | ||
| <td> |
There was a problem hiding this comment.
Similar blocks of code found in 2 locations. Consider refactoring.
| }); | ||
| }; | ||
|
|
||
| Visitor.remoteMethod('oAuthConfirm', { |
There was a problem hiding this comment.
Similar blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 4 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 4 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 4 locations. Consider refactoring.
| }) | ||
| } | ||
|
|
||
| handleTimeSlot(e) { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
server/boot/create-admin.js
Outdated
| }); | ||
| }); | ||
| }); | ||
| Visitor.findOrCreate({ |
There was a problem hiding this comment.
Similar blocks of code found in 4 locations. Consider refactoring.
client/googlef392b883fe8ce677.html
Outdated
| @@ -0,0 +1 @@ | |||
| google-site-verification: googlef392b883fe8ce677.html No newline at end of file | |||
server/boot/create-admin.js
Outdated
| }); | ||
| }); | ||
| }); | ||
| Visitor.findOrCreate({ |
There was a problem hiding this comment.
These functions should be condensed into some sort of loop
| { this.state.user && (this.state.isAdmin === false) ? | ||
| <li className="nav-item"> | ||
| <Link to="/request">Request</Link> | ||
| <Link id='reqtest' to="/request" >Request</Link> |
There was a problem hiding this comment.
Is this supposed to be request?
| .then(res => { | ||
| res.data.map(request => { | ||
| axios.delete(`/api/AptRequests/${request.id}`) | ||
| axios.post(`/api/AptRequests/denyEmail`, { |
There was a problem hiding this comment.
Posting the deny email should come after the DELETE request has been fulfilled. Throw this POST request within a .then of the previous request
| time: time, | ||
| }) | ||
| .then(function (response) { | ||
| console.log(response); |
There was a problem hiding this comment.
Remove superfluous console.log(s) from client side
| import SignIn from '../SignIn'; | ||
| import Request from '../Request'; | ||
| import Availability from '../AdminAvailability'; | ||
| import Christianviews from '../Request/Christianview'; |
There was a problem hiding this comment.
These files are essentially the same. Condense the three components into one and pass down differences through props
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
This request should go inside the .then of the previous axios.post. We should expect that the request was successful before getting an email about it
src/components/Request/index.jsx
Outdated
| time: time, | ||
| studentName: studentName, | ||
| }) | ||
| .then() |
tests/e2e/main.spec.js
Outdated
| chai.use(chaiHttp); | ||
| const expect = chai.expect; | ||
|
|
||
| const path = 'http://localhost:8080' || process.env.PORT; |
There was a problem hiding this comment.
This string will always be truthy, so it will never take process.env.PORT (which isn't needed in your test). Change this line to just the string
tests/main.spec.js
Outdated
| chai.use(chaiHttp); | ||
| const expect = chai.expect; | ||
|
|
||
| const url = 'http://localhost:8080' || process.env.PORT; |
There was a problem hiding this comment.
This line isn't needed
| import moment from 'moment'; | ||
|
|
||
| export default class Anthonyview extends react.Component{ | ||
| constructor(props){ |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| } | ||
|
|
||
| handleSubmit(e) { | ||
| axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, { |
There was a problem hiding this comment.
Similar blocks of code found in 2 locations. Consider refactoring.
| } | ||
|
|
||
| handleSubmit(e) { | ||
| axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, { |
There was a problem hiding this comment.
Similar blocks of code found in 2 locations. Consider refactoring.
| }) | ||
| } | ||
|
|
||
| handleSubmit(e) { |
There was a problem hiding this comment.
Function handleSubmit has 41 lines of code (exceeds 25 allowed). Consider refactoring.
|
|
||
|
|
||
|
|
||
| render(){ |
There was a problem hiding this comment.
Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
|
|
||
| } | ||
|
|
||
| handleSubmit(e) { |
There was a problem hiding this comment.
Function handleSubmit has 40 lines of code (exceeds 25 allowed). Consider refactoring.
| "slotId": this.state.slotId, | ||
| "instructorId": "anthony" | ||
| }).then((response) => { | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| import moment from 'moment'; | ||
|
|
||
| export default class Anthonyview extends react.Component{ | ||
| constructor(props){ |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| } | ||
|
|
||
| handleSubmit(e) { | ||
| axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, { |
There was a problem hiding this comment.
Similar blocks of code found in 2 locations. Consider refactoring.
| } | ||
|
|
||
| handleSubmit(e) { | ||
| axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, { |
There was a problem hiding this comment.
Similar blocks of code found in 2 locations. Consider refactoring.
| }) | ||
| } | ||
|
|
||
| handleSubmit(e) { |
There was a problem hiding this comment.
Function handleSubmit has 41 lines of code (exceeds 25 allowed). Consider refactoring.
|
|
||
|
|
||
|
|
||
| render(){ |
There was a problem hiding this comment.
Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
|
|
||
| } | ||
|
|
||
| handleSubmit(e) { |
There was a problem hiding this comment.
Function handleSubmit has 40 lines of code (exceeds 25 allowed). Consider refactoring.
| "slotId": this.state.slotId, | ||
| "instructorId": "anthony" | ||
| }).then((response) => { | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| import moment from 'moment'; | ||
|
|
||
| export default class Anthonyview extends react.Component{ | ||
| constructor(props){ |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| } | ||
|
|
||
| handleSubmit(e) { | ||
| axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, { |
There was a problem hiding this comment.
Similar blocks of code found in 2 locations. Consider refactoring.
| } | ||
|
|
||
| handleSubmit(e) { | ||
| axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, { |
There was a problem hiding this comment.
Similar blocks of code found in 2 locations. Consider refactoring.
| }) | ||
| } | ||
|
|
||
| handleSubmit(e) { |
There was a problem hiding this comment.
Function handleSubmit has 41 lines of code (exceeds 25 allowed). Consider refactoring.
|
|
||
|
|
||
|
|
||
| render(){ |
There was a problem hiding this comment.
Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
|
|
||
| } | ||
|
|
||
| handleSubmit(e) { |
There was a problem hiding this comment.
Function handleSubmit has 40 lines of code (exceeds 25 allowed). Consider refactoring.
| "slotId": this.state.slotId, | ||
| "instructorId": "anthony" | ||
| }).then((response) => { | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| import moment from 'moment'; | ||
|
|
||
| export default class Anthonyview extends react.Component{ | ||
| constructor(props){ |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| } | ||
|
|
||
| handleSubmit(e) { | ||
| axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, { |
There was a problem hiding this comment.
Similar blocks of code found in 2 locations. Consider refactoring.
| } | ||
|
|
||
| handleSubmit(e) { | ||
| axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, { |
There was a problem hiding this comment.
Similar blocks of code found in 2 locations. Consider refactoring.
| }) | ||
| } | ||
|
|
||
| handleSubmit(e) { |
There was a problem hiding this comment.
Function handleSubmit has 41 lines of code (exceeds 25 allowed). Consider refactoring.
|
|
||
|
|
||
|
|
||
| render(){ |
There was a problem hiding this comment.
Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
|
|
||
| } | ||
|
|
||
| handleSubmit(e) { |
There was a problem hiding this comment.
Function handleSubmit has 40 lines of code (exceeds 25 allowed). Consider refactoring.
| "slotId": this.state.slotId, | ||
| "instructorId": "anthony" | ||
| }).then((response) => { | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| import moment from 'moment'; | ||
|
|
||
| export default class Anthonyview extends react.Component{ | ||
| constructor(props){ |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| } | ||
|
|
||
| handleSubmit(e) { | ||
| axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, { |
There was a problem hiding this comment.
Similar blocks of code found in 2 locations. Consider refactoring.
| } | ||
|
|
||
| handleSubmit(e) { | ||
| axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, { |
There was a problem hiding this comment.
Similar blocks of code found in 2 locations. Consider refactoring.
| }) | ||
| } | ||
|
|
||
| handleSubmit(e) { |
There was a problem hiding this comment.
Function handleSubmit has 41 lines of code (exceeds 25 allowed). Consider refactoring.
|
|
||
|
|
||
|
|
||
| render(){ |
There was a problem hiding this comment.
Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
|
|
||
| } | ||
|
|
||
| handleSubmit(e) { |
There was a problem hiding this comment.
Function handleSubmit has 40 lines of code (exceeds 25 allowed). Consider refactoring.
| "slotId": this.state.slotId, | ||
| "instructorId": "anthony" | ||
| }).then((response) => { | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| import moment from 'moment'; | ||
|
|
||
| export default class Anthonyview extends react.Component{ | ||
| constructor(props){ |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| } | ||
|
|
||
| handleSubmit(e) { | ||
| axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, { |
There was a problem hiding this comment.
Similar blocks of code found in 2 locations. Consider refactoring.
| } | ||
|
|
||
| handleSubmit(e) { | ||
| axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, { |
There was a problem hiding this comment.
Similar blocks of code found in 2 locations. Consider refactoring.
| }) | ||
| } | ||
|
|
||
| handleSubmit(e) { |
There was a problem hiding this comment.
Function handleSubmit has 41 lines of code (exceeds 25 allowed). Consider refactoring.
|
|
||
|
|
||
|
|
||
| render(){ |
There was a problem hiding this comment.
Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
|
|
||
| } | ||
|
|
||
| handleSubmit(e) { |
There was a problem hiding this comment.
Function handleSubmit has 40 lines of code (exceeds 25 allowed). Consider refactoring.
| "slotId": this.state.slotId, | ||
| "instructorId": "anthony" | ||
| }).then((response) => { | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
| const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com` | ||
| const time = this.state.time; | ||
| const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName); | ||
| axios.post(`/api/AptRequests/emailAdmin`, { |
There was a problem hiding this comment.
Identical blocks of code found in 2 locations. Consider refactoring.
No description provided.