mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
26 lines
477 B
JavaScript
26 lines
477 B
JavaScript
import { assert } from '@ember/debug';
|
|
import { action } from '@ember/object';
|
|
import Component from '@glimmer/component';
|
|
|
|
export default class BreadcrumbsJob extends Component {
|
|
get job() {
|
|
return this.args.crumb.job;
|
|
}
|
|
|
|
get hasParent() {
|
|
return !!this.job.belongsTo('parent').id();
|
|
}
|
|
|
|
@action
|
|
onError(err) {
|
|
assert(`Error: ${err.message}`);
|
|
}
|
|
|
|
@action
|
|
fetchParent() {
|
|
if (this.hasParent) {
|
|
return this.job.get('parent');
|
|
}
|
|
}
|
|
}
|