2017-12-15 21:39:18 +00:00
|
|
|
import { computed } from '@ember/object';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
|
|
|
// 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) {
|
2021-12-28 14:45:20 +00:00
|
|
|
return computed(uuidKey, function () {
|
2022-04-27 16:11:24 +00:00
|
|
|
return this.get(uuidKey)?.split('-')[0];
|
2017-09-19 14:47:10 +00:00
|
|
|
});
|
|
|
|
}
|