Removes IActions that shouldn't be IActions
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Umbraco.Web.Models.Trees
|
||||
{
|
||||
@@ -28,9 +29,17 @@ namespace Umbraco.Web.Models.Trees
|
||||
/// </summary>
|
||||
public virtual string AngularServiceMethodName { get; } = null;
|
||||
|
||||
[SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")]
|
||||
protected ActionMenuItem()
|
||||
: base()
|
||||
protected ActionMenuItem(string alias, string name) : base(alias, name)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
protected ActionMenuItem(string alias, ILocalizedTextService textService) : base(alias, textService)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
//add the current type to the metadata
|
||||
if (AngularServiceMethodName.IsNullOrWhiteSpace())
|
||||
|
||||
@@ -11,17 +11,16 @@ namespace Umbraco.Web.Models.Trees
|
||||
public override string AngularServiceName => "umbracoMenuActions";
|
||||
|
||||
public CreateChildEntity(string name, bool seperatorBefore = false)
|
||||
: base(ActionNew.ActionAlias, name)
|
||||
{
|
||||
Alias = ActionNew.ActionAlias;
|
||||
Icon = "add"; Name = name;
|
||||
SeperatorBefore = seperatorBefore;
|
||||
}
|
||||
|
||||
public CreateChildEntity(ILocalizedTextService textService, bool seperatorBefore = false)
|
||||
: base(ActionNew.ActionAlias, textService)
|
||||
{
|
||||
Alias = ActionNew.ActionAlias;
|
||||
Icon = "add";
|
||||
Name = textService.Localize($"actions/{Alias}");
|
||||
SeperatorBefore = seperatorBefore;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Umbraco.Web.Models.Trees
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Umbraco.Web.Models.Trees
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the export member menu item
|
||||
@@ -6,5 +8,10 @@
|
||||
public sealed class ExportMember : ActionMenuItem
|
||||
{
|
||||
public override string AngularServiceName => "umbracoMenuActions";
|
||||
|
||||
public ExportMember(ILocalizedTextService textService) : base("export", textService)
|
||||
{
|
||||
Icon = "download-alt";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,14 @@ namespace Umbraco.Web.Models.Trees
|
||||
Name = name;
|
||||
}
|
||||
|
||||
|
||||
public MenuItem(string alias, ILocalizedTextService textService)
|
||||
: this()
|
||||
{
|
||||
Alias = alias;
|
||||
Name = textService.Localize($"actions/{Alias}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a menu item based on an <see cref="IAction"/> definition
|
||||
/// </summary>
|
||||
|
||||
@@ -38,28 +38,6 @@ namespace Umbraco.Web.Models.Trees
|
||||
return item;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a menu item based on an <see cref="IAction"/>
|
||||
/// </summary>
|
||||
/// <param name="name">The text to display for the menu item, will default to the IAction alias if not specified</param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public MenuItem Add<T>(string name)
|
||||
where T : IAction
|
||||
{
|
||||
return Add<T>(name, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a menu item based on an <see cref="IAction"/>
|
||||
/// </summary>
|
||||
/// <param name="textService">The <see cref="ILocalizedTextService"/> used to localize the action name based on it's alias</param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public MenuItem Add<T>(ILocalizedTextService textService)
|
||||
where T : IAction
|
||||
{
|
||||
return Add<T>(textService, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a menu item with a dictionary which is merged to the AdditionalData bag
|
||||
/// </summary>
|
||||
|
||||
@@ -11,18 +11,16 @@ namespace Umbraco.Web.Models.Trees
|
||||
public override string AngularServiceName => "umbracoMenuActions";
|
||||
|
||||
public RefreshNode(string name, bool seperatorBefore = false)
|
||||
: base("refreshNode", name)
|
||||
{
|
||||
Alias = "refreshNode";
|
||||
Icon = "refresh";
|
||||
Name = name;
|
||||
SeperatorBefore = seperatorBefore;
|
||||
}
|
||||
|
||||
public RefreshNode(ILocalizedTextService textService, bool seperatorBefore = false)
|
||||
: base("refreshNode", textService)
|
||||
{
|
||||
Alias = "refreshNode";
|
||||
Icon = "refresh";
|
||||
Name = textService.Localize($"actions/{Alias}");
|
||||
SeperatorBefore = seperatorBefore;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user