OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/app/assets/javascripts/angular/helpers/components/custom-field-helper.js

14 lines
435 B

angular.module('openproject.uiComponents')
.constant('CUSTOM_FIELD_PREFIX', 'cf_')
.service('CustomFieldHelper', ['CUSTOM_FIELD_PREFIX', function(CUSTOM_FIELD_PREFIX) {
return {
isCustomFieldKey: function(key) {
return key.substr(0, CUSTOM_FIELD_PREFIX.length) === CUSTOM_FIELD_PREFIX;
},
getCustomFieldId: function(cfKey) {
return parseInt(cfKey.substr(CUSTOM_FIELD_PREFIX.length, 10), 10);
}
};
}]);