Netcore: Moves services and dependencies from Web to Abstractions (#7497)
* Moves the services and dependencies from web, * Fix bug with Empty collection not being a property (new one for each access) * remvoed moved files from web csproj * Fix spelling
This commit is contained in:
committed by
Elitsa Marinovska
parent
09b9c01f94
commit
3b7825b30d
-1
@@ -4,7 +4,6 @@ using System.Linq;
|
||||
using Umbraco.Core.Models.Sections;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Sections;
|
||||
using Umbraco.Web.Trees;
|
||||
|
||||
namespace Umbraco.Web.Services
|
||||
{
|
||||
+1
-3
@@ -2,11 +2,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Core.Dashboards;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Core.Services.Implement;
|
||||
using Umbraco.Web.Dashboards;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
|
||||
@@ -15,7 +13,7 @@ namespace Umbraco.Web.Services
|
||||
/// <summary>
|
||||
/// A utility class for determine dashboard security
|
||||
/// </summary>
|
||||
internal class DashboardService : IDashboardService
|
||||
public class DashboardService : IDashboardService
|
||||
{
|
||||
// TODO: Unit test all this!!! :/
|
||||
|
||||
@@ -13,7 +13,6 @@ using Umbraco.Web.PublishedCache;
|
||||
using Umbraco.Web.Routing;
|
||||
using Umbraco.Web.Scheduling;
|
||||
using Umbraco.Web.Search;
|
||||
using Current = Umbraco.Web.Composing.Current;
|
||||
|
||||
namespace Umbraco.Web.Compose
|
||||
{
|
||||
@@ -46,7 +45,7 @@ namespace Umbraco.Web.Compose
|
||||
{
|
||||
//rebuild the xml cache file if the server is not synced
|
||||
() =>
|
||||
{
|
||||
{
|
||||
var publishedSnapshotService = factory.GetInstance<IPublishedSnapshotService>();
|
||||
|
||||
// rebuild the published snapshot caches entirely, if the server is not synced
|
||||
|
||||
@@ -39,8 +39,5 @@ namespace Umbraco.Web.Models.Trees
|
||||
{
|
||||
get { return _menuItems; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Actions;
|
||||
using Umbraco.Web.Composing;
|
||||
|
||||
|
||||
namespace Umbraco.Web.Models.Trees
|
||||
{
|
||||
/// <summary>
|
||||
@@ -20,49 +17,17 @@ namespace Umbraco.Web.Models.Trees
|
||||
{
|
||||
}
|
||||
|
||||
public MenuItemList(IEnumerable<MenuItem> items)
|
||||
public MenuItemList( IEnumerable<MenuItem> items)
|
||||
: base(items)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a menu item based on a <see cref="IAction"/>
|
||||
/// </summary>
|
||||
/// <param name="action"></param>
|
||||
/// <param name="name">The text to display for the menu item, will default to the IAction alias if not specified</param>
|
||||
internal MenuItem Add(IAction action, string name)
|
||||
{
|
||||
var item = new MenuItem(action, name);
|
||||
|
||||
Add(item);
|
||||
return item;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a menu item with a dictionary which is merged to the AdditionalData bag
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="hasSeparator"></param>
|
||||
/// <param name="name">The text to display for the menu item, will default to the IAction alias if not specified</param>
|
||||
/// <param name="opensDialog">Whether or not this action opens a dialog</param>
|
||||
public MenuItem Add<T>(string name, bool hasSeparator = false, bool opensDialog = false)
|
||||
where T : IAction
|
||||
{
|
||||
var item = CreateMenuItem<T>(name, hasSeparator, opensDialog);
|
||||
if (item != null)
|
||||
{
|
||||
Add(item);
|
||||
return item;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a menu item with a dictionary which is merged to the AdditionalData bag
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="hasSeparator"></param>
|
||||
/// <param name="textService">The <see cref="ILocalizedTextService"/> used to localize the action name based on it's alias</param>
|
||||
/// <param name="textService">The <see cref="ILocalizedTextService"/> used to localize the action name based on its alias</param>
|
||||
/// <param name="opensDialog">Whether or not this action opens a dialog</param>
|
||||
public MenuItem Add<T>(ILocalizedTextService textService, bool hasSeparator = false, bool opensDialog = false)
|
||||
where T : IAction
|
||||
@@ -75,22 +40,8 @@ namespace Umbraco.Web.Models.Trees
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
internal MenuItem CreateMenuItem<T>(string name, bool hasSeparator = false, bool opensDialog = false)
|
||||
where T : IAction
|
||||
{
|
||||
var item = Current.Actions.GetAction<T>();
|
||||
if (item == null) return null;
|
||||
var menuItem = new MenuItem(item, name)
|
||||
{
|
||||
SeparatorBefore = hasSeparator,
|
||||
OpensDialog = opensDialog
|
||||
};
|
||||
|
||||
return menuItem;
|
||||
}
|
||||
|
||||
internal MenuItem CreateMenuItem<T>(ILocalizedTextService textService, bool hasSeparator = false, bool opensDialog = false)
|
||||
private MenuItem CreateMenuItem<T>(ILocalizedTextService textService, bool hasSeparator = false, bool opensDialog = false)
|
||||
where T : IAction
|
||||
{
|
||||
var item = Current.Actions.GetAction<T>();
|
||||
@@ -104,6 +55,6 @@ namespace Umbraco.Web.Models.Trees
|
||||
|
||||
return menuItem;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ namespace Umbraco.Web.Trees
|
||||
private void AddActionNode<TAction>(IUmbracoEntity item, MenuItemCollection menu, bool hasSeparator = false, bool opensDialog = false)
|
||||
where TAction : IAction
|
||||
{
|
||||
var menuItem = menu.Items.Add<TAction>(Services.TextService.Localize("actions", _actions.GetAction<TAction>().Alias), hasSeparator, opensDialog);
|
||||
var menuItem = menu.Items.Add<TAction>(Services.TextService, hasSeparator, opensDialog);
|
||||
}
|
||||
|
||||
public IEnumerable<SearchResultEntity> Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null)
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Umbraco.Web.Trees
|
||||
if (id == Constants.System.RootString)
|
||||
{
|
||||
//Create the normal create action
|
||||
menu.Items.Add<ActionNew>(Services.TextService.Localize("actions", ActionNew.ActionAlias));
|
||||
menu.Items.Add<ActionNew>(Services.TextService);
|
||||
|
||||
//refresh action
|
||||
menu.Items.Add(new RefreshNode(Services.TextService, true));
|
||||
@@ -34,7 +34,7 @@ namespace Umbraco.Web.Trees
|
||||
var relationType = Services.RelationService.GetRelationTypeById(int.Parse(id));
|
||||
if (relationType == null) return new MenuItemCollection();
|
||||
|
||||
menu.Items.Add<ActionDelete>(Services.TextService.Localize("actions", ActionDelete.ActionAlias));
|
||||
menu.Items.Add<ActionDelete>(Services.TextService);
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,6 @@
|
||||
<Compile Include="Composing\LightInject\LightInjectContainer.cs" />
|
||||
<Compile Include="Compose\BackOfficeUserAuditEventsComponent.cs" />
|
||||
<Compile Include="Dashboards\ContentDashboard.cs" />
|
||||
<Compile Include="Dashboards\DashboardCollection.cs" />
|
||||
<Compile Include="Dashboards\DashboardCollectionBuilder.cs" />
|
||||
<Compile Include="Dashboards\ExamineDashboard.cs" />
|
||||
<Compile Include="Dashboards\FormsDashboard.cs" />
|
||||
@@ -194,6 +193,8 @@
|
||||
<Compile Include="Models\Mapping\UserMapDefinition.cs" />
|
||||
<Compile Include="Models\Membership\UmbracoMembershipMember.cs" />
|
||||
<Compile Include="Models\PublishedContent\HybridVariationContextAccessor.cs" />
|
||||
<Compile Include="Models\Trees\MenuItemCollection.cs" />
|
||||
<Compile Include="Models\Trees\MenuItemList.cs" />
|
||||
<Compile Include="Mvc\HttpUmbracoFormRouteStringException.cs" />
|
||||
<Compile Include="Mvc\ModelBindingExceptionFilter.cs" />
|
||||
<Compile Include="Mvc\StatusCodeFilterAttribute.cs" />
|
||||
@@ -238,12 +239,12 @@
|
||||
<Compile Include="Security\UserAwarePasswordHasher.cs" />
|
||||
<Compile Include="Search\IUmbracoTreeSearcherFields.cs" />
|
||||
<Compile Include="Search\UmbracoTreeSearcherFields.cs" />
|
||||
<Compile Include="Services\DashboardService.cs" />
|
||||
<Compile Include="Services\IDashboardService.cs" />
|
||||
<Compile Include="StringExtensions.cs" />
|
||||
<Compile Include="Templates\HtmlLocalLinkParser.cs" />
|
||||
<Compile Include="Templates\HtmlImageSourceParser.cs" />
|
||||
<Compile Include="Templates\HtmlUrlParser.cs" />
|
||||
<Compile Include="Trees\TreeCollectionBuilder.cs" />
|
||||
<Compile Include="Trees\TreeNode.cs" />
|
||||
<Compile Include="UmbracoContextFactory.cs" />
|
||||
<Compile Include="UmbracoContextReference.cs" />
|
||||
<Compile Include="Mvc\UmbracoVirtualNodeByUdiRouteHandler.cs" />
|
||||
@@ -255,12 +256,6 @@
|
||||
<Compile Include="PropertyEditors\MultiUrlPickerValueEditor.cs" />
|
||||
<Compile Include="PropertyEditors\ValueConverters\MultiUrlPickerValueConverter.cs" />
|
||||
<Compile Include="Templates\ITemplateRenderer.cs" />
|
||||
<Compile Include="Trees\TreeCollectionBuilder.cs" />
|
||||
<Compile Include="Trees\TreeUse.cs" />
|
||||
<Compile Include="Trees\Tree.cs" />
|
||||
<Compile Include="Trees\ITree.cs" />
|
||||
<Compile Include="Services\ITreeService.cs" />
|
||||
<Compile Include="Services\ISectionService.cs" />
|
||||
<Compile Include="PropertyEditors\GridPropertyIndexValueFactory.cs" />
|
||||
<Compile Include="PublishedCache\NuCache\NuCacheComposer.cs" />
|
||||
<Compile Include="Routing\RedirectTrackingComposer.cs" />
|
||||
@@ -294,7 +289,6 @@
|
||||
<Compile Include="Security\SessionIdValidator.cs" />
|
||||
<Compile Include="SignalR\PreviewHubComposer.cs" />
|
||||
<Compile Include="Trees\FilesTreeController.cs" />
|
||||
<Compile Include="Trees\TreeCollection.cs" />
|
||||
<Compile Include="JavaScript\ClientDependencyConfiguration.cs" />
|
||||
<Compile Include="Editors\Binders\BlueprintItemBinder.cs" />
|
||||
<Compile Include="UmbracoApplicationBase.cs" />
|
||||
@@ -488,9 +482,7 @@
|
||||
<Compile Include="Runtime\WebInitialComponent.cs" />
|
||||
<Compile Include="Editors\PublishedStatusController.cs" />
|
||||
<Compile Include="Editors\NuCacheStatusController.cs" />
|
||||
<Compile Include="Services\SectionService.cs" />
|
||||
<Compile Include="Trees\TreeAttribute.cs" />
|
||||
<Compile Include="Models\Trees\TreeNode.cs" />
|
||||
<Compile Include="Routing\NotFoundHandlerHelper.cs" />
|
||||
<Compile Include="Models\LocalPackageInstallModel.cs" />
|
||||
<Compile Include="Mvc\ControllerContextExtensions.cs" />
|
||||
@@ -513,7 +505,6 @@
|
||||
<Compile Include="Security\ForceRenewalCookieAuthenticationMiddleware.cs" />
|
||||
<Compile Include="Security\GetUserSecondsMiddleWare.cs" />
|
||||
<Compile Include="Security\IUmbracoBackOfficeTwoFactorOptions.cs" />
|
||||
<Compile Include="Services\TreeService.cs" />
|
||||
<Compile Include="Security\PreviewAuthenticationMiddleware.cs" />
|
||||
<Compile Include="Trees\ContentTypeTreeController.cs" />
|
||||
<Compile Include="Trees\PackagesTreeController.cs" />
|
||||
@@ -616,14 +607,12 @@
|
||||
<Compile Include="Scheduling\TaskAndFactoryExtensions.cs" />
|
||||
<Compile Include="Migrations\PostMigrations\ClearCsrfCookies.cs" />
|
||||
<Compile Include="TagQuery.cs" />
|
||||
<Compile Include="Trees\CoreTreeAttribute.cs" />
|
||||
<Compile Include="Trees\DataTypeTreeController.cs" />
|
||||
<Compile Include="Trees\FileSystemTreeController.cs" />
|
||||
<Compile Include="Trees\LanguageTreeController.cs" />
|
||||
<Compile Include="Trees\MemberTreeController.cs" />
|
||||
<Compile Include="Trees\MenuRenderingEventArgs.cs" />
|
||||
<Compile Include="Models\Trees\CreateChildEntity.cs" />
|
||||
<Compile Include="Models\Trees\MenuItemList.cs" />
|
||||
<Compile Include="Trees\TemplatesTreeController.cs" />
|
||||
<Compile Include="Trees\TreeControllerBase.cs" />
|
||||
<Compile Include="JavaScript\AssetInitialization.cs" />
|
||||
@@ -671,13 +660,7 @@
|
||||
<Compile Include="FormDataCollectionExtensions.cs" />
|
||||
<Compile Include="PropertyEditors\RichTextPropertyEditor.cs" />
|
||||
<Compile Include="Trees\MediaTreeController.cs" />
|
||||
<Compile Include="Models\Trees\ActionMenuItem.cs" />
|
||||
<Compile Include="Trees\ActionUrlMethod.cs" />
|
||||
<Compile Include="Trees\ContentTreeControllerBase.cs" />
|
||||
<Compile Include="Trees\ISearchableTree.cs" />
|
||||
<Compile Include="Models\Trees\MenuItem.cs" />
|
||||
<Compile Include="Models\Trees\MenuItemCollection.cs" />
|
||||
<Compile Include="Models\Trees\RefreshNode.cs" />
|
||||
<Compile Include="Models\Trees\TreeRootNode.cs" />
|
||||
<Compile Include="Trees\TreeController.cs" />
|
||||
<Compile Include="Models\Trees\TreeNodeCollection.cs" />
|
||||
|
||||
Reference in New Issue
Block a user