Giter Site home page Giter Site logo

commotion's People

Contributors

andrew07039 avatar billyshears314 avatar nfamigletti avatar ppegusii avatar r3d3y3 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

commotion's Issues

Lengthen filename field for photos

Since these can be long urls (possibly longer than Youtube URLs), we should make the filename property varchar(1023) instead of varchar(255).

Fully populate user dorianYates

I would like to have one user, for now, fully populated, in this case dorianYates, so that I can test what I have. Also, we'll need a fully populated user for the presentation.

He needs an avatar_url, a list of activities, a list of followers, a list of follows.

It would also be great if the users that are his followers, and that he follows had avatar_urls as well. That way I can display them on the followers and following view pages. But this part can wait since I know this will take longer.

Thank you

user edit profile fill existing info

You probably just haven't implemented this yet, but maybe we should have the existing skill level, activities, and bio populated in the user profile edit pop up if they exist.

Activities in User Object are returning more than they should

All of the activities are being returned in the user object and they have duplicates depending on how many activities the user has. If the user has two activities, there are two of each activity, if the user has three activities, there are three of each activity.

If it is feasible, I would like for there just to be the activities that the user has associated with them in the user object. Otherwise, I will try using the activitiesgetByUserId function.

We should have an Encyclopedia Index

We mentioned this earlier in our development that we should have an index page that lists all the exercises. I think this would be very useful. I'll just need a query function that returns all of the exercises ids and names. Then I can create a page that lists their names with links to their entries.

Problem with exerciseGetById

Works when id = 5, but I got this error when I tried to query id = 500000:

/vagrant/commotion/data/Exercise.js:61
var eid = row.id.toString();
^
TypeError: Cannot read property 'id' of undefined
at rowToExercise (/vagrant/commotion/data/Exercise.js:61:16)
at /vagrant/commotion/data/Exercise.js:41:5
at null.callback (/vagrant/commotion/data/Conn.js:19:7)
at Query.handleReadyForQuery (/vagrant/commotion/node_modules/pg/lib/query.js:84:10)
at null. (/vagrant/commotion/node_modules/pg/lib/client.js:159:19)
at EventEmitter.emit (events.js:117:20)
at null. (/vagrant/commotion/node_modules/pg/lib/connection.js:97:12)
at Socket.EventEmitter.emit (events.js:95:17)
at Socket. (_stream_readable.js:746:14)
at Socket.EventEmitter.emit (events.js:92:17)

Custom error objects

Create custom error object that includes a public error message for users, an external error message for client side development, and a stack trace that should probably be stripped before sending the error client side.

Insert exercise by specified fields

Insert exercise by passing in query with following format:

{ names: <array of strings; give error if names.length === 0>
difficulty: <non-empty string>
description: <string; give error if empty>
musclegroup: <non-empty string>
photos: <array of strings; can be empty>
videos: <array of strings; can be empty>
}

Client-side SQL select

Is there any way to sanitize select statements so that we can create them client side? Then we could use very specific queries without having many functions to handle them server-side, while limiting exposure to SQL injection.

Problem saving existing exercises

What I did:
Go to exercise 11 (dumbbell row)
Edit
Add name "new"
Try to save

The logs:

<Viewing exercise 11>
[ { id: '11',
    description: 'Row with dumbbells',
    difficulty: { id: 1, name: 'beginner' },
    musclegroup: { id: 2, name: 'upper body' },
    created: Thu Apr 24 2014 15:22:07 GMT+0000 (UTC),
    names: [ [Object] ],
    videos: [ [Object] ],
    photos: [] } ]
GET /encyclopedia/exercise_entry?eid=11 200 19ms - 5.57kb
GET /encyclopedia/stylesheets/bootstrap/css/bootstrap.css 404 3ms
GET /javascripts/jquery-1.11.0.min.js 304 18ms
GET /encyclopedia/stylesheets/blog.css 404 20ms
GET /stylesheets/header.css 304 22ms
GET /stylesheets/bootstrap/css/bootstrap.css 200 26ms - 118.38kb
GET /stylesheets/bootstrap/fonts/glyphicons-halflings-regular.woff 200 8ms - 22.77kb

Executing editExercise
Found eid 11
GET /encyclopedia/exercise_entry/edit?eid=11 302 12ms - 88b
Executing createExercise
GET /create/exercise 200 18ms - 7.62kb
GET /javascripts/jquery-1.11.0.min.js 304 6ms
GET /stylesheets/bootstrap/css/bootstrap.css 200 15ms - 118.38kb
GET /javascripts/createExercise.js 304 13ms
GET /stylesheets/header.css 304 15ms
GET /javascripts/bootstrap.js 304 19ms
GET /stylesheets/bootstrap/fonts/glyphicons-halflings-regular.woff 200 6ms - 22.77kb

Executing saveexercise
{ id: '11',
  description: 'Row with dumbbells',
  difficulty: { id: 1, name: 'Beginner' },
  musclegroup: { id: 2, name: 'Upper body' },
  created: null,
  names:
   [ { id: 11, name: 'dumbbell row', uiId: 0 },
     { id: null, name: 'new', uiId: 1 } ],
  photos: [],
  videos:
   [ { id: 11,
       url: 'www.youtube.com/watch?v=GkLqraq4m6U',
       exerciseId: 11,
       workoutId: null } ] }

/vagrant/commotion/data/Exercise.js:118
      if(exercise.id){
                 ^
TypeError: Cannot read property 'id' of undefined
    at afterChildDeletion (/vagrant/commotion/data/Exercise.js:118:18)
    at afterDeletion (/vagrant/commotion/data/Exercise.js:194:14)
    at /vagrant/commotion/node_modules/async/lib/async.js:577:17
    at done (/vagrant/commotion/node_modules/async/lib/async.js:122:15)
    at /vagrant/commotion/node_modules/async/lib/async.js:25:16
    at /vagrant/commotion/node_modules/async/lib/async.js:574:21
    at /vagrant/commotion/data/common.js:25:14
    at null.callback (/vagrant/commotion/data/Conn.js:16:9)
    at Query.handleError (/vagrant/commotion/node_modules/pg/lib/query.js:101:10)
    at null.<anonymous> (/vagrant/commotion/node_modules/pg/lib/client.js:167:26)

DB loading of exercise_instances and timers

I think there's a problem with the loading of these tables. The id of the records loaded in each table refer to the same workout_components record by id. For example:

INSERT INTO exercise_instances (id, exercise_id, measurement_id, measurement_value) VALUES (1, 1, 1, '10'),
INSERT INTO timers (id,seconds) VALUES (1, 120),

Since each record in exercise_instance logically combines with a record in workout_components to specify an ExerciseInstance and each record in timers logically combines with a record in workout_components to specify a Timer, no record in timers should have the same id as a record in exercise_instances. Does that make sense?

P.S. I'm sorry for the confusing DB design. In hind sight, this probably was not a good time to experiment with inheritance.

Cannot create exercise

Even with name and description fields populated, I still get 'name.votes NaN' when trying to push to database. See the saveexercise route.

ComMotion - Error when I run CreateDb.sql

When I run CreateDb.sql with "psql -d commotion -a -f CreateDb.sql" to recreate the tables in my database, I get this error:
...
psql:sql/CreateDb.sql:215: ERROR: column "difficulty_id" of relation "users" does not exist
LINE 1: INSERT INTO users (id, username, password, difficulty_id) VA...

Post Object Table will be needed

I just remembered that we'll need a table for posts by the user for the locker page. There should be a column for id, user_id (of the creator), the text post itself, and the timestamp for when it was created.

This isn't urgent though so we can just have static content for the presentation and work on this later.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.