sprintly / sprintly-kanban

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

Add item fixes #67

Closed florapdx closed 9 years ago

florapdx commented 9 years ago

What's this PR do?

Fixes some minor issues around the Add Item Modal: adding hotkey support for Cmd+Return for rapid item creation; adds focus to the first input field on modal render and on tab change; restores error handling on item add promise; and fixes broken form validation. Also includes a fix for styling bug on the product selector page (truncating long product names).

Where should the reviewer start?

add-item-modal.js

How should this be manually tested?

Load up local instance and verify that you are able to create items in succession using Cmd+Enter. Focus should always be returned to the first input ('who' for story; title for all other types). Verify that submitting an item without filling in required fields causes error-state highlighting on those fields ('who', 'what', 'where' in story; 'title' in all else). You should still be able to close a partially filled-out add item form and reopen the form with that entered data still present.

Any background context you want to provide?

Nope

What ticket or issue # does this fix?

Fixes #212

Screenshots (if appropriate)

Product selector page style bug: screen shot 2015-07-21 at 11 43 04 am

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

200

Definition of Done:

florapdx commented 9 years ago

I'm not 100% sure why one would be preferable over the other, but I can change the error handling in the AddItem.then() from passing the error callback to using a catch block:

.catch((err) => {
      this.updateValidation(err);
    });
wookiehangover commented 9 years ago

@florapdx usually .catch is preferred because it's more explicit and works as a "catch all" when chaining multiple promises (whereas the .then(success, error) only handles errors from the first promise.) There's a good explanation of the benefit here: http://www.html5rocks.com/en/tutorials/es6/promises/#toc-error-handling