From 63f5d0acaf0fb483c555edb187a952d68ad9a3ea Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 26 Sep 2013 17:17:18 +1000 Subject: [PATCH 01/34] Fixes: U4-2787 Copy dialog results in YSOD, converts move/copy dialog to only use the new API. removes xhtmlConformance from web.config. --- src/Umbraco.Web.UI/web.Template.Debug.config | 1 + src/Umbraco.Web.UI/web.Template.config | 5 +-- .../umbraco/dialogs/moveOrCopy.aspx.cs | 40 +++++++++---------- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/Umbraco.Web.UI/web.Template.Debug.config b/src/Umbraco.Web.UI/web.Template.Debug.config index ff98d7e712..a43ba6a739 100644 --- a/src/Umbraco.Web.UI/web.Template.Debug.config +++ b/src/Umbraco.Web.UI/web.Template.Debug.config @@ -50,6 +50,7 @@ + - + @@ -75,8 +75,7 @@ - - + + + + + + + + + + + + + + + + + From e0fb09c6bcff714b855c8735a2fa4f1c59bab1d7 Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 27 Sep 2013 11:02:59 +1000 Subject: [PATCH 15/34] Added better backwards compatibility for when people are using the legacy business logic APIs but they are using new property editors when there is no legacy property editor predecessor (IDataType implementation). --- src/Umbraco.Core/Models/DataTypeDefinition.cs | 8 ++- src/Umbraco.Core/Models/PropertyType.cs | 8 ++- .../BackwardsCompatibleData.cs | 43 +++++++++++++ .../BackwardsCompatibleDataType.cs | 62 +++++++++++++++++++ .../LegacyPropertyEditorIdToAliasConverter.cs | 28 +++++++-- src/Umbraco.Core/PublishedContentHelper.cs | 6 +- src/Umbraco.Core/Umbraco.Core.csproj | 2 + ...cyPropertyEditorIdToAliasConverterTests.cs | 23 ++++++- .../umbraco/Trees/BaseMediaTree.cs | 2 +- .../datatype/DataTypeDefinition.cs | 22 ++++++- 10 files changed, 187 insertions(+), 17 deletions(-) create mode 100644 src/Umbraco.Core/PropertyEditors/BackwardsCompatibleData.cs create mode 100644 src/Umbraco.Core/PropertyEditors/BackwardsCompatibleDataType.cs diff --git a/src/Umbraco.Core/Models/DataTypeDefinition.cs b/src/Umbraco.Core/Models/DataTypeDefinition.cs index 943bb134d9..6f7fac6db7 100644 --- a/src/Umbraco.Core/Models/DataTypeDefinition.cs +++ b/src/Umbraco.Core/Models/DataTypeDefinition.cs @@ -191,10 +191,14 @@ namespace Umbraco.Core.Models /// Id of the DataType control /// [DataMember] - [Obsolete("Property editor's are defined by a string alias from version 7 onwards, use the PropertyEditorAlias property instead")] + [Obsolete("Property editor's are defined by a string alias from version 7 onwards, use the PropertyEditorAlias property instead. This method will return a generated GUID for any property editor alias not explicitly mapped to a legacy ID")] public Guid ControlId { - get { return LegacyPropertyEditorIdToAliasConverter.GetLegacyIdFromAlias(_propertyEditorAlias, true).Value; } + get + { + return LegacyPropertyEditorIdToAliasConverter.GetLegacyIdFromAlias( + _propertyEditorAlias, LegacyPropertyEditorIdToAliasConverter.NotFoundLegacyIdResponseBehavior.GenerateId).Value; + } set { var alias = LegacyPropertyEditorIdToAliasConverter.GetAliasFromLegacyId(value, true); diff --git a/src/Umbraco.Core/Models/PropertyType.cs b/src/Umbraco.Core/Models/PropertyType.cs index c5a703df67..c1526a9ffb 100644 --- a/src/Umbraco.Core/Models/PropertyType.cs +++ b/src/Umbraco.Core/Models/PropertyType.cs @@ -141,10 +141,14 @@ namespace Umbraco.Core.Models /// Gets of Sets the Id of the DataType control /// /// This is the Id of the actual DataType control - [Obsolete("Property editor's are defined by a string alias from version 7 onwards, use the PropertyEditorAlias property instead")] + [Obsolete("Property editor's are defined by a string alias from version 7 onwards, use the PropertyEditorAlias property instead. This method will return a generated GUID for any property editor alias not explicitly mapped to a legacy ID")] public Guid DataTypeId { - get { return LegacyPropertyEditorIdToAliasConverter.GetLegacyIdFromAlias(_propertyEditorAlias, true).Value; } + get + { + return LegacyPropertyEditorIdToAliasConverter.GetLegacyIdFromAlias( + _propertyEditorAlias, LegacyPropertyEditorIdToAliasConverter.NotFoundLegacyIdResponseBehavior.GenerateId).Value; + } set { var alias = LegacyPropertyEditorIdToAliasConverter.GetAliasFromLegacyId(value, true); diff --git a/src/Umbraco.Core/PropertyEditors/BackwardsCompatibleData.cs b/src/Umbraco.Core/PropertyEditors/BackwardsCompatibleData.cs new file mode 100644 index 0000000000..9283256e54 --- /dev/null +++ b/src/Umbraco.Core/PropertyEditors/BackwardsCompatibleData.cs @@ -0,0 +1,43 @@ +using System; +using System.Xml; +using umbraco.interfaces; + +namespace Umbraco.Core.PropertyEditors +{ + + /// + /// This is used purelty to attempt to maintain some backwards compatibility with new property editors that don't have a + /// legacy property editor predecessor when developers are using the legacy APIs + /// + internal class BackwardsCompatibleData : IData + { + public int PropertyId { set; get; } + + public object Value { get; set; } + + + public XmlNode ToXMl(XmlDocument data) + { + throw new NotSupportedException( + typeof(IData) + + " is a legacy object and is not supported by runtime generated " + + " instances to maintain backwards compatibility with the legacy APIs. Consider upgrading your code to use the new Services APIs."); + } + + public void MakeNew(int PropertyId) + { + throw new NotSupportedException( + typeof(IData) + + " is a legacy object and is not supported by runtime generated " + + " instances to maintain backwards compatibility with the legacy APIs. Consider upgrading your code to use the new Services APIs."); + } + + public void Delete() + { + throw new NotSupportedException( + typeof(IData) + + " is a legacy object and is not supported by runtime generated " + + " instances to maintain backwards compatibility with the legacy APIs. Consider upgrading your code to use the new Services APIs."); + } + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/PropertyEditors/BackwardsCompatibleDataType.cs b/src/Umbraco.Core/PropertyEditors/BackwardsCompatibleDataType.cs new file mode 100644 index 0000000000..0bee6322b3 --- /dev/null +++ b/src/Umbraco.Core/PropertyEditors/BackwardsCompatibleDataType.cs @@ -0,0 +1,62 @@ +using System; +using umbraco.interfaces; + +namespace Umbraco.Core.PropertyEditors +{ + + /// + /// This is used purelty to attempt to maintain some backwards compatibility with new property editors that don't have a + /// legacy property editor predecessor when developers are using the legacy APIs + /// + internal class BackwardsCompatibleDataType : IDataType + { + public Guid Id { get; private set; } + public string DataTypeName { get; private set; } + public IData Data { get; private set; } + public int DataTypeDefinitionId { get; set; } + + /// + /// Creates a runtime instance + /// + /// + /// + /// + /// + internal static BackwardsCompatibleDataType Create(string propEdAlias, Guid legacyId, int dataTypeDefId) + { + var dt = new BackwardsCompatibleDataType + { + Id = legacyId, + DataTypeName = propEdAlias, + DataTypeDefinitionId = dataTypeDefId, + Data = new BackwardsCompatibleData() + }; + + return dt; + } + + public IDataEditor DataEditor + { + get + { + throw new NotSupportedException( + typeof(IDataEditor) + + " is a legacy object and is not supported by runtime generated " + + typeof(IDataType) + + " instances to maintain backwards compatibility with the legacy APIs. Consider upgrading your code to use the new Services APIs."); + } + } + public IDataPrevalue PrevalueEditor + { + get + { + throw new NotSupportedException( + typeof(IDataPrevalue) + + " is a legacy object and is not supported by runtime generated " + + typeof(IDataType) + + " instances to maintain backwards compatibility with the legacy APIs. Consider upgrading your code to use the new Services APIs."); + } + } + + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/PropertyEditors/LegacyPropertyEditorIdToAliasConverter.cs b/src/Umbraco.Core/PropertyEditors/LegacyPropertyEditorIdToAliasConverter.cs index e36b86b94c..53a4365244 100644 --- a/src/Umbraco.Core/PropertyEditors/LegacyPropertyEditorIdToAliasConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/LegacyPropertyEditorIdToAliasConverter.cs @@ -3,6 +3,7 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.Data; using System.Linq; +using Umbraco.Core.Logging; namespace Umbraco.Core.PropertyEditors { @@ -14,6 +15,14 @@ namespace Umbraco.Core.PropertyEditors /// public static class LegacyPropertyEditorIdToAliasConverter { + + public enum NotFoundLegacyIdResponseBehavior + { + ThrowException, + ReturnNull, + GenerateId + } + /// /// The map consists of a key which is always the GUID (lowercase, no hyphens + alias (trimmed)) /// @@ -55,18 +64,27 @@ namespace Umbraco.Core.PropertyEditors /// Gets a legacy Id based on the alias /// /// - /// if set to true will throw an exception if the map isn't found + /// /// Returns the legacy GUID of a property editor if found, otherwise returns null - public static Guid? GetLegacyIdFromAlias(string alias, bool throwIfNotFound = false) + public static Guid? GetLegacyIdFromAlias(string alias, NotFoundLegacyIdResponseBehavior notFoundBehavior) { var found = _map.FirstOrDefault(x => x.Value.Item2 == alias); if (found.Equals(default(KeyValuePair>))) { - if (throwIfNotFound) + switch (notFoundBehavior) { - throw new ObjectNotFoundException("Could not find a map for a property editor with an alias of " + alias + ". Consider using the new business logic APIs instead of the old obsoleted ones."); + case NotFoundLegacyIdResponseBehavior.ThrowException: + throw new ObjectNotFoundException("Could not find a map for a property editor with an alias of " + alias + ". Consider using the new business logic APIs instead of the old obsoleted ones."); + case NotFoundLegacyIdResponseBehavior.ReturnNull: + return null; + case NotFoundLegacyIdResponseBehavior.GenerateId: + var generated = alias.EncodeAsGuid(); + CreateMap(generated, alias); + + LogHelper.Warn(typeof(LegacyPropertyEditorIdToAliasConverter), "A legacy GUID id was generated for property editor " + alias + ". This occurs when the legacy APIs are used and done to attempt to maintain backwards compatibility. Consider upgrading all code to use the new Services APIs instead to avoid any potential issues."); + + return generated; } - return null; } return found.Value.Item1; } diff --git a/src/Umbraco.Core/PublishedContentHelper.cs b/src/Umbraco.Core/PublishedContentHelper.cs index a6a3c1cadc..1707f0f745 100644 --- a/src/Umbraco.Core/PublishedContentHelper.cs +++ b/src/Umbraco.Core/PublishedContentHelper.cs @@ -113,16 +113,16 @@ namespace Umbraco.Core //if it is good return it, otherwise we'll continue processing the legacy stuff below. if (result.Success) { - return new Attempt(true, result.Result); + return Attempt.Succeed(result.Result); } } //In order to maintain backwards compatibility here with IPropertyEditorValueConverter we need to attempt to lookup the // legacy GUID for the current property editor. If one doesn't exist then we will abort the conversion. - var legacyId = LegacyPropertyEditorIdToAliasConverter.GetLegacyIdFromAlias(propertyDefinition.PropertyEditorAlias); + var legacyId = LegacyPropertyEditorIdToAliasConverter.GetLegacyIdFromAlias(propertyDefinition.PropertyEditorAlias, LegacyPropertyEditorIdToAliasConverter.NotFoundLegacyIdResponseBehavior.ReturnNull); if (legacyId.HasValue == false) { - return Attempt.False; + return Attempt.Fail(); } //First lets check all registered converters for this data type. diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index a1d9969d52..2d79ca600e 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -417,6 +417,8 @@ + + diff --git a/src/Umbraco.Tests/PropertyEditors/LegacyPropertyEditorIdToAliasConverterTests.cs b/src/Umbraco.Tests/PropertyEditors/LegacyPropertyEditorIdToAliasConverterTests.cs index d82ce6a259..f27b201005 100644 --- a/src/Umbraco.Tests/PropertyEditors/LegacyPropertyEditorIdToAliasConverterTests.cs +++ b/src/Umbraco.Tests/PropertyEditors/LegacyPropertyEditorIdToAliasConverterTests.cs @@ -28,7 +28,11 @@ namespace Umbraco.Tests.PropertyEditors var id = Guid.NewGuid(); LegacyPropertyEditorIdToAliasConverter.CreateMap(id, "test"); - Assert.AreEqual(id, LegacyPropertyEditorIdToAliasConverter.GetLegacyIdFromAlias("test", true)); + Assert.AreEqual( + id, + LegacyPropertyEditorIdToAliasConverter.GetLegacyIdFromAlias( + "test", + LegacyPropertyEditorIdToAliasConverter.NotFoundLegacyIdResponseBehavior.ThrowException)); } [Test] @@ -37,7 +41,22 @@ namespace Umbraco.Tests.PropertyEditors var id = Guid.NewGuid(); LegacyPropertyEditorIdToAliasConverter.CreateMap(id, "test"); - Assert.AreEqual("test", LegacyPropertyEditorIdToAliasConverter.GetAliasFromLegacyId(id, true)); + Assert.AreEqual( + "test", + LegacyPropertyEditorIdToAliasConverter.GetAliasFromLegacyId( + id, + true)); + } + + [Test] + public void Can_Generate_Id_From_Missing_Alias() + { + var gen1 = LegacyPropertyEditorIdToAliasConverter.GetLegacyIdFromAlias("Donotfindthisone", LegacyPropertyEditorIdToAliasConverter.NotFoundLegacyIdResponseBehavior.GenerateId); + var gen2 = LegacyPropertyEditorIdToAliasConverter.GetLegacyIdFromAlias("Donotfindthisone", LegacyPropertyEditorIdToAliasConverter.NotFoundLegacyIdResponseBehavior.GenerateId); + + Assert.IsNotNull(gen1); + Assert.IsNotNull(gen2); + Assert.AreEqual(gen1, gen2); } [Test] diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseMediaTree.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseMediaTree.cs index 3f7f5a5bfc..5a033ace09 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseMediaTree.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseMediaTree.cs @@ -171,7 +171,7 @@ function openMedia(id) { foreach (var property in entity.UmbracoProperties) { //required for backwards compatibility with v7 with changing the GUID -> alias - var controlId = LegacyPropertyEditorIdToAliasConverter.GetLegacyIdFromAlias(property.PropertyEditorAlias); + var controlId = LegacyPropertyEditorIdToAliasConverter.GetLegacyIdFromAlias(property.PropertyEditorAlias, LegacyPropertyEditorIdToAliasConverter.NotFoundLegacyIdResponseBehavior.ReturnNull); if (controlId != null) { if (LinkableMediaDataTypes.Contains(controlId.Value) && diff --git a/src/umbraco.cms/businesslogic/datatype/DataTypeDefinition.cs b/src/umbraco.cms/businesslogic/datatype/DataTypeDefinition.cs index 162880f143..8ae006f9a6 100644 --- a/src/umbraco.cms/businesslogic/datatype/DataTypeDefinition.cs +++ b/src/umbraco.cms/businesslogic/datatype/DataTypeDefinition.cs @@ -13,6 +13,9 @@ using Umbraco.Core; namespace umbraco.cms.businesslogic.datatype { + + + /// /// Datatypedefinitions is the basic buildingblocks of umbraco's documents/medias/members generic datastructure /// @@ -59,12 +62,27 @@ namespace umbraco.cms.businesslogic.datatype if (_propertyEditorAlias.IsNullOrWhiteSpace()) return null; - var controlId = LegacyPropertyEditorIdToAliasConverter.GetLegacyIdFromAlias(_propertyEditorAlias, true); + //Attempt to resolve a legacy control id from the alias. If one is not found we'll generate one - + // the reason one will not be found is if there's a new v7 property editor created that doesn't have a legacy + // property editor predecessor. + //So, we'll generate an id for it based on the alias which will remain consistent, but then we'll try to resolve a legacy + // IDataType which of course will not exist. In this case we'll have to create a new one on the fly for backwards compatibility but + // this instance will have limited capabilities and will really only work for saving data so the legacy APIs continue to work. + var controlId = LegacyPropertyEditorIdToAliasConverter.GetLegacyIdFromAlias(_propertyEditorAlias, LegacyPropertyEditorIdToAliasConverter.NotFoundLegacyIdResponseBehavior.GenerateId); var dt = DataTypesResolver.Current.GetById(controlId.Value); - + if (dt != null) + { dt.DataTypeDefinitionId = Id; + } + else + { + //Ok so it was not found, we can only assume that this is because this is a new property editor that does not have a legacy predecessor. + //we'll have to attempt to generate one at runtime. + dt = BackwardsCompatibleDataType.Create(_propertyEditorAlias, controlId.Value, Id); + } + return dt; } From bf124cb32681a465c5ae0acd2a8558123c549184 Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 27 Sep 2013 12:39:52 +1000 Subject: [PATCH 16/34] Fixes: U4-2957 Member type saving generates YSOD --- src/Umbraco.Web.UI/umbraco/members/EditMemberType.aspx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/members/EditMemberType.aspx b/src/Umbraco.Web.UI/umbraco/members/EditMemberType.aspx index eb9cc90070..3e274b567f 100644 --- a/src/Umbraco.Web.UI/umbraco/members/EditMemberType.aspx +++ b/src/Umbraco.Web.UI/umbraco/members/EditMemberType.aspx @@ -1,5 +1,4 @@ - -<%@ Page language="c#" MasterPageFile="../masterpages/umbracoPage.Master" Codebehind="EditMemberType.aspx.cs" AutoEventWireup="True" Inherits="umbraco.cms.presentation.members.EditMemberType" %> +<%@ Page Async="true" language="c#" MasterPageFile="../masterpages/umbracoPage.Master" Codebehind="EditMemberType.aspx.cs" AutoEventWireup="True" Inherits="umbraco.cms.presentation.members.EditMemberType" %> <%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> <%@ Register TagPrefix="uc1" TagName="ContentTypeControlNew" Src="../controls/ContentTypeControlNew.ascx" %> <%@ Register Namespace="umbraco" TagPrefix="umb" Assembly="umbraco" %> From ed7851c96252fa23e42c3811df23814b97b18ad6 Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 27 Sep 2013 12:51:52 +1000 Subject: [PATCH 17/34] Fixes more issues with the legacy API backwards compatibility issues with new property editor that don't have legacy predecessors. - can now create a member. --- .../PropertyEditors/BackwardsCompatibleData.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Core/PropertyEditors/BackwardsCompatibleData.cs b/src/Umbraco.Core/PropertyEditors/BackwardsCompatibleData.cs index 9283256e54..38726e4a49 100644 --- a/src/Umbraco.Core/PropertyEditors/BackwardsCompatibleData.cs +++ b/src/Umbraco.Core/PropertyEditors/BackwardsCompatibleData.cs @@ -18,18 +18,17 @@ namespace Umbraco.Core.PropertyEditors public XmlNode ToXMl(XmlDocument data) { - throw new NotSupportedException( - typeof(IData) - + " is a legacy object and is not supported by runtime generated " - + " instances to maintain backwards compatibility with the legacy APIs. Consider upgrading your code to use the new Services APIs."); + //TODO: We need to get the xml property value converters in place, then this method will need to call in to that converter to + // get the xml, for now we're just creating a CDATA section with the raw value. + + var sValue = Value != null ? Value.ToString() : String.Empty; + return data.CreateCDataSection(sValue); + } public void MakeNew(int PropertyId) { - throw new NotSupportedException( - typeof(IData) - + " is a legacy object and is not supported by runtime generated " - + " instances to maintain backwards compatibility with the legacy APIs. Consider upgrading your code to use the new Services APIs."); + //DO nothing } public void Delete() From 7684381326c52d8b70a292bc506bb2a6bb55cd59 Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 27 Sep 2013 13:05:57 +1000 Subject: [PATCH 18/34] Fixes issue with media edit controller not having a $timeout reference. --- .../src/views/media/media.edit.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/media/media.edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/media/media.edit.controller.js index f24fa3e41e..d10da4d8bc 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/media.edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/media/media.edit.controller.js @@ -6,7 +6,7 @@ * @description * The controller for the media editor */ -function mediaEditController($scope, $routeParams, mediaResource, notificationsService, angularHelper, serverValidationManager, contentEditingHelper, fileManager, editorContextService) { +function mediaEditController($scope, $routeParams, mediaResource, notificationsService, angularHelper, serverValidationManager, contentEditingHelper, fileManager, editorContextService, $timeout) { //initialize the file manager fileManager.clearFiles(); From 249015a0e9adc515ca6826e17c00b08202719de1 Mon Sep 17 00:00:00 2001 From: perploug Date: Fri, 27 Sep 2013 11:02:40 +0200 Subject: [PATCH 19/34] Remove non-working doctype add link --- src/Umbraco.Web.UI.Client/src/views/content/create.html | 4 ++-- src/Umbraco.Web.UI.Client/src/views/media/create.html | 4 ++-- .../src/views/media/media.create.controller.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/create.html b/src/Umbraco.Web.UI.Client/src/views/content/create.html index 9ee6ec320f..2a0415a33a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/create.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/create.html @@ -17,7 +17,7 @@ - + diff --git a/src/Umbraco.Web.UI.Client/src/views/media/create.html b/src/Umbraco.Web.UI.Client/src/views/media/create.html index 5048af043a..bd526ebc14 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/create.html +++ b/src/Umbraco.Web.UI.Client/src/views/media/create.html @@ -17,7 +17,7 @@ - + diff --git a/src/Umbraco.Web.UI.Client/src/views/media/media.create.controller.js b/src/Umbraco.Web.UI.Client/src/views/media/media.create.controller.js index 6536a6d504..57ab8d9c5b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/media.create.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/media/media.create.controller.js @@ -9,7 +9,7 @@ function mediaCreateController($scope, $routeParams, mediaTypeResource, iconHelper) { mediaTypeResource.getAllowedTypes($scope.currentNode.id).then(function(data) { - $scope.allowedTypes = iconHelper.formatContentTypeThumbnails(data); + $scope.allowedTypes = iconHelper.formatContentTypeIcons(data); }); } From 08e21e36a6127217c89ac521d88cb77738c3ffef Mon Sep 17 00:00:00 2001 From: perploug Date: Fri, 27 Sep 2013 11:03:01 +0200 Subject: [PATCH 20/34] minor styling updates --- .../src/common/services/util.service.js | 3 ++ src/Umbraco.Web.UI.Client/src/less/hacks.less | 2 +- src/Umbraco.Web.UI.Client/src/less/main.less | 33 +---------------- .../src/less/property-editors.less | 36 +++++++++++++++++++ src/Umbraco.Web.UI.Client/src/less/tree.less | 25 ------------- 5 files changed, 41 insertions(+), 58 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/util.service.js b/src/Umbraco.Web.UI.Client/src/common/services/util.service.js index 21e81d1ac3..baaa96e81c 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/util.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/util.service.js @@ -323,6 +323,9 @@ function iconHelper($q) { { oldIcon: ".sprTreeUserType", newIcon: "" }, */ + { oldIcon: "folder.png", newIcon: "icon-folder" }, + { oldIcon: "mediaphoto.gif", newIcon: "icon-picture" }, + { oldIcon: "mediafile.gif", newIcon: "icon-document" }, { oldIcon: ".sprTreeDeveloperCacheItem", newIcon: "icon-box" }, { oldIcon: ".sprTreeDeveloperCacheTypes", newIcon: "icon-box" }, diff --git a/src/Umbraco.Web.UI.Client/src/less/hacks.less b/src/Umbraco.Web.UI.Client/src/less/hacks.less index 9cd96ccca4..3b1efd81ba 100644 --- a/src/Umbraco.Web.UI.Client/src/less/hacks.less +++ b/src/Umbraco.Web.UI.Client/src/less/hacks.less @@ -37,7 +37,7 @@ iframe, .content-column-body { border: none; } -/* ng-cloak support with requirejs */ +/* ng-cloak support with lazyloading */ [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none; } diff --git a/src/Umbraco.Web.UI.Client/src/less/main.less b/src/Umbraco.Web.UI.Client/src/less/main.less index 91f1d0c25c..7b823d407c 100644 --- a/src/Umbraco.Web.UI.Client/src/less/main.less +++ b/src/Umbraco.Web.UI.Client/src/less/main.less @@ -54,38 +54,7 @@ div.umb-codeeditor .umb-btn-toolbar { background: #f7f7f7 } -/* FILE UPLOAD*/ -.umb-fileupload .preview { - border-radius: 5px; - border: 1px solid #a0a0a0; - padding: 3px; - background: #efefef; - float: left; - margin-right: 30px; - margin-bottom: 30px -} -.umb-fileupload ul { - list-style: none; - vertical-align: middle; - margin-bottom: 0px -} -.umb-fileupload label { - vertical-align: middle; - padding-left: 7px; - font-weight: normal -} -.umb-fileupload .preview-file { - color: #666; - height: 45px; - width: 55px; - text-align: center; - text-transform: uppercase; - font-size: 10px; - padding-top: 27px -} -.umb-fileupload input { - font-size: 12px -} + /* MISC FORM ELEMENTS */ diff --git a/src/Umbraco.Web.UI.Client/src/less/property-editors.less b/src/Umbraco.Web.UI.Client/src/less/property-editors.less index 3b48484c10..ece90a861a 100644 --- a/src/Umbraco.Web.UI.Client/src/less/property-editors.less +++ b/src/Umbraco.Web.UI.Client/src/less/property-editors.less @@ -198,3 +198,39 @@ ul.color-picker li a { overflow: hidden; display: block; } + + + // + // File upload + // -------------------------------------------------- + .umb-fileupload .preview { + border-radius: 5px; + border: 1px solid #a0a0a0; + padding: 3px; + background: #efefef; + float: left; + margin-right: 30px; + margin-bottom: 30px + } + .umb-fileupload ul { + list-style: none; + vertical-align: middle; + margin-bottom: 0px + } + .umb-fileupload label { + vertical-align: middle; + padding-left: 7px; + font-weight: normal + } + .umb-fileupload .preview-file { + color: #666; + height: 45px; + width: 55px; + text-align: center; + text-transform: uppercase; + font-size: 10px; + padding-top: 27px + } + .umb-fileupload input { + font-size: 12px + } \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/less/tree.less b/src/Umbraco.Web.UI.Client/src/less/tree.less index 3111c5a944..750960407b 100644 --- a/src/Umbraco.Web.UI.Client/src/less/tree.less +++ b/src/Umbraco.Web.UI.Client/src/less/tree.less @@ -7,7 +7,6 @@ width: auto; display: block } - .umb-item-list li { display: block; width: auto; @@ -424,30 +423,6 @@ height:1px; } - -// Search -// ------------------------- -/* -.umb-search-field { - font-size: 12px; - width: 235px; - border-radius: 0 !important; - border-color: #f5f5f5; - padding: 5px 7px !important; - background: url(../img/applicationIcons/search.png) no-repeat 225px 8px #fff; - margin: 27px 20px 20px 20px; -} -*/ -#search-results h5 { - margin: 0px 0px 7px 20px; -} -#search-results ul { - list-style: none; - margin: 0px; - padding: 0px; - border-bottom: 1px solid #efefef -} - body.touch .umb-tree .icon{font-size: 17px;} body.touch .umb-tree ins{font-size: 14px; visibility: visible; padding: 7px;} body.touch .umb-tree li div { From 1db94711f5807a61d68c1b718b11b5d753eac9e9 Mon Sep 17 00:00:00 2001 From: perploug Date: Fri, 27 Sep 2013 11:21:10 +0200 Subject: [PATCH 21/34] tree icons updated --- .../umbraco.presentation/umbraco/Trees/loadLanguages.cs | 4 ++-- .../umbraco.presentation/umbraco/Trees/loadMediaTypes.cs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadLanguages.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadLanguages.cs index bbbad92f5a..7dd10e3755 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadLanguages.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadLanguages.cs @@ -61,8 +61,8 @@ function openDictionary() { xNode.NodeID = l.id.ToString(); //"language_" + l.id.ToString(); xNode.Text = l.FriendlyName; xNode.Action = "javascript:openLanguage(" + l.id + ");"; - xNode.Icon = "settingLanguage.gif"; - xNode.OpenIcon = "settingLanguage.gif"; + xNode.Icon = "icon-flag-alt"; + xNode.OpenIcon = "icon-flag-alt"; OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty); if (xNode != null) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadMediaTypes.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadMediaTypes.cs index 1f58cee995..da2d9a40ba 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadMediaTypes.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadMediaTypes.cs @@ -52,10 +52,11 @@ function openMediaType(id) { xNode.NodeID = mediaType.Id.ToString(CultureInfo.InvariantCulture); xNode.Text = mediaType.Name; xNode.Action = string.Format("javascript:openMediaType({0});", mediaType.Id); - xNode.Icon = "settingDataType.gif"; - xNode.OpenIcon = "settingDataType.gif"; + xNode.Icon = "icon-item-arrangement"; + xNode.OpenIcon = "icon-item-arrangement"; xNode.Source = GetTreeServiceUrl(mediaType.Id); xNode.HasChildren = hasChildren; + if (hasChildren) { xNode.Icon = "settingMasterDataType.gif"; From ba838e893e5226f7ef9097820d298cf788fa123c Mon Sep 17 00:00:00 2001 From: perploug Date: Fri, 27 Sep 2013 11:21:33 +0200 Subject: [PATCH 22/34] Polished nodetype dialog windows --- .../umbraco/create/nodeType.ascx | 44 +++++++++++-------- .../umbraco/create/nodeType.ascx.cs | 3 +- .../umbraco/create/nodeType.ascx.designer.cs | 13 +++++- .../umbraco/create/xslt.ascx | 8 ++-- 4 files changed, 42 insertions(+), 26 deletions(-) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/nodeType.ascx b/src/Umbraco.Web/umbraco.presentation/umbraco/create/nodeType.ascx index 751d88770d..bb498c0f0f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/nodeType.ascx +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/nodeType.ascx @@ -1,24 +1,30 @@ <%@ Control Language="c#" AutoEventWireup="True" Codebehind="nodeType.ascx.cs" Inherits="umbraco.cms.presentation.create.controls.nodeType" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%> -

Master Document Type:
- - -

+<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> -
<%=umbraco.ui.Text("name")%>: - *
- -
+ + + + + + + + + * + -
- -
+ + + -
+ + + <%=umbraco.ui.Text("cancel")%> + + \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/nodeType.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/nodeType.ascx.cs index ca89fdbb4a..ba73303dfb 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/nodeType.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/nodeType.ascx.cs @@ -23,12 +23,13 @@ namespace umbraco.cms.presentation.create.controls protected void Page_Load(object sender, System.EventArgs e) { sbmt.Text = ui.Text("create"); + pp_name.Text = ui.Text("name"); + if (!IsPostBack) { string nodeId = umbraco.helper.Request("nodeId"); if (String.IsNullOrEmpty(nodeId) || nodeId == "init") { - masterType.Attributes.Add("style", "width: 350px;"); masterType.Items.Add(new ListItem(ui.Text("none") + "...", "0")); foreach (cms.businesslogic.web.DocumentType dt in cms.businesslogic.web.DocumentType.GetAllAsList()) { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/nodeType.ascx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/nodeType.ascx.designer.cs index 6fc02106f5..58a30d39aa 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/nodeType.ascx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/nodeType.ascx.designer.cs @@ -31,13 +31,13 @@ namespace umbraco.cms.presentation.create.controls { protected global::System.Web.UI.WebControls.Literal masterTypePreDefined; /// - /// RequiredFieldValidator1 control. + /// pp_name control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1; + protected global::umbraco.uicontrols.PropertyPanel pp_name; /// /// rename control. @@ -48,6 +48,15 @@ namespace umbraco.cms.presentation.create.controls { /// protected global::System.Web.UI.WebControls.TextBox rename; + /// + /// RequiredFieldValidator1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1; + /// /// createTemplate control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/xslt.ascx b/src/Umbraco.Web/umbraco.presentation/umbraco/create/xslt.ascx index ffd1c9e07c..e3c6735fda 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/xslt.ascx +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/xslt.ascx @@ -2,13 +2,13 @@ <%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - + + * - + - + Clean From 812ed78cd972b5f062dfb0597a587cbbdd0a61eb Mon Sep 17 00:00:00 2001 From: perploug Date: Fri, 27 Sep 2013 11:21:56 +0200 Subject: [PATCH 23/34] made mediatype editor async --- src/Umbraco.Web.UI/umbraco/settings/EditMediaType.aspx | 1 + .../umbraco/settings/EditDictionaryItem.aspx.cs | 1 + .../umbraco.presentation/umbraco/settings/EditMediaType.aspx | 1 + .../umbraco/settings/EditMediaType.aspx.designer.cs | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI/umbraco/settings/EditMediaType.aspx b/src/Umbraco.Web.UI/umbraco/settings/EditMediaType.aspx index 28a6efe773..ab35ae3a63 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/EditMediaType.aspx +++ b/src/Umbraco.Web.UI/umbraco/settings/EditMediaType.aspx @@ -1,6 +1,7 @@ <%@ Register TagPrefix="cc2" Namespace="umbraco.uicontrols" Assembly="controls" %> <%@ Page Language="c#" CodeBehind="EditMediaType.aspx.cs" MasterPageFile="../masterpages/umbracoPage.Master" + Async="true" AsyncTimeOut="300" AutoEventWireup="True" Inherits="umbraco.cms.presentation.settings.EditMediaType" %> <%@ Register TagPrefix="uc1" TagName="ContentTypeControlNew" Src="../controls/ContentTypeControlNew.ascx" %> diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.cs index d68117de12..b6165ac86c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.cs @@ -39,6 +39,7 @@ namespace umbraco.settings uicontrols.Pane p = new uicontrols.Pane(); var save = Panel1.Menu.NewButton(); + save.Text = ui.Text("save"); save.Click += save_Click; save.ToolTip = ui.Text("save"); save.ID = "save"; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditMediaType.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditMediaType.aspx index 28a6efe773..ab35ae3a63 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditMediaType.aspx +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditMediaType.aspx @@ -1,6 +1,7 @@ <%@ Register TagPrefix="cc2" Namespace="umbraco.uicontrols" Assembly="controls" %> <%@ Page Language="c#" CodeBehind="EditMediaType.aspx.cs" MasterPageFile="../masterpages/umbracoPage.Master" + Async="true" AsyncTimeOut="300" AutoEventWireup="True" Inherits="umbraco.cms.presentation.settings.EditMediaType" %> <%@ Register TagPrefix="uc1" TagName="ContentTypeControlNew" Src="../controls/ContentTypeControlNew.ascx" %> diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditMediaType.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditMediaType.aspx.designer.cs index e120177439..3bf60caa2c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditMediaType.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditMediaType.aspx.designer.cs @@ -19,6 +19,6 @@ namespace umbraco.cms.presentation.settings { /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::umbraco.controls.ContentTypeControlNew ContentTypeControlNew1; + protected global::System.Web.UI.UserControl ContentTypeControlNew1; } } From 10b58fbd29817713a6db2ccc06bf67a7bcd3bf79 Mon Sep 17 00:00:00 2001 From: perploug Date: Fri, 27 Sep 2013 11:22:26 +0200 Subject: [PATCH 24/34] Adds drag drop to media dashboard --- .../dashboard/dashboard.tabs.controller.js | 57 ++++++++++++++++++- .../dashboard/media/mediafolderbrowser.html | 21 ++++++- 2 files changed, 73 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/dashboard.tabs.controller.js b/src/Umbraco.Web.UI.Client/src/views/dashboard/dashboard.tabs.controller.js index 74149da018..3983777263 100644 --- a/src/Umbraco.Web.UI.Client/src/views/dashboard/dashboard.tabs.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/dashboard.tabs.controller.js @@ -21,8 +21,61 @@ function startupLatestEditsController($scope) { } angular.module("umbraco").controller("Umbraco.Dashboard.StartupLatestEditsController", startupLatestEditsController); -function MediaFolderBrowserDashboardController($scope) { - +function MediaFolderBrowserDashboardController($rootScope, $scope, assetsService, $routeParams, $timeout, $element, $location, umbRequestHelper, mediaResource, imageHelper) { + var dialogOptions = $scope.$parent.dialogOptions; + + $scope.filesUploading = []; + $scope.options = { + url: umbRequestHelper.getApiUrl("mediaApiBaseUrl", "PostAddFile"), + autoUpload: true, + disableImageResize: /Android(?!.*Chrome)|Opera/ + .test(window.navigator.userAgent), + previewMaxWidth: 200, + previewMaxHeight: 200, + previewCrop: true, + formData:{ + currentFolder: -1 + } + }; + + + $scope.loadChildren = function(){ + mediaResource.getChildren(-1) + .then(function(data) { + $scope.images = data.items; + }); + }; + + $scope.$on('fileuploadstop', function(event, files){ + $scope.loadChildren($scope.options.formData.currentFolder); + $scope.queue = []; + $scope.filesUploading = []; + }); + + $scope.$on('fileuploadprocessalways', function(e,data) { + var i; + $scope.$apply(function() { + $scope.filesUploading.push(data.files[data.index]); + }); + }); + + // All these sit-ups are to add dropzone area and make sure it gets removed if dragging is aborted! + $scope.$on('fileuploaddragover', function(event, files) { + if (!$scope.dragClearTimeout) { + $scope.$apply(function() { + $scope.dropping = true; + }); + } else { + $timeout.cancel($scope.dragClearTimeout); + } + $scope.dragClearTimeout = $timeout(function () { + $scope.dropping = null; + $scope.dragClearTimeout = null; + }, 300); + }); + + //init load + $scope.loadChildren(); } angular.module("umbraco").controller("Umbraco.Dashboard.MediaFolderBrowserDashboardController", MediaFolderBrowserDashboardController); diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/media/mediafolderbrowser.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/media/mediafolderbrowser.html index c4664280b0..f4e4499ae9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/dashboard/media/mediafolderbrowser.html +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/media/mediafolderbrowser.html @@ -1,3 +1,18 @@ -
- -
\ No newline at end of file +
+ + + + + + \ No newline at end of file From c4984bffc7ef3a54e86f08cb4f6925901449d3bb Mon Sep 17 00:00:00 2001 From: perploug Date: Fri, 27 Sep 2013 11:22:39 +0200 Subject: [PATCH 25/34] Nodetype create dialog --- .../umbraco/create/nodeType.ascx | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/create/nodeType.ascx b/src/Umbraco.Web.UI/umbraco/create/nodeType.ascx index 751d88770d..bb498c0f0f 100644 --- a/src/Umbraco.Web.UI/umbraco/create/nodeType.ascx +++ b/src/Umbraco.Web.UI/umbraco/create/nodeType.ascx @@ -1,24 +1,30 @@ <%@ Control Language="c#" AutoEventWireup="True" Codebehind="nodeType.ascx.cs" Inherits="umbraco.cms.presentation.create.controls.nodeType" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%> -

Master Document Type:
- - -

+<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> -
<%=umbraco.ui.Text("name")%>: - *
- -
+ + + + + + + + + * + -
- -
+ + + -
+ + + <%=umbraco.ui.Text("cancel")%> + + \ No newline at end of file From 23822a97efa94c386c03540943003a5a62585ee0 Mon Sep 17 00:00:00 2001 From: perploug Date: Fri, 27 Sep 2013 11:23:03 +0200 Subject: [PATCH 26/34] fixes dialog legacy redirects --- .../Application/UmbracoClientManager.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoClientManager.js b/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoClientManager.js index e19acea068..99f1e83ee0 100644 --- a/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoClientManager.js +++ b/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoClientManager.js @@ -130,15 +130,16 @@ Umbraco.Sys.registerNamespace("Umbraco.Application"); } this._debug("contentFrame: parsed location: " + strLocation); - var self = this; - window.setTimeout(function() { - if (typeof self.mainWindow().right != "undefined") { - self.mainWindow().right.location.href = strLocation; - } - else { - self.mainWindow().location.href = strLocation; //set the current windows location if the right frame doesn't exist int he current context - } - }, 200); + + if (!this.mainWindow().UmbClientMgr) { + window.setTimeout(function() { + var self = this; + self.mainWindow().location.href = strLocation; + }, 200); + } + else { + this.mainWindow().UmbClientMgr.contentFrame(strLocation); + } } }, reloadContentFrameUrlIfPathLoaded: function (url) { From dcb08250abd8d242fa53e3f743f1a2ec2e6a03c6 Mon Sep 17 00:00:00 2001 From: perploug Date: Fri, 27 Sep 2013 11:23:38 +0200 Subject: [PATCH 27/34] Minor search visual tweaks --- build/Build.bat | 2 +- .../Configuration/UmbracoVersion.cs | 2 +- .../src/views/directives/umb-navigation.html | 30 +++++++++++++------ src/Umbraco.Web/Editors/EntityController.cs | 3 ++ src/Umbraco.Web/UmbracoContext.cs | 4 +-- 5 files changed, 28 insertions(+), 13 deletions(-) diff --git a/build/Build.bat b/build/Build.bat index ff11f0e7ab..27af8026d9 100644 --- a/build/Build.bat +++ b/build/Build.bat @@ -1,6 +1,6 @@ @ECHO OFF SET release=7.0.0 -SET comment= +SET comment=alpha SET version=%release% IF [%comment%] EQU [] (SET version=%release%) ELSE (SET version=%release%-%comment%) diff --git a/src/Umbraco.Core/Configuration/UmbracoVersion.cs b/src/Umbraco.Core/Configuration/UmbracoVersion.cs index e15e365ba4..3e3564f38f 100644 --- a/src/Umbraco.Core/Configuration/UmbracoVersion.cs +++ b/src/Umbraco.Core/Configuration/UmbracoVersion.cs @@ -23,7 +23,7 @@ namespace Umbraco.Core.Configuration /// Gets the version comment (like beta or RC). ///
/// The version comment. - public static string CurrentComment { get { return ""; } } + public static string CurrentComment { get { return "alpha"; } } // Get the version of the umbraco.dll by looking at a class in that dll // Had to do it like this due to medium trust issues, see: http://haacked.com/archive/2010/11/04/assembly-location-and-medium-trust.aspx diff --git a/src/Umbraco.Web.UI.Client/src/views/directives/umb-navigation.html b/src/Umbraco.Web.UI.Client/src/views/directives/umb-navigation.html index 8314ce4557..2b9740d07e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/directives/umb-navigation.html +++ b/src/Umbraco.Web.UI.Client/src/views/directives/umb-navigation.html @@ -54,16 +54,28 @@
-
Search results
-
diff --git a/src/Umbraco.Web/Editors/EntityController.cs b/src/Umbraco.Web/Editors/EntityController.cs index 73208928ef..63782c4c55 100644 --- a/src/Umbraco.Web/Editors/EntityController.cs +++ b/src/Umbraco.Web/Editors/EntityController.cs @@ -36,6 +36,9 @@ namespace Umbraco.Web.Editors [HttpGet] public IEnumerable Search([FromUri] string query, UmbracoEntityTypes type) { + if (string.IsNullOrEmpty(query)) + return null; + switch (type) { case UmbracoEntityTypes.Document: diff --git a/src/Umbraco.Web/UmbracoContext.cs b/src/Umbraco.Web/UmbracoContext.cs index f479cc3ac6..35896c9358 100644 --- a/src/Umbraco.Web/UmbracoContext.cs +++ b/src/Umbraco.Web/UmbracoContext.cs @@ -412,8 +412,8 @@ namespace Umbraco.Web return //StateHelper.Cookies.Preview.HasValue // has preview cookie HttpContext.Request.HasPreviewCookie() - && UmbracoUser != null // has user - && currentUrl.StartsWith(IOHelper.ResolveUrl(SystemDirectories.Umbraco)) == false; // is not in admin UI + && currentUrl.StartsWith(IOHelper.ResolveUrl(SystemDirectories.Umbraco)) == false + && UmbracoUser != null; // has user } private HttpRequestBase GetRequestFromContext() From 0c8a7f3466b573bacfff2b15050537afae9d4115 Mon Sep 17 00:00:00 2001 From: perploug Date: Fri, 27 Sep 2013 11:35:59 +0200 Subject: [PATCH 28/34] Updates missing dashboard paths --- .../config/Dashboard.Release.config | 24 ++++++++----------- src/Umbraco.Web.UI/config/Dashboard.config | 6 ++--- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/Umbraco.Web.UI/config/Dashboard.Release.config b/src/Umbraco.Web.UI/config/Dashboard.Release.config index 0689c584d5..433574958e 100644 --- a/src/Umbraco.Web.UI/config/Dashboard.Release.config +++ b/src/Umbraco.Web.UI/config/Dashboard.Release.config @@ -1,5 +1,6 @@  +
settings @@ -26,7 +27,11 @@ views/dashboard/developer/developerdashboardvideos.html + + /umbraco/dashboard/ExamineManagement.ascx +
+
media @@ -51,6 +56,7 @@
+
translator @@ -63,17 +69,17 @@ admin - views/dashboard/startupdashboardintro.html + views/dashboard/default/startupdashboardintro.html - views/dashboard/startupdashboardkits.html + views/dashboard/default/startupdashboardkits.html editor writer - views/dashboard/startupdashboardvideos.html + views/dashboard/default/startupdashboardvideos.html @@ -85,7 +91,7 @@
- +
member @@ -102,14 +108,4 @@
- -
- - developer - - - /umbraco/dashboard/ExamineManagement.ascx - -
-
\ No newline at end of file diff --git a/src/Umbraco.Web.UI/config/Dashboard.config b/src/Umbraco.Web.UI/config/Dashboard.config index 5eef4294e3..b8cbbe0838 100644 --- a/src/Umbraco.Web.UI/config/Dashboard.config +++ b/src/Umbraco.Web.UI/config/Dashboard.config @@ -69,17 +69,17 @@ admin - views/dashboard/startupdashboardintro.html + views/dashboard/default/startupdashboardintro.html - views/dashboard/startupdashboardkits.html + views/dashboard/default/startupdashboardkits.html editor writer - views/dashboard/startupdashboardvideos.html + views/dashboard/default/startupdashboardvideos.html From 962bab088cff0311ab55f3878bfe7b0680617260 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Fri, 27 Sep 2013 12:00:36 +0200 Subject: [PATCH 29/34] Update nuspec files to get the correct dependencies with the correct versions --- build/NuSpecs/UmbracoCms.Core.nuspec | 105 ++++++++++++++------------- build/NuSpecs/UmbracoCms.nuspec | 4 +- 2 files changed, 55 insertions(+), 54 deletions(-) diff --git a/build/NuSpecs/UmbracoCms.Core.nuspec b/build/NuSpecs/UmbracoCms.Core.nuspec index 009b47b89b..4bf105df18 100644 --- a/build/NuSpecs/UmbracoCms.Core.nuspec +++ b/build/NuSpecs/UmbracoCms.Core.nuspec @@ -1,8 +1,8 @@ - + UmbracoCms.Core - 6.1.2 + 7.0.0 Umbraco Cms Core Binaries Morten Christensen Umbraco HQ @@ -14,57 +14,58 @@ Contains the core assemblies needed to run Umbraco Cms en-US umbraco - + - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build/NuSpecs/UmbracoCms.nuspec b/build/NuSpecs/UmbracoCms.nuspec index e84ebc8e2e..07ef412ce5 100644 --- a/build/NuSpecs/UmbracoCms.nuspec +++ b/build/NuSpecs/UmbracoCms.nuspec @@ -1,8 +1,8 @@ - + UmbracoCms - 6.1.2 + 7.0.0 Umbraco Cms Morten Christensen Umbraco HQ From 540a28ea8b5a9753abe35e742c1f8dca8ef3e0ea Mon Sep 17 00:00:00 2001 From: perploug Date: Fri, 27 Sep 2013 12:23:12 +0200 Subject: [PATCH 30/34] Fixes image upload extensions filters out disallowed converts images to mediaType=image everything else type = file --- src/Umbraco.Web/Editors/MediaController.cs | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web/Editors/MediaController.cs b/src/Umbraco.Web/Editors/MediaController.cs index 8d1dd5c3c6..eff8106d31 100644 --- a/src/Umbraco.Web/Editors/MediaController.cs +++ b/src/Umbraco.Web/Editors/MediaController.cs @@ -29,6 +29,7 @@ using Umbraco.Web.WebApi.Filters; using umbraco; using umbraco.BusinessLogic.Actions; using Constants = Umbraco.Core.Constants; +using Umbraco.Core.Configuration; namespace Umbraco.Web.Editors { @@ -347,16 +348,24 @@ namespace Umbraco.Web.Editors foreach (var file in result.FileData) { var fileName = file.Headers.ContentDisposition.FileName.Trim(new[] { '\"' }); + var ext = fileName.Substring(fileName.LastIndexOf('.')+1).ToLower(); - var mediaService = ApplicationContext.Services.MediaService; - var f = mediaService.CreateMedia(fileName, parentId, Constants.Conventions.MediaTypes.Image); - - using (var fs = System.IO.File.OpenRead(file.LocalFileName)) + if (!UmbracoConfig.For.UmbracoSettings().Content.DisallowedUploadFiles.Contains(ext)) { - f.SetValue(Constants.Conventions.Media.File, fileName, fs); - } + var mediaType = Constants.Conventions.MediaTypes.File; - mediaService.Save(f); + if (UmbracoConfig.For.UmbracoSettings().Content.ImageFileTypes.Contains(ext)) + mediaType = Constants.Conventions.MediaTypes.Image; + + var mediaService = ApplicationContext.Services.MediaService; + var f = mediaService.CreateMedia(fileName, parentId, mediaType); + using (var fs = System.IO.File.OpenRead(file.LocalFileName)) + { + f.SetValue(Constants.Conventions.Media.File, fileName, fs); + } + + mediaService.Save(f); + } //now we can remove the temp file System.IO.File.Delete(file.LocalFileName); From f74b9f9071b5d3af15bbc8b28695a99b896f7371 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Fri, 27 Sep 2013 13:35:52 +0200 Subject: [PATCH 31/34] Renaming columns in SQL CE is a bit more elaborate.. --- .../Upgrades/TargetVersionSeven/AlterCmsMacroPropertyTable.cs | 3 ++- .../Upgrades/TargetVersionSeven/ChangeControlIdColumn.cs | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterCmsMacroPropertyTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterCmsMacroPropertyTable.cs index c93b095e69..77613dbd0d 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterCmsMacroPropertyTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterCmsMacroPropertyTable.cs @@ -23,8 +23,9 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven //change the type (keep the data) Alter.Table("cmsMacroProperty").AlterColumn("macroPropertyType").AsString(255); //rename the column + Alter.Table("cmsMacroProperty").AddColumn("editorAlias").AsString(255).NotNullable().WithDefaultValue(""); Rename.Column("macroPropertyType").OnTable("cmsMacroProperty").To("editorAlias"); - + Delete.Column("macroPropertyType").FromTable("cmsMacroProperty"); } public override void Down() diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/ChangeControlIdColumn.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/ChangeControlIdColumn.cs index e2b3632622..c84d3f9d9f 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/ChangeControlIdColumn.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/ChangeControlIdColumn.cs @@ -12,7 +12,10 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven public override void Up() { Alter.Table("cmsDataType").AlterColumn("controlId").AsString(255); + Alter.Table("cmsDataType").AddColumn("propertyEditorAlias").AsString(255).NotNullable().WithDefaultValue(""); Rename.Column("controlId").OnTable("cmsDataType").To("propertyEditorAlias"); + + Delete.Column("controlId").FromTable("cmsDataType"); } public override void Down() From f0692329b689675cee8550dad9b3a6755c5bd510 Mon Sep 17 00:00:00 2001 From: perploug Date: Fri, 27 Sep 2013 13:36:59 +0200 Subject: [PATCH 32/34] Moved contentpicker button to bottom --- .../common/dialogs/contentpicker.controller.js | 1 - .../views/common/dialogs/contentpicker.html | 18 +++++++++--------- .../src/views/common/dialogs/treepicker.html | 18 +++++++++--------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/contentpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/contentpicker.controller.js index 06176cd6c0..305790a59d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/contentpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/contentpicker.controller.js @@ -8,7 +8,6 @@ angular.module("umbraco").controller("Umbraco.Dialogs.ContentPickerController", args.event.preventDefault(); args.event.stopPropagation(); - eventsService.publish("Umbraco.Dialogs.ContentPickerController.Select", args).then(function(args){ if(dialogOptions && dialogOptions.multipicker){ diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/contentpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/contentpicker.html index 75e9cf8a97..ebe9151b4f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/contentpicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/contentpicker.html @@ -1,13 +1,5 @@
-
-
-
- -
-
-
- -
+
+ +
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.html index bf61c6eeb8..01120accf8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.html @@ -1,13 +1,5 @@
-
-
-
- -
-
-
- -
+
+ +
\ No newline at end of file From 840047335a43d40e85ef6d12d79e858e72cb94d3 Mon Sep 17 00:00:00 2001 From: perploug Date: Fri, 27 Sep 2013 13:48:06 +0200 Subject: [PATCH 33/34] removes folder.gif references --- .../config/trees.Release.config | 58 +++++++++---------- .../umbraco/Trees/loadPackages.cs | 10 +--- .../umbraco/Trees/loadScripts.cs | 4 +- 3 files changed, 32 insertions(+), 40 deletions(-) diff --git a/src/Umbraco.Web.UI/config/trees.Release.config b/src/Umbraco.Web.UI/config/trees.Release.config index e263be1c66..67bb821825 100644 --- a/src/Umbraco.Web.UI/config/trees.Release.config +++ b/src/Umbraco.Web.UI/config/trees.Release.config @@ -2,50 +2,50 @@ - - + + - - + + - + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - + + + - - - + + + - - + + + iconClosed=".icon-folder" iconOpen=".icon-folder" sortOrder="10" />--> \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs index 2b4e95b846..9fa426669b 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs @@ -135,15 +135,6 @@ namespace umbraco xNode.OpenIcon = "icon-folder"; xNode.NodeType = "packagesCategory" + cat.Id; tree.Add(xNode); - /* - XmlElement catElement = Tree.CreateElement("tree"); - catElement.SetAttribute("text", cat.Text); - //catElement.SetAttribute("menu", ""); - catElement.SetAttribute("icon", "folder.gif"); - catElement.SetAttribute("openIcon", "folder_o.gif"); - catElement.SetAttribute("nodeType", "packagesCategory" + cat.Id); - catElement.SetAttribute("action", "javascript:openPackageCategory('BrowseRepository.aspx?category=" + cat.Id + "&repoGuid=" + currentRepo.Guid + "');"); - root.AppendChild(catElement);*/ } } break; @@ -172,6 +163,7 @@ namespace umbraco set { m_app = value; } } + void ITree.Render(ref XmlDocument Tree) { m_packageType = HttpContext.Current.Request.QueryString["packageType"]; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadScripts.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadScripts.cs index e5df6d330f..605ca14946 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadScripts.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadScripts.cs @@ -32,7 +32,7 @@ using Umbraco.Core; namespace umbraco { - [Tree(Constants.Applications.Settings, "scripts", "Scripts", "folder.gif", "folder_o.gif", sortOrder: 2)] + [Tree(Constants.Applications.Settings, "scripts", "Scripts", "icon-folder", "icon-folder", sortOrder: 2)] public class loadScripts : FileSystemTree { public loadScripts(string application) : base(application) { } @@ -76,7 +76,7 @@ namespace umbraco { xNode.Action = xNode.Action.Replace("openFile", "openScriptEditor"); xNode.Icon = "icon-code"; - xNode.OpenIcon = "icon.code"; + xNode.OpenIcon = "icon-code"; } From f456e5b83e330bb10eda14780d648188aa7412c8 Mon Sep 17 00:00:00 2001 From: perploug Date: Fri, 27 Sep 2013 14:21:06 +0200 Subject: [PATCH 34/34] One last icon class update in tree.config --- .../config/trees.Release.config | 58 ++++++++-------- src/Umbraco.Web.UI/config/trees.config | 67 +++++++++++-------- 2 files changed, 67 insertions(+), 58 deletions(-) diff --git a/src/Umbraco.Web.UI/config/trees.Release.config b/src/Umbraco.Web.UI/config/trees.Release.config index 67bb821825..83d4d5ad1e 100644 --- a/src/Umbraco.Web.UI/config/trees.Release.config +++ b/src/Umbraco.Web.UI/config/trees.Release.config @@ -2,50 +2,50 @@ - - + + - - + + - + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - + + + - - - + + + - - + + + iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="10" />--> \ No newline at end of file diff --git a/src/Umbraco.Web.UI/config/trees.config b/src/Umbraco.Web.UI/config/trees.config index e18f473875..12556c44e3 100644 --- a/src/Umbraco.Web.UI/config/trees.config +++ b/src/Umbraco.Web.UI/config/trees.config @@ -1,42 +1,51 @@  + - - + + + - - + + + - + - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + + - - - + + + + - - - + + + + - - + + + + iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="10" />--> + \ No newline at end of file