Skip to content

Commit cdc0c50

Browse files
authored
feat: support display of rule content that is not string (#118)
* Support display of rule values that are not string * Made WebUI display correctly RuleContent objects * removed unneeded modifications * updated rules.framework nuget version in other projects
1 parent 8ee042e commit cdc0c50

6 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/Rules.Framework.Providers.InMemory/Rules.Framework.Providers.InMemory.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@
3636
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3737
</PackageReference>
3838
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.1.1" />
39-
<PackageReference Include="Rules.Framework" Version="1.7.4" />
39+
<PackageReference Include="Rules.Framework" Version="1.7.5" />
4040
</ItemGroup>
4141
</Project>

src/Rules.Framework.Providers.MongoDb/Rules.Framework.Providers.MongoDb.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
</PackageReference>
3838
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
3939
<PackageReference Include="MongoDB.Driver" Version="2.13.1" />
40-
<PackageReference Include="Rules.Framework" Version="1.7.4" />
40+
<PackageReference Include="Rules.Framework" Version="1.7.5" />
4141
</ItemGroup>
4242
</Project>

src/Rules.Framework.WebUI/Rules.Framework.WebUI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</ItemGroup>
4848

4949
<ItemGroup>
50-
<PackageReference Include="Rules.Framework" Version="1.7.4" />
50+
<PackageReference Include="Rules.Framework" Version="1.7.5" />
5151
</ItemGroup>
5252

5353
<ItemGroup>

src/Rules.Framework.WebUI/WebUIRequestHandlerBase.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ protected WebUIRequestHandlerBase(string[] resourcePath, WebUIOptions webUIOptio
2525
{
2626
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
2727
WriteIndented = true,
28-
IncludeFields = true
28+
IncludeFields = true,
29+
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
2930
};
3031
this.SerializerOptions.Converters.Add(new JsonStringEnumConverter());
3132
this.SerializerOptions.Converters.Add(new PolymorphicWriteOnlyJsonConverter<ConditionNodeDto>());

src/Rules.Framework.WebUI/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ <h5 class="mb-3">Rules</h5>
204204
<th scope="col" width="30%">Name</th>
205205
<th scope="col" width="16%" nowrap style="text-align: center;">Date Begin</th>
206206
<th scope="col" width="16%" nowrap style="text-align: center;">Date End</th>
207-
<th scope="col" width="25%">Value</th>
207+
<th scope="col" width="25%">Content</th>
208208
<th scope="col" width="6%" style="text-align: center;">Status</th>
209209
<th scope="col" width="5%" style="text-align: center;">Conditions</th>
210210
</tr>
@@ -299,7 +299,7 @@ <h5 class="mb-3">Rules</h5>
299299

300300
trHTML += '<tr><th scope="row">' + item.priority + ' </th><td>' + item.name + '</td>';
301301
trHTML += '<td style="text-align: center;" nowrap>' + item.dateBegin + '</td><td style="text-align: center;" nowrap> ' + dateEnd + '</td>';
302-
trHTML += '<td>' + item.value + '</td>';
302+
trHTML += '<td>' + JSON.stringify(item.value) + '</td>';
303303
trHTML += '<td style="text-align: center;"><span class="' + labelColor + '" style="' + style + '"> ';
304304
trHTML += item.status;
305305
trHTML += ' <span class="' + icon + '"></span> '

tests/Rules.Framework.WebUI.Tests/Rules.Framework.WebUI.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
1313
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
1414
<PackageReference Include="Moq" Version="4.16.1" />
15-
<PackageReference Include="Rules.Framework" Version="1.7.4" />
15+
<PackageReference Include="Rules.Framework" Version="1.7.5" />
1616
<PackageReference Include="xunit" Version="2.4.1" />
1717
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
1818
<PrivateAssets>all</PrivateAssets>

0 commit comments

Comments
 (0)