From 7a413010dd4f0172b657f90ab4d01f98e2bdf005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimi=CC=81r=20Orany=CC=81?= Date: Tue, 25 Oct 2016 14:31:04 +0200 Subject: [PATCH] MET-1290 do not tokenize if the metadata key is url --- .../assets/javascripts/modelcatalogue/util/names.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ModelCatalogueCorePlugin/grails-app/assets/javascripts/modelcatalogue/util/names.coffee b/ModelCatalogueCorePlugin/grails-app/assets/javascripts/modelcatalogue/util/names.coffee index 4bf831352d..7910e392df 100644 --- a/ModelCatalogueCorePlugin/grails-app/assets/javascripts/modelcatalogue/util/names.coffee +++ b/ModelCatalogueCorePlugin/grails-app/assets/javascripts/modelcatalogue/util/names.coffee @@ -5,11 +5,13 @@ propertyNamesFromQualifiers = {} names = { getNaturalName: (propertyName) -> return null if not propertyName + return propertyName if propertyName.indexOf('http') == 0 naturalNames[propertyName] = naturalNames[propertyName] ? (word[0].toUpperCase() + word[1..-1].toLowerCase() for word in propertyName.split /(?=[A-Z])(?=[A-Z])|\s+/g).join(' ').replace /([A-Z]) (?=([A-Z] ))/g, '$1' getPropertyNameFromType: (type) -> return null if not type + return type if type.indexOf('http') == 0 cached = propertyNamesFromTypes[type] return cached if cached simpleName = type @@ -21,10 +23,11 @@ names = { getPropertyNameFromQualifier: (type) -> return null if not type + return type if type.indexOf('http') == 0 propertyNamesFromQualifiers[type] = propertyNamesFromQualifiers[type] ? if type.indexOf('.') > -1 then type.substring(type.lastIndexOf('.') + 1) else type capitalize: (words) -> return words.replace /(?:^|\s)\S/g, (a) -> return a.toUpperCase() } -angular.module( 'mc.util.names', []).constant 'names', names \ No newline at end of file +angular.module( 'mc.util.names', []).constant 'names', names