Skip to content

Commit

Permalink
Removed FixedHeader for Crash Reports
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Feb 20, 2024
1 parent d3d4ecf commit 075f28a
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</CardTitle>
</CardHeader>
<CardBody>
<DataGridStreamingPaging @ref="@_datagridPagingRef" TItem="CrashReportModel2" GetFilters="@GetFilters" GetItems="@GetCrashReports" Sortable Filterable DefaultPageSize="@UserSettings.DefaultCrashReportPageSize" PageSizes="@UserSettings.AvailableCrashReportPageSizes" GetPageSize="@(x => x.CrashReportPageSize)" FixedHeader>
<DataGridStreamingPaging @ref="@_datagridPagingRef" TItem="CrashReportModel2" GetFilters="@GetFilters" GetItems="@GetCrashReports" Sortable Filterable DefaultPageSize="@UserSettings.DefaultCrashReportPageSize" PageSizes="@UserSettings.AvailableCrashReportPageSizes" GetPageSize="@(x => x.CrashReportPageSize)">
<DataGridColumns>
<DataGridColumnText TItem="CrashReportModel2" ElementId="game-version" Field="@nameof(CrashReportModel2.GameVersion)" Caption="Game Version" Filterable Placeholder="v1.0.0" Sortable SortField="@nameof(EntityFields.GameVersion)"/>
<DataGridColumnTextAutocomplete TItem="CrashReportModel2" Field="@nameof(CrashReportModel2.InvolvedModules)" Caption="Top Involved Module" Filterable Sortable SortField="@nameof(EntityFields.TopInvolvedModuleId)" MinLength="3" GetAutocompleteValues="@GetAutocompleteValues">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
namespace BUTR.Site.NexusMods.DependencyInjection;

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class HostedServiceAttribute : Attribute, IToRegister { }

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class HostedServiceAttribute<TInterface> : Attribute, IToRegister { }
public sealed class HostedServiceAttribute : Attribute, IToRegister;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace BUTR.Site.NexusMods.DependencyInjection;

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class ScopedServiceAttribute<TInterface> : Attribute, IToRegister { }
public sealed class ScopedServiceAttribute<TInterface> : Attribute, IToRegister;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace BUTR.Site.NexusMods.DependencyInjection;

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class SingletonServiceAttribute : Attribute, IToRegister { }
public sealed class SingletonServiceAttribute : Attribute, IToRegister;

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class SingletonServiceAttribute<TInterface> : Attribute, IToRegister { }
public sealed class SingletonServiceAttribute<TInterface> : Attribute, IToRegister;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace BUTR.Site.NexusMods.DependencyInjection;

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class TransientServiceAttribute<TInterface> : Attribute, IToRegister { }
public sealed class TransientServiceAttribute<TInterface> : Attribute, IToRegister;
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
namespace BUTR.Site.NexusMods.DependencyInjection;

public interface IToRegister { }
public interface IToRegister;
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ partial void ConfigureServicesPartial(IServiceCollection services)
context.AddSource("AutoGeneratedServicesRegistration", SourceText.From(stringBuilder.ToString(), Encoding.UTF8));
}

private IEnumerable<INamedTypeSymbol> GetTypesWithIToRegisterAttributes(Compilation compilation)
private static IEnumerable<INamedTypeSymbol> GetTypesWithIToRegisterAttributes(Compilation compilation)
{
var allTypes = GetAllTypes(compilation.GlobalNamespace);
var types = allTypes.Where(x =>
Expand All @@ -81,7 +81,7 @@ private IEnumerable<INamedTypeSymbol> GetTypesWithIToRegisterAttributes(Compilat
return types;
}

private IEnumerable<INamedTypeSymbol> GetAllTypes(INamespaceSymbol @namespace)
private static IEnumerable<INamedTypeSymbol> GetAllTypes(INamespaceSymbol @namespace)
{
foreach (var type in @namespace.GetTypeMembers())
foreach (var nestedType in GetNestedTypes(type))
Expand All @@ -92,7 +92,7 @@ private IEnumerable<INamedTypeSymbol> GetAllTypes(INamespaceSymbol @namespace)
yield return type;
}

private IEnumerable<INamedTypeSymbol> GetNestedTypes(INamedTypeSymbol type)
private static IEnumerable<INamedTypeSymbol> GetNestedTypes(INamedTypeSymbol type)
{
yield return type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Net.Http.Headers;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -136,7 +137,8 @@ public AuthenticationController(
return ApiResult(new JwtTokenResponse(generatedToken.Token, HttpContext.GetProfile(validateResponse, userRole, metadata)));
}

var token = Request.Headers["Authorization"].ToString().Replace(ButrNexusModsAuthSchemeConstants.AuthScheme, "").Trim();
var authenticationHeaderValue = AuthenticationHeaderValue.Parse(Request.Headers.Authorization!);
var token = authenticationHeaderValue.Parameter!;
return ApiResult(new JwtTokenResponse(token, HttpContext.GetProfile()));
}
}

0 comments on commit 075f28a

Please sign in to comment.