Skip to content

Commit

Permalink
Merge pull request #215 from DennisvHest/development
Browse files Browse the repository at this point in the history
1.6.1
  • Loading branch information
DennisvHest authored Aug 25, 2024
2 parents b85dec3 + 1dfc2ae commit 47924cf
Show file tree
Hide file tree
Showing 16 changed files with 143 additions and 45 deletions.
14 changes: 7 additions & 7 deletions MapMaven.Core.Tests/MapMaven.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@

<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="MockQueryable.Moq" Version="7.0.1" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="RichardSzalay.MockHttp" Version="7.0.0" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="21.0.22" />
<PackageReference Include="TestableIO.System.IO.Abstractions" Version="21.0.22" />
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="21.0.22" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="Xunit.Microsoft.DependencyInjection" Version="8.1.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="21.0.29" />
<PackageReference Include="TestableIO.System.IO.Abstractions" Version="21.0.29" />
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="21.0.29" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="Xunit.Microsoft.DependencyInjection" Version="8.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
14 changes: 7 additions & 7 deletions MapMaven.Core/MapMaven.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<PackageReference Include="BeatSaverSharper" Version="3.4.5" />
<PackageReference Include="FastDeepCloner" Version="1.3.6" />
<PackageReference Include="Microsoft.AspNetCore.Components.DataAnnotations.Validation" Version="3.2.0-rc1.20223.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.6" />
<PackageReference Include="Microsoft.Extensions.ApiDescription.Client" Version="8.0.6">
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.7" />
<PackageReference Include="Microsoft.Extensions.ApiDescription.Client" Version="8.0.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -35,19 +35,19 @@
<PackageReference Include="NAudio" Version="2.2.1" />
<PackageReference Include="NAudio.Vorbis" Version="1.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NSwag.ApiDescription.Client" Version="14.0.8">
<PackageReference Include="NSwag.ApiDescription.Client" Version="14.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Pather.CSharp" Version="2.1.0" />
<PackageReference Include="Plotly.NET" Version="5.0.0" />
<PackageReference Include="RateLimiter" Version="2.2.0" />
<PackageReference Include="Serilog" Version="4.0.0" />
<PackageReference Include="Serilog" Version="4.0.1" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
<PackageReference Include="System.Drawing.Common" Version="8.0.6" />
<PackageReference Include="System.Drawing.Common" Version="8.0.7" />
<PackageReference Include="System.Reactive" Version="6.0.1" />
<PackageReference Include="TestableIO.System.IO.Abstractions" Version="21.0.22" />
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="21.0.22" />
<PackageReference Include="TestableIO.System.IO.Abstractions" Version="21.0.29" />
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="21.0.29" />
</ItemGroup>
<ItemGroup Label="ScoreSaberScoreEstimateMLModel">
<None Include="ScoreEstimation\ScoreSaberScoreEstimateMLModel.consumption.cs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.6">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.6">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.6">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.6">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
6 changes: 3 additions & 3 deletions MapMaven.Functions/MapMaven.Functions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.20.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.21.2" />
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.22.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.2" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.4" />
<PackageReference Include="Microsoft.Extensions.Azure" Version="1.7.4" />
<PackageReference Include="RateLimiter" Version="2.2.0" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions MapMaven.Infrastructure/MapMaven.Infrastructure.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<ItemGroup>
<PackageReference Include="BeatSaber.SongHashing" Version="1.2.0" />
<PackageReference Include="BeatSaverSharper" Version="3.4.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.6">
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
1 change: 0 additions & 1 deletion MapMaven/Components/PlayerProfileInfo.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@
top: 0;
width: 100%;
height: auto;
z-index: -1;
filter: blur(10px);
}
8 changes: 4 additions & 4 deletions MapMaven/Components/Playlists/PlaylistList.razor
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@
</div>
@if (LoadingPlaylists)
{
<MudProgressCircular Color="Color.Info" Size="Size.Small" Indeterminate="true" Class="align-self-center" />
<MudProgressLinear Color="Color.Info" Indeterminate="true" />
}
<div class="full-height" style="overflow-y: auto;">
<div class="full-height" style="overflow-y: auto; margin-right: 8px;">
@if (string.IsNullOrEmpty(PlaylistSearchText))
{
<MudTreeView T="Playlist" @ref="PlaylistTreeView" SelectedValue="SelectedPlaylist" SelectedValueChanged="OnPlaylistSelect" Color="Color.Primary" ExpandOnClick="true" AutoExpand="true">
<PlaylistTreeViewFolder Folder="PlaylistTree.RootPlaylistFolder" />
<PlaylistTreeViewFolder Folder="PlaylistTree.RootPlaylistFolder" Loading="LoadingPlaylists" />
</MudTreeView>
}
else
{
<MudTreeView T="Playlist" SelectedValue="SelectedPlaylist" SelectedValueChanged="OnPlaylistSelect" Color="Color.Primary" ExpandOnClick="true">
<PlaylistTreeViewFolder Folder="PlaylistTree.RootPlaylistFolder" Expanded="true" />
<PlaylistTreeViewFolder Folder="PlaylistTree.RootPlaylistFolder" Loading="LoadingPlaylists" Expanded="true" />
</MudTreeView>
}
</div>
Expand Down
7 changes: 7 additions & 0 deletions MapMaven/Components/Playlists/PlaylistTreeViewFolder.razor
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@
}
}

@if (!Loading && !Folder.ChildItems.Any())
{
<div class="d-flex align-center justify-center full-width pa-2">
<MudIcon Icon="@Icons.Material.Filled.PlaylistRemove" Class="mr-2" /> <soan>No playlists found</soan>
</div>
}

<MudDialog @bind-Visible="DeletePlaylistDialogVisible" Options="new() { BackdropClick = false }">
<DialogContent>
<MudText Typo="Typo.body1" Class="mb-3">Are you sure you want to delete the "@PlaylistToDelete.Title" playlist?</MudText>
Expand Down
3 changes: 3 additions & 0 deletions MapMaven/Components/Playlists/PlaylistTreeViewFolder.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public partial class PlaylistTreeViewFolder
[Parameter]
public bool Expanded { get; set; }

[Parameter]
public bool Loading { get; set; }

Playlist? PlaylistToDelete = null;
bool DeletePlaylistDialogVisible = false;
bool DeletingPlaylist = false;
Expand Down
5 changes: 3 additions & 2 deletions MapMaven/Components/SideNav.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@inherits ReactiveComponent

<MudDrawer Open="true" Elevation="1" Class="sidenav">
<MudDrawer Open="true" Elevation="1" Class="sidenav" Style="width: var(--main-drawer-width-left)">
<div class="resizer-handle"></div>
<PlayerProfile></PlayerProfile>
<MudNavMenu Color="Color.Primary" Bordered="true" Class="full-height d-flex flex-column fill-remaining-space">
@if (!string.IsNullOrEmpty(PlayerId))
Expand Down Expand Up @@ -40,4 +41,4 @@
</MudNavLink>
</div>
</MudNavMenu>
</MudDrawer>
</MudDrawer>
14 changes: 12 additions & 2 deletions MapMaven/Components/SideNav.razor.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
using MapMaven.Core.Services.Interfaces;
using MapMaven.Core.Services.Leaderboards;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MudBlazor;

namespace MapMaven.Components
{
public partial class SideNav
{
[Inject]
protected IPlaylistService PlaylistService { get; set; }
IPlaylistService PlaylistService { get; set; }

[Inject]
ILeaderboardService ScoreSaberService { get; set; }

[Inject]
public IDialogService DialogService { get; set; }
IDialogService DialogService { get; set; }

[Inject]
IJSRuntime JS { get; set; }

public string? PlayerId { get; set; } = null;

Expand All @@ -23,6 +27,12 @@ protected override void OnInitialized()
SubscribeAndBind(ScoreSaberService.PlayerIdObservable, playerId => PlayerId = playerId);
}

protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
await JS.InvokeVoidAsync("window.sideNavResizer.initialize");
}

protected void OnMapsNavigation()
{
PlaylistService.SetSelectedPlaylist(null);
Expand Down
55 changes: 55 additions & 0 deletions MapMaven/Components/SideNav.razor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
window.sideNavResizer = (function () {
const minSideNavWidth = 250;
const maxSideNavWidth = 700;

let sideNavWidth = localStorage.getItem("sideNavWidth") ?? minSideNavWidth;

setDrawerWidthNoThrottle(sideNavWidth);

const setDrawerWidth = throttle(setDrawerWidthNoThrottle, 30);

function setDrawerWidthNoThrottle(width) {
// Set the side nav width to the current mouse position
sideNavWidth = width;
document.documentElement.style.setProperty("--main-drawer-width-left", `${width}px`);
}

function startSideNavResize(event) {
// Start tracking mouse movement
document.addEventListener("mousemove", onMouseMove);
document.addEventListener("mouseup", stopSideNavResize);
}

function onMouseMove(event) {
if (event.clientX >= minSideNavWidth && event.clientX <= maxSideNavWidth)
setDrawerWidth(event.clientX);
}

function stopSideNavResize() {
document.removeEventListener("mouseup", stopSideNavResize);
document.removeEventListener("mousemove", onMouseMove);

localStorage.setItem("sideNavWidth", sideNavWidth);
}

function throttle(mainFunction, delay) {
let timerFlag = null;

return (...args) => {
if (timerFlag === null)
mainFunction(...args);
timerFlag = setTimeout(() => {
timerFlag = null;
}, delay);
}
};

function initialize() {
const resizerHandle = document.querySelector(".resizer-handle");
resizerHandle.addEventListener("mousedown", startSideNavResize);
}

return {
initialize: initialize
}
})()
16 changes: 8 additions & 8 deletions MapMaven/MapMaven.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -83,23 +83,23 @@
<PackageReference Include="BeatSaberPlaylistsLib" Version="1.6.6" />
<PackageReference Include="Blazor-ApexCharts" Version="3.3.0" />
<PackageReference Include="Clowd.Squirrel" Version="2.11.1" />
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="7.0.0-rc.1" />
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="7.0.0" />
<PackageReference Include="Markdig" Version="0.37.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.DataAnnotations.Validation" Version="3.2.0-rc1.20223.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.6">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Utilities" Version="17.10.40170" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240607001" />
<PackageReference Include="MudBlazor" Version="7.0.0" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240627000" />
<PackageReference Include="MudBlazor" Version="7.6.0" />
<PackageReference Include="NAudio" Version="2.2.1" />
<PackageReference Include="NAudio.Vorbis" Version="1.5.0" />
<PackageReference Include="PInvoke.User32" Version="0.7.124" />
<PackageReference Include="securifybv.ShellLink" Version="0.1.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="System.Drawing.Common" Version="8.0.6" />
<PackageReference Include="System.Drawing.Common" Version="8.0.7" />
<PackageReference Include="System.Reactive" Version="6.0.1" />
</ItemGroup>

Expand All @@ -109,9 +109,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.61" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.61" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.61" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.80" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.80" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.80" />
</ItemGroup>

<PropertyGroup>
Expand Down
23 changes: 22 additions & 1 deletion MapMaven/wwwroot/css/app.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
body {
html {
--main-drawer-width-left: 250px;
}

body {
user-select: none;
}

Expand Down Expand Up @@ -89,6 +93,23 @@
width: 100%;
}

.mud-main-content {
margin-left: var(--main-drawer-width-left) !important;
}

.resizer-handle {
position: absolute;
right: 0;
height: 100%;
width: 8px;
z-index: 9999999;
}

.resizer-handle:hover, .resizer-handle:active {
background-color: rgba(255, 255, 255, 0.3);
cursor: e-resize;
}

/* MudBlazor overrides */
.mud-main-content {
height: 100vh;
Expand Down
2 changes: 2 additions & 0 deletions MapMaven/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
}
}
</style>

<script src="./Components/SideNav.razor.js"></script>
</head>

<body style="background-color: #0f0f0f">
Expand Down

0 comments on commit 47924cf

Please sign in to comment.