travis-web/app
Piotr Sarnacki 147ab06fcf Fix references in V3 payloads
V3 API doesn't return any of the records more than 2 times. If a record
is already included in the response any other occurences will be
represented as a reference, ie. a hash with just an @href. Ember Data
doesn't play nice with such references as it needs an id to identify a
record.

The code in this commit traverses payloads from V3 API and adds an id to
each of the references that are present.

For example a following payload:

    {
      "@href": "/build/1",
      "@type": "build"
      "id": 1,
      "state": "passed",
      "branch": {
        "@href": "/repo/1/branch/master",
        "name": "master",
        "lastBuild": {
          "@href": "/build/1"
        }
      }
    }

Will be changed to:

    {
      "@href": "/build/1",
      "@type": "build"
      "id": 1,
      "state": "passed",
      "branch": {
        "@href": "/repo/1/branch/master",
        "name": "master",
        "lastBuild": {
          "@href": "/build/1",
          "id": 1
        }
      }
    }

In this case an "id" field was added to "branch.lastBuild" field.
2015-12-08 10:18:06 +01:00
..
adapters Don't throw error if broadcastArray is undefined 2015-12-08 10:18:03 +01:00
components Sort repos in repos-list component, not in controller 2015-12-08 10:18:02 +01:00
controllers Fix sidebar repos list 2015-12-08 10:18:05 +01:00
helpers Remove some more deprecations 2015-12-08 10:17:32 +01:00
initializers Move ajax and auth into services 2015-12-08 10:18:02 +01:00
instance-initializers Move ajax and auth into services 2015-12-08 10:18:02 +01:00
mixins Enable polling for tests 2015-05-12 10:02:47 +02:00
models Fix sidebar repos list 2015-12-08 10:18:05 +01:00
routes Fix job route's use of job.build relationship 2015-12-08 10:18:04 +01:00
serializers Fix references in V3 payloads 2015-12-08 10:18:06 +01:00
services Simplify pusher handling in store 2015-12-08 10:18:05 +01:00
styles fix flash messages width 2015-12-04 16:02:03 +01:00
templates Sort repos in repos-list component, not in controller 2015-12-08 10:18:02 +01:00
transforms Add ember-cli version of the Ember.js app 2015-02-03 09:48:22 +01:00
utils Move ajax and auth into services 2015-12-08 10:18:02 +01:00
views Remove some more deprecations 2015-12-08 10:17:32 +01:00
app.coffee Remove some more deprecations 2015-09-01 10:24:03 +02:00
index.html add icon for pinned tabs in Safari 2015-10-27 14:46:21 +01:00
router.coffee Move ajax and auth into services 2015-12-08 10:18:02 +01:00