Show caches also if there're no caches for push builds
This commit fixes caches view to show caches also if only PR caches exist. Previous version checked for pushes only.
This commit is contained in:
parent
1fc1fdadfa
commit
bfb4946df8
|
@ -7,6 +7,10 @@ Controller = Ember.Controller.extend
|
||||||
|
|
||||||
isDeleting: false
|
isDeleting: false
|
||||||
|
|
||||||
|
cachesExist: (->
|
||||||
|
@get('model.pushes.length') || @get('model.pullRequests.length')
|
||||||
|
).property('model.pushes.length', 'model.pullRequests.length')
|
||||||
|
|
||||||
actions:
|
actions:
|
||||||
deleteRepoCache: ->
|
deleteRepoCache: ->
|
||||||
return if @get('isDeleting')
|
return if @get('isDeleting')
|
||||||
|
|
|
@ -10,10 +10,6 @@ Route = TravisRoute.extend
|
||||||
"#{model.name}"
|
"#{model.name}"
|
||||||
|
|
||||||
model: (params) ->
|
model: (params) ->
|
||||||
owner = {}
|
$.get(config.apiEndpoint + "/v3/owner/#{params.owner}?include=user.repositories,organization.repositories,build.commit,repository.active")
|
||||||
|
|
||||||
$.get(config.apiEndpoint + "/v3/owner/#{params.owner}?include=user.repositories,organization.repositories,build.commit,repository.active").then( (data) ->
|
|
||||||
data
|
|
||||||
)
|
|
||||||
|
|
||||||
`export default Route`
|
`export default Route`
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
{{#if model.pushes.length}}
|
{{#if cachesExist}}
|
||||||
|
|
||||||
<div class="caches-header">
|
<div class="caches-header">
|
||||||
<h1 class="caches-title">All caches <small>(<a href="http://docs.travis-ci.com/user/caching/" title="">documentation</a>)</small></h1>
|
<h1 class="caches-title">All caches <small>(<a href="http://docs.travis-ci.com/user/caching/" title="">documentation</a>)</small></h1>
|
||||||
<a href="#" {{action "deleteRepoCache"}} {{bind-attr class="isDeleting:deleting :delete-repo-caches :button--delete"}}>
|
<a href="#" {{action "deleteRepoCache"}} {{bind-attr class="isDeleting:deleting :delete-repo-caches :button--delete"}}>
|
||||||
Delete all repository caches
|
Delete all repository caches
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<h2 class="caches-title">Pushes</h2>
|
{{#if model.pushes.length}}
|
||||||
<ul id="caches" class="caches">
|
<h2 class="caches-title">Pushes</h2>
|
||||||
{{#each cache in model.pushes }}
|
<ul id="caches" class="caches">
|
||||||
{{caches-item cache=cache repo=repo caches=model.pushes}}
|
{{#each cache in model.pushes }}
|
||||||
{{/each}}
|
{{caches-item cache=cache repo=repo caches=model.pushes}}
|
||||||
</ul>
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{#if model.pullRequests.length}}
|
{{#if model.pullRequests.length}}
|
||||||
<h2 class="caches-title">Pull Requests</h2>
|
<h2 class="caches-title">Pull Requests</h2>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user