Skip to content

Commit

Permalink
refact: add parent check to boolean (#14115)
Browse files Browse the repository at this point in the history
* refact: add parent check to boolean

* chore:  add changelog entry
  • Loading branch information
ChaiWithJai committed Aug 15, 2022
1 parent 9f51a5d commit 7079692
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .changelog/14115.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: Removes duplicate breadcrumb header when navigating from child job back to parent.
```
2 changes: 1 addition & 1 deletion ui/app/components/breadcrumbs/job.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions ui/app/components/breadcrumbs/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ 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}`);
}

@action
fetchParent() {
const hasParent = !!this.job.belongsTo('parent').id();
if (hasParent) {
if (this.hasParent) {
return this.job.get('parent');
}
}
Expand Down

0 comments on commit 7079692

Please sign in to comment.