open-vault/ui/app/helpers/is-version.js
2018-04-03 09:16:57 -05:00

17 lines
457 B
JavaScript

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}`);
},
});