From bfd2462158e95f965225212362be0fbfc85a067a Mon Sep 17 00:00:00 2001 From: jcdcdev Date: Tue, 31 Dec 2024 01:38:27 +0000 Subject: [PATCH] fix: oneOf ConditionManifest --- .../SimpleWorkspaceViewPackageManifestReader.cs | 3 ++- .../Web/Models/Manifests/ConditionManifest.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jcdcdev.Umbraco.Core.TestSite/SimpleWorkspaceViewPackageManifestReader.cs b/src/jcdcdev.Umbraco.Core.TestSite/SimpleWorkspaceViewPackageManifestReader.cs index 7220148..a62935f 100644 --- a/src/jcdcdev.Umbraco.Core.TestSite/SimpleWorkspaceViewPackageManifestReader.cs +++ b/src/jcdcdev.Umbraco.Core.TestSite/SimpleWorkspaceViewPackageManifestReader.cs @@ -1,6 +1,7 @@ using jcdcdev.Umbraco.Core.Extensions; using jcdcdev.Umbraco.Core.Web.Models.Manifests; using Umbraco.Cms.Core.Manifest; +using Umbraco.Cms.Core.Models; using Umbraco.Cms.Infrastructure.Manifest; using Umbraco.Cms.Web.Common.PublishedModels; @@ -53,7 +54,7 @@ public async Task> ReadPackageManifestsAsync() Conditions = [ ConditionManifest.EntityIsTrashed(), - ConditionManifest.WorkspaceContentTypeAlias(Home.ModelTypeAlias) + ConditionManifest.WorkspaceContentTypeAlias([Home.ModelTypeAlias, BasePage.ModelTypeAlias]) ] }; diff --git a/src/jcdcdev.Umbraco.Core/Web/Models/Manifests/ConditionManifest.cs b/src/jcdcdev.Umbraco.Core/Web/Models/Manifests/ConditionManifest.cs index 44991ce..3584656 100644 --- a/src/jcdcdev.Umbraco.Core/Web/Models/Manifests/ConditionManifest.cs +++ b/src/jcdcdev.Umbraco.Core/Web/Models/Manifests/ConditionManifest.cs @@ -15,8 +15,8 @@ private ConditionManifest(string alias, object[] oneOf) } public static ConditionManifest Create(string alias, string match) => new(alias, match); - public static ConditionManifest Create(string alias, string[] match) => new(alias, match.Select(x => (object)x)); public static ConditionManifest Create(string alias, bool match) => new(alias, match); + public static ConditionManifest Create(string alias, string[] oneOf) => new(alias, (object[])oneOf); /// /// Requires the current Section Alias to match the one specified.