iPlantCollaborativeOpenSource/troposphere — pull request #48 by jchansen (2014-08-13 18:26:46+00:00)
Title: General improvements

1. Lots of refactoring to handle more complex workflow scenarios with more clarity, ease and less risk of edge cases. The core driver for doing this was that the data stores were doing the AJAX calls (like suspend, start, launch, etc.), which worked fine when the application didn't have a hierarchical structure (instances being in projects). But as soon as we needed to support concepts like "Create this volume, and then when it's officially created, add it to this project" it got to be problematic and less clear. Mainly because the "Create Volume" action should be optimistic, and we also want to add the volume to the project before it's actually created (when it doesn't have an ID). To do that we need to add it, and then update the project with the real information and ID once we have it, and then use that ID to officially add the volume to the project on the server.

All of this was solved much more simply by moving the AJAX calls up into the actions, who could then act like orchestrators and dispatch updates to all the stores to reflect the application state. It also makes it easier to set statuses of resources later (like pending, error, transitionDirection, etc).