Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refact: add parent check to boolean #14115

Merged
merged 2 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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