From 1340a5ce4b7d5166a203b3b544c6744bddc76556 Mon Sep 17 00:00:00 2001 From: Callum Whyte Date: Sat, 26 Jan 2019 02:59:14 +0000 Subject: [PATCH 1/4] Removing support for legacy webservices --- src/Umbraco.Core/IO/SystemDirectories.cs | 3 - .../Sync/ServerSyncWebServiceClient.cs | 248 ------------------ src/Umbraco.Core/Umbraco.Core.csproj | 3 - src/Umbraco.Core/UriExtensions.cs | 3 - .../Composing/TypeFinderTests.cs | 1 - .../CoreThings/UriExtensionsTests.cs | 3 - src/Umbraco.Tests/IO/IoHelperTests.cs | 1 - src/Umbraco.Web/Mvc/BackOfficeArea.cs | 8 - .../Routing/WebServicesRouteConstraint.cs | 26 -- src/Umbraco.Web/Umbraco.Web.csproj | 1 - 10 files changed, 297 deletions(-) delete mode 100644 src/Umbraco.Core/Sync/ServerSyncWebServiceClient.cs delete mode 100644 src/Umbraco.Web/Routing/WebServicesRouteConstraint.cs diff --git a/src/Umbraco.Core/IO/SystemDirectories.cs b/src/Umbraco.Core/IO/SystemDirectories.cs index 5bbf325c8c..100dbc265e 100644 --- a/src/Umbraco.Core/IO/SystemDirectories.cs +++ b/src/Umbraco.Core/IO/SystemDirectories.cs @@ -39,9 +39,6 @@ namespace Umbraco.Core.IO [Obsolete("Usercontrols are obsolete and code should be removed")] public static string UserControls => "~/usercontrols"; - [Obsolete("Only used by legacy load balancing which is obsolete and should be removed")] - public static string WebServices => IOHelper.ReturnPath("umbracoWebservicesPath", Umbraco.EnsureEndsWith("/") + "webservices"); - public static string Packages => Data + "/packages"; public static string Preview => Data + "/preview"; diff --git a/src/Umbraco.Core/Sync/ServerSyncWebServiceClient.cs b/src/Umbraco.Core/Sync/ServerSyncWebServiceClient.cs deleted file mode 100644 index 38ba2ce189..0000000000 --- a/src/Umbraco.Core/Sync/ServerSyncWebServiceClient.cs +++ /dev/null @@ -1,248 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web.Services; -using Umbraco.Core.IO; - -namespace Umbraco.Core.Sync -{ - /// - /// The client Soap service for making distributed cache calls between servers - /// - [WebServiceBinding(Name = "CacheRefresherSoap", Namespace = "http://umbraco.org/webservices/")] - [Obsolete("Legacy load balancing is obsolete and should be removed")] - internal class ServerSyncWebServiceClient : System.Web.Services.Protocols.SoapHttpClientProtocol - { - - /// - public ServerSyncWebServiceClient() - { - // only set the url if the httpcontext is present, else it's set by the cache dispatcher methods (when using distributed calls) - if (System.Web.HttpContext.Current != null) - this.Url = "http://" + System.Web.HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + IOHelper.ResolveUrl(SystemDirectories.WebServices) + "/cacheRefresher.asmx"; - - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/BulkRefresh", RequestNamespace = "http://umbraco.org/webservices/", ResponseNamespace = "http://umbraco.org/webservices/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void BulkRefresh(RefreshInstruction[] instructions, string appId, string login, string password) - { - this.Invoke("BulkRefresh", new object[] { - instructions, - appId, - login, - password}); - } - - /// - public System.IAsyncResult BeginBulkRefresh(RefreshInstruction[] instructions, string appId, string login, string password, System.AsyncCallback callback, object asyncState) - { - return this.BeginInvoke("BulkRefresh", new object[] { - instructions, - appId, - login, - password}, callback, asyncState); - } - - /// - public void EndBulkRefresh(System.IAsyncResult asyncResult) - { - this.EndInvoke(asyncResult); - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RefreshAll", RequestNamespace = "http://umbraco.org/webservices/", ResponseNamespace = "http://umbraco.org/webservices/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void RefreshAll(System.Guid uniqueIdentifier, string Login, string Password) - { - this.Invoke("RefreshAll", new object[] { - uniqueIdentifier, - Login, - Password}); - } - - /// - public System.IAsyncResult BeginRefreshAll(System.Guid uniqueIdentifier, string Login, string Password, System.AsyncCallback callback, object asyncState) - { - return this.BeginInvoke("RefreshAll", new object[] { - uniqueIdentifier, - Login, - Password}, callback, asyncState); - } - - /// - public void EndRefreshAll(System.IAsyncResult asyncResult) - { - this.EndInvoke(asyncResult); - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RefreshByJson", RequestNamespace = "http://umbraco.org/webservices/", ResponseNamespace = "http://umbraco.org/webservices/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void RefreshByJson(System.Guid uniqueIdentifier, string jsonPayload, string Login, string Password) - { - this.Invoke("RefreshByJson", new object[] { - uniqueIdentifier, - jsonPayload, - Login, - Password}); - } - - /// - public System.IAsyncResult BeginRefreshByJson(System.Guid uniqueIdentifier, string jsonPayload, string Login, string Password, System.AsyncCallback callback, object asyncState) - { - return this.BeginInvoke("RefreshByJson", new object[] { - uniqueIdentifier, - jsonPayload, - Login, - Password}, callback, asyncState); - } - - /// - public void EndRefreshByJson(System.IAsyncResult asyncResult) - { - this.EndInvoke(asyncResult); - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RefreshByGuid", RequestNamespace = "http://umbraco.org/webservices/", ResponseNamespace = "http://umbraco.org/webservices/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void RefreshByGuid(System.Guid uniqueIdentifier, System.Guid Id, string Login, string Password) - { - this.Invoke("RefreshByGuid", new object[] { - uniqueIdentifier, - Id, - Login, - Password}); - } - - /// - public System.IAsyncResult BeginRefreshByGuid(System.Guid uniqueIdentifier, System.Guid Id, string Login, string Password, System.AsyncCallback callback, object asyncState) - { - return this.BeginInvoke("RefreshByGuid", new object[] { - uniqueIdentifier, - Id, - Login, - Password}, callback, asyncState); - } - - /// - public void EndRefreshByGuid(System.IAsyncResult asyncResult) - { - this.EndInvoke(asyncResult); - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RefreshById", - RequestNamespace = "http://umbraco.org/webservices/", - ResponseNamespace = "http://umbraco.org/webservices/", - Use = System.Web.Services.Description.SoapBindingUse.Literal, - ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void RefreshById(System.Guid uniqueIdentifier, int Id, string Login, string Password) - { - this.Invoke("RefreshById", new object[] { - uniqueIdentifier, - Id, - Login, - Password}); - } - - /// - public System.IAsyncResult BeginRefreshById(System.Guid uniqueIdentifier, int Id, string Login, string Password, System.AsyncCallback callback, object asyncState) - { - return this.BeginInvoke("RefreshById", new object[] { - uniqueIdentifier, - Id, - Login, - Password}, callback, asyncState); - } - - /// - public void EndRefreshById(System.IAsyncResult asyncResult) - { - this.EndInvoke(asyncResult); - } - - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RefreshByIds", - RequestNamespace = "http://umbraco.org/webservices/", - ResponseNamespace = "http://umbraco.org/webservices/", - Use = System.Web.Services.Description.SoapBindingUse.Literal, - ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void RefreshByIds(System.Guid uniqueIdentifier, string jsonIds, string Login, string Password) - { - this.Invoke("RefreshByIds", new object[] { - uniqueIdentifier, - jsonIds, - Login, - Password}); - } - - /// - public System.IAsyncResult BeginRefreshByIds(System.Guid uniqueIdentifier, string jsonIds, string Login, string Password, System.AsyncCallback callback, object asyncState) - { - return this.BeginInvoke("RefreshByIds", new object[] { - uniqueIdentifier, - jsonIds, - Login, - Password}, callback, asyncState); - } - - /// - public void EndRefreshByIds(System.IAsyncResult asyncResult) - { - this.EndInvoke(asyncResult); - } - - - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RemoveById", RequestNamespace = "http://umbraco.org/webservices/", ResponseNamespace = "http://umbraco.org/webservices/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void RemoveById(System.Guid uniqueIdentifier, int Id, string Login, string Password) - { - this.Invoke("RemoveById", new object[] { - uniqueIdentifier, - Id, - Login, - Password}); - } - - /// - public System.IAsyncResult BeginRemoveById(System.Guid uniqueIdentifier, int Id, string Login, string Password, System.AsyncCallback callback, object asyncState) - { - return this.BeginInvoke("RemoveById", new object[] { - uniqueIdentifier, - Id, - Login, - Password}, callback, asyncState); - } - - /// - public void EndRemoveById(System.IAsyncResult asyncResult) - { - this.EndInvoke(asyncResult); - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/GetRefreshers", RequestNamespace = "http://umbraco.org/webservices/", ResponseNamespace = "http://umbraco.org/webservices/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public System.Xml.XmlNode GetRefreshers(string Login, string Password) - { - object[] results = this.Invoke("GetRefreshers", new object[] { - Login, - Password}); - return ((System.Xml.XmlNode)(results[0])); - } - - /// - public System.IAsyncResult BeginGetRefreshers(string Login, string Password, System.AsyncCallback callback, object asyncState) - { - return this.BeginInvoke("GetRefreshers", new object[] { - Login, - Password}, callback, asyncState); - } - - /// - public System.Xml.XmlNode EndGetRefreshers(System.IAsyncResult asyncResult) - { - object[] results = this.EndInvoke(asyncResult); - return ((System.Xml.XmlNode)(results[0])); - } - } -} diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 86c37ca54d..c3c052b2af 100755 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -1524,9 +1524,6 @@ Component - - Component - Properties\SolutionInfo.cs diff --git a/src/Umbraco.Core/UriExtensions.cs b/src/Umbraco.Core/UriExtensions.cs index ba3e677219..083ca90cc4 100644 --- a/src/Umbraco.Core/UriExtensions.cs +++ b/src/Umbraco.Core/UriExtensions.cs @@ -4,7 +4,6 @@ using System.Linq; using Umbraco.Core.Composing; using Umbraco.Core.Configuration; using Umbraco.Core.IO; -using Umbraco.Core.Logging; namespace Umbraco.Core { @@ -28,7 +27,6 @@ namespace Umbraco.Core /// If any route has an extension in the path like .aspx = back office /// /// These are def back office: - /// /Umbraco/RestServices = back office /// /Umbraco/BackOffice = back office /// /Umbraco/Preview = back office /// If it's not any of the above, and there's no extension then we cannot determine if it's back office or front-end @@ -78,7 +76,6 @@ namespace Umbraco.Core //check for special back office paths if (urlPath.InvariantStartsWith("/" + globalSettings.GetUmbracoMvcArea() + "/BackOffice/") - || urlPath.InvariantStartsWith("/" + globalSettings.GetUmbracoMvcArea() + "/RestServices/") || urlPath.InvariantStartsWith("/" + globalSettings.GetUmbracoMvcArea() + "/Preview/")) { return true; diff --git a/src/Umbraco.Tests/Composing/TypeFinderTests.cs b/src/Umbraco.Tests/Composing/TypeFinderTests.cs index 49c807b19f..f615d6cebb 100644 --- a/src/Umbraco.Tests/Composing/TypeFinderTests.cs +++ b/src/Umbraco.Tests/Composing/TypeFinderTests.cs @@ -367,7 +367,6 @@ namespace Umbraco.Tests.Composing "umbraco.interfaces,", "umbraco.providers,", "Umbraco.Web.UI,", - "umbraco.webservices", "Lucene.", "Examine,", "Examine.", diff --git a/src/Umbraco.Tests/CoreThings/UriExtensionsTests.cs b/src/Umbraco.Tests/CoreThings/UriExtensionsTests.cs index f253d44973..be7aec631e 100644 --- a/src/Umbraco.Tests/CoreThings/UriExtensionsTests.cs +++ b/src/Umbraco.Tests/CoreThings/UriExtensionsTests.cs @@ -33,7 +33,6 @@ namespace Umbraco.Tests.CoreThings [TestCase("http://www.domain.com/umbrac", "", false)] [TestCase("http://www.domain.com/test", "", false)] [TestCase("http://www.domain.com/test/umbraco", "", false)] - [TestCase("http://www.domain.com/Umbraco/restServices/blah", "", true)] [TestCase("http://www.domain.com/Umbraco/Backoffice/blah", "", true)] [TestCase("http://www.domain.com/Umbraco/anything", "", true)] [TestCase("http://www.domain.com/Umbraco/anything/", "", true)] @@ -42,8 +41,6 @@ namespace Umbraco.Tests.CoreThings [TestCase("http://www.domain.com/myvdir/umbraco/api/blah", "myvdir", false)] [TestCase("http://www.domain.com/MyVdir/umbraco/api/blah", "/myvdir", false)] [TestCase("http://www.domain.com/MyVdir/Umbraco/", "myvdir", true)] - [TestCase("http://www.domain.com/MyVdir/Umbraco/restServices/blah", "/myvdir", true)] - [TestCase("http://www.domain.com/umbraco/webservices/legacyAjaxCalls.asmx/js", "", true)] [TestCase("http://www.domain.com/umbraco/test/legacyAjaxCalls.ashx?some=query&blah=js", "", true)] public void Is_Back_Office_Request(string input, string virtualPath, bool expected) { diff --git a/src/Umbraco.Tests/IO/IoHelperTests.cs b/src/Umbraco.Tests/IO/IoHelperTests.cs index b0e59cbb55..3f510dd57e 100644 --- a/src/Umbraco.Tests/IO/IoHelperTests.cs +++ b/src/Umbraco.Tests/IO/IoHelperTests.cs @@ -44,7 +44,6 @@ namespace Umbraco.Tests.IO Assert.AreEqual(IOHelper.MapPath(SystemDirectories.Scripts, true), IOHelper.MapPath(SystemDirectories.Scripts, false)); Assert.AreEqual(IOHelper.MapPath(SystemDirectories.Umbraco, true), IOHelper.MapPath(SystemDirectories.Umbraco, false)); Assert.AreEqual(IOHelper.MapPath(SystemDirectories.UserControls, true), IOHelper.MapPath(SystemDirectories.UserControls, false)); - Assert.AreEqual(IOHelper.MapPath(SystemDirectories.WebServices, true), IOHelper.MapPath(SystemDirectories.WebServices, false)); } [Test] diff --git a/src/Umbraco.Web/Mvc/BackOfficeArea.cs b/src/Umbraco.Web/Mvc/BackOfficeArea.cs index f501a70729..e72f2cc81a 100644 --- a/src/Umbraco.Web/Mvc/BackOfficeArea.cs +++ b/src/Umbraco.Web/Mvc/BackOfficeArea.cs @@ -44,14 +44,6 @@ namespace Umbraco.Web.Mvc id = @"[a-zA-Z]*" }, new[] {typeof (BackOfficeController).Namespace}); - - //Create the REST/web/script service routes - context.MapRoute( - "Umbraco_web_services", - _globalSettings.GetUmbracoMvcArea() + "/RestServices/{controller}/{action}/{id}", - new {controller = "SaveFileController", action = "Index", id = UrlParameter.Optional}, - //look in this namespace for controllers - new[] {"Umbraco.Web.WebServices"}); } public override string AreaName => _globalSettings.GetUmbracoMvcArea(); diff --git a/src/Umbraco.Web/Routing/WebServicesRouteConstraint.cs b/src/Umbraco.Web/Routing/WebServicesRouteConstraint.cs deleted file mode 100644 index 4b2ecc28fe..0000000000 --- a/src/Umbraco.Web/Routing/WebServicesRouteConstraint.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Web; -using System.Web.Routing; - -namespace Umbraco.Web.Routing -{ - //public class WebServicesRouteConstraint : IRouteConstraint - //{ - // public bool Match( - // HttpContextBase httpContext, - // Route route, - // string parameterName, - // RouteValueDictionary values, - // RouteDirection routeDirection) - // { - // if (routeDirection == RouteDirection.UrlGeneration) - // { - - // } - // return true; - // } - //} -} diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index ccf8c49485..5c1fb9d91d 100755 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -1137,7 +1137,6 @@ - From c778249fed1ae34d0dc824c00fee648ffcc671d5 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Tue, 29 Jan 2019 14:33:41 +0100 Subject: [PATCH 2/4] Fix the approved color styling --- .../src/less/components/umb-color-swatches.less | 4 ---- .../src/views/components/umb-color-swatches.html | 5 ++--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-color-swatches.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-color-swatches.less index 6dc2dd6ff3..8cf64e183c 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-color-swatches.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-color-swatches.less @@ -57,10 +57,6 @@ .umb-color-box__label { background: @white; font-size: 14px; - display: flex; - flex-flow: column wrap; - flex: 1 0 100%; - justify-content: flex-end; padding: 1px 5px; min-height: 45px; max-width: 100%; diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-color-swatches.html b/src/Umbraco.Web.UI.Client/src/views/components/umb-color-swatches.html index a18319b4f2..24aa29125e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-color-swatches.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-color-swatches.html @@ -2,8 +2,8 @@ - \ No newline at end of file From 4915efbb8d0aced43a3bb5d634021aa510b4036a Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Tue, 29 Jan 2019 14:38:52 +0100 Subject: [PATCH 3/4] Re-select selected color on reload --- .../src/views/components/umb-color-swatches.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-color-swatches.html b/src/Umbraco.Web.UI.Client/src/views/components/umb-color-swatches.html index 24aa29125e..74c010307a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-color-swatches.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-color-swatches.html @@ -3,7 +3,7 @@