Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

&& Brittany Jones Ampers #45

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

brittanyrjones
Copy link

TREK

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What does it mean for code to be asynchronous? Some code that we write is only applicable on certain actions, which means some of the code does not need to be loaded at the same time the page is loaded. For example, a click action.
Describe a piece of your code that executes asynchronously. How did this affect the way you structured it? My all trips button appears when the page loads, But when the button is clicked, it loads the list of trips. I had to add an on click event handler on the button so it loads the trips when clicked.
What kind of errors might the API give you? How did you choose to handle them? Creating a reservation can return an error without the proper fields filled in on the form. I had some issues creating a trip, so far it is printing out an error in my console, and the user can see something went wrong on the browser error message
Do you have any recommendations on how we could improve this project for the next cohort? It was kind of hard to work on a bunch of small projects at the same time, with them all being introduced around the same time too. It is good to practice working on many projects at the same time, but my git hygiene suffered and I did not commit as much as I should have.

@CheezItMan
Copy link

TREK

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene As you noted, you should commit more
Comprehension questions Check, asynchronous actually means that code may not be executed sequentially and that you cannot predetermine the order of events. Different functions seem to operate simultaneously.
Functionality
Click a button to list trips Check, but you're using jQuery instead of axios?
Click a trip to see trip details Check, but ditto on the above concern
Fill out a form to reserve a spot It does work, but does not inform the user. Also it seems to change the currently selected trip somehow.
Errors are reported to the user Only vague errors reported.
Styling Minimal styling, you did import the Foundation CSS
Under the Hood
Trip data is retrieved using from the API Check
JavaScript is well-organized and easy to read Everything is crammed into document.ready. Not everything needs to be.
HTML is semantic You have some unnecessary divs, but overall ok.
Overall It's very odd that you elected to use jQuery for the API work. I'm curious about that decision. You have code to make the API calls, but styling is almost nonexistent and You have issues reporting success and errors to the user. Those would be things to work on. Hopefully React is going better for you.

<!-- Reserve a trip -->

<div id="reserve-trip" class="reserve-trip-form">
<form action="#" method="post" id="reservation-form">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your JavaScript should hide this form until there's a trip to submit details about.

<title>Ada Trek</title>
<!-- <link rel="stylesheet" href="foundation.css"> -->
<!-- <link rel="stylesheet" href="index.css"> -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/foundation.min.css" integrity="sha256-GSio8qamaXapM8Fq9JYdGNTvk/dgs+cMLgPeevOYEx0= sha384-wAweiGTn38CY2DSwAaEffed6iMeflc0FMiuptanbN4J+ib+342gKGpvYRWubPd/+ sha512-QHEb6jOC8SaGTmYmGU19u2FhIfeG+t/hSacIWPpDzOp5yygnthL3JwnilM7LM1dOAbJv62R+/FICfsrKUqv4Gg==" crossorigin="anonymous">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

<!-- Single Trip view -->
<article id="trip" class="trip-info-list">
<h1 id="trip-name"></h1>
<ul id="trip-summary"></ul>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've styled the single trip to show at the bottom rather than to the right.

console.log('reservation: success!');
})
.fail(function(response){
$('#fail').html('<p>Something went wrong!</p>')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should output the validation errors like we did in class.

const url = $(this).attr('action');
const formData = $(this).serialize();

$.post(url, formData, (response) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you using jQuery to do post requests rather than using Axios like we did in class?

const formData = $(this).serialize();

$.post(url, formData, (response) => {
$('#confirmation-msg').html('<p>Made Reservation: ' + $('#trip-name').html() + '!</p>');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This id #confirmation-msg does not exist in the HTML page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants