From 7537509ede430a82ad2ca49ef0709b6a64c8a0a3 Mon Sep 17 00:00:00 2001 From: Nikolaj Brask-Nielsen Date: Wed, 9 Aug 2023 17:30:28 +0200 Subject: [PATCH] feat: Show published state in tree picker (#14641) --- .../Models/Mapping/EntityMapDefinition.cs | 5 +++++ .../Search/UmbracoTreeSearcherFields.cs | 2 ++ .../src/less/components/tree/umb-tree.less | 3 +++ .../src/views/components/tree/umb-tree-search-results.html | 2 +- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Infrastructure/Models/Mapping/EntityMapDefinition.cs b/src/Umbraco.Infrastructure/Models/Mapping/EntityMapDefinition.cs index 2ddb17bcfd..0116ec401d 100644 --- a/src/Umbraco.Infrastructure/Models/Mapping/EntityMapDefinition.cs +++ b/src/Umbraco.Infrastructure/Models/Mapping/EntityMapDefinition.cs @@ -276,6 +276,11 @@ public class EntityMapDefinition : IMapDefinition { target.AdditionalData.Add("contentType", source.Values[ExamineFieldNames.ItemTypeFieldName]); } + + if (source.Values.ContainsKey(UmbracoExamineFieldNames.PublishedFieldName)) + { + target.AdditionalData.Add("published", string.Equals(source.Values[UmbracoExamineFieldNames.PublishedFieldName], "y", StringComparison.InvariantCultureIgnoreCase)); + } } private static string? MapContentTypeIcon(IEntitySlim entity) diff --git a/src/Umbraco.Infrastructure/Search/UmbracoTreeSearcherFields.cs b/src/Umbraco.Infrastructure/Search/UmbracoTreeSearcherFields.cs index d0131399fe..8845e6e371 100644 --- a/src/Umbraco.Infrastructure/Search/UmbracoTreeSearcherFields.cs +++ b/src/Umbraco.Infrastructure/Search/UmbracoTreeSearcherFields.cs @@ -73,6 +73,8 @@ public class UmbracoTreeSearcherFields : IUmbracoTreeSearcherFields fields.Add(field); } + fields.Add(UmbracoExamineFieldNames.PublishedFieldName); + return fields; } } diff --git a/src/Umbraco.Web.UI.Client/src/less/components/tree/umb-tree.less b/src/Umbraco.Web.UI.Client/src/less/components/tree/umb-tree.less index 1f61b7cfc2..4dd0a56b3f 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/tree/umb-tree.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/tree/umb-tree.less @@ -257,6 +257,9 @@ body.touch .umb-tree { > .umb-tree-item__inner > a { opacity: 0.6; } + &.umb-search-group-item { + opacity: 0.6; + } } .not-allowed { diff --git a/src/Umbraco.Web.UI.Client/src/views/components/tree/umb-tree-search-results.html b/src/Umbraco.Web.UI.Client/src/views/components/tree/umb-tree-search-results.html index f0b4af8dd2..97b3f6824f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/tree/umb-tree-search-results.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/tree/umb-tree-search-results.html @@ -7,7 +7,7 @@