GideonNeedleman / 5x5

0 stars 0 forks source link

Enable Edit Exercise #123

Closed GideonNeedleman closed 7 months ago

GideonNeedleman commented 7 months ago

Just remembered that the EditExercise page needs to restrict what can be edited. Only changes that don't contradict previous records are allowed.

Can't change metric name, inputBar, or units.

I can change exercise name, rest timer, metric default value, metric step value and adaptive metric value.

That means I can't use the existing AddMetricToExercise component. I need something new. Should probably fix the original AddMetricToExercise component while we're at it. Can't link to traditional input bar, need a custom input bar with input fields where the text is.

GideonNeedleman commented 7 months ago

Ok, I'm now able to edit exercises and submit correctly. Edited exercises show up correctly inside exerciseData.

The problem is that workoutData doesn't reference exerciseData, instead all the exercises are replicated inside the workout. I need to refactor workoutData now to reference the exercises instead of copying them!

I really messed up my data structure in the beginning.

GideonNeedleman commented 7 months ago

Resolved issue where edited exercises didn't include inputBar field. That meant I couldn't edit a previously edited exercise because without inputBar property, the EditExercise couldn't load up an inputBar to be edited.