jmkaneshiro / stayontrack

StayOnTrack is a clone of Pivotal Tracker -- an agile project management tool.
https://stay-on-track-app.herokuapp.com/
5 stars 0 forks source link

Adds delete story modal #67

Closed jmkaneshiro closed 4 years ago

jmkaneshiro commented 4 years ago

Summary

A user should be protected from accidentally deleting a story. When a user clicks the trash can icon on a story, they are redirected to a modal that provides a second prompt verifying that the user actually wants to delete the story.

Technical Notes

I was unable to pass story object as a prop to the modal directly. I was able to resolve this problem by creating a new slice of state called focused_item. Whenever the delete modal is prompted, the app calls the fetchStory action, which returns an object RECEIVE_STORY to the focused_item_reducer.

The focused_item_reducer should be flexible, and possibly usable for deleting other objects like projects and/or users via a modal.