2018-09-25 16:28:26 +00:00
|
|
|
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({
|
2018-09-25 16:28:26 +00:00
|
|
|
version: service(),
|
2018-04-03 14:16:57 +00:00
|
|
|
onFeaturesChange: observer('version.version', function() {
|
|
|
|
this.recompute();
|
|
|
|
}),
|
|
|
|
compute([sku]) {
|
|
|
|
if (sku !== 'OSS' && sku !== 'Enterprise') {
|
2018-09-25 16:28:26 +00:00
|
|
|
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}`);
|
|
|
|
},
|
|
|
|
});
|