From c58dcd80ffc884182199d2fa132e158e7884cc6b Mon Sep 17 00:00:00 2001 From: Jeroen Breuer Date: Wed, 30 Jul 2014 16:26:42 +0200 Subject: [PATCH 1/7] Fix 1 for #187 --- app/views/archetype.default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/archetype.default.html b/app/views/archetype.default.html index f37906f..6507836 100644 --- a/app/views/archetype.default.html +++ b/app/views/archetype.default.html @@ -38,7 +38,7 @@
- +
From 9afaa024c022d5a35262659fd7a3aad51a8689de Mon Sep 17 00:00:00 2001 From: Jeroen Breuer Date: Wed, 30 Jul 2014 16:30:42 +0200 Subject: [PATCH 2/7] Fix 2 for #187 --- app/directives/archetypeproperty.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/directives/archetypeproperty.js b/app/directives/archetypeproperty.js index 21baea7..64fb95b 100644 --- a/app/directives/archetypeproperty.js +++ b/app/directives/archetypeproperty.js @@ -1,4 +1,4 @@ -angular.module("umbraco.directives").directive('archetypeProperty', function ($compile, $http, archetypePropertyEditorResource, umbPropEditorHelper, $timeout, $rootScope, $q) { +angular.module("umbraco.directives").directive('archetypeProperty', function ($compile, $http, archetypePropertyEditorResource, umbPropEditorHelper, $timeout, $rootScope, $q, editorState) { function getFieldsetByAlias(fieldsets, alias) { @@ -66,7 +66,7 @@ angular.module("umbraco.directives").directive('archetypeProperty', function ($c defaultValue = jsonOrString(defaultValue, scope.archetypeConfig.developerMode, "defaultValue"); //grab info for the selected datatype, prepare for view - archetypePropertyEditorResource.getDataType(dataTypeGuid).then(function (data) { + archetypePropertyEditorResource.getDataType(dataTypeGuid, editorState.current.contentTypeAlias, scope.propertyEditorAlias, alias).then(function (data) { //transform preValues array into object expected by propertyeditor views var configObj = {}; _.each(data.preValues, function(p) { @@ -235,6 +235,7 @@ angular.module("umbraco.directives").directive('archetypeProperty', function ($c scope: { property: '=', propertyConfigIndex: '=', + propertyEditorAlias: '=', archetypeConfig: '=', fieldset: '=', fieldsetIndex: '=', @@ -243,4 +244,4 @@ angular.module("umbraco.directives").directive('archetypeProperty', function ($c umbracoForm: '=' } } -}); \ No newline at end of file +}); From b5bfbb5c258bead2b7e35ed38b843045d38ee584 Mon Sep 17 00:00:00 2001 From: Jeroen Breuer Date: Wed, 30 Jul 2014 16:33:01 +0200 Subject: [PATCH 3/7] Fix 3 for #187 --- app/resources/propertyeditor.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/resources/propertyeditor.js b/app/resources/propertyeditor.js index 13b6afb..0bf4980 100644 --- a/app/resources/propertyeditor.js +++ b/app/resources/propertyeditor.js @@ -6,9 +6,9 @@ angular.module('umbraco.resources').factory('archetypePropertyEditorResource', f $http.get("/umbraco/backoffice/ArchetypeApi/ArchetypeDataType/GetAll"), 'Failed to retrieve datatypes from tree service' ); }, - getDataType: function(guid) { + getDataType: function (guid, contentTypeAlias, propertyTypeAlias, archetypeAlias) { return umbRequestHelper.resourcePromise( - $http.get("/umbraco/backoffice/ArchetypeApi/ArchetypeDataType/GetByGuid?guid=" + guid), 'Failed to retrieve datatype' + $http.get("/umbraco/backoffice/ArchetypeApi/ArchetypeDataType/GetByGuid?guid=" + guid + "&contentTypeAlias=" + contentTypeAlias + "&propertyTypeAlias=" + propertyTypeAlias + "&archetypeAlias=" + archetypeAlias), 'Failed to retrieve datatype' ); }, getPropertyEditorMapping: function(alias) { @@ -26,4 +26,4 @@ angular.module('umbraco.resources').factory('archetypePropertyEditorResource', f }); } } -}); \ No newline at end of file +}); From 25826958a3a1563d4ff1b842a00459f88394cf71 Mon Sep 17 00:00:00 2001 From: Jeroen Breuer Date: Wed, 30 Jul 2014 16:34:33 +0200 Subject: [PATCH 4/7] Fix 4 for #187 --- .../Umbraco.Archetype/Api/ArchetypeDataTypeController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs index a544c3a..9de2913 100644 --- a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs +++ b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs @@ -28,7 +28,7 @@ namespace Archetype.Api return dataTypes.Select(t => new { guid = t.Key, name = t.Name }); } - public object GetByGuid(Guid guid) + public object GetByGuid(Guid guid, string contentTypeAlias, string propertyTypeAlias, string archetypeAlias) { var dataType = Services.DataTypeService.GetDataTypeDefinitionById(guid); if (dataType == null) @@ -36,7 +36,7 @@ namespace Archetype.Api throw new HttpResponseException(HttpStatusCode.NotFound); } var dataTypeDisplay = Mapper.Map(dataType); - return new { selectedEditor = dataTypeDisplay.SelectedEditor, preValues = dataTypeDisplay.PreValues }; + return new { selectedEditor = dataTypeDisplay.SelectedEditor, preValues = dataTypeDisplay.PreValues, contentTypeAlias = contentTypeAlias, propertyTypeAlias = propertyTypeAlias, archetypeAlias = archetypeAlias }; } } } From c20aa64af27c631104f4971c9e286a415f9a701e Mon Sep 17 00:00:00 2001 From: Jeroen Breuer Date: Thu, 31 Jul 2014 12:11:02 +0200 Subject: [PATCH 5/7] Added node id --- app/directives/archetypeproperty.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/directives/archetypeproperty.js b/app/directives/archetypeproperty.js index 64fb95b..57cc61f 100644 --- a/app/directives/archetypeproperty.js +++ b/app/directives/archetypeproperty.js @@ -66,7 +66,7 @@ angular.module("umbraco.directives").directive('archetypeProperty', function ($c defaultValue = jsonOrString(defaultValue, scope.archetypeConfig.developerMode, "defaultValue"); //grab info for the selected datatype, prepare for view - archetypePropertyEditorResource.getDataType(dataTypeGuid, editorState.current.contentTypeAlias, scope.propertyEditorAlias, alias).then(function (data) { + archetypePropertyEditorResource.getDataType(dataTypeGuid, editorState.current.contentTypeAlias, scope.propertyEditorAlias, alias, editorState.current.id).then(function (data) { //transform preValues array into object expected by propertyeditor views var configObj = {}; _.each(data.preValues, function(p) { From 6b61dc978ad72d780d1406897cc50fcb277fa840 Mon Sep 17 00:00:00 2001 From: Jeroen Breuer Date: Thu, 31 Jul 2014 12:11:51 +0200 Subject: [PATCH 6/7] Added node id --- app/resources/propertyeditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/resources/propertyeditor.js b/app/resources/propertyeditor.js index 0bf4980..c8bc73c 100644 --- a/app/resources/propertyeditor.js +++ b/app/resources/propertyeditor.js @@ -6,9 +6,9 @@ angular.module('umbraco.resources').factory('archetypePropertyEditorResource', f $http.get("/umbraco/backoffice/ArchetypeApi/ArchetypeDataType/GetAll"), 'Failed to retrieve datatypes from tree service' ); }, - getDataType: function (guid, contentTypeAlias, propertyTypeAlias, archetypeAlias) { + getDataType: function (guid, contentTypeAlias, propertyTypeAlias, archetypeAlias, nodeId) { return umbRequestHelper.resourcePromise( - $http.get("/umbraco/backoffice/ArchetypeApi/ArchetypeDataType/GetByGuid?guid=" + guid + "&contentTypeAlias=" + contentTypeAlias + "&propertyTypeAlias=" + propertyTypeAlias + "&archetypeAlias=" + archetypeAlias), 'Failed to retrieve datatype' + $http.get("/umbraco/backoffice/ArchetypeApi/ArchetypeDataType/GetByGuid?guid=" + guid + "&contentTypeAlias=" + contentTypeAlias + "&propertyTypeAlias=" + propertyTypeAlias + "&archetypeAlias=" + archetypeAlias + "&nodeId=" + nodeId), 'Failed to retrieve datatype' ); }, getPropertyEditorMapping: function(alias) { From 57ffa69ff5f87a79c883d218648ac36d662f0202 Mon Sep 17 00:00:00 2001 From: Jeroen Breuer Date: Thu, 31 Jul 2014 12:12:35 +0200 Subject: [PATCH 7/7] Added node id --- .../Umbraco.Archetype/Api/ArchetypeDataTypeController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs index 9de2913..5770d2e 100644 --- a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs +++ b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs @@ -28,7 +28,7 @@ namespace Archetype.Api return dataTypes.Select(t => new { guid = t.Key, name = t.Name }); } - public object GetByGuid(Guid guid, string contentTypeAlias, string propertyTypeAlias, string archetypeAlias) + public object GetByGuid(Guid guid, string contentTypeAlias, string propertyTypeAlias, string archetypeAlias, int nodeId) { var dataType = Services.DataTypeService.GetDataTypeDefinitionById(guid); if (dataType == null) @@ -36,7 +36,7 @@ namespace Archetype.Api throw new HttpResponseException(HttpStatusCode.NotFound); } var dataTypeDisplay = Mapper.Map(dataType); - return new { selectedEditor = dataTypeDisplay.SelectedEditor, preValues = dataTypeDisplay.PreValues, contentTypeAlias = contentTypeAlias, propertyTypeAlias = propertyTypeAlias, archetypeAlias = archetypeAlias }; + return new { selectedEditor = dataTypeDisplay.SelectedEditor, preValues = dataTypeDisplay.PreValues, contentTypeAlias = contentTypeAlias, propertyTypeAlias = propertyTypeAlias, archetypeAlias = archetypeAlias, nodeId = nodeId }; } } }