Change config keys to camel case
This commit is contained in:
parent
86b0e3a765
commit
141457c4f9
|
@ -2,7 +2,7 @@
|
|||
`import config from 'travis/config/environment'`
|
||||
|
||||
Adapter = DS.ActiveModelAdapter.extend
|
||||
host: config.api_endpoint
|
||||
host: config.apiEndpoint
|
||||
|
||||
ajaxOptions: (url, type, options) ->
|
||||
hash = @_super(url, type, options)
|
||||
|
|
|
@ -22,7 +22,7 @@ Controller = Ember.Controller.extend
|
|||
|
||||
billingUrl: (->
|
||||
id = if @get('account.type') == 'user' then 'user' else @get('account.login')
|
||||
"#{@get('config').billing_endpoint}/subscriptions/#{id}"
|
||||
"#{@get('config').billingEndpoint}/subscriptions/#{id}"
|
||||
).property('account.login', 'account.type')
|
||||
|
||||
`export default Controller`
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
`import config from 'travis/config/environment'`
|
||||
|
||||
initialize = (container) ->
|
||||
if config.ga_code
|
||||
if config.gaCode
|
||||
window._gaq = []
|
||||
_gaq.push(['_setAccount', config.ga_code])
|
||||
_gaq.push(['_setAccount', config.gaCode])
|
||||
|
||||
ga = document.createElement('script')
|
||||
ga.type = 'text/javascript'
|
||||
|
|
|
@ -19,11 +19,11 @@ Hook = Model.extend
|
|||
).property('ownerName', 'name')
|
||||
|
||||
urlGithub: (->
|
||||
"#{config.source_endpoint}/#{@get('slug')}"
|
||||
"#{config.sourceEndpoint}/#{@get('slug')}"
|
||||
).property()
|
||||
|
||||
urlGithubAdmin: (->
|
||||
"#{config.source_endpoint}/#{@get('slug')}/settings/hooks#travis_minibucket"
|
||||
"#{config.sourceEndpoint}/#{@get('slug')}/settings/hooks#travis_minibucket"
|
||||
).property()
|
||||
|
||||
toggle: ->
|
||||
|
|
|
@ -23,7 +23,7 @@ User = Model.extend
|
|||
).observes('isSyncing')
|
||||
|
||||
urlGithub: (->
|
||||
"#{config.source_endpoint}/#{@get('login')}"
|
||||
"#{config.sourceEndpoint}/#{@get('login')}"
|
||||
).property()
|
||||
|
||||
_rawPermissions: (->
|
||||
|
|
|
@ -12,7 +12,7 @@ Router = Ember.Router.extend
|
|||
didTransition: ->
|
||||
@_super.apply @, arguments
|
||||
|
||||
if config.ga_code
|
||||
if config.gaCode
|
||||
_gaq.push ['_trackPageview', location.pathname]
|
||||
|
||||
Router.map ->
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
`import Ember from 'ember'`
|
||||
`import TravisRoute from 'travis/routes/basic'`
|
||||
`import config from 'travis/config/environment'`
|
||||
|
||||
Route = TravisRoute.extend
|
||||
queryParams:
|
||||
filter: { replace: true }
|
||||
model: ->
|
||||
apiEndpoint = @get('config').api_endpoint
|
||||
apiEndpoint = config.apiEndpoint
|
||||
$.ajax(apiEndpoint + '/v3/repos?repository.active=true', {
|
||||
headers: {
|
||||
Authorization: 'token ' + @auth.token()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div id="about" class="box">
|
||||
<h4>How can we help?</h4>
|
||||
<ul>
|
||||
{{#if config.billing_endpoint}}
|
||||
{{#if config.billingEndpoint}}
|
||||
<li><a href="#" {{action displayCharm target="Travis"}}>Support Ticket</a></li>
|
||||
{{/if}}
|
||||
<li><a href="http://chat.travis-ci.com">Live Chat</a></li>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<h3>{{view.name}}</h3>
|
||||
|
||||
{{#if config.billing_endpoint}}
|
||||
{{#if config.billingEndpoint}}
|
||||
{{#if view.subscribed}}
|
||||
<a class="button activated" {{bind-attr href="billingUrl"}}>
|
||||
Subscription active!
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</h5>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{#if config.billing_endpoint}}
|
||||
{{#if config.billingEndpoint}}
|
||||
<li id="tab_billing" class="right">
|
||||
<h5>
|
||||
<a {{bind-attr href="billingUrl"}}>Billing</a>
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
<p>
|
||||
Integrating <a href="https://codeclimate.com">Code Climate's test coverage</a> reporting with your test
|
||||
suite on Travis CI allows to track changes in coverage over time. If you haven't tried it out already, <a
|
||||
{{bind-attr href=config.code_climate_url}}" target="_blank">sign
|
||||
{{bind-attr href=config.codeClimateUrl}}" target="_blank">sign
|
||||
up today</a> to improve your code's quality. New customers get 20% off for the first three months!
|
||||
</p>
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
</li>
|
||||
{{/unless}}
|
||||
|
||||
{{#if config.pages_endpoint}}
|
||||
{{#if config.pagesEndpoint}}
|
||||
<li class="menu legal">
|
||||
<p class="handle">
|
||||
<a {{bind-attr href="config.url_legal"}}>Legal</a>
|
||||
|
@ -77,9 +77,9 @@
|
|||
<li>
|
||||
{{#link-to "profile" class="signed-in"}}Accounts{{/link-to}}
|
||||
</li>
|
||||
{{#if config.billing_endpoint}}
|
||||
{{#if config.billingEndpoint}}
|
||||
<li>
|
||||
<a {{bind-attr href="config.billing_endpoint"}}>Billing</a>
|
||||
<a {{bind-attr href="config.billingEndpoint"}}>Billing</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
<li>
|
||||
|
|
|
@ -39,7 +39,7 @@ ajax = Em.Object.create
|
|||
method = method || "GET"
|
||||
method = method.toUpperCase()
|
||||
|
||||
endpoint = config.api_endpoint || ''
|
||||
endpoint = config.apiEndpoint || ''
|
||||
options = options || {}
|
||||
|
||||
token = Travis.sessionStorage.getItem('travis.token')
|
||||
|
|
|
@ -12,7 +12,7 @@ Auth = Ember.Object.extend
|
|||
Travis.sessionStorage.getItem('travis.token')
|
||||
|
||||
endpoint: (->
|
||||
config.api_endpoint
|
||||
config.apiEndpoint
|
||||
).property(),
|
||||
|
||||
signOut: ->
|
||||
|
|
|
@ -110,12 +110,12 @@ _githubReferenceRegexp = new RegExp("([\\w-]+)?\\/?([\\w-]+)?(?:#|gh-)(\\d+)", '
|
|||
_githubReferenceLink = (reference, current, matched) ->
|
||||
owner = matched.owner || current.owner
|
||||
repo = matched.repo || current.repo
|
||||
"<a href=\"#{config.source_endpoint}/#{owner}/#{repo}/issues/#{matched.number}\">#{reference}</a>"
|
||||
"<a href=\"#{config.sourceEndpoint}/#{owner}/#{repo}/issues/#{matched.number}\">#{reference}</a>"
|
||||
|
||||
_githubUserRegexp = new RegExp("\\B@([\\w-]+)", 'g')
|
||||
|
||||
_githubUserLink = (reference, username) ->
|
||||
"<a href=\"#{config.source_endpoint}/#{username}\">#{reference}</a>"
|
||||
"<a href=\"#{config.sourceEndpoint}/#{username}\">#{reference}</a>"
|
||||
|
||||
_githubCommitReferenceRegexp = new RegExp("([\\w-]+)?\\/([\\w-]+)?@([0-9A-Fa-f]+)", 'g')
|
||||
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
`import config from 'travis/config/environment'`
|
||||
|
||||
plainTextLog = (id) ->
|
||||
"#{config.api_endpoint}/jobs/#{id}/log.txt?deansi=true"
|
||||
"#{config.apiEndpoint}/jobs/#{id}/log.txt?deansi=true"
|
||||
|
||||
githubPullRequest = (slug, pullRequestNumber) ->
|
||||
"#{config.source_endpoint}/#{slug}/pull/#{pullRequestNumber}"
|
||||
"#{config.sourceEndpoint}/#{slug}/pull/#{pullRequestNumber}"
|
||||
|
||||
githubCommit = (slug, sha) ->
|
||||
"#{config.source_endpoint}/#{slug}/commit/#{sha}"
|
||||
"#{config.sourceEndpoint}/#{slug}/commit/#{sha}"
|
||||
|
||||
githubRepo = (slug) ->
|
||||
"#{config.source_endpoint}/#{slug}"
|
||||
"#{config.sourceEndpoint}/#{slug}"
|
||||
|
||||
githubWatchers = (slug) ->
|
||||
"#{config.source_endpoint}/#{slug}/watchers"
|
||||
"#{config.sourceEndpoint}/#{slug}/watchers"
|
||||
|
||||
githubNetwork = (slug) ->
|
||||
"#{config.source_endpoint}/#{slug}/network"
|
||||
"#{config.sourceEndpoint}/#{slug}/network"
|
||||
|
||||
githubAdmin = (slug) ->
|
||||
"#{config.source_endpoint}/#{slug}/settings/hooks#travis_minibucket"
|
||||
"#{config.sourceEndpoint}/#{slug}/settings/hooks#travis_minibucket"
|
||||
|
||||
statusImage = (slug, branch) ->
|
||||
if config.pro
|
||||
|
@ -31,9 +31,9 @@ statusImage = (slug, branch) ->
|
|||
ccXml = (slug) ->
|
||||
if config.pro
|
||||
token = Travis.__container__.lookup('controller:currentUser').get('token')
|
||||
"##{config.api_endpoint}/repos/#{slug}/cc.xml?token=#{token}"
|
||||
"##{config.apiEndpoint}/repos/#{slug}/cc.xml?token=#{token}"
|
||||
else
|
||||
"#{config.api_endpoint}/repos/#{slug}/cc.xml"
|
||||
"#{config.apiEndpoint}/repos/#{slug}/cc.xml"
|
||||
|
||||
email = (email) ->
|
||||
"mailto:#{email}"
|
||||
|
|
|
@ -19,7 +19,7 @@ module.exports = function(environment) {
|
|||
},
|
||||
|
||||
// defaults for running travis-web
|
||||
api_endpoint: 'https://api.travis-ci.org',
|
||||
apiEndpoint: 'https://api.travis-ci.org',
|
||||
source_endpoint: 'https://github.com',
|
||||
pusher: {
|
||||
key: '5df8ac576dcccf4fd076',
|
||||
|
|
|
@ -166,22 +166,22 @@ class Travis::Web::App
|
|||
def set_config(string, opts = {})
|
||||
# TODO: clean up
|
||||
config = {}
|
||||
config['api_endpoint'] = options[:api_endpoint] if options[:api_endpoint]
|
||||
config['pages_endpoint'] = options[:pages_endpoint] if options[:pages_endpoint]
|
||||
config['billing_endpoint'] = options[:billing_endpoint] if options[:billing_endpoint]
|
||||
config['source_endpoint'] = options[:source_endpoint] if options[:source_endpoint]
|
||||
config['apiEndpoint'] = options[:api_endpoint] if options[:api_endpoint]
|
||||
config['pagesEndpoint'] = options[:pages_endpoint] if options[:pages_endpoint]
|
||||
config['billingEndpoint'] = options[:billing_endpoint] if options[:billing_endpoint]
|
||||
config['sourceEndpoint'] = options[:source_endpoint] if options[:source_endpoint]
|
||||
pusher = {}
|
||||
pusher['key'] = options[:pusher_key] if options[:pusher_key]
|
||||
pusher['host'] = options[:pusher_host] if options[:pusher_host]
|
||||
pusher['path'] = options[:pusher_path] if options[:pusher_path]
|
||||
config['pusher'] = pusher
|
||||
|
||||
config['ga_code'] = options[:ga_code] if options[:ga_code]
|
||||
config['gaCode'] = options[:ga_code] if options[:ga_code]
|
||||
config['pro'] = options[:pro] if options[:pro]
|
||||
config['enterprise'] = options[:enterprise] if options[:enterprise]
|
||||
|
||||
config['code_climate'] = options[:code_climate] if options[:code_climate]
|
||||
config['code_climate_url'] = options[:code_climate_url] if options[:code_climate_url]
|
||||
config['codeClimate'] = options[:code_climate] if options[:code_climate]
|
||||
config['codeClimateUrl'] = options[:code_climate_url] if options[:code_climate_url]
|
||||
|
||||
regexp = %r(<meta name="travis/config/environment"\s+content="([^"]+)")
|
||||
string.gsub!(regexp) do
|
||||
|
|
Loading…
Reference in New Issue
Block a user