open-vault/ui/app/components/license-info.js
Matthew Irish 3f91ad5ca6
UI - fix perf standby feature display (#5971)
* add performanceStandbyCount to license model

* use count to determine if perf standby is an active feature

* rename test file and add tests for new perf standby behavior

* Update ui/app/templates/components/license-info.hbs

* update display language
2018-12-18 11:01:12 -06:00

40 lines
998 B
JavaScript

import Component from '@ember/component';
import { allFeatures } from 'vault/helpers/all-features';
import { computed } from '@ember/object';
export default Component.extend({
expirationTime: '',
startTime: '',
licenseId: '',
features: null,
model: null,
text: '',
showForm: false,
isTemporary: computed('licenseId', function() {
return this.licenseId === 'temporary';
}),
featuresInfo: computed('model', 'features', function() {
return allFeatures().map(feature => {
let active = this.features.includes(feature);
if (active && feature === 'Performance Standby') {
let count = this.model.performanceStandbyCount;
return {
name: feature,
active: count ? active : false,
count,
};
}
return { name: feature, active };
});
}),
saveModel() {},
actions: {
saveModel(text) {
this.saveModel(text);
},
toggleForm() {
this.toggleProperty('showForm');
},
},
});