2017-12-15 21:39:18 +00:00
|
|
|
import Component from '@ember/component';
|
2022-01-03 17:08:07 +00:00
|
|
|
import { action } from '@ember/object';
|
|
|
|
import { inject as service } from '@ember/service';
|
2017-09-26 18:57:46 +00:00
|
|
|
import { lazyClick } from '../helpers/lazy-click';
|
2020-06-10 13:49:16 +00:00
|
|
|
import { classNames, tagName } from '@ember-decorators/component';
|
|
|
|
import classic from 'ember-classic-decorator';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@classic
|
|
|
|
@tagName('tr')
|
|
|
|
@classNames('job-row', 'is-interactive')
|
|
|
|
export default class JobRow extends Component {
|
2022-01-03 17:08:07 +00:00
|
|
|
@service router;
|
2020-06-10 13:49:16 +00:00
|
|
|
@service store;
|
2022-01-03 17:08:07 +00:00
|
|
|
@service system;
|
2018-02-12 23:27:19 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
job = null;
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-09-19 00:33:43 +00:00
|
|
|
// One of independent, parent, or child. Used to customize the template
|
|
|
|
// based on the relationship of this job to others.
|
|
|
|
context = 'independent';
|
|
|
|
|
2017-09-19 14:47:10 +00:00
|
|
|
click(event) {
|
2022-01-03 17:08:07 +00:00
|
|
|
lazyClick([this.gotoJob, event]);
|
|
|
|
}
|
|
|
|
|
|
|
|
@action
|
|
|
|
gotoJob() {
|
|
|
|
const { job } = this;
|
2022-01-03 17:34:02 +00:00
|
|
|
this.router.transitionTo('jobs.job', job.plainId, {
|
2022-01-03 17:08:07 +00:00
|
|
|
queryParams: { namespace: job.get('namespace.name') },
|
|
|
|
});
|
2020-06-10 13:49:16 +00:00
|
|
|
}
|
|
|
|
}
|