commit current status

This commit is contained in:
Lisa P 2015-09-07 15:53:14 +02:00
parent 8d5e7d5b87
commit dda2051d57
8 changed files with 78 additions and 37 deletions

View File

@ -0,0 +1,17 @@
`import Ember from 'ember'`
`import { gravatarImage } from 'travis/utils/urls'`
`import GithubUrlPropertievs from 'travis/mixins/github-url-properties'`
BranchesController = Ember.Controller.extend
actions:
tiggerBuild: (branch) ->
console.log('trigger build')
viewAllBuilds: (branch) ->
console.log('view all builds')
# updateFilter: (value) ->
# @set('_lastFilterValue', value)
# Ember.run.throttle this, @updateFilter, [], 200, false
`export default BranchesController`

View File

@ -41,10 +41,6 @@ Controller = Ember.ArrayController.extend
false
).property('tab', 'repo.builds', 'repo.branches')
displayNewBranchRows: (->
true if @get('tab') == 'branches'
).property('tab', 'repo.builds', 'repo.branches')
noticeData: (->
return {
repo: @get('repo'),

View File

@ -46,11 +46,11 @@ Router.map ->
@route 'search', path: '/search/:phrase'
@resource 'repo', path: '/:owner/:name', ->
@route 'index', path: '/'
@resource 'branches', path: '/branches'
@resource 'build', path: '/builds/:build_id'
@resource 'job', path: '/jobs/:job_id'
@resource 'builds', path: '/builds'
@resource 'pullRequests', path: '/pull_requests'
@resource 'branches', path: '/branches'
@resource 'requests', path: '/requests'
@resource 'caches', path: '/caches' if config.endpoints.caches
@resource 'request', path: '/requests/:request_id'

View File

@ -1,5 +1,25 @@
`import AbstractBuildsRoute from 'travis/routes/abstract-builds'`
`import Ember from 'ember'`
`import TravisRoute from 'travis/routes/basic'`
`import config from 'travis/config/environment'`
Route = TravisRoute.extend
model: (params) ->
apiEndpoint = config.apiEndpoint
repoId = @modelFor('repo').get('id')
options = {}
if @get('auth.signedIn')
options.headers = { Authorization: "token #{@auth.token()}" }
$.ajax("#{apiEndpoint}/repos/#{repoId}/branch/master", options).then (response) ->
console.log(response)
# response.repositories.sortBy('last_build.finished_at').filter( (repo) ->
# repo.last_build
# ).map( (repo) ->
# Ember.Object.create(repo)
# )
Route = AbstractBuildsRoute.extend(contentType: 'branches')
`export default Route`

View File

@ -9,29 +9,6 @@ Route = TravisRoute.extend
repo.fetchSettings().then (settings) ->
console.log(settings)
repo.set('settings', settings)
# return {
# settings: (->
# $.ajax('https://api.travis-ci.org/v3/repos/#{repo.id}/settings', {
# headers: {
# Authorization: 'token ' + @auth.token()
# }
# }).then (response) ->
# console.log(response);
# return response
# )
# env_vars: (->
# $.ajax('/settings/env_vars?repository_id={repo.id}', {
# headers: {
# Authorization: 'token ' + @auth.token()
# }
# }).then (response) ->
# console.log(response);
# return response
# )
# }
`export default Route`

View File

@ -0,0 +1,25 @@
<section>
<h2>Default Branch</h2>
</section>
<section>
<h2>Active Branches</h2>
</section>
<section>
<h2>Inactive Branches</h2>
</section>
{{!-- {{#if content.isLoaded}} --}}
{{branch-row build=build}}
{{!-- {{else}}
{{loading-indicator}}
{{/if}} --}}

View File

@ -1,13 +1,7 @@
{{#if content.isLoaded}}
<ul>
{{#each controller as |build|}}
{{#if displayNewBranchRows}}
{{branch-row build=build}}
{{else}}
{{builds-item build=build}}
{{/if}}
{{builds-item build=build}}
{{else}}
{{no-builds repo=noticeData isPR=displayPullRequests isBranch=displayBranches}}
{{/each}}

View File

@ -0,0 +1,12 @@
`import { test, moduleFor } from 'ember-qunit'`
moduleFor 'controller:branches', {
# Specify the other units that are required for this test.
# needs: ['controller:foo']
}
# Replace this with your real tests.
test 'it exists', (assert) ->
controller = @subject()
assert.ok controller