github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/app/utils/breadcrumb-utils.js (about) 1 import PromiseObject from 'nomad-ui/utils/classes/promise-object'; 2 import { qpBuilder } from 'nomad-ui/utils/classes/query-params'; 3 4 export const jobCrumb = job => ({ 5 label: job.get('trimmedName'), 6 args: [ 7 'jobs.job.index', 8 job.get('plainId'), 9 qpBuilder({ 10 jobNamespace: job.get('namespace.name') || 'default', 11 }), 12 ], 13 }); 14 15 export const jobCrumbs = job => { 16 if (!job) return []; 17 18 if (job.get('parent.content')) { 19 return [ 20 PromiseObject.create({ 21 promise: job.get('parent').then(parent => jobCrumb(parent)), 22 }), 23 jobCrumb(job), 24 ]; 25 } else { 26 return [jobCrumb(job)]; 27 } 28 };