2023-04-10 15:36:59 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
2022-01-05 17:45:05 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
|
|
|
import Component from '@glimmer/component';
|
2020-07-09 16:37:00 +00:00
|
|
|
|
2022-01-05 17:45:05 +00:00
|
|
|
export default class JobSubnav extends Component {
|
|
|
|
@service can;
|
2022-08-17 16:59:33 +00:00
|
|
|
@service keyboard;
|
2022-01-05 17:45:05 +00:00
|
|
|
|
|
|
|
get shouldRenderClientsTab() {
|
|
|
|
const { job } = this.args;
|
|
|
|
return (
|
|
|
|
job?.hasClientStatus && !job?.hasChildren && this.can.can('read client')
|
|
|
|
);
|
|
|
|
}
|
2023-05-16 20:07:12 +00:00
|
|
|
|
|
|
|
// Periodic and Parameterized jobs "parents" are not jobs unto themselves, but more like summaries.
|
|
|
|
// They should not have tabs for allocations, evaluations, etc.
|
|
|
|
// but their child jobs, and other job types generally, should.
|
|
|
|
get shouldHideNonParentTabs() {
|
|
|
|
return this.args.job?.hasChildren;
|
|
|
|
}
|
2022-01-05 17:45:05 +00:00
|
|
|
}
|