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

Carets - Maria - BackTrek #37

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

Carets - Maria - BackTrek #37

wants to merge 10 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Dec 4, 2017

BackTREK

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What role does the Model play in Backbone? It talks to the API and acts as the the intermediary between the JavaScript and the API.
How did the presence of Models and Collections change the way you thought about your app? It changed the way I thought about how to get an individual trip and I'm using the models and collections to consider how to append a reservation
How do Backbone Events compare to DOM events? The Backbone events are triggered when data is changed as opposed to DOM events being triggered as a response to user actions. Backbone allows us to separate the code that updates the model from the code that updates the DOM.
How did you approach filtering? What was your data flow for this feature? Filtering is not yet completed
What do you think of Backbone in comparison to raw JavaScript & jQuery? Backbone felt more intuitive when we call the events in the jQuery. It'd be nice to get a better understanding of the differences between the asynchronicity in the jQuery and Backbone events because they seem to be called the same way.
Do you have any recommendations on how we could improve this project for the next cohort? No recommendations

@CheezItMan
Copy link

BackTREK

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene more granular commits would be better
Comprehension questions Models also provide business logic and contain the application's data. You'll get more experience with Backbone & jQuery event next week with Views.
Organization
Models and collections are defined in separate files Check
Code that relies on the DOM is located in or called by $(document).ready The event listener for when the collection is updated is done inside another event handler instead of in document ready. I left a note in your code.
Code follows the Backbone data flow (DOM event -> update model or collection -> Backbone event -> update DOM) Yes with regard to updating a collection.
Functionality
Display list of trips Check
Display trip details Check
Register for a trip MISSING You could do this either with a Reservation model or direct jQuery and Ajax.
Add a trip Check
Sort trips MISING You can check our livecode for an example. This is probably the easiest next step to do.
General
Snappy visual feedback for user actions Crisp quick changes. No spiffy CSS animations, but that wasn't required.
API error handling Basic error handling for creating trips.
Client-side validation Check
Overall What you have done, works well enough. You're missing sorting and registering for a trip. If you get these done you can ping me and I'll look at'em. I also left some comments in your code.


$('h3').text('Trip Info');

trip.fetch().done(() => {

Choose a reason for hiding this comment

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

There's no detecting that the fetch failed, so no way to provide a msg about when things fail.


const loadTrips = function loadTrips() {
tripList.fetch();
tripList.on('update', render, tripList);

Choose a reason for hiding this comment

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

It's theoretically possible that the fetch could complete before the update event listener is added. So I would register the listener in $(document).ready when the application starts.

This will also register render as an event listener every time loadTrips is clicked, so the list could be rendered multiple times.

event.preventDefault();

const tripData = {};
fields.forEach((field) => {

Choose a reason for hiding this comment

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

Breaking this into a helper method which reads the form would be better.

console.log(response);
$('#status-messages ul').empty();
$('#status-messages ul').append(`<li>${trip.get('name')} added!</li>`);
$('#status-messages').show();

Choose a reason for hiding this comment

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

I would also clear the form on a successful save.

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