diff --git a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs index 2a688811d7..5e07a617d4 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs @@ -187,7 +187,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial private void CreateCmsPropertyTypeData() { - _database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 6, UniqueId = 6.ToGuid(), DataTypeId = -90, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.File, Name = "Upload image", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null }); + _database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 6, UniqueId = 6.ToGuid(), DataTypeId = 1043, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.File, Name = "Upload image", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null }); _database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 7, UniqueId = 7.ToGuid(), DataTypeId = -92, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Width, Name = "Width", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null }); _database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 8, UniqueId = 8.ToGuid(), DataTypeId = -92, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Height, Name = "Height", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null }); _database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 9, UniqueId = 9.ToGuid(), DataTypeId = -92, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Bytes, Name = "Size", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null }); diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js index fc8ca74a2d..5b3bd81918 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js @@ -110,7 +110,6 @@ ]; if ($routeParams.create) { - vm.page.loading = true; //we are creating so get an empty data type item @@ -124,7 +123,6 @@ }); } else { - vm.page.loading = true; contentTypeResource.getById($routeParams.id).then(function (dt) { @@ -141,7 +139,6 @@ /* ---------- SAVE ---------- */ function save() { - var deferred = $q.defer(); vm.page.saveButtonState = "busy"; @@ -206,18 +203,15 @@ }); }); } - vm.page.saveButtonState = "error"; deferred.reject(err); }); - return deferred.promise; } function init(contentType) { - //get available composite types contentTypeResource.getAvailableCompositeContentTypes(contentType.id).then(function (result) { contentType.availableCompositeContentTypes = result; @@ -237,8 +231,6 @@ }); } - - // sort properties after sort order angular.forEach(contentType.groups, function (group) { group.properties = $filter('orderBy')(group.properties, 'sortOrder'); @@ -250,17 +242,13 @@ contentType.allowedTemplates = contentTypeHelper.insertTemplatePlaceholder(contentType.allowedTemplates); } - - //set a shared state editorState.set(contentType); vm.contentType = contentType; - } function convertLegacyIcons(contentType) { - // make array to store contentType icon var contentTypeArray = []; @@ -272,11 +260,9 @@ // set icon back on contentType contentType.icon = contentTypeArray[0].icon; - } function getDataTypeDetails(property) { - if (property.propertyState !== "init") { dataTypeResource.getById(property.dataTypeId) @@ -287,18 +273,14 @@ } } - /** Syncs the content type to it's tree node - this occurs on first load and after saving */ function syncTreeNode(dt, path, initialLoad) { - navigationService.syncTree({ tree: "documenttypes", path: path.split(","), forceReload: initialLoad !== true }).then(function (syncArgs) { vm.currentNode = syncArgs.node; }); - } } angular.module("umbraco").controller("Umbraco.Editors.DocumentTypes.EditController", DocumentTypesEditController); - })(); diff --git a/src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.controller.js index 51bdb249bc..b3fd404ba8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.controller.js @@ -10,7 +10,6 @@ "use strict"; function MediaTypesEditController($scope, $routeParams, mediaTypeResource, dataTypeResource, editorState, contentEditingHelper, formHelper, navigationService, iconHelper, contentTypeHelper, notificationsService, $filter, $q, localizationService) { - var vm = this; vm.save = save; @@ -96,22 +95,20 @@ ]; if ($routeParams.create) { - vm.page.loading = true; //we are creating so get an empty data type item mediaTypeResource.getScaffold($routeParams.id) - .then(function (dt) { - init(dt); + .then(function(dt) { + init(dt); - vm.page.loading = false; - }); + vm.page.loading = false; + }); } else { - vm.page.loading = true; - mediaTypeResource.getById($routeParams.id).then(function (dt) { + mediaTypeResource.getById($routeParams.id).then(function(dt) { init(dt); syncTreeNode(vm.contentType, dt.path, true); @@ -120,11 +117,9 @@ }); } - /* ---------- SAVE ---------- */ function save() { - var deferred = $q.defer(); vm.page.saveButtonState = "busy"; @@ -165,17 +160,14 @@ }); return deferred.promise; - } function init(contentType) { - //get available composite types mediaTypeResource.getAvailableCompositeContentTypes(contentType.id).then(function (result) { contentType.availableCompositeContentTypes = result; - - // convert icons for composite content types - iconHelper.formatContentTypeIcons(contentType.availableCompositeContentTypes); + // convert legacy icons + convertLegacyIcons(contentType); }); // set all tab to inactive @@ -189,10 +181,7 @@ }); } - - // convert legacy icons - convertLegacyIcons(contentType); - + // sort properties after sort order angular.forEach(contentType.groups, function (group) { group.properties = $filter('orderBy')(group.properties, 'sortOrder'); @@ -202,11 +191,9 @@ editorState.set(contentType); vm.contentType = contentType; - } function convertLegacyIcons(contentType) { - // make array to store contentType icon var contentTypeArray = []; @@ -218,33 +205,27 @@ // set icon back on contentType contentType.icon = contentTypeArray[0].icon; - } function getDataTypeDetails(property) { - if (property.propertyState !== "init") { dataTypeResource.getById(property.dataTypeId) - .then(function (dataType) { - property.dataTypeIcon = dataType.icon; - property.dataTypeName = dataType.name; - }); + .then(function(dataType) { + property.dataTypeIcon = dataType.icon; + property.dataTypeName = dataType.name; + }); } } /** Syncs the content type to it's tree node - this occurs on first load and after saving */ function syncTreeNode(dt, path, initialLoad) { - - navigationService.syncTree({ tree: "mediatypes", path: path.split(","), forceReload: initialLoad !== true }).then(function (syncArgs) { + navigationService.syncTree({ tree: "mediatypes", path: path.split(","), forceReload: initialLoad !== true }).then(function(syncArgs) { vm.currentNode = syncArgs.node; }); - } - } angular.module("umbraco").controller("Umbraco.Editors.MediaTypes.EditController", MediaTypesEditController); - })(); diff --git a/src/Umbraco.Web.UI/web.Template.config b/src/Umbraco.Web.UI/web.Template.config index a8bb6da508..3595ff54d1 100644 --- a/src/Umbraco.Web.UI/web.Template.config +++ b/src/Umbraco.Web.UI/web.Template.config @@ -140,8 +140,8 @@ - - + +