Workshop - Added profile uploading

Submission wizard - Final upload steps
This commit is contained in:
Robert committed 2023-08-13 21:11:05 +02:00
1 parent e52faf1c9f
commit ad4da3032d
32 files changed
+621 -93

No files matched your search

@@ -1,5 +1,9 @@
using System.Reflection;
using Artemis.WebClient.Workshop.Extensions;
using Artemis.WebClient.Workshop.Repositories;
using Artemis.WebClient.Workshop.Services;
using Artemis.WebClient.Workshop.State;
using Artemis.WebClient.Workshop.UploadHandlers;
using DryIoc;
using DryIoc.Microsoft.DependencyInjection;
using IdentityModel.Client;
@@ -18,11 +22,17 @@ public static class ContainerExtensions
/// <param name="container">The builder building the current container</param>
public static void RegisterWorkshopClient(this IContainer container)
{
Assembly[] workshopAssembly = {typeof(WorkshopConstants).Assembly};
ServiceCollection serviceCollection = new();
serviceCollection
.AddHttpClient()
.AddWorkshopClient()
.AddHttpMessageHandler<WorkshopClientStoreAccessor, AuthenticationDelegatingHandler>()
.ConfigureHttpClient(client => client.BaseAddress = new Uri(WorkshopConstants.WORKSHOP_URL + "/graphql"));
serviceCollection.AddHttpClient(WorkshopConstants.WORKSHOP_CLIENT_NAME)
.AddHttpMessageHandler<AuthenticationDelegatingHandler>()
.ConfigureHttpClient(client => client.BaseAddress = new Uri(WorkshopConstants.WORKSHOP_URL));
serviceCollection.AddSingleton<IDiscoveryCache>(r =>
{
@@ -34,5 +44,8 @@ public static class ContainerExtensions
container.Register<IAuthenticationRepository, AuthenticationRepository>(Reuse.Singleton);
container.Register<IAuthenticationService, AuthenticationService>(Reuse.Singleton);
container.Register<EntryUploadHandlerFactory>(Reuse.Transient);
container.RegisterMany(workshopAssembly, type => type.IsAssignableTo<IEntryUploadHandler>(), Reuse.Transient);
}
}