From 89839273d66e327725cc952c9ca00f1b83f64f1e Mon Sep 17 00:00:00 2001 From: Anderson Ferreira da Silva Date: Thu, 19 Dec 2024 06:06:47 -0600 Subject: [PATCH] Fixing delegable feature. --- .../App/IExternalEnabledFeatures.cs | 8 ++++++-- .../Microsoft.PowerFx.Core/Public/Config/Features.cs | 5 ----- src/libraries/Microsoft.PowerFx.Core/Texl/Remove.cs | 7 ++----- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/libraries/Microsoft.PowerFx.Core/App/IExternalEnabledFeatures.cs b/src/libraries/Microsoft.PowerFx.Core/App/IExternalEnabledFeatures.cs index 52cd752720..d149e2882e 100644 --- a/src/libraries/Microsoft.PowerFx.Core/App/IExternalEnabledFeatures.cs +++ b/src/libraries/Microsoft.PowerFx.Core/App/IExternalEnabledFeatures.cs @@ -21,7 +21,9 @@ internal interface IExternalEnabledFeatures bool IsEnhancedComponentFunctionPropertyEnabled { get; } - bool IsComponentFunctionPropertyDataflowEnabled { get; } + bool IsComponentFunctionPropertyDataflowEnabled { get; } + + bool IsRemoveAllDelegationEnabled { get; } } internal sealed class DefaultEnabledFeatures : IExternalEnabledFeatures @@ -36,6 +38,8 @@ internal sealed class DefaultEnabledFeatures : IExternalEnabledFeatures public bool IsEnhancedComponentFunctionPropertyEnabled => true; - public bool IsComponentFunctionPropertyDataflowEnabled => true; + public bool IsComponentFunctionPropertyDataflowEnabled => true; + + public bool IsRemoveAllDelegationEnabled => true; } } diff --git a/src/libraries/Microsoft.PowerFx.Core/Public/Config/Features.cs b/src/libraries/Microsoft.PowerFx.Core/Public/Config/Features.cs index 8a4a109439..abf908f462 100644 --- a/src/libraries/Microsoft.PowerFx.Core/Public/Config/Features.cs +++ b/src/libraries/Microsoft.PowerFx.Core/Public/Config/Features.cs @@ -82,11 +82,6 @@ public sealed class Features /// internal bool IsUserDefinedTypesEnabled { get; init; } = false; - /// - /// Enables Remove All delegation. - /// - internal bool IsRemoveAllDelegationEnabled { get; set; } - internal static readonly Features None = new Features(); /// diff --git a/src/libraries/Microsoft.PowerFx.Core/Texl/Remove.cs b/src/libraries/Microsoft.PowerFx.Core/Texl/Remove.cs index f8e57f83cf..e4cc808eec 100644 --- a/src/libraries/Microsoft.PowerFx.Core/Texl/Remove.cs +++ b/src/libraries/Microsoft.PowerFx.Core/Texl/Remove.cs @@ -509,12 +509,9 @@ public override bool IsServerDelegatable(CallNode callNode, TexlBinding binding) } // Use ECS flag as a guard. - if (binding.Document != null) + if (binding.Document != null && !binding.Document.Properties.EnabledFeatures.IsRemoveAllDelegationEnabled) { - if (!binding.Features.IsRemoveAllDelegationEnabled) - { - return false; - } + return false; } if (!binding.TryGetDataSourceInfo(callNode.Args.Children[0], out IExternalDataSource dataSource))