Skip to content

Commit

Permalink
Feature: remove blazored modal references (#1738)
Browse files Browse the repository at this point in the history
* remove blazored modal references

* Fix remove blazored modal references

* remove CascadingBlazoredModal
  • Loading branch information
GuillaumeM-2ISA authored Feb 6, 2023
1 parent 69a37ad commit e4dbabb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 29 deletions.
47 changes: 22 additions & 25 deletions src/AzureIoTHub.Portal.Client/App.razor
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@

@using Blazored.Modal
@using Microsoft.AspNetCore.Authorization

@attribute [Authorize]

<Error>
<CascadingBlazoredModal>
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
<NotAuthorized>
@if (!context.User.Identity.IsAuthenticated)
{
<RedirectToLogin />
}
else
{
<p>You are not authorized to access this resource.</p>
}
</NotAuthorized>
</AuthorizeRouteView>
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
</CascadingBlazoredModal>
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
<NotAuthorized>
@if (!context.User.Identity.IsAuthenticated)
{
<RedirectToLogin />
}
else
{
<p>You are not authorized to access this resource.</p>
}
</NotAuthorized>
</AuthorizeRouteView>
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
</Error>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
Expand All @@ -9,7 +9,6 @@
<ItemGroup>
<PackageReference Include="ChartJs.Blazor.Fork" Version="2.0.2" />
<PackageReference Include="Blazored.LocalStorage" Version="4.3.0" />
<PackageReference Include="Blazored.Modal" Version="7.1.0" />
<PackageReference Include="FluentValidation" Version="11.4.0" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.9" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web.Extensions" Version="5.0.0-preview9.20513.1" />
Expand Down
2 changes: 0 additions & 2 deletions src/AzureIoTHub.Portal.Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using AzureIoTHub.Portal.Models.v10;
using AzureIoTHub.Portal.Settings;
using Blazored.LocalStorage;
using Blazored.Modal;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
Expand Down Expand Up @@ -60,7 +59,6 @@
_ = builder.Services.AddFileReaderService(o => o.UseWasmSharedBuffer = true);

_ = builder.Services.AddBlazoredLocalStorage();
_ = builder.Services.AddBlazoredModal();
_ = builder.Services.AddMudServices(config =>
{
config.SnackbarConfiguration.PositionClass = Defaults.Classes.Position.BottomLeft;
Expand Down

0 comments on commit e4dbabb

Please sign in to comment.