2021-12-13 15:29:25 +00:00
|
|
|
import { assert } from '@ember/debug';
|
2021-12-08 19:26:25 +00:00
|
|
|
import { action } from '@ember/object';
|
|
|
|
import Component from '@glimmer/component';
|
|
|
|
|
|
|
|
export default class BreadcrumbsJob extends Component {
|
|
|
|
get job() {
|
|
|
|
return this.args.crumb.job;
|
|
|
|
}
|
|
|
|
|
2021-12-13 15:29:25 +00:00
|
|
|
@action
|
|
|
|
onError(err) {
|
|
|
|
assert(`Error: ${err.message}`);
|
|
|
|
}
|
|
|
|
|
2021-12-08 19:26:25 +00:00
|
|
|
@action
|
|
|
|
fetchParent() {
|
2021-12-09 16:32:28 +00:00
|
|
|
const hasParent = !!this.job.belongsTo('parent').id();
|
|
|
|
if (hasParent) {
|
|
|
|
return this.job.get('parent');
|
|
|
|
}
|
2021-12-08 19:26:25 +00:00
|
|
|
}
|
|
|
|
}
|