Skip to content

Commit

Permalink
reactor: move the Admin module to the client side
Browse files Browse the repository at this point in the history
  • Loading branch information
djoufson committed Dec 29, 2024
1 parent 4f67ff7 commit 79fc94f
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 17 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
@using app.Components.Pages.Admin.Events
@using app.domain.Models.EventAggregate.Entities
@using app.domain.Models.EventAggregate.ValueObjects
@using app.domain.ViewModels
@inject IJSRuntime JsInterop

<div id="activity-popup" class="activity-popup absolute top-0 left-0 w-full h-full z-10">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
</div>

@code{
public int Year => DateTime.Now.Year;
private int Year => DateTime.Now.Year;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@page "/admin/events/delete/{Id:guid}"
@using app.business.Services
@layout AdminLayout
@attribute [Authorize]
@inject NavigationManager NavigationManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
@page "/admin"
@using app.business.Services
@using app.domain.Models.EventAggregate
@using app.shared.Utilities
@attribute [Authorize]
@layout AdminLayout
@inject IEventService EventService
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
@page "/admin/events"
@page "/admin/events/{Id:guid}"
@using app.domain.Models.EventAggregate.Enums
@layout AdminLayout
@rendermode InteractiveServer
@rendermode InteractiveWebAssembly
@attribute [Authorize]

<PageTitle>Admin | Edit Event</PageTitle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.JSInterop;

namespace app.Components.Pages.Admin.Events;
namespace app.client.Pages.Admin.Events;
public partial class NewOrEdit
{
[Parameter]
Expand Down
1 change: 1 addition & 0 deletions app.client/Pages/Counter.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@page "/counter"
@attribute [Authorize]
@rendermode InteractiveWebAssembly

<PageTitle>Counter</PageTitle>
Expand Down
15 changes: 15 additions & 0 deletions app.client/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,18 @@
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using Microsoft.AspNetCore.Authorization
@using System.Security.Claims
@using Microsoft.AspNetCore.Http
@using app.client.Components
@using app.business.Services
@using app.client.Layout
@using ErrorOr
@using app.domain.Extensions
@using app.domain.Models.EventAggregate
@using app.shared.Utilities
@using app.client.Pages.Admin.Events
@using app.domain.Models.EventAggregate.Entities
@using app.domain.Models.EventAggregate.ValueObjects
@using app.domain.ViewModels
@using app.domain.Models.EventAggregate.Enums
5 changes: 3 additions & 2 deletions app.client/app.client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\app.business\app.business.csproj" />
<ItemGroup>
<ProjectReference Include="..\app.business\app.business.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using app.domain.Models.EventAggregate.ValueObjects;

namespace app.Extensions;
namespace app.domain.Extensions;
public static class ScheduleExtensions
{
public static string ToFriendlyString(this EventSchedule schedule)
Expand Down
4 changes: 2 additions & 2 deletions app/Components/Components/NavBar.razor
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<li class="flex">
<NavLink href="/dotnet-conf-2024" data-enhance-nav="false" class="py-2 md:text-slate-300 md:hover:text-white transition-all">.NET Conf 2024</NavLink>
</li>
<li class="flex">
@* <li class="flex">
<NavLink href="/counter" data-enhance-nav="false" class="py-2 md:text-slate-300 md:hover:text-white transition-all">Counter</NavLink>
</li>
</li> *@
@* <li class="flex">
<NavLink href="/about" class="py-2 md:text-slate-300 md:hover:text-white transition-all">About</NavLink>
</li>
Expand Down

0 comments on commit 79fc94f

Please sign in to comment.