github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/app/components/job-row.js (about) 1 import Component from '@ember/component'; 2 import { action } from '@ember/object'; 3 import { inject as service } from '@ember/service'; 4 import { lazyClick } from '../helpers/lazy-click'; 5 import { 6 classNames, 7 tagName, 8 attributeBindings, 9 } from '@ember-decorators/component'; 10 import classic from 'ember-classic-decorator'; 11 12 @classic 13 @tagName('tr') 14 @classNames('job-row', 'is-interactive') 15 @attributeBindings('data-test-job-row') 16 export default class JobRow extends Component { 17 @service router; 18 @service store; 19 @service system; 20 21 job = null; 22 23 // One of independent, parent, or child. Used to customize the template 24 // based on the relationship of this job to others. 25 context = 'independent'; 26 27 click(event) { 28 lazyClick([this.gotoJob, event]); 29 } 30 31 @action 32 gotoJob() { 33 const { job } = this; 34 this.router.transitionTo('jobs.job.index', job.idWithNamespace); 35 } 36 }