[ui] Remove unnecessary subnav for parent jobs (#17190)
* Nest job subnav in a parent-check * Move the evaluation tab test to withn an else of the children condition
This commit is contained in:
parent
2426aae832
commit
817b2cab9b
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
</LinkTo>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{#unless this.shouldHideNonParentTabs}}
|
||||
<li data-test-tab="allocations">
|
||||
<LinkTo
|
||||
@route="jobs.job.allocations"
|
||||
|
@ -82,5 +83,6 @@
|
|||
Services
|
||||
</LinkTo>
|
||||
</li>
|
||||
{{/unless}}
|
||||
</ul>
|
||||
</div>
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue