Skip to content

Commit

Permalink
Fixing delegable feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
anderson-joyle committed Dec 19, 2024
1 parent d2a778f commit 4619d74
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ internal interface IExternalEnabledFeatures

bool IsEnhancedComponentFunctionPropertyEnabled { get; }

bool IsComponentFunctionPropertyDataflowEnabled { get; }
bool IsComponentFunctionPropertyDataflowEnabled { get; }

bool IsRemoveAllDelegationEnabled { get; }
}

internal sealed class DefaultEnabledFeatures : IExternalEnabledFeatures
Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ public sealed class Features
/// </summary>
internal bool IsUserDefinedTypesEnabled { get; init; } = false;

/// <summary>
/// Enables Remove All delegation.
/// </summary>
internal bool IsRemoveAllDelegationEnabled { get; set; }

internal static readonly Features None = new Features();

/// <summary>
Expand Down
7 changes: 2 additions & 5 deletions src/libraries/Microsoft.PowerFx.Core/Texl/Remove.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 4619d74

Please sign in to comment.