Merge pull request #392 from travis-ci/fix-owner-on-magnum
Authenticate owner request
This commit is contained in:
commit
58f540457b
|
@ -7,7 +7,6 @@ Route = TravisRoute.extend
|
||||||
filter: { replace: true }
|
filter: { replace: true }
|
||||||
model: ->
|
model: ->
|
||||||
apiEndpoint = config.apiEndpoint
|
apiEndpoint = config.apiEndpoint
|
||||||
console.log(@auth)
|
|
||||||
$.ajax(apiEndpoint + '/v3/repos?repository.active=true', {
|
$.ajax(apiEndpoint + '/v3/repos?repository.active=true', {
|
||||||
# $.ajax(apiEndpoint + '/v3/#{params.owner}?include=user.repositories,organization.repositories,build.commit', {
|
# $.ajax(apiEndpoint + '/v3/#{params.owner}?include=user.repositories,organization.repositories,build.commit', {
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
@ -4,11 +4,15 @@
|
||||||
`import config from 'travis/config/environment'`
|
`import config from 'travis/config/environment'`
|
||||||
|
|
||||||
Route = TravisRoute.extend
|
Route = TravisRoute.extend
|
||||||
|
|
||||||
deactivate: ->
|
deactivate: ->
|
||||||
@controllerFor('loading').set('layoutName', null)
|
@controllerFor('loading').set('layoutName', null)
|
||||||
|
|
||||||
model: (params) ->
|
model: (params) ->
|
||||||
$.get(config.apiEndpoint + "/v3/owner/#{params.owner}")
|
options = {}
|
||||||
|
if @get('auth.signedIn')
|
||||||
|
options.headers = { Authorization: "token #{@auth.token()}" }
|
||||||
|
$.ajax(config.apiEndpoint + "/v3/owner/#{params.owner}", options)
|
||||||
|
|
||||||
beforeModel: ->
|
beforeModel: ->
|
||||||
@controllerFor('loading').set('layoutName', 'simple')
|
@controllerFor('loading').set('layoutName', 'simple')
|
||||||
|
|
|
@ -10,6 +10,9 @@ Route = TravisRoute.extend
|
||||||
"#{model.name}"
|
"#{model.name}"
|
||||||
|
|
||||||
model: (params, transition) ->
|
model: (params, transition) ->
|
||||||
$.get(config.apiEndpoint + "/v3/owner/#{transition.params.owner.owner}?include=user.repositories,organization.repositories,build.commit,repository.active")
|
options = {}
|
||||||
|
if @get('auth.signedIn')
|
||||||
|
options.headers = { Authorization: "token #{@auth.token()}" }
|
||||||
|
$.ajax(config.apiEndpoint + "/v3/owner/#{transition.params.owner.owner}?include=user.repositories,organization.repositories,build.commit,repository.active", options)
|
||||||
|
|
||||||
`export default Route`
|
`export default Route`
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{{#if repo.private }}
|
{{!-- {{#if repo.private }}
|
||||||
<div class="tile-lock"><span class="icon icon-lock"></span></div>
|
<div class="tile-lock"><span class="icon icon-lock"></span></div>
|
||||||
{{/if}}
|
{{/if}} --}}
|
||||||
<div class="repo">
|
<div class="repo">
|
||||||
{{#if isAnimating}}
|
{{#if isAnimating}}
|
||||||
<span class="icon-owner-receiving"><i></i><i></i><i></i></span>
|
<span class="icon-owner-receiving"><i></i><i></i><i></i></span>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user