-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Add alias ["value", 0] in addition to ["argv", 0]
* Move values to a separate interface added to context `IContextValueAccessor` * Provide `["value"]` as a shortcut for `["dataModel", ["argv", 0]]`
- Loading branch information
Showing
10 changed files
with
161 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/Altinn.App.Core/Models/Expressions/IContextValueAccessor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace Altinn.App.Core.Models.Expressions; | ||
|
||
/// <summary> | ||
/// Provide an implementation for the ["value", ?] expression | ||
/// The expression is special, because it is only valid in contexts where there exists a value | ||
/// * Expression validation (`["value"]` is the value to validate) | ||
/// * Filtering (["value"] is the value that is should be compared) | ||
/// </summary> | ||
public interface IContextValueAccessor | ||
{ | ||
/// <summary> | ||
/// Get the value from the context | ||
/// </summary> | ||
/// <param name="function">The function that was called</param> | ||
/// <param name="args">List of arguments for the expression</param> | ||
/// <returns>The value</returns> | ||
object? GetValue(ExpressionFunction function, ReadOnlySpan<object?> args); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...ore.Tests/LayoutExpressions/CommonTests/shared-tests/functions/concat/specialStrings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Special strings must not be lowercased", | ||
"expression": ["concat", "TRUE", "FALSE", "true", "false", "Null", "null", "NULL", "undefined", "UNDEFINED"], | ||
"expects": "TRUEFALSEtruefalseNullnullNULLundefinedUNDEFINED" | ||
} |