Commit Graph

1179 Commits

Author SHA1 Message Date
Piotr Sarnacki
7ae4d6aa7d Fix handling branches
This commit fixes handling of branches when using both V3 and V2. The
changes include:

  * proper definition of relationships that reflect V3 structure, so for
    example build belongs to a branch
  * setting up inverse records for some of the relationships. without
    doing that Ember Data can handle relationships in a surprising way,
    for example if the same record is referenced in 2 places in a
    belongsTo relationship, Ember Data will remove one of the references
    without proper inverse definitions
  * we need to add id when extracting branch as a relationship. Ember
    Data expects all of the relationships to have an id
  * lastly, we need to mimic the structure of the V3 API in V2 payloads,
    so for a build payload I'm now creating a branch record
2015-12-08 10:18:06 +01:00
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
Lisa P
0b1bd7d090 style caches
some cache tweaks

add title attributes to settings interaction elements
2015-12-02 16:13:21 +01:00
Lisa P
495c3b50f8 style requests
some spacing tweaks

implement Justine's feedback
2015-12-02 16:13:18 +01:00
Lisa P
3fa79819dd change template for build history
new icon vor show more btn
2015-12-02 16:13:15 +01:00
Lisa P
85f61c5155 style pullrequests 2015-12-02 16:13:14 +01:00
Lisa P
336479a2be jobs list styles
align animating icons

bring back color in sidebar tiles

change settings hover color

new help icon for allowed failures and settings help

fix svgs for firefox

also for remove log

also for help icon

fix coloring issues, use flexbox footer
2015-12-02 16:13:10 +01:00
Lisa P
fe36e018ce start flexboxify job list
implement Justine\'s feedback

remove regenerate key popup styles

add new icons, refactor request-icon component

use correct property name
2015-12-02 16:11:25 +01:00
Lisa P
fd885304f6 remove old build header styles
delete old job styles

cleanup templates and prepare for jobs list
2015-12-02 16:11:21 +01:00
Lisa P
a6e6cb0418 make adjustment to logs to take up less space on mobile 2015-12-02 16:11:20 +01:00
Lisa P
c7212174fb style settings button
hover states for repo tool buttons

style log buttons

dont forget the small arrow iconå
2015-12-02 16:11:17 +01:00
Lisa P
1ba9548ad0 first iteration build header styles
build header styles 2nd iteration

make job header use component too

cleanup templates and markup for repo page

styles for the repo header

rewrite styles for repo header, cleanup tabs
2015-12-02 16:11:14 +01:00
Lisa P
0176f9fb0c remove unused color variables
remove old icons
2015-12-02 16:11:10 +01:00
Lisa P
613e1dac80 make component for build header 2015-12-02 16:11:09 +01:00
Lisa P
f117c939dd rewrite markup for buildheader
fill in status icons
2015-12-02 16:11:05 +01:00
Henrik Hodne
465ddc81f6 Fix Xcode typo on landing page 2015-12-02 07:36:21 +01:00
Lisa P
f9d5e94d41 change _config to config 2015-12-01 12:09:07 +01:00
Lisa P
b482922dd7 also check for dist in GCE notice 2015-12-01 11:38:50 +01:00
Lisa P
00304798a6 add notice for gce builds 2015-11-27 16:55:01 +01:00
Lisa P
6771e53da6 fix width in plans 2015-11-24 12:06:02 +01:00
carlad
36a28290ec fix typo ulimited to unlimited 2015-11-24 11:38:20 +01:00
Lisa P
fbe9eb2fc4 fix safari flexbox issues for plans and logo 2015-11-23 13:01:18 +01:00
Lisa P
787b2fa4d1 fix button alignment bug 2015-11-23 12:47:57 +01:00
Lisa P
466588d1d6 remove flexbox on small screens because it causes too much troubl eon safari 2015-11-23 11:36:44 +01:00
Lisa P
362ff8d73a add a bit more spacing on feature list 2015-11-23 10:42:09 +01:00
Lisa P
41f69029a4 set favicon to default after logout 2015-11-23 10:38:32 +01:00
Lisa P
a604463c9d change nav change logic 2015-11-23 10:26:39 +01:00
Lisa P
af6e1ec69a remove another declaration of topbar color 2015-11-23 09:49:36 +01:00
Lisa P
6784f6f708 Merge pull request #407 from travis-ci/lp-pro-landingpage
pro landing page
2015-11-23 09:24:54 +01:00
Lisa P
d299f330ff align plan number 2015-11-23 09:11:58 +01:00
Lisa P
9b3440be1f change image path 2015-11-23 09:08:24 +01:00
Lisa P
4bbb90ce02 add logos and paths 2015-11-23 08:59:02 +01:00
Lisa P
3f2fb06791 update josh and flex-flow of team 2015-11-20 17:21:02 +01:00
Lisa P
193eccb179 fix typo on plans page 2015-11-20 16:35:12 +01:00
Lisa P
9acb4a2476 hot pink fixes (with flexbox) pt3 2015-11-20 14:00:19 +01:00
Lisa P
335b7a1302 hot pink fixes pt2 2015-11-20 13:39:51 +01:00
Lisa P
4d69e32534 hot pink fixes pt1 2015-11-20 13:21:58 +01:00
Lisa P
2eaf1e9c4d change nav for pro signed in 2015-11-19 18:01:39 +01:00
Lisa P
983ccd5e0a change team page route 2015-11-19 17:38:27 +01:00
Lisa P
b4ccfa5110 update team flags 2015-11-16 17:26:21 +01:00
Lisa P
834ab67ac2 add ga tracking to pro landing and pricing buttons 2015-11-16 14:58:34 +01:00
Lisa P
cfcd65c0b1 fill in missing links on pro pages 2015-11-16 13:00:47 +01:00
Lisa P
ff6455bab7 add osx_image to keys-map 2015-11-13 13:13:40 +01:00
Lisa P
6e8e48ab96 redirect to landing page after signout 2015-11-13 12:41:39 +01:00
Lisa P
46a3af254a change plans route on .org 2015-11-12 13:10:33 +01:00
Lisa P
b5ef87fd32 also remove obsolete files 2015-11-11 18:59:01 +01:00
Lisa P
7b04ae16ce rearrange some css files 2015-11-11 18:57:02 +01:00
Lisa P
701acecc56 change pro navigation and landing page redirects 2015-11-11 18:18:58 +01:00
Lisa P
88fd47002f add team pics 2015-11-11 17:17:07 +01:00
Lisa P
dfb303a0a3 add finaly styles to logo page 2015-11-11 16:58:20 +01:00
Lisa P
b23aaa8b02 add more logo page content 2015-11-11 13:13:36 +01:00