open-nomad/ui/app/utils/properties/short-uuid.js
Phil Renaud 182bead357
[ui, mirage] Evaluation mocks (#12471)
* Linear and Branching mock evaluations

* De-comment

* test-trigger

* Making evaluation trees dynamic

* Reinstated job relationship on eval mock

* Dasherize job prefix back to normal

* Handle bug where UUIDKey is not present on job

* Appending node to eval

* Job ID as a passed property

* Remove unused import

* Branching evals set up as generatable
2022-04-27 12:11:24 -04:00

13 lines
350 B
JavaScript

import { computed } from '@ember/object';
// An Ember.Computed property for taking the first segment
// of a uuid.
//
// ex. id: 123456-7890-abcd-efghijk
// short: shortUUIDProperty('id') // 123456
export default function shortUUIDProperty(uuidKey) {
return computed(uuidKey, function () {
return this.get(uuidKey)?.split('-')[0];
});
}