cherking19 / EC463_SmartExerciseSystem

2 stars 0 forks source link

Edit and Delete recorded workouts in the View Completed Workout page #58

Closed cherking19 closed 1 year ago

cherking19 commented 1 year ago

This issue can be closed when users are able to make and save edits in the View Completed Workout page. Saving an edit or deleting should refresh the saved tracked workouts.

cherking19 commented 1 year ago

image

The View Completed Workout page now has buttons at the bottom to control editing and deleting. By default the page is not in editable mode so none of the workout elements are interactable.

image

By clicking the edit button, the page enters editable mode and the workout elements are interactable now.

image image

The workout start date and time can be edited by clicking on the start date. This opens a date picker modal that is initially set at the workout's current start date and has a date range of 1 year prior to the current date (bug, should be 1 year prior to the original date) to today's date.

image

The workout duration can be edited by clicking on the duration. This opens a duration picker modal that is initially set to the workout's current duration.

As usual, the sets have their completed reps adjusted.

image The weight of individual sets can also be adjusted by clicking on their corresponding weight widget. Only weights of sets that have been attempted are interactable. The user can then enter any positive integer, and upon the text input losing focus, the weight will be updated.

Edits are stored in an intermediate variable so unless they are saved they are not persistent. The edits can be canceled by clicking the cancel button. This will display a confirmation modal to prompt the user to confirm their choice, and if confirmed, will leave the editable mode and revert the display to the original data. Saving the data will update the workout data in their recorded history, go back to the History page, and refresh the tabs.

The user can delete a record by clicking the delete button. This will display a confirmation modal to prompt the user to confirm their choice, and if confirmed, will similarly delete the workout data from their recorded history, go back to the History page, and refresh the tabs.