From 23f1cb54b48ac91887ade6d7643ff3829df3d41a Mon Sep 17 00:00:00 2001 From: Michael Klein Date: Thu, 17 Feb 2022 14:38:27 +0100 Subject: [PATCH] fix: breadcrumbs allocations due to recent namespace changes * change the breadcrumbs generation to use `idWithNamespace` * adapt tests to reflect new URLs for jobs with namespaces --- ui/app/controllers/allocations/allocation.js | 3 +-- ui/app/controllers/jobs/job/task-group.js | 7 +------ ui/tests/acceptance/task-detail-test.js | 4 ++-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/ui/app/controllers/allocations/allocation.js b/ui/app/controllers/allocations/allocation.js index 142c9f3ff..b6ebcbacd 100644 --- a/ui/app/controllers/allocations/allocation.js +++ b/ui/app/controllers/allocations/allocation.js @@ -37,9 +37,8 @@ export default class AllocationsAllocationController extends Controller { label: allocation.taskGroupName, args: [ 'jobs.job.task-group', - job.plainId, + job.idWithNamespace, allocation.taskGroupName, - jobQueryParams, ], }, { diff --git a/ui/app/controllers/jobs/job/task-group.js b/ui/app/controllers/jobs/job/task-group.js index 592f1508e..30f29fb3a 100644 --- a/ui/app/controllers/jobs/job/task-group.js +++ b/ui/app/controllers/jobs/job/task-group.js @@ -174,12 +174,7 @@ export default class TaskGroupController extends Controller.extend( return { title: 'Task Group', label: name, - args: [ - 'jobs.job.task-group', - job, - name, - qpBuilder({ jobNamespace: job.get('namespace.name') || 'default' }), - ], + args: ['jobs.job.task-group', job, name], }; } } diff --git a/ui/tests/acceptance/task-detail-test.js b/ui/tests/acceptance/task-detail-test.js index b9adbb3d0..ab3f8c167 100644 --- a/ui/tests/acceptance/task-detail-test.js +++ b/ui/tests/acceptance/task-detail-test.js @@ -375,7 +375,7 @@ module('Acceptance | task detail (different namespace)', function (hooks) { await Layout.breadcrumbFor('jobs.job.index').visit(); assert.equal( currentURL(), - `/jobs/${job.id}?namespace=other-namespace`, + `/jobs/${job.id}@other-namespace`, 'Job breadcrumb links correctly' ); @@ -383,7 +383,7 @@ module('Acceptance | task detail (different namespace)', function (hooks) { await Layout.breadcrumbFor('jobs.job.task-group').visit(); assert.equal( currentURL(), - `/jobs/${job.id}/${taskGroup}?namespace=other-namespace`, + `/jobs/${job.id}@other-namespace/${taskGroup}`, 'Task Group breadcrumb links correctly' );