travis-web/app/components/env-var.coffee
2015-07-16 15:46:39 +02:00

30 lines
643 B
CoffeeScript

`import Ember from 'ember'`
EnvVarComponent = Ember.Component.extend
classNames: ['settings-envvar']
classNameBindings: ['envVar.public:is-public']
isDeleting: false
validates:
name: ['presence']
actionType: 'Save'
showValueField: Ember.computed.alias('public')
value: ( (key, value) ->
if @get('envVar.public')
@get('envVar.value')
else
'••••••••••••••••'
).property('envVar.value', 'envVar.public')
actions:
delete: ->
return if @get('isDeleting')
@set('isDeleting', true)
@get('envVar').destroyRecord()
`export default EnvVarComponent`