From 9fa18fe9a30f1ce384174e8bc7e693e9c5b2cc57 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Mon, 20 Jan 2020 15:20:21 +0100 Subject: [PATCH] AB4549 - Moved more models --- .../Models/ContentEditing/ContentItemSave.cs | 10 +++--- .../ContentPropertyCollectionDto.cs | 2 -- .../ContentEditing/ContentPropertyDto.cs | 5 +-- .../ContentEditing/ContentVariantSave.cs | 0 .../ContentEditing/MemberPropertyTypeBasic.cs | 0 .../MemberPropertyTypeDisplay.cs | 0 .../RedirectUrlSearchResults.cs | 0 .../ContentEditing/ContentItemDisplay.cs | 4 +-- .../Models/ContentEditing/ContentTypeBasic.cs | 22 ++----------- .../ContentTypeCompositionDisplay.cs | 0 .../Models/ContentEditing/ContentTypeSave.cs | 0 .../Models/ContentEditing/DataTypeBasic.cs | 0 .../DataTypeConfigurationFieldDisplay.cs | 0 .../Models/ContentEditing/DataTypeDisplay.cs | 0 .../ContentEditing/DocumentTypeDisplay.cs | 0 .../Models/ContentEditing/DocumentTypeSave.cs | 0 .../ListViewAwareContentItemDisplayBase.cs | 0 .../Models/ContentEditing/MacroDisplay.cs | 0 .../Models/ContentEditing/MediaItemDisplay.cs | 0 .../Models/ContentEditing/MediaItemSave.cs | 1 - .../Models/ContentEditing/MediaTypeDisplay.cs | 0 .../Models/ContentEditing/MediaTypeSave.cs | 0 .../Models/ContentEditing/MemberBasic.cs | 0 .../Models/ContentEditing/MemberDisplay.cs | 0 .../ContentEditing/MemberListDisplay.cs | 0 .../Models/ContentEditing/MemberSave.cs | 6 +--- .../ContentEditing/MemberTypeDisplay.cs | 0 .../Models/ContentEditing/MemberTypeSave.cs | 0 .../ContentEditing/MessagesExtensions.cs | 0 .../ContentEditing/ModelWithNotifications.cs | 0 .../Models/ContentEditing/PostedFiles.cs | 2 +- .../ContentEditing/PropertyGroupDisplay.cs | 0 .../Models/ContentEditing/PublicAccess.cs | 0 .../Models/ContentEditing/UserInvite.cs | 4 +-- .../Mapping/ContentTypeMapDefinition.cs | 30 ++++++++++++++++-- src/Umbraco.Web/Umbraco.Web.csproj | 31 ------------------- 36 files changed, 41 insertions(+), 76 deletions(-) rename src/{Umbraco.Web => Umbraco.Abstractions}/Models/ContentEditing/ContentItemSave.cs (95%) rename src/{Umbraco.Infrastructure => Umbraco.Abstractions}/Models/ContentEditing/ContentPropertyCollectionDto.cs (92%) rename src/{Umbraco.Infrastructure => Umbraco.Abstractions}/Models/ContentEditing/ContentPropertyDto.cs (82%) rename src/{Umbraco.Web => Umbraco.Abstractions}/Models/ContentEditing/ContentVariantSave.cs (100%) rename src/{Umbraco.Web => Umbraco.Abstractions}/Models/ContentEditing/MemberPropertyTypeBasic.cs (100%) rename src/{Umbraco.Web => Umbraco.Abstractions}/Models/ContentEditing/MemberPropertyTypeDisplay.cs (100%) rename src/{Umbraco.Web => Umbraco.Abstractions}/Models/ContentEditing/RedirectUrlSearchResults.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/ContentItemDisplay.cs (98%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/ContentTypeBasic.cs (84%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/ContentTypeCompositionDisplay.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/ContentTypeSave.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/DataTypeBasic.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/DataTypeConfigurationFieldDisplay.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/DataTypeDisplay.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/DocumentTypeDisplay.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/DocumentTypeSave.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/ListViewAwareContentItemDisplayBase.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/MacroDisplay.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/MediaItemDisplay.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/MediaItemSave.cs (90%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/MediaTypeDisplay.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/MediaTypeSave.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/MemberBasic.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/MemberDisplay.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/MemberListDisplay.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/MemberSave.cs (92%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/MemberTypeDisplay.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/MemberTypeSave.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/MessagesExtensions.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/ModelWithNotifications.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/PostedFiles.cs (91%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/PropertyGroupDisplay.cs (100%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/Models/ContentEditing/PublicAccess.cs (100%) diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentItemSave.cs b/src/Umbraco.Abstractions/Models/ContentEditing/ContentItemSave.cs similarity index 95% rename from src/Umbraco.Web/Models/ContentEditing/ContentItemSave.cs rename to src/Umbraco.Abstractions/Models/ContentEditing/ContentItemSave.cs index 4dbbb1385a..195c1800b7 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentItemSave.cs +++ b/src/Umbraco.Abstractions/Models/ContentEditing/ContentItemSave.cs @@ -1,8 +1,6 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; using Umbraco.Core.Models; using Umbraco.Core.Models.Editors; @@ -30,7 +28,7 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "variants", IsRequired = true)] public IEnumerable Variants { get; set; } - + [DataMember(Name = "contentTypeAlias", IsRequired = true)] [Required(AllowEmptyStrings = false)] public string ContentTypeAlias { get; set; } @@ -40,7 +38,7 @@ namespace Umbraco.Web.Models.ContentEditing /// [DataMember(Name = "templateAlias")] public string TemplateAlias { get; set; } - + #region IContentSave [DataMember(Name = "action", IsRequired = true)] @@ -54,7 +52,7 @@ namespace Umbraco.Web.Models.ContentEditing /// [IgnoreDataMember] IContent IContentSave.PersistedContent { get; set; } - + //Non explicit internal getter so we don't need to explicitly cast in our own code [IgnoreDataMember] internal IContent PersistedContent diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/ContentPropertyCollectionDto.cs b/src/Umbraco.Abstractions/Models/ContentEditing/ContentPropertyCollectionDto.cs similarity index 92% rename from src/Umbraco.Infrastructure/Models/ContentEditing/ContentPropertyCollectionDto.cs rename to src/Umbraco.Abstractions/Models/ContentEditing/ContentPropertyCollectionDto.cs index 3e9da2a56e..d4c94410fe 100644 --- a/src/Umbraco.Infrastructure/Models/ContentEditing/ContentPropertyCollectionDto.cs +++ b/src/Umbraco.Abstractions/Models/ContentEditing/ContentPropertyCollectionDto.cs @@ -1,7 +1,5 @@ using System.Collections.Generic; using System.Linq; -using Newtonsoft.Json; -using Umbraco.Core.Models; namespace Umbraco.Web.Models.ContentEditing { diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/ContentPropertyDto.cs b/src/Umbraco.Abstractions/Models/ContentEditing/ContentPropertyDto.cs similarity index 82% rename from src/Umbraco.Infrastructure/Models/ContentEditing/ContentPropertyDto.cs rename to src/Umbraco.Abstractions/Models/ContentEditing/ContentPropertyDto.cs index 466030226d..865a10d5d5 100644 --- a/src/Umbraco.Infrastructure/Models/ContentEditing/ContentPropertyDto.cs +++ b/src/Umbraco.Abstractions/Models/ContentEditing/ContentPropertyDto.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; -using Newtonsoft.Json; -using Umbraco.Core.Models; -using Umbraco.Core.PropertyEditors; +using Umbraco.Core.Models; namespace Umbraco.Web.Models.ContentEditing { diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentVariantSave.cs b/src/Umbraco.Abstractions/Models/ContentEditing/ContentVariantSave.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/ContentVariantSave.cs rename to src/Umbraco.Abstractions/Models/ContentEditing/ContentVariantSave.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberPropertyTypeBasic.cs b/src/Umbraco.Abstractions/Models/ContentEditing/MemberPropertyTypeBasic.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/MemberPropertyTypeBasic.cs rename to src/Umbraco.Abstractions/Models/ContentEditing/MemberPropertyTypeBasic.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberPropertyTypeDisplay.cs b/src/Umbraco.Abstractions/Models/ContentEditing/MemberPropertyTypeDisplay.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/MemberPropertyTypeDisplay.cs rename to src/Umbraco.Abstractions/Models/ContentEditing/MemberPropertyTypeDisplay.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/RedirectUrlSearchResults.cs b/src/Umbraco.Abstractions/Models/ContentEditing/RedirectUrlSearchResults.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/RedirectUrlSearchResults.cs rename to src/Umbraco.Abstractions/Models/ContentEditing/RedirectUrlSearchResults.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplay.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/ContentItemDisplay.cs similarity index 98% rename from src/Umbraco.Web/Models/ContentEditing/ContentItemDisplay.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/ContentItemDisplay.cs index b135ae573e..73740a14de 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplay.cs +++ b/src/Umbraco.Infrastructure/Models/ContentEditing/ContentItemDisplay.cs @@ -173,7 +173,7 @@ namespace Umbraco.Web.Models.ContentEditing /// This is not used for outgoing model information. /// [IgnoreDataMember] - internal IContent PersistedContent { get; set; } + public IContent PersistedContent { get; set; } /// /// The DTO object used to gather all required content data including data type information etc... for use with validation - used during inbound model binding @@ -184,7 +184,7 @@ namespace Umbraco.Web.Models.ContentEditing /// This is not used for outgoing model information. /// [IgnoreDataMember] - internal ContentPropertyCollectionDto ContentDto { get; set; } + public ContentPropertyCollectionDto ContentDto { get; set; } /// /// This is used to add custom localized messages/strings to the response for the app to use for localized UI purposes. diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentTypeBasic.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/ContentTypeBasic.cs similarity index 84% rename from src/Umbraco.Web/Models/ContentEditing/ContentTypeBasic.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/ContentTypeBasic.cs index 167d0e1627..33749a451c 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentTypeBasic.cs +++ b/src/Umbraco.Infrastructure/Models/ContentEditing/ContentTypeBasic.cs @@ -4,7 +4,7 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using Umbraco.Core; -using Umbraco.Web.Composing; + namespace Umbraco.Web.Models.ContentEditing { @@ -67,15 +67,7 @@ namespace Umbraco.Web.Models.ContentEditing /// [DataMember(Name = "iconFilePath")] [ReadOnly(true)] - public string IconFilePath - { - get - { - return IconIsClass - ? string.Empty - : string.Format("{0}images/umbraco/{1}", Current.Configs.Global().Path.EnsureEndsWith("/"), Icon); - } - } + public string IconFilePath { get; set; } /// /// Returns true if the icon represents a CSS class instead of a file path @@ -100,15 +92,7 @@ namespace Umbraco.Web.Models.ContentEditing /// [DataMember(Name = "thumbnailFilePath")] [ReadOnly(true)] - public string ThumbnailFilePath - { - get - { - return ThumbnailIsClass - ? string.Empty - : Current.IOHelper.ResolveUrl("~/umbraco/images/thumbnails/" + Thumbnail); - } - } + public string ThumbnailFilePath { get; set; } [DataMember(Name = "blueprints")] [ReadOnly(true)] diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentTypeCompositionDisplay.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/ContentTypeCompositionDisplay.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/ContentTypeCompositionDisplay.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/ContentTypeCompositionDisplay.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentTypeSave.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/ContentTypeSave.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/ContentTypeSave.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/ContentTypeSave.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/DataTypeBasic.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/DataTypeBasic.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/DataTypeBasic.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/DataTypeBasic.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/DataTypeConfigurationFieldDisplay.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/DataTypeConfigurationFieldDisplay.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/DataTypeConfigurationFieldDisplay.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/DataTypeConfigurationFieldDisplay.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/DataTypeDisplay.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/DataTypeDisplay.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/DataTypeDisplay.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/DataTypeDisplay.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/DocumentTypeDisplay.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/DocumentTypeDisplay.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/DocumentTypeDisplay.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/DocumentTypeDisplay.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/DocumentTypeSave.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/DocumentTypeSave.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/DocumentTypeSave.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/DocumentTypeSave.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/ListViewAwareContentItemDisplayBase.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/ListViewAwareContentItemDisplayBase.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/ListViewAwareContentItemDisplayBase.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/ListViewAwareContentItemDisplayBase.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/MacroDisplay.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/MacroDisplay.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/MacroDisplay.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/MacroDisplay.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/MediaItemDisplay.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/MediaItemDisplay.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/MediaItemDisplay.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/MediaItemDisplay.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/MediaItemSave.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/MediaItemSave.cs similarity index 90% rename from src/Umbraco.Web/Models/ContentEditing/MediaItemSave.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/MediaItemSave.cs index b31f1d1782..d983077fa2 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MediaItemSave.cs +++ b/src/Umbraco.Infrastructure/Models/ContentEditing/MediaItemSave.cs @@ -1,6 +1,5 @@ using System.Runtime.Serialization; using Umbraco.Core.Models; -using Umbraco.Web.WebApi.Filters; namespace Umbraco.Web.Models.ContentEditing { diff --git a/src/Umbraco.Web/Models/ContentEditing/MediaTypeDisplay.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/MediaTypeDisplay.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/MediaTypeDisplay.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/MediaTypeDisplay.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/MediaTypeSave.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/MediaTypeSave.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/MediaTypeSave.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/MediaTypeSave.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberBasic.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/MemberBasic.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/MemberBasic.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/MemberBasic.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberDisplay.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/MemberDisplay.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/MemberDisplay.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/MemberDisplay.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberListDisplay.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/MemberListDisplay.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/MemberListDisplay.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/MemberListDisplay.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberSave.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/MemberSave.cs similarity index 92% rename from src/Umbraco.Web/Models/ContentEditing/MemberSave.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/MemberSave.cs index 10774de1a4..b9ec6fad67 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MemberSave.cs +++ b/src/Umbraco.Infrastructure/Models/ContentEditing/MemberSave.cs @@ -1,13 +1,9 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json.Linq; using Umbraco.Core.Models; -using Umbraco.Core.Models.Editors; using Umbraco.Core.Models.Validation; -using Umbraco.Web.WebApi.Filters; using Umbraco.Core; namespace Umbraco.Web.Models.ContentEditing diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberTypeDisplay.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/MemberTypeDisplay.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/MemberTypeDisplay.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/MemberTypeDisplay.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberTypeSave.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/MemberTypeSave.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/MemberTypeSave.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/MemberTypeSave.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/MessagesExtensions.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/MessagesExtensions.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/MessagesExtensions.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/MessagesExtensions.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/ModelWithNotifications.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/ModelWithNotifications.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/ModelWithNotifications.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/ModelWithNotifications.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/PostedFiles.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/PostedFiles.cs similarity index 91% rename from src/Umbraco.Web/Models/ContentEditing/PostedFiles.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/PostedFiles.cs index 43b018653f..e0ec347b45 100644 --- a/src/Umbraco.Web/Models/ContentEditing/PostedFiles.cs +++ b/src/Umbraco.Infrastructure/Models/ContentEditing/PostedFiles.cs @@ -9,7 +9,7 @@ namespace Umbraco.Web.Models.ContentEditing /// temporary files that were created. /// [DataContract] - internal class PostedFiles : IHaveUploadedFiles, INotificationModel + public class PostedFiles : IHaveUploadedFiles, INotificationModel { public PostedFiles() { diff --git a/src/Umbraco.Web/Models/ContentEditing/PropertyGroupDisplay.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/PropertyGroupDisplay.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/PropertyGroupDisplay.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/PropertyGroupDisplay.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/PublicAccess.cs b/src/Umbraco.Infrastructure/Models/ContentEditing/PublicAccess.cs similarity index 100% rename from src/Umbraco.Web/Models/ContentEditing/PublicAccess.cs rename to src/Umbraco.Infrastructure/Models/ContentEditing/PublicAccess.cs diff --git a/src/Umbraco.Web/Models/ContentEditing/UserInvite.cs b/src/Umbraco.Web/Models/ContentEditing/UserInvite.cs index 405bececc9..3adf10c467 100644 --- a/src/Umbraco.Web/Models/ContentEditing/UserInvite.cs +++ b/src/Umbraco.Web/Models/ContentEditing/UserInvite.cs @@ -31,10 +31,10 @@ namespace Umbraco.Web.Models.ContentEditing public IEnumerable Validate(ValidationContext validationContext) { if (UserGroups.Any() == false) - yield return new ValidationResult("A user must be assigned to at least one group", new[] { "UserGroups" }); + yield return new ValidationResult("A user must be assigned to at least one group", new[] { nameof(UserGroups) }); if (Current.Configs.Settings().Security.UsernameIsEmail == false && Username.IsNullOrWhiteSpace()) - yield return new ValidationResult("A username cannot be empty", new[] { "Username" }); + yield return new ValidationResult("A username cannot be empty", new[] { nameof(Username) }); } } } diff --git a/src/Umbraco.Web/Models/Mapping/ContentTypeMapDefinition.cs b/src/Umbraco.Web/Models/Mapping/ContentTypeMapDefinition.cs index 1f6df93367..11e7bfde6e 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentTypeMapDefinition.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentTypeMapDefinition.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using Umbraco.Core; +using Umbraco.Core.Configuration; using Umbraco.Web.Composing; using Umbraco.Core.Logging; using Umbraco.Core.Mapping; @@ -10,6 +11,7 @@ using Umbraco.Core.PropertyEditors; using Umbraco.Web.Models.ContentEditing; using Umbraco.Core.Services; using Umbraco.Core.Exceptions; +using Umbraco.Core.IO; using Umbraco.Core.Strings; namespace Umbraco.Web.Models.Mapping @@ -27,11 +29,13 @@ namespace Umbraco.Web.Models.Mapping private readonly IMemberTypeService _memberTypeService; private readonly ILogger _logger; private readonly IShortStringHelper _shortStringHelper; + private readonly IIOHelper _ioHelper; + private readonly IGlobalSettings _globalSettings; public ContentTypeMapDefinition(PropertyEditorCollection propertyEditors, IDataTypeService dataTypeService, IFileService fileService, IContentTypeService contentTypeService, IMediaTypeService mediaTypeService, IMemberTypeService memberTypeService, - ILogger logger, IShortStringHelper shortStringHelper) + ILogger logger, IShortStringHelper shortStringHelper, IIOHelper ioHelper, IGlobalSettings globalSettings) { _propertyEditors = propertyEditors; _dataTypeService = dataTypeService; @@ -41,7 +45,8 @@ namespace Umbraco.Web.Models.Mapping _memberTypeService = memberTypeService; _logger = logger; _shortStringHelper = shortStringHelper; - + _ioHelper = ioHelper; + _globalSettings = globalSettings; } public void DefineMaps(UmbracoMapper mapper) @@ -184,6 +189,11 @@ namespace Umbraco.Web.Models.Mapping target.CreateDate = source.CreateDate; target.Description = source.Description; target.Icon = source.Icon; + target.IconFilePath = target.IconIsClass + ? string.Empty + : $"{Current.Configs.Global().Path.EnsureEndsWith("/")}images/umbraco/{source.Icon}"; + + target.Trashed = source.Trashed; target.Id = source.Id; target.IsContainer = source.IsContainer; target.IsElement = source.IsElement; @@ -192,7 +202,9 @@ namespace Umbraco.Web.Models.Mapping target.ParentId = source.ParentId; target.Path = source.Path; target.Thumbnail = source.Thumbnail; - target.Trashed = source.Trashed; + target.ThumbnailFilePath = target.ThumbnailIsClass + ? string.Empty + : Current.IOHelper.ResolveUrl("~/umbraco/images/thumbnails/" + source.Thumbnail); target.UpdateDate = source.UpdateDate; } @@ -487,6 +499,9 @@ namespace Umbraco.Web.Models.Mapping target.CreateDate = source.CreateDate; target.Description = source.Description; target.Icon = source.Icon; + target.IconFilePath = target.IconIsClass + ? string.Empty + : $"{Current.Configs.Global().Path.EnsureEndsWith("/")}images/umbraco/{source.Icon}"; target.Id = source.Id; target.IsContainer = source.IsContainer; target.IsElement = source.IsElement; @@ -495,6 +510,9 @@ namespace Umbraco.Web.Models.Mapping target.ParentId = source.ParentId; target.Path = source.Path; target.Thumbnail = source.Thumbnail; + target.ThumbnailFilePath = target.ThumbnailIsClass + ? string.Empty + : Current.IOHelper.ResolveUrl("~/umbraco/images/thumbnails/" + source.Thumbnail); target.Udi = MapContentTypeUdi(source); target.UpdateDate = source.UpdateDate; @@ -524,6 +542,9 @@ namespace Umbraco.Web.Models.Mapping target.CompositeContentTypes = source.CompositeContentTypes; target.Description = source.Description; target.Icon = source.Icon; + target.IconFilePath = target.IconIsClass + ? string.Empty + : $"{Current.Configs.Global().Path.EnsureEndsWith("/")}images/umbraco/{source.Icon}"; target.Id = source.Id; target.IsContainer = source.IsContainer; target.IsElement = source.IsElement; @@ -532,6 +553,9 @@ namespace Umbraco.Web.Models.Mapping target.ParentId = source.ParentId; target.Path = source.Path; target.Thumbnail = source.Thumbnail; + target.ThumbnailFilePath = target.ThumbnailIsClass + ? string.Empty + : Current.IOHelper.ResolveUrl("~/umbraco/images/thumbnails/" + source.Thumbnail); target.Trashed = source.Trashed; target.Udi = source.Udi; } diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index f496581711..913f8a45d6 100755 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -187,11 +187,6 @@ - - - - - @@ -266,7 +261,6 @@ - @@ -393,7 +387,6 @@ - @@ -537,17 +530,6 @@ - - - - - - - - - - - @@ -560,7 +542,6 @@ - @@ -569,7 +550,6 @@ - @@ -621,11 +601,7 @@ - - - - @@ -673,10 +649,7 @@ - - - @@ -692,8 +665,6 @@ - - @@ -770,7 +741,6 @@ - @@ -807,7 +777,6 @@ -