open-vault/ui/app/helpers/is-version.js

17 lines
457 B
JavaScript
Raw Normal View History

2018-04-03 14:16:57 +00:00
import Ember from 'ember';
const { Helper, inject, observer } = Ember;
export default Helper.extend({
version: inject.service(),
onFeaturesChange: observer('version.version', function() {
this.recompute();
}),
compute([sku]) {
if (sku !== 'OSS' && sku !== 'Enterprise') {
Ember.assert(`${sku} is not one of the available values for Vault versions.`, false);
return false;
}
return this.get(`version.is${sku}`);
},
});