diff --git a/src/Umbraco.Core/Constants-Conventions.cs b/src/Umbraco.Core/Constants-Conventions.cs index 8ca4daddb3..4e49933585 100644 --- a/src/Umbraco.Core/Constants-Conventions.cs +++ b/src/Umbraco.Core/Constants-Conventions.cs @@ -225,7 +225,7 @@ namespace Umbraco.Core { { Comments, - new PropertyType(PropertyEditors.Aliases.TextboxMultiple, ValueStorageType.Ntext, true, Comments) + new PropertyType(PropertyEditors.Aliases.TextArea, ValueStorageType.Ntext, true, Comments) { Name = CommentsLabel } diff --git a/src/Umbraco.Core/Constants-PropertyEditors.cs b/src/Umbraco.Core/Constants-PropertyEditors.cs index 56c174b68c..f6ce98901d 100644 --- a/src/Umbraco.Core/Constants-PropertyEditors.cs +++ b/src/Umbraco.Core/Constants-PropertyEditors.cs @@ -1,4 +1,4 @@ -using System; +using Umbraco.Core.PropertyEditors; namespace Umbraco.Core { @@ -32,7 +32,7 @@ namespace Umbraco.Core /// /// Content Picker. /// - public const string ContentPicker2Alias = "Umbraco.ContentPicker2"; // fixme + public const string ContentPicker = "Umbraco.ContentPicker"; /// /// Date. @@ -102,12 +102,12 @@ namespace Umbraco.Core /// /// Media Picker. /// - public const string MediaPicker2 = "Umbraco.MediaPicker2"; // fixme + public const string MediaPicker = "Umbraco.MediaPicker"; /// /// Member Picker. /// - public const string MemberPicker2 = "Umbraco.MemberPicker2"; // fixme + public const string MemberPicker = "Umbraco.MemberPicker"; /// /// Member Group Picker. @@ -117,7 +117,7 @@ namespace Umbraco.Core /// /// MultiNode Tree Picker. /// - public const string MultiNodeTreePicker2 = "Umbraco.MultiNodeTreePicker2"; // fixme + public const string MultiNodeTreePicker = "Umbraco.MultiNodeTreePicker"; /// /// Multiple TextString. @@ -142,7 +142,7 @@ namespace Umbraco.Core /// /// Related Links. /// - public const string RelatedLinks2 = "Umbraco.RelatedLinks2"; // fixme + public const string RelatedLinks = "Umbraco.RelatedLinks"; /// /// Slider. @@ -157,12 +157,12 @@ namespace Umbraco.Core /// /// Textbox. /// - public const string Textbox = "Umbraco.Textbox"; + public const string TextBox = "Umbraco.TextBox"; /// /// Textbox Multiple. /// - public const string TextboxMultiple = "Umbraco.TextboxMultiple"; // fixme TextArea? + public const string TextArea = "Umbraco.TextArea"; /// /// TinyMCE @@ -216,9 +216,9 @@ namespace Umbraco.Core public static class ConfigurationKeys { /// - /// The value type of property data (i.e., string, etc) - /// fixme - values? + /// The value type of property data (i.e., string, integer, etc) /// + /// Must be a valid value. public const string DataValueType = "umbracoDataValueType"; } } diff --git a/src/Umbraco.Core/Migrations/Install/DatabaseDataCreator.cs b/src/Umbraco.Core/Migrations/Install/DatabaseDataCreator.cs index 484b761661..8032cd42a6 100644 --- a/src/Umbraco.Core/Migrations/Install/DatabaseDataCreator.cs +++ b/src/Umbraco.Core/Migrations/Install/DatabaseDataCreator.cs @@ -230,8 +230,8 @@ namespace Umbraco.Core.Migrations.Install _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -51, EditorAlias = Constants.PropertyEditors.Aliases.Integer, DbType = "Integer" }); _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -87, EditorAlias = Constants.PropertyEditors.Aliases.TinyMce, DbType = "Ntext", Configuration = "{\"value\":\",code,undo,redo,cut,copy,mcepasteword,stylepicker,bold,italic,bullist,numlist,outdent,indent,mcelink,unlink,mceinsertanchor,mceimage,umbracomacro,mceinserttable,umbracoembed,mcecharmap,|1|1,2,3,|0|500,400|1049,|true|\"}" }); - _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -88, EditorAlias = Constants.PropertyEditors.Aliases.Textbox, DbType = "Nvarchar" }); - _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -89, EditorAlias = Constants.PropertyEditors.Aliases.TextboxMultiple, DbType = "Ntext" }); + _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -88, EditorAlias = Constants.PropertyEditors.Aliases.TextBox, DbType = "Nvarchar" }); + _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -89, EditorAlias = Constants.PropertyEditors.Aliases.TextArea, DbType = "Ntext" }); _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -90, EditorAlias = Constants.PropertyEditors.Aliases.UploadField, DbType = "Nvarchar" }); _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -92, EditorAlias = Constants.PropertyEditors.Aliases.NoEdit, DbType = "Nvarchar" }); _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -36, EditorAlias = Constants.PropertyEditors.Aliases.DateTime, DbType = "Date" }); @@ -251,12 +251,12 @@ namespace Umbraco.Core.Migrations.Install Configuration = "{\"pageSize\":10, \"orderBy\":\"username\", \"orderDirection\":\"asc\", \"includeProperties\":[{\"alias\":\"username\",\"isSystem\":1},{\"alias\":\"email\",\"isSystem\":1},{\"alias\":\"updateDate\",\"header\":\"Last edited\",\"isSystem\":1}]}" }); //New UDI pickers with newer Ids - _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1046, EditorAlias = Constants.PropertyEditors.Aliases.ContentPicker2Alias, DbType = "Nvarchar" }); - _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1047, EditorAlias = Constants.PropertyEditors.Aliases.MemberPicker2, DbType = "Nvarchar" }); - _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1048, EditorAlias = Constants.PropertyEditors.Aliases.MediaPicker2, DbType = "Ntext" }); - _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1049, EditorAlias = Constants.PropertyEditors.Aliases.MediaPicker2, DbType = "Ntext", + _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1046, EditorAlias = Constants.PropertyEditors.Aliases.ContentPicker, DbType = "Nvarchar" }); + _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1047, EditorAlias = Constants.PropertyEditors.Aliases.MemberPicker, DbType = "Nvarchar" }); + _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1048, EditorAlias = Constants.PropertyEditors.Aliases.MediaPicker, DbType = "Ntext" }); + _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1049, EditorAlias = Constants.PropertyEditors.Aliases.MediaPicker, DbType = "Ntext", Configuration = "{\"multiPicker\":1}" }); - _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1050, EditorAlias = Constants.PropertyEditors.Aliases.RelatedLinks2, DbType = "Ntext" }); + _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1050, EditorAlias = Constants.PropertyEditors.Aliases.RelatedLinks, DbType = "Ntext" }); //TODO: We're not creating these for 7.0 //_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { DataTypeId = 1038, PropertyEditorAlias = Constants.PropertyEditors.MarkdownEditorAlias, DbType = "Ntext" }); diff --git a/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs b/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs index 5e9e09e63b..16ec3d0a30 100644 --- a/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs +++ b/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs @@ -8,9 +8,6 @@ using Umbraco.Core.Migrations.Upgrade.V_7_5_5; using Umbraco.Core.Migrations.Upgrade.V_7_6_0; using Umbraco.Core.Migrations.Upgrade.V_7_7_0; using Umbraco.Core.Migrations.Upgrade.V_8_0_0; -using AddLockObjects = Umbraco.Core.Migrations.Upgrade.V_8_0_0.AddLockObjects; -using AddLockTable = Umbraco.Core.Migrations.Upgrade.V_8_0_0.AddLockTable; -using UpdateUniqueIndexOnPropertyData = Umbraco.Core.Migrations.Upgrade.V_7_5_0.UpdateUniqueIndexOnPropertyData; namespace Umbraco.Core.Migrations.Upgrade { @@ -67,7 +64,7 @@ namespace Umbraco.Core.Migrations.Upgrade // // when installing, the source state is empty, and the target state should be the final state. - Add(string.Empty, "{82C4BA1D-7720-46B1-BBD7-07F3F73800E6}"); + Add(string.Empty, "{CA7DB949-3EF4-403D-8464-F9BA36A52E87}"); // UPGRADE FROM 7 // @@ -79,14 +76,15 @@ namespace Umbraco.Core.Migrations.Upgrade // upgrade paths, etc). From("{init-7.8.0}") - .Chain("{7C447271-CA3F-4A6A-A913-5D77015655CB}") // add more lock objects + .Chain("{7C447271-CA3F-4A6A-A913-5D77015655CB}") // add more lock objects .Chain("{CBFF58A2-7B50-4F75-8E98-249920DB0F37}") .Chain("{3D18920C-E84D-405C-A06A-B7CEE52FE5DD}") .Chain("{FB0A5429-587E-4BD0-8A67-20F0E7E62FF7}") .Chain("{F0C42457-6A3B-4912-A7EA-F27ED85A2092}") .Chain("{8640C9E4-A1C0-4C59-99BB-609B4E604981}") .Chain("{DD1B99AF-8106-4E00-BAC7-A43003EA07F8}") - .Chain("{CC1B1201-1328-443C-954A-E0BBB8CCC1B5}"); + .Chain("{9DF05B77-11D1-475C-A00A-B656AF7E0908}") + .Chain("{CA7DB949-3EF4-403D-8464-F9BA36A52E87}");; // 7.8.1 = same as 7.8.0 From("{init-7.8.1}") @@ -117,14 +115,14 @@ namespace Umbraco.Core.Migrations.Upgrade // 8.0.0 From("{init-origin}"); - Chain("{98347B5E-65BF-4DD7-BB43-A09CB7AF4FCA}"); - Chain("{1E8165C4-942D-40DC-AC76-C5FF8831E400}"); + Chain("{98347B5E-65BF-4DD7-BB43-A09CB7AF4FCA}"); + Chain("{1E8165C4-942D-40DC-AC76-C5FF8831E400}"); Chain("{39E15568-7AAD-4D54-81D0-758CCFC529F8}"); Chain("{55C3F97D-BDA7-4FB1-A743-B0456B56EAA3}"); // 7.5.0 Chain("{287F9E39-F673-42F7-908C-21659AB13B13}"); - Chain("{2D08588A-AD90-479C-9F6E-A99B60BA7226}"); + Chain("{2D08588A-AD90-479C-9F6E-A99B60BA7226}"); Chain("{2D917FF8-AC81-4C00-A407-1F4B1DF6089C}"); // 7.5.5 @@ -157,6 +155,7 @@ namespace Umbraco.Core.Migrations.Upgrade Chain("{82C4BA1D-7720-46B1-BBD7-07F3F73800E6}"); Chain("{139F26D7-7E08-48E3-81D9-E50A21A72F67}"); Chain("{CC1B1201-1328-443C-954A-E0BBB8CCC1B5}"); + Chain("{CA7DB949-3EF4-403D-8464-F9BA36A52E87}"); } } } diff --git a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/PropertyEditorsMigration.cs b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/PropertyEditorsMigration.cs new file mode 100644 index 0000000000..cd4e702ea9 --- /dev/null +++ b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/PropertyEditorsMigration.cs @@ -0,0 +1,39 @@ +using System; +using Umbraco.Core.Persistence; +using Umbraco.Core.Persistence.Dtos; + +namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 +{ + public class PropertyEditorsMigration : MigrationBase + { + public PropertyEditorsMigration(IMigrationContext context) + : base(context) + { } + + public override void Migrate() + { + RenameDataType(Constants.PropertyEditors.Aliases.ContentPicker + "2", Constants.PropertyEditors.Aliases.ContentPicker); + RenameDataType(Constants.PropertyEditors.Aliases.MediaPicker + "2", Constants.PropertyEditors.Aliases.MediaPicker); + RenameDataType(Constants.PropertyEditors.Aliases.MemberPicker + "2", Constants.PropertyEditors.Aliases.MemberPicker); + RenameDataType(Constants.PropertyEditors.Aliases.MultiNodeTreePicker + "2", Constants.PropertyEditors.Aliases.MultiNodeTreePicker); + RenameDataType(Constants.PropertyEditors.Aliases.RelatedLinks + "2", Constants.PropertyEditors.Aliases.RelatedLinks); + RenameDataType("Umbraco.TextboxMultiple", Constants.PropertyEditors.Aliases.TextArea); + RenameDataType("Umbraco.Textbox", Constants.PropertyEditors.Aliases.TextBox); + } + + private void RenameDataType(string fromAlias, string toAlias) + { + var oldCount = Database.ExecuteScalar(Sql() + .SelectCount() + .From() + .Where(x => x.EditorAlias == toAlias)); + + if (oldCount > 0) + throw new InvalidOperationException($"Cannot rename datatype alias \"{fromAlias}\" to \"{toAlias}\" because the target alias is already used."); + + Database.Execute(Sql() + .Update(u => u.Set(x => x.EditorAlias, toAlias)) + .Where(x => x.EditorAlias == fromAlias)); + } + } +} diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs index 89f978f417..56d500167c 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs @@ -88,10 +88,10 @@ namespace Umbraco.Core.Models.PublishedContent // fixme - this list somehow also exists in constants, see memberTypeRepository => remove duplicate! private static readonly Dictionary BuiltinMemberProperties = new Dictionary { - { "Email", (Constants.DataTypes.Textbox, Constants.PropertyEditors.Aliases.Textbox) }, - { "Username", (Constants.DataTypes.Textbox, Constants.PropertyEditors.Aliases.Textbox) }, - { "PasswordQuestion", (Constants.DataTypes.Textbox, Constants.PropertyEditors.Aliases.Textbox) }, - { "Comments", (Constants.DataTypes.Textbox, Constants.PropertyEditors.Aliases.Textbox) }, + { "Email", (Constants.DataTypes.Textbox, Constants.PropertyEditors.Aliases.TextBox) }, + { "Username", (Constants.DataTypes.Textbox, Constants.PropertyEditors.Aliases.TextBox) }, + { "PasswordQuestion", (Constants.DataTypes.Textbox, Constants.PropertyEditors.Aliases.TextBox) }, + { "Comments", (Constants.DataTypes.Textbox, Constants.PropertyEditors.Aliases.TextBox) }, { "IsApproved", (Constants.DataTypes.Boolean, Constants.PropertyEditors.Aliases.Boolean) }, { "IsLockedOut", (Constants.DataTypes.Boolean, Constants.PropertyEditors.Aliases.Boolean) }, { "LastLockoutDate", (Constants.DataTypes.Datetime, Constants.PropertyEditors.Aliases.DateTime) }, diff --git a/src/Umbraco.Core/PropertyEditors/IPropertyValueConverter.cs b/src/Umbraco.Core/PropertyEditors/IPropertyValueConverter.cs index f535534caf..a42b26c9a1 100644 --- a/src/Umbraco.Core/PropertyEditors/IPropertyValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/IPropertyValueConverter.cs @@ -4,12 +4,10 @@ using Umbraco.Core.Composing; namespace Umbraco.Core.PropertyEditors { - // fixme rename PropertyValueConverter to ValueConverter everywhere - // fixme rename the "intermediate" value to "temp" value - /// /// Provides published content properties conversion service. /// + /// This is not a simple "value converter" because it really works only for properties. public interface IPropertyValueConverter : IDiscoverable { /// diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/MustBeStringValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/MustBeStringValueConverter.cs index 6feb3ad033..c9528c3e8b 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/MustBeStringValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/MustBeStringValueConverter.cs @@ -19,7 +19,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters { private static readonly string[] Aliases = { - Constants.PropertyEditors.Aliases.MultiNodeTreePicker2 + Constants.PropertyEditors.Aliases.MultiNodeTreePicker }; public override bool IsConverter(PublishedPropertyType propertyType) diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/TextStringValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/TextStringValueConverter.cs index 47b20326b4..854fd4ca2a 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/TextStringValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/TextStringValueConverter.cs @@ -9,8 +9,8 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters { private static readonly string[] PropertyTypeAliases = { - Constants.PropertyEditors.Aliases.Textbox, - Constants.PropertyEditors.Aliases.TextboxMultiple + Constants.PropertyEditors.Aliases.TextBox, + Constants.PropertyEditors.Aliases.TextArea }; public override bool IsConverter(PublishedPropertyType propertyType) diff --git a/src/Umbraco.Core/Services/Implement/MemberService.cs b/src/Umbraco.Core/Services/Implement/MemberService.cs index 40265e2f4c..83ec78932f 100644 --- a/src/Umbraco.Core/Services/Implement/MemberService.cs +++ b/src/Umbraco.Core/Services/Implement/MemberService.cs @@ -1162,7 +1162,7 @@ namespace Umbraco.Core.Services.Implement Name = "Membership", Id = --identity }; - propGroup.PropertyTypes.Add(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, Constants.Conventions.Member.Comments) + propGroup.PropertyTypes.Add(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, Constants.Conventions.Member.Comments) { Name = Constants.Conventions.Member.CommentsLabel, SortOrder = 0, diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 94db77d6fe..00f1a85d79 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -315,6 +315,7 @@ + diff --git a/src/Umbraco.Tests/Models/Mapping/ContentTypeModelMappingTests.cs b/src/Umbraco.Tests/Models/Mapping/ContentTypeModelMappingTests.cs index 79e5b36b80..39baa2000e 100644 --- a/src/Umbraco.Tests/Models/Mapping/ContentTypeModelMappingTests.cs +++ b/src/Umbraco.Tests/Models/Mapping/ContentTypeModelMappingTests.cs @@ -714,7 +714,7 @@ namespace Umbraco.Tests.Models.Mapping var ctMain = MockedContentTypes.CreateSimpleMediaType("parent", "Parent"); //not assigned to tab - ctMain.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) + ctMain.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = "umbracoUrlName", Name = "Slug", @@ -725,7 +725,7 @@ namespace Umbraco.Tests.Models.Mapping }); MockedContentTypes.EnsureAllIds(ctMain, 8888); var ctChild1 = MockedContentTypes.CreateSimpleMediaType("child1", "Child 1", ctMain, true); - ctChild1.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) + ctChild1.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = "someProperty", Name = "Some Property", @@ -737,7 +737,7 @@ namespace Umbraco.Tests.Models.Mapping MockedContentTypes.EnsureAllIds(ctChild1, 7777); var contentType = MockedContentTypes.CreateSimpleMediaType("child2", "Child 2", ctChild1, true, "CustomGroup"); //not assigned to tab - contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) + contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = "umbracoUrlAlias", Name = "AltUrl", @@ -805,13 +805,13 @@ namespace Umbraco.Tests.Models.Mapping var ctMain = MockedContentTypes.CreateSimpleContentType(); //not assigned to tab - ctMain.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) + ctMain.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = "umbracoUrlName", Name = "Slug", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }); MockedContentTypes.EnsureAllIds(ctMain, 8888); var ctChild1 = MockedContentTypes.CreateSimpleContentType("child1", "Child 1", ctMain, true); - ctChild1.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) + ctChild1.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = "someProperty", Name = "Some Property", @@ -823,7 +823,7 @@ namespace Umbraco.Tests.Models.Mapping MockedContentTypes.EnsureAllIds(ctChild1, 7777); var contentType = MockedContentTypes.CreateSimpleContentType("child2", "Child 2", ctChild1, true, "CustomGroup"); //not assigned to tab - contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) + contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = "umbracoUrlAlias", Name = "AltUrl", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }); diff --git a/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs b/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs index 69b45f8fbb..8bde14678d 100644 --- a/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs +++ b/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs @@ -141,8 +141,8 @@ namespace Umbraco.Tests.Models.Mapping var idSeed = 1; var contentType = MockedContentTypes.CreateSimpleContentType(); //add non-grouped properties - contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "nonGrouped1") { Name = "Non Grouped 1", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }); - contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "nonGrouped2") { Name = "Non Grouped 2", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }); + contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "nonGrouped1") { Name = "Non Grouped 1", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }); + contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "nonGrouped2") { Name = "Non Grouped 2", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }); //set ids or it wont work contentType.Id = idSeed; foreach (var p in contentType.PropertyTypes) diff --git a/src/Umbraco.Tests/Persistence/Querying/ContentTypeSqlMappingTests.cs b/src/Umbraco.Tests/Persistence/Querying/ContentTypeSqlMappingTests.cs index 1a459e61b5..1274a4ee90 100644 --- a/src/Umbraco.Tests/Persistence/Querying/ContentTypeSqlMappingTests.cs +++ b/src/Umbraco.Tests/Persistence/Querying/ContentTypeSqlMappingTests.cs @@ -148,7 +148,7 @@ namespace Umbraco.Tests.Persistence.Querying scope.Database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 99999, Trashed = false, ParentId = -1, UserId = 0, Level = 0, Path = "-1,99999", SortOrder = 0, UniqueId = new Guid("129241F0-D24E-4FC3-92D1-BC2D48B7C431"), Text = "Test Content Type", NodeObjectType = Constants.ObjectTypes.DocumentType, CreateDate = DateTime.Now }); scope.Database.Execute(new Sql(string.Format("SET IDENTITY_INSERT {0} OFF ", SqlSyntax.GetQuotedTableName("umbracoNode")))); - scope.Database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 55555, EditorAlias = Constants.PropertyEditors.Aliases.Textbox, DbType = "Nvarchar" }); + scope.Database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 55555, EditorAlias = Constants.PropertyEditors.Aliases.TextBox, DbType = "Nvarchar" }); scope.Database.Execute(new Sql(string.Format("SET IDENTITY_INSERT {0} ON ", SqlSyntax.GetQuotedTableName("cmsContentType")))); scope.Database.Insert("cmsContentType", "pk", false, new ContentTypeDto { PrimaryKey = 88888, NodeId = 99999, Alias = "TestContentType", Icon = "icon-folder", Thumbnail = "folder.png", IsContainer = false, AllowAtRoot = true }); diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs index df44a41e27..0e726064f4 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs @@ -41,7 +41,7 @@ namespace Umbraco.Tests.PublishedContent new DataType(new RichTextPropertyEditor(logger)) { Id = 1002 }, new DataType(new IntegerPropertyEditor(logger)) { Id = 1003 }, new DataType(new TextboxPropertyEditor(logger)) { Id = 1004 }, - new DataType(new MediaPicker2PropertyEditor(logger)) { Id = 1005 }); + new DataType(new MediaPickerPropertyEditor(logger)) { Id = 1005 }); Container.RegisterSingleton(f => dataTypeService); } diff --git a/src/Umbraco.Tests/Services/ContentTypeServiceExtensionsTests.cs b/src/Umbraco.Tests/Services/ContentTypeServiceExtensionsTests.cs index 26e037b2e1..dd016f4b18 100644 --- a/src/Umbraco.Tests/Services/ContentTypeServiceExtensionsTests.cs +++ b/src/Umbraco.Tests/Services/ContentTypeServiceExtensionsTests.cs @@ -21,7 +21,7 @@ namespace Umbraco.Tests.Services { var contentCollection = new PropertyTypeCollection(true) { - new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) {Alias = alias, Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88} + new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) {Alias = alias, Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88} }; var pg = new PropertyGroup(contentCollection) { Name = "test", SortOrder = 1 }; ct.PropertyGroups.Add(pg); @@ -61,7 +61,7 @@ namespace Umbraco.Tests.Services { var contentCollection = new PropertyTypeCollection(true) { - new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) {Alias = "title", Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88} + new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) {Alias = "title", Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88} }; var pg = new PropertyGroup(contentCollection) { Name = "test", SortOrder = 1 }; ct.PropertyGroups.Add(pg); @@ -98,7 +98,7 @@ namespace Umbraco.Tests.Services { var contentCollection = new PropertyTypeCollection(true) { - new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) {Alias = "title", Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88} + new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) {Alias = "title", Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88} }; var pg = new PropertyGroup(contentCollection) { Name = "test", SortOrder = 1 }; ct.PropertyGroups.Add(pg); diff --git a/src/Umbraco.Tests/Services/ContentTypeServiceTests.cs b/src/Umbraco.Tests/Services/ContentTypeServiceTests.cs index bb877b2240..a5aec7ccfc 100644 --- a/src/Umbraco.Tests/Services/ContentTypeServiceTests.cs +++ b/src/Umbraco.Tests/Services/ContentTypeServiceTests.cs @@ -521,9 +521,9 @@ namespace Umbraco.Tests.Services Trashed = false }; - contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "title") { Name = "Title", Description = "", Mandatory = false, DataTypeId = -88 }); + contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "title") { Name = "Title", Description = "", Mandatory = false, DataTypeId = -88 }); contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.TinyMce, ValueStorageType.Ntext, "bodyText") { Name = "Body Text", Description = "", Mandatory = false, DataTypeId = -87 }); - contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "author") { Name = "Author", Description = "Name of the author", Mandatory = false, DataTypeId = -88 }); + contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "author") { Name = "Author", Description = "Name of the author", Mandatory = false, DataTypeId = -88 }); service.Save(contentType); @@ -912,7 +912,7 @@ namespace Umbraco.Tests.Services service.Save(child); // Act - var duplicatePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "title") + var duplicatePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "title") { Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; @@ -948,7 +948,7 @@ namespace Umbraco.Tests.Services service.Save(advancedPage); // Act - var duplicatePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "title") + var duplicatePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "title") { Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; @@ -1002,14 +1002,14 @@ namespace Umbraco.Tests.Services service.Save(contentMetaComposition); // Act - var bodyTextPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "bodyText") + var bodyTextPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "bodyText") { Name = "Body Text", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; var bodyTextAdded = basePage.AddPropertyType(bodyTextPropertyType, "Content"); service.Save(basePage); - var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "author") + var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "author") { Name = "Author", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; @@ -1020,7 +1020,7 @@ namespace Umbraco.Tests.Services service.Save(advancedPage); //NOTE: It should not be possible to Save 'BasePage' with the Title PropertyType added - var titlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "title") + var titlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "title") { Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; @@ -1077,28 +1077,28 @@ namespace Umbraco.Tests.Services service.Save(metaComposition); // Act - var bodyTextPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "bodyText") + var bodyTextPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "bodyText") { Name = "Body Text", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; var bodyTextAdded = basePage.AddPropertyType(bodyTextPropertyType, "Content"); service.Save(basePage); - var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "author") + var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "author") { Name = "Author", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; var authorAdded = contentPage.AddPropertyType(authorPropertyType, "Content"); service.Save(contentPage); - var subtitlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "subtitle") + var subtitlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "subtitle") { Name = "Subtitle", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; var subtitleAdded = advancedPage.AddPropertyType(subtitlePropertyType, "Content"); service.Save(advancedPage); - var titlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "title") + var titlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "title") { Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; @@ -1157,28 +1157,28 @@ namespace Umbraco.Tests.Services service.Save(metaComposition); // Act - var bodyTextPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "bodyText") + var bodyTextPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "bodyText") { Name = "Body Text", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; var bodyTextAdded = basePage.AddPropertyType(bodyTextPropertyType, "Content"); service.Save(basePage); - var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "author") + var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "author") { Name = "Author", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; var authorAdded = contentPage.AddPropertyType(authorPropertyType, "Content"); service.Save(contentPage); - var subtitlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "subtitle") + var subtitlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "subtitle") { Name = "Subtitle", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; var subtitleAdded = advancedPage.AddPropertyType(subtitlePropertyType, "Content"); service.Save(advancedPage); - var titlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "title") + var titlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "title") { Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; @@ -1198,7 +1198,7 @@ namespace Umbraco.Tests.Services Assert.That(seoCompositionAdded, Is.True); Assert.That(metaCompositionAdded, Is.True); - var testPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "test") + var testPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "test") { Name = "Test", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; @@ -1228,11 +1228,11 @@ namespace Umbraco.Tests.Services service.Save(contentMetaComposition); // Act - var subtitlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "subtitle") + var subtitlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "subtitle") { Name = "Subtitle", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; - var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "author") + var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "author") { Name = "Author", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; @@ -1274,22 +1274,22 @@ namespace Umbraco.Tests.Services service.Save(advancedPage); // Act - var titlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "title") + var titlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "title") { Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; var titleAdded = basePage.AddPropertyType(titlePropertyType, "Content"); - var bodyTextPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "bodyText") + var bodyTextPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "bodyText") { Name = "Body Text", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; var bodyTextAdded = contentPage.AddPropertyType(bodyTextPropertyType, "Content"); - var subtitlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "subtitle") + var subtitlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "subtitle") { Name = "Subtitle", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; var subtitleAdded = contentPage.AddPropertyType(subtitlePropertyType, "Content"); - var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "author") + var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "author") { Name = "Author", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; @@ -1347,7 +1347,7 @@ namespace Umbraco.Tests.Services service.Save(contentMetaComposition); // Act - var propertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "title") + var propertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "title") { Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; @@ -1381,12 +1381,12 @@ namespace Umbraco.Tests.Services service.Save(contentPage); // Act - var propertyTypeOne = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "testTextbox") + var propertyTypeOne = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "testTextbox") { Name = "Test Textbox", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; var firstOneAdded = contentPage.AddPropertyType(propertyTypeOne, "Content_"); - var propertyTypeTwo = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "anotherTextbox") + var propertyTypeTwo = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "anotherTextbox") { Name = "Another Test Textbox", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; @@ -1434,11 +1434,11 @@ namespace Umbraco.Tests.Services service.Save(contentPage); // Act - var bodyTextPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "bodyText") + var bodyTextPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "bodyText") { Name = "Body Text", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; - var subtitlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "subtitle") + var subtitlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "subtitle") { Name = "Subtitle", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; @@ -1446,15 +1446,15 @@ namespace Umbraco.Tests.Services var subtitleAdded = contentPage.AddPropertyType(subtitlePropertyType, "Content");//Will be added to the "Content Meta" composition service.Save(contentPage); - var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "author") + var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "author") { Name = "Author", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; - var descriptionPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "description") + var descriptionPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "description") { Name = "Description", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; - var keywordsPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "keywords") + var keywordsPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "keywords") { Name = "Keywords", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; @@ -1503,15 +1503,15 @@ namespace Umbraco.Tests.Services service.Save(contentMetaComposition); // Act - var bodyTextPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "bodyText") + var bodyTextPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "bodyText") { Name = "Body Text", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; - var subtitlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "subtitle") + var subtitlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "subtitle") { Name = "Subtitle", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; - var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "author") + var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "author") { Name = "Author", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; @@ -1556,14 +1556,14 @@ namespace Umbraco.Tests.Services service.Save(contentMetaComposition); // Act - var bodyTextPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "bodyText") + var bodyTextPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "bodyText") { Name = "Body Text", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; var bodyTextAdded = basePage.AddPropertyType(bodyTextPropertyType, "Content"); service.Save(basePage); - var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "author") + var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "author") { Name = "Author", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; @@ -1598,7 +1598,7 @@ namespace Umbraco.Tests.Services basePage.AddPropertyGroup("Meta"); service.Save(basePage); - var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "author") + var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "author") { Name = "Author", Description = "", @@ -1608,7 +1608,7 @@ namespace Umbraco.Tests.Services }; Assert.IsTrue(basePage.AddPropertyType(authorPropertyType, "Content")); - var titlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "title") + var titlePropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "title") { Name = "Title", Description = "", @@ -1657,14 +1657,14 @@ namespace Umbraco.Tests.Services service.Save(contentMetaComposition); // Act - var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "author") + var authorPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "author") { Name = "Author", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; var authorAdded = contentPage.AddPropertyType(authorPropertyType, "Content"); service.Save(contentPage); - var bodyTextPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext, "bodyText") + var bodyTextPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "bodyText") { Name = "Body Text", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }; @@ -1690,7 +1690,7 @@ namespace Umbraco.Tests.Services //Ensure that adding a new PropertyType to the "Content"-tab also adds it to the right group - var descriptionPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) + var descriptionPropertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = "description", Name = "Description", Description = "", Mandatory = false, SortOrder = 1,DataTypeId = -88 }; diff --git a/src/Umbraco.Tests/TestHelpers/Entities/MockedContentTypes.cs b/src/Umbraco.Tests/TestHelpers/Entities/MockedContentTypes.cs index aa68a63bd4..d9c87f10c9 100644 --- a/src/Umbraco.Tests/TestHelpers/Entities/MockedContentTypes.cs +++ b/src/Umbraco.Tests/TestHelpers/Entities/MockedContentTypes.cs @@ -151,9 +151,9 @@ namespace Umbraco.Tests.TestHelpers.Entities }; var contentCollection = new PropertyTypeCollection(true); - contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) { Alias = "title", Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }); + contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = "title", Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }); contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TinyMce, ValueStorageType.Ntext) { Alias = "bodyText", Name = "Body Text", Description = "", Mandatory = false, SortOrder = 2, DataTypeId = -87 }); - contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) { Alias = "author", Name = "Author", Description = "Name of the author", Mandatory = false, SortOrder = 3, DataTypeId = -88 }); + contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = "author", Name = "Author", Description = "Name of the author", Mandatory = false, SortOrder = 3, DataTypeId = -88 }); contentType.PropertyGroups.Add(new PropertyGroup(contentCollection) { Name = "Content", SortOrder = 1 }); @@ -185,7 +185,7 @@ namespace Umbraco.Tests.TestHelpers.Entities { var contentType = CreateSimpleContentType(alias, name, parent, randomizeAliases, propertyGroupName); - var propertyType = new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) + var propertyType = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = RandomAlias("gen", randomizeAliases), Name = "Gen", @@ -213,9 +213,9 @@ namespace Umbraco.Tests.TestHelpers.Entities contentType.Trashed = false; var contentCollection = new PropertyTypeCollection(true); - contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) { Alias = RandomAlias("title", randomizeAliases), Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }); + contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = RandomAlias("title", randomizeAliases), Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }); contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TinyMce, ValueStorageType.Ntext) { Alias = RandomAlias("bodyText", randomizeAliases), Name = "Body Text", Description = "", Mandatory = false, SortOrder = 2, DataTypeId = -87 }); - contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) { Alias = RandomAlias("author", randomizeAliases) , Name = "Author", Description = "Name of the author", Mandatory = false, SortOrder = 3, DataTypeId = -88 }); + contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = RandomAlias("author", randomizeAliases) , Name = "Author", Description = "Name of the author", Mandatory = false, SortOrder = 3, DataTypeId = -88 }); var pg = new PropertyGroup(contentCollection) {Name = propertyGroupName, SortOrder = 1}; contentType.PropertyGroups.Add(pg); @@ -242,9 +242,9 @@ namespace Umbraco.Tests.TestHelpers.Entities contentType.Trashed = false; var contentCollection = new PropertyTypeCollection(false); - contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) { Alias = RandomAlias("title", randomizeAliases), Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }); + contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = RandomAlias("title", randomizeAliases), Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }); contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TinyMce, ValueStorageType.Ntext) { Alias = RandomAlias("bodyText", randomizeAliases), Name = "Body Text", Description = "", Mandatory = false, SortOrder = 2, DataTypeId = -87 }); - contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) { Alias = RandomAlias("author", randomizeAliases), Name = "Author", Description = "Name of the author", Mandatory = false, SortOrder = 3, DataTypeId = -88 }); + contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = RandomAlias("author", randomizeAliases), Name = "Author", Description = "Name of the author", Mandatory = false, SortOrder = 3, DataTypeId = -88 }); var pg = new PropertyGroup(contentCollection) { Name = propertyGroupName, SortOrder = 1 }; contentType.PropertyGroups.Add(pg); @@ -356,8 +356,8 @@ namespace Umbraco.Tests.TestHelpers.Entities contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Boolean, ValueStorageType.Integer) { Alias = "isTrue", Name = "Is True or False", Mandatory = false, SortOrder = 1, DataTypeId = -49 }); contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Integer, ValueStorageType.Integer) { Alias = "number", Name = "Number", Mandatory = false, SortOrder = 2, DataTypeId = -51 }); contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TinyMce, ValueStorageType.Ntext) { Alias = "bodyText", Name = "Body Text", Mandatory = false, SortOrder = 3, DataTypeId = -87 }); - contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Nvarchar) { Alias = "singleLineText", Name = "Text String", Mandatory = false, SortOrder = 4, DataTypeId = -88 }); - contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TextboxMultiple, ValueStorageType.Ntext) { Alias = "multilineText", Name = "Multiple Text Strings", Mandatory = false, SortOrder = 5, DataTypeId = -89 }); + contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Nvarchar) { Alias = "singleLineText", Name = "Text String", Mandatory = false, SortOrder = 4, DataTypeId = -88 }); + contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TextArea, ValueStorageType.Ntext) { Alias = "multilineText", Name = "Multiple Text Strings", Mandatory = false, SortOrder = 5, DataTypeId = -89 }); contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.UploadField, ValueStorageType.Nvarchar) { Alias = "upload", Name = "Upload Field", Mandatory = false, SortOrder = 6, DataTypeId = -90 }); contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.NoEdit, ValueStorageType.Nvarchar) { Alias = "label", Name = "Label", Mandatory = false, SortOrder = 7, DataTypeId = -92 }); contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.DateTime, ValueStorageType.Date) { Alias = "dateTime", Name = "Date Time", Mandatory = false, SortOrder = 8, DataTypeId = -36 }); @@ -369,10 +369,10 @@ namespace Umbraco.Tests.TestHelpers.Entities contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Date, ValueStorageType.Date) { Alias = "date", Name = "Date", Mandatory = false, SortOrder = 13, DataTypeId = -41 }); contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.DropDownList, ValueStorageType.Integer) { Alias = "ddl", Name = "Dropdown List", Mandatory = false, SortOrder = 14, DataTypeId = -42 }); contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.CheckBoxList, ValueStorageType.Nvarchar) { Alias = "chklist", Name = "Checkbox List", Mandatory = false, SortOrder = 15, DataTypeId = -43 }); - contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.ContentPicker2Alias, ValueStorageType.Integer) { Alias = "contentPicker", Name = "Content Picker", Mandatory = false, SortOrder = 16, DataTypeId = 1046 }); - contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.MediaPicker2, ValueStorageType.Integer) { Alias = "mediaPicker", Name = "Media Picker", Mandatory = false, SortOrder = 17, DataTypeId = 1048 }); - contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.MemberPicker2, ValueStorageType.Integer) { Alias = "memberPicker", Name = "Member Picker", Mandatory = false, SortOrder = 18, DataTypeId = 1047 }); - contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.RelatedLinks2, ValueStorageType.Ntext) { Alias = "relatedLinks", Name = "Related Links", Mandatory = false, SortOrder = 21, DataTypeId = 1050 }); + contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.ContentPicker, ValueStorageType.Integer) { Alias = "contentPicker", Name = "Content Picker", Mandatory = false, SortOrder = 16, DataTypeId = 1046 }); + contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.MediaPicker, ValueStorageType.Integer) { Alias = "mediaPicker", Name = "Media Picker", Mandatory = false, SortOrder = 17, DataTypeId = 1048 }); + contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.MemberPicker, ValueStorageType.Integer) { Alias = "memberPicker", Name = "Member Picker", Mandatory = false, SortOrder = 18, DataTypeId = 1047 }); + contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.RelatedLinks, ValueStorageType.Ntext) { Alias = "relatedLinks", Name = "Related Links", Mandatory = false, SortOrder = 21, DataTypeId = 1050 }); contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Tags, ValueStorageType.Ntext) { Alias = "tags", Name = "Tags", Mandatory = false, SortOrder = 22, DataTypeId = 1041 }); //contentCollection.Add(new PropertyType(Constants.PropertyEditors.UltraSimpleEditorAlias, DataTypeDatabaseType.Ntext) { Alias = "simpleEditor", Name = "Ultra Simple Editor", Mandatory = false, SortOrder = 19, DataTypeDefinitionId = 1038 }); @@ -455,9 +455,9 @@ namespace Umbraco.Tests.TestHelpers.Entities }; var contentCollection = new PropertyTypeCollection(false); - contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) { Alias = "title", Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }); - contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) { Alias = "bodyText", Name = "Body Text", Description = "", Mandatory = false, SortOrder = 2, DataTypeId = -87 }); - contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Textbox, ValueStorageType.Ntext) { Alias = "author", Name = "Author", Description = "Name of the author", Mandatory = false, SortOrder = 3, DataTypeId = -88 }); + contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = "title", Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }); + contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = "bodyText", Name = "Body Text", Description = "", Mandatory = false, SortOrder = 2, DataTypeId = -87 }); + contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = "author", Name = "Author", Description = "Name of the author", Mandatory = false, SortOrder = 3, DataTypeId = -88 }); contentType.PropertyGroups.Add(new PropertyGroup(contentCollection) { Name = "Content", SortOrder = 1 }); diff --git a/src/Umbraco.Web/Models/Mapping/MacroMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/MacroMapperProfile.cs index 2e97697578..6eedccf50b 100644 --- a/src/Umbraco.Web/Models/Mapping/MacroMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/MacroMapperProfile.cs @@ -40,7 +40,7 @@ namespace Umbraco.Web.Models.Mapping if (paramEditor == null) { //we'll just map this to a text box - paramEditor = Current.ParameterEditors[Constants.PropertyEditors.Aliases.Textbox]; + paramEditor = Current.ParameterEditors[Constants.PropertyEditors.Aliases.TextBox]; Current.Logger.Warn("Could not resolve a parameter editor with alias " + property.EditorAlias + ", a textbox will be rendered in it's place"); } diff --git a/src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ContentPickerPropertyEditor.cs similarity index 58% rename from src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs rename to src/Umbraco.Web/PropertyEditors/ContentPickerPropertyEditor.cs index a48c4a9929..391257ca58 100644 --- a/src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ContentPickerPropertyEditor.cs @@ -8,10 +8,10 @@ namespace Umbraco.Web.PropertyEditors /// /// Content property editor that stores UDI /// - [DataEditor(Constants.PropertyEditors.Aliases.ContentPicker2Alias, EditorType.PropertyValue | EditorType.MacroParameter, "Content Picker", "contentpicker", ValueType = ValueTypes.String, Group = "Pickers")] - public class ContentPicker2PropertyEditor : DataEditor + [DataEditor(Constants.PropertyEditors.Aliases.ContentPicker, EditorType.PropertyValue | EditorType.MacroParameter, "Content Picker", "contentpicker", ValueType = ValueTypes.String, Group = "Pickers")] + public class ContentPickerPropertyEditor : DataEditor { - public ContentPicker2PropertyEditor(ILogger logger) + public ContentPickerPropertyEditor(ILogger logger) : base(logger) { } diff --git a/src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs similarity index 60% rename from src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs rename to src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs index c8a403f348..7ef2e6eb52 100644 --- a/src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs @@ -7,13 +7,13 @@ namespace Umbraco.Web.PropertyEditors /// /// Represents a media picker property editor. /// - [DataEditor(Constants.PropertyEditors.Aliases.MediaPicker2, EditorType.PropertyValue | EditorType.MacroParameter, "mediapicker", ValueTypes.Text, Group = "media", Icon = "icon-picture")] - public class MediaPicker2PropertyEditor : DataEditor + [DataEditor(Constants.PropertyEditors.Aliases.MediaPicker, EditorType.PropertyValue | EditorType.MacroParameter, "mediapicker", ValueTypes.Text, Group = "media", Icon = "icon-picture")] + public class MediaPickerPropertyEditor : DataEditor { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public MediaPicker2PropertyEditor(ILogger logger) + public MediaPickerPropertyEditor(ILogger logger) : base(logger) { } diff --git a/src/Umbraco.Web/PropertyEditors/MemberPicker2PropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MemberPickerPropertyEditor.cs similarity index 50% rename from src/Umbraco.Web/PropertyEditors/MemberPicker2PropertyEditor.cs rename to src/Umbraco.Web/PropertyEditors/MemberPickerPropertyEditor.cs index e48f6644cb..a0705fb373 100644 --- a/src/Umbraco.Web/PropertyEditors/MemberPicker2PropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MemberPickerPropertyEditor.cs @@ -4,10 +4,10 @@ using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors { - [DataEditor(Constants.PropertyEditors.Aliases.MemberPicker2, "Member Picker", "memberpicker", ValueType = ValueTypes.String, Group = "People", Icon = "icon-user")] - public class MemberPicker2PropertyEditor : DataEditor + [DataEditor(Constants.PropertyEditors.Aliases.MemberPicker, "Member Picker", "memberpicker", ValueType = ValueTypes.String, Group = "People", Icon = "icon-user")] + public class MemberPickerPropertyEditor : DataEditor { - public MemberPicker2PropertyEditor(ILogger logger) + public MemberPickerPropertyEditor(ILogger logger) : base(logger) { } diff --git a/src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs similarity index 59% rename from src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs rename to src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs index 2760efb704..ad75e16717 100644 --- a/src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs @@ -4,10 +4,10 @@ using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors { - [DataEditor(Constants.PropertyEditors.Aliases.MultiNodeTreePicker2, "Multinode Treepicker", "contentpicker", ValueType = ValueTypes.Text, Group = "pickers", Icon = "icon-page-add")] - public class MultiNodeTreePicker2PropertyEditor : DataEditor + [DataEditor(Constants.PropertyEditors.Aliases.MultiNodeTreePicker, "Multinode Treepicker", "contentpicker", ValueType = ValueTypes.Text, Group = "pickers", Icon = "icon-page-add")] + public class MultiNodeTreePickerPropertyEditor : DataEditor { - public MultiNodeTreePicker2PropertyEditor(ILogger logger) + public MultiNodeTreePickerPropertyEditor(ILogger logger) : base(logger) { } diff --git a/src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs deleted file mode 100644 index 77fb5775ad..0000000000 --- a/src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections.Generic; -using Umbraco.Core; -using Umbraco.Core.Logging; -using Umbraco.Core.PropertyEditors; - -namespace Umbraco.Web.PropertyEditors -{ - [DataEditor(Constants.PropertyEditors.Aliases.RelatedLinks2, "Related links", "relatedlinks", ValueType = ValueTypes.Json, Icon = "icon-thumbnail-list", Group = "pickers")] - public class RelatedLinks2PropertyEditor : DataEditor - { - public RelatedLinks2PropertyEditor(ILogger logger) - : base(logger) - { } - - protected override IConfigurationEditor CreateConfigurationEditor() => new RelatedLinksConfigurationEditor(); - } -} diff --git a/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs new file mode 100644 index 0000000000..b450fcc67f --- /dev/null +++ b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs @@ -0,0 +1,16 @@ +using Umbraco.Core; +using Umbraco.Core.Logging; +using Umbraco.Core.PropertyEditors; + +namespace Umbraco.Web.PropertyEditors +{ + [DataEditor(Constants.PropertyEditors.Aliases.RelatedLinks, "Related links", "relatedlinks", ValueType = ValueTypes.Json, Icon = "icon-thumbnail-list", Group = "pickers")] + public class RelatedLinksPropertyEditor : DataEditor + { + public RelatedLinksPropertyEditor(ILogger logger) + : base(logger) + { } + + protected override IConfigurationEditor CreateConfigurationEditor() => new RelatedLinksConfigurationEditor(); + } +} diff --git a/src/Umbraco.Web/PropertyEditors/TextAreaPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/TextAreaPropertyEditor.cs index f05cf969e7..041ca3f624 100644 --- a/src/Umbraco.Web/PropertyEditors/TextAreaPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/TextAreaPropertyEditor.cs @@ -7,7 +7,7 @@ namespace Umbraco.Web.PropertyEditors /// /// Represents a textarea property and parameter editor. /// - [DataEditor(Constants.PropertyEditors.Aliases.TextboxMultiple, EditorType.PropertyValue | EditorType.MacroParameter, "Textarea", "textarea", ValueType = ValueTypes.Text, Icon="icon-application-window-alt")] + [DataEditor(Constants.PropertyEditors.Aliases.TextArea, EditorType.PropertyValue | EditorType.MacroParameter, "Textarea", "textarea", ValueType = ValueTypes.Text, Icon="icon-application-window-alt")] public class TextAreaPropertyEditor : DataEditor { /// diff --git a/src/Umbraco.Web/PropertyEditors/TextboxPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/TextboxPropertyEditor.cs index 5fe6b8023e..9d35f6f336 100644 --- a/src/Umbraco.Web/PropertyEditors/TextboxPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/TextboxPropertyEditor.cs @@ -7,7 +7,7 @@ namespace Umbraco.Web.PropertyEditors /// /// Represents a textbox property and parameter editor. /// - [DataEditor(Constants.PropertyEditors.Aliases.Textbox, EditorType.PropertyValue | EditorType.MacroParameter, "Textbox", "textbox", Group = "Common")] + [DataEditor(Constants.PropertyEditors.Aliases.TextBox, EditorType.PropertyValue | EditorType.MacroParameter, "Textbox", "textbox", Group = "Common")] public class TextboxPropertyEditor : DataEditor { /// diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/ContentPickerValueConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/ContentPickerValueConverter.cs index 2bf1f6beba..ce3fef228f 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/ContentPickerValueConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/ContentPickerValueConverter.cs @@ -24,7 +24,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters } public override bool IsConverter(PublishedPropertyType propertyType) - => propertyType.EditorAlias.Equals(Constants.PropertyEditors.Aliases.ContentPicker2Alias); + => propertyType.EditorAlias.Equals(Constants.PropertyEditors.Aliases.ContentPicker); public override Type GetPropertyValueType(PublishedPropertyType propertyType) => typeof (IPublishedContent); diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/MediaPickerValueConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/MediaPickerValueConverter.cs index 0b39dc5cbe..9e9e61cb05 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/MediaPickerValueConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/MediaPickerValueConverter.cs @@ -23,7 +23,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters public override bool IsConverter(PublishedPropertyType propertyType) { - return propertyType.EditorAlias.Equals(Constants.PropertyEditors.Aliases.MediaPicker2); + return propertyType.EditorAlias.Equals(Constants.PropertyEditors.Aliases.MediaPicker); } public override Type GetPropertyValueType(PublishedPropertyType propertyType) diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/MemberPickerValueConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/MemberPickerValueConverter.cs index 75fc72d48a..3abdc0702a 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/MemberPickerValueConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/MemberPickerValueConverter.cs @@ -19,7 +19,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters public override bool IsConverter(PublishedPropertyType propertyType) { - return propertyType.EditorAlias.InvariantEquals(Constants.PropertyEditors.Aliases.MemberPicker2); + return propertyType.EditorAlias.InvariantEquals(Constants.PropertyEditors.Aliases.MemberPicker); } public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType) diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/MultiNodeTreePickerValueConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/MultiNodeTreePickerValueConverter.cs index e481fd14cb..42fc63011b 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/MultiNodeTreePickerValueConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/MultiNodeTreePickerValueConverter.cs @@ -35,7 +35,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters public override bool IsConverter(PublishedPropertyType propertyType) { - return propertyType.EditorAlias.Equals(Constants.PropertyEditors.Aliases.MultiNodeTreePicker2); + return propertyType.EditorAlias.Equals(Constants.PropertyEditors.Aliases.MultiNodeTreePicker); } public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType) @@ -46,7 +46,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters public override object ConvertSourceToIntermediate(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview) { - if (propertyType.EditorAlias.Equals(Constants.PropertyEditors.Aliases.MultiNodeTreePicker2)) + if (propertyType.EditorAlias.Equals(Constants.PropertyEditors.Aliases.MultiNodeTreePicker)) { var nodeIds = source.ToString() .Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries) @@ -67,7 +67,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters //TODO: Inject an UmbracoHelper and create a GetUmbracoHelper method based on either injected or singleton if (UmbracoContext.Current != null) { - if (propertyType.EditorAlias.Equals(Constants.PropertyEditors.Aliases.MultiNodeTreePicker2)) + if (propertyType.EditorAlias.Equals(Constants.PropertyEditors.Aliases.MultiNodeTreePicker)) { var udis = (Udi[])source; diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/RelatedLinksLegacyValueConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/RelatedLinksLegacyValueConverter.cs index 5bc680fc3d..ca6f54fcd8 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/RelatedLinksLegacyValueConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/RelatedLinksLegacyValueConverter.cs @@ -18,7 +18,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters public class RelatedLinksLegacyValueConverter : PropertyValueConverterBase { private static readonly string[] MatchingEditors = { - Constants.PropertyEditors.Aliases.RelatedLinks2 + Constants.PropertyEditors.Aliases.RelatedLinks }; private readonly IUmbracoContextAccessor _umbracoContextAccessor; @@ -66,7 +66,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters { switch (propertyType.EditorAlias) { - case Constants.PropertyEditors.Aliases.RelatedLinks2: + case Constants.PropertyEditors.Aliases.RelatedLinks: var strLinkId = a.Value("link"); var udiAttempt = strLinkId.TryConvertTo(); if (udiAttempt) diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/RelatedLinksValueConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/RelatedLinksValueConverter.cs index 06cca04ec2..3a6cc6aa9b 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/RelatedLinksValueConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/RelatedLinksValueConverter.cs @@ -40,7 +40,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters /// The . /// public override bool IsConverter(PublishedPropertyType propertyType) - => propertyType.EditorAlias.Equals(Constants.PropertyEditors.Aliases.RelatedLinks2); + => propertyType.EditorAlias.Equals(Constants.PropertyEditors.Aliases.RelatedLinks); public override Type GetPropertyValueType(PublishedPropertyType propertyType) => typeof (JArray); diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/TextStringValueConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/TextStringValueConverter.cs index f6082a45b8..9f9d60c62f 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/TextStringValueConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/TextStringValueConverter.cs @@ -12,8 +12,8 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters { private static readonly string[] PropertyTypeAliases = { - Constants.PropertyEditors.Aliases.Textbox, - Constants.PropertyEditors.Aliases.TextboxMultiple + Constants.PropertyEditors.Aliases.TextBox, + Constants.PropertyEditors.Aliases.TextArea }; public override bool IsConverter(PublishedPropertyType propertyType) diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 86545139a6..20358b3d4d 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -239,7 +239,7 @@ - + @@ -261,14 +261,14 @@ - + - + - + @@ -276,7 +276,7 @@ - + diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/assemblyBrowser.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/assemblyBrowser.aspx.cs index aefdedfa83..96b815019f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/assemblyBrowser.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/assemblyBrowser.aspx.cs @@ -195,7 +195,7 @@ namespace umbraco.developer return Constants.PropertyEditors.Aliases.Boolean; case "String": default: - return Constants.PropertyEditors.Aliases.Textbox; + return Constants.PropertyEditors.Aliases.TextBox; } }