diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRedirectUrlRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRedirectUrlRepository.cs index 963128b7da..adf0816196 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRedirectUrlRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRedirectUrlRepository.cs @@ -66,5 +66,15 @@ namespace Umbraco.Core.Persistence.Repositories /// The total count of redirect urls. /// The redirect urls. IEnumerable GetAllUrls(int rootContentId, long pageIndex, int pageSize, out long total); + + /// + /// Searches for all redirect urls that contain a given search term in their URL property. + /// + /// The term to search for. + /// The page index. + /// The page size. + /// The total count of redirect urls. + /// The redirect urls. + IEnumerable SearchUrls(string searchTerm, long pageIndex, int pageSize, out long total); } } diff --git a/src/Umbraco.Core/Persistence/Repositories/RedirectUrlRepository.cs b/src/Umbraco.Core/Persistence/Repositories/RedirectUrlRepository.cs index 7073aae560..5452e868a0 100644 --- a/src/Umbraco.Core/Persistence/Repositories/RedirectUrlRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/RedirectUrlRepository.cs @@ -117,6 +117,7 @@ JOIN umbracoNode ON umbracoRedirectUrl.contentKey=umbracoNode.uniqueID"); try { url.DisableChangeTracking(); + url.Key = dto.Id; url.Id = dto.Id.GetHashCode(); url.ContentId = dto.ContentId; url.ContentKey = dto.ContentKey; @@ -185,7 +186,19 @@ JOIN umbracoNode ON umbracoRedirectUrl.contentKey=umbracoNode.uniqueID"); public IEnumerable GetAllUrls(int rootContentId, long pageIndex, int pageSize, out long total) { var sql = GetBaseQuery(false) - .Where("umbracoNode.path LIKE @path", new { path = "%," + rootContentId + ",%" }) + .Where(string.Format("{0}.{1} LIKE @path", SqlSyntax.GetQuotedTableName("umbracoNode"), SqlSyntax.GetQuotedColumnName("path")), new { path = "%," + rootContentId + ",%" }) + .OrderByDescending(x => x.CreateDateUtc, SqlSyntax); + var result = Database.Page(pageIndex + 1, pageSize, sql); + total = Convert.ToInt32(result.TotalItems); + + var rules = result.Items.Select(Map); + return rules; + } + + public IEnumerable SearchUrls(string searchTerm, long pageIndex, int pageSize, out long total) + { + var sql = GetBaseQuery(false) + .Where(string.Format("{0}.{1} LIKE @url", SqlSyntax.GetQuotedTableName("umbracoRedirectUrl"), SqlSyntax.GetQuotedColumnName("Url")), new { url = "%" + searchTerm.Trim().ToLowerInvariant() + "%" }) .OrderByDescending(x => x.CreateDateUtc, SqlSyntax); var result = Database.Page(pageIndex + 1, pageSize, sql); total = Convert.ToInt32(result.TotalItems); diff --git a/src/Umbraco.Core/Services/IRedirectUrlService.cs b/src/Umbraco.Core/Services/IRedirectUrlService.cs index d359958d63..1249b3b664 100644 --- a/src/Umbraco.Core/Services/IRedirectUrlService.cs +++ b/src/Umbraco.Core/Services/IRedirectUrlService.cs @@ -72,5 +72,15 @@ namespace Umbraco.Core.Services /// The total count of redirect urls. /// The redirect urls. IEnumerable GetAllRedirectUrls(int rootContentId, long pageIndex, int pageSize, out long total); + + /// + /// Searches for all redirect urls that contain a given search term in their URL property. + /// + /// The term to search for. + /// The page index. + /// The page size. + /// The total count of redirect urls. + /// The redirect urls. + IEnumerable SearchRedirectUrls(string searchTerm, long pageIndex, int pageSize, out long total); } } diff --git a/src/Umbraco.Core/Services/RedirectUrlService.cs b/src/Umbraco.Core/Services/RedirectUrlService.cs index 723532665a..0283332401 100644 --- a/src/Umbraco.Core/Services/RedirectUrlService.cs +++ b/src/Umbraco.Core/Services/RedirectUrlService.cs @@ -75,7 +75,6 @@ namespace Umbraco.Core.Services using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) { var rule = repo.GetMostRecentUrl(url); - uow.Commit(); return rule; } } @@ -86,7 +85,6 @@ namespace Umbraco.Core.Services using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) { var rules = repo.GetContentUrls(contentKey); - uow.Commit(); return rules; } } @@ -97,7 +95,6 @@ namespace Umbraco.Core.Services using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) { var rules = repo.GetAllUrls(pageIndex, pageSize, out total); - uow.Commit(); return rules; } } @@ -108,7 +105,15 @@ namespace Umbraco.Core.Services using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) { var rules = repo.GetAllUrls(rootContentId, pageIndex, pageSize, out total); - uow.Commit(); + return rules; + } + } + public IEnumerable SearchRedirectUrls(string searchTerm, long pageIndex, int pageSize, out long total) + { + using (var uow = UowProvider.GetUnitOfWork()) + using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) + { + var rules = repo.SearchUrls(searchTerm, pageIndex, pageSize, out total); return rules; } } diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/redirecturls.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/redirecturls.resource.js new file mode 100644 index 0000000000..936c934320 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/common/resources/redirecturls.resource.js @@ -0,0 +1,119 @@ +/** + * @ngdoc service + * @name umbraco.resources.redirectUrlResource + * @function + * + * @description + * Used by the redirect url dashboard to get urls and send requests to remove redirects. + */ +(function() { + 'use strict'; + + function redirectUrlsResource($http, umbRequestHelper) { + + /** + * @ngdoc function + * @name umbraco.resources.redirectUrlResource#searchRedirectUrls + * @methodOf umbraco.resources.redirectUrlResource + * @function + * + * @description + * Called to search redirects + * ##usage + *
+         * redirectUrlsResource.searchRedirectUrls("", 0, 20)
+         *    .then(function(response) {
+         *
+         *    });
+         * 
+ * @param {String} searchTerm Searh term + * @param {Int} pageIndex index of the page to retrive items from + * @param {Int} pageSize The number of items on a page + */ + function searchRedirectUrls(searchTerm, pageIndex, pageSize) { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "redirectUrlManagementApiBaseUrl", + "SearchRedirectUrls", + { searchTerm: searchTerm, pageIndex: pageIndex, pageSize: pageSize })), + 'Failed to retrieve data for searching redirect urls'); + } + + function isEnabled() { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "redirectUrlManagementApiBaseUrl", + "IsEnabled")), + 'Failed to retrieve data to check if the 301 redirect is enabled'); + } + + /** + * @ngdoc function + * @name umbraco.resources.redirectUrlResource#deleteRedirectUrl + * @methodOf umbraco.resources.redirectUrlResource + * @function + * + * @description + * Called to delete a redirect + * ##usage + *
+         * redirectUrlsResource.deleteRedirectUrl(1234)
+         *    .then(function() {
+         *
+         *    });
+         * 
+ * @param {Int} id Id of the redirect + */ + function deleteRedirectUrl(id) { + return umbRequestHelper.resourcePromise( + $http.post( + umbRequestHelper.getApiUrl( + "redirectUrlManagementApiBaseUrl", + "DeleteRedirectUrl", { id: id })), + 'Failed to remove redirect'); + } + + /** + * @ngdoc function + * @name umbraco.resources.redirectUrlResource#toggleUrlTracker + * @methodOf umbraco.resources.redirectUrlResource + * @function + * + * @description + * Called to enable or disable redirect url tracker + * ##usage + *
+         * redirectUrlsResource.toggleUrlTracker(true)
+         *    .then(function() {
+         *
+         *    });
+         * 
+ * @param {Bool} disable true/false to disable/enable the url tracker + */ + function toggleUrlTracker(disable) { + return umbRequestHelper.resourcePromise( + $http.post( + umbRequestHelper.getApiUrl( + "redirectUrlManagementApiBaseUrl", + "ToggleUrlTracker", { disable: disable })), + 'Failed to toggle redirect url tracker'); + } + + var resource = { + searchRedirectUrls: searchRedirectUrls, + deleteRedirectUrl: deleteRedirectUrl, + toggleUrlTracker: toggleUrlTracker, + isEnabled: isEnabled + }; + + return resource; + + } + + angular.module('umbraco.resources').factory('redirectUrlsResource', redirectUrlsResource); + +})(); diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less index cfbf425bef..f14df918c0 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less @@ -331,6 +331,11 @@ width: 100%; } +.umb-era-button.umb-button--s { + height: 30px; + font-size: 13px; +} + /* CATEGORIES */ diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-table.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-table.less index 874f9e9551..219c15c7d5 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-table.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-table.less @@ -3,6 +3,8 @@ display: flex; flex-direction: column; + position: relative; + border: 1px solid @grayLight; flex-wrap: nowrap; @@ -11,6 +13,25 @@ min-width: 640px; } +.umb-table.umb-table-inactive { + + &:before { + content: ""; + background: rgba(255, 255, 255, 0.75); + + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + + z-index: 10; + + outline: 1px solid rgba(255, 255, 255, 0.75); + } + +} + .umb-table a { text-decoration: none; cursor: pointer; @@ -93,6 +114,14 @@ input.umb-table__input { } } +.umb-table-body .umb-table-row.-solid { + cursor: default; + + &:hover { + background-color: white; + } +} + .umb-table-body__link { text-decoration: none; @@ -183,6 +212,8 @@ input.umb-table__input { user-select: none; } + + .umb-table-row.-selected, .umb-table-row.-selected:hover { background-color: fade(@blueDark, 4%); diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/redirecturls.controller.js b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/redirecturls.controller.js new file mode 100644 index 0000000000..8af12709a9 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/redirecturls.controller.js @@ -0,0 +1,144 @@ +(function() { + "use strict"; + + function RedirectUrlsController($scope, redirectUrlsResource, notificationsService, $q) { + //...todo + //search by url or url part + //search by domain + //display domain in dashboard results? + + //used to cancel any request in progress if another one needs to take it's place + var vm = this; + var canceler = null; + + vm.dashboard = { + searchTerm: "", + loading: false, + urlTrackerDisabled: false + }; + + vm.pagination = { + pageIndex: 0, + pageNumber: 1, + totalPages: 1, + pageSize: 20 + }; + + vm.goToPage = goToPage; + vm.search = search; + vm.removeRedirect = removeRedirect; + vm.disableUrlTracker = disableUrlTracker; + vm.enableUrlTracker = enableUrlTracker; + vm.filter = filter; + vm.checkEnabled = checkEnabled; + + function activate() { + vm.checkEnabled().then(function() { + vm.search(); + }); + } + + function checkEnabled() { + vm.dashboard.loading = true; + return redirectUrlsResource.isEnabled().then(function (response) { + vm.dashboard.urlTrackerDisabled = response !== "true"; + vm.dashboard.loading = false; + }); + } + + function goToPage(pageNumber) { + vm.pagination.pageIndex = pageNumber - 1; + vm.pagination.pageNumber = pageNumber; + vm.search(); + } + + function search() { + + vm.dashboard.loading = true; + + var searchTerm = vm.dashboard.searchTerm; + if (searchTerm === undefined) { + searchTerm = ""; + } + + redirectUrlsResource.searchRedirectUrls(searchTerm, vm.pagination.pageIndex, vm.pagination.pageSize).then(function(response) { + + vm.redirectUrls = response.searchResults; + + // update pagination + vm.pagination.pageIndex = response.currentPage; + vm.pagination.pageNumber = response.currentPage + 1; + vm.pagination.totalPages = response.pageCount; + + vm.dashboard.loading = false; + + }); + } + + function removeRedirect(redirectToDelete) { + + redirectUrlsResource.deleteRedirectUrl(redirectToDelete.redirectId).then(function () { + + var index = vm.redirectUrls.indexOf(redirectToDelete); + vm.redirectUrls.splice(index, 1); + notificationsService.success("Redirect Url Removed!", "Redirect Url " + redirectToDelete.Url + " has been deleted"); + + }, function(error) { + + notificationsService.error("Redirect Url Error!", "Redirect Url " + redirectToDelete.Url + " was not deleted"); + + }); + + } + + function disableUrlTracker() { + var toggleConfirm = confirm("Are you sure you want to disable the URL tracker?"); + if (toggleConfirm) { + + redirectUrlsResource.toggleUrlTracker(true).then(function() { + activate(); + notificationsService.success("URL Tracker has now been disabled"); + }, function(error) { + notificationsService.warning("Error disabling the URL Tracker, more information can be found in your log file."); + }); + + } + } + + function enableUrlTracker() { + redirectUrlsResource.toggleUrlTracker(false).then(function() { + activate(); + notificationsService.success("URL Tracker has now been enabled"); + }, function(error) { + notificationsService.warning("Error enabling the URL Tracker, more information can be found in your log file."); + }); + } + + var filterDebounced = _.debounce(function(e) { + + $scope.$apply(function() { + + //a canceler exists, so perform the cancelation operation and reset + if (canceler) { + canceler.resolve(); + canceler = $q.defer(); + } else { + canceler = $q.defer(); + } + + vm.search(); + + }); + + }, 200); + + function filter() { + filterDebounced(); + } + + activate(); + + } + + angular.module("umbraco").controller("Umbraco.Dashboard.RedirectUrlsController", RedirectUrlsController); +})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/redirecturls.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/redirecturls.html new file mode 100644 index 0000000000..fe6424424a --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/redirecturls.html @@ -0,0 +1,99 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
Original Url
+
Redirected To
+
Date Created
+
+
+
+ +
+ +
+ +
+ +
+ + + + + +
+ {{redirectUrl.createDateUtc | date:'medium'}} +
+ +
+ Edit + +
+ +
+ +
+ +
+ +
+ + +
+ +
diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 0ffe8e2a8b..51c3f4b053 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -40,8 +40,7 @@ v4.5 true - - + 44319 diff --git a/src/Umbraco.Web.UI/config/Dashboard.config b/src/Umbraco.Web.UI/config/Dashboard.config index df45708e0f..9eb808c67c 100644 --- a/src/Umbraco.Web.UI/config/Dashboard.config +++ b/src/Umbraco.Web.UI/config/Dashboard.config @@ -109,4 +109,14 @@ +
+ + developer + + + + views/dashboard/developer/redirecturls.html + + +
diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs index ccc339b3f8..9049aafac2 100644 --- a/src/Umbraco.Web/Editors/BackOfficeController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeController.cs @@ -224,6 +224,10 @@ namespace Umbraco.Web.Editors {"gridConfig", Url.Action("GetGridConfig", "BackOffice")}, {"serverVarsJs", Url.Action("Application", "BackOffice")}, //API URLs + { + "redirectUrlManagementApiBaseUrl", Url.GetUmbracoApiServiceBaseUrl( + controller => controller.IsEnabled()) + }, { "embedApiBaseUrl", Url.GetUmbracoApiServiceBaseUrl( controller => controller.GetEmbed("", 0, 0)) diff --git a/src/Umbraco.Web/Editors/RedirectUrlManagementController.cs b/src/Umbraco.Web/Editors/RedirectUrlManagementController.cs new file mode 100644 index 0000000000..9c55e0df01 --- /dev/null +++ b/src/Umbraco.Web/Editors/RedirectUrlManagementController.cs @@ -0,0 +1,91 @@ +using System; +using System.Web.Hosting; +using System.Web.Http; +using System.Xml; +using System.Collections.Generic; +using System.Linq; +using AutoMapper; +using Umbraco.Core.Configuration; +using Umbraco.Web.Models.ContentEditing; +using Umbraco.Web.Mvc; +using Umbraco.Web.WebApi; +using File = System.IO.File; + +namespace Umbraco.Web.Editors +{ + [PluginController("UmbracoApi")] + public class RedirectUrlManagementController : UmbracoAuthorizedApiController + { + + /// + /// Returns true/false of whether redirect tracking is enabled or not + /// + /// + [HttpGet] + public bool IsEnabled() + { + return UmbracoConfig.For.UmbracoSettings().WebRouting.DisableRedirectUrlTracking == false; + } + + //add paging + [HttpGet] + public RedirectUrlSearchResult SearchRedirectUrls(string searchTerm, int page = 0, int pageSize = 10) + { + var searchResult = new RedirectUrlSearchResult(); + var redirectUrlService = Services.RedirectUrlService; + long resultCount; + + var redirects = string.IsNullOrWhiteSpace(searchTerm) + ? redirectUrlService.GetAllRedirectUrls(page, pageSize, out resultCount) + : redirectUrlService.SearchRedirectUrls(searchTerm, page, pageSize, out resultCount); + + searchResult.SearchResults = Mapper.Map>(redirects).ToArray(); + //now map the Content/published url + foreach (var result in searchResult.SearchResults) + { + result.DestinationUrl = result.ContentId > 0 ? Umbraco.Url(result.ContentId) : "#"; + } + + searchResult.TotalCount = resultCount; + searchResult.CurrentPage = page; + searchResult.PageCount = ((int)resultCount + pageSize - 1) / pageSize; + + return searchResult; + + } + + [HttpPost] + public IHttpActionResult DeleteRedirectUrl(Guid id) + { + var redirectUrlService = Services.RedirectUrlService; + redirectUrlService.Delete(id); + return Ok(); + } + + [HttpPost] + public IHttpActionResult ToggleUrlTracker(bool disable) + { + var httpContext = TryGetHttpContext(); + if (httpContext.Success == false) throw new InvalidOperationException("Cannot acquire HttpContext"); + var configFilePath = httpContext.Result.Server.MapPath("~/config/umbracoSettings.config"); + + var action = disable ? "disable" : "enable"; + + if (File.Exists(configFilePath) == false) + return BadRequest(string.Format("Couldn't {0} URL Tracker, the umbracoSettings.config file does not exist.", action)); + + var umbracoConfig = new XmlDocument { PreserveWhitespace = true }; + umbracoConfig.Load(configFilePath); + + var webRoutingElement = umbracoConfig.SelectSingleNode("//web.routing") as XmlElement; + if (webRoutingElement == null) + return BadRequest(string.Format("Couldn't {0} URL Tracker, the web.routing element was not found in umbracoSettings.config.", action)); + + // note: this adds the attribute if it does not exist + webRoutingElement.SetAttribute("disableRedirectUrlTracking", disable.ToString().ToLowerInvariant()); + umbracoConfig.Save(configFilePath); + + return Ok(string.Format("URL tracker is now {0}d", action)); + } + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentRedirectUrl.cs b/src/Umbraco.Web/Models/ContentEditing/ContentRedirectUrl.cs new file mode 100644 index 0000000000..38fdb265b8 --- /dev/null +++ b/src/Umbraco.Web/Models/ContentEditing/ContentRedirectUrl.cs @@ -0,0 +1,24 @@ +using System; +using System.Runtime.Serialization; + +namespace Umbraco.Web.Models.ContentEditing +{ + [DataContract(Name = "contentRedirectUrl", Namespace = "")] + public class ContentRedirectUrl + { + [DataMember(Name = "redirectId")] + public Guid RedirectId { get; set; } + + [DataMember(Name = "originalUrl")] + public string OriginalUrl { get; set; } + + [DataMember(Name = "destinationUrl")] + public string DestinationUrl { get; set; } + + [DataMember(Name = "createDateUtc")] + public DateTime CreateDateUtc { get; set; } + + [DataMember(Name = "contentId")] + public int ContentId { get; set; } + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/Models/ContentEditing/RedirectUrlSearchResults.cs b/src/Umbraco.Web/Models/ContentEditing/RedirectUrlSearchResults.cs new file mode 100644 index 0000000000..6a64b0dbc4 --- /dev/null +++ b/src/Umbraco.Web/Models/ContentEditing/RedirectUrlSearchResults.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; +using System.Runtime.Serialization; +using Umbraco.Core.Models; + +namespace Umbraco.Web.Models.ContentEditing +{ + [DataContract(Name = "redirectUrlSearchResult", Namespace = "")] + public class RedirectUrlSearchResult + { + [DataMember(Name = "searchResults")] + public IEnumerable SearchResults { get; set; } + + [DataMember(Name = "totalCount")] + public long TotalCount { get; set; } + + [DataMember(Name = "pageCount")] + public int PageCount { get; set; } + + [DataMember(Name = "currentPage")] + public int CurrentPage { get; set; } + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/Models/Mapping/DashboardModelsMapper.cs b/src/Umbraco.Web/Models/Mapping/DashboardModelsMapper.cs new file mode 100644 index 0000000000..a87ea4eeb9 --- /dev/null +++ b/src/Umbraco.Web/Models/Mapping/DashboardModelsMapper.cs @@ -0,0 +1,27 @@ +using AutoMapper; +using Umbraco.Core; +using Umbraco.Core.Models.Mapping; +using Umbraco.Web.Models.ContentEditing; +using umbraco.BusinessLogic; +using Umbraco.Core.Models; + +namespace Umbraco.Web.Models.Mapping +{ + /// + /// A model mapper used to map models for the various dashboards + /// + internal class DashboardModelsMapper : MapperConfiguration + { + public override void ConfigureMappings(IConfiguration config, ApplicationContext applicationContext) + { + config.CreateMap() + .ForMember(x => x.OriginalUrl, expression => expression.MapFrom(item => item.Url)) + .ForMember(x => x.DestinationUrl, expression => expression.Ignore()) + .ForMember(x => x.RedirectId, expression => expression.MapFrom(item => item.Key)); + + //for the logging controller (and assuming dashboard that is used in uaas? otherwise not sure what that controller is used for) + config.CreateMap() + .ForMember(log => log.LogType, expression => expression.MapFrom(item => Enum.Parse(item.LogType.ToString()))); + } + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/Models/Mapping/LogModelMapper.cs b/src/Umbraco.Web/Models/Mapping/LogModelMapper.cs deleted file mode 100644 index db205f9d9e..0000000000 --- a/src/Umbraco.Web/Models/Mapping/LogModelMapper.cs +++ /dev/null @@ -1,17 +0,0 @@ -using AutoMapper; -using Umbraco.Core; -using Umbraco.Core.Models.Mapping; -using Umbraco.Web.Models.ContentEditing; -using umbraco.BusinessLogic; - -namespace Umbraco.Web.Models.Mapping -{ - internal class LogModelMapper : MapperConfiguration - { - public override void ConfigureMappings(IConfiguration config, ApplicationContext applicationContext) - { - config.CreateMap() - .ForMember(log => log.LogType, expression => expression.MapFrom(item => Enum.Parse(item.LogType.ToString()))); - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 41f0256cab..cc61d99b4a 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -344,6 +344,7 @@ + @@ -391,6 +392,8 @@ + + @@ -583,7 +586,7 @@ - +