From a2fe5d5d083fffa301c3c76b383f3e37dcc19e53 Mon Sep 17 00:00:00 2001 From: RobertBeekman Date: Thu, 8 Feb 2024 20:58:16 +0100 Subject: [PATCH] Settings - Added account management --- src/Artemis.UI/Routing/Routes.cs | 1 + .../LayoutProviders/WorkshopLayoutView.axaml | 5 +- .../WorkshopLayoutViewModel.cs | 1 + .../Account/ChangeEmailAddressView.axaml | 14 ++ .../Account/ChangeEmailAddressView.axaml.cs | 16 +++ .../Account/ChangeEmailAddressViewModel.cs | 50 ++++++++ .../Settings/Account/ChangePasswordView.axaml | 17 +++ .../Account/ChangePasswordView.axaml.cs | 17 +++ .../Account/ChangePasswordViewModel.cs | 47 +++++++ .../Settings/Account/RemoveAccountView.axaml | 14 ++ .../Account/RemoveAccountView.axaml.cs | 16 +++ .../Account/RemoveAccountViewModel.cs | 52 ++++++++ .../Screens/Settings/SettingsViewModel.cs | 1 + .../Settings/Tabs/AccountTabView.axaml | 121 ++++++++++++++++++ .../Settings/Tabs/AccountTabView.axaml.cs | 14 ++ .../Settings/Tabs/AccountTabViewModel.cs | 105 +++++++++++++++ .../CurrentUser/CurrentUserView.axaml | 18 ++- .../CurrentUser/CurrentUserView.axaml.cs | 8 +- .../CurrentUser/CurrentUserViewModel.cs | 10 +- .../Entries/Details/EntryReleasesViewModel.cs | 1 + .../Dialogs/DeviceSelectionDialogViewModel.cs | 1 + .../Workshop/Layout/LayoutDetailsViewModel.cs | 1 + .../Library/SubmissionDetailViewModel.cs | 2 +- .../Library/Tabs/InstalledTabItemViewModel.cs | 1 + .../Library/Tabs/InstalledTabViewModel.cs | 1 + .../Steps/UploadStepViewModel.cs | 4 +- .../DryIoc/ContainerExtensions.cs | 8 +- .../EntryInstallResult.cs | 3 +- .../IEntryInstallationHandler.cs | 1 + .../LayoutEntryInstallationHandler.cs | 1 + .../ProfileEntryInstallationHandler.cs | 1 + .../{ImageUploadResult.cs => ApiResult.cs} | 10 +- .../{Services => Models}/AccessToken.cs | 3 +- .../{Services => Models}/InstalledEntry.cs | 2 +- .../Models/PersonalAccessToken.cs | 3 + .../Providers/WorkshopLayoutProvider.cs | 1 + .../Services/AuthenticationService.cs | 1 + .../Interfaces/IUserManagementService.cs | 16 +++ .../Services/Interfaces/IWorkshopService.cs | 5 +- .../Services/UserManagementService.cs | 103 +++++++++++++++ .../Services/WorkshopService.cs | 14 +- .../WorkshopConstants.cs | 1 + 42 files changed, 681 insertions(+), 30 deletions(-) create mode 100644 src/Artemis.UI/Screens/Settings/Account/ChangeEmailAddressView.axaml create mode 100644 src/Artemis.UI/Screens/Settings/Account/ChangeEmailAddressView.axaml.cs create mode 100644 src/Artemis.UI/Screens/Settings/Account/ChangeEmailAddressViewModel.cs create mode 100644 src/Artemis.UI/Screens/Settings/Account/ChangePasswordView.axaml create mode 100644 src/Artemis.UI/Screens/Settings/Account/ChangePasswordView.axaml.cs create mode 100644 src/Artemis.UI/Screens/Settings/Account/ChangePasswordViewModel.cs create mode 100644 src/Artemis.UI/Screens/Settings/Account/RemoveAccountView.axaml create mode 100644 src/Artemis.UI/Screens/Settings/Account/RemoveAccountView.axaml.cs create mode 100644 src/Artemis.UI/Screens/Settings/Account/RemoveAccountViewModel.cs create mode 100644 src/Artemis.UI/Screens/Settings/Tabs/AccountTabView.axaml create mode 100644 src/Artemis.UI/Screens/Settings/Tabs/AccountTabView.axaml.cs create mode 100644 src/Artemis.UI/Screens/Settings/Tabs/AccountTabViewModel.cs rename src/Artemis.WebClient.Workshop/Handlers/UploadHandlers/{ImageUploadResult.cs => ApiResult.cs} (51%) rename src/Artemis.WebClient.Workshop/{Services => Models}/AccessToken.cs (92%) rename src/Artemis.WebClient.Workshop/{Services => Models}/InstalledEntry.cs (99%) create mode 100644 src/Artemis.WebClient.Workshop/Models/PersonalAccessToken.cs create mode 100644 src/Artemis.WebClient.Workshop/Services/Interfaces/IUserManagementService.cs create mode 100644 src/Artemis.WebClient.Workshop/Services/UserManagementService.cs diff --git a/src/Artemis.UI/Routing/Routes.cs b/src/Artemis.UI/Routing/Routes.cs index e129b384c..1d4862f44 100644 --- a/src/Artemis.UI/Routing/Routes.cs +++ b/src/Artemis.UI/Routing/Routes.cs @@ -64,6 +64,7 @@ public static class Routes new RouteRegistration("{releaseId:guid}") } }, + new RouteRegistration("account"), new RouteRegistration("about") } }, diff --git a/src/Artemis.UI/Screens/Device/Tabs/Layout/LayoutProviders/WorkshopLayoutView.axaml b/src/Artemis.UI/Screens/Device/Tabs/Layout/LayoutProviders/WorkshopLayoutView.axaml index 07a8a7325..38c1e2eef 100644 --- a/src/Artemis.UI/Screens/Device/Tabs/Layout/LayoutProviders/WorkshopLayoutView.axaml +++ b/src/Artemis.UI/Screens/Device/Tabs/Layout/LayoutProviders/WorkshopLayoutView.axaml @@ -4,6 +4,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:services="clr-namespace:Artemis.WebClient.Workshop.Services;assembly=Artemis.WebClient.Workshop" xmlns:layoutProviders="clr-namespace:Artemis.UI.Screens.Device.Layout.LayoutProviders" + xmlns:models="clr-namespace:Artemis.WebClient.Workshop.Models;assembly=Artemis.WebClient.Workshop" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="Artemis.UI.Screens.Device.Layout.LayoutProviders.WorkshopLayoutView" x:DataType="layoutProviders:WorkshopLayoutViewModel"> @@ -19,7 +20,7 @@ + + + You are not logged in + + In order to manage your account you must be logged in. + + Creating an account is free and we'll not bother you with a newsletter or crap like that. + + + + + + Click Log In below to (create an account) and log in. + + You'll also be able to log in with Google or Discord. + + + + + + + + + + + + + + + + + + + + Account management + + + + + + + Change avatar + + + +