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

19 lines
552 B
JavaScript
Raw Normal View History

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