From a69d705d344a976e713c6a2873b369c2be2445c7 Mon Sep 17 00:00:00 2001 From: Mole Date: Wed, 30 Sep 2020 10:21:21 +0200 Subject: [PATCH] Clean --- .../BackOfficeServiceCollectionExtensions.cs | 1 - .../Routing/BackOfficeAreaRoutes.cs | 4 ++++ .../SignalR/PreviewHubComposer.cs | 2 -- .../src/preview/preview.controller.js | 16 ++++++++-------- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Umbraco.Web.BackOffice/Extensions/BackOfficeServiceCollectionExtensions.cs b/src/Umbraco.Web.BackOffice/Extensions/BackOfficeServiceCollectionExtensions.cs index be18faf4ee..8dc1b8c417 100644 --- a/src/Umbraco.Web.BackOffice/Extensions/BackOfficeServiceCollectionExtensions.cs +++ b/src/Umbraco.Web.BackOffice/Extensions/BackOfficeServiceCollectionExtensions.cs @@ -45,7 +45,6 @@ namespace Umbraco.Extensions services.ConfigureOptions(); } - // AddUmbracoPreview -> Use in UmbracoBuilderExtensions public static void AddUmbracoPreview(this IServiceCollection services) { services.AddSignalR(); diff --git a/src/Umbraco.Web.BackOffice/Routing/BackOfficeAreaRoutes.cs b/src/Umbraco.Web.BackOffice/Routing/BackOfficeAreaRoutes.cs index 480a7f0fc6..c6f453ca18 100644 --- a/src/Umbraco.Web.BackOffice/Routing/BackOfficeAreaRoutes.cs +++ b/src/Umbraco.Web.BackOffice/Routing/BackOfficeAreaRoutes.cs @@ -62,6 +62,10 @@ namespace Umbraco.Web.BackOffice.Routing } } + /// + /// Returns the path to the signalR hub used for preview + /// + /// Path to signalR hub public string GetPreviewHubRoute() { return $"/{_umbracoPathSegment}/{nameof(PreviewHub)}"; diff --git a/src/Umbraco.Web.BackOffice/SignalR/PreviewHubComposer.cs b/src/Umbraco.Web.BackOffice/SignalR/PreviewHubComposer.cs index 4a6e3d30d4..6660d918c0 100644 --- a/src/Umbraco.Web.BackOffice/SignalR/PreviewHubComposer.cs +++ b/src/Umbraco.Web.BackOffice/SignalR/PreviewHubComposer.cs @@ -10,8 +10,6 @@ namespace Umbraco.Web.SignalR public override void Compose(Composition composition) { base.Compose(composition); - - // composition.RegisterUnique(_ => GlobalHost.ConnectionManager.GetHubContext()); } } } diff --git a/src/Umbraco.Web.UI.Client/src/preview/preview.controller.js b/src/Umbraco.Web.UI.Client/src/preview/preview.controller.js index e5d5b6c636..b312c57503 100644 --- a/src/Umbraco.Web.UI.Client/src/preview/preview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/preview/preview.controller.js @@ -5,7 +5,7 @@ var app = angular.module("umbraco.preview", ['umbraco.resources', 'umbraco.services']) - .controller("previewController", function ($scope, $window, $location, umbRequestHelper) { + .controller("previewController", function ($scope, $window, $location) { $scope.currentCulture = { iso: '', title: '...', icon: 'icon-loading' } var cultures = []; @@ -70,29 +70,29 @@ var app = angular.module("umbraco.preview", ['umbraco.resources', 'umbraco.servi .build(); $.connection.on("refreshed", function (message) { - console.log('Notified by SignalR preview hub (' + message + ').'); + console.log("Notified by SignalR preview hub (" + message + ")."); if ($scope.pageId != message) { - console.log('Not a notification for us (' + $scope.pageId + ').'); + console.log("Not a notification for us (" + $scope.pageId + ")."); return; } if (!visibleContent) { - console.log('Not visible, will reload.'); + console.log("Not visible, will reload."); dirtyContent = true; return; } - console.log('Reloading.'); + console.log("Reloading."); var iframeDoc = iframe.contentWindow || iframe.contentDocument; iframeDoc.location.reload(); }) try { $.connection.start().then(function () { - console.log('Connected to SignalR preview hub (ID=' + $.connection.connectionId + ')'); + console.log("Connected to SignalR preview hub (ID=" + $.connection.connectionId + ")"); }).catch(function () { - console.log('Could not connect to SignalR preview hub.'); + console.log("Could not connect to SignalR preview hub."); }); } catch (e) { - console.error('Could not establish signalr connection. Error: ' + e); + console.error("Could not establish signalr connection. Error: " + e); } }