Repository navigation
feat!: type the filter condition, criteria, filtering type and search… - #71
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The implementation and coverage consistently enforce the new filtering contracts, with only a non-blocking comment wording correction identified.
1 open finding
What changed in this PR
Types filtering models before 1.0 and normalizes grid-lite event payloads for strongly typed .NET consumption.
Changes:
- Adds typed filter criteria and filtering-operation enums.
- Converts event search terms into appropriate primitive values.
- Normalizes condition objects in JavaScript and expands serialization/integration coverage.
| File | Description |
|---|---|
ModelSerializationTests.cs |
Tests updated filter payloads. |
GridLiteJsInteropTests.cs |
Verifies typed criteria interop. |
EnumSerializationTests.cs |
Tests new enum converters. |
GridPage.razor |
Exposes filtering results for browser tests. |
GridLiteTests.cs |
Tests condition-object normalization. |
IgbGridLiteFilterExpression.cs |
Types conditions and criteria. |
IgbGridLiteFilteringEventArgs.cs |
Types operation and expression collection. |
IgbGridLiteFilteredEventArgs.cs |
Makes state read-only. |
GridLiteJsonContext.cs |
Updates serialization documentation. |
AppValueSerializer.cs |
Converts search terms to primitives. |
igc-grid-lite-entry.js |
Normalizes event condition objects. |
README.md |
Documents valid condition names. |
docs/TRIMMING.md |
Updates trimming guidance. |
docs/security/threat-model.md |
Updates payload security description. |
CHANGELOG.md |
Records breaking API changes. |
.github/copilot-instructions.md |
Updates serialization guidance. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
| /// </summary> | ||
| /// <remarks> | ||
| /// Typically matches the <see cref="IgbGridLiteColumn.DataType"/> holding a <see cref="string"/>, | ||
| /// a <see cref="double"/> (any number, including one set as an <see cref="int"/>) or a <see cref="bool"/>; |
There was a problem hiding this comment.
Is there a point to support and document the boolean type? Since the boolean expressions take no SeacrhTerm, just condition, like:
new IgbGridLiteFilterExpression
{
Key = nameof(NwindDataItem.Discontinued),
Condition = "true"
}
Unless we support custom conditions somehow, but I don't think that we do?
MayaKirova
left a comment
There was a problem hiding this comment.
Other than wondering about the SearchTerm's boolean type LGTM.

Settles the filter expression's value types before 1.0, where changing a property's type would be breaking.
Changes
IgbGridLiteFilterExpression.Conditionobjectstring, a grid-lite condition nameIgbGridLiteFilterExpression.Criteriastring?GridLiteFilterCriteria?(And,Or)IgbGridLiteFilteringEventArgs.TypestringGridLiteFilteringType(Add,Modify,Remove)IgbGridLiteFilteringEventArgs.Expressions,IgbGridLiteFilteredEventArgs.StateList<IgbGridLiteFilterExpression>IReadOnlyList<IgbGridLiteFilterExpression>SearchTermin theFiltering/FilteredeventsJsonElementstring,doubleorbool;JsonElementonly for an array or object the app set itselfConditionis a name. grid-lite's condition is either a name or an operation object carrying alogicfunction, and only the name can cross to .NET. Before,Conditionread back from the events as aJsonElementof that object. The names valid for eachDataType, and which conditions take noSearchTerm, are listed inCondition's docs and the README. grid-lite is moving to names only as well. Its 0.11.0 still reports the object in event details, so the grid's script reduces each condition to its name before handing the details to .NET; that works with both forms.Criteriaand the filteringTypeare enums. They are fixed sets in grid-lite, written in camelCase likeGridLiteSortingDirection.SearchTermcomes back as its value. Numbers always read asdouble, since JSON has a single number type: a term set as anintcomes back as adouble.Conditionno longer goes through the reflection-based serializer;SearchTermis the only filter value that still does (docs/TRIMMING.md).The name
Conditionfollows grid-lite. The fullIgbGrid'sIgbFilteringExpressionholds the same names inConditionName, so moving an expression across is a property rename with identical values (the full grid's…OrEqualTonumber conditions aside).Tests
ConditionandCriteriaare written as plain strings; the event args readType,Criteriaand each kind ofSearchTermfrom grid-lite's payloads; the two enums reject integers.filteringevent in grid-lite 0.11.0's shape, with a condition object, reaches the .NET handler asAdd contains.