ppegusii / commotion Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
If there is a photo associated with the exercise, use the first one; otherwise, use a default picture.
If the exercise id exists, allow the names field to be an empty array. Otherwise, it is impossible to edit an exercise without defining a new name.
If you look at someone's profile and hit "Back" on the browser, then click on one of the sidebar buttons (like about), you still see the other person's info, even though one would expect to see your own.
Since these can be long urls (possibly longer than Youtube URLs), we should make the filename property varchar(1023) instead of varchar(255).
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
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.
We won't have this ready in time for Thursday, but just for future reference.
Logout doesn't work
I noticed there isn't a column in the user table for the user to write a short description or bio about themself.
Even if the number of results isn't a multiple of five, a multiple of five results always shows up?
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 need a way to add or remove users that you want to follow. I can then add an option to follow or unfollow that user on their profile page.
For example, if I search for "squat" and get three results, then click next, the interface disappears.
Current validator only checks for standard URL format, so URLs like "http://imgur.com/gallery/new?original" go through.
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.
Err is undefined even if the exercise id doesn't match anything in the database.
Alert or notification should appear prompting for a search. The error page is somewhat jarring.
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)
Was able to login as "hashtagyoloswag" with password "mileycyrusisdabomb", who I doubt is a user in the database. :P
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 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>
}
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.
Should use a default image for exercises with no media
Double photos, no videos
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)
Have we considered freezing a somewhat tested version for the presentation?
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.
Use this URL:
http://localhost:8080/encyclopedia/exercise_entry?eid=<id of exercise>
Alex has the profiles working as far as I can tell, so link up the results.
Could you make an exercise with multiple name fields, images, and videos associated with it? They don't have to be sensible, as long as they link to actual name objects or actual images and videos accessible online.
Even with name and description fields populated, I still get 'name.votes NaN' when trying to push to database. See the saveexercise route.
Use for authentication!
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...
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.
For some reason, the page can't seem to recognize an empty error message.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.