From 9fce9e05c735a560558fd5de11d3e30a1eb2306e Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Wed, 18 May 2022 00:50:30 +0200 Subject: [PATCH] Menu action icons (#12418) * Fix icon for export member * Add missing start summary tag * Formatting --- src/Umbraco.Core/Models/Trees/ActionMenuItem.cs | 12 +++++++----- src/Umbraco.Core/Models/Trees/ExportMember.cs | 5 +++-- src/Umbraco.Core/Models/Trees/MenuItem.cs | 3 ++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Core/Models/Trees/ActionMenuItem.cs b/src/Umbraco.Core/Models/Trees/ActionMenuItem.cs index c89fb402d0..cb1a631e80 100644 --- a/src/Umbraco.Core/Models/Trees/ActionMenuItem.cs +++ b/src/Umbraco.Core/Models/Trees/ActionMenuItem.cs @@ -1,4 +1,4 @@ -using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Core.Services; using Umbraco.Extensions; namespace Umbraco.Cms.Core.Models.Trees @@ -27,22 +27,24 @@ namespace Umbraco.Cms.Core.Models.Trees /// 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 diff --git a/src/Umbraco.Core/Models/Trees/ExportMember.cs b/src/Umbraco.Core/Models/Trees/ExportMember.cs index cbaa95498b..e478af7a55 100644 --- a/src/Umbraco.Core/Models/Trees/ExportMember.cs +++ b/src/Umbraco.Core/Models/Trees/ExportMember.cs @@ -9,9 +9,10 @@ namespace Umbraco.Cms.Core.Models.Trees { 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; } } diff --git a/src/Umbraco.Core/Models/Trees/MenuItem.cs b/src/Umbraco.Core/Models/Trees/MenuItem.cs index f6c3b6b4ac..cad8fe0d5f 100644 --- a/src/Umbraco.Core/Models/Trees/MenuItem.cs +++ b/src/Umbraco.Core/Models/Trees/MenuItem.cs @@ -34,7 +34,7 @@ namespace Umbraco.Cms.Core.Models.Trees { 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); } /// @@ -91,6 +91,7 @@ namespace Umbraco.Cms.Core.Models.Trees [DataMember(Name = "icon")] public string Icon { get; set; } + /// /// Used in the UI to indicate whether icons should be prefixed with "icon-". /// If not legacy icon full icon name should be specified. ///