From eef86689c873713741c9b8d122eec1ac851db7fa Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 29 Jan 2019 23:05:59 +1100 Subject: [PATCH] Removes booting.aspx and creates embedded html pages for booting and failed (if those are ever seen ), renames some classes and namespaces, removes old cdf bundle classes --- .../MultiValuePropertyEditorTests.cs | 1 - .../Runtimes/WebRuntimeComponentTests.cs | 1 - .../JsInitializationTests.cs | 2 +- .../ServerVariablesParserTests.cs | 2 +- ...RenderIndexActionSelectorAttributeTests.cs | 1 - src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 1 - .../config/ClientDependency.Release.config | 2 +- .../config/splashes/booting.aspx | 29 ---- src/Umbraco.Web/{UI => }/CdfLogger.cs | 2 +- src/Umbraco.Web/CompositionExtensions.cs | 9 +- .../Editors/BackOfficeController.cs | 2 +- .../Editors/ContentTypeController.cs | 5 +- .../Editors/DictionaryController.cs | 3 +- src/Umbraco.Web/Editors/MacrosController.cs | 41 +++--- src/Umbraco.Web/Editors/MediaController.cs | 10 +- .../Editors/PackageInstallController.cs | 14 +- src/Umbraco.Web/Editors/PreviewController.cs | 2 +- .../Install/Controllers/InstallController.cs | 2 +- .../JavaScript/AssetInitialization.cs | 2 +- .../ClientDependencyConfiguration.cs | 2 +- .../{UI => }/JavaScript/CssInitialization.cs | 8 +- .../JavaScript/DependencyPathRenderer.cs | 2 +- .../{UI => }/JavaScript/JsInitialization.cs | 6 +- .../{UI => }/JavaScript/JsInitialize.js | 0 src/Umbraco.Web/{UI => }/JavaScript/Main.js | 0 .../{UI => }/JavaScript/PreviewInitialize.js | 0 .../{UI => }/JavaScript/Resources.Designer.cs | 89 +++++------- .../{UI => }/JavaScript/Resources.resx | 0 .../{UI => }/JavaScript/ServerVariables.js | 0 .../JavaScript/ServerVariablesParser.cs | 2 +- .../UmbracoClientDependencyLoader.cs | 2 +- .../ContentEditing/MessagesExtensions.cs | 13 +- .../Models/ContentEditing/Notification.cs | 5 +- .../ContentEditing/NotificationStyle.cs} | 9 +- src/Umbraco.Web/Mvc/ProfilingView.cs | 4 +- src/Umbraco.Web/Mvc/ProfilingViewEngine.cs | 4 +- src/Umbraco.Web/Mvc/UmbracoPageResult.cs | 1 - src/Umbraco.Web/Mvc/UrlHelperExtensions.cs | 72 ---------- .../Routing/RedirectTrackingComponent.cs | 3 +- .../Routing/RedirectTrackingComposer.cs | 2 +- .../Routing/Resources/Booting.html | 9 ++ src/Umbraco.Web/Routing/Resources/Failed.html | 8 ++ .../Routing/Resources/HtmlPages.Designer.cs | 99 ++++++++++++++ .../Routing/Resources/HtmlPages.resx | 127 ++++++++++++++++++ .../Runtime/WebRuntimeComponent.cs | 3 +- .../UI/Bundles/JsApplicationLib.cs | 13 -- src/Umbraco.Web/UI/Bundles/JsJQueryCore.cs | 14 -- src/Umbraco.Web/UI/Bundles/JsJQueryPlugins.cs | 15 --- .../UI/Bundles/JsUmbracoApplicationCore.cs | 13 -- .../UI/Bundles/JsUmbracoApplicationUI.cs | 14 -- src/Umbraco.Web/UI/Bundles/JsUmbracoTree.cs | 18 --- src/Umbraco.Web/Umbraco.Web.csproj | 48 ++++--- src/Umbraco.Web/UmbracoInjectedModule.cs | 10 +- .../AppendCurrentEventMessagesAttribute.cs | 13 +- 54 files changed, 383 insertions(+), 376 deletions(-) delete mode 100644 src/Umbraco.Web.UI/config/splashes/booting.aspx rename src/Umbraco.Web/{UI => }/CdfLogger.cs (97%) rename src/Umbraco.Web/{UI => }/JavaScript/AssetInitialization.cs (98%) rename src/Umbraco.Web/{UI => }/JavaScript/ClientDependencyConfiguration.cs (99%) rename src/Umbraco.Web/{UI => }/JavaScript/CssInitialization.cs (95%) rename src/Umbraco.Web/{UI => }/JavaScript/DependencyPathRenderer.cs (98%) rename src/Umbraco.Web/{UI => }/JavaScript/JsInitialization.cs (99%) rename src/Umbraco.Web/{UI => }/JavaScript/JsInitialize.js (100%) rename src/Umbraco.Web/{UI => }/JavaScript/Main.js (100%) rename src/Umbraco.Web/{UI => }/JavaScript/PreviewInitialize.js (100%) rename src/Umbraco.Web/{UI => }/JavaScript/Resources.Designer.cs (82%) rename src/Umbraco.Web/{UI => }/JavaScript/Resources.resx (100%) rename src/Umbraco.Web/{UI => }/JavaScript/ServerVariables.js (100%) rename src/Umbraco.Web/{UI => }/JavaScript/ServerVariablesParser.cs (95%) rename src/Umbraco.Web/{UI => }/JavaScript/UmbracoClientDependencyLoader.cs (97%) rename src/Umbraco.Web/{UI/SpeechBubbleIcon.cs => Models/ContentEditing/NotificationStyle.cs} (75%) delete mode 100644 src/Umbraco.Web/Mvc/UrlHelperExtensions.cs create mode 100644 src/Umbraco.Web/Routing/Resources/Booting.html create mode 100644 src/Umbraco.Web/Routing/Resources/Failed.html create mode 100644 src/Umbraco.Web/Routing/Resources/HtmlPages.Designer.cs create mode 100644 src/Umbraco.Web/Routing/Resources/HtmlPages.resx delete mode 100644 src/Umbraco.Web/UI/Bundles/JsApplicationLib.cs delete mode 100644 src/Umbraco.Web/UI/Bundles/JsJQueryCore.cs delete mode 100644 src/Umbraco.Web/UI/Bundles/JsJQueryPlugins.cs delete mode 100644 src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationCore.cs delete mode 100644 src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationUI.cs delete mode 100644 src/Umbraco.Web/UI/Bundles/JsUmbracoTree.cs diff --git a/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs b/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs index 129116bf61..b7037eb192 100644 --- a/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs +++ b/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs @@ -9,7 +9,6 @@ using Umbraco.Core.Cache; using Umbraco.Core.Composing; using Umbraco.Core.Logging; using Umbraco.Core.Models; -using Umbraco.Core.Profiling; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers; diff --git a/src/Umbraco.Tests/Runtimes/WebRuntimeComponentTests.cs b/src/Umbraco.Tests/Runtimes/WebRuntimeComponentTests.cs index 97688a7113..27e5328f6f 100644 --- a/src/Umbraco.Tests/Runtimes/WebRuntimeComponentTests.cs +++ b/src/Umbraco.Tests/Runtimes/WebRuntimeComponentTests.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using System.Web.Mvc; using NUnit.Framework; -using Umbraco.Core.Profiling; using Umbraco.Web.Mvc; using Umbraco.Web.Runtime; diff --git a/src/Umbraco.Tests/Web/AngularIntegration/JsInitializationTests.cs b/src/Umbraco.Tests/Web/AngularIntegration/JsInitializationTests.cs index f16abd578a..c4b5e3247b 100644 --- a/src/Umbraco.Tests/Web/AngularIntegration/JsInitializationTests.cs +++ b/src/Umbraco.Tests/Web/AngularIntegration/JsInitializationTests.cs @@ -1,7 +1,7 @@ using System.Linq; using NUnit.Framework; using Umbraco.Core; -using Umbraco.Web.UI.JavaScript; +using Umbraco.Web.JavaScript; namespace Umbraco.Tests.Web.AngularIntegration { diff --git a/src/Umbraco.Tests/Web/AngularIntegration/ServerVariablesParserTests.cs b/src/Umbraco.Tests/Web/AngularIntegration/ServerVariablesParserTests.cs index 0bf07a83c6..42abecd06b 100644 --- a/src/Umbraco.Tests/Web/AngularIntegration/ServerVariablesParserTests.cs +++ b/src/Umbraco.Tests/Web/AngularIntegration/ServerVariablesParserTests.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using NUnit.Framework; -using Umbraco.Web.UI.JavaScript; using Umbraco.Core; +using Umbraco.Web.JavaScript; namespace Umbraco.Tests.Web.AngularIntegration { diff --git a/src/Umbraco.Tests/Web/Mvc/RenderIndexActionSelectorAttributeTests.cs b/src/Umbraco.Tests/Web/Mvc/RenderIndexActionSelectorAttributeTests.cs index c6609f38c9..29deeb31ec 100644 --- a/src/Umbraco.Tests/Web/Mvc/RenderIndexActionSelectorAttributeTests.cs +++ b/src/Umbraco.Tests/Web/Mvc/RenderIndexActionSelectorAttributeTests.cs @@ -12,7 +12,6 @@ using Umbraco.Core.Cache; using Umbraco.Core.Composing; using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.Logging; -using Umbraco.Core.Profiling; using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Stubs; diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 5e61de2132..ceca081b37 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -162,7 +162,6 @@ - diff --git a/src/Umbraco.Web.UI/config/ClientDependency.Release.config b/src/Umbraco.Web.UI/config/ClientDependency.Release.config index 4693347955..2814119201 100644 --- a/src/Umbraco.Web.UI/config/ClientDependency.Release.config +++ b/src/Umbraco.Web.UI/config/ClientDependency.Release.config @@ -10,7 +10,7 @@ NOTES: * Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config * A new version will invalidate both client and server cache and create new persisted files --> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + booting.html;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + failed.html;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + \ No newline at end of file diff --git a/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs b/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs index 26c8faca58..4fb8dadf17 100644 --- a/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs +++ b/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs @@ -19,16 +19,15 @@ using Umbraco.Core.Configuration; using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.IO; using Umbraco.Core.Models.PublishedContent; -using Umbraco.Core.Profiling; using Umbraco.Core.Services; using Umbraco.Web.Install; +using Umbraco.Web.JavaScript; using Umbraco.Web.Models.Trees; using Umbraco.Web.Mvc; using Umbraco.Web.PublishedCache; using Umbraco.Web.Routing; using Umbraco.Web.Security; using Umbraco.Web.Trees; -using Umbraco.Web.UI.JavaScript; using Umbraco.Web.WebApi; using Current = Umbraco.Web.Composing.Current; diff --git a/src/Umbraco.Web/UI/Bundles/JsApplicationLib.cs b/src/Umbraco.Web/UI/Bundles/JsApplicationLib.cs deleted file mode 100644 index 5b0ffcd85d..0000000000 --- a/src/Umbraco.Web/UI/Bundles/JsApplicationLib.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Web.UI; -using ClientDependency.Core; - -namespace Umbraco.Web.UI.Bundles -{ - /// - /// The core libs that have no dependencies - /// - [ClientDependency(ClientDependencyType.Javascript, "lib/umbraco/NamespaceManager.js", "UmbracoRoot", Priority = 0, Group = 0)] - public class JsApplicationLib : Control - { - } -} diff --git a/src/Umbraco.Web/UI/Bundles/JsJQueryCore.cs b/src/Umbraco.Web/UI/Bundles/JsJQueryCore.cs deleted file mode 100644 index 570551c0bf..0000000000 --- a/src/Umbraco.Web/UI/Bundles/JsJQueryCore.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Web.UI; -using ClientDependency.Core; - -namespace Umbraco.Web.UI.Bundles -{ - /// - /// The core Jquery libs - /// - [ClientDependency(ClientDependencyType.Javascript, "lib/jquery/jquery.min.js", "UmbracoRoot", Priority = 1, Group = 1)] - [ClientDependency(ClientDependencyType.Javascript, "lib/jquery-migrate/jquery-migrate.min.js", "UmbracoRoot", Priority = 2, Group = 1)] - public class JsJQueryCore : Control - { - } -} diff --git a/src/Umbraco.Web/UI/Bundles/JsJQueryPlugins.cs b/src/Umbraco.Web/UI/Bundles/JsJQueryPlugins.cs deleted file mode 100644 index c5fcdb858b..0000000000 --- a/src/Umbraco.Web/UI/Bundles/JsJQueryPlugins.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Web.UI; -using ClientDependency.Core; -namespace Umbraco.Web.UI.Bundles -{ - /// - /// The core Jquery libs - /// - [ClientDependency(ClientDependencyType.Javascript, "modal/jquery.simplemodal.1.4.1.custom.js", "UmbracoClient", Priority = 2, Group = 4)] - [ClientDependency(ClientDependencyType.Javascript, "Application/jQuery/jquery.cookie.js", "UmbracoClient", Priority = 3, Group = 4)] - [ClientDependency(ClientDependencyType.Javascript, "Application/JQuery/jquery.metadata.min.js", "UmbracoClient", Priority = 4, Group = 4)] - [ClientDependency(ClientDependencyType.Javascript, "Application/jQuery/jquery.hotkeys.js", "UmbracoClient", Priority = 5, Group = 4)] - public class JsJQueryPlugins : Control - { - } -} diff --git a/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationCore.cs b/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationCore.cs deleted file mode 100644 index 6ccee78fa3..0000000000 --- a/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationCore.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Web.UI; -using ClientDependency.Core; - -namespace Umbraco.Web.UI.Bundles -{ - /// - /// The core libs that require JQuery to be loaded - /// - [ClientDependency(ClientDependencyType.Javascript, "lib/umbraco/LegacyUmbClientMgr.js", "UmbracoRoot", Priority = 1, Group = 2)] - public class JsUmbracoApplicationCore : Control - { - } -} diff --git a/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationUI.cs b/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationUI.cs deleted file mode 100644 index cd4f8da660..0000000000 --- a/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationUI.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Web.UI; -using ClientDependency.Core; - -namespace Umbraco.Web.UI.Bundles -{ - /// - /// The UI Umbraco libs - /// - [ClientDependency(ClientDependencyType.Javascript, "js/guiFunctions.js", "UmbracoRoot", Priority = 1, Group = 5)] - [ClientDependency(ClientDependencyType.Javascript, "js/UmbracoSpeechBubbleBackend.js", "UmbracoRoot", Priority = 3, Group = 5)] - public class JsUmbracoApplicationUI : Control - { - } -} diff --git a/src/Umbraco.Web/UI/Bundles/JsUmbracoTree.cs b/src/Umbraco.Web/UI/Bundles/JsUmbracoTree.cs deleted file mode 100644 index 5f393376cf..0000000000 --- a/src/Umbraco.Web/UI/Bundles/JsUmbracoTree.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Web.UI; -using ClientDependency.Core; - -namespace Umbraco.Web.UI.Bundles -{ - /// - /// The umb tree libs - /// - [ClientDependency(ClientDependencyType.Javascript, "Tree/jquery.tree.js", "UmbracoClient", Priority = 0, Group = 10)] - [ClientDependency(ClientDependencyType.Javascript, "Tree/UmbracoContext.js", "UmbracoClient", Priority = 1, Group = 10)] - [ClientDependency(ClientDependencyType.Javascript, "Tree/jquery.tree.contextmenu.js", "UmbracoClient", Priority = 2, Group = 10)] - [ClientDependency(ClientDependencyType.Javascript, "Tree/jquery.tree.checkbox.js", "UmbracoClient", Priority = 3, Group = 10)] - [ClientDependency(ClientDependencyType.Javascript, "Tree/NodeDefinition.js", "UmbracoClient", Priority = 4, Group = 10)] - [ClientDependency(ClientDependencyType.Javascript, "Tree/UmbracoTree.js", "UmbracoClient", Priority = 5, Group = 10)] - public class JsUmbracoTree : Control - { - } -} diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index c3d3707fd3..5a3379b82b 100755 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -182,6 +182,11 @@ + + True + True + HtmlPages.resx + @@ -259,7 +264,7 @@ - + @@ -577,9 +582,6 @@ - - - @@ -679,7 +681,7 @@ - + @@ -691,7 +693,6 @@ - @@ -892,9 +893,9 @@ - - - + + + True @@ -1001,7 +1002,7 @@ - + @@ -1035,17 +1036,14 @@ - + True True Resources.resx - + - - - - + @@ -1139,7 +1137,7 @@ - + @@ -1202,7 +1200,7 @@ - + ResXFileCodeGenerator Resources.Designer.cs Designer @@ -1211,15 +1209,21 @@ ResXFileCodeGenerator Strings.Designer.cs - - - + + + + + ResXFileCodeGenerator + HtmlPages.Designer.cs + - + + + diff --git a/src/Umbraco.Web/UmbracoInjectedModule.cs b/src/Umbraco.Web/UmbracoInjectedModule.cs index cc17d32752..2b6d032f72 100644 --- a/src/Umbraco.Web/UmbracoInjectedModule.cs +++ b/src/Umbraco.Web/UmbracoInjectedModule.cs @@ -275,9 +275,10 @@ namespace Umbraco.Web // redirect to booting page httpContext.Response.StatusCode = 503; // temp not available - const string bootUrl = "~/config/splashes/booting.aspx"; //fixme: remove booting.aspx once the above question is resolved + var bootHtml = Routing.Resources.HtmlPages.Booting; httpContext.Response.AddHeader("Retry-After", debug ? "1" : "30"); // seconds - httpContext.RewritePath(UriUtility.ToAbsolute(bootUrl) + "?url=" + HttpUtility.UrlEncode(uri.ToString())); + httpContext.Response.Write(bootHtml); + httpContext.Response.Flush(); return false; // cannot serve content case RuntimeLevel.BootFailed: @@ -285,9 +286,10 @@ namespace Umbraco.Web ReportRuntime(level, "Umbraco has failed."); httpContext.Response.StatusCode = 503; // temp not available - const string deathUrl = "~/config/splashes/death.aspx"; + var deathHtml = Routing.Resources.HtmlPages.Failed; httpContext.Response.AddHeader("Retry-After", debug ? "1" : "300"); // seconds - httpContext.RewritePath(UriUtility.ToAbsolute(deathUrl) + "?url=" + HttpUtility.UrlEncode(uri.ToString())); + httpContext.Response.Write(deathHtml); + httpContext.Response.Flush(); return false; // cannot serve content case RuntimeLevel.Run: diff --git a/src/Umbraco.Web/WebApi/Filters/AppendCurrentEventMessagesAttribute.cs b/src/Umbraco.Web/WebApi/Filters/AppendCurrentEventMessagesAttribute.cs index 911fff3e3c..779a559a16 100644 --- a/src/Umbraco.Web/WebApi/Filters/AppendCurrentEventMessagesAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/AppendCurrentEventMessagesAttribute.cs @@ -4,7 +4,6 @@ using System.Web.Http.Filters; using Umbraco.Core.Events; using Umbraco.Web.Composing; using Umbraco.Web.Models.ContentEditing; -using Umbraco.Web.UI; namespace Umbraco.Web.WebApi.Filters { @@ -32,23 +31,23 @@ namespace Umbraco.Web.WebApi.Filters foreach (var eventMessage in msgs.GetAll()) { - SpeechBubbleIcon msgType; + NotificationStyle msgType; switch (eventMessage.MessageType) { case EventMessageType.Default: - msgType = SpeechBubbleIcon.Save; + msgType = NotificationStyle.Save; break; case EventMessageType.Info: - msgType = SpeechBubbleIcon.Info; + msgType = NotificationStyle.Info; break; case EventMessageType.Error: - msgType = SpeechBubbleIcon.Error; + msgType = NotificationStyle.Error; break; case EventMessageType.Success: - msgType = SpeechBubbleIcon.Success; + msgType = NotificationStyle.Success; break; case EventMessageType.Warning: - msgType = SpeechBubbleIcon.Warning; + msgType = NotificationStyle.Warning; break; default: throw new ArgumentOutOfRangeException();