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

#157731614 Add Dropset Support #20

Merged
merged 1 commit into from
Jun 20, 2018
Merged

Conversation

dondrzzy
Copy link

What does this PR do?

This PR creates a feature that enables users to add dropset workouts.

Add changeWorkoutType function to wger/core/static/js/wger-core.js
Add a onClick event handler to function to addEntry button in wger/manager/templates/day/log.html
Add functionality to enable adding new sets to the existing sets in wger/manager/views/log.py
Create new model WorkoutType, add category field to Setting model as a
foreign key.

Description of Task to be completed?

Add support for dropsets((https://en.wikipedia.org/wiki/Drop_set)

How should this be manually tested?

1: Clone the application and install the requirements in your virtual environment.
2: Update the database settings in the settings.py file with your postgres user, password and database name.
3: Run the application with python manage.py runserver.
4: Register and login.
5: Hover over Workouts in the navbar menu and select Workouts.
6: Add a workout then a day and description then add an exercise to the workout:
7: Add an initial weight and amount
8: You should be able to declare a workout type as a dropset or default workout.

Expected response

screen shot 2018-06-17 at 16 37 30

8: Click save and you should view the created workout as a dropset workout.

Expected response

screen shot 2018-06-17 at 16 37 57

9: Go to Workouts-> carlendar and add new log to the workout of the day respectively.
10: You should be able to add a new dropset reports while you work out.

Expected response

screen shot 2018-06-17 at 16 38 41

Any background context you want to provide?

This feature was not available.

What are the relevant pivotal tracker stories?

#157731614

@coveralls
Copy link

coveralls commented Jun 17, 2018

Pull Request Test Coverage Report for Build 351

  • 32 of 42 (76.19%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.05%) to 93.025%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tasks.py 0 2 0.0%
wger/manager/views/set.py 13 16 81.25%
wger/manager/views/log.py 8 13 61.54%
Totals Coverage Status
Change from base Build 346: -0.05%
Covered Lines: 12457
Relevant Lines: 13391

💛 - Coveralls

@peterwade153
Copy link

work on the failing tests

@@ -452,6 +466,7 @@ function updateAllExerciseFormset() {
$formsets.append(data);
$('#exercise-search-log').scrollTop(0);
$formsets.trigger('create');
console.log('value: ', setValue);
Copy link

Choose a reason for hiding this comment

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

Remove this statement

@@ -8,33 +8,33 @@
wgerSetupSortable();

// Init the modal dialog to edit the exercise
wgerFormModalDialog();
// wgerFormModalDialog();
Copy link

Choose a reason for hiding this comment

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

Why are you commenting this line?

"category": "dropset"
}
}
]
Copy link

Choose a reason for hiding this comment

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

Add new line

Copy link

@emugaya emugaya left a comment

Choose a reason for hiding this comment

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

Do remove the multiple migration files you have. We need to have one migration per django app

@emugaya
Copy link

emugaya commented Jun 18, 2018

Change the dropset from a dropdown to a checkbox. and It should be unselected by default. FIx your tests..

@dondrzzy dondrzzy force-pushed the ft-dropset-support-#157731614 branch from 2f7ef20 to 481c689 Compare June 19, 2018 16:00
@tibetegya tibetegya temporarily deployed to wg-rogue-one-pr-20 June 19, 2018 16:17 Inactive
@dondrzzy dondrzzy force-pushed the ft-dropset-support-#157731614 branch from 481c689 to 97d9e5e Compare June 19, 2018 16:58
@dondrzzy dondrzzy temporarily deployed to wg-rogue-one-pr-20 June 19, 2018 16:58 Inactive
@dondrzzy dondrzzy force-pushed the ft-dropset-support-#157731614 branch from 97d9e5e to 4a4e72b Compare June 19, 2018 17:14
@dondrzzy dondrzzy requested a deployment to wg-rogue-one-pr-20 June 19, 2018 17:14 Abandoned
@tibetegya tibetegya temporarily deployed to wg-rogue-one-pr-20 June 19, 2018 17:15 Inactive
@dondrzzy dondrzzy force-pushed the ft-dropset-support-#157731614 branch from 4a4e72b to 46e5a7d Compare June 19, 2018 17:55
@dondrzzy dondrzzy requested a deployment to wg-rogue-one-pr-20 June 19, 2018 17:55 Abandoned
@tibetegya tibetegya temporarily deployed to wg-rogue-one-pr-20 June 19, 2018 17:56 Inactive
@dondrzzy dondrzzy force-pushed the ft-dropset-support-#157731614 branch from 46e5a7d to 2e9b7e3 Compare June 19, 2018 18:03
@dondrzzy dondrzzy requested a deployment to wg-rogue-one-pr-20 June 19, 2018 18:03 Abandoned
@tibetegya tibetegya temporarily deployed to wg-rogue-one-pr-20 June 19, 2018 18:04 Inactive
@dondrzzy dondrzzy force-pushed the ft-dropset-support-#157731614 branch from 2e9b7e3 to 7ce194b Compare June 19, 2018 18:11
@dondrzzy dondrzzy temporarily deployed to wg-rogue-one-pr-20 June 19, 2018 18:11 Inactive
@dondrzzy dondrzzy force-pushed the ft-dropset-support-#157731614 branch from 7ce194b to 3d594fb Compare June 19, 2018 18:26
@dondrzzy dondrzzy temporarily deployed to wg-rogue-one-pr-20 June 19, 2018 18:26 Inactive
@tibetegya tibetegya temporarily deployed to wg-rogue-one-pr-20 June 20, 2018 06:25 Inactive
@dondrzzy dondrzzy force-pushed the ft-dropset-support-#157731614 branch from 3d594fb to cfaaabc Compare June 20, 2018 07:15
@dondrzzy dondrzzy temporarily deployed to wg-rogue-one-pr-20 June 20, 2018 07:15 Inactive
@dondrzzy dondrzzy force-pushed the ft-dropset-support-#157731614 branch from cfaaabc to a355553 Compare June 20, 2018 08:05
@dondrzzy dondrzzy temporarily deployed to wg-rogue-one-pr-20 June 20, 2018 08:05 Inactive
@dondrzzy dondrzzy force-pushed the ft-dropset-support-#157731614 branch from a355553 to 56f1c95 Compare June 20, 2018 08:49
@dondrzzy dondrzzy temporarily deployed to wg-rogue-one-pr-20 June 20, 2018 08:49 Inactive
@hariclerry
Copy link

@dondrzzy, awesome job. Please don't forget to run autopep8 command to fix all pep8 issues in the new lines of code you added. Coveralls is still complaining though.

This commit adds a feature that allows users to add dropset workouts.
Users define the workout on creation as a dropset.

Create new model WorkoutType, alter field reps in Setting
Add category field to Setting model as a foreign key.
Add workout to the returned response for url `workout/day/1/log/add/` and
`workout/set/day/<id>/set/add`
Add handle workoutype change event handler to `workoutType` button in `wger/manager/templates/set/add.html`
through `wger/core/static/js/wger-core.js`

[Delivers #157731614]
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.

None yet

6 participants