Skip to content

Commit 11a2d41

Browse files
authored
Update AntDesign 0.16.2 and Add ReuseTabs (#162)
* update to AntDesign 0.16.2 * add reuse tabs * fix the reusetabs issue * update template * update action
1 parent c3ea33b commit 11a2d41

File tree

12 files changed

+72
-35
lines changed

12 files changed

+72
-35
lines changed

.github/workflows/azure-static-web-apps-brave-coast-0edcf6600.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
- uses: actions/setup-dotnet@v1
1919
with:
20-
dotnet-version: 7.0.100
20+
dotnet-version: 8.0.100
2121

2222
- uses: actions/setup-node@v1
2323
with:

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup .NET Core
2424
uses: actions/setup-dotnet@v1
2525
with:
26-
dotnet-version: 7.0.100
26+
dotnet-version: 8.0.100
2727

2828
- uses: actions/setup-node@v1
2929
with:

.github/workflows/pr-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup .NET Core
1616
uses: actions/setup-dotnet@v1
1717
with:
18-
dotnet-version: 7.0.100
18+
dotnet-version: 8.0.100
1919

2020
- uses: actions/setup-node@v1
2121
with:

.template.config/templates/hosted/src/Client/AntDesign.Pro.Template.Client.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="AntDesign.Charts" Version="0.3.1" />
11-
<PackageReference Include="AntDesign.ProLayout" Version="0.14.4" />
12-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" />
13-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0" PrivateAssets="all" />
14-
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
15-
<PackageReference Include="System.Net.Http.Json" Version="7.0.0" />
10+
<PackageReference Include="AntDesign.Charts" Version="0.4.0" />
11+
<PackageReference Include="AntDesign.ProLayout" Version="0.16.2" />
12+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
13+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" PrivateAssets="all" />
14+
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
15+
<PackageReference Include="System.Net.Http.Json" Version="8.0.0" />
1616
</ItemGroup>
1717

1818
<!--#if (UseNodeJS) -->

.template.config/templates/hosted/src/Server/AntDesign.Pro.Template.Server.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="7.0.0" />
10+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.0" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

.template.config/templates/server/AntDesign.Pro.Template.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="AntDesign.Charts" Version="0.3.1" />
11-
<PackageReference Include="AntDesign.ProLayout" Version="0.14.4" />
12-
<PackageReference Include="System.Net.Http.Json" Version="7.0.0" />
10+
<PackageReference Include="AntDesign.Charts" Version="0.4.0" />
11+
<PackageReference Include="AntDesign.ProLayout" Version="0.16.2" />
12+
<PackageReference Include="System.Net.Http.Json" Version="8.0.0" />
1313
</ItemGroup>
1414

1515
<!--#if (UseNodeJS) -->

.template.config/templates/wasm/AntDesign.Pro.Template.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<RazorLangVersion>3.0</RazorLangVersion>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="AntDesign.Charts" Version="0.3.1" />
10-
<PackageReference Include="AntDesign.ProLayout" Version="0.14.4" />
11-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" />
12-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0" PrivateAssets="all" />
13-
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
14-
<PackageReference Include="System.Net.Http.Json" Version="7.0.0" />
9+
<PackageReference Include="AntDesign.Charts" Version="0.4.0" />
10+
<PackageReference Include="AntDesign.ProLayout" Version="0.16.2" />
11+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
12+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" PrivateAssets="all" />
13+
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
14+
<PackageReference Include="System.Net.Http.Json" Version="8.0.0" />
1515
</ItemGroup>
1616

1717
<!--#if (UseNodeJS) -->

src/AntDesign.Pro/AntDesign.Pro.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22

33
<PropertyGroup>
4-
<TargetFramework>net7</TargetFramework>
4+
<TargetFramework>net8</TargetFramework>
55
<RazorLangVersion>3.0</RazorLangVersion>
66
<AssemblyName>AntDesign.Pro.Template</AssemblyName>
77
<RootNamespace>AntDesign.Pro.Template</RootNamespace>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="AntDesign.Charts" Version="0.3.1" />
12-
<PackageReference Include="AntDesign.ProLayout" Version="0.14.4" />
13-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" />
14-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0" PrivateAssets="all" />
15-
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
16-
<PackageReference Include="System.Net.Http.Json" Version="7.0.0" />
11+
<PackageReference Include="AntDesign.Charts" Version="0.4.0" />
12+
<PackageReference Include="AntDesign.ProLayout" Version="0.16.2" />
13+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
14+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" PrivateAssets="all" />
15+
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
16+
<PackageReference Include="System.Net.Http.Json" Version="8.0.0" />
1717
</ItemGroup>
1818

1919
<PropertyGroup Condition=" '$(SolutionDir)'==''">

src/AntDesign.Pro/App.razor

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<Router AppAssembly="@typeof(Program).Assembly">
22
<Found Context="routeData">
3-
<RouteView RouteData="@routeData" DefaultLayout="@typeof(BasicLayout)" />
3+
<CascadingValue Value="routeData">
4+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(BasicLayout)" />
5+
</CascadingValue>
46
</Found>
57
<NotFound>
68
<LayoutView Layout="@typeof(BasicLayout)">

src/AntDesign.Pro/Layouts/BasicLayout.razor

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
@namespace AntDesign.Pro.Template
22
@inherits LayoutComponentBase
33

4-
<AntDesign.ProLayout.BasicLayout
5-
Logo="@("https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg")"
6-
MenuData="MenuData">
4+
<AntDesign.ProLayout.BasicLayout Logo="@("https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg")"
5+
MenuData="MenuData"
6+
MenuAccordion
7+
Collapsed="collapsed"
8+
OnCollapse="e=>collapsed=e">
9+
<HeaderContentRender>
10+
<Space Size="@("24")">
11+
<SpaceItem>
12+
<Icon Class="action" Type="@(collapsed?"menu-unfold":"menu-fold")" OnClick="Toggle" />
13+
</SpaceItem>
14+
<SpaceItem>
15+
<Icon Class="action" Type="reload" Theme="outline" OnClick="Reload" />
16+
</SpaceItem>
17+
</Space>
18+
</HeaderContentRender>
719
<RightContentRender>
820
<AntDesign.Pro.Template.Components.RightContent />
921
</RightContentRender>
1022
<ChildContent>
11-
@Body
23+
<ReuseTabs></ReuseTabs>
24+
@* @Body *@
1225
</ChildContent>
1326
<FooterRender>
1427
<FooterView Copyright="2021 Ant Design Blazor" Links="Links"></FooterView>
@@ -17,14 +30,21 @@
1730
<SettingDrawer />
1831

1932
@inject HttpClient HttpClient
33+
@inject ReuseTabsService TabService;
2034
@code
2135
{
36+
bool collapsed;
37+
2238
private MenuDataItem[] MenuData { get; set; } = { };
2339

2440
protected override async Task OnInitializedAsync()
2541
{
2642
await base.OnInitializedAsync();
2743
MenuData = await HttpClient.GetFromJsonAsync<MenuDataItem[]>("data/menu.json");
44+
45+
// workaround for the reusetabs issue that can't open the default page.
46+
// will fix in next release. https://github.com/ant-design-blazor/ant-design-blazor/pull/3519
47+
TabService.ReloadPage();
2848
}
2949

3050
public LinkItem[] Links { get; set; } =
@@ -51,4 +71,14 @@
5171
BlankTarget = true,
5272
}
5373
};
74+
75+
void Toggle()
76+
{
77+
collapsed = !collapsed;
78+
}
79+
80+
void Reload()
81+
{
82+
TabService.ReloadPage();
83+
}
5484
}

0 commit comments

Comments
 (0)