open-nomad/ui/app/components/children-status-bar.js
Buck Doyle 89136cbf6a Add massaged results of class codemod
Manual interventions:
• decorators on the same line for service and controller
  injections and most computed property macros
• preserving import order when possible, both per-line
  and intra-line
• moving new imports to the bottom
• removal of classic decorator for trivial cases
• conversion of init to constructor when appropriate
2020-06-10 16:18:42 -05:00

27 lines
813 B
JavaScript

import { computed } from '@ember/object';
import DistributionBar from './distribution-bar';
import classic from 'ember-classic-decorator';
@classic
export default class ChildrenStatusBar extends DistributionBar {
layoutName = 'components/distribution-bar';
job = null;
'data-test-children-status-bar' = true;
@computed('job.{pendingChildren,runningChildren,deadChildren}')
get data() {
if (!this.job) {
return [];
}
const children = this.job.getProperties('pendingChildren', 'runningChildren', 'deadChildren');
return [
{ label: 'Pending', value: children.pendingChildren, className: 'queued' },
{ label: 'Running', value: children.runningChildren, className: 'running' },
{ label: 'Dead', value: children.deadChildren, className: 'complete' },
];
}
}