This repository has been archived by the owner on Apr 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/benjaminsampica/DynamoLeagu…
- Loading branch information
Showing
44 changed files
with
1,431 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,15 @@ By default, a test account is created with administrator permissions with the fo | |
Username `[email protected]` | ||
|
||
Password `hunter2` | ||
|
||
# Contributing | ||
|
||
Please make sure all tests pass before submitting a new pull request. | ||
|
||
## Adding a Migration | ||
|
||
New migrations can be added to the database by: | ||
|
||
1. Installing the dotnet ef tools via `dotnet tool install --global dotnet-ef` | ||
2. Running the following command with a command line while inside the `/src/Server` folder | ||
`dotnet ef migrations add {YourMigrationName} -o ./Infrastructure/Migrations --context ApplicationDbContext --project DynamoLeagueBlazor.Server.csproj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<MudCard Style=@BackgroundColor Class="ma-1"> | ||
<MudCardHeader> | ||
<CardHeaderAvatar> | ||
<MudAvatar Image=@RankedItem.ImageUrl></MudAvatar> | ||
</CardHeaderAvatar> | ||
<CardHeaderContent> | ||
<MudText Typo="NameTypo">@RankedItem.Name</MudText> | ||
</CardHeaderContent> | ||
<CardHeaderActions> | ||
<MudText Typo="AmountTypo" Color=Color.Success>@RankedItem.Amount</MudText> | ||
</CardHeaderActions> | ||
</MudCardHeader> | ||
</MudCard> | ||
|
||
@code { | ||
[Parameter, EditorRequired] public IRankedItem RankedItem { get; set; } = null!; | ||
[Parameter, EditorRequired] public Typo NameTypo { get; set; } | ||
[Parameter, EditorRequired] public Typo AmountTypo { get; set; } | ||
[Parameter] public string? BackgroundColor { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@if(RankedItems.Count() > 2) | ||
{ | ||
<MudItem xs=12> | ||
@{ | ||
var first =RankedItems.First(); | ||
var second = RankedItems.Skip(1).First(); | ||
var third = RankedItems.Skip(2).First(); | ||
} | ||
<RankedCard BackgroundColor="background: rgba(167, 149, 70, 1);" RankedItem="@first" NameTypo=Typo.h4 AmountTypo=Typo.h4/> | ||
<RankedCard BackgroundColor="background: rgba(147, 147, 147, 1);" RankedItem="@second" NameTypo=Typo.h5 AmountTypo=Typo.h5/> | ||
<RankedCard BackgroundColor="background: rgba(135, 106, 63, 1);" RankedItem="@third" NameTypo=Typo.h5 AmountTypo=Typo.h5/> | ||
</MudItem> | ||
@foreach(var rankedItem in RankedItems.Skip(3)) | ||
{ | ||
<MudItem xs=12 sm=4 Class="mx-auto"> | ||
<RankedCard RankedItem="@rankedItem" NameTypo=Typo.body1 AmountTypo=Typo.h6 /> | ||
</MudItem> | ||
} | ||
} | ||
else | ||
{ | ||
<MudAlert Severity=Severity.Normal> | ||
@NotEnoughItemsContent | ||
</MudAlert> | ||
} | ||
|
||
@code { | ||
[Parameter] public IEnumerable<IRankedItem> RankedItems { get; set; } = Array.Empty<IRankedItem>(); | ||
[Parameter, EditorRequired] public RenderFragment NotEnoughItemsContent { get; set; } = null!; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
@if(_result is null) | ||
{ | ||
<MudSkeleton SkeletonType="SkeletonType.Text" Width="100%" Height="50px"/> | ||
@for(int i = 0; i < 3; i++) | ||
{ | ||
<MudItem xs=12> | ||
<MudCard Class="ma-1"> | ||
<MudCardHeader> | ||
<CardHeaderAvatar> | ||
<MudSkeleton SkeletonType=SkeletonType.Circle Width="50px" Height="50px"></MudSkeleton> | ||
</CardHeaderAvatar> | ||
<CardHeaderContent> | ||
<MudSkeleton SkeletonType=SkeletonType.Text Width="200px" Height="40px"></MudSkeleton> | ||
</CardHeaderContent> | ||
<CardHeaderActions> | ||
<MudSkeleton SkeletonType=SkeletonType.Text Width="40px" Height="40px"></MudSkeleton> | ||
</CardHeaderActions> | ||
</MudCardHeader> | ||
</MudCard> | ||
</MudItem> | ||
} | ||
} | ||
else | ||
{ | ||
<MudGrid> | ||
<MudItem xs=12> | ||
<PageHeader> | ||
Top Offenders | ||
</PageHeader> | ||
</MudItem> | ||
|
||
<RankedList RankedItems="_result.Players"> | ||
<NotEnoughItemsContent> | ||
There aren't enough players with fines quite yet. Check back later! | ||
</NotEnoughItemsContent> | ||
</RankedList> | ||
</MudGrid> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
src/Client/Features/Dashboard/TopOffenders/PlayerCard.razor
This file was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
src/Client/Features/Dashboard/TopOffenders/TopOffenders.razor
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
@if(_result is null) | ||
{ | ||
<MudSkeleton SkeletonType="SkeletonType.Text" Width="100%" Height="50px"/> | ||
@for(int i = 0; i < 3; i++) | ||
{ | ||
<MudItem xs=12> | ||
<MudCard Class="ma-1"> | ||
<MudCardHeader> | ||
<CardHeaderAvatar> | ||
<MudSkeleton SkeletonType=SkeletonType.Circle Width="50px" Height="50px"></MudSkeleton> | ||
</CardHeaderAvatar> | ||
<CardHeaderContent> | ||
<MudSkeleton SkeletonType=SkeletonType.Text Width="200px" Height="40px"></MudSkeleton> | ||
</CardHeaderContent> | ||
<CardHeaderActions> | ||
<MudSkeleton SkeletonType=SkeletonType.Text Width="40px" Height="40px"></MudSkeleton> | ||
</CardHeaderActions> | ||
</MudCardHeader> | ||
</MudCard> | ||
</MudItem> | ||
} | ||
} | ||
else | ||
{ | ||
<MudGrid> | ||
<MudItem xs=12> | ||
<PageHeader> | ||
Top Team Fines | ||
</PageHeader> | ||
</MudItem> | ||
|
||
<RankedList RankedItems="_result.Teams"> | ||
<NotEnoughItemsContent> | ||
There aren't enough teams with fines quite yet. Check back later! | ||
</NotEnoughItemsContent> | ||
</RankedList> | ||
</MudGrid> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using DynamoLeagueBlazor.Shared.Features.Dashboard; | ||
using Microsoft.AspNetCore.Components; | ||
using Microsoft.AspNetCore.Components.WebAssembly.Authentication; | ||
using System.Net.Http.Json; | ||
|
||
namespace DynamoLeagueBlazor.Client.Features.Dashboard; | ||
|
||
public sealed partial class TopTeamFines : IDisposable | ||
{ | ||
[Inject] private HttpClient HttpClient { get; set; } = null!; | ||
|
||
private TopTeamFinesResult? _result; | ||
private readonly CancellationTokenSource _cts = new(); | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
try | ||
{ | ||
_result = await HttpClient.GetFromJsonAsync<TopTeamFinesResult>(TopTeamFinesRouteFactory.Uri, _cts.Token); | ||
} | ||
catch (AccessTokenNotAvailableException exception) | ||
{ | ||
exception.Redirect(); | ||
} | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
_cts.Cancel(); | ||
_cts.Dispose(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@using DynamoLeagueBlazor.Client.Features.Dashboard.Shared | ||
@using DynamoLeagueBlazor.Shared.Features.Dashboard.Shared |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div class="d-flex align-center"> | ||
<MudAvatar Image=@ImageUrl Class="mr-1"></MudAvatar> | ||
@Name | ||
</div> | ||
|
||
@code { | ||
[Parameter, EditorRequired] public string Name { get; set; } = string.Empty; | ||
[Parameter, EditorRequired] public string ImageUrl { get; set; } = string.Empty; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.