open-nomad/ui/app/components/breadcrumbs/job.js
2021-12-21 07:46:27 -05:00

23 lines
458 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;
}
@action
onError(err) {
assert(`Error: ${err.message}`);
}
@action
fetchParent() {
const hasParent = !!this.job.belongsTo('parent').id();
if (hasParent) {
return this.job.get('parent');
}
}
}