tidepool-org/jellyfish — pull request #5 by nicolashery (2014-02-26 13:54:50+00:00)
Title: New web client

I still have a couple things I would like to polish on the UI, but this should be a working version and ready to test.

Things to do before running this:

```bash
$ npm install
$ bower install
```

Before testing it though, as discussed @cheddar, we need to have the `syncTask.status` updated with agreed-upon states (I suggested `'pending'`, '`success'`, `'error'`, but that can be easily changed in `client/services/synctask.js`).

Right now I've tested the UI behavior by replacing select endpoints in `app.js` with something like:

```javascript
app.post(
'/v1/device/upload',
function(req, res) {
res.send(200, {_id: '123', status: 'pending'});
}
);

var fooCounter = 0;
app.get(
'/v1/synctasks/:id',
function(req, res) {
fooCounter = fooCounter + 1;
if (fooCounter === 2) {
fooCounter = 0;
return res.send(200, {_id: '123', status: 'success'});
}
res.send(200, {_id: '123', status: 'pending'});
}
);
```

Testing it with the actual `app.js` and a local version of the Tidepool platform, the UI gets "stuck" in a "Processing data..." state (as expected), because the only answer it's getting back from `/synctasks/:id` is `{status: "started"}`.

I'm not very familiar with how the backend of Jellyfish works, so I could use some help with getting the correct Sync Task status updates? If you're too busy with other things, I'll try to take a closer look, although there are some things I'd like to get done on Blip...

On a side note, I've also noticed by inspecting Mongo's `streams.syncTasks` collection that two get created, clearly the first one being "trash" data?

```javascript
> db.syncTasks.find()
{ "status" : "starting", "_id" : ObjectId("530de890ed64c20000000001") }
{ "status" : "started", "_id" : "530de890ed64c20000000001", "syncTaskId" : "530de890ed64c20000000001", "url" : "http://localhost:9122/v1/synctasks/530de890ed64c20000000001", "meta" : { "groupId" : "5caed05dbe", "archives" : [ "/Users/nicolashery/Projects/tidepool/jellyfish/data/0/carelink.csv" ] } }
```