Commit Graph

1128 Commits

Author SHA1 Message Date
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
Piotr Sarnacki
e84cf89cf7 app/serializers/repo.coffee -> app/serializers/repo.js 2015-12-08 10:18:05 +01:00
Piotr Sarnacki
e161717f73 Simplify pusher handling in store 2015-12-08 10:18:05 +01:00
Piotr Sarnacki
d7400c0567 Remove console.log 2015-12-08 10:18:05 +01:00
Piotr Sarnacki
81898e422f Fix pusher to work with new ember-data
This commit just fixes things to the point where pusher updates are
applied to the store properly. This still lacks a business logic fixes,
so for example we won't update lastBuild's field, because there's no
such information from pusher.
2015-12-08 10:18:05 +01:00
Piotr Sarnacki
7187d2ef45 Disable dashboard test for now 2015-12-08 10:18:05 +01:00
Piotr Sarnacki
d636369daa Fix sidebar repos list
We need this list to update with pusher, so filtering is better than
using store.query.
2015-12-08 10:18:05 +01:00
Piotr Sarnacki
35f95739c7 Attribute mappings in serializers should use underscore notation 2015-12-08 10:18:04 +01:00
Piotr Sarnacki
dbd83c8643 Use job_ids as a key for jobs relationship for build 2015-12-08 10:18:04 +01:00
Piotr Sarnacki
ca633bdf7b Don't add commit data to included array in build serializer
We already do it in an abstracted way (ie. for all relationships) in v2
fallback serializer.
2015-12-08 10:18:04 +01:00
Piotr Sarnacki
ad4d06cb25 No need to add repo to the list of attributes now 2015-12-08 10:18:04 +01:00
Piotr Sarnacki
39a579c9db Fix handling relationships for V2 API
* we should look for both embedded relationship and relationship key,
  so in cases like for commit, when there's a full commit data on
  "commit" property, and only id at "commit_id", we will use commit data
* we can't add @type to V2 fallback, because in other places we chack
  for @type to distinguish V2 and V3 payloads
* there's no need to include a record in "included" if there's only a
  type and an id there
2015-12-08 10:18:04 +01:00
Piotr Sarnacki
34e53c1034 Fix job route's use of job.build relationship
build is an async relationship now, so job.get('build') returns a
promise.
2015-12-08 10:18:04 +01:00
Piotr Sarnacki
e4623d981b Fix including to-many relationships for V3 payloads 2015-12-08 10:18:04 +01:00
Piotr Sarnacki
c50c01f8ea Properly include relationships for V2 payloads 2015-12-08 10:18:04 +01:00
Piotr Sarnacki
a2bd6d827d Convert build serializer to javascript 2015-12-08 10:18:03 +01:00
Piotr Sarnacki
74a9a1603e Update serializers to work with jobs endpoint response 2015-12-08 10:18:03 +01:00
Piotr Sarnacki
d59e402314 Include repositoryId as an attribute on build
For some reason (probably some problem with one of the serializers) we
sometimes lack an id attribute for a promise that we get for a repo
relationship on build. Because of that doing `build.get('repo.id')` may
sometimes return undefined. A temporary workaround is to make sure that
we always can access the `repository_id` property.
2015-12-08 10:18:03 +01:00
Piotr Sarnacki
3946077c96 Use V2FallbackSerializer for jobs 2015-12-08 10:18:03 +01:00
Piotr Sarnacki
c40e413f35 Don't throw error if broadcastArray is undefined 2015-12-08 10:18:03 +01:00
Piotr Sarnacki
ab0b0cbebc Use storage service instead of Travis.storage 2015-12-08 10:18:03 +01:00
Piotr Sarnacki
1843d8cb54 Remove unused settings/index controller 2015-12-08 10:18:03 +01:00
Piotr Sarnacki
6ee956367c Observe repos.firstObject on reposController
Since we change repos property on reposController, we can't set observer
on repos, because as soon as it's changed, we loose the observer.
Instead, we should observe only on reposController, which is not going
to change.
2015-12-08 10:18:02 +01:00
Piotr Sarnacki
8de314e943 Sort repos in repos-list component, not in controller 2015-12-08 10:18:02 +01:00
Piotr Sarnacki
47439657a1 Use lastBuild from defaultBranch on repository
One thing that is not standard here is a serializer for branch, which
uses @href as id. At this point branches don't have ids and ember-data
needs one, so using @href is the easiest way.
2015-12-08 10:18:02 +01:00
Piotr Sarnacki
d9cff6e8b4 Create adapters and serializers working with v3 and v2 APIs
This commit adds adapters and serializers for v3, but also a fallback
serializer for v2, which allows to handle v2 and v3 payloads at the same
time. This is needed, because when we use v3 endpoint for one of the
models (in this case repo), we can also get embedded records of other
types (like branch or build).
2015-12-08 10:18:02 +01:00
Piotr Sarnacki
5cf1cbba6b Move ajax and auth into services 2015-12-08 10:18:02 +01:00
Piotr Sarnacki
d677307006 Remove some more deprecations 2015-12-08 10:17:32 +01:00
Piotr Sarnacki
63ddf332a8 Properly call error callback in ajax utility 2015-12-07 13:35:25 +01:00
Piotr Sarnacki
69ac8e1a00 Revert "Change signature in $.ajax's error callback"
This reverts commit 60a77742c0.

We don't use $.ajax...
2015-12-07 10:05:19 +01:00
Piotr Sarnacki
60a77742c0 Change signature in $.ajax's error callback
Error callback in $.ajax has different signature than success callback
2015-12-07 09:39:39 +01:00
Lisa P
60116154c7 fix flash messages width 2015-12-04 16:02:03 +01:00
Lisa P
efe80caa37 clean up icons and other assets 2015-12-04 11:44:24 +01:00
Lisa P
2e45aae5f9 update flexbox in footer 2015-12-04 11:44:24 +01:00
Lisa P
174e7b2bc1 update docs and blog links to use https 2015-12-04 11:44:24 +01:00
Lisa P
86a6cf5c05 refactor some icons 2015-12-04 11:44:24 +01:00
Lisa P
5a8024fd42 change settings icon on profile page 2015-12-04 11:44:23 +01:00
Lisa P
e0629a1571 change to new icons for key and fingerprint 2015-12-04 11:44:23 +01:00
Piotr Sarnacki
3827b6b4d8 Add debug info on ajax errors 2015-12-04 11:23:53 +01:00
Lisa P
61e445381c Merge branch 'master' of github.com:travis-ci/travis-web 2015-12-03 12:32:59 +01:00
Lisa P
d78ec1a438 fix commit link in build header 2015-12-03 12:32:48 +01:00
Piotr Sarnacki
b2ec5ab110 Merge pull request #415 from travis-ci/sol-infrastructure-conductor
Tweaking solarce's title
2015-12-03 12:03:12 +01:00
Lisa P
e86de3d068 fix tab arrow in FF 2015-12-03 11:50:07 +01:00
Lisa P
88b7af156d add scale icon 2015-12-03 11:22:29 +01:00
Brandon Burton
5ece740957 Tweaking solarce's title
**Infrastructure Conductor** =D
2015-12-02 10:16:38 -08:00
Lisa P
e4658e8023 fix tests and stuff 2015-12-02 17:34:46 +01:00
Lisa P
728f428c1f fix notices 2015-12-02 16:42:54 +01:00
Lisa P
9cb7c6c836 tweak elapsed time 2015-12-02 16:28:14 +01:00
Lisa P
576409ba1e add elapsed time 2015-12-02 16:13:28 +01:00
Lisa P
9baadcfd9e try two-line /builds
fix white ghosting on api icon

check requests for existing branch

tweak cc icon

tweak settings fields

try hover over settigns menu
2015-12-02 16:13:26 +01:00