From a6e0afe57dcb43a42ba747690d94a9bec6d6b2e2 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 27 Oct 2020 15:42:59 +0100 Subject: [PATCH] Migrating classes not inhering or having dependencies to EntityBasic --- .../ContentEditing/BackOfficeNotification.cs | 1 - .../Models/ContentEditing/CodeFileDisplay.cs | 6 +-- .../DataTypeConfigurationFieldDisplay.cs | 1 - .../DataTypeConfigurationFieldSave.cs | 1 - .../Models/ContentEditing/DomainSave.cs | 0 .../Models/ContentEditing/EditorNavigation.cs | 2 +- .../GetAvailableCompositionsFilter.cs | 0 .../Models/ContentEditing/IErrorModel.cs | 0 .../ContentEditing/INotificationModel.cs | 0 .../Models/ContentEditing/MacroParameter.cs | 7 +-- .../ContentEditing/MacroParameterDisplay.cs | 6 +-- .../ContentEditing/MessagesExtensions.cs | 53 +++++++++---------- .../ContentEditing/ModelWithNotifications.cs | 0 .../Models/ContentEditing/PostedFiles.cs | 0 .../ContentEditing/PropertyGroupDisplay.cs | 0 .../Models/ContentEditing/SearchResults.cs | 0 .../ContentEditing/SimpleNotificationModel.cs | 0 .../Models/ContentEditing/TemplateDisplay.cs | 0 .../Models/ContentEditing/UserDetail.cs | 5 +- .../UserGroupPermissionsSave.cs | 0 .../Models/ContentEditing/UserProfile.cs | 3 +- 21 files changed, 35 insertions(+), 50 deletions(-) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/BackOfficeNotification.cs (99%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/CodeFileDisplay.cs (95%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/DataTypeConfigurationFieldDisplay.cs (99%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/DataTypeConfigurationFieldSave.cs (96%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/DomainSave.cs (100%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/EditorNavigation.cs (99%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/GetAvailableCompositionsFilter.cs (100%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/IErrorModel.cs (100%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/INotificationModel.cs (100%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/MacroParameter.cs (91%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/MacroParameterDisplay.cs (90%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/MessagesExtensions.cs (66%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/ModelWithNotifications.cs (100%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/PostedFiles.cs (100%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/PropertyGroupDisplay.cs (100%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/SearchResults.cs (100%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/SimpleNotificationModel.cs (100%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/TemplateDisplay.cs (100%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/UserDetail.cs (97%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/UserGroupPermissionsSave.cs (100%) rename src/{Umbraco.Infrastructure => Umbraco.Core}/Models/ContentEditing/UserProfile.cs (94%) diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/BackOfficeNotification.cs b/src/Umbraco.Core/Models/ContentEditing/BackOfficeNotification.cs similarity index 99% rename from src/Umbraco.Infrastructure/Models/ContentEditing/BackOfficeNotification.cs rename to src/Umbraco.Core/Models/ContentEditing/BackOfficeNotification.cs index 0dd132a503..ffdd26d960 100644 --- a/src/Umbraco.Infrastructure/Models/ContentEditing/BackOfficeNotification.cs +++ b/src/Umbraco.Core/Models/ContentEditing/BackOfficeNotification.cs @@ -25,6 +25,5 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "type")] public NotificationStyle NotificationType { get; set; } - } } diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/CodeFileDisplay.cs b/src/Umbraco.Core/Models/ContentEditing/CodeFileDisplay.cs similarity index 95% rename from src/Umbraco.Infrastructure/Models/ContentEditing/CodeFileDisplay.cs rename to src/Umbraco.Core/Models/ContentEditing/CodeFileDisplay.cs index 7e186932ac..8004e8e731 100644 --- a/src/Umbraco.Infrastructure/Models/ContentEditing/CodeFileDisplay.cs +++ b/src/Umbraco.Core/Models/ContentEditing/CodeFileDisplay.cs @@ -1,11 +1,7 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; -using System.Linq; using System.Runtime.Serialization; -using System.Text; -using System.Threading.Tasks; using Umbraco.Core; namespace Umbraco.Web.Models.ContentEditing diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/DataTypeConfigurationFieldDisplay.cs b/src/Umbraco.Core/Models/ContentEditing/DataTypeConfigurationFieldDisplay.cs similarity index 99% rename from src/Umbraco.Infrastructure/Models/ContentEditing/DataTypeConfigurationFieldDisplay.cs rename to src/Umbraco.Core/Models/ContentEditing/DataTypeConfigurationFieldDisplay.cs index 022746c7ec..26d650b02b 100644 --- a/src/Umbraco.Infrastructure/Models/ContentEditing/DataTypeConfigurationFieldDisplay.cs +++ b/src/Umbraco.Core/Models/ContentEditing/DataTypeConfigurationFieldDisplay.cs @@ -38,6 +38,5 @@ namespace Umbraco.Web.Models.ContentEditing /// [DataMember(Name = "config")] public IDictionary Config { get; set; } - } } diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/DataTypeConfigurationFieldSave.cs b/src/Umbraco.Core/Models/ContentEditing/DataTypeConfigurationFieldSave.cs similarity index 96% rename from src/Umbraco.Infrastructure/Models/ContentEditing/DataTypeConfigurationFieldSave.cs rename to src/Umbraco.Core/Models/ContentEditing/DataTypeConfigurationFieldSave.cs index 85984df281..d480f4c4b7 100644 --- a/src/Umbraco.Infrastructure/Models/ContentEditing/DataTypeConfigurationFieldSave.cs +++ b/src/Umbraco.Core/Models/ContentEditing/DataTypeConfigurationFieldSave.cs @@ -1,5 +1,4 @@ using System.Runtime.Serialization; -using Newtonsoft.Json.Linq; namespace Umbraco.Web.Models.ContentEditing { diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/DomainSave.cs b/src/Umbraco.Core/Models/ContentEditing/DomainSave.cs similarity index 100% rename from src/Umbraco.Infrastructure/Models/ContentEditing/DomainSave.cs rename to src/Umbraco.Core/Models/ContentEditing/DomainSave.cs diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/EditorNavigation.cs b/src/Umbraco.Core/Models/ContentEditing/EditorNavigation.cs similarity index 99% rename from src/Umbraco.Infrastructure/Models/ContentEditing/EditorNavigation.cs rename to src/Umbraco.Core/Models/ContentEditing/EditorNavigation.cs index 29922750cf..007c3267cd 100644 --- a/src/Umbraco.Infrastructure/Models/ContentEditing/EditorNavigation.cs +++ b/src/Umbraco.Core/Models/ContentEditing/EditorNavigation.cs @@ -23,4 +23,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "active")] public bool Active { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/GetAvailableCompositionsFilter.cs b/src/Umbraco.Core/Models/ContentEditing/GetAvailableCompositionsFilter.cs similarity index 100% rename from src/Umbraco.Infrastructure/Models/ContentEditing/GetAvailableCompositionsFilter.cs rename to src/Umbraco.Core/Models/ContentEditing/GetAvailableCompositionsFilter.cs diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/IErrorModel.cs b/src/Umbraco.Core/Models/ContentEditing/IErrorModel.cs similarity index 100% rename from src/Umbraco.Infrastructure/Models/ContentEditing/IErrorModel.cs rename to src/Umbraco.Core/Models/ContentEditing/IErrorModel.cs diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/INotificationModel.cs b/src/Umbraco.Core/Models/ContentEditing/INotificationModel.cs similarity index 100% rename from src/Umbraco.Infrastructure/Models/ContentEditing/INotificationModel.cs rename to src/Umbraco.Core/Models/ContentEditing/INotificationModel.cs diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/MacroParameter.cs b/src/Umbraco.Core/Models/ContentEditing/MacroParameter.cs similarity index 91% rename from src/Umbraco.Infrastructure/Models/ContentEditing/MacroParameter.cs rename to src/Umbraco.Core/Models/ContentEditing/MacroParameter.cs index 24dd55338a..ed3551449c 100644 --- a/src/Umbraco.Infrastructure/Models/ContentEditing/MacroParameter.cs +++ b/src/Umbraco.Core/Models/ContentEditing/MacroParameter.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; using System.Runtime.Serialization; -using System.Text; -using System.Threading.Tasks; namespace Umbraco.Web.Models.ContentEditing { @@ -43,6 +39,5 @@ namespace Umbraco.Web.Models.ContentEditing /// [DataMember(Name = "value")] public object Value { get; set; } - } } diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/MacroParameterDisplay.cs b/src/Umbraco.Core/Models/ContentEditing/MacroParameterDisplay.cs similarity index 90% rename from src/Umbraco.Infrastructure/Models/ContentEditing/MacroParameterDisplay.cs rename to src/Umbraco.Core/Models/ContentEditing/MacroParameterDisplay.cs index 2a07dd84ef..866e631dc4 100644 --- a/src/Umbraco.Infrastructure/Models/ContentEditing/MacroParameterDisplay.cs +++ b/src/Umbraco.Core/Models/ContentEditing/MacroParameterDisplay.cs @@ -1,7 +1,7 @@ -namespace Umbraco.Web.Models.ContentEditing -{ - using System.Runtime.Serialization; +using System.Runtime.Serialization; +namespace Umbraco.Web.Models.ContentEditing +{ /// /// The macro parameter display. /// diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/MessagesExtensions.cs b/src/Umbraco.Core/Models/ContentEditing/MessagesExtensions.cs similarity index 66% rename from src/Umbraco.Infrastructure/Models/ContentEditing/MessagesExtensions.cs rename to src/Umbraco.Core/Models/ContentEditing/MessagesExtensions.cs index c27fa39d44..0f9a1dc500 100644 --- a/src/Umbraco.Infrastructure/Models/ContentEditing/MessagesExtensions.cs +++ b/src/Umbraco.Core/Models/ContentEditing/MessagesExtensions.cs @@ -1,5 +1,4 @@ - -using System.Linq; +using System.Linq; using Umbraco.Core; namespace Umbraco.Web.Models.ContentEditing @@ -11,11 +10,11 @@ namespace Umbraco.Web.Models.ContentEditing if (model.Exists(header, msg, type)) return; model.Notifications.Add(new BackOfficeNotification() - { - Header = header, - Message = msg, - NotificationType = type - }); + { + Header = header, + Message = msg, + NotificationType = type + }); } public static void AddSuccessNotification(this INotificationModel model, string header, string msg) @@ -23,11 +22,11 @@ namespace Umbraco.Web.Models.ContentEditing if (model.Exists(header, msg, NotificationStyle.Success)) return; model.Notifications.Add(new BackOfficeNotification() - { - Header = header, - Message = msg, - NotificationType = NotificationStyle.Success - }); + { + Header = header, + Message = msg, + NotificationType = NotificationStyle.Success + }); } public static void AddErrorNotification(this INotificationModel model, string header, string msg) @@ -35,11 +34,11 @@ namespace Umbraco.Web.Models.ContentEditing if (model.Exists(header, msg, NotificationStyle.Error)) return; model.Notifications.Add(new BackOfficeNotification() - { - Header = header, - Message = msg, - NotificationType = NotificationStyle.Error - }); + { + Header = header, + Message = msg, + NotificationType = NotificationStyle.Error + }); } public static void AddWarningNotification(this INotificationModel model, string header, string msg) @@ -47,11 +46,11 @@ namespace Umbraco.Web.Models.ContentEditing if (model.Exists(header, msg, NotificationStyle.Warning)) return; model.Notifications.Add(new BackOfficeNotification() - { - Header = header, - Message = msg, - NotificationType = NotificationStyle.Warning - }); + { + Header = header, + Message = msg, + NotificationType = NotificationStyle.Warning + }); } public static void AddInfoNotification(this INotificationModel model, string header, string msg) @@ -59,11 +58,11 @@ namespace Umbraco.Web.Models.ContentEditing if (model.Exists(header, msg, NotificationStyle.Info)) return; model.Notifications.Add(new BackOfficeNotification() - { - Header = header, - Message = msg, - NotificationType = NotificationStyle.Info - }); + { + Header = header, + Message = msg, + NotificationType = NotificationStyle.Info + }); } private static bool Exists(this INotificationModel model, string header, string message, NotificationStyle notificationType) => model.Notifications.Any(x => x.Header.InvariantEquals(header) && x.Message.InvariantEquals(message) && x.NotificationType == notificationType); diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/ModelWithNotifications.cs b/src/Umbraco.Core/Models/ContentEditing/ModelWithNotifications.cs similarity index 100% rename from src/Umbraco.Infrastructure/Models/ContentEditing/ModelWithNotifications.cs rename to src/Umbraco.Core/Models/ContentEditing/ModelWithNotifications.cs diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/PostedFiles.cs b/src/Umbraco.Core/Models/ContentEditing/PostedFiles.cs similarity index 100% rename from src/Umbraco.Infrastructure/Models/ContentEditing/PostedFiles.cs rename to src/Umbraco.Core/Models/ContentEditing/PostedFiles.cs diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/PropertyGroupDisplay.cs b/src/Umbraco.Core/Models/ContentEditing/PropertyGroupDisplay.cs similarity index 100% rename from src/Umbraco.Infrastructure/Models/ContentEditing/PropertyGroupDisplay.cs rename to src/Umbraco.Core/Models/ContentEditing/PropertyGroupDisplay.cs diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/SearchResults.cs b/src/Umbraco.Core/Models/ContentEditing/SearchResults.cs similarity index 100% rename from src/Umbraco.Infrastructure/Models/ContentEditing/SearchResults.cs rename to src/Umbraco.Core/Models/ContentEditing/SearchResults.cs diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/SimpleNotificationModel.cs b/src/Umbraco.Core/Models/ContentEditing/SimpleNotificationModel.cs similarity index 100% rename from src/Umbraco.Infrastructure/Models/ContentEditing/SimpleNotificationModel.cs rename to src/Umbraco.Core/Models/ContentEditing/SimpleNotificationModel.cs diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/TemplateDisplay.cs b/src/Umbraco.Core/Models/ContentEditing/TemplateDisplay.cs similarity index 100% rename from src/Umbraco.Infrastructure/Models/ContentEditing/TemplateDisplay.cs rename to src/Umbraco.Core/Models/ContentEditing/TemplateDisplay.cs diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/UserDetail.cs b/src/Umbraco.Core/Models/ContentEditing/UserDetail.cs similarity index 97% rename from src/Umbraco.Infrastructure/Models/ContentEditing/UserDetail.cs rename to src/Umbraco.Core/Models/ContentEditing/UserDetail.cs index 58cb6d2513..3bcff43fa2 100644 --- a/src/Umbraco.Infrastructure/Models/ContentEditing/UserDetail.cs +++ b/src/Umbraco.Core/Models/ContentEditing/UserDetail.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; @@ -25,7 +24,7 @@ namespace Umbraco.Web.Models.ContentEditing /// [DataMember(Name = "emailHash")] public string EmailHash { get; set; } - + [ReadOnly(true)] [DataMember(Name = "userGroups")] public string[] UserGroups { get; set; } diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/UserGroupPermissionsSave.cs b/src/Umbraco.Core/Models/ContentEditing/UserGroupPermissionsSave.cs similarity index 100% rename from src/Umbraco.Infrastructure/Models/ContentEditing/UserGroupPermissionsSave.cs rename to src/Umbraco.Core/Models/ContentEditing/UserGroupPermissionsSave.cs diff --git a/src/Umbraco.Infrastructure/Models/ContentEditing/UserProfile.cs b/src/Umbraco.Core/Models/ContentEditing/UserProfile.cs similarity index 94% rename from src/Umbraco.Infrastructure/Models/ContentEditing/UserProfile.cs rename to src/Umbraco.Core/Models/ContentEditing/UserProfile.cs index 12b6e2a627..18981ece64 100644 --- a/src/Umbraco.Infrastructure/Models/ContentEditing/UserProfile.cs +++ b/src/Umbraco.Core/Models/ContentEditing/UserProfile.cs @@ -1,7 +1,6 @@ using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Umbraco.Core.Models.Membership; namespace Umbraco.Web.Models.ContentEditing { @@ -23,6 +22,6 @@ namespace Umbraco.Web.Models.ContentEditing int IComparable.CompareTo(object obj) { return String.Compare(Name, ((UserProfile)obj).Name, StringComparison.Ordinal); - } + } } }