open-vault/ui/app/helpers/is-version.js
Matthew Irish 97767717aa
UI - no ember cli eslint (#6613)
* remove ember-cli-eslint, add eslint, run eslint in tests

* ignore story files for now

* fix or ignore linting
2019-04-18 20:50:05 -05:00

20 lines
604 B
JavaScript

import { inject as service } from '@ember/service';
import { assert } from '@ember/debug';
import Helper from '@ember/component/helper';
import { observer } from '@ember/object';
export default Helper.extend({
version: service(),
/* eslint-disable-next-line ember/no-observers */
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);
return false;
}
return this.get(`version.is${sku}`);
},
});