diff --git a/ui/app/components/job-subnav.js b/ui/app/components/job-subnav.js index 7d758bfb9..a01952f03 100644 --- a/ui/app/components/job-subnav.js +++ b/ui/app/components/job-subnav.js @@ -16,4 +16,11 @@ export default class JobSubnav extends Component { job?.hasClientStatus && !job?.hasChildren && this.can.can('read client') ); } + + // 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; + } } diff --git a/ui/app/templates/components/job-subnav.hbs b/ui/app/templates/components/job-subnav.hbs index 2670733c0..db100fb5b 100644 --- a/ui/app/templates/components/job-subnav.hbs +++ b/ui/app/templates/components/job-subnav.hbs @@ -44,43 +44,45 @@ {{/if}} -
  • - - Allocations - -
  • -
  • - - Evaluations - -
  • - {{#if this.shouldRenderClientsTab}} -
  • + {{#unless this.shouldHideNonParentTabs}} +
  • + Allocations + +
  • +
  • + - Clients + Evaluations
  • - {{/if}} -
  • - - Services - -
  • + {{#if this.shouldRenderClientsTab}} +
  • + + Clients + +
  • + {{/if}} +
  • + + Services + +
  • + {{/unless}} \ No newline at end of file diff --git a/ui/tests/helpers/module-for-job.js b/ui/tests/helpers/module-for-job.js index 2538d6cf1..ee1785236 100644 --- a/ui/tests/helpers/module-for-job.js +++ b/ui/tests/helpers/module-for-job.js @@ -101,16 +101,6 @@ export default function moduleForJob( assert.equal(decodeURIComponent(currentURL()), expectedURL); }); - test('the subnav links to evaluations', async function (assert) { - await JobDetail.tabFor('evaluations').visit(); - - const expectedURL = job.namespace - ? `/jobs/${job.name}@${job.namespace}/evaluations` - : `/jobs/${job.name}/evaluations`; - - assert.equal(decodeURIComponent(currentURL()), expectedURL); - }); - test('the title buttons are dependent on job status', async function (assert) { if (job.status === 'dead') { assert.ok(JobDetail.start.isPresent); @@ -229,6 +219,16 @@ export default function moduleForJob( 'Allocations are not shown in the summary section' ); }); + } else { + test('the subnav links to evaluations', async function (assert) { + await JobDetail.tabFor('evaluations').visit(); + + const expectedURL = job.namespace + ? `/jobs/${job.name}@${job.namespace}/evaluations` + : `/jobs/${job.name}/evaluations`; + + assert.equal(decodeURIComponent(currentURL()), expectedURL); + }); } for (var testName in additionalTests) {