From d7ce9f1d2c2b3a2d9e1124be6e343aa9584e9d15 Mon Sep 17 00:00:00 2001 From: ioancrisan Date: Mon, 9 Sep 2013 14:41:22 +0300 Subject: [PATCH] Added support for display name in DataProperty and NavigationProperty --- Breeze.Client/Metadata/metadata.example.js | 1 + Breeze.Client/Metadata/metadata.schema.js | 8 ++++++++ Breeze.Client/Scripts/IBlade/a40_entityMetadata.js | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/Breeze.Client/Metadata/metadata.example.js b/Breeze.Client/Metadata/metadata.example.js index f151910ec..2023a1642 100644 --- a/Breeze.Client/Metadata/metadata.example.js +++ b/Breeze.Client/Metadata/metadata.example.js @@ -96,6 +96,7 @@ var x = { }, { "name": "categoryName", + "displayName": "Category name", "dataType": "String", "isNullable": false, "defaultValue": "", diff --git a/Breeze.Client/Metadata/metadata.schema.js b/Breeze.Client/Metadata/metadata.schema.js index 7b0f44a2b..3398b6cfa 100644 --- a/Breeze.Client/Metadata/metadata.schema.js +++ b/Breeze.Client/Metadata/metadata.schema.js @@ -131,6 +131,10 @@ var x = { "description": "The server side side name of this property. Either name or nameOnServer must be specified and either is sufficient.", "type": "string" }, + "displayName": { + "description": "The property display name. It is used for example in validation, replacing the %displayName% macro definition.", + "type": "string" + }, "dataType": { "description": "If present, the complexType name should be omitted.", "enum": [ @@ -208,6 +212,10 @@ var x = { "description": "The server side side name of this property. Either name or nameOnServer must be specified and either is sufficient.", "type": "string" }, + "displayName": { + "description": "The property display name. It is used for example in validation, replacing the %displayName% macro definition.", + "type": "string" + }, "entityTypeName": { "description": "The type of the entity or collection of entities returned by this property.", "$ref": "#/definitions/structuralTypeName" diff --git a/Breeze.Client/Scripts/IBlade/a40_entityMetadata.js b/Breeze.Client/Scripts/IBlade/a40_entityMetadata.js index c4bcf158f..8ffafeaf2 100644 --- a/Breeze.Client/Scripts/IBlade/a40_entityMetadata.js +++ b/Breeze.Client/Scripts/IBlade/a40_entityMetadata.js @@ -2044,6 +2044,7 @@ var DataProperty = (function () { @param [config.nameOnServer] {String} Same as above but the name is that defined on the server. Either this or the 'name' above must be specified. Whichever one is specified the other will be computed using the NamingConvention on the MetadataStore associated with the EntityType to which this will be added. + @param [config.displayName] {String} @param [config.dataType=DataType.String] {DataType} @param [config.complexTypeName] {String} @param [config.isNullable=true] {Boolean} @@ -2058,6 +2059,7 @@ var DataProperty = (function () { assertConfig(config) .whereParam("name").isString().isOptional() .whereParam("nameOnServer").isString().isOptional() + .whereParam("displayName").isString().isOptional() .whereParam("dataType").isEnumOf(DataType).isOptional().or().isString().or().isInstanceOf(ComplexType) .whereParam("complexTypeName").isOptional() .whereParam("isNullable").isBoolean().isOptional().withDefault(true) @@ -2302,6 +2304,7 @@ var NavigationProperty = (function () { @param [config.nameOnServer] {String} Same as above but the name is that defined on the server. Either this or the 'name' above must be specified. Whichever one is specified the other will be computed using the NamingConvention on the MetadataStore associated with the EntityType to which this will be added. + @param [config.displayName] {String} @param config.entityTypeName {String} The fully qualified name of the type of entity that this property will return. This type need not yet have been created, but it will need to get added to the relevant MetadataStore before this EntityType will be 'complete'. The entityType name is constructed as: {shortName} + ":#" + {namespace} @@ -2318,6 +2321,7 @@ var NavigationProperty = (function () { assertConfig(config) .whereParam("name").isString().isOptional() .whereParam("nameOnServer").isString().isOptional() + .whereParam("displayName").isString().isOptional() .whereParam("entityTypeName").isString() .whereParam("isScalar").isBoolean() .whereParam("associationName").isString().isOptional()