From 7aac3dc1bf1e1d1d568360d975ebd92b40f89eed Mon Sep 17 00:00:00 2001 From: Nathan Woulfe Date: Wed, 13 Feb 2019 16:33:02 +1000 Subject: [PATCH 01/55] notifications are full-width on all screen sizes --- .../src/less/application/grid.less | 8 +--- .../notifications/umb-notifications.less | 46 +++++++++---------- 2 files changed, 22 insertions(+), 32 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/application/grid.less b/src/Umbraco.Web.UI.Client/src/less/application/grid.less index 073d1b5721..0c6e790272 100644 --- a/src/Umbraco.Web.UI.Client/src/less/application/grid.less +++ b/src/Umbraco.Web.UI.Client/src/less/application/grid.less @@ -62,10 +62,6 @@ body.umb-drawer-is-visible #mainwrapper{ margin: 0; } -#umb-notifications-wrapper { - left: 80px; -} - #contentcolumn { left: 0px; } @@ -171,13 +167,11 @@ body.umb-drawer-is-visible #mainwrapper{ } @media (min-width: 1101px) { - #contentwrapper, #umb-notifications-wrapper {left: 360px;} - #speechbubble {left: 360px;} + #contentwrapper, #speechbubble {left: 360px;} .emptySection #contentwrapper {left:0px;} } //empty section modification -.emptySection #umb-notifications-wrapper {left: 80px;} .emptySection #speechbubble {left: 0;} .emptySection #navigation {display: none} diff --git a/src/Umbraco.Web.UI.Client/src/less/components/notifications/umb-notifications.less b/src/Umbraco.Web.UI.Client/src/less/components/notifications/umb-notifications.less index b29c340dce..9e16eca414 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/notifications/umb-notifications.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/notifications/umb-notifications.less @@ -1,35 +1,31 @@ .umb-notifications { - z-index: 1000; - position: absolute; - bottom: @editorFooterHeight; - left: 0; - right: 0; - border-bottom: none; - margin: auto; - padding: 0px; - border: none; - background: none; - border-radius: 0; + z-index: 1000; + position: absolute; + bottom: @editorFooterHeight; + left: 0; + right: 0; + + @media (min-width: 1101px) { + left: 360px; + } } .umb-notifications__notifications { - list-style: none; - margin: 0; - position: relative; -} - + list-style: none; + margin: 0; + position: relative; +} .umb-notifications__notification { - padding: 5px 20px; - text-shadow: none; - font-size: 14px; - border: none; - border-radius: 0; - position: relative; - margin-bottom: 0; + padding: 5px 20px; + text-shadow: none; + font-size: 14px; + border: none; + position: relative; + margin-bottom: 0; } .umb-notifications__notification.-extra-padding { - padding-top: 20px; - padding-bottom: 20px; + padding-top: 20px; + padding-bottom: 20px; } From 3c2b2e29635ad375844423b524ac411d31bc5d85 Mon Sep 17 00:00:00 2001 From: Nathan Woulfe Date: Wed, 13 Feb 2019 17:10:43 +1000 Subject: [PATCH 02/55] fix height of editor sub-nav to prevent vertical overflow of borders --- .../src/less/components/umb-editor-navigation-item.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-editor-navigation-item.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-editor-navigation-item.less index 0372eeef4b..09c8fa9aa0 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-editor-navigation-item.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-editor-navigation-item.less @@ -14,7 +14,7 @@ flex-direction: column; align-items: center; justify-content: center; - height: @editorHeaderHeight; + height: calc(~'@{editorHeaderHeight}' - ~'1px'); // need to offset the 1px border-bottom on .umb-editor-header - avoids overflowing top of the container position: relative; color: @ui-active-type; From 730a2f7768185d718a2fc0223ae43e73d0b38ba8 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Wed, 13 Feb 2019 08:11:01 +0100 Subject: [PATCH 03/55] Localize content app names --- src/Umbraco.Web.UI/Umbraco/config/lang/da.xml | 4 ++++ src/Umbraco.Web.UI/Umbraco/config/lang/en.xml | 4 ++++ .../Umbraco/config/lang/en_us.xml | 4 ++++ .../Models/Mapping/ContentAppResolver.cs | 23 ++++++++++++++++--- 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml index a507366b56..09ea57e176 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml @@ -77,6 +77,10 @@ Tillad adgang til at gemme en node Tillad adgang til at oprette en indholdsskabelon + + Indhold + Info + Tilladelse nægtet. Tilføj nyt domæne diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml index 548d6932a6..b41752ae36 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml @@ -78,6 +78,10 @@ Allow access to save a node Allow access to create a Content Template + + Content + Info + Permission denied. Add new Domain diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml index 7dcd101aff..7551ebe6a3 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml @@ -78,6 +78,10 @@ Allow access to save a node Allow access to create a Content Template + + Content + Info + Permission denied. Add new Domain diff --git a/src/Umbraco.Web/Models/Mapping/ContentAppResolver.cs b/src/Umbraco.Web/Models/Mapping/ContentAppResolver.cs index ee3e991f89..6d9ae77009 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentAppResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentAppResolver.cs @@ -1,7 +1,10 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; +using System.Linq; using AutoMapper; using Umbraco.Core.Models; using Umbraco.Core.Models.ContentEditing; +using Umbraco.Core.Services; using Umbraco.Web.ContentApps; using Umbraco.Web.Models.ContentEditing; @@ -12,15 +15,29 @@ namespace Umbraco.Web.Models.Mapping internal class ContentAppResolver : IValueResolver> { private readonly ContentAppFactoryCollection _contentAppDefinitions; + private readonly ILocalizedTextService _localizedTextService; - public ContentAppResolver(ContentAppFactoryCollection contentAppDefinitions) + public ContentAppResolver(ContentAppFactoryCollection contentAppDefinitions, ILocalizedTextService localizedTextService) { _contentAppDefinitions = contentAppDefinitions; + _localizedTextService = localizedTextService; } public IEnumerable Resolve(IContent source, ContentItemDisplay destination, IEnumerable destMember, ResolutionContext context) { - return _contentAppDefinitions.GetContentAppsFor(source); + var apps = _contentAppDefinitions.GetContentAppsFor(source).ToArray(); + + // localize content app names + foreach (var app in apps) + { + var localizedAppName = _localizedTextService.Localize($"apps/{app.Alias}"); + if (localizedAppName.Equals($"[{app.Alias}]", StringComparison.OrdinalIgnoreCase) == false) + { + app.Name = localizedAppName; + } + } + + return apps; } } } From cc50a7a3ba3fbf0ef9499380ab97578dcd097861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 13 Feb 2019 09:27:24 +0100 Subject: [PATCH 04/55] grey out icons in umb-tree when not published or allowed --- .../src/less/components/tree/umb-tree.less | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/tree/umb-tree.less b/src/Umbraco.Web.UI.Client/src/less/components/tree/umb-tree.less index eaa26b5d1a..9fcd5ac2cc 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/tree/umb-tree.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/tree/umb-tree.less @@ -219,15 +219,15 @@ body.touch .umb-tree { // Tree item states // ------------------------- .not-published { - > i.icon, - a { + > .umb-tree-item__inner > i.icon, + > .umb-tree-item__inner > a { opacity: 0.6; } } .not-allowed { - > i.icon, - a { + > .umb-tree-item__inner > i.icon, + > .umb-tree-item__inner > a { cursor: not-allowed; } } From f2472c321d38c7974b671287ab5e674201308c0e Mon Sep 17 00:00:00 2001 From: Stephan Date: Wed, 13 Feb 2019 12:42:04 +0100 Subject: [PATCH 05/55] Use ChangesMonitor to prevent unwanted restarts during install/upgrade --- src/Umbraco.Web/Install/ChangesMonitor.cs | 155 ++++++++++++++++++ .../Install/FilePermissionHelper.cs | 25 +-- src/Umbraco.Web/Umbraco.Web.csproj | 1 + 3 files changed, 169 insertions(+), 12 deletions(-) create mode 100644 src/Umbraco.Web/Install/ChangesMonitor.cs diff --git a/src/Umbraco.Web/Install/ChangesMonitor.cs b/src/Umbraco.Web/Install/ChangesMonitor.cs new file mode 100644 index 0000000000..5a95312853 --- /dev/null +++ b/src/Umbraco.Web/Install/ChangesMonitor.cs @@ -0,0 +1,155 @@ +using System; +using System.Reflection; +using System.Web; + +namespace Umbraco.Web.Install +{ + public class ChangesMonitor : IDisposable + { + private readonly object _fileMonitor; + private readonly FieldInfo _disposedField; + private readonly bool _wasDisposed; + private bool _acquired; + private object _lockDispose; + + + //Ref. Option B http://beweb.pbworks.com/w/page/30073098/Prevent%20app%20restarts%20and%20site%20downtime%20when%20deploying%20files + //Ref. http://stackoverflow.com/questions/613824/how-to-prevent-an-asp-net-application-restarting-when-the-web-config-is-modified/629876#629876 + // + // HttpRuntime.FilesChangesMonitor is a FileChangesMonitor instance + // which has inner DirectoryMonitor instances to monitor directories + // FileChangesMonitor has a Stop method which stops monitoring everything - and release all native resources + // but... then we cannot really re-enable monitoring + // + // OTOH if FileChangesMonitor believes it's been disposed, ie its _disposed field is true, + // its OnSubdirChange and OnCriticaldirChange methods return without doing anything + // so... we can flip _disposed to true while doing our critical changes + // + // potential issues = race conditions, + // - event triggering too late, after we have re-enabled monitoring + // -> ? + // - monitor being disposed for real while we pretend it's been disposed + // -> handled, by locking the file monitor's inner lock + // - while _disposed is true, will not start monitoring everything either + // -> assuming that ... we're using this at a time where no multi-thread thing would run + + /// + /// Gets a disposable object representing suspended change monitoring. + /// + /// + /// Dispose the object to re-enable change monitoring. + /// + public static IDisposable Suspended() => new ChangesMonitor(); + + /// + /// Initializes a new instance of the class. + /// + private ChangesMonitor() + { + // get the FileChangesMonitor property + var fileMonitorProperty = typeof(HttpRuntime).GetProperty("FileChangesMonitor", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static); + if (fileMonitorProperty == null) throw new Exception("Could not get HttpRuntime.FileChangesMonitor property."); + + // get its value, ie the file monitor, a FileChangesMonitor instance + _fileMonitor = fileMonitorProperty.GetValue(null); + if (_fileMonitor == null) throw new Exception("Could not get the file monitor."); + + // no! this stops monitoring everything and monitoring cannot be re-enabled + /* + // get the Stop method + var fileMonitorStopMethod = fileMonitor.GetType().GetMethod("Stop", BindingFlags.Instance | BindingFlags.NonPublic); + if (fileMonitorStopMethod == null) throw new Exception("Could not get the file monitor Stop method."); + + // stop + fileMonitorStopMethod.Invoke(fileMonitor, new object[] { }); + */ + + // get the _disposed field + _disposedField = _fileMonitor.GetType().GetField("_disposed", BindingFlags.Instance | BindingFlags.NonPublic); + if (_disposedField == null) throw new Exception("Could not get the file monitor _disposed field."); + + // pretend to be disposed, if not already disposed + try + { + AcquireDisposeLock(_fileMonitor); + + _wasDisposed = (bool)_disposedField.GetValue(_fileMonitor); + if (!_wasDisposed) + _disposedField.SetValue(_fileMonitor, true); + } + finally + { + ReleaseDisposeLock(); + } + } + + public void Dispose() + { + // restore + if (_disposedField == null || _wasDisposed) + return; + + // if the FileChangesMonitor is stopped while we have _disposed being true... + // it will *still* do all the disposing work, but we must detect it and *not* + // flip the flag back to false! + // + // the FileChangesMonitor locks before flipping _disposed to true and releasing + // anything, so by locking too we should be safe + + try + { + AcquireDisposeLock(_fileMonitor); + + var dirMonSubdirsField = _fileMonitor.GetType().GetField("_dirMonSubdirs", BindingFlags.Instance | BindingFlags.NonPublic); + if (dirMonSubdirsField == null) throw new Exception("Could not get the file monitor _dirMonSubdirs field."); + + var dirMonSpecialDirsField = _fileMonitor.GetType().GetField("_dirMonSpecialDirs", BindingFlags.Instance | BindingFlags.NonPublic); + if (dirMonSpecialDirsField == null) throw new Exception("Could not get the file monitor _dirMonSpecialDirs field."); + + var dirMonSubdirsIsNull = dirMonSubdirsField.GetValue(_fileMonitor) == null; + var dirMonSpecialDirsIsNull = dirMonSpecialDirsField.GetValue(_fileMonitor) == null; + + // let's say... this works + var hasBeenDisposed = dirMonSubdirsIsNull && dirMonSpecialDirsIsNull; + + // if it has been disposed, leave _disposed true, else reset the value + if (!hasBeenDisposed) + _disposedField.SetValue(_fileMonitor, false); + } + finally + { + ReleaseDisposeLock(); + } + } + + private void AcquireDisposeLock(object fileMonitor) + { + if (_lockDispose == null) + { + var lockDisposeField = fileMonitor.GetType().GetField("_lockDispose", BindingFlags.Instance | BindingFlags.NonPublic); + if (lockDisposeField == null) throw new Exception("Could not get the file monitor _lockDispose field."); + + _lockDispose = lockDisposeField.GetValue(fileMonitor); + if (_lockDispose == null) throw new Exception("File monitor _lockDispose is null."); + } + + var aquireMethod = _lockDispose.GetType().GetMethod("AcquireWriterLock", BindingFlags.Instance | BindingFlags.NonPublic); + if (aquireMethod == null) throw new Exception("Could not get the dispose lock AcquireWriterLock method."); + + aquireMethod.Invoke(_lockDispose, Array.Empty()); + _acquired = true; + } + + private void ReleaseDisposeLock() + { + if (!_acquired) throw new Exception("Lock has not been acquired."); + if (_lockDispose == null) throw new Exception("File monitor _lockDispose is null."); + + var releaseMethod = _lockDispose.GetType().GetMethod("ReleaseWriterLock", BindingFlags.Instance | BindingFlags.NonPublic); + if (releaseMethod == null) throw new Exception("Could not get the dispose lock ReleaseWriterLock method."); + + releaseMethod.Invoke(_lockDispose, Array.Empty()); + _acquired = false; + } + } +} diff --git a/src/Umbraco.Web/Install/FilePermissionHelper.cs b/src/Umbraco.Web/Install/FilePermissionHelper.cs index e802b19c8d..ede9008514 100644 --- a/src/Umbraco.Web/Install/FilePermissionHelper.cs +++ b/src/Umbraco.Web/Install/FilePermissionHelper.cs @@ -21,22 +21,23 @@ namespace Umbraco.Web.Install { report = new Dictionary>(); - IEnumerable errors; + using (ChangesMonitor.Suspended()) // hack: ensure this does not trigger a restart + { + if (EnsureDirectories(PermissionDirs, out var errors) == false) + report["Folder creation failed"] = errors.ToList(); - if (EnsureDirectories(PermissionDirs, out errors) == false) - report["Folder creation failed"] = errors.ToList(); + if (EnsureDirectories(PackagesPermissionsDirs, out errors) == false) + report["File writing for packages failed"] = errors.ToList(); - if (EnsureDirectories(PackagesPermissionsDirs, out errors) == false) - report["File writing for packages failed"] = errors.ToList(); + if (EnsureFiles(PermissionFiles, out errors) == false) + report["File writing failed"] = errors.ToList(); - if (EnsureFiles(PermissionFiles, out errors) == false) - report["File writing failed"] = errors.ToList(); + if (TestPublishedSnapshotService(out errors) == false) + report["Published snapshot environment check failed"] = errors.ToList(); - if (TestPublishedSnapshotService(out errors) == false) - report["Published snapshot environment check failed"] = errors.ToList(); - - if (EnsureCanCreateSubDirectory(SystemDirectories.Media, out errors) == false) - report["Media folder creation failed"] = errors.ToList(); + if (EnsureCanCreateSubDirectory(SystemDirectories.Media, out errors) == false) + report["Media folder creation failed"] = errors.ToList(); + } return report.Count == 0; } diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 26624ee4a2..f7f6c044de 100755 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -138,6 +138,7 @@ + From f385e1d01d4b934038da04808fa2b91f38a2081a Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 14 Feb 2019 11:01:34 +1100 Subject: [PATCH 06/55] fixes #4408 --- src/Umbraco.Web/CompositionExtensions.cs | 7 +++++++ src/Umbraco.Web/Trees/Tree.cs | 8 ++++---- src/Umbraco.Web/Trees/TreeCollectionBuilder.cs | 16 +++++++++++++++- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web/CompositionExtensions.cs b/src/Umbraco.Web/CompositionExtensions.cs index 4302cdaeee..17eba3f81f 100644 --- a/src/Umbraco.Web/CompositionExtensions.cs +++ b/src/Umbraco.Web/CompositionExtensions.cs @@ -109,6 +109,13 @@ namespace Umbraco.Web public static EmbedProvidersCollectionBuilder OEmbedProviders(this Composition composition) => composition.WithCollectionBuilder(); + /// + /// Gets the back office tree collection builder + /// + /// + /// + public static TreeCollectionBuilder Trees(this Composition composition) + => composition.WithCollectionBuilder(); #endregion #region Uniques diff --git a/src/Umbraco.Web/Trees/Tree.cs b/src/Umbraco.Web/Trees/Tree.cs index 37b379e292..a2c70bac72 100644 --- a/src/Umbraco.Web/Trees/Tree.cs +++ b/src/Umbraco.Web/Trees/Tree.cs @@ -10,12 +10,12 @@ namespace Umbraco.Web.Trees public Tree(int sortOrder, string applicationAlias, string group, string alias, string title, TreeUse use, Type treeControllerType, bool isSingleNodeTree) { SortOrder = sortOrder; - SectionAlias = applicationAlias; + SectionAlias = applicationAlias ?? throw new ArgumentNullException(nameof(applicationAlias)); TreeGroup = group; - TreeAlias = alias; - TreeTitle = title; + TreeAlias = alias ?? throw new ArgumentNullException(nameof(alias)); + TreeTitle = title ?? throw new ArgumentNullException(nameof(title)); TreeUse = use; - TreeControllerType = treeControllerType; + TreeControllerType = treeControllerType ?? throw new ArgumentNullException(nameof(treeControllerType)); IsSingleNodeTree = isSingleNodeTree; } diff --git a/src/Umbraco.Web/Trees/TreeCollectionBuilder.cs b/src/Umbraco.Web/Trees/TreeCollectionBuilder.cs index a62e474e43..d324ad93b2 100644 --- a/src/Umbraco.Web/Trees/TreeCollectionBuilder.cs +++ b/src/Umbraco.Web/Trees/TreeCollectionBuilder.cs @@ -16,6 +16,20 @@ namespace Umbraco.Web.Trees public void RegisterWith(IRegister register) => register.Register(CreateCollection, Lifetime.Singleton); + /// + /// Registers a custom tree definition + /// + /// + /// + /// This is useful if a developer wishes to have a single tree controller for different tree aliases. In this case the tree controller + /// cannot be decorated with the TreeAttribute (since then it will be auto-registered). + /// + public void AddTree(Tree treeDefinition) + { + if (treeDefinition == null) throw new ArgumentNullException(nameof(treeDefinition)); + _trees.Add(treeDefinition); + } + public void AddTreeController() where TController : TreeControllerBase => AddTreeController(typeof(TController)); @@ -25,7 +39,7 @@ namespace Umbraco.Web.Trees if (!typeof(TreeControllerBase).IsAssignableFrom(controllerType)) throw new ArgumentException($"Type {controllerType} does not inherit from {typeof(TreeControllerBase).FullName}."); - // no all TreeControllerBase are meant to be used here, + // not all TreeControllerBase are meant to be used here, // ignore those that don't have the attribute var attribute = controllerType.GetCustomAttribute(false); From fd5a2f355b004e94193ae901d730fbb6086d57c9 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 14 Feb 2019 11:08:39 +1100 Subject: [PATCH 07/55] Also exposes the SearchableTreeCollectionBuilder since that's required to be able to replace the ISearchableTree implementations --- src/Umbraco.Web/CompositionExtensions.cs | 10 ++++++++++ .../Search/SearchableTreeCollectionBuilder.cs | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/CompositionExtensions.cs b/src/Umbraco.Web/CompositionExtensions.cs index 17eba3f81f..c9cc213ba0 100644 --- a/src/Umbraco.Web/CompositionExtensions.cs +++ b/src/Umbraco.Web/CompositionExtensions.cs @@ -10,6 +10,7 @@ using Umbraco.Web.Media.EmbedProviders; using Umbraco.Web.Mvc; using Umbraco.Web.PublishedCache; using Umbraco.Web.Routing; +using Umbraco.Web.Search; using Umbraco.Web.Tour; using Umbraco.Web.Trees; using Current = Umbraco.Web.Composing.Current; @@ -116,6 +117,15 @@ namespace Umbraco.Web /// public static TreeCollectionBuilder Trees(this Composition composition) => composition.WithCollectionBuilder(); + + /// + /// Gets the back office searchable tree collection builder + /// + /// + /// + public static SearchableTreeCollectionBuilder SearchableTrees(this Composition composition) + => composition.WithCollectionBuilder(); + #endregion #region Uniques diff --git a/src/Umbraco.Web/Search/SearchableTreeCollectionBuilder.cs b/src/Umbraco.Web/Search/SearchableTreeCollectionBuilder.cs index 2d668257ef..847264ee03 100644 --- a/src/Umbraco.Web/Search/SearchableTreeCollectionBuilder.cs +++ b/src/Umbraco.Web/Search/SearchableTreeCollectionBuilder.cs @@ -3,7 +3,7 @@ using Umbraco.Web.Trees; namespace Umbraco.Web.Search { - internal class SearchableTreeCollectionBuilder : LazyCollectionBuilderBase + public class SearchableTreeCollectionBuilder : LazyCollectionBuilderBase { protected override SearchableTreeCollectionBuilder This => this; From 6644fc790aa74af229420c16228aaab8d1ff8937 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 14 Feb 2019 11:15:43 +1100 Subject: [PATCH 08/55] dont null check tree title --- src/Umbraco.Web/Trees/Tree.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Trees/Tree.cs b/src/Umbraco.Web/Trees/Tree.cs index a2c70bac72..4747d2495b 100644 --- a/src/Umbraco.Web/Trees/Tree.cs +++ b/src/Umbraco.Web/Trees/Tree.cs @@ -13,7 +13,7 @@ namespace Umbraco.Web.Trees SectionAlias = applicationAlias ?? throw new ArgumentNullException(nameof(applicationAlias)); TreeGroup = group; TreeAlias = alias ?? throw new ArgumentNullException(nameof(alias)); - TreeTitle = title ?? throw new ArgumentNullException(nameof(title)); + TreeTitle = title; TreeUse = use; TreeControllerType = treeControllerType ?? throw new ArgumentNullException(nameof(treeControllerType)); IsSingleNodeTree = isSingleNodeTree; From 5e38cadacc0099c4ab26481bd38a0dadf1397170 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 14 Feb 2019 12:30:36 +1100 Subject: [PATCH 09/55] publishes js test results to xml so that Azure DevOps can read the results, re-enables js test building, fixes an issue with one of the tests --- .gitignore | 1 + src/Umbraco.Web.UI.Client/gulp/tasks/build.js | 2 +- src/Umbraco.Web.UI.Client/package-lock.json | 16 +++++++++++++ src/Umbraco.Web.UI.Client/package.json | 7 +++--- .../test/config/karma.conf.js | 24 ++++++++++++++----- .../content-picker-controller.spec.js | 16 ++++++++----- 6 files changed, 50 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 0825d81b78..23ba01ebf0 100644 --- a/.gitignore +++ b/.gitignore @@ -160,3 +160,4 @@ build/temp/ # eof +/src/Umbraco.Web.UI.Client/TESTS-*.xml diff --git a/src/Umbraco.Web.UI.Client/gulp/tasks/build.js b/src/Umbraco.Web.UI.Client/gulp/tasks/build.js index 8fe582e406..32bf71f5f7 100644 --- a/src/Umbraco.Web.UI.Client/gulp/tasks/build.js +++ b/src/Umbraco.Web.UI.Client/gulp/tasks/build.js @@ -6,5 +6,5 @@ var runSequence = require('run-sequence'); // Build - build the files ready for production gulp.task('build', function(cb) { - runSequence(["js", "dependencies", "less", "views"], /*"test:unit",*/ cb); + runSequence(["js", "dependencies", "less", "views"], "test:unit", cb); }); diff --git a/src/Umbraco.Web.UI.Client/package-lock.json b/src/Umbraco.Web.UI.Client/package-lock.json index 207eba38c5..487c50bddb 100644 --- a/src/Umbraco.Web.UI.Client/package-lock.json +++ b/src/Umbraco.Web.UI.Client/package-lock.json @@ -8664,6 +8664,16 @@ "jasmine-core": "^3.3" } }, + "karma-junit-reporter": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/karma-junit-reporter/-/karma-junit-reporter-1.2.0.tgz", + "integrity": "sha1-T5xAzt+xo5X4rvh2q/lhiZF8Y5Y=", + "dev": true, + "requires": { + "path-is-absolute": "^1.0.0", + "xmlbuilder": "8.2.2" + } + }, "karma-phantomjs-launcher": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/karma-phantomjs-launcher/-/karma-phantomjs-launcher-1.0.4.tgz", @@ -16436,6 +16446,12 @@ "ultron": "~1.1.0" } }, + "xmlbuilder": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-8.2.2.tgz", + "integrity": "sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M=", + "dev": true + }, "xmlhttprequest-ssl": { "version": "1.5.5", "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", diff --git a/src/Umbraco.Web.UI.Client/package.json b/src/Umbraco.Web.UI.Client/package.json index f24275420a..3a5ff22f04 100644 --- a/src/Umbraco.Web.UI.Client/package.json +++ b/src/Umbraco.Web.UI.Client/package.json @@ -48,6 +48,7 @@ "@babel/preset-env": "7.1.6", "autoprefixer": "9.3.1", "cssnano": "4.1.7", + "fs": "0.0.2", "gulp": "^3.9.1", "gulp-babel": "8.0.0", "gulp-clean-css": "4.0.0", @@ -58,6 +59,7 @@ "gulp-imagemin": "^4.1.0", "gulp-less": "4.0.1", "gulp-ngdocs": "0.3.0", + "gulp-notify": "^3.0.0", "gulp-open": "3.0.1", "gulp-postcss": "8.0.0", "gulp-rename": "1.4.0", @@ -65,16 +67,15 @@ "gulp-watch": "5.0.1", "gulp-wrap": "0.14.0", "gulp-wrap-js": "0.4.1", - "gulp-notify": "^3.0.0", "jasmine-core": "3.3.0", "karma": "3.1.1", "karma-jasmine": "2.0.1", + "karma-junit-reporter": "^1.2.0", "karma-phantomjs-launcher": "1.0.4", "less": "3.9.0", "lodash": "4.17.11", "marked": "^0.5.2", "merge-stream": "1.0.1", - "run-sequence": "2.2.1", - "fs": "0.0.2" + "run-sequence": "2.2.1" } } diff --git a/src/Umbraco.Web.UI.Client/test/config/karma.conf.js b/src/Umbraco.Web.UI.Client/test/config/karma.conf.js index cfb4eddb40..6029d2e75b 100644 --- a/src/Umbraco.Web.UI.Client/test/config/karma.conf.js +++ b/src/Umbraco.Web.UI.Client/test/config/karma.conf.js @@ -1,7 +1,7 @@ module.exports = function (config) { config.set({ - + // base path, that will be used to resolve files and exclude basePath: '../..', @@ -52,7 +52,7 @@ module.exports = function (config) { // use dolts reporter, as travis terminal does not support escaping sequences // possible values: 'dots', 'progress', 'junit', 'teamcity' // CLI --reporters progress - reporters: ['progress'], + reporters: ['progress', 'junit'], // web server port // CLI --port 9876 @@ -60,7 +60,7 @@ module.exports = function (config) { // cli runner port // CLI --runner-port 9100 - runnerPort: 9100, + runnerPort: 9100, // enable / disable colors in the output (reporters and logs) // CLI --colors --no-colors @@ -89,7 +89,7 @@ module.exports = function (config) { // allow waiting a bit longer, some machines require this browserNoActivityTimeout: 100000, // default 10,000ms - + // Auto run tests on start (when browsers are captured) and exit // CLI --single-run --no-single-run singleRun: true, @@ -100,7 +100,19 @@ module.exports = function (config) { plugins: [ require('karma-jasmine'), - require('karma-phantomjs-launcher') - ] + require('karma-phantomjs-launcher'), + require('karma-junit-reporter') + ], + + // the default configuration + junitReporter: { + outputDir: '', // results will be saved as $outputDir/$browserName.xml + outputFile: undefined, // if included, results will be saved as $outputDir/$browserName/$outputFile + suite: '', // suite will become the package name attribute in xml testsuite element + useBrowserName: true, // add browser name to report and classes names + nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element + classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element + properties: {} // key value pair of properties to add to the section of the report + } }); }; diff --git a/src/Umbraco.Web.UI.Client/test/unit/app/propertyeditors/content-picker-controller.spec.js b/src/Umbraco.Web.UI.Client/test/unit/app/propertyeditors/content-picker-controller.spec.js index ef9748d75e..238d77b5fe 100644 --- a/src/Umbraco.Web.UI.Client/test/unit/app/propertyeditors/content-picker-controller.spec.js +++ b/src/Umbraco.Web.UI.Client/test/unit/app/propertyeditors/content-picker-controller.spec.js @@ -52,11 +52,15 @@ describe('Content picker controller tests', function () { describe('content edit controller save and publish', function () { - var item = { - name: "meh", - id: 666, - icon: "woop" - }; + var item; + + beforeEach(function () { + item = { + name: "meh", + id: 666, + icon: "woop" + }; + }); it('should define the default properties on construction', function () { expect(scope.model.value).not.toBeUndefined(); @@ -107,4 +111,4 @@ describe('Content picker controller tests', function () { }); }); -}); \ No newline at end of file +}); From 64df1d040f6632fef55079bd98bcb129901c2c80 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 14 Feb 2019 15:09:28 +1100 Subject: [PATCH 10/55] Fixes how tests are run, fixes up the content picker, removes unecessary tests --- .../contentpicker/contentpicker.controller.js | 4 +- .../test/config/karma.conf.js | 6 +++ .../content-picker-controller.spec.js | 24 ++++++------ .../template-editor-controller.spec.js | 37 ------------------- 4 files changed, 20 insertions(+), 51 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js index 16aa7efceb..2bebc55beb 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js @@ -191,7 +191,7 @@ function contentPickerController($scope, entityResource, editorState, iconHelper //if we have a query for the startnode, we will use that. var rootId = $routeParams.id; entityResource.getByQuery($scope.model.config.startNode.query, rootId, "Document").then(function (ent) { - dialogOptions.startNodeId = $scope.model.config.idType === "udi" ? ent.udi : ent.id; + dialogOptions.startNodeId = ($scope.model.config.idType === "udi" ? ent.udi : ent.id).toString(); }); } else { @@ -261,7 +261,7 @@ function contentPickerController($scope, entityResource, editorState, iconHelper $scope.add = function (item) { var currIds = $scope.model.value ? $scope.model.value.split(',') : []; - var itemId = $scope.model.config.idType === "udi" ? item.udi : item.id; + var itemId = ($scope.model.config.idType === "udi" ? item.udi : item.id).toString(); if (currIds.indexOf(itemId) < 0) { currIds.push(itemId); diff --git a/src/Umbraco.Web.UI.Client/test/config/karma.conf.js b/src/Umbraco.Web.UI.Client/test/config/karma.conf.js index 6029d2e75b..08223de092 100644 --- a/src/Umbraco.Web.UI.Client/test/config/karma.conf.js +++ b/src/Umbraco.Web.UI.Client/test/config/karma.conf.js @@ -113,6 +113,12 @@ module.exports = function (config) { nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element properties: {} // key value pair of properties to add to the section of the report + }, + + client: { + jasmine: { + random: false + } } }); }; diff --git a/src/Umbraco.Web.UI.Client/test/unit/app/propertyeditors/content-picker-controller.spec.js b/src/Umbraco.Web.UI.Client/test/unit/app/propertyeditors/content-picker-controller.spec.js index 238d77b5fe..49d8914ac6 100644 --- a/src/Umbraco.Web.UI.Client/test/unit/app/propertyeditors/content-picker-controller.spec.js +++ b/src/Umbraco.Web.UI.Client/test/unit/app/propertyeditors/content-picker-controller.spec.js @@ -12,6 +12,7 @@ describe('Content picker controller tests', function () { httpBackend = $httpBackend; scope = $rootScope.$new(); + scope.model = { alias: "property", value:"1233,1231,23121", @@ -86,28 +87,27 @@ describe('Content picker controller tests', function () { }); it("Adding an item should update renderModel, ids and model.value", function(){ + scope.add(item); scope.$apply(); - setTimeout(function(){ - expect(scope.renderModel.length).toBe(4); - expect(scope.model.value).toBe("1233,1231,23121,666"); - }, 1000); + httpBackend.flush(); + + expect(scope.renderModel.length).toBe(4); + expect(scope.model.value).toBe("1233,1231,23121,666"); }); it("Adding a duplicate item should note update renderModel, ids and model.value", function(){ scope.add(item); scope.$apply(); - setTimeout(function(){ - expect(scope.renderModel.length).toBe(4); - expect(scope.model.value).toBe("1233,1231,23121,666"); - }, 1000); + httpBackend.flush(); + expect(scope.renderModel.length).toBe(4); + expect(scope.model.value).toBe("1233,1231,23121,666"); scope.add(item); scope.$apply(); - setTimeout(function(){ - expect(scope.renderModel.length).toBe(4); - expect(scope.model.value).toBe("1233,1231,23121,666"); - }, 1000); + + expect(scope.renderModel.length).toBe(4); + expect(scope.model.value).toBe("1233,1231,23121,666"); }); }); diff --git a/src/Umbraco.Web.UI.Client/test/unit/app/templates/template-editor-controller.spec.js b/src/Umbraco.Web.UI.Client/test/unit/app/templates/template-editor-controller.spec.js index ac49709ee4..b4615eaad8 100644 --- a/src/Umbraco.Web.UI.Client/test/unit/app/templates/template-editor-controller.spec.js +++ b/src/Umbraco.Web.UI.Client/test/unit/app/templates/template-editor-controller.spec.js @@ -102,43 +102,6 @@ it("has ace editor", function () { expect(controller.editor).toBe(ace); }); - - it("sets masterpage on template", function () { - controller.setLayout = function() {}; - - controller.openMasterTemplateOverlay(); - setTimeout(function(){ - controller.masterTemplateOverlay.submit({ - selectedItem: { - alias: "NewMasterPage" - } - }); - expect(controller.template.masterTemplateAlias).toBe("NewMasterPage"); - }, 1000); - }); - - //// TODO: THIS FAILED - //it("changes layout value when masterpage is selected", function() { - // var newTemplate; - // ace.clearSelection = nada; - // ace.navigateFileStart = nada; - // ace.getValue = function () { - // return "@{ Layout = null; }"; - // } - // ace.setValue = function (value) { - // newTemplate = value; - // } - - // controller.openMasterTemplateOverlay(); - // setTimeout(function(){ - // controller.masterTemplateOverlay.submit({ - // selectedItem: { - // alias: "NewMasterPage" - // } - // }); - // expect(newTemplate).toBe("@{ Layout = \"NewMasterPage.cshtml\"; }"); - // }, 1000); - //}); }); From 7660e9fb25219c769f918225cd38fafba59bc4c4 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 14 Feb 2019 09:15:47 +0100 Subject: [PATCH 11/55] Reorganize composition code --- .../AuditEventsComponent.cs | 3 +- .../AuditEventsComposer.cs | 4 +- .../CompositionExtensions.cs | 9 ++- .../ManifestWatcherComponent.cs | 3 +- .../ManifestWatcherComposer.cs | 4 +- .../RelateOnCopyComponent.cs | 2 +- .../RelateOnCopyComposer.cs | 4 +- .../RelateOnTrashComponent.cs | 2 +- .../RelateOnTrashComposer.cs | 4 +- .../ComponentCollection.cs | 3 +- .../ComponentCollectionBuilder.cs | 3 +- .../ComponentComposer.cs | 4 +- .../ComposeAfterAttribute.cs | 2 +- .../ComposeBeforeAttribute.cs | 2 +- .../{Components => Composing}/Composers.cs | 2 +- .../{Components => Composing}/Composition.cs | 3 +- .../Configuration.cs} | 8 +-- .../CoreMappingProfiles.cs} | 5 +- .../FileSystems.cs} | 10 +-- .../Repositories.cs} | 7 +- .../Services.cs} | 5 +- .../DisableAttribute.cs | 2 +- .../DisableComposerAttribute.cs | 2 +- .../EnableAttribute.cs | 2 +- .../EnableComposerAttribute.cs | 2 +- .../{Components => Composing}/IComponent.cs | 2 +- .../{Components => Composing}/IComposer.cs | 4 +- .../ICoreComposer.cs | 2 +- .../IRuntimeComposer.cs | 2 +- .../IUserComposer.cs | 2 +- .../RuntimeLevelAttribute.cs | 3 +- .../{Composing => }/CompositionExtensions.cs | 4 +- .../{Composing => }/FactoryExtensions.cs | 3 +- .../Logging/Viewer/LogViewerComposer.cs | 3 +- .../{Composing => }/RegisterExtensions.cs | 4 +- src/Umbraco.Core/Runtime/CoreRuntime.cs | 1 - .../Runtime/CoreRuntimeComponent.cs | 2 +- .../Runtime/CoreRuntimeComposer.cs | 3 +- src/Umbraco.Core/RuntimeOptions.cs | 1 - .../{Composing => }/TypeLoaderExtensions.cs | 5 +- src/Umbraco.Core/Umbraco.Core.csproj | 70 +++++++++---------- .../DistributedCache/DistributedCacheTests.cs | 1 - .../Cache/DistributedCacheBinderTests.cs | 1 - .../PublishedContentCacheTests.cs | 1 + .../Components/ComponentTests.cs | 2 +- .../Composing/CollectionBuildersTests.cs | 1 - .../Composing/ContainerConformingTests.cs | 1 + .../Composing/LazyCollectionBuilderTests.cs | 1 - .../Composing/PackageActionCollectionTests.cs | 1 - src/Umbraco.Tests/IO/FileSystemsTests.cs | 4 +- .../Models/ContentExtensionsTests.cs | 3 +- src/Umbraco.Tests/Models/ContentTests.cs | 3 +- .../Mapping/ContentWebModelMappingTests.cs | 3 +- .../Packaging/PackageDataInstallationTests.cs | 2 +- .../Packaging/PackageInstallationTest.cs | 1 + .../PropertyEditors/ImageCropperTest.cs | 1 - .../PropertyEditorValueEditorTests.cs | 1 - .../Published/ConvertersTests.cs | 1 - .../PublishedContentSnapshotTestBase.cs | 1 + .../ContentFinderByUrlAndTemplateTests.cs | 1 + .../ContentFinderByUrlWithDomainsTests.cs | 1 + src/Umbraco.Tests/Routing/UrlRoutesTests.cs | 1 + .../Runtimes/CoreRuntimeTests.cs | 2 +- src/Umbraco.Tests/Runtimes/StandaloneTests.cs | 1 - .../Scoping/ScopeEventDispatcherTests.cs | 1 - .../Scoping/ScopeFileSystemsTests.cs | 3 +- .../Scoping/ScopedRepositoryTests.cs | 1 + src/Umbraco.Tests/Scoping/ScopedXmlTests.cs | 1 + .../Services/EntityXmlSerializerTests.cs | 1 + .../Services/SectionServiceTests.cs | 1 + .../TestHelpers/BaseUsingSqlCeSyntax.cs | 1 - src/Umbraco.Tests/Testing/UmbracoTestBase.cs | 12 ++-- src/Umbraco.Tests/UmbracoExamine/IndexTest.cs | 1 + .../UmbracoExamine/SearchTests.cs | 1 + .../Web/Mvc/UmbracoViewPageTests.cs | 1 + .../Cache/DistributedCacheBinderComponent.cs | 2 +- .../Cache/DistributedCacheBinderComposer.cs | 1 - .../BackOfficeUserAuditEventsComponent.cs | 6 +- .../BackOfficeUserAuditEventsComposer.cs | 4 +- ...aseServerRegistrarAndMessengerComponent.cs | 5 +- .../NotificationsComponent.cs | 18 ++--- .../NotificationsComposer.cs | 3 +- .../PublicAccessComponent.cs | 6 +- .../PublicAccessComposer.cs | 4 +- .../Controllers.cs} | 5 +- .../Installer.cs} | 7 +- .../WebMappingProfiles.cs} | 5 +- src/Umbraco.Web/CompositionExtensions.cs | 2 +- .../ContentAppFactoryCollectionBuilder.cs | 1 + .../Logging/WebProfilerComponent.cs | 2 +- .../Logging/WebProfilerComposer.cs | 2 +- .../PropertyEditorsComponent.cs | 2 +- .../PropertyEditorsComposer.cs | 2 +- .../NuCache/NuCacheComponent.cs | 2 +- .../PublishedCache/NuCache/NuCacheComposer.cs | 2 +- .../Routing/RedirectTrackingComponent.cs | 4 +- .../Routing/RedirectTrackingComposer.cs | 2 +- src/Umbraco.Web/Runtime/WebRuntime.cs | 1 - .../Runtime/WebRuntimeComponent.cs | 1 - src/Umbraco.Web/Runtime/WebRuntimeComposer.cs | 3 +- .../Scheduling/SchedulerComponent.cs | 1 - .../Scheduling/SchedulerComposer.cs | 2 +- src/Umbraco.Web/Search/ExamineComponent.cs | 2 +- src/Umbraco.Web/Search/ExamineComposer.cs | 1 - .../SignalR/PreviewHubComponent.cs | 2 +- src/Umbraco.Web/SignalR/PreviewHubComposer.cs | 2 +- .../BackOfficeSectionCollectionBuilder.cs | 1 + src/Umbraco.Web/Umbraco.Web.csproj | 20 +++--- 108 files changed, 189 insertions(+), 201 deletions(-) rename src/Umbraco.Core/{Components => Compose}/AuditEventsComponent.cs (99%) rename src/Umbraco.Core/{Components => Compose}/AuditEventsComposer.cs (63%) rename src/Umbraco.Core/{Components => Compose}/CompositionExtensions.cs (99%) rename src/Umbraco.Core/{Components => Compose}/ManifestWatcherComponent.cs (95%) rename src/Umbraco.Core/{Components => Compose}/ManifestWatcherComposer.cs (71%) rename src/Umbraco.Core/{Components => Compose}/RelateOnCopyComponent.cs (98%) rename src/Umbraco.Core/{Components => Compose}/RelateOnCopyComposer.cs (71%) rename src/Umbraco.Core/{Components => Compose}/RelateOnTrashComponent.cs (99%) rename src/Umbraco.Core/{Components => Compose}/RelateOnTrashComposer.cs (71%) rename src/Umbraco.Core/{Components => Composing}/ComponentCollection.cs (96%) rename src/Umbraco.Core/{Components => Composing}/ComponentCollectionBuilder.cs (95%) rename src/Umbraco.Core/{Components => Composing}/ComponentComposer.cs (91%) rename src/Umbraco.Core/{Components => Composing}/ComposeAfterAttribute.cs (98%) rename src/Umbraco.Core/{Components => Composing}/ComposeBeforeAttribute.cs (98%) rename src/Umbraco.Core/{Components => Composing}/Composers.cs (99%) rename src/Umbraco.Core/{Components => Composing}/Composition.cs (99%) rename src/Umbraco.Core/Composing/{Composers/ConfigurationComposer.cs => CompositionExtensions/Configuration.cs} (75%) rename src/Umbraco.Core/Composing/{Composers/CoreMappingProfilesComposer.cs => CompositionExtensions/CoreMappingProfiles.cs} (69%) rename src/Umbraco.Core/Composing/{Composers/FileSystemsComposer.cs => CompositionExtensions/FileSystems.cs} (95%) rename src/Umbraco.Core/Composing/{Composers/RepositoriesComposer.cs => CompositionExtensions/Repositories.cs} (95%) rename src/Umbraco.Core/Composing/{Composers/ServicesComposer.cs => CompositionExtensions/Services.cs} (98%) rename src/Umbraco.Core/{Components => Composing}/DisableAttribute.cs (97%) rename src/Umbraco.Core/{Components => Composing}/DisableComposerAttribute.cs (96%) rename src/Umbraco.Core/{Components => Composing}/EnableAttribute.cs (97%) rename src/Umbraco.Core/{Components => Composing}/EnableComposerAttribute.cs (97%) rename src/Umbraco.Core/{Components => Composing}/IComponent.cs (95%) rename src/Umbraco.Core/{Components => Composing}/IComposer.cs (81%) rename src/Umbraco.Core/{Components => Composing}/ICoreComposer.cs (91%) rename src/Umbraco.Core/{Components => Composing}/IRuntimeComposer.cs (88%) rename src/Umbraco.Core/{Components => Composing}/IUserComposer.cs (89%) rename src/Umbraco.Core/{Components => Composing}/RuntimeLevelAttribute.cs (92%) rename src/Umbraco.Core/{Composing => }/CompositionExtensions.cs (97%) rename src/Umbraco.Core/{Composing => }/FactoryExtensions.cs (98%) rename src/Umbraco.Core/{Composing => }/RegisterExtensions.cs (96%) rename src/Umbraco.Core/{Composing => }/TypeLoaderExtensions.cs (93%) rename src/Umbraco.Web/{Components => Compose}/BackOfficeUserAuditEventsComponent.cs (98%) rename src/Umbraco.Web/{Components => Compose}/BackOfficeUserAuditEventsComposer.cs (67%) rename src/Umbraco.Web/{Components => Compose}/DatabaseServerRegistrarAndMessengerComponent.cs (99%) rename src/Umbraco.Web/{Components => Compose}/NotificationsComponent.cs (98%) rename src/Umbraco.Web/{Components => Compose}/NotificationsComposer.cs (86%) rename src/Umbraco.Web/{Components => Compose}/PublicAccessComponent.cs (91%) rename src/Umbraco.Web/{Components => Compose}/PublicAccessComposer.cs (82%) rename src/Umbraco.Web/Composing/{Composers/ControllersComposer.cs => CompositionExtensions/Controllers.cs} (97%) rename src/Umbraco.Web/Composing/{Composers/InstallerComposer.cs => CompositionExtensions/Installer.cs} (88%) rename src/Umbraco.Web/Composing/{Composers/WebMappingProfilesComposer.cs => CompositionExtensions/WebMappingProfiles.cs} (95%) diff --git a/src/Umbraco.Core/Components/AuditEventsComponent.cs b/src/Umbraco.Core/Compose/AuditEventsComponent.cs similarity index 99% rename from src/Umbraco.Core/Components/AuditEventsComponent.cs rename to src/Umbraco.Core/Compose/AuditEventsComponent.cs index 08d4702afa..15fdfeacff 100644 --- a/src/Umbraco.Core/Components/AuditEventsComponent.cs +++ b/src/Umbraco.Core/Compose/AuditEventsComponent.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Text; using System.Threading; using System.Web; +using Umbraco.Core.Composing; using Umbraco.Core.Events; using Umbraco.Core.Models; using Umbraco.Core.Models.Membership; @@ -10,7 +11,7 @@ using Umbraco.Core.Security; using Umbraco.Core.Services; using Umbraco.Core.Services.Implement; -namespace Umbraco.Core.Components +namespace Umbraco.Core.Compose { public sealed class AuditEventsComponent : IComponent { diff --git a/src/Umbraco.Core/Components/AuditEventsComposer.cs b/src/Umbraco.Core/Compose/AuditEventsComposer.cs similarity index 63% rename from src/Umbraco.Core/Components/AuditEventsComposer.cs rename to src/Umbraco.Core/Compose/AuditEventsComposer.cs index 692cb6c6dd..339d106087 100644 --- a/src/Umbraco.Core/Components/AuditEventsComposer.cs +++ b/src/Umbraco.Core/Compose/AuditEventsComposer.cs @@ -1,4 +1,6 @@ -namespace Umbraco.Core.Components +using Umbraco.Core.Composing; + +namespace Umbraco.Core.Compose { public sealed class AuditEventsComposer : ComponentComposer, ICoreComposer { } diff --git a/src/Umbraco.Core/Components/CompositionExtensions.cs b/src/Umbraco.Core/Compose/CompositionExtensions.cs similarity index 99% rename from src/Umbraco.Core/Components/CompositionExtensions.cs rename to src/Umbraco.Core/Compose/CompositionExtensions.cs index 96d7e7d5c7..4767797dc1 100644 --- a/src/Umbraco.Core/Components/CompositionExtensions.cs +++ b/src/Umbraco.Core/Compose/CompositionExtensions.cs @@ -1,18 +1,17 @@ using System; using Umbraco.Core.Cache; -using Umbraco.Core.Dictionary; using Umbraco.Core.Composing; +using Umbraco.Core.Dictionary; using Umbraco.Core.IO; -using Umbraco.Core.Migrations; +using Umbraco.Core.Logging.Viewer; using Umbraco.Core.Models.PublishedContent; +using Umbraco.Core.PackageActions; using Umbraco.Core.Persistence.Mappers; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Strings; using Umbraco.Core.Sync; -using Umbraco.Core.Logging.Viewer; -using Umbraco.Core.PackageActions; -namespace Umbraco.Core.Components +namespace Umbraco.Core.Compose { /// /// Provides extension methods to the class. diff --git a/src/Umbraco.Core/Components/ManifestWatcherComponent.cs b/src/Umbraco.Core/Compose/ManifestWatcherComponent.cs similarity index 95% rename from src/Umbraco.Core/Components/ManifestWatcherComponent.cs rename to src/Umbraco.Core/Compose/ManifestWatcherComponent.cs index 2420e1d5bb..4821a1dd94 100644 --- a/src/Umbraco.Core/Components/ManifestWatcherComponent.cs +++ b/src/Umbraco.Core/Compose/ManifestWatcherComponent.cs @@ -1,9 +1,10 @@ using System.IO; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.Manifest; -namespace Umbraco.Core.Components +namespace Umbraco.Core.Compose { public sealed class ManifestWatcherComponent : IComponent { diff --git a/src/Umbraco.Core/Components/ManifestWatcherComposer.cs b/src/Umbraco.Core/Compose/ManifestWatcherComposer.cs similarity index 71% rename from src/Umbraco.Core/Components/ManifestWatcherComposer.cs rename to src/Umbraco.Core/Compose/ManifestWatcherComposer.cs index b08680156b..fb37e3dc25 100644 --- a/src/Umbraco.Core/Components/ManifestWatcherComposer.cs +++ b/src/Umbraco.Core/Compose/ManifestWatcherComposer.cs @@ -1,4 +1,6 @@ -namespace Umbraco.Core.Components +using Umbraco.Core.Composing; + +namespace Umbraco.Core.Compose { [RuntimeLevel(MinLevel = RuntimeLevel.Run)] public class ManifestWatcherComposer : ComponentComposer, ICoreComposer diff --git a/src/Umbraco.Core/Components/RelateOnCopyComponent.cs b/src/Umbraco.Core/Compose/RelateOnCopyComponent.cs similarity index 98% rename from src/Umbraco.Core/Components/RelateOnCopyComponent.cs rename to src/Umbraco.Core/Compose/RelateOnCopyComponent.cs index d38406f970..63a7e170da 100644 --- a/src/Umbraco.Core/Components/RelateOnCopyComponent.cs +++ b/src/Umbraco.Core/Compose/RelateOnCopyComponent.cs @@ -3,7 +3,7 @@ using Umbraco.Core.Models; using Umbraco.Core.Services; using Umbraco.Core.Services.Implement; -namespace Umbraco.Core.Components +namespace Umbraco.Core.Compose { // TODO: This should just exist in the content service/repo! public sealed class RelateOnCopyComponent : IComponent diff --git a/src/Umbraco.Core/Components/RelateOnCopyComposer.cs b/src/Umbraco.Core/Compose/RelateOnCopyComposer.cs similarity index 71% rename from src/Umbraco.Core/Components/RelateOnCopyComposer.cs rename to src/Umbraco.Core/Compose/RelateOnCopyComposer.cs index f5e9423edd..3c65b291c6 100644 --- a/src/Umbraco.Core/Components/RelateOnCopyComposer.cs +++ b/src/Umbraco.Core/Compose/RelateOnCopyComposer.cs @@ -1,4 +1,6 @@ -namespace Umbraco.Core.Components +using Umbraco.Core.Composing; + +namespace Umbraco.Core.Compose { [RuntimeLevel(MinLevel = RuntimeLevel.Run)] public sealed class RelateOnCopyComposer : ComponentComposer, ICoreComposer diff --git a/src/Umbraco.Core/Components/RelateOnTrashComponent.cs b/src/Umbraco.Core/Compose/RelateOnTrashComponent.cs similarity index 99% rename from src/Umbraco.Core/Components/RelateOnTrashComponent.cs rename to src/Umbraco.Core/Compose/RelateOnTrashComponent.cs index 6279bb98ba..501907a6e7 100644 --- a/src/Umbraco.Core/Components/RelateOnTrashComponent.cs +++ b/src/Umbraco.Core/Compose/RelateOnTrashComponent.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models; using Umbraco.Core.Services; using Umbraco.Core.Services.Implement; -namespace Umbraco.Core.Components +namespace Umbraco.Core.Compose { public sealed class RelateOnTrashComponent : IComponent { diff --git a/src/Umbraco.Core/Components/RelateOnTrashComposer.cs b/src/Umbraco.Core/Compose/RelateOnTrashComposer.cs similarity index 71% rename from src/Umbraco.Core/Components/RelateOnTrashComposer.cs rename to src/Umbraco.Core/Compose/RelateOnTrashComposer.cs index 5d89bc0e37..d0e90fba33 100644 --- a/src/Umbraco.Core/Components/RelateOnTrashComposer.cs +++ b/src/Umbraco.Core/Compose/RelateOnTrashComposer.cs @@ -1,4 +1,6 @@ -namespace Umbraco.Core.Components +using Umbraco.Core.Composing; + +namespace Umbraco.Core.Compose { [RuntimeLevel(MinLevel = RuntimeLevel.Run)] public sealed class RelateOnTrashComposer : ComponentComposer, ICoreComposer diff --git a/src/Umbraco.Core/Components/ComponentCollection.cs b/src/Umbraco.Core/Composing/ComponentCollection.cs similarity index 96% rename from src/Umbraco.Core/Components/ComponentCollection.cs rename to src/Umbraco.Core/Composing/ComponentCollection.cs index 4fa81b9760..52d3fa43b9 100644 --- a/src/Umbraco.Core/Components/ComponentCollection.cs +++ b/src/Umbraco.Core/Composing/ComponentCollection.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; using System.Linq; -using Umbraco.Core.Composing; using Umbraco.Core.Logging; -namespace Umbraco.Core.Components +namespace Umbraco.Core.Composing { /// /// Represents the collection of implementations. diff --git a/src/Umbraco.Core/Components/ComponentCollectionBuilder.cs b/src/Umbraco.Core/Composing/ComponentCollectionBuilder.cs similarity index 95% rename from src/Umbraco.Core/Components/ComponentCollectionBuilder.cs rename to src/Umbraco.Core/Composing/ComponentCollectionBuilder.cs index 584de7a8f2..59a272125e 100644 --- a/src/Umbraco.Core/Components/ComponentCollectionBuilder.cs +++ b/src/Umbraco.Core/Composing/ComponentCollectionBuilder.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; -using Umbraco.Core.Composing; using Umbraco.Core.Logging; -namespace Umbraco.Core.Components +namespace Umbraco.Core.Composing { /// /// Builds a . diff --git a/src/Umbraco.Core/Components/ComponentComposer.cs b/src/Umbraco.Core/Composing/ComponentComposer.cs similarity index 91% rename from src/Umbraco.Core/Components/ComponentComposer.cs rename to src/Umbraco.Core/Composing/ComponentComposer.cs index 792790c42f..b93ec49a89 100644 --- a/src/Umbraco.Core/Components/ComponentComposer.cs +++ b/src/Umbraco.Core/Composing/ComponentComposer.cs @@ -1,4 +1,6 @@ -namespace Umbraco.Core.Components +using Umbraco.Core.Compose; + +namespace Umbraco.Core.Composing { /// /// Provides a base class for composers which compose a component. diff --git a/src/Umbraco.Core/Components/ComposeAfterAttribute.cs b/src/Umbraco.Core/Composing/ComposeAfterAttribute.cs similarity index 98% rename from src/Umbraco.Core/Components/ComposeAfterAttribute.cs rename to src/Umbraco.Core/Composing/ComposeAfterAttribute.cs index a8fdfaa92b..95c39c7094 100644 --- a/src/Umbraco.Core/Components/ComposeAfterAttribute.cs +++ b/src/Umbraco.Core/Composing/ComposeAfterAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Umbraco.Core.Components +namespace Umbraco.Core.Composing { /// /// Indicates that a composer requires another composer. diff --git a/src/Umbraco.Core/Components/ComposeBeforeAttribute.cs b/src/Umbraco.Core/Composing/ComposeBeforeAttribute.cs similarity index 98% rename from src/Umbraco.Core/Components/ComposeBeforeAttribute.cs rename to src/Umbraco.Core/Composing/ComposeBeforeAttribute.cs index 17065d1676..f88445b0e7 100644 --- a/src/Umbraco.Core/Components/ComposeBeforeAttribute.cs +++ b/src/Umbraco.Core/Composing/ComposeBeforeAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Umbraco.Core.Components +namespace Umbraco.Core.Composing { /// /// Indicates that a component is required by another composer. diff --git a/src/Umbraco.Core/Components/Composers.cs b/src/Umbraco.Core/Composing/Composers.cs similarity index 99% rename from src/Umbraco.Core/Components/Composers.cs rename to src/Umbraco.Core/Composing/Composers.cs index 4bbbdf26b0..14cb0dce8e 100644 --- a/src/Umbraco.Core/Components/Composers.cs +++ b/src/Umbraco.Core/Composing/Composers.cs @@ -6,7 +6,7 @@ using System.Text; using Umbraco.Core.Collections; using Umbraco.Core.Logging; -namespace Umbraco.Core.Components +namespace Umbraco.Core.Composing { // note: this class is NOT thread-safe in any ways diff --git a/src/Umbraco.Core/Components/Composition.cs b/src/Umbraco.Core/Composing/Composition.cs similarity index 99% rename from src/Umbraco.Core/Components/Composition.cs rename to src/Umbraco.Core/Composing/Composition.cs index 6df86d793f..d7686ccd07 100644 --- a/src/Umbraco.Core/Components/Composition.cs +++ b/src/Umbraco.Core/Composing/Composition.cs @@ -1,10 +1,9 @@ using System; using System.Collections.Generic; -using Umbraco.Core.Composing; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; -namespace Umbraco.Core.Components +namespace Umbraco.Core.Composing { /// /// Represents a composition. diff --git a/src/Umbraco.Core/Composing/Composers/ConfigurationComposer.cs b/src/Umbraco.Core/Composing/CompositionExtensions/Configuration.cs similarity index 75% rename from src/Umbraco.Core/Composing/Composers/ConfigurationComposer.cs rename to src/Umbraco.Core/Composing/CompositionExtensions/Configuration.cs index 7fba47a2cd..78475953b7 100644 --- a/src/Umbraco.Core/Composing/Composers/ConfigurationComposer.cs +++ b/src/Umbraco.Core/Composing/CompositionExtensions/Configuration.cs @@ -1,13 +1,11 @@ -using Umbraco.Core.Components; -using Umbraco.Core.Configuration; -using Umbraco.Core.Configuration.UmbracoSettings; +using Umbraco.Core.Configuration.UmbracoSettings; -namespace Umbraco.Core.Composing.Composers +namespace Umbraco.Core.Composing.CompositionExtensions { /// /// Compose configurations. /// - public static class ConfigurationComposer + public static class Configuration { public static Composition ComposeConfiguration(this Composition composition) { diff --git a/src/Umbraco.Core/Composing/Composers/CoreMappingProfilesComposer.cs b/src/Umbraco.Core/Composing/CompositionExtensions/CoreMappingProfiles.cs similarity index 69% rename from src/Umbraco.Core/Composing/Composers/CoreMappingProfilesComposer.cs rename to src/Umbraco.Core/Composing/CompositionExtensions/CoreMappingProfiles.cs index 0274b8f1a9..ed875ec973 100644 --- a/src/Umbraco.Core/Composing/Composers/CoreMappingProfilesComposer.cs +++ b/src/Umbraco.Core/Composing/CompositionExtensions/CoreMappingProfiles.cs @@ -1,11 +1,10 @@ using AutoMapper; -using Umbraco.Core.Components; using Umbraco.Core.Models.Identity; -namespace Umbraco.Core.Composing.Composers +namespace Umbraco.Core.Composing.CompositionExtensions { - public static class CoreMappingProfilesComposer + public static class CoreMappingProfiles { public static Composition ComposeCoreMappingProfiles(this Composition composition) { diff --git a/src/Umbraco.Core/Composing/Composers/FileSystemsComposer.cs b/src/Umbraco.Core/Composing/CompositionExtensions/FileSystems.cs similarity index 95% rename from src/Umbraco.Core/Composing/Composers/FileSystemsComposer.cs rename to src/Umbraco.Core/Composing/CompositionExtensions/FileSystems.cs index 4c598f27e4..76b363f80e 100644 --- a/src/Umbraco.Core/Composing/Composers/FileSystemsComposer.cs +++ b/src/Umbraco.Core/Composing/CompositionExtensions/FileSystems.cs @@ -1,10 +1,10 @@ -using Umbraco.Core.Components; +using Umbraco.Core.Compose; using Umbraco.Core.IO; using Umbraco.Core.IO.MediaPathSchemes; -namespace Umbraco.Core.Composing.Composers +namespace Umbraco.Core.Composing.CompositionExtensions { - public static class FileSystemsComposer + public static class FileSystems { /* * HOW TO REPLACE THE MEDIA UNDERLYING FILESYSTEM @@ -73,10 +73,10 @@ namespace Umbraco.Core.Composing.Composers // it needs to be registered (not only the interface) because it provides additional // functionality eg for scoping, and is injected in the scope provider - whereas the // interface is really for end-users to get access to filesystems. - composition.RegisterUnique(factory => factory.CreateInstance(factory)); + composition.RegisterUnique(factory => factory.CreateInstance(factory)); // register IFileSystems, which gives access too all filesystems - composition.RegisterUnique(factory => factory.GetInstance()); + composition.RegisterUnique(factory => factory.GetInstance()); // register the scheme for media paths composition.RegisterUnique(); diff --git a/src/Umbraco.Core/Composing/Composers/RepositoriesComposer.cs b/src/Umbraco.Core/Composing/CompositionExtensions/Repositories.cs similarity index 95% rename from src/Umbraco.Core/Composing/Composers/RepositoriesComposer.cs rename to src/Umbraco.Core/Composing/CompositionExtensions/Repositories.cs index 62b92081c1..03f13f96cb 100644 --- a/src/Umbraco.Core/Composing/Composers/RepositoriesComposer.cs +++ b/src/Umbraco.Core/Composing/CompositionExtensions/Repositories.cs @@ -1,13 +1,12 @@ -using Umbraco.Core.Components; -using Umbraco.Core.Persistence.Repositories; +using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.Repositories.Implement; -namespace Umbraco.Core.Composing.Composers +namespace Umbraco.Core.Composing.CompositionExtensions { /// /// Composes repositories. /// - public static class RepositoriesComposer + public static class Repositories { public static Composition ComposeRepositories(this Composition composition) { diff --git a/src/Umbraco.Core/Composing/Composers/ServicesComposer.cs b/src/Umbraco.Core/Composing/CompositionExtensions/Services.cs similarity index 98% rename from src/Umbraco.Core/Composing/Composers/ServicesComposer.cs rename to src/Umbraco.Core/Composing/CompositionExtensions/Services.cs index 1e10585b8e..ead2524d80 100644 --- a/src/Umbraco.Core/Composing/Composers/ServicesComposer.cs +++ b/src/Umbraco.Core/Composing/CompositionExtensions/Services.cs @@ -2,7 +2,6 @@ using System.IO; using System.Linq; using Umbraco.Core.Cache; -using Umbraco.Core.Components; using Umbraco.Core.Events; using Umbraco.Core.IO; using Umbraco.Core.Logging; @@ -10,9 +9,9 @@ using Umbraco.Core.Packaging; using Umbraco.Core.Services; using Umbraco.Core.Services.Implement; -namespace Umbraco.Core.Composing.Composers +namespace Umbraco.Core.Composing.CompositionExtensions { - public static class ServicesComposer + public static class Services { public static Composition ComposeServices(this Composition composition) { diff --git a/src/Umbraco.Core/Components/DisableAttribute.cs b/src/Umbraco.Core/Composing/DisableAttribute.cs similarity index 97% rename from src/Umbraco.Core/Components/DisableAttribute.cs rename to src/Umbraco.Core/Composing/DisableAttribute.cs index 608967d6ae..c2a419f8bc 100644 --- a/src/Umbraco.Core/Components/DisableAttribute.cs +++ b/src/Umbraco.Core/Composing/DisableAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Umbraco.Core.Components +namespace Umbraco.Core.Composing { /// /// Indicates that a composer should be disabled. diff --git a/src/Umbraco.Core/Components/DisableComposerAttribute.cs b/src/Umbraco.Core/Composing/DisableComposerAttribute.cs similarity index 96% rename from src/Umbraco.Core/Components/DisableComposerAttribute.cs rename to src/Umbraco.Core/Composing/DisableComposerAttribute.cs index 9d90a099df..7adc5673ec 100644 --- a/src/Umbraco.Core/Components/DisableComposerAttribute.cs +++ b/src/Umbraco.Core/Composing/DisableComposerAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Umbraco.Core.Components +namespace Umbraco.Core.Composing { /// /// Indicates that a composer should be disabled. diff --git a/src/Umbraco.Core/Components/EnableAttribute.cs b/src/Umbraco.Core/Composing/EnableAttribute.cs similarity index 97% rename from src/Umbraco.Core/Components/EnableAttribute.cs rename to src/Umbraco.Core/Composing/EnableAttribute.cs index 2176a4ec23..276a04cbec 100644 --- a/src/Umbraco.Core/Components/EnableAttribute.cs +++ b/src/Umbraco.Core/Composing/EnableAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Umbraco.Core.Components +namespace Umbraco.Core.Composing { /// /// Indicates that a composer should be enabled. diff --git a/src/Umbraco.Core/Components/EnableComposerAttribute.cs b/src/Umbraco.Core/Composing/EnableComposerAttribute.cs similarity index 97% rename from src/Umbraco.Core/Components/EnableComposerAttribute.cs rename to src/Umbraco.Core/Composing/EnableComposerAttribute.cs index fe57700145..a1bc0a8123 100644 --- a/src/Umbraco.Core/Components/EnableComposerAttribute.cs +++ b/src/Umbraco.Core/Composing/EnableComposerAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Umbraco.Core.Components +namespace Umbraco.Core.Composing { /// /// Indicates that a composer should be enabled. diff --git a/src/Umbraco.Core/Components/IComponent.cs b/src/Umbraco.Core/Composing/IComponent.cs similarity index 95% rename from src/Umbraco.Core/Components/IComponent.cs rename to src/Umbraco.Core/Composing/IComponent.cs index b1954d821b..dcd0365b12 100644 --- a/src/Umbraco.Core/Components/IComponent.cs +++ b/src/Umbraco.Core/Composing/IComponent.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Components +namespace Umbraco.Core.Composing { /// /// Represents a component. diff --git a/src/Umbraco.Core/Components/IComposer.cs b/src/Umbraco.Core/Composing/IComposer.cs similarity index 81% rename from src/Umbraco.Core/Components/IComposer.cs rename to src/Umbraco.Core/Composing/IComposer.cs index ce02aa4f13..a7a159d697 100644 --- a/src/Umbraco.Core/Components/IComposer.cs +++ b/src/Umbraco.Core/Composing/IComposer.cs @@ -1,6 +1,4 @@ -using Umbraco.Core.Composing; - -namespace Umbraco.Core.Components +namespace Umbraco.Core.Composing { /// /// Represents a composer. diff --git a/src/Umbraco.Core/Components/ICoreComposer.cs b/src/Umbraco.Core/Composing/ICoreComposer.cs similarity index 91% rename from src/Umbraco.Core/Components/ICoreComposer.cs rename to src/Umbraco.Core/Composing/ICoreComposer.cs index 94aa9953a9..ff09f41f6b 100644 --- a/src/Umbraco.Core/Components/ICoreComposer.cs +++ b/src/Umbraco.Core/Composing/ICoreComposer.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Components +namespace Umbraco.Core.Composing { /// /// Represents a core . diff --git a/src/Umbraco.Core/Components/IRuntimeComposer.cs b/src/Umbraco.Core/Composing/IRuntimeComposer.cs similarity index 88% rename from src/Umbraco.Core/Components/IRuntimeComposer.cs rename to src/Umbraco.Core/Composing/IRuntimeComposer.cs index 4b8253ee6c..2a352dc783 100644 --- a/src/Umbraco.Core/Components/IRuntimeComposer.cs +++ b/src/Umbraco.Core/Composing/IRuntimeComposer.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Components +namespace Umbraco.Core.Composing { /// /// Represents a runtime . diff --git a/src/Umbraco.Core/Components/IUserComposer.cs b/src/Umbraco.Core/Composing/IUserComposer.cs similarity index 89% rename from src/Umbraco.Core/Components/IUserComposer.cs rename to src/Umbraco.Core/Composing/IUserComposer.cs index 59e0023635..136e69a469 100644 --- a/src/Umbraco.Core/Components/IUserComposer.cs +++ b/src/Umbraco.Core/Composing/IUserComposer.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Components +namespace Umbraco.Core.Composing { /// /// Represents a user . diff --git a/src/Umbraco.Core/Components/RuntimeLevelAttribute.cs b/src/Umbraco.Core/Composing/RuntimeLevelAttribute.cs similarity index 92% rename from src/Umbraco.Core/Components/RuntimeLevelAttribute.cs rename to src/Umbraco.Core/Composing/RuntimeLevelAttribute.cs index 2c698a671a..5de90ee8e8 100644 --- a/src/Umbraco.Core/Components/RuntimeLevelAttribute.cs +++ b/src/Umbraco.Core/Composing/RuntimeLevelAttribute.cs @@ -1,7 +1,6 @@ using System; -using Umbraco.Core.Composing; -namespace Umbraco.Core.Components +namespace Umbraco.Core.Composing { /// /// Marks a composer to indicate a minimum and/or maximum runtime level for which the composer would compose. diff --git a/src/Umbraco.Core/Composing/CompositionExtensions.cs b/src/Umbraco.Core/CompositionExtensions.cs similarity index 97% rename from src/Umbraco.Core/Composing/CompositionExtensions.cs rename to src/Umbraco.Core/CompositionExtensions.cs index c312259b82..46e8111237 100644 --- a/src/Umbraco.Core/Composing/CompositionExtensions.cs +++ b/src/Umbraco.Core/CompositionExtensions.cs @@ -1,9 +1,9 @@ using Umbraco.Core.Cache; -using Umbraco.Core.Components; +using Umbraco.Core.Composing; using Umbraco.Core.Logging; using Umbraco.Core.Persistence; -namespace Umbraco.Core.Composing +namespace Umbraco.Core { /// /// Provides extension methods to the class. diff --git a/src/Umbraco.Core/Composing/FactoryExtensions.cs b/src/Umbraco.Core/FactoryExtensions.cs similarity index 98% rename from src/Umbraco.Core/Composing/FactoryExtensions.cs rename to src/Umbraco.Core/FactoryExtensions.cs index 8027f2c7a1..8514525417 100644 --- a/src/Umbraco.Core/Composing/FactoryExtensions.cs +++ b/src/Umbraco.Core/FactoryExtensions.cs @@ -1,8 +1,9 @@ using System; using System.Linq; using System.Reflection; +using Umbraco.Core.Composing; -namespace Umbraco.Core.Composing +namespace Umbraco.Core { /// /// Provides extension methods to the class. diff --git a/src/Umbraco.Core/Logging/Viewer/LogViewerComposer.cs b/src/Umbraco.Core/Logging/Viewer/LogViewerComposer.cs index 5ddcb01078..651e3de06e 100644 --- a/src/Umbraco.Core/Logging/Viewer/LogViewerComposer.cs +++ b/src/Umbraco.Core/Logging/Viewer/LogViewerComposer.cs @@ -1,4 +1,5 @@ -using Umbraco.Core.Components; +using Umbraco.Core.Compose; +using Umbraco.Core.Composing; namespace Umbraco.Core.Logging.Viewer { diff --git a/src/Umbraco.Core/Composing/RegisterExtensions.cs b/src/Umbraco.Core/RegisterExtensions.cs similarity index 96% rename from src/Umbraco.Core/Composing/RegisterExtensions.cs rename to src/Umbraco.Core/RegisterExtensions.cs index d1eacc0c0f..69e092878e 100644 --- a/src/Umbraco.Core/Composing/RegisterExtensions.cs +++ b/src/Umbraco.Core/RegisterExtensions.cs @@ -1,4 +1,6 @@ -namespace Umbraco.Core.Composing +using Umbraco.Core.Composing; + +namespace Umbraco.Core { /// /// Provides extension methods to the class. diff --git a/src/Umbraco.Core/Runtime/CoreRuntime.cs b/src/Umbraco.Core/Runtime/CoreRuntime.cs index da71cb1061..813c2e6a18 100644 --- a/src/Umbraco.Core/Runtime/CoreRuntime.cs +++ b/src/Umbraco.Core/Runtime/CoreRuntime.cs @@ -6,7 +6,6 @@ using System.Reflection; using System.Threading; using System.Web; using Umbraco.Core.Cache; -using Umbraco.Core.Components; using Umbraco.Core.Composing; using Umbraco.Core.Configuration; using Umbraco.Core.Exceptions; diff --git a/src/Umbraco.Core/Runtime/CoreRuntimeComponent.cs b/src/Umbraco.Core/Runtime/CoreRuntimeComponent.cs index b9efdd6432..e9842a1ba1 100644 --- a/src/Umbraco.Core/Runtime/CoreRuntimeComponent.cs +++ b/src/Umbraco.Core/Runtime/CoreRuntimeComponent.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using AutoMapper; -using Umbraco.Core.Components; +using Umbraco.Core.Composing; using Umbraco.Core.IO; namespace Umbraco.Core.Runtime diff --git a/src/Umbraco.Core/Runtime/CoreRuntimeComposer.cs b/src/Umbraco.Core/Runtime/CoreRuntimeComposer.cs index b4faddb5d0..690ac4d56c 100644 --- a/src/Umbraco.Core/Runtime/CoreRuntimeComposer.cs +++ b/src/Umbraco.Core/Runtime/CoreRuntimeComposer.cs @@ -1,9 +1,8 @@ using System; using System.Configuration; using Umbraco.Core.Cache; -using Umbraco.Core.Components; using Umbraco.Core.Composing; -using Umbraco.Core.Composing.Composers; +using Umbraco.Core.Composing.CompositionExtensions; using Umbraco.Core.Configuration; using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.Logging; diff --git a/src/Umbraco.Core/RuntimeOptions.cs b/src/Umbraco.Core/RuntimeOptions.cs index 1f89ee6314..c0bae23446 100644 --- a/src/Umbraco.Core/RuntimeOptions.cs +++ b/src/Umbraco.Core/RuntimeOptions.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Configuration; using System.Runtime.CompilerServices; using Umbraco.Core.Cache; -using Umbraco.Core.Components; using Umbraco.Core.Composing; using Umbraco.Core.Logging; using Umbraco.Core.Persistence; diff --git a/src/Umbraco.Core/Composing/TypeLoaderExtensions.cs b/src/Umbraco.Core/TypeLoaderExtensions.cs similarity index 93% rename from src/Umbraco.Core/Composing/TypeLoaderExtensions.cs rename to src/Umbraco.Core/TypeLoaderExtensions.cs index 5d17b0f53c..96028daca6 100644 --- a/src/Umbraco.Core/Composing/TypeLoaderExtensions.cs +++ b/src/Umbraco.Core/TypeLoaderExtensions.cs @@ -1,13 +1,12 @@ using System; using System.Collections.Generic; -using System.Linq; using Umbraco.Core.Cache; +using Umbraco.Core.Composing; using Umbraco.Core.PackageActions; using Umbraco.Core.Persistence.Mappers; -using Umbraco.Core.Persistence.SqlSyntax; using Umbraco.Core.PropertyEditors; -namespace Umbraco.Core.Composing +namespace Umbraco.Core { internal static class TypeLoaderExtensions { diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 08a2c552cb..7f50d6249b 100755 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -112,7 +112,7 @@ - + @@ -157,37 +157,37 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + @@ -205,7 +205,7 @@ - + @@ -290,7 +290,7 @@ - + @@ -1446,9 +1446,9 @@ - - - + + + diff --git a/src/Umbraco.Tests/Cache/DistributedCache/DistributedCacheTests.cs b/src/Umbraco.Tests/Cache/DistributedCache/DistributedCacheTests.cs index 68b666632c..650cc64720 100644 --- a/src/Umbraco.Tests/Cache/DistributedCache/DistributedCacheTests.cs +++ b/src/Umbraco.Tests/Cache/DistributedCache/DistributedCacheTests.cs @@ -5,7 +5,6 @@ using Moq; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Cache; -using Umbraco.Core.Components; using Umbraco.Core.Composing; using Umbraco.Core.Logging; using Umbraco.Core.Sync; diff --git a/src/Umbraco.Tests/Cache/DistributedCacheBinderTests.cs b/src/Umbraco.Tests/Cache/DistributedCacheBinderTests.cs index e9448bd0fc..014c6b0af5 100644 --- a/src/Umbraco.Tests/Cache/DistributedCacheBinderTests.cs +++ b/src/Umbraco.Tests/Cache/DistributedCacheBinderTests.cs @@ -3,7 +3,6 @@ using System.Linq; using System.Threading; using Moq; using NUnit.Framework; -using Umbraco.Core.Components; using Umbraco.Core.Composing; using Umbraco.Core.Events; using Umbraco.Core.Models; diff --git a/src/Umbraco.Tests/Cache/PublishedCache/PublishedContentCacheTests.cs b/src/Umbraco.Tests/Cache/PublishedCache/PublishedContentCacheTests.cs index 87ec4215ac..2a6739df38 100644 --- a/src/Umbraco.Tests/Cache/PublishedCache/PublishedContentCacheTests.cs +++ b/src/Umbraco.Tests/Cache/PublishedCache/PublishedContentCacheTests.cs @@ -2,6 +2,7 @@ using System.Xml; using Moq; using NUnit.Framework; +using Umbraco.Core; using Umbraco.Core.Cache; using Umbraco.Core.Composing; using Umbraco.Core.Configuration; diff --git a/src/Umbraco.Tests/Components/ComponentTests.cs b/src/Umbraco.Tests/Components/ComponentTests.cs index b35813ce99..30cdae4b9d 100644 --- a/src/Umbraco.Tests/Components/ComponentTests.cs +++ b/src/Umbraco.Tests/Components/ComponentTests.cs @@ -4,7 +4,7 @@ using System.Linq; using Moq; using NUnit.Framework; using Umbraco.Core; -using Umbraco.Core.Components; +using Umbraco.Core.Compose; using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; diff --git a/src/Umbraco.Tests/Composing/CollectionBuildersTests.cs b/src/Umbraco.Tests/Composing/CollectionBuildersTests.cs index 07699f77ed..ec757e09f0 100644 --- a/src/Umbraco.Tests/Composing/CollectionBuildersTests.cs +++ b/src/Umbraco.Tests/Composing/CollectionBuildersTests.cs @@ -5,7 +5,6 @@ using Moq; using NUnit.Framework; using Umbraco.Core.Composing; using Umbraco.Core; -using Umbraco.Core.Components; using Umbraco.Core.Logging; using Umbraco.Tests.Components; diff --git a/src/Umbraco.Tests/Composing/ContainerConformingTests.cs b/src/Umbraco.Tests/Composing/ContainerConformingTests.cs index 86226b82e7..f5c1ff9bc7 100644 --- a/src/Umbraco.Tests/Composing/ContainerConformingTests.cs +++ b/src/Umbraco.Tests/Composing/ContainerConformingTests.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using NUnit.Framework; +using Umbraco.Core; using Umbraco.Core.Composing; namespace Umbraco.Tests.Composing diff --git a/src/Umbraco.Tests/Composing/LazyCollectionBuilderTests.cs b/src/Umbraco.Tests/Composing/LazyCollectionBuilderTests.cs index cbabae1a83..3996eba89f 100644 --- a/src/Umbraco.Tests/Composing/LazyCollectionBuilderTests.cs +++ b/src/Umbraco.Tests/Composing/LazyCollectionBuilderTests.cs @@ -5,7 +5,6 @@ using Moq; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Cache; -using Umbraco.Core.Components; using Umbraco.Core.Composing; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; diff --git a/src/Umbraco.Tests/Composing/PackageActionCollectionTests.cs b/src/Umbraco.Tests/Composing/PackageActionCollectionTests.cs index fe8ca7dadc..07db4be3d3 100644 --- a/src/Umbraco.Tests/Composing/PackageActionCollectionTests.cs +++ b/src/Umbraco.Tests/Composing/PackageActionCollectionTests.cs @@ -5,7 +5,6 @@ using System.Xml.Linq; using Moq; using NUnit.Framework; using Umbraco.Core; -using Umbraco.Core.Components; using Umbraco.Core.Composing; using Umbraco.Core.Logging; using Umbraco.Core.PackageActions; diff --git a/src/Umbraco.Tests/IO/FileSystemsTests.cs b/src/Umbraco.Tests/IO/FileSystemsTests.cs index 1f98fd4443..8c70de883f 100644 --- a/src/Umbraco.Tests/IO/FileSystemsTests.cs +++ b/src/Umbraco.Tests/IO/FileSystemsTests.cs @@ -4,16 +4,16 @@ using System.Text; using Moq; using NUnit.Framework; using Umbraco.Core; -using Umbraco.Core.Components; using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.Composing; -using Umbraco.Core.Composing.Composers; using Umbraco.Core.IO; using Umbraco.Core.IO.MediaPathSchemes; using Umbraco.Core.Logging; using Umbraco.Core.Services; using Umbraco.Tests.Components; using Umbraco.Tests.TestHelpers; +using Umbraco.Core.Composing.CompositionExtensions; +using FileSystems = Umbraco.Core.IO.FileSystems; namespace Umbraco.Tests.IO { diff --git a/src/Umbraco.Tests/Models/ContentExtensionsTests.cs b/src/Umbraco.Tests/Models/ContentExtensionsTests.cs index efa464a46c..42d7f0e01b 100644 --- a/src/Umbraco.Tests/Models/ContentExtensionsTests.cs +++ b/src/Umbraco.Tests/Models/ContentExtensionsTests.cs @@ -3,8 +3,7 @@ using System.Linq; using Moq; using NUnit.Framework; using Umbraco.Core; -using Umbraco.Core.Composing; -using Umbraco.Core.Composing.Composers; +using Umbraco.Core.Composing.CompositionExtensions; using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.Logging; using Umbraco.Core.Models; diff --git a/src/Umbraco.Tests/Models/ContentTests.cs b/src/Umbraco.Tests/Models/ContentTests.cs index 693f919b7a..05f726893e 100644 --- a/src/Umbraco.Tests/Models/ContentTests.cs +++ b/src/Umbraco.Tests/Models/ContentTests.cs @@ -8,8 +8,7 @@ using Moq; using Umbraco.Core; using NUnit.Framework; using Umbraco.Core.Cache; -using Umbraco.Core.Composing; -using Umbraco.Core.Composing.Composers; +using Umbraco.Core.Composing.CompositionExtensions; using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.Logging; using Umbraco.Core.Models; diff --git a/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs b/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs index 1817414f69..7ebdfabbb0 100644 --- a/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs +++ b/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs @@ -4,8 +4,7 @@ using AutoMapper; using Moq; using NUnit.Framework; using Umbraco.Core; -using Umbraco.Core.Composing; -using Umbraco.Core.Composing.Composers; +using Umbraco.Core.Composing.CompositionExtensions; using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.Services; using Umbraco.Core.Dictionary; diff --git a/src/Umbraco.Tests/Packaging/PackageDataInstallationTests.cs b/src/Umbraco.Tests/Packaging/PackageDataInstallationTests.cs index ba71caad95..51df7d1f2f 100644 --- a/src/Umbraco.Tests/Packaging/PackageDataInstallationTests.cs +++ b/src/Umbraco.Tests/Packaging/PackageDataInstallationTests.cs @@ -5,7 +5,6 @@ using System.Xml.Linq; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Composing; -using Umbraco.Core.Composing.Composers; using Umbraco.Core.Logging; using Umbraco.Core.Models; using Umbraco.Core.Models.Packaging; @@ -16,6 +15,7 @@ using Umbraco.Core.Services; using Umbraco.Tests.Services; using Umbraco.Tests.Services.Importing; using Umbraco.Tests.Testing; +using Umbraco.Core.Composing.CompositionExtensions; namespace Umbraco.Tests.Packaging { diff --git a/src/Umbraco.Tests/Packaging/PackageInstallationTest.cs b/src/Umbraco.Tests/Packaging/PackageInstallationTest.cs index 731ce73d3d..abf61370a8 100644 --- a/src/Umbraco.Tests/Packaging/PackageInstallationTest.cs +++ b/src/Umbraco.Tests/Packaging/PackageInstallationTest.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using Moq; using NUnit.Framework; +using Umbraco.Core; using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Models; diff --git a/src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs b/src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs index c55da764e2..8d2ab84d35 100644 --- a/src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs +++ b/src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs @@ -6,7 +6,6 @@ using NUnit.Framework; using Newtonsoft.Json.Linq; using Umbraco.Core; using Umbraco.Core.Cache; -using Umbraco.Core.Components; using Umbraco.Core.Composing; using Umbraco.Core.Configuration; using Umbraco.Core.Configuration.UmbracoSettings; diff --git a/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueEditorTests.cs b/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueEditorTests.cs index ea5fbcaa06..764f6ac4a4 100644 --- a/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueEditorTests.cs +++ b/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueEditorTests.cs @@ -3,7 +3,6 @@ using System.Threading; using Moq; using NUnit.Framework; using Umbraco.Core; -using Umbraco.Core.Components; using Umbraco.Core.Composing; using Umbraco.Core.Logging; using Umbraco.Core.Models; diff --git a/src/Umbraco.Tests/Published/ConvertersTests.cs b/src/Umbraco.Tests/Published/ConvertersTests.cs index eb0f1a9368..0fce8ebfc3 100644 --- a/src/Umbraco.Tests/Published/ConvertersTests.cs +++ b/src/Umbraco.Tests/Published/ConvertersTests.cs @@ -5,7 +5,6 @@ using Moq; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Cache; -using Umbraco.Core.Components; using Umbraco.Core.Composing; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentSnapshotTestBase.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentSnapshotTestBase.cs index e293653c37..7a9a882baa 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentSnapshotTestBase.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentSnapshotTestBase.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Web.Routing; using Moq; +using Umbraco.Core; using Umbraco.Core.Models.PublishedContent; using Umbraco.Web; using Umbraco.Web.PublishedCache; diff --git a/src/Umbraco.Tests/Routing/ContentFinderByUrlAndTemplateTests.cs b/src/Umbraco.Tests/Routing/ContentFinderByUrlAndTemplateTests.cs index c40b2e5876..5efd8668d5 100644 --- a/src/Umbraco.Tests/Routing/ContentFinderByUrlAndTemplateTests.cs +++ b/src/Umbraco.Tests/Routing/ContentFinderByUrlAndTemplateTests.cs @@ -1,5 +1,6 @@ using Moq; using NUnit.Framework; +using Umbraco.Core; using Umbraco.Core.Composing; using Umbraco.Core.Configuration; using Umbraco.Tests.TestHelpers; diff --git a/src/Umbraco.Tests/Routing/ContentFinderByUrlWithDomainsTests.cs b/src/Umbraco.Tests/Routing/ContentFinderByUrlWithDomainsTests.cs index dfbe9b0cda..ac2e62b1ef 100644 --- a/src/Umbraco.Tests/Routing/ContentFinderByUrlWithDomainsTests.cs +++ b/src/Umbraco.Tests/Routing/ContentFinderByUrlWithDomainsTests.cs @@ -1,5 +1,6 @@ using Moq; using NUnit.Framework; +using Umbraco.Core; using Umbraco.Core.Composing; using Umbraco.Core.Configuration; using Umbraco.Core.Models; diff --git a/src/Umbraco.Tests/Routing/UrlRoutesTests.cs b/src/Umbraco.Tests/Routing/UrlRoutesTests.cs index a794e226f1..2e944211ca 100644 --- a/src/Umbraco.Tests/Routing/UrlRoutesTests.cs +++ b/src/Umbraco.Tests/Routing/UrlRoutesTests.cs @@ -1,6 +1,7 @@ using System; using Moq; using NUnit.Framework; +using Umbraco.Core; using Umbraco.Core.Composing; using Umbraco.Core.Configuration; using Umbraco.Core.Models; diff --git a/src/Umbraco.Tests/Runtimes/CoreRuntimeTests.cs b/src/Umbraco.Tests/Runtimes/CoreRuntimeTests.cs index ee3bca42e9..5850153100 100644 --- a/src/Umbraco.Tests/Runtimes/CoreRuntimeTests.cs +++ b/src/Umbraco.Tests/Runtimes/CoreRuntimeTests.cs @@ -6,7 +6,7 @@ using Examine; using Moq; using NUnit.Framework; using Umbraco.Core; -using Umbraco.Core.Components; +using Umbraco.Core.Compose; using Umbraco.Core.Composing; using Umbraco.Core.Configuration; using Umbraco.Core.Events; diff --git a/src/Umbraco.Tests/Runtimes/StandaloneTests.cs b/src/Umbraco.Tests/Runtimes/StandaloneTests.cs index 49bc8149a9..995e1c75a9 100644 --- a/src/Umbraco.Tests/Runtimes/StandaloneTests.cs +++ b/src/Umbraco.Tests/Runtimes/StandaloneTests.cs @@ -11,7 +11,6 @@ using Moq; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Cache; -using Umbraco.Core.Components; using Umbraco.Core.Composing; using Umbraco.Core.Configuration; using Umbraco.Core.IO; diff --git a/src/Umbraco.Tests/Scoping/ScopeEventDispatcherTests.cs b/src/Umbraco.Tests/Scoping/ScopeEventDispatcherTests.cs index 4aa28b5975..001553a8ae 100644 --- a/src/Umbraco.Tests/Scoping/ScopeEventDispatcherTests.cs +++ b/src/Umbraco.Tests/Scoping/ScopeEventDispatcherTests.cs @@ -3,7 +3,6 @@ using System.Linq; using Moq; using NUnit.Framework; using Umbraco.Core; -using Umbraco.Core.Components; using Umbraco.Core.Events; using Umbraco.Core.Models; using Umbraco.Core.IO; diff --git a/src/Umbraco.Tests/Scoping/ScopeFileSystemsTests.cs b/src/Umbraco.Tests/Scoping/ScopeFileSystemsTests.cs index 0a23e4a1b9..b9d680780e 100644 --- a/src/Umbraco.Tests/Scoping/ScopeFileSystemsTests.cs +++ b/src/Umbraco.Tests/Scoping/ScopeFileSystemsTests.cs @@ -4,10 +4,11 @@ using System.Text; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Composing; -using Umbraco.Core.Composing.Composers; using Umbraco.Core.IO; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.Testing; +using Umbraco.Core.Composing.CompositionExtensions; +using FileSystems = Umbraco.Core.IO.FileSystems; namespace Umbraco.Tests.Scoping { diff --git a/src/Umbraco.Tests/Scoping/ScopedRepositoryTests.cs b/src/Umbraco.Tests/Scoping/ScopedRepositoryTests.cs index b85a79f326..9134e9f51b 100644 --- a/src/Umbraco.Tests/Scoping/ScopedRepositoryTests.cs +++ b/src/Umbraco.Tests/Scoping/ScopedRepositoryTests.cs @@ -11,6 +11,7 @@ using Umbraco.Tests.TestHelpers; using Umbraco.Tests.Testing; using Umbraco.Web.Cache; using Moq; +using Umbraco.Core; using Umbraco.Core.Events; using Umbraco.Core.Logging; using Umbraco.Core.Sync; diff --git a/src/Umbraco.Tests/Scoping/ScopedXmlTests.cs b/src/Umbraco.Tests/Scoping/ScopedXmlTests.cs index 1d07ec074f..ad8b8e19a6 100644 --- a/src/Umbraco.Tests/Scoping/ScopedXmlTests.cs +++ b/src/Umbraco.Tests/Scoping/ScopedXmlTests.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Xml; using Moq; using NUnit.Framework; +using Umbraco.Core; using Umbraco.Core.Cache; using Umbraco.Core.Composing; using Umbraco.Core.Configuration.UmbracoSettings; diff --git a/src/Umbraco.Tests/Services/EntityXmlSerializerTests.cs b/src/Umbraco.Tests/Services/EntityXmlSerializerTests.cs index 28c69344b7..972595f2f1 100644 --- a/src/Umbraco.Tests/Services/EntityXmlSerializerTests.cs +++ b/src/Umbraco.Tests/Services/EntityXmlSerializerTests.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using System.Linq; using System.Xml.Linq; using NUnit.Framework; +using Umbraco.Core; using Umbraco.Core.Composing; using Umbraco.Core.Models; using Umbraco.Core.Services; diff --git a/src/Umbraco.Tests/Services/SectionServiceTests.cs b/src/Umbraco.Tests/Services/SectionServiceTests.cs index d6bf26184b..cf0471a947 100644 --- a/src/Umbraco.Tests/Services/SectionServiceTests.cs +++ b/src/Umbraco.Tests/Services/SectionServiceTests.cs @@ -1,6 +1,7 @@ using NUnit.Framework; using System.Linq; using System.Threading; +using Umbraco.Core; using Umbraco.Core.Composing; using Umbraco.Core.Models.Membership; using Umbraco.Tests.Testing; diff --git a/src/Umbraco.Tests/TestHelpers/BaseUsingSqlCeSyntax.cs b/src/Umbraco.Tests/TestHelpers/BaseUsingSqlCeSyntax.cs index 35fcc853d4..2e1aadc9bb 100644 --- a/src/Umbraco.Tests/TestHelpers/BaseUsingSqlCeSyntax.cs +++ b/src/Umbraco.Tests/TestHelpers/BaseUsingSqlCeSyntax.cs @@ -3,7 +3,6 @@ using NPoco; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Cache; -using Umbraco.Core.Components; using Umbraco.Core.Logging; using Umbraco.Core.Persistence.Mappers; using Umbraco.Core.Persistence.SqlSyntax; diff --git a/src/Umbraco.Tests/Testing/UmbracoTestBase.cs b/src/Umbraco.Tests/Testing/UmbracoTestBase.cs index a868245940..dc41c64444 100644 --- a/src/Umbraco.Tests/Testing/UmbracoTestBase.cs +++ b/src/Umbraco.Tests/Testing/UmbracoTestBase.cs @@ -1,6 +1,5 @@ using System; using System.IO; -using System.Linq; using System.Reflection; using AutoMapper; using Examine; @@ -8,9 +7,7 @@ using Moq; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Cache; -using Umbraco.Core.Components; using Umbraco.Core.Composing; -using Umbraco.Core.Composing.Composers; using Umbraco.Core.Configuration; using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.Events; @@ -26,7 +23,6 @@ using Umbraco.Core.Persistence.Repositories.Implement; using Umbraco.Core.Persistence.SqlSyntax; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Scoping; -using Umbraco.Core.Services; using Umbraco.Core.Services.Implement; using Umbraco.Core.Strings; using Umbraco.Tests.Components; @@ -36,14 +32,14 @@ using Umbraco.Web; using Umbraco.Web.Services; using Umbraco.Tests.Testing.Objects.Accessors; using Umbraco.Web.Actions; -using Umbraco.Web.Composing.Composers; using Umbraco.Web.ContentApps; -using Umbraco.Web.Macros; using Umbraco.Web.PublishedCache; -using Current = Umbraco.Core.Composing.Current; using Umbraco.Web.Routing; -using Umbraco.Web.Templates; using Umbraco.Web.Trees; +using Umbraco.Core.Composing.CompositionExtensions; +using Umbraco.Web.Composing.CompositionExtensions; +using Current = Umbraco.Core.Composing.Current; +using FileSystems = Umbraco.Core.IO.FileSystems; namespace Umbraco.Tests.Testing { diff --git a/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs b/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs index ba6a83adff..9e59422310 100644 --- a/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs +++ b/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs @@ -14,6 +14,7 @@ using Umbraco.Core.Models; using Newtonsoft.Json; using System.Collections.Generic; using System; +using Umbraco.Core; namespace Umbraco.Tests.UmbracoExamine { diff --git a/src/Umbraco.Tests/UmbracoExamine/SearchTests.cs b/src/Umbraco.Tests/UmbracoExamine/SearchTests.cs index fc0d771fb8..a45a33ec00 100644 --- a/src/Umbraco.Tests/UmbracoExamine/SearchTests.cs +++ b/src/Umbraco.Tests/UmbracoExamine/SearchTests.cs @@ -5,6 +5,7 @@ using Examine; using Examine.Search; using NUnit.Framework; using Moq; +using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Services; diff --git a/src/Umbraco.Tests/Web/Mvc/UmbracoViewPageTests.cs b/src/Umbraco.Tests/Web/Mvc/UmbracoViewPageTests.cs index c5c8b5c77d..d1395c6f2e 100644 --- a/src/Umbraco.Tests/Web/Mvc/UmbracoViewPageTests.cs +++ b/src/Umbraco.Tests/Web/Mvc/UmbracoViewPageTests.cs @@ -5,6 +5,7 @@ using System.Web.Mvc; using System.Web.Routing; using Moq; using NUnit.Framework; +using Umbraco.Core; using Umbraco.Core.Cache; using Umbraco.Core.Composing; using Umbraco.Core.Configuration.UmbracoSettings; diff --git a/src/Umbraco.Web/Cache/DistributedCacheBinderComponent.cs b/src/Umbraco.Web/Cache/DistributedCacheBinderComponent.cs index 94d274731d..31e876892e 100644 --- a/src/Umbraco.Web/Cache/DistributedCacheBinderComponent.cs +++ b/src/Umbraco.Web/Cache/DistributedCacheBinderComponent.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Components; +using Umbraco.Core.Composing; namespace Umbraco.Web.Cache { diff --git a/src/Umbraco.Web/Cache/DistributedCacheBinderComposer.cs b/src/Umbraco.Web/Cache/DistributedCacheBinderComposer.cs index f0f57a203b..86f70798d7 100644 --- a/src/Umbraco.Web/Cache/DistributedCacheBinderComposer.cs +++ b/src/Umbraco.Web/Cache/DistributedCacheBinderComposer.cs @@ -1,5 +1,4 @@ using Umbraco.Core; -using Umbraco.Core.Components; using Umbraco.Core.Composing; namespace Umbraco.Web.Cache diff --git a/src/Umbraco.Web/Components/BackOfficeUserAuditEventsComponent.cs b/src/Umbraco.Web/Compose/BackOfficeUserAuditEventsComponent.cs similarity index 98% rename from src/Umbraco.Web/Components/BackOfficeUserAuditEventsComponent.cs rename to src/Umbraco.Web/Compose/BackOfficeUserAuditEventsComponent.cs index 545a781a8d..9bb1889b68 100644 --- a/src/Umbraco.Web/Components/BackOfficeUserAuditEventsComponent.cs +++ b/src/Umbraco.Web/Compose/BackOfficeUserAuditEventsComponent.cs @@ -1,11 +1,11 @@ using System; using Umbraco.Core; -using Umbraco.Core.Components; +using Umbraco.Core.Composing; using Umbraco.Core.Models.Membership; using Umbraco.Core.Services; using Umbraco.Web.Security; -namespace Umbraco.Web.Components +namespace Umbraco.Web.Compose { public sealed class BackOfficeUserAuditEventsComponent : IComponent { @@ -19,7 +19,7 @@ namespace Umbraco.Web.Components } public void Initialize() - { + { //BackOfficeUserManager.AccountLocked += ; //BackOfficeUserManager.AccountUnlocked += ; BackOfficeUserManager.ForgotPasswordRequested += OnForgotPasswordRequest; diff --git a/src/Umbraco.Web/Components/BackOfficeUserAuditEventsComposer.cs b/src/Umbraco.Web/Compose/BackOfficeUserAuditEventsComposer.cs similarity index 67% rename from src/Umbraco.Web/Components/BackOfficeUserAuditEventsComposer.cs rename to src/Umbraco.Web/Compose/BackOfficeUserAuditEventsComposer.cs index 8364dc05f4..38065f98ce 100644 --- a/src/Umbraco.Web/Components/BackOfficeUserAuditEventsComposer.cs +++ b/src/Umbraco.Web/Compose/BackOfficeUserAuditEventsComposer.cs @@ -1,6 +1,6 @@ -using Umbraco.Core.Components; +using Umbraco.Core.Composing; -namespace Umbraco.Web.Components +namespace Umbraco.Web.Compose { public sealed class BackOfficeUserAuditEventsComposer : ComponentComposer, ICoreComposer { } diff --git a/src/Umbraco.Web/Components/DatabaseServerRegistrarAndMessengerComponent.cs b/src/Umbraco.Web/Compose/DatabaseServerRegistrarAndMessengerComponent.cs similarity index 99% rename from src/Umbraco.Web/Components/DatabaseServerRegistrarAndMessengerComponent.cs rename to src/Umbraco.Web/Compose/DatabaseServerRegistrarAndMessengerComponent.cs index 4ae371502f..086aa9b197 100644 --- a/src/Umbraco.Web/Components/DatabaseServerRegistrarAndMessengerComponent.cs +++ b/src/Umbraco.Web/Compose/DatabaseServerRegistrarAndMessengerComponent.cs @@ -1,8 +1,7 @@ using System; using System.Threading; -using Examine; using Umbraco.Core; -using Umbraco.Core.Components; +using Umbraco.Core.Compose; using Umbraco.Core.Composing; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; @@ -18,7 +17,7 @@ using Umbraco.Web.Scheduling; using Umbraco.Web.Search; using Current = Umbraco.Web.Composing.Current; -namespace Umbraco.Web.Components +namespace Umbraco.Web.Compose { /// /// Ensures that servers are automatically registered in the database, when using the database server registrar. diff --git a/src/Umbraco.Web/Components/NotificationsComponent.cs b/src/Umbraco.Web/Compose/NotificationsComponent.cs similarity index 98% rename from src/Umbraco.Web/Components/NotificationsComponent.cs rename to src/Umbraco.Web/Compose/NotificationsComponent.cs index 4b447598a3..08bcdf345c 100644 --- a/src/Umbraco.Web/Components/NotificationsComponent.cs +++ b/src/Umbraco.Web/Compose/NotificationsComponent.cs @@ -1,20 +1,20 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; using Umbraco.Core; +using Umbraco.Core.Composing; +using Umbraco.Core.Configuration; +using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.Logging; -using Umbraco.Core.Components; using Umbraco.Core.Models; using Umbraco.Core.Models.Entities; +using Umbraco.Core.Models.Membership; using Umbraco.Core.Services; using Umbraco.Core.Services.Implement; using Umbraco.Web.Actions; -using Umbraco.Core.Configuration; -using Umbraco.Core.Configuration.UmbracoSettings; -using System.Linq; -using Umbraco.Core.Models.Membership; -using System; -using System.Globalization; -namespace Umbraco.Web.Components +namespace Umbraco.Web.Compose { public sealed class NotificationsComponent : IComponent { diff --git a/src/Umbraco.Web/Components/NotificationsComposer.cs b/src/Umbraco.Web/Compose/NotificationsComposer.cs similarity index 86% rename from src/Umbraco.Web/Components/NotificationsComposer.cs rename to src/Umbraco.Web/Compose/NotificationsComposer.cs index c945facfc6..7b4bebf878 100644 --- a/src/Umbraco.Web/Components/NotificationsComposer.cs +++ b/src/Umbraco.Web/Compose/NotificationsComposer.cs @@ -1,8 +1,7 @@ using Umbraco.Core; -using Umbraco.Core.Components; using Umbraco.Core.Composing; -namespace Umbraco.Web.Components +namespace Umbraco.Web.Compose { [RuntimeLevel(MinLevel = RuntimeLevel.Run)] public sealed class NotificationsComposer : ComponentComposer, ICoreComposer diff --git a/src/Umbraco.Web/Components/PublicAccessComponent.cs b/src/Umbraco.Web/Compose/PublicAccessComponent.cs similarity index 91% rename from src/Umbraco.Web/Components/PublicAccessComponent.cs rename to src/Umbraco.Web/Compose/PublicAccessComponent.cs index e08d42d961..ef7532253b 100644 --- a/src/Umbraco.Web/Components/PublicAccessComponent.cs +++ b/src/Umbraco.Web/Compose/PublicAccessComponent.cs @@ -1,10 +1,10 @@ using Umbraco.Core; -using Umbraco.Core.Components; +using Umbraco.Core.Composing; using Umbraco.Core.Services; using Umbraco.Core.Services.Implement; -using Umbraco.Web.Composing; +using Current = Umbraco.Web.Composing.Current; -namespace Umbraco.Web.Components +namespace Umbraco.Web.Compose { public sealed class PublicAccessComponent : IComponent { diff --git a/src/Umbraco.Web/Components/PublicAccessComposer.cs b/src/Umbraco.Web/Compose/PublicAccessComposer.cs similarity index 82% rename from src/Umbraco.Web/Components/PublicAccessComposer.cs rename to src/Umbraco.Web/Compose/PublicAccessComposer.cs index a4ae98d0e9..49b4978b80 100644 --- a/src/Umbraco.Web/Components/PublicAccessComposer.cs +++ b/src/Umbraco.Web/Compose/PublicAccessComposer.cs @@ -1,7 +1,7 @@ using Umbraco.Core; -using Umbraco.Core.Components; +using Umbraco.Core.Composing; -namespace Umbraco.Web.Components +namespace Umbraco.Web.Compose { /// /// Used to ensure that the public access data file is kept up to date properly diff --git a/src/Umbraco.Web/Composing/Composers/ControllersComposer.cs b/src/Umbraco.Web/Composing/CompositionExtensions/Controllers.cs similarity index 97% rename from src/Umbraco.Web/Composing/Composers/ControllersComposer.cs rename to src/Umbraco.Web/Composing/CompositionExtensions/Controllers.cs index 0aa3c7f8a1..329c93360b 100644 --- a/src/Umbraco.Web/Composing/Composers/ControllersComposer.cs +++ b/src/Umbraco.Web/Composing/CompositionExtensions/Controllers.cs @@ -4,14 +4,13 @@ using System.Linq; using System.Reflection; using System.Web.Http.Controllers; using System.Web.Mvc; -using Umbraco.Core.Components; using Umbraco.Core.Composing; using Umbraco.Web.Mvc; using Umbraco.Web.WebApi; -namespace Umbraco.Web.Composing.Composers +namespace Umbraco.Web.Composing.CompositionExtensions { - internal static class ControllersComposer + internal static class Controllers { /// /// Registers Umbraco controllers. diff --git a/src/Umbraco.Web/Composing/Composers/InstallerComposer.cs b/src/Umbraco.Web/Composing/CompositionExtensions/Installer.cs similarity index 88% rename from src/Umbraco.Web/Composing/Composers/InstallerComposer.cs rename to src/Umbraco.Web/Composing/CompositionExtensions/Installer.cs index 4051dc0306..233db9bcb3 100644 --- a/src/Umbraco.Web/Composing/Composers/InstallerComposer.cs +++ b/src/Umbraco.Web/Composing/CompositionExtensions/Installer.cs @@ -1,12 +1,11 @@ -using Umbraco.Core.Components; +using Umbraco.Core; using Umbraco.Core.Composing; using Umbraco.Web.Install; using Umbraco.Web.Install.InstallSteps; -using Umbraco.Web.Install.Models; -namespace Umbraco.Web.Composing.Composers +namespace Umbraco.Web.Composing.CompositionExtensions { - public static class InstallerComposer + public static class Installer { public static Composition ComposeInstaller(this Composition composition) { diff --git a/src/Umbraco.Web/Composing/Composers/WebMappingProfilesComposer.cs b/src/Umbraco.Web/Composing/CompositionExtensions/WebMappingProfiles.cs similarity index 95% rename from src/Umbraco.Web/Composing/Composers/WebMappingProfilesComposer.cs rename to src/Umbraco.Web/Composing/CompositionExtensions/WebMappingProfiles.cs index 202849a975..b4fce14385 100644 --- a/src/Umbraco.Web/Composing/Composers/WebMappingProfilesComposer.cs +++ b/src/Umbraco.Web/Composing/CompositionExtensions/WebMappingProfiles.cs @@ -1,15 +1,14 @@ using AutoMapper; using Umbraco.Core; -using Umbraco.Core.Components; using Umbraco.Core.Composing; using Umbraco.Core.Models; using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Models.Mapping; using Umbraco.Web.Trees; -namespace Umbraco.Web.Composing.Composers +namespace Umbraco.Web.Composing.CompositionExtensions { - public static class WebMappingProfilesComposer + public static class WebMappingProfiles { public static Composition ComposeWebMappingProfiles(this Composition composition) { diff --git a/src/Umbraco.Web/CompositionExtensions.cs b/src/Umbraco.Web/CompositionExtensions.cs index 4302cdaeee..ff71a99fa9 100644 --- a/src/Umbraco.Web/CompositionExtensions.cs +++ b/src/Umbraco.Web/CompositionExtensions.cs @@ -1,5 +1,5 @@ using System; -using Umbraco.Core.Components; +using Umbraco.Core; using Umbraco.Core.Composing; using Umbraco.Web.Actions; using Umbraco.Web.ContentApps; diff --git a/src/Umbraco.Web/ContentApps/ContentAppFactoryCollectionBuilder.cs b/src/Umbraco.Web/ContentApps/ContentAppFactoryCollectionBuilder.cs index 2f35e77a7c..170b9169ef 100644 --- a/src/Umbraco.Web/ContentApps/ContentAppFactoryCollectionBuilder.cs +++ b/src/Umbraco.Web/ContentApps/ContentAppFactoryCollectionBuilder.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using Umbraco.Core; using Umbraco.Core.Composing; using Umbraco.Core.Logging; using Umbraco.Core.Manifest; diff --git a/src/Umbraco.Web/Logging/WebProfilerComponent.cs b/src/Umbraco.Web/Logging/WebProfilerComponent.cs index b61bcd372c..2959e12ad7 100755 --- a/src/Umbraco.Web/Logging/WebProfilerComponent.cs +++ b/src/Umbraco.Web/Logging/WebProfilerComponent.cs @@ -1,6 +1,6 @@ using System; using System.Web; -using Umbraco.Core.Components; +using Umbraco.Core.Composing; using Umbraco.Core.Logging; namespace Umbraco.Web.Logging diff --git a/src/Umbraco.Web/Logging/WebProfilerComposer.cs b/src/Umbraco.Web/Logging/WebProfilerComposer.cs index 383d8d1149..5834dd9dd4 100644 --- a/src/Umbraco.Web/Logging/WebProfilerComposer.cs +++ b/src/Umbraco.Web/Logging/WebProfilerComposer.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Components; +using Umbraco.Core.Composing; namespace Umbraco.Web.Logging { diff --git a/src/Umbraco.Web/PropertyEditors/PropertyEditorsComponent.cs b/src/Umbraco.Web/PropertyEditors/PropertyEditorsComponent.cs index 2fc3badb85..3b4148eb56 100644 --- a/src/Umbraco.Web/PropertyEditors/PropertyEditorsComponent.cs +++ b/src/Umbraco.Web/PropertyEditors/PropertyEditorsComponent.cs @@ -1,5 +1,5 @@ using System.Linq; -using Umbraco.Core.Components; +using Umbraco.Core.Composing; using Umbraco.Core.Models; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Services.Implement; diff --git a/src/Umbraco.Web/PropertyEditors/PropertyEditorsComposer.cs b/src/Umbraco.Web/PropertyEditors/PropertyEditorsComposer.cs index 1a1c218db6..ce0cf2904f 100644 --- a/src/Umbraco.Web/PropertyEditors/PropertyEditorsComposer.cs +++ b/src/Umbraco.Web/PropertyEditors/PropertyEditorsComposer.cs @@ -1,5 +1,5 @@ using Umbraco.Core; -using Umbraco.Core.Components; +using Umbraco.Core.Composing; namespace Umbraco.Web.PropertyEditors { diff --git a/src/Umbraco.Web/PublishedCache/NuCache/NuCacheComponent.cs b/src/Umbraco.Web/PublishedCache/NuCache/NuCacheComponent.cs index 089ff6a8ea..fba133a2aa 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/NuCacheComponent.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/NuCacheComponent.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Components; +using Umbraco.Core.Composing; namespace Umbraco.Web.PublishedCache.NuCache { diff --git a/src/Umbraco.Web/PublishedCache/NuCache/NuCacheComposer.cs b/src/Umbraco.Web/PublishedCache/NuCache/NuCacheComposer.cs index f4449008f9..72fa39e7e4 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/NuCacheComposer.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/NuCacheComposer.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Components; +using Umbraco.Core; using Umbraco.Core.Composing; using Umbraco.Web.PublishedCache.NuCache.DataSource; diff --git a/src/Umbraco.Web/Routing/RedirectTrackingComponent.cs b/src/Umbraco.Web/Routing/RedirectTrackingComponent.cs index acbd022f2e..6db90e3190 100644 --- a/src/Umbraco.Web/Routing/RedirectTrackingComponent.cs +++ b/src/Umbraco.Web/Routing/RedirectTrackingComponent.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; using Umbraco.Core.Cache; -using Umbraco.Core.Components; +using Umbraco.Core.Composing; using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.Events; using Umbraco.Core.Models; @@ -10,7 +10,7 @@ using Umbraco.Core.Services; using Umbraco.Core.Services.Implement; using Umbraco.Core.Sync; using Umbraco.Web.Cache; -using Umbraco.Web.Composing; +using Current = Umbraco.Web.Composing.Current; namespace Umbraco.Web.Routing { diff --git a/src/Umbraco.Web/Routing/RedirectTrackingComposer.cs b/src/Umbraco.Web/Routing/RedirectTrackingComposer.cs index 75ab4ad613..bcafc8d050 100644 --- a/src/Umbraco.Web/Routing/RedirectTrackingComposer.cs +++ b/src/Umbraco.Web/Routing/RedirectTrackingComposer.cs @@ -1,5 +1,5 @@ using Umbraco.Core; -using Umbraco.Core.Components; +using Umbraco.Core.Composing; namespace Umbraco.Web.Routing { diff --git a/src/Umbraco.Web/Runtime/WebRuntime.cs b/src/Umbraco.Web/Runtime/WebRuntime.cs index 0f689378d6..13cd717fd1 100644 --- a/src/Umbraco.Web/Runtime/WebRuntime.cs +++ b/src/Umbraco.Web/Runtime/WebRuntime.cs @@ -1,6 +1,5 @@ using System.Web; using Umbraco.Core.Cache; -using Umbraco.Core.Components; using Umbraco.Core.Composing; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; diff --git a/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs b/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs index a7de6ca842..e2bdd7e84d 100644 --- a/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs +++ b/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs @@ -13,7 +13,6 @@ using System.Web.Routing; using ClientDependency.Core.CompositeFiles.Providers; using ClientDependency.Core.Config; using Umbraco.Core; -using Umbraco.Core.Components; using Umbraco.Core.Composing; using Umbraco.Core.Configuration; using Umbraco.Core.Configuration.UmbracoSettings; diff --git a/src/Umbraco.Web/Runtime/WebRuntimeComposer.cs b/src/Umbraco.Web/Runtime/WebRuntimeComposer.cs index 6e82177c89..8a0f47dec3 100644 --- a/src/Umbraco.Web/Runtime/WebRuntimeComposer.cs +++ b/src/Umbraco.Web/Runtime/WebRuntimeComposer.cs @@ -4,7 +4,6 @@ using System.Web.Security; using Examine; using Microsoft.AspNet.SignalR; using Umbraco.Core; -using Umbraco.Core.Components; using Umbraco.Core.Composing; using Umbraco.Core.Dashboards; using Umbraco.Core.Dictionary; @@ -18,7 +17,7 @@ using Umbraco.Core.Runtime; using Umbraco.Core.Services; using Umbraco.Web.Actions; using Umbraco.Web.Cache; -using Umbraco.Web.Composing.Composers; +using Umbraco.Web.Composing.CompositionExtensions; using Umbraco.Web.ContentApps; using Umbraco.Web.Dashboards; using Umbraco.Web.Dictionary; diff --git a/src/Umbraco.Web/Scheduling/SchedulerComponent.cs b/src/Umbraco.Web/Scheduling/SchedulerComponent.cs index 697c80e76d..ee1fc3d7bb 100644 --- a/src/Umbraco.Web/Scheduling/SchedulerComponent.cs +++ b/src/Umbraco.Web/Scheduling/SchedulerComponent.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Threading; using Umbraco.Core; -using Umbraco.Core.Components; using Umbraco.Core.Composing; using Umbraco.Core.Configuration; using Umbraco.Core.Configuration.HealthChecks; diff --git a/src/Umbraco.Web/Scheduling/SchedulerComposer.cs b/src/Umbraco.Web/Scheduling/SchedulerComposer.cs index b28312c8d6..5c56f3d314 100644 --- a/src/Umbraco.Web/Scheduling/SchedulerComposer.cs +++ b/src/Umbraco.Web/Scheduling/SchedulerComposer.cs @@ -1,6 +1,6 @@ using System; using Umbraco.Core; -using Umbraco.Core.Components; +using Umbraco.Core.Composing; namespace Umbraco.Web.Scheduling { diff --git a/src/Umbraco.Web/Search/ExamineComponent.cs b/src/Umbraco.Web/Search/ExamineComponent.cs index 0db3f0b65e..3583e5b7f9 100644 --- a/src/Umbraco.Web/Search/ExamineComponent.cs +++ b/src/Umbraco.Web/Search/ExamineComponent.cs @@ -6,7 +6,6 @@ using System.Threading; using Examine; using Umbraco.Core; using Umbraco.Core.Cache; -using Umbraco.Core.Components; using Umbraco.Core.Logging; using Umbraco.Core.Models; using Umbraco.Core.Scoping; @@ -19,6 +18,7 @@ using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Web.Scheduling; using System.Threading.Tasks; using Examine.LuceneEngine.Directories; +using Umbraco.Core.Composing; namespace Umbraco.Web.Search { diff --git a/src/Umbraco.Web/Search/ExamineComposer.cs b/src/Umbraco.Web/Search/ExamineComposer.cs index 5a897144f9..6e74f0e89d 100644 --- a/src/Umbraco.Web/Search/ExamineComposer.cs +++ b/src/Umbraco.Web/Search/ExamineComposer.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using Examine; using Umbraco.Core; -using Umbraco.Core.Components; using Umbraco.Core.Composing; using Umbraco.Core.Models; using Umbraco.Core.PropertyEditors; diff --git a/src/Umbraco.Web/SignalR/PreviewHubComponent.cs b/src/Umbraco.Web/SignalR/PreviewHubComponent.cs index 328f5a06ed..1d8a10118b 100644 --- a/src/Umbraco.Web/SignalR/PreviewHubComponent.cs +++ b/src/Umbraco.Web/SignalR/PreviewHubComponent.cs @@ -1,7 +1,7 @@ using System; using Microsoft.AspNet.SignalR; using Umbraco.Core.Cache; -using Umbraco.Core.Components; +using Umbraco.Core.Composing; using Umbraco.Core.Sync; using Umbraco.Web.Cache; diff --git a/src/Umbraco.Web/SignalR/PreviewHubComposer.cs b/src/Umbraco.Web/SignalR/PreviewHubComposer.cs index b92c6fe5a4..cef1e166c2 100644 --- a/src/Umbraco.Web/SignalR/PreviewHubComposer.cs +++ b/src/Umbraco.Web/SignalR/PreviewHubComposer.cs @@ -1,6 +1,6 @@ using Microsoft.AspNet.SignalR; using Umbraco.Core; -using Umbraco.Core.Components; +using Umbraco.Core.Composing; namespace Umbraco.Web.SignalR { diff --git a/src/Umbraco.Web/Trees/BackOfficeSectionCollectionBuilder.cs b/src/Umbraco.Web/Trees/BackOfficeSectionCollectionBuilder.cs index 452ac02f38..290e28fab8 100644 --- a/src/Umbraco.Web/Trees/BackOfficeSectionCollectionBuilder.cs +++ b/src/Umbraco.Web/Trees/BackOfficeSectionCollectionBuilder.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using Umbraco.Core; using Umbraco.Core.Composing; using Umbraco.Core.Manifest; using Umbraco.Core.Models.Trees; diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index bdea3f1a66..228abb41fd 100755 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -115,12 +115,12 @@ - - - - + + + + - + @@ -333,13 +333,13 @@ - + - + @@ -887,7 +887,7 @@ - + @@ -1044,7 +1044,7 @@ Resources.resx - + @@ -1123,7 +1123,7 @@ - + From 71f128d7967d869d2a9621312ff05378cf8aa29e Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Thu, 14 Feb 2019 09:39:42 +0100 Subject: [PATCH 12/55] #4426 - Added track by $index for `Repeatable Textstrings` --- .../views/propertyeditors/multipletextbox/multipletextbox.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/multipletextbox/multipletextbox.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/multipletextbox/multipletextbox.html index 9f45c46a77..e3abe970a2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/multipletextbox/multipletextbox.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/multipletextbox/multipletextbox.html @@ -1,7 +1,7 @@
-
+
From 30386cc96e4d79d47b2d9175b944cd8fb15c07e3 Mon Sep 17 00:00:00 2001 From: Claus Date: Thu, 14 Feb 2019 11:32:23 +0100 Subject: [PATCH 13/55] adding some translations. --- src/Umbraco.Web.UI/Umbraco/config/lang/da.xml | 4 +++- src/Umbraco.Web.UI/Umbraco/config/lang/en.xml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml index 1130eadcac..e7cf75f976 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml @@ -167,6 +167,7 @@ Sendt til udgivelse Sendt til oversættelse Sorteret + Historik (alle sprog) For at skifte det valgte indholds dokumenttype, skal du først vælge en ny dokumenttype, som er gyldig på denne placering. @@ -573,6 +574,7 @@ Fejl Find Første + Generelt Grupper Højde Hjælp @@ -684,7 +686,7 @@ Copy Lines Down Move Lines Up Move Lines Down - General + Generelt Editor diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml index 84d9e90c6d..b67c669615 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml @@ -175,6 +175,7 @@ Send To Publish Send To Publish Sort + History (all variants) To change the document type for the selected content, first select from the list of valid types for this location. From 0ac196bec61c40148f25b1a46b2b96c44502ae03 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Mon, 11 Feb 2019 12:12:12 +0100 Subject: [PATCH 14/55] Add some missing localization for content info --- .../content/umbcontentnodeinfo.directive.js | 4 +++- .../rollback/rollback.controller.js | 16 +++++++++------- .../infiniteeditors/rollback/rollback.html | 2 +- .../content/umb-content-node-info.html | 2 +- src/Umbraco.Web.UI/Umbraco/config/lang/da.xml | 1 + 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbcontentnodeinfo.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbcontentnodeinfo.directive.js index a043b292ef..7ca7e337bb 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbcontentnodeinfo.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbcontentnodeinfo.directive.js @@ -44,7 +44,8 @@ "prompt_doctypeChangeWarning", "general_history", "auditTrails_historyIncludingVariants", - "content_itemNotPublished" + "content_itemNotPublished", + "general_choose" ]; localizationService.localizeMany(keys) @@ -59,6 +60,7 @@ labels.notPublished = data[9]; scope.historyLabel = scope.node.variants && scope.node.variants.length === 1 ? data[7] : data[8]; + scope.chooseLabel = data[10]; setNodePublishStatus(); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/rollback/rollback.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/rollback/rollback.controller.js index e179e0acb3..afec0ae120 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/rollback/rollback.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/rollback/rollback.controller.js @@ -20,6 +20,7 @@ vm.diff = null; vm.currentVersion = null; vm.rollbackButtonDisabled = true; + vm.labels = {}; // find the current version for invariant nodes if($scope.model.node.variants.length === 1) { @@ -39,12 +40,13 @@ } } - // set default title - if(!$scope.model.title) { - localizationService.localize("actions_rollback").then(function(value){ - $scope.model.title = value; - }); - } + localizationService.localizeMany(["actions_rollback", "general_choose"]).then(function (data) { + // set default title + if (!$scope.model.title) { + $scope.model.title = data[0]; + } + vm.labels.choose = data[1]; + }); // Load in diff library assetsService.loadJs('lib/jsdiff/diff.min.js', $scope).then(function () { @@ -177,4 +179,4 @@ angular.module("umbraco").controller("Umbraco.Editors.RollbackController", RollbackController); -})(); \ No newline at end of file +})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/rollback/rollback.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/rollback/rollback.html index d7ba57c1af..9b230410b0 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/rollback/rollback.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/rollback/rollback.html @@ -40,7 +40,7 @@ ng-model="vm.selectedVersion" ng-options="version.displayValue for version in vm.previousVersions track by version.versionId" ng-change="vm.changeVersion(vm.selectedVersion)"> - +
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/content/umb-content-node-info.html b/src/Umbraco.Web.UI.Client/src/views/components/content/umb-content-node-info.html index 84b7017c64..48a621406e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/content/umb-content-node-info.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/content/umb-content-node-info.html @@ -158,7 +158,7 @@ ng-model="node.template" ng-options="key as value for (key, value) in availableTemplates" ng-change="updateTemplate(node.template)"> - + Open diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml index e7cf75f976..d7b02f0052 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml @@ -248,6 +248,7 @@ Type Afpublicér Afpubliceret + Ikke oprettet Sidst redigeret Tidspunkt for seneste redigering Fjern fil From 494bdfef1e5af0636a1c746e16fa8dc5d9b05512 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Mon, 11 Feb 2019 09:16:35 +0100 Subject: [PATCH 15/55] Allow invariant languages to be resolved by specific cultures --- .../Implement/LanguageRepository.cs | 1 + .../Repositories/LanguageRepositoryTest.cs | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/LanguageRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/LanguageRepository.cs index b3f2ff4af0..5a62c25df7 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Implement/LanguageRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Implement/LanguageRepository.cs @@ -250,6 +250,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement lock (_codeIdMap) { if (_codeIdMap.TryGetValue(isoCode, out var id)) return id; + if (isoCode.Contains('-') && _codeIdMap.TryGetValue(isoCode.Split('-').First(), out var invariantId)) return invariantId; } if (throwOnNotFound) throw new ArgumentException($"Code {isoCode} does not correspond to an existing language.", nameof(isoCode)); diff --git a/src/Umbraco.Tests/Persistence/Repositories/LanguageRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/LanguageRepositoryTest.cs index 5823537f7a..39f6e3e114 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/LanguageRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/LanguageRepositoryTest.cs @@ -79,7 +79,39 @@ namespace Umbraco.Tests.Persistence.Repositories } } + [Test] + public void Can_Perform_Get_By_Invariant_Code_On_LanguageRepository() + { + var provider = TestObjects.GetScopeProvider(Logger); + using (var scope = provider.CreateScope()) + { + var repository = CreateRepository(provider); + var es = new CultureInfo("es"); + var esSpecific = new CultureInfo("es-ES"); + + var language = (ILanguage)new Language(es.Name) + { + CultureName = es.DisplayName, + FallbackLanguageId = 1 + }; + repository.Save(language); + + language = repository.GetByIsoCode(es.Name); + var languageSpecific = repository.GetByIsoCode(esSpecific.Name); + + // Assert + Assert.That(language, Is.Not.Null); + Assert.That(language.HasIdentity, Is.True); + Assert.That(language.IsoCode, Is.EqualTo(es.Name)); + + Assert.That(languageSpecific, Is.Not.Null); + Assert.That(languageSpecific.HasIdentity, Is.True); + Assert.That(languageSpecific.Id, Is.EqualTo(language.Id)); + Assert.That(language.IsoCode, Is.EqualTo(language.IsoCode)); + } + } + [Test] public void Get_When_Id_Doesnt_Exist_Returns_Null() { From 7b03bc20cc355ab4550fcd1f44c13a2c7d90ccbe Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Tue, 12 Feb 2019 08:14:21 +0100 Subject: [PATCH 16/55] Support localization of template and content type names in the content mapper --- .../Models/Mapping/ContentMapperProfile.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web/Models/Mapping/ContentMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/ContentMapperProfile.cs index 652ac12014..9555cf2ef9 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentMapperProfile.cs @@ -24,7 +24,8 @@ namespace Umbraco.Web.Models.Mapping IContentService contentService, IContentTypeService contentTypeService, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, - ILocalizationService localizationService) + ILocalizationService localizationService, + ILocalizedTextService localizedTextService) { // create, capture, cache var contentOwnerResolver = new OwnerResolver(userService); @@ -32,7 +33,7 @@ namespace Umbraco.Web.Models.Mapping var actionButtonsResolver = new ActionButtonsResolver(userService, contentService); var childOfListViewResolver = new ContentChildOfListViewResolver(contentService, contentTypeService); var contentTypeBasicResolver = new ContentTypeBasicResolver(contentTypeBaseServiceProvider); - var allowedTemplatesResolver = new AllowedTemplatesResolver(contentTypeService); + var allowedTemplatesResolver = new AllowedTemplatesResolver(contentTypeService, localizedTextService); var defaultTemplateResolver = new DefaultTemplateResolver(); var variantResolver = new ContentVariantResolver(localizationService); var schedPublishReleaseDateResolver = new ScheduledPublishDateResolver(ContentScheduleAction.Release); @@ -47,7 +48,7 @@ namespace Umbraco.Web.Models.Mapping .ForMember(dest => dest.ContentApps, opt => opt.MapFrom(contentAppResolver)) .ForMember(dest => dest.Icon, opt => opt.MapFrom(src => src.ContentType.Icon)) .ForMember(dest => dest.ContentTypeAlias, opt => opt.MapFrom(src => src.ContentType.Alias)) - .ForMember(dest => dest.ContentTypeName, opt => opt.MapFrom(src => src.ContentType.Name)) + .ForMember(dest => dest.ContentTypeName, opt => opt.MapFrom(src => localizedTextService.UmbracoDictionaryTranslate(src.ContentType.Name))) .ForMember(dest => dest.IsContainer, opt => opt.MapFrom(src => src.ContentType.IsContainer)) .ForMember(dest => dest.IsElement, opt => opt.MapFrom(src => src.ContentType.IsElement)) .ForMember(dest => dest.IsBlueprint, opt => opt.MapFrom(src => src.Blueprint)) @@ -146,10 +147,12 @@ namespace Umbraco.Web.Models.Mapping private class AllowedTemplatesResolver : IValueResolver> { private readonly IContentTypeService _contentTypeService; + private readonly ILocalizedTextService _localizedTextService; - public AllowedTemplatesResolver(IContentTypeService contentTypeService) + public AllowedTemplatesResolver(IContentTypeService contentTypeService, ILocalizedTextService localizedTextService) { _contentTypeService = contentTypeService; + _localizedTextService = localizedTextService; } public IDictionary Resolve(IContent source, ContentItemDisplay destination, IDictionary destMember, ResolutionContext context) @@ -158,7 +161,7 @@ namespace Umbraco.Web.Models.Mapping return contentType.AllowedTemplates .Where(t => t.Alias.IsNullOrWhiteSpace() == false && t.Name.IsNullOrWhiteSpace() == false) - .ToDictionary(t => t.Alias, t => t.Name); + .ToDictionary(t => t.Alias, t => _localizedTextService.UmbracoDictionaryTranslate(t.Name)); } } } From 66656959860fb56d1e4b48d9ea8030729a3593fa Mon Sep 17 00:00:00 2001 From: matthew-hair Date: Fri, 1 Feb 2019 14:01:12 -0600 Subject: [PATCH 17/55] Added null check for context.Identity Signed-off-by: matthew-hair --- .../Security/BackOfficeCookieAuthenticationProvider.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Umbraco.Core/Security/BackOfficeCookieAuthenticationProvider.cs b/src/Umbraco.Core/Security/BackOfficeCookieAuthenticationProvider.cs index 1a3b9f54ee..57075269d8 100644 --- a/src/Umbraco.Core/Security/BackOfficeCookieAuthenticationProvider.cs +++ b/src/Umbraco.Core/Security/BackOfficeCookieAuthenticationProvider.cs @@ -107,6 +107,11 @@ namespace Umbraco.Core.Security await EnsureValidSessionId(context); + if (context?.Identity == null) + { + context?.OwinContext.Authentication.SignOut(context.Options.AuthenticationType); + return; + } await base.ValidateIdentity(context); } From 684bacb93748fb74634bb3a1bc16c8fd2e5883e1 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Thu, 14 Feb 2019 13:13:19 +0100 Subject: [PATCH 18/55] V8: Handle element types in the content editor (#4193) * Don't allow preview for element types * Don't show the "save and publish" button group for element types + apply primary button state to the "save" button * Hide templates and URLs for element types * Fix null error * Use same notation for negation --- .../directives/components/content/edit.controller.js | 4 ++-- .../components/content/umbcontentnodeinfo.directive.js | 10 +++++++++- .../src/views/components/content/edit.html | 6 +++--- src/Umbraco.Web/Editors/ContentController.cs | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js index b1ce4a266c..9844118858 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js @@ -174,8 +174,8 @@ */ function createButtons(content) { - // for trashed items, the save button is the primary action - otherwise it's a secondary action - $scope.page.saveButtonStyle = content.trashed ? "primary" : "info"; + // for trashed and element type items, the save button is the primary action - otherwise it's a secondary action + $scope.page.saveButtonStyle = content.trashed || content.isElement ? "primary" : "info"; // only create the save/publish/preview buttons if the // content app is "Conent" diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbcontentnodeinfo.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbcontentnodeinfo.directive.js index 7ca7e337bb..0fdfe6a457 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbcontentnodeinfo.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbcontentnodeinfo.directive.js @@ -64,7 +64,7 @@ setNodePublishStatus(); - if (scope.currentUrls.length === 0) { + if (scope.currentUrls && scope.currentUrls.length === 0) { if (scope.node.id > 0) { //it's created but not published scope.currentUrls.push({ text: labels.notPublished, isUrl: false }); @@ -104,6 +104,8 @@ loadAuditTrail(); } + // never show templates for element types (if they happen to have been created in the content tree) + scope.disableTemplates = scope.disableTemplates || scope.node.isElement; } scope.auditTrailPageChange = function (pageNumber) { @@ -303,6 +305,12 @@ } function updateCurrentUrls() { + // never show urls for element types (if they happen to have been created in the content tree) + if (scope.node.isElement) { + scope.currentUrls = null; + return; + } + // find the urls for the currently selected language if (scope.node.variants.length > 1) { // nodes with variants diff --git a/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html b/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html index dda9334e05..1f38d61469 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html @@ -57,9 +57,9 @@ shortcut="ctrl+s" add-ellipsis="{{page.saveButtonEllipsis}}"> - - (content); - display.AllowPreview = display.AllowPreview && content.Trashed == false; + display.AllowPreview = display.AllowPreview && content.Trashed == false && content.ContentType.IsElement == false; return display; } From 92dd1b0f8f796855f33eaf8f45aaacac22d62cea Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Thu, 14 Feb 2019 13:48:57 +0100 Subject: [PATCH 19/55] Use the url from the object --- .../common/infiniteeditors/linkpicker/linkpicker.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.controller.js index 6057b671bd..f4725fa82d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.controller.js @@ -75,7 +75,7 @@ angular.module("umbraco").controller("Umbraco.Editors.LinkPickerController", // get the content properties to build the anchor name list contentResource.getById(id).then(function (resp) { $scope.anchorValues = tinyMceService.getAnchorNames(JSON.stringify(resp.properties)); - $scope.model.target.url = resp.urls[0]; + $scope.model.target.url = resp.urls[0].text; }); } } else if ($scope.model.target.url.length) { From d4a76f1bea064b6d56a8566938dbef0c38757a92 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Thu, 14 Feb 2019 14:21:21 +0100 Subject: [PATCH 20/55] V8: Align dialogs in the Settings section (#4344) * Show the cancel button on macro delete confirm * Hide "Do something else" when creating folders * Remove "Do something else" on create relation type --- src/Umbraco.Web.UI.Client/src/views/macros/delete.html | 2 +- .../src/views/partialviewmacros/create.html | 2 +- .../src/views/partialviews/create.html | 2 +- .../src/views/relationtypes/create.html | 6 ------ src/Umbraco.Web.UI.Client/src/views/stylesheets/create.html | 2 +- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/macros/delete.html b/src/Umbraco.Web.UI.Client/src/views/macros/delete.html index 9d16e2d4e6..e6c24507b6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/macros/delete.html +++ b/src/Umbraco.Web.UI.Client/src/views/macros/delete.html @@ -5,6 +5,6 @@ Are you sure you want to delete {{vm.name}}?

- +
diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/create.html b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/create.html index 89e8075d33..88ab5b944c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/create.html +++ b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/create.html @@ -77,7 +77,7 @@
- -