open-nomad/ui/app/helpers/format-id.js
Jai 87a3bd5393
bug: hitting refresh on /jobs/:jobId/services/:serviceId doesn't display data (#15431)
* ui: create id helper

* refact: handle async relationships

* chore: prettify template

* ui: helper async escape hatch

* refact: use escape hatch for tooltip
2022-12-01 10:45:31 -05:00

9 lines
233 B
JavaScript

import Helper from '@ember/component/helper';
export function formatID([model, relationship]) {
const id = model.belongsTo(relationship).id();
return { id, shortId: id.split('-')[0] };
}
export default Helper.helper(formatID);