refact: add parent check to boolean (#14115)

* refact: add parent check to boolean

* chore:  add changelog entry
This commit is contained in:
Jai 2022-08-15 13:42:08 -04:00 committed by GitHub
parent d7def242b8
commit 81cac313c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

3
.changelog/14115.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
ui: Removes duplicate breadcrumb header when navigating from child job back to parent.
```

View File

@ -8,7 +8,7 @@
</li>
{{/if}}
{{#if trigger.data.isSuccess}}
{{#if trigger.data.result}}
{{#if (and trigger.data.result this.hasParent)}}
<li>
<LinkTo
@route="jobs.job.index"

View File

@ -7,6 +7,10 @@ export default class BreadcrumbsJob extends Component {
return this.args.crumb.job;
}
get hasParent() {
return !!this.job.belongsTo('parent').id();
}
@action
onError(err) {
assert(`Error: ${err.message}`);
@ -14,8 +18,7 @@ export default class BreadcrumbsJob extends Component {
@action
fetchParent() {
const hasParent = !!this.job.belongsTo('parent').id();
if (hasParent) {
if (this.hasParent) {
return this.job.get('parent');
}
}