sprintly / sprintly-kanban

A Kanban Board for Sprintly
https://kanban.sprint.ly
ISC License
493 stars 81 forks source link

Using local storage for add item modal #26

Closed mikekauffman closed 9 years ago

mikekauffman commented 9 years ago

What's this PR do?

Stores add-item modal form values in local storage so users don't lose their data if they close the modal.

Which code should the reviewer start with?

app/views/components/add-item-modal.js

How is this feature tested (either manually or automatically)?

Fill out the various fields in the add-item modal and click outside the modal. Reopening the modal will display the original input values.

What are the relevant tickets (please include link(s))?

Delivers #9859 https://sprint.ly/product/1/item/9859

What gif best describes this PR or how it makes you feel?

wookiehangover commented 9 years ago

@mikekauffman the form is getting reset every time it's dismissed (presumably to clear the values after a successful create). We should move these lines

https://github.com/sprintly/5columns/blob/7c4a21382f/app%2Fviews%2Fcomponents%2Fadd-item-modal.js#L91-L92

into this callback

https://github.com/sprintly/5columns/blob/7c4a21382f/app%2Fviews%2Fcomponents%2Fadd-item-modal.js#L110-L117

mikekauffman commented 9 years ago

@wookiehangover I didn't know if we wanted to distinguish between clicking outside the modal to dismiss and save the input values, and clicking cancel to dismiss and clear the values. To clarify, it sounds like you want the values to persist in both cases?

wookiehangover commented 9 years ago

@mikekauffman the main workflow I want to achieve is typing some content into the modal, dismiss it (either by clicking cancel, clicking the background, or hitting escape), and have your content come back when you open the modal again.

wookiehangover commented 9 years ago

@mikekauffman bump on this

mikekauffman commented 9 years ago

@wookiehangover should be good to go. The necessary logic was already being called in the create success block here. Removed it from the cancel block.