Skip to content

Commit

Permalink
Release 1.10.0 (#128)
Browse files Browse the repository at this point in the history
Adding linker config to fix Table Footer feature
Breaking Change - Updated TableRowClass to Func<TableItem, string> #122 (Thanks to @rdadkins)
NuGet update
.Net Core update to 3.1.202
  • Loading branch information
IvanJosipovic committed May 18, 2020
1 parent e99f444 commit 7545b95
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.201
dotnet-version: 3.1.202

- name: Dotnet Build
run: dotnet build -c Release
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.201
dotnet-version: 3.1.202

- name: Dotnet Build
run: dotnet build -c Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.201
dotnet-version: 3.1.202

- name: Dotnet Pack
working-directory: src/BlazorTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.4" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="System.Net.Http.Json" Version="3.2.0-rc1.20217.1" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorTable.Sample.Wasm/BlazorTable.Sample.Wasm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
<ItemGroup>
<Watch Include="..\**\*.razor" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/BlazorTable.Tests/BlazorTable.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="PuppeteerSharp" Version="2.0.3" />
<PackageReference Include="PuppeteerSharp.Contrib.Extensions" Version="1.0.0" />
<PackageReference Include="PuppeteerSharp.Contrib.Extensions" Version="2.0.0" />
<PackageReference Include="Shouldly" Version="3.0.2" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
Expand Down
4 changes: 3 additions & 1 deletion src/BlazorTable.Tests/BrowserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ void Page_Console(object sender, ConsoleEventArgs e)

await page.GoToAsync(BaseAddress);

(await page.WaitForSelectorAsync("div.table-responsive > table > tbody > tr:nth-child(1) > td:nth-child(3)")).InnerText().ShouldBe("Astrix Mariette");
var selector = await page.WaitForSelectorAsync("div.table-responsive > table > tbody > tr:nth-child(1) > td:nth-child(3)");

(await selector.InnerTextAsync()).ShouldBe("Astrix Mariette");

hasError.ShouldBeFalse();

Expand Down
18 changes: 9 additions & 9 deletions src/BlazorTable/BlazorTable.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,28 @@

<ItemGroup>
<None Include="icon.png" Pack="true" PackagePath="" />
<Watch Include="..\**\*.razor" />
<BlazorLinkerDescriptor Include="LinkerConfig.xml" />
<EmbeddedResource Include="LinkerConfig.xml">
<LogicalName>$(MSBuildProjectName).xml</LogicalName>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<PackageReference Include="LINQKit.Core" Version="1.1.17" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.4" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<Watch Include="..\**\*.razor" />
</ItemGroup>



<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>$(AssemblyName).Tests</_Parameter1>
<!-- We use the value of AssemblyName to declare the value of the attribute -->
</AssemblyAttribute>
</ItemGroup>

</Project>
5 changes: 3 additions & 2 deletions src/BlazorTable/Components/Table.razor
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,11 @@
@foreach (IColumn<TableItem> column in Columns)
{
<td @key="column" style="@(column.Align > 0 ? $"text-align: {column.Align};" : "")" class="@(column.ColumnFooterClass)">
@if (!string.IsNullOrEmpty(column.SetFooterValue))
@if (!string.IsNullOrEmpty(column.SetFooterValue)){
@column.SetFooterValue
else
} else if(FilteredItems != null && FilteredItems.Any()) {
@column.GetFooterValue()
}
</td>
}
</tr>
Expand Down
14 changes: 2 additions & 12 deletions src/BlazorTable/Components/Table.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public partial class Table<TableItem> : ITable<TableItem>
/// Expression to set Row Class
/// </summary>
[Parameter]
public Expression<Func<TableItem, string>> TableRowClass { get; set; }
public Func<TableItem, string> TableRowClass { get; set; }

/// <summary>
/// Page Size, defaults to 15
Expand Down Expand Up @@ -311,19 +311,9 @@ private void HandleDrop(IColumn<TableItem> column)
/// <returns></returns>
private string RowClass(TableItem item)
{
if (TableRowClass == null) return null;

if (_tableRowClassCompiled == null)
_tableRowClassCompiled = TableRowClass.Compile();

return _tableRowClassCompiled.Invoke(item);
return TableRowClass?.Invoke(item);
}

/// <summary>
/// Save compiled TableRowClass property to avoid repeated Compile() calls
/// </summary>
private Func<TableItem, string> _tableRowClassCompiled;

/// <summary>
/// Set the template to use for empty data
/// </summary>
Expand Down
22 changes: 22 additions & 0 deletions src/BlazorTable/LinkerConfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
This file specifies which parts of the BCL or Blazor packages must not be
stripped by the IL Linker even if they aren't referenced by user code.
-->
<linker>
<assembly fullname="mscorlib">
<!--
Preserve the methods in WasmRuntime because its methods are called by
JavaScript client-side code to implement timers.
Fixes: https://github.com/dotnet/blazor/issues/239
-->
<type fullname="System.Threading.WasmRuntime" />
</assembly>
<assembly fullname="System.Linq.Queryable">
<!--
System.Linq.Queryable* is need by the Table Footer
-->
<type fullname="System.Linq.Queryable" />
</assembly>
<assembly fullname="BlazorTable" />
</linker>
4 changes: 2 additions & 2 deletions src/BlazorTable/Utillities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

namespace BlazorTable
{
internal static class Utilities
internal static class Utilities
{
/// <summary>
/// Calculates Sum or Avergage of a column base on given field name.
/// Calculates Sum or Average of a column base on given field name.
/// </summary>
/// <param name="source"></param>
/// <param name="member"></param>
Expand Down

0 comments on commit 7545b95

Please sign in to comment.