Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/Umbraco.Core/Models/Trees/ActionMenuItem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services;
using Umbraco.Extensions;

namespace Umbraco.Cms.Core.Models.Trees
Expand Down Expand Up @@ -27,22 +27,24 @@ public abstract class ActionMenuItem : MenuItem
/// </summary>
public virtual string? AngularServiceMethodName { get; } = null;

protected ActionMenuItem(string alias, string name) : base(alias, name)
protected ActionMenuItem(string alias, string name)
: base(alias, name)
{
Initialize();
}

protected ActionMenuItem(string alias, ILocalizedTextService textService) : base(alias, textService)
protected ActionMenuItem(string alias, ILocalizedTextService textService)
: base(alias, textService)
{
Initialize();
}

private void Initialize()
{
//add the current type to the metadata
// add the current type to the metadata
if (AngularServiceMethodName.IsNullOrWhiteSpace())
{
//if no method name is supplied we will assume that the menu action is the type name of the current menu class
// if no method name is supplied we will assume that the menu action is the type name of the current menu class
ExecuteJsMethod($"{AngularServiceName}.{this.GetType().Name}");
}
else
Expand Down
5 changes: 3 additions & 2 deletions src/Umbraco.Core/Models/Trees/ExportMember.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ public sealed class ExportMember : ActionMenuItem
{
public override string AngularServiceName => "umbracoMenuActions";

public ExportMember(ILocalizedTextService textService) : base("export", textService)
public ExportMember(ILocalizedTextService textService)
: base("export", textService)
{
Icon = "download-alt";
Icon = "icon-download-alt";
UseLegacyIcon = false;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/Umbraco.Core/Models/Trees/MenuItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public MenuItem(string alias, ILocalizedTextService textService)
{
Alias = alias;
Name = textService.Localize("actions", Alias);
TextDescription = textService.Localize("visuallyHiddenTexts", alias + "_description", Thread.CurrentThread.CurrentUICulture);
TextDescription = textService.Localize("visuallyHiddenTexts", alias + "_description", Thread.CurrentThread.CurrentUICulture);
}

/// <summary>
Expand Down Expand Up @@ -91,6 +91,7 @@ public MenuItem(IAction action, string name = "")
[DataMember(Name = "icon")]
public string Icon { get; set; }

/// <summary>
/// Used in the UI to indicate whether icons should be prefixed with "icon-".
/// If not legacy icon full icon name should be specified.
/// </summary>
Expand Down