Commit Graph

22 Commits

Author SHA1 Message Date
Justine Arreche
d324319a96 changes made to profile page including increased type size for readability, color styling and gravatar border radius increase 2014-01-03 19:10:58 -05:00
Piotr Sarnacki
92616251bb Revert "Update code for newest ember-model"
This reverts commit 1594130ff3.
2013-09-06 22:14:06 +02:00
Piotr Sarnacki
1594130ff3 Update code for newest ember-model 2013-09-06 19:37:06 +02:00
Piotr Sarnacki
12aaeeef2d Add records to record arrays in a runloop
When adding records just after loading them, the elements in the UI
might have to be updated, which may trigger `get` on associations right
away. As an effect, even if we load a few records on an event (like
repository on build:started event), ember model may end up fetching the
record.

This commit fixes such occurrences by adding record to record arrays in
a run loop, so newly created records will be added at once, after the
event was served.
2013-09-04 21:20:10 +02:00
Piotr Sarnacki
003c6e7b01 Add unload method on model 2013-08-05 03:24:39 +02:00
Piotr Sarnacki
66ed172888 Refactor the way we insert new records with pusher
Previousy I was using find to ensure that the record is materialized,
but the new version is much lighter - it uses Model#load to load the
record directly
2013-08-03 15:09:18 +02:00
Piotr Sarnacki
549efc8046 Add resetData, unload and removeFromCache to Travis.Model 2013-07-31 13:56:19 +02:00
Piotr Sarnacki
c0cb223aeb Update Travis.Model to work with Ember Model 2013-07-31 13:51:28 +02:00
Piotr Sarnacki
4337949dd4 Fix the rest of the specs 2013-03-04 13:29:00 +01:00
Piotr Sarnacki
83fb0ebb2c Fix incomplete implementation 2013-02-21 23:22:54 +01:00
Piotr Sarnacki
f0e95ddd3f Main view mostly works on new router 2013-02-21 23:22:51 +01:00
Piotr Sarnacki
49f1c74a12 Extend message on loaded models and fix undefined ke problem 2012-11-06 11:47:12 +01:00
Piotr Sarnacki
eef8e55cfe Check if key is defined in incomplete checks 2012-10-31 14:56:17 +01:00
Piotr Sarnacki
6bf5bd3356 Needed to move part of incomplete impl. to store
When using get with path (eg. get('foo.bar.baz')), get method is called
only on the current object and computed property will be called. Because
there is no easy way to overwrite the computed property, I moved
incomplete record loading to ember-data. It's not DRY and it should be
rewritten, but I don't want to do it at this point as we will need to
completely rewrite it when upgrading ember-data.
2012-10-31 00:46:13 +01:00
Piotr Sarnacki
5ae7e1d046 Check also associations for incomplete records 2012-10-28 23:43:17 +01:00
Piotr Sarnacki
300ad58516 Fix incomplete implementation
While testing in the wild I spotted a few problems with it:

* it didn't work for camel case names.
* it was sometimes setting loaded data too late - it needed to use find
  and then save data on the record. Instead it should save data in
  special array saved on store, indexed by clientId
* there is already method to get attributes in ember-data, it just
  doesn't work with Travis.Foo.get('attributes'), it needs
  Ember.get(Travis.Foo, 'attributes') - it makes implementation much
  shorter
2012-10-22 02:54:48 +02:00
Piotr Sarnacki
9d07ef79ac Fix bug with undefined loadedAttributes 2012-10-16 17:47:03 +02:00
Piotr Sarnacki
c05ce673bf Load incomplete records when trying to get unknown attribute
In order to minimize ajax requests, I implemented isComplete property,
which can be used to check if record is fetched from the API or if it
was just partially loaded (for example by pusher event). This is nice in
terms of requests reduction, but caries risk of showing incomplete data.

This commit fixes this situation by saving which attributes were
provided on "incomplete" load and triggering refresh when any unknown
attribute is tried to be fetched.

The implementation is really simple and will probably need refactoring,
but I would like to test it in the wild before putting much more time
into it.
2012-10-16 03:05:38 +02:00
Sven Fuchs
ed94cb7329 Merge branch 'master' of github.com:travis-ci/travis-web
Conflicts:
	assets/scripts/lib/travis/model.coffee
	public/scripts/app.js
	public/scripts/min/app.js
	public/version
2012-10-13 21:22:42 +02:00
Sven Fuchs
e7a26524d4 move select() functionality to Travis.Model and reuse it for accounts 2012-10-13 21:20:11 +02:00
Piotr Sarnacki
c707135ccd First spike of 'isComplete' functionality
When we get payload from pusher, we usually don't send the entire
record. Initially such records where fetched from server right away to
get missing data. This was done becuase Ember can't tell if given data
is complete or not and just assumes that the record is loaded.

To not fire unneeded request, this code sets incomplete flag on records
loaded from pusher and loads the rest of the data only if needed.
2012-10-13 20:47:21 +02:00
Sven Fuchs
7b47863014 extract paths in Assetfile; rename javascripts to scripts, stylesheets to styles 2012-10-03 17:13:02 +02:00