import {getVocabularyItemNameTranslated} from 'core/utils'; ItemUrgency.$inject = ['metadata']; export function ItemUrgency(metadata) { metadata.initialize(); return { scope: {urgency: '='}, template: [ '{{ short }}', ].join(''), link: function(scope, elem) { scope.$watch('urgency', (urgency) => { if (urgency) { var spec = metadata.urgencyByValue(urgency); if (spec) { scope.color = spec.color; scope.short = spec.short || urgency; scope.title = getVocabularyItemNameTranslated(spec); } } }); }, }; }