travis-web/app/components/env-var.js
Piotr Sarnacki 4b71704b1c [deprecations] Don't use second argument in a property
This makes Ember.js think that we're trying to use the property as
setter and it's deprecated
2016-01-07 11:18:05 +01:00

29 lines
716 B
JavaScript

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