diff --git a/.changelog/12765.txt b/.changelog/12765.txt new file mode 100644 index 000000000..a5bfd42dc --- /dev/null +++ b/.changelog/12765.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: fix broken link to task-groups in the Recent Allocations table in the Job Detail overview page. +``` diff --git a/ui/app/helpers/format-job-id.js b/ui/app/helpers/format-job-id.js new file mode 100644 index 000000000..2173a07e9 --- /dev/null +++ b/ui/app/helpers/format-job-id.js @@ -0,0 +1,8 @@ +import Helper from '@ember/component/helper'; + +export function formatJobId([jobId]) { + if (!jobId) return; + return JSON.parse(jobId).join('@'); +} + +export default Helper.helper(formatJobId); diff --git a/ui/app/routes/allocations/allocation.js b/ui/app/routes/allocations/allocation.js index f95ebc31e..2c2ebea16 100644 --- a/ui/app/routes/allocations/allocation.js +++ b/ui/app/routes/allocations/allocation.js @@ -17,12 +17,13 @@ export default class AllocationRoute extends Route.extend(WithWatchers) { // Preload the job for the allocation since it's required for the breadcrumb trail return super .model(...arguments) - .then((allocation) => - allocation - .get('job') + .then((allocation) => { + const jobId = allocation.belongsTo('job').id(); + return this.store + .findRecord('job', jobId) .then(() => this.store.findAll('namespace')) // namespaces belong to a job and are an asynchronous relationship so we can peak them later on - .then(() => allocation) - ) + .then(() => allocation); + }) .catch(notifyError(this)); } diff --git a/ui/app/templates/allocations/allocation/index.hbs b/ui/app/templates/allocations/allocation/index.hbs index e463ad9eb..6519c3629 100644 --- a/ui/app/templates/allocations/allocation/index.hbs +++ b/ui/app/templates/allocations/allocation/index.hbs @@ -5,11 +5,12 @@
{{this.error.description}}
++ {{this.error.description}} +
+