Almost all actions on views were not properly handled, because they were still
methods directly on a view object rather than in `actions` property. This commit
fixes it.
This commit starts refactoring of one of the remaining areas where we do weird
tricks to get the desired behaviour. Namely, we were treating "my_repositories"
and "recent" not as individual routes with separate URLs, but only different
states on the repos controller. Such approach leads to various problem with
connecting outlets on rerenders (ie. we don't explicitly connect outlets when
changing from one view to another programatically).
A new cleaner way is to change both tabs into routes.
After upgrading ember to 1.8.1 tests pass, but I found a few cases where
things break (for example when navigating between certain routes). I'm
reverting for now.
This reverts commit fa5e9179af, reversing
changes made to 978c887123.
When requeue icon was clicked 2 times it was sometimes the case that we
sent 2 requests. This commit prevents that and also adds a little nice
indicator instead of restart button while we're sending the request.
I found the commit that caused the bug that caused me to do the last
revert. I'm therefore reverting the previous revert and I will be
committing a revert that reverts the commit that introduced the bug. See
next commit.
This reverts commit db2d38a7af.
If you can see the repository, then you should also be able to see the
status of said repository (and status image), so you should also be able
to copy the link to a status image.
Closetravis-ci/travis-ci#1881.
We observe last build on the repo in order to show the freshest build on
repo page. I moved it to router in order to keep such observers in the
same place, but this was not a wise move. To make it work properly
observer needs to be removed when moving to some other part (like
build's page). The problem is that deactivate function is not called
when we move to the other route in the same nesting. We have our own
'activate' function on repoController, which is better suited for
handling this task.
This change pushes the cog menu to the top, where it belongs, as it
now only includes repository-relevant actions. The icons now reflect
things relating to the build/job itself, and have replace the cog
meny.
The hack which is needed for wrong outlet behaviour renders a template
when outlet is not rendered automatically, but it was done immediately.
Because of that when changing routes from index to job route, sometimes
the hack was kicking in and rendering build instead of job template.
This commit fixes it to check if rendering is needed in "afterRender"
phase on runloop.
Previously we were checking if we should display an error message by
adding if statements in a template. This is not the best way to do
it, because it clutters a template and makes code harder to follow.
In this commit I move rendering error templates to the router. Code for
rendering error when there is no builds is not the best way to do it
either, but it can be improved when new router changes are merged to
Ember's master and a way Ember Data is handling promises is revised and
improved.
* if user is logged out, the default tab should be 'recent'
* when user logs in, the tab is switched to 'my repositories'
* when user logs out, my repositories is hidden again and tab is
switched to 'recent'