From a8a797211a67d4238bfc96950a85bd641d48495e Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Sun, 29 Sep 2024 20:58:08 +0200 Subject: [PATCH] Add PlatformUno Frontend. --- FrontendPlaformUno/.editorconfig | 167 +++ FrontendPlaformUno/.gitignore | 403 +++++++ .../.run/FrontendPlaformUno.run.xml | 62 + FrontendPlaformUno/.run/Readme.md | 3 + .../.vsconfig | 28 +- FrontendPlaformUno/Directory.Build.props | 15 + FrontendPlaformUno/Directory.Build.targets | 2 + FrontendPlaformUno/Directory.Packages.props | 18 + .../FrontendPlaformUno.Tests/AppInfoTests.cs | 18 + .../FrontendPlaformUno.Tests.csproj | 20 + .../FrontendPlaformUno.Tests/GlobalUsings.cs | 3 + .../FrontendPlaformUno.UITests/Constants.cs | 12 + .../FrontendPlaformUno.UITests.csproj | 17 + .../Given_MainPage.cs | 25 + .../GlobalUsings.cs | 2 - .../FrontendPlaformUno.UITests/TestBase.cs | 82 ++ FrontendPlaformUno/FrontendPlaformUno.sln | 58 + .../FrontendPlaformUno/App.xaml | 29 + .../FrontendPlaformUno/App.xaml.cs | 199 ++++ .../FrontendPlaformUno/Assets/Icons/icon.svg | 2 +- .../Assets/Icons/icon_foreground.svg | 2 +- .../Assets/Images}/back.svg | 0 .../FrontendPlaformUno/Assets/SharedAssets.md | 32 + .../Assets}/Splash/splash_screen.svg | 2 +- .../FrontendPlaformUno.csproj | 57 + .../FrontendPlaformUno/GlobalUsings.cs | 13 + .../FrontendPlaformUno/IGameNightOptions.cs | 5 + .../FrontendPlaformUno/Models/AppConfig.cs | 6 + .../FrontendPlaformUno/Models/Entity.cs | 3 + .../Models/WeatherForecast.cs | 15 + .../FrontendPlaformUno}/Package.appxmanifest | 20 +- .../Platforms}/Android/AndroidManifest.xml | 0 .../Platforms}/Android/Assets/AboutAssets.txt | 2 +- .../Platforms/Android/Main.Android.cs | 43 + .../Platforms/Android/MainActivity.Android.cs | 15 + .../Android/Resources/AboutResources.txt | 0 .../Android/Resources/values/Strings.xml | 2 +- .../Android/Resources/values/Styles.xml | 11 +- .../Platforms}/Android/environment.conf | 0 .../Platforms/Desktop/Program.cs | 19 + .../Platforms}/MacCatalyst/Entitlements.plist | 0 .../Platforms}/MacCatalyst/Info.plist | 5 +- .../Platforms/MacCatalyst/Main.maccatalyst.cs | 13 + .../LaunchImages.launchimage/Contents.json | 0 .../Platforms/WebAssembly/LinkerConfig.xml | 10 + .../Platforms/WebAssembly/Program.cs | 13 + .../Platforms/WebAssembly}/WasmCSS/Fonts.css | 2 +- .../WebAssembly/WasmScripts/AppManifest.js | 3 + .../WebAssembly}/manifest.webmanifest | 6 +- .../wwwroot/staticwebapp.config.json | 0 .../Platforms/WebAssembly}/wwwroot/web.config | 0 .../Platforms}/iOS/Entitlements.plist | 0 .../Platforms}/iOS/Info.plist | 10 +- .../Platforms/iOS/Main.iOS.cs | 13 + .../LaunchImages.launchimage/Contents.json | 0 .../Platforms/iOS/PrivacyInfo.xcprivacy | 41 + .../Presentation/LoginModel.cs | 23 + .../Presentation/LoginPage.xaml | 37 + .../Presentation/LoginPage.xaml.cs | 9 + .../Presentation/MainModel.cs | 36 + .../Presentation/MainPage.xaml | 32 + .../Presentation/MainPage.xaml.cs | 9 + .../Presentation/SecondModel.cs | 5 + .../Presentation/SecondPage.xaml | 36 + .../Presentation/SecondPage.xaml.cs | 10 + .../Presentation/Shell.xaml | 36 + .../Presentation/Shell.xaml.cs | 10 + .../Presentation/ShellModel.cs | 22 + .../PublishProfiles/win-arm64.pubxml | 10 +- .../Properties/PublishProfiles/win-x64.pubxml | 10 +- .../Properties/PublishProfiles/win-x86.pubxml | 10 +- .../Properties/launchSettings.json | 50 + .../FrontendPlaformUno/ReadMe.md | 7 + .../Serialization/WeatherForecastContext.cs | 23 + .../Services/Caching/IWeatherCache.cs | 6 + .../Services/Caching/WeatherCache.cs | 76 ++ .../Services/Endpoints/DebugHandler.cs | 44 + .../Endpoints/Gamenight/IGamenight.cs | 1 + .../Services/Endpoints/Gamenight/IToken.cs | 9 + .../Endpoints/Gamenight/Login/LoginRequest.cs | 11 + .../Gamenight/Login/LoginResponse.cs | 18 + .../Services/Endpoints/IApiClient.cs | 9 + .../Strings/en/Resources.resw | 58 +- .../Strings/es}/Resources.resw | 58 +- .../Strings/fr}/Resources.resw | 58 +- .../Strings/pt-BR}/Resources.resw | 58 +- .../Styles/ColorPaletteOverride.json | 76 ++ .../Styles/ColorPaletteOverride.xaml | 14 +- .../FrontendPlaformUno}/app.manifest | 12 +- .../appsettings.development.json | 4 +- .../FrontendPlaformUno}/appsettings.json | 2 +- FrontendPlaformUno/global.json | 9 + FrontendPlatformUno/.gitignore | 3 - FrontendPlatformUno/Directory.Build.props | 59 - FrontendPlatformUno/Directory.Build.targets | 2 - .../FrontendPlatformUno.Base/AppHead.xaml | 17 - .../FrontendPlatformUno.Base/AppHead.xaml.cs | 14 - .../FrontendPlatformUno.Base/base.props | 25 - .../FrontendPlatformUno.DataContracts.csproj | 8 - .../Serialization/WeatherForecastContext.cs | 22 - .../WeatherForecast.cs | 16 - .../Android/Main.Android.cs | 43 - .../Android/MainActivity.Android.cs | 17 - .../FrontendPlatformUno.Mobile.csproj | 82 -- .../FrontendPlatformUno.Mobile.csproj.user | 15 - .../MacCatalyst/Main.maccatalyst.cs | 15 - .../iOS/Main.iOS.cs | 15 - .../FrontendPlatformUno.Skia.Gtk.csproj | 38 - .../FrontendPlatformUno.Skia.Gtk.csproj.user | 15 - .../FrontendPlatformUno.Skia.Gtk/Program.cs | 22 - .../Properties/launchSettings.json | 11 - .../FrontendPlatformUno.Skia.Gtk/app.manifest | 77 -- .../FrontendPlatformUno.Tests/AppInfoTests.cs | 19 - .../FrontendPlatformUno.Tests.csproj | 19 - .../FrontendPlatformUno.Tests/GlobalUsings.cs | 3 - .../FrontendPlatformUno.UITests/Constants.cs | 12 - .../FrontendPlatformUno.UITests.csproj | 16 - .../Given_MainPage.cs | 22 - .../FrontendPlatformUno.UITests/TestBase.cs | 82 -- .../FrontendPlatformUno.Wasm.csproj | 85 -- .../FrontendPlatformUno.Wasm.csproj.user | 5 - .../FrontendPlatformUno.Wasm/LinkerConfig.xml | 11 - .../FrontendPlatformUno.Wasm/Program.cs | 14 - .../Properties/launchSettings.json | 30 - .../WasmScripts/AppManifest.js | 3 - .../FrontendPlatformUno.Windows.csproj | 69 -- .../FrontendPlatformUno.Windows.csproj.user | 17 - .../Package.appxmanifest | 43 - .../Properties/launchsettings.json | 14 - .../Resources.lang-en-us.resw | 123 -- FrontendPlatformUno/FrontendPlatformUno.sln | 197 --- .../FrontendPlatformUno/App.cs | 75 -- .../FrontendPlatformUno/AppResources.xaml | 15 - .../Assets/SharedAssets.md | 34 - .../Business/Models/AppConfig.cs | 8 - .../Business/Models/Entity.cs | 5 - .../FrontendPlatformUno.csproj | 113 -- .../FrontendPlatformUno.csproj.user | 18 - .../FrontendPlatformUno/GlobalUsings.cs | 30 - .../Infrastructure/DebugHandler.cs | 41 - .../FrontendPlatformUno/Services/.gitignore | 1 - .../Services/Gamenight.yaml | 249 ---- .../Styles/ColorPaletteOverride.zip | Bin 5848 -> 0 bytes .../Styles/GamenightStyles.xaml | 13 - .../Styles/MaterialFontsOverride.xaml | 8 - .../ViewModels/GamenightsViewModel.cs | 31 - .../ViewModels/LoginViewModel.cs | 59 - .../ViewModels/ShellViewModel.cs | 19 - .../Views/GamenightsPage.xaml | 23 - .../Views/GamenightsPage.xaml.cs | 30 - .../FrontendPlatformUno/Views/LoginPage.xaml | 37 - .../Views/LoginPage.xaml.cs | 42 - .../Views/NavBarUserControl.xaml | 27 - .../Views/NavBarUserControl.xaml.cs | 27 - .../FrontendPlatformUno/Views/Shell.xaml | 35 - .../FrontendPlatformUno/Views/Shell.xaml.cs | 14 - backend-actix/Cargo.lock | 1053 ++++++++++------- backend-actix/Cargo.toml | 7 +- backend-actix/src/main.rs | 14 + backend-actix/src/schema/schema.rs | 3 + 160 files changed, 2852 insertions(+), 2905 deletions(-) create mode 100644 FrontendPlaformUno/.editorconfig create mode 100644 FrontendPlaformUno/.gitignore create mode 100644 FrontendPlaformUno/.run/FrontendPlaformUno.run.xml create mode 100644 FrontendPlaformUno/.run/Readme.md rename {FrontendPlatformUno => FrontendPlaformUno}/.vsconfig (72%) create mode 100644 FrontendPlaformUno/Directory.Build.props create mode 100644 FrontendPlaformUno/Directory.Build.targets create mode 100644 FrontendPlaformUno/Directory.Packages.props create mode 100644 FrontendPlaformUno/FrontendPlaformUno.Tests/AppInfoTests.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno.Tests/FrontendPlaformUno.Tests.csproj create mode 100644 FrontendPlaformUno/FrontendPlaformUno.Tests/GlobalUsings.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno.UITests/Constants.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno.UITests/FrontendPlaformUno.UITests.csproj create mode 100644 FrontendPlaformUno/FrontendPlaformUno.UITests/Given_MainPage.cs rename {FrontendPlatformUno/FrontendPlatformUno.UITests => FrontendPlaformUno/FrontendPlaformUno.UITests}/GlobalUsings.cs (97%) create mode 100644 FrontendPlaformUno/FrontendPlaformUno.UITests/TestBase.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno.sln create mode 100644 FrontendPlaformUno/FrontendPlaformUno/App.xaml create mode 100644 FrontendPlaformUno/FrontendPlaformUno/App.xaml.cs rename FrontendPlatformUno/FrontendPlatformUno.Base/Icons/iconapp.svg => FrontendPlaformUno/FrontendPlaformUno/Assets/Icons/icon.svg (96%) rename FrontendPlatformUno/FrontendPlatformUno.Base/Icons/appconfig.svg => FrontendPlaformUno/FrontendPlaformUno/Assets/Icons/icon_foreground.svg (99%) rename {FrontendPlatformUno/FrontendPlatformUno/Assets/Icons => FrontendPlaformUno/FrontendPlaformUno/Assets/Images}/back.svg (100%) create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Assets/SharedAssets.md rename {FrontendPlatformUno/FrontendPlatformUno.Base => FrontendPlaformUno/FrontendPlaformUno/Assets}/Splash/splash_screen.svg (99%) create mode 100644 FrontendPlaformUno/FrontendPlaformUno/FrontendPlaformUno.csproj create mode 100644 FrontendPlaformUno/FrontendPlaformUno/GlobalUsings.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/IGameNightOptions.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Models/AppConfig.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Models/Entity.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Models/WeatherForecast.cs rename {FrontendPlatformUno/FrontendPlatformUno.Skia.Gtk => FrontendPlaformUno/FrontendPlaformUno}/Package.appxmanifest (63%) rename {FrontendPlatformUno/FrontendPlatformUno.Mobile => FrontendPlaformUno/FrontendPlaformUno/Platforms}/Android/AndroidManifest.xml (100%) rename {FrontendPlatformUno/FrontendPlatformUno.Mobile => FrontendPlaformUno/FrontendPlaformUno/Platforms}/Android/Assets/AboutAssets.txt (88%) create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/Main.Android.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/MainActivity.Android.cs rename {FrontendPlatformUno/FrontendPlatformUno.Mobile => FrontendPlaformUno/FrontendPlaformUno/Platforms}/Android/Resources/AboutResources.txt (100%) rename {FrontendPlatformUno/FrontendPlatformUno.Mobile => FrontendPlaformUno/FrontendPlaformUno/Platforms}/Android/Resources/values/Strings.xml (65%) rename {FrontendPlatformUno/FrontendPlatformUno.Mobile => FrontendPlaformUno/FrontendPlaformUno/Platforms}/Android/Resources/values/Styles.xml (64%) rename {FrontendPlatformUno/FrontendPlatformUno.Mobile => FrontendPlaformUno/FrontendPlaformUno/Platforms}/Android/environment.conf (100%) create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Platforms/Desktop/Program.cs rename {FrontendPlatformUno/FrontendPlatformUno.Mobile => FrontendPlaformUno/FrontendPlaformUno/Platforms}/MacCatalyst/Entitlements.plist (100%) rename {FrontendPlatformUno/FrontendPlatformUno.Mobile => FrontendPlaformUno/FrontendPlaformUno/Platforms}/MacCatalyst/Info.plist (85%) create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Platforms/MacCatalyst/Main.maccatalyst.cs rename {FrontendPlatformUno/FrontendPlatformUno.Mobile => FrontendPlaformUno/FrontendPlaformUno/Platforms}/MacCatalyst/Media.xcassets/LaunchImages.launchimage/Contents.json (100%) create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Platforms/WebAssembly/LinkerConfig.xml create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Platforms/WebAssembly/Program.cs rename {FrontendPlatformUno/FrontendPlatformUno.Wasm => FrontendPlaformUno/FrontendPlaformUno/Platforms/WebAssembly}/WasmCSS/Fonts.css (72%) create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Platforms/WebAssembly/WasmScripts/AppManifest.js rename {FrontendPlatformUno/FrontendPlatformUno.Wasm => FrontendPlaformUno/FrontendPlaformUno/Platforms/WebAssembly}/manifest.webmanifest (55%) rename {FrontendPlatformUno/FrontendPlatformUno.Wasm => FrontendPlaformUno/FrontendPlaformUno/Platforms/WebAssembly}/wwwroot/staticwebapp.config.json (100%) rename {FrontendPlatformUno/FrontendPlatformUno.Wasm => FrontendPlaformUno/FrontendPlaformUno/Platforms/WebAssembly}/wwwroot/web.config (100%) rename {FrontendPlatformUno/FrontendPlatformUno.Mobile => FrontendPlaformUno/FrontendPlaformUno/Platforms}/iOS/Entitlements.plist (100%) rename {FrontendPlatformUno/FrontendPlatformUno.Mobile => FrontendPlaformUno/FrontendPlaformUno/Platforms}/iOS/Info.plist (79%) create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Platforms/iOS/Main.iOS.cs rename {FrontendPlatformUno/FrontendPlatformUno.Mobile => FrontendPlaformUno/FrontendPlaformUno/Platforms}/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json (100%) create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Platforms/iOS/PrivacyInfo.xcprivacy create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Presentation/LoginModel.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Presentation/LoginPage.xaml create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Presentation/LoginPage.xaml.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Presentation/MainModel.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Presentation/MainPage.xaml create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Presentation/MainPage.xaml.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Presentation/SecondModel.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Presentation/SecondPage.xaml create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Presentation/SecondPage.xaml.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Presentation/Shell.xaml create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Presentation/Shell.xaml.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Presentation/ShellModel.cs rename FrontendPlatformUno/FrontendPlatformUno.Windows/Properties/PublishProfiles/win10-arm64.pubxml => FrontendPlaformUno/FrontendPlaformUno/Properties/PublishProfiles/win-arm64.pubxml (63%) rename FrontendPlatformUno/FrontendPlatformUno.Windows/Properties/PublishProfiles/win10-x64.pubxml => FrontendPlaformUno/FrontendPlaformUno/Properties/PublishProfiles/win-x64.pubxml (63%) rename FrontendPlatformUno/FrontendPlatformUno.Windows/Properties/PublishProfiles/win10-x86.pubxml => FrontendPlaformUno/FrontendPlaformUno/Properties/PublishProfiles/win-x86.pubxml (63%) create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Properties/launchSettings.json create mode 100644 FrontendPlaformUno/FrontendPlaformUno/ReadMe.md create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Serialization/WeatherForecastContext.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Services/Caching/IWeatherCache.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Services/Caching/WeatherCache.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Services/Endpoints/DebugHandler.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Services/Endpoints/Gamenight/IGamenight.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Services/Endpoints/Gamenight/IToken.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Services/Endpoints/Gamenight/Login/LoginRequest.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Services/Endpoints/Gamenight/Login/LoginResponse.cs create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Services/Endpoints/IApiClient.cs rename {FrontendPlatformUno/FrontendPlatformUno => FrontendPlaformUno/FrontendPlaformUno}/Strings/en/Resources.resw (92%) rename {FrontendPlatformUno/FrontendPlatformUno/Strings/fr => FrontendPlaformUno/FrontendPlaformUno/Strings/es}/Resources.resw (92%) rename {FrontendPlatformUno/FrontendPlatformUno/Strings/pt-BR => FrontendPlaformUno/FrontendPlaformUno/Strings/fr}/Resources.resw (92%) rename {FrontendPlatformUno/FrontendPlatformUno/Strings/es => FrontendPlaformUno/FrontendPlaformUno/Strings/pt-BR}/Resources.resw (92%) create mode 100644 FrontendPlaformUno/FrontendPlaformUno/Styles/ColorPaletteOverride.json rename {FrontendPlatformUno/FrontendPlatformUno => FrontendPlaformUno/FrontendPlaformUno}/Styles/ColorPaletteOverride.xaml (89%) rename {FrontendPlatformUno/FrontendPlatformUno.Windows => FrontendPlaformUno/FrontendPlaformUno}/app.manifest (50%) rename {FrontendPlatformUno/FrontendPlatformUno => FrontendPlaformUno/FrontendPlaformUno}/appsettings.development.json (50%) rename {FrontendPlatformUno/FrontendPlatformUno => FrontendPlaformUno/FrontendPlaformUno}/appsettings.json (84%) create mode 100644 FrontendPlaformUno/global.json delete mode 100644 FrontendPlatformUno/.gitignore delete mode 100644 FrontendPlatformUno/Directory.Build.props delete mode 100644 FrontendPlatformUno/Directory.Build.targets delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Base/AppHead.xaml delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Base/AppHead.xaml.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Base/base.props delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.DataContracts/FrontendPlatformUno.DataContracts.csproj delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.DataContracts/Serialization/WeatherForecastContext.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.DataContracts/WeatherForecast.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Mobile/Android/Main.Android.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Mobile/Android/MainActivity.Android.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Mobile/FrontendPlatformUno.Mobile.csproj delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Mobile/FrontendPlatformUno.Mobile.csproj.user delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Mobile/MacCatalyst/Main.maccatalyst.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Mobile/iOS/Main.iOS.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Skia.Gtk/FrontendPlatformUno.Skia.Gtk.csproj delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Skia.Gtk/FrontendPlatformUno.Skia.Gtk.csproj.user delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Skia.Gtk/Program.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Skia.Gtk/Properties/launchSettings.json delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Skia.Gtk/app.manifest delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Tests/AppInfoTests.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Tests/FrontendPlatformUno.Tests.csproj delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Tests/GlobalUsings.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.UITests/Constants.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.UITests/FrontendPlatformUno.UITests.csproj delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.UITests/Given_MainPage.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.UITests/TestBase.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Wasm/FrontendPlatformUno.Wasm.csproj delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Wasm/FrontendPlatformUno.Wasm.csproj.user delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Wasm/LinkerConfig.xml delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Wasm/Program.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Wasm/Properties/launchSettings.json delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Wasm/WasmScripts/AppManifest.js delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Windows/FrontendPlatformUno.Windows.csproj delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Windows/FrontendPlatformUno.Windows.csproj.user delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Windows/Package.appxmanifest delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Windows/Properties/launchsettings.json delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.Windows/Resources.lang-en-us.resw delete mode 100644 FrontendPlatformUno/FrontendPlatformUno.sln delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/App.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/AppResources.xaml delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/Assets/SharedAssets.md delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/Business/Models/AppConfig.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/Business/Models/Entity.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/FrontendPlatformUno.csproj delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/FrontendPlatformUno.csproj.user delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/GlobalUsings.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/Infrastructure/DebugHandler.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/Services/.gitignore delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/Services/Gamenight.yaml delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/Styles/ColorPaletteOverride.zip delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/Styles/GamenightStyles.xaml delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/Styles/MaterialFontsOverride.xaml delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/ViewModels/GamenightsViewModel.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/ViewModels/LoginViewModel.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/ViewModels/ShellViewModel.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/Views/GamenightsPage.xaml delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/Views/GamenightsPage.xaml.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/Views/LoginPage.xaml delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/Views/LoginPage.xaml.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/Views/NavBarUserControl.xaml delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/Views/NavBarUserControl.xaml.cs delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/Views/Shell.xaml delete mode 100644 FrontendPlatformUno/FrontendPlatformUno/Views/Shell.xaml.cs diff --git a/FrontendPlaformUno/.editorconfig b/FrontendPlaformUno/.editorconfig new file mode 100644 index 0000000..b947be6 --- /dev/null +++ b/FrontendPlaformUno/.editorconfig @@ -0,0 +1,167 @@ +; This file is for unifying the coding style for different editors and IDEs. +; More information at http://editorconfig.org + +# This file is the top-most EditorConfig file +root = true + +########################################## +# Common Settings +########################################## + +[*] +indent_style = space +end_of_line = crlf +trim_trailing_whitespace = true +insert_final_newline = true +charset = utf-8 + +########################################## +# File Extension Settings +########################################## + +[*.{yml,yaml}] +indent_size = 2 + +[.vsconfig] +indent_size = 2 +end_of_line = lf + +[*.sln] +indent_style = tab +indent_size = 2 + +[*.{csproj,proj,projitems,shproj}] +indent_size = 2 + +[*.{json,slnf}] +indent_size = 2 +end_of_line = lf + +[*.{props,targets}] +indent_size = 2 + +[*.xaml] +indent_size = 2 +charset = utf-8-bom + +[*.xml] +indent_size = 2 +end_of_line = lf + +[*.plist] +indent_size = 2 +indent_style = tab +end_of_line = lf + +[*.manifest] +indent_size = 2 + +[*.appxmanifest] +indent_size = 2 + +[*.{json,css,webmanifest}] +indent_size = 2 +end_of_line = lf + +[web.config] +indent_size = 2 +end_of_line = lf + +[*.sh] +indent_size = 2 +end_of_line = lf + +[*.cs] +# EOL should be normalized by Git. See https://github.com/dotnet/format/issues/1099 +end_of_line = unset + +# See https://github.com/dotnet/roslyn/issues/20356#issuecomment-310143926 +trim_trailing_whitespace = false + +tab_width = 4 +indent_size = 4 + +# Sort using and Import directives with System.* appearing first +dotnet_sort_system_directives_first = true + +# Avoid "this." and "Me." if not necessary +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_event = false:suggestion + +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion + +csharp_indent_labels = one_less_than_current +csharp_using_directive_placement = outside_namespace:silent +csharp_prefer_simple_using_statement = true:suggestion +csharp_prefer_braces = true:silent +csharp_style_namespace_declarations = file_scoped:warning +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_top_level_statements = true:silent +csharp_style_prefer_primary_constructors = true:suggestion +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent diff --git a/FrontendPlaformUno/.gitignore b/FrontendPlaformUno/.gitignore new file mode 100644 index 0000000..ef88c20 --- /dev/null +++ b/FrontendPlaformUno/.gitignore @@ -0,0 +1,403 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml + +# Single Target Config +solution-config.props +# Publish Profiles +!**/Properties/PublishProfiles/*.pubxml \ No newline at end of file diff --git a/FrontendPlaformUno/.run/FrontendPlaformUno.run.xml b/FrontendPlaformUno/.run/FrontendPlaformUno.run.xml new file mode 100644 index 0000000..6ba9ad4 --- /dev/null +++ b/FrontendPlaformUno/.run/FrontendPlaformUno.run.xml @@ -0,0 +1,62 @@ + + + + + + + + + + diff --git a/FrontendPlaformUno/.run/Readme.md b/FrontendPlaformUno/.run/Readme.md new file mode 100644 index 0000000..6e72638 --- /dev/null +++ b/FrontendPlaformUno/.run/Readme.md @@ -0,0 +1,3 @@ +# About the `.run` folder + +This folder is present to add support for the [Rider IDE](https://aka.platform.uno/rider-getstarted). You can remove this folder safely if you're not using Rider. diff --git a/FrontendPlatformUno/.vsconfig b/FrontendPlaformUno/.vsconfig similarity index 72% rename from FrontendPlatformUno/.vsconfig rename to FrontendPlaformUno/.vsconfig index 1c9c228..0439670 100644 --- a/FrontendPlatformUno/.vsconfig +++ b/FrontendPlaformUno/.vsconfig @@ -5,34 +5,30 @@ "Microsoft.VisualStudio.Workload.CoreEditor", "Microsoft.NetCore.Component.SDK", "Microsoft.NetCore.Component.DevelopmentTools", - "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions", - "Microsoft.NetCore.Component.Web", "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites", "Microsoft.VisualStudio.Component.TextTemplating", + "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions", + "Microsoft.NetCore.Component.Web", "Microsoft.VisualStudio.Component.IISExpress", "Component.Microsoft.Web.LibraryManager", "Microsoft.VisualStudio.ComponentGroup.Web", "Microsoft.VisualStudio.Component.Web", "Microsoft.VisualStudio.ComponentGroup.Web.Client", "Microsoft.VisualStudio.Workload.NetWeb", - "Microsoft.VisualStudio.ComponentGroup.Azure.Prerequisites", - "Microsoft.VisualStudio.Workload.Azure", - "Microsoft.VisualStudio.Component.Windows10SDK.19041", + "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.TemplateEngine", + "Microsoft.VisualStudio.ComponentGroup.MSIX.Packaging", "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites", "Microsoft.VisualStudio.Component.Debugger.JustInTime", - "Microsoft.VisualStudio.ComponentGroup.MSIX.Packaging", "Microsoft.VisualStudio.Workload.ManagedDesktop", - "Microsoft.Component.NetFX.Native", - "Microsoft.VisualStudio.Component.Graphics", - "Component.OpenJDK", - "Microsoft.VisualStudio.Component.MonoDebugger", - "Microsoft.VisualStudio.Component.Merq", "Component.Xamarin.RemotedSimulator", - "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.TemplateEngine", - "Component.Xamarin", - "Component.Android.SDK32", + "Microsoft.VisualStudio.Component.MonoDebugger", + "Microsoft.VisualStudio.ComponentGroup.Maui.All", + "Component.Android.SDK34", + "Component.OpenJDK", "Microsoft.VisualStudio.Workload.NetCrossPlat", - "Microsoft.VisualStudio.Workload.NetCoreTools", - "Microsoft.VisualStudio.ComponentGroup.Maui.All" + "Microsoft.VisualStudio.Workload.NetCoreTools" + ], + "extensions": [ + "https://marketplace.visualstudio.com/items?itemName=unoplatform.uno-platform-addin-2022" ] } diff --git a/FrontendPlaformUno/Directory.Build.props b/FrontendPlaformUno/Directory.Build.props new file mode 100644 index 0000000..8daf569 --- /dev/null +++ b/FrontendPlaformUno/Directory.Build.props @@ -0,0 +1,15 @@ + + + enable + enable + true + + + $(NoWarn);NU1507;NETSDK1201;PRI257 + + diff --git a/FrontendPlaformUno/Directory.Build.targets b/FrontendPlaformUno/Directory.Build.targets new file mode 100644 index 0000000..f75adf7 --- /dev/null +++ b/FrontendPlaformUno/Directory.Build.targets @@ -0,0 +1,2 @@ + + diff --git a/FrontendPlaformUno/Directory.Packages.props b/FrontendPlaformUno/Directory.Packages.props new file mode 100644 index 0000000..43f897b --- /dev/null +++ b/FrontendPlaformUno/Directory.Packages.props @@ -0,0 +1,18 @@ + + + + + + + + + + + + + diff --git a/FrontendPlaformUno/FrontendPlaformUno.Tests/AppInfoTests.cs b/FrontendPlaformUno/FrontendPlaformUno.Tests/AppInfoTests.cs new file mode 100644 index 0000000..ab3c02f --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno.Tests/AppInfoTests.cs @@ -0,0 +1,18 @@ +namespace FrontendPlaformUno.Tests; + +public class AppInfoTests +{ + [SetUp] + public void Setup() + { + } + + [Test] + public void AppInfoCreation() + { + var appInfo = new AppConfig { Environment = "Test" }; + + appInfo.Should().NotBeNull(); + appInfo.Environment.Should().Be("Test"); + } +} diff --git a/FrontendPlaformUno/FrontendPlaformUno.Tests/FrontendPlaformUno.Tests.csproj b/FrontendPlaformUno/FrontendPlaformUno.Tests/FrontendPlaformUno.Tests.csproj new file mode 100644 index 0000000..db44850 --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno.Tests/FrontendPlaformUno.Tests.csproj @@ -0,0 +1,20 @@ + + + + net8.0 + false + true + + + + + + + + + + + + + + diff --git a/FrontendPlaformUno/FrontendPlaformUno.Tests/GlobalUsings.cs b/FrontendPlaformUno/FrontendPlaformUno.Tests/GlobalUsings.cs new file mode 100644 index 0000000..34486ef --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno.Tests/GlobalUsings.cs @@ -0,0 +1,3 @@ +global using FluentAssertions; +global using FrontendPlaformUno.Models; +global using NUnit.Framework; diff --git a/FrontendPlaformUno/FrontendPlaformUno.UITests/Constants.cs b/FrontendPlaformUno/FrontendPlaformUno.UITests/Constants.cs new file mode 100644 index 0000000..19abac8 --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno.UITests/Constants.cs @@ -0,0 +1,12 @@ +namespace FrontendPlaformUno.UITests; + +public class Constants +{ + public readonly static string WebAssemblyDefaultUri = "http://localhost:5000/"; + public readonly static string iOSAppName = "es.brentj.FrontendPlaformUno"; + public readonly static string AndroidAppName = "es.brentj.FrontendPlaformUno"; + public readonly static string iOSDeviceNameOrId = "iPad Pro (12.9-inch) (3rd generation)"; + + public readonly static Platform CurrentPlatform = Platform.Browser; + public readonly static Browser WebAssemblyBrowser = Browser.Chrome; +} diff --git a/FrontendPlaformUno/FrontendPlaformUno.UITests/FrontendPlaformUno.UITests.csproj b/FrontendPlaformUno/FrontendPlaformUno.UITests/FrontendPlaformUno.UITests.csproj new file mode 100644 index 0000000..ef4fb63 --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno.UITests/FrontendPlaformUno.UITests.csproj @@ -0,0 +1,17 @@ + + + + net8.0 + true + + + + + + + + + + + + diff --git a/FrontendPlaformUno/FrontendPlaformUno.UITests/Given_MainPage.cs b/FrontendPlaformUno/FrontendPlaformUno.UITests/Given_MainPage.cs new file mode 100644 index 0000000..f056c7b --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno.UITests/Given_MainPage.cs @@ -0,0 +1,25 @@ +namespace FrontendPlaformUno.UITests; + +public class Given_MainPage : TestBase +{ + [Test] + public async Task When_SmokeTest() + { + // NOTICE + // To run UITests, Run the WASM target without debugger. Note + // the port that is being used and update the Constants.cs file + // in the UITests project with the correct port number. + + // Add delay to allow for the splash screen to disappear + await Task.Delay(5000); + + + // Query for the SecondPageButton and then tap it + Query xamlButton = q => q.All().Marked("SecondPageButton"); + App.WaitForElement(xamlButton); + App.Tap(xamlButton); + + // Take a screenshot and add it to the test results + TakeScreenshot("After tapped"); + } +} diff --git a/FrontendPlatformUno/FrontendPlatformUno.UITests/GlobalUsings.cs b/FrontendPlaformUno/FrontendPlaformUno.UITests/GlobalUsings.cs similarity index 97% rename from FrontendPlatformUno/FrontendPlatformUno.UITests/GlobalUsings.cs rename to FrontendPlaformUno/FrontendPlaformUno.UITests/GlobalUsings.cs index be400b2..eb3b6c8 100644 --- a/FrontendPlatformUno/FrontendPlatformUno.UITests/GlobalUsings.cs +++ b/FrontendPlaformUno/FrontendPlaformUno.UITests/GlobalUsings.cs @@ -1,7 +1,5 @@ - global using NUnit.Framework; global using Uno.UITest; global using Uno.UITest.Helpers.Queries; global using Uno.UITests.Helpers; global using Query = System.Func; - diff --git a/FrontendPlaformUno/FrontendPlaformUno.UITests/TestBase.cs b/FrontendPlaformUno/FrontendPlaformUno.UITests/TestBase.cs new file mode 100644 index 0000000..ab50e10 --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno.UITests/TestBase.cs @@ -0,0 +1,82 @@ + +namespace FrontendPlaformUno.UITests; + +public class TestBase +{ + private IApp? _app; + + static TestBase() + { + AppInitializer.TestEnvironment.AndroidAppName = Constants.AndroidAppName; + AppInitializer.TestEnvironment.WebAssemblyDefaultUri = Constants.WebAssemblyDefaultUri; + AppInitializer.TestEnvironment.iOSAppName = Constants.iOSAppName; + AppInitializer.TestEnvironment.AndroidAppName = Constants.AndroidAppName; + AppInitializer.TestEnvironment.iOSDeviceNameOrId = Constants.iOSDeviceNameOrId; + AppInitializer.TestEnvironment.CurrentPlatform = Constants.CurrentPlatform; + AppInitializer.TestEnvironment.WebAssemblyBrowser = Constants.WebAssemblyBrowser; + +#if DEBUG + AppInitializer.TestEnvironment.WebAssemblyHeadless = false; +#endif + + // Start the app only once, so the tests runs don't restart it + // and gain some time for the tests. + AppInitializer.ColdStartApp(); + } + + protected IApp App + { + get => _app!; + private set + { + _app = value; + Uno.UITest.Helpers.Queries.Helpers.App = value; + } + } + + [SetUp] + public void SetUpTest() + { + App = AppInitializer.AttachToApp(); + } + + [TearDown] + public void TearDownTest() + { + TakeScreenshot("teardown"); + } + + public FileInfo TakeScreenshot(string stepName) + { + var title = $"{TestContext.CurrentContext.Test.Name}_{stepName}" + .Replace(" ", "_") + .Replace(".", "_"); + + var fileInfo = App.Screenshot(title); + + var fileNameWithoutExt = Path.GetFileNameWithoutExtension(fileInfo.Name); + if (fileNameWithoutExt != title && fileInfo.DirectoryName != null) + { + var destFileName = Path + .Combine(fileInfo.DirectoryName, title + Path.GetExtension(fileInfo.Name)); + + if (File.Exists(destFileName)) + { + File.Delete(destFileName); + } + + File.Move(fileInfo.FullName, destFileName); + + TestContext.AddTestAttachment(destFileName, stepName); + + fileInfo = new FileInfo(destFileName); + } + else + { + TestContext.AddTestAttachment(fileInfo.FullName, stepName); + } + + return fileInfo; + } + +} diff --git a/FrontendPlaformUno/FrontendPlaformUno.sln b/FrontendPlaformUno/FrontendPlaformUno.sln new file mode 100644 index 0000000..3789a8d --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno.sln @@ -0,0 +1,58 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35312.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FrontendPlaformUno", "FrontendPlaformUno\FrontendPlaformUno.csproj", "{5EA00281-83BD-4B28-8D2A-7FBF5FA5C951}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{E17EEAED-92DF-4399-A1AD-E90914D44955}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FrontendPlaformUno.UITests", "FrontendPlaformUno.UITests\FrontendPlaformUno.UITests.csproj", "{07B45AB6-6827-444D-918A-C5C3E42A173D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FrontendPlaformUno.Tests", "FrontendPlaformUno.Tests\FrontendPlaformUno.Tests.csproj", "{77538902-6BAD-4164-AF66-5DE8317661F4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8A8F1605-47C4-4E3E-8D6D-768654BD3DE7}" + ProjectSection(SolutionItems) = preProject + .gitignore = .gitignore + Directory.Build.props = Directory.Build.props + Directory.Build.targets = Directory.Build.targets + Directory.Packages.props = Directory.Packages.props + global.json = global.json + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5EA00281-83BD-4B28-8D2A-7FBF5FA5C951}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EA00281-83BD-4B28-8D2A-7FBF5FA5C951}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EA00281-83BD-4B28-8D2A-7FBF5FA5C951}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {5EA00281-83BD-4B28-8D2A-7FBF5FA5C951}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EA00281-83BD-4B28-8D2A-7FBF5FA5C951}.Release|Any CPU.Build.0 = Release|Any CPU + {5EA00281-83BD-4B28-8D2A-7FBF5FA5C951}.Release|Any CPU.Deploy.0 = Release|Any CPU + {07B45AB6-6827-444D-918A-C5C3E42A173D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {07B45AB6-6827-444D-918A-C5C3E42A173D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {07B45AB6-6827-444D-918A-C5C3E42A173D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {07B45AB6-6827-444D-918A-C5C3E42A173D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {07B45AB6-6827-444D-918A-C5C3E42A173D}.Release|Any CPU.Build.0 = Release|Any CPU + {07B45AB6-6827-444D-918A-C5C3E42A173D}.Release|Any CPU.Deploy.0 = Release|Any CPU + {77538902-6BAD-4164-AF66-5DE8317661F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {77538902-6BAD-4164-AF66-5DE8317661F4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {77538902-6BAD-4164-AF66-5DE8317661F4}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {77538902-6BAD-4164-AF66-5DE8317661F4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {77538902-6BAD-4164-AF66-5DE8317661F4}.Release|Any CPU.Build.0 = Release|Any CPU + {77538902-6BAD-4164-AF66-5DE8317661F4}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {07B45AB6-6827-444D-918A-C5C3E42A173D} = {E17EEAED-92DF-4399-A1AD-E90914D44955} + {77538902-6BAD-4164-AF66-5DE8317661F4} = {E17EEAED-92DF-4399-A1AD-E90914D44955} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C100779A-C536-48D0-8B2B-2D39626AE74C} + EndGlobalSection +EndGlobal diff --git a/FrontendPlaformUno/FrontendPlaformUno/App.xaml b/FrontendPlaformUno/FrontendPlaformUno/App.xaml new file mode 100644 index 0000000..3085481 --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno/App.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + diff --git a/FrontendPlaformUno/FrontendPlaformUno/App.xaml.cs b/FrontendPlaformUno/FrontendPlaformUno/App.xaml.cs new file mode 100644 index 0000000..6f0b717 --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno/App.xaml.cs @@ -0,0 +1,199 @@ +using FrontendPlaformUno.Services.Endpoints.Gamenight; +using FrontendPlaformUno.Services.Endpoints.Gamenight.Login; +using Uno.Resizetizer; + +namespace FrontendPlaformUno; + +public class GamenightEndpointOptions : EndpointOptions +{ + public string? ApiKey { get; init; } +} + +public partial class App : Application +{ + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + protected Window? MainWindow { get; private set; } + protected IHost? Host { get; private set; } + + protected async override void OnLaunched(LaunchActivatedEventArgs args) + { + var builder = this.CreateBuilder(args) + // Add navigation support for toolkit controls such as TabBar and NavigationView + .UseToolkitNavigation() + .Configure(host => host +#if DEBUG + // Switch to Development environment when running in DEBUG + .UseEnvironment(Environments.Development) +#endif + .UseLogging(configure: (context, logBuilder) => + { + // Configure log levels for different categories of logging + logBuilder + .SetMinimumLevel( + context.HostingEnvironment.IsDevelopment() ? + LogLevel.Information : + LogLevel.Warning) + + // Default filters for core Uno Platform namespaces + .CoreLogLevel(LogLevel.Warning); + + // Uno Platform namespace filter groups + // Uncomment individual methods to see more detailed logging + //// Generic Xaml events + //logBuilder.XamlLogLevel(LogLevel.Debug); + //// Layout specific messages + //logBuilder.XamlLayoutLogLevel(LogLevel.Debug); + //// Storage messages + //logBuilder.StorageLogLevel(LogLevel.Debug); + //// Binding related messages + //logBuilder.XamlBindingLogLevel(LogLevel.Debug); + //// Binder memory references tracking + //logBuilder.BinderMemoryReferenceLogLevel(LogLevel.Debug); + //// DevServer and HotReload related + //logBuilder.HotReloadCoreLogLevel(LogLevel.Information); + //// Debug JS interop + //logBuilder.WebAssemblyLogLevel(LogLevel.Debug); + + }, enableUnoLogging: true) + .UseConfiguration(configure: configBuilder => + configBuilder + .EmbeddedSource() + .Section() + ) + // Enable localization (see appsettings.json for supported languages) + .UseLocalization() + // Register Json serializers (ISerializer and ISerializer) + .UseSerialization((context, services) => services + .AddContentSerializer(context) + .AddJsonTypeInfo(WeatherForecastContext.Default.IImmutableListWeatherForecast)) + .UseHttp((context, services) => services + // Register HttpClient +#if DEBUG + // DelegatingHandler will be automatically injected into Refit Client + .AddTransient() +#endif + .AddSingleton() + .AddRefitClient(context) + .AddRefitClientWithEndpoint( + context, + configure: (builder, options) => builder + .ConfigureHttpClient(HttpClient => + { + HttpClient.BaseAddress = new Uri("http://localhost:8080/"); + } + ) + )) + .UseAuthentication(auth => + auth.AddCustom(custom => + custom + .Login(async (sp, dispatcher, credentials, cancellationToken) => + { + // TODO: Write code to process credentials that are passed into the LoginAsync method + var gamenightApi = sp.GetRequiredService(); + + string? username = ""; + string? password = ""; + + var hasUsername = credentials?.TryGetValue(nameof(LoginModel.Username), out username) ?? false; + var hasPassword = credentials?.TryGetValue(nameof(LoginModel.Password), out password) ?? false; + + if (!hasUsername || !hasPassword) + { + return credentials; + } + + var apiResponse = await gamenightApi.Login(new LoginRequest { Username = username!, Password = password! }, cancellationToken); + + + if (apiResponse.IsSuccessStatusCode && apiResponse.Content is LoginResponse loginResponse) + { + // Return IDictionary containing any tokens used by service calls or in the app + credentials ??= new Dictionary(); + credentials[TokenCacheExtensions.AccessTokenKey] = "SampleToken"; + credentials[TokenCacheExtensions.RefreshTokenKey] = "RefreshToken"; + credentials["Expiry"] = DateTime.Now.AddMinutes(5).ToString("g"); + return credentials; + } + + // Return null/default to fail the LoginAsync method + return default; + }) + .Refresh((sp, tokenDictionary, cancellationToken) => + { + // TODO: Write code to refresh tokens using the currently stored tokens + if ((tokenDictionary?.TryGetValue(TokenCacheExtensions.RefreshTokenKey, out var refreshToken) ?? false) && + !refreshToken.IsNullOrEmpty() && + (tokenDictionary?.TryGetValue("Expiry", out var expiry) ?? false) && + DateTime.TryParse(expiry, out var tokenExpiry) && + tokenExpiry > DateTime.Now) + { + // Return IDictionary containing any tokens used by service calls or in the app + tokenDictionary ??= new Dictionary(); + tokenDictionary[TokenCacheExtensions.AccessTokenKey] = "NewSampleToken"; + tokenDictionary["Expiry"] = DateTime.Now.AddMinutes(5).ToString("g"); + return ValueTask.FromResult?>(tokenDictionary); + } + + // Return null/default to fail the Refresh method + return ValueTask.FromResult?>(default); + }), name: "CustomAuth") + ) + .ConfigureServices((context, services) => + { + // TODO: Register your services + //services.AddSingleton(); + }) + .UseNavigation(ReactiveViewModelMappings.ViewModelMappings, RegisterRoutes) + ); + MainWindow = builder.Window; + +#if DEBUG + MainWindow.EnableHotReload(); +#endif + MainWindow.SetWindowIcon(); + + Host = await builder.NavigateAsync + (initialNavigate: async (services, navigator) => + { + var auth = services.GetRequiredService(); + var authenticated = await auth.RefreshAsync(); + if (authenticated) + { + await navigator.NavigateViewModelAsync(this, qualifier: Qualifiers.Nested); + } + else + { + await navigator.NavigateViewModelAsync(this, qualifier: Qualifiers.Nested); + } + }); + } + + private static void RegisterRoutes(IViewRegistry views, IRouteRegistry routes) + { + views.Register( + new ViewMap(ViewModel: typeof(ShellModel)), + new ViewMap(), + new ViewMap(), + new DataViewMap() + ); + + routes.Register( + new RouteMap("", View: views.FindByViewModel(), + Nested: + [ + new ("Login", View: views.FindByViewModel()), + new ("Main", View: views.FindByViewModel(), IsDefault:true), + new ("Second", View: views.FindByViewModel()), + ] + ) + ); + } +} diff --git a/FrontendPlatformUno/FrontendPlatformUno.Base/Icons/iconapp.svg b/FrontendPlaformUno/FrontendPlaformUno/Assets/Icons/icon.svg similarity index 96% rename from FrontendPlatformUno/FrontendPlatformUno.Base/Icons/iconapp.svg rename to FrontendPlaformUno/FrontendPlaformUno/Assets/Icons/icon.svg index f621ea5..a15af53 100644 --- a/FrontendPlatformUno/FrontendPlatformUno.Base/Icons/iconapp.svg +++ b/FrontendPlaformUno/FrontendPlaformUno/Assets/Icons/icon.svg @@ -5,7 +5,7 @@ viewBox="0 0 456 456" version="1.1" id="svg453" - sodipodi:docname="iconapp.old.svg" + sodipodi:docname="icon.svg" inkscape:version="1.2 (dc2aedaf03, 2022-05-15)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" diff --git a/FrontendPlatformUno/FrontendPlatformUno.Base/Icons/appconfig.svg b/FrontendPlaformUno/FrontendPlaformUno/Assets/Icons/icon_foreground.svg similarity index 99% rename from FrontendPlatformUno/FrontendPlatformUno.Base/Icons/appconfig.svg rename to FrontendPlaformUno/FrontendPlaformUno/Assets/Icons/icon_foreground.svg index 3106b1a..8ffc41a 100644 --- a/FrontendPlatformUno/FrontendPlatformUno.Base/Icons/appconfig.svg +++ b/FrontendPlaformUno/FrontendPlaformUno/Assets/Icons/icon_foreground.svg @@ -5,7 +5,7 @@ viewBox="0 0 50.369617 49.826836" version="1.1" id="svg151" - sodipodi:docname="appconfig.svg" + sodipodi:docname="icon_foreground.svg" inkscape:version="1.2 (dc2aedaf03, 2022-05-15)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" diff --git a/FrontendPlatformUno/FrontendPlatformUno/Assets/Icons/back.svg b/FrontendPlaformUno/FrontendPlaformUno/Assets/Images/back.svg similarity index 100% rename from FrontendPlatformUno/FrontendPlatformUno/Assets/Icons/back.svg rename to FrontendPlaformUno/FrontendPlaformUno/Assets/Images/back.svg diff --git a/FrontendPlaformUno/FrontendPlaformUno/Assets/SharedAssets.md b/FrontendPlaformUno/FrontendPlaformUno/Assets/SharedAssets.md new file mode 100644 index 0000000..1b84a74 --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno/Assets/SharedAssets.md @@ -0,0 +1,32 @@ +# Shared Assets + +See documentation about assets here: https://github.com/unoplatform/uno/blob/master/doc/articles/features/working-with-assets.md + +## Here is a cheat sheet + +1. Add the image file to the `Assets` directory of a shared project. +2. Set the build action to `Content`. +3. (Recommended) Provide an asset for various scales/dpi + +### Examples + +```text +\Assets\Images\logo.scale-100.png +\Assets\Images\logo.scale-200.png +\Assets\Images\logo.scale-400.png + +\Assets\Images\scale-100\logo.png +\Assets\Images\scale-200\logo.png +\Assets\Images\scale-400\logo.png +``` + +### Table of scales + +| Scale | WinUI | iOS/MacCatalyst | Android | +|-------|:-----------:|:---------------:|:-------:| +| `100` | scale-100 | @1x | mdpi | +| `125` | scale-125 | N/A | N/A | +| `150` | scale-150 | N/A | hdpi | +| `200` | scale-200 | @2x | xhdpi | +| `300` | scale-300 | @3x | xxhdpi | +| `400` | scale-400 | N/A | xxxhdpi | diff --git a/FrontendPlatformUno/FrontendPlatformUno.Base/Splash/splash_screen.svg b/FrontendPlaformUno/FrontendPlaformUno/Assets/Splash/splash_screen.svg similarity index 99% rename from FrontendPlatformUno/FrontendPlatformUno.Base/Splash/splash_screen.svg rename to FrontendPlaformUno/FrontendPlaformUno/Assets/Splash/splash_screen.svg index 3106b1a..8ffc41a 100644 --- a/FrontendPlatformUno/FrontendPlatformUno.Base/Splash/splash_screen.svg +++ b/FrontendPlaformUno/FrontendPlaformUno/Assets/Splash/splash_screen.svg @@ -5,7 +5,7 @@ viewBox="0 0 50.369617 49.826836" version="1.1" id="svg151" - sodipodi:docname="appconfig.svg" + sodipodi:docname="icon_foreground.svg" inkscape:version="1.2 (dc2aedaf03, 2022-05-15)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" diff --git a/FrontendPlaformUno/FrontendPlaformUno/FrontendPlaformUno.csproj b/FrontendPlaformUno/FrontendPlaformUno/FrontendPlaformUno.csproj new file mode 100644 index 0000000..a7c6049 --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno/FrontendPlaformUno.csproj @@ -0,0 +1,57 @@ + + + net8.0-android;net8.0-ios;net8.0-maccatalyst;net8.0-windows10.0.19041;net8.0-browserwasm;net8.0-desktop;net8.0 + + Exe + true + + + FrontendPlaformUno + + es.brentj.FrontendPlaformUno + + 1.0 + 1 + + dbren + + FrontendPlaformUno powered by Uno Platform. + + + + + + Material; + Dsp; + Hosting; + Toolkit; + Logging; + MVUX; + Configuration; + Http; + Serialization; + Localization; + Authentication; + Navigation; + ThemeService; + + + + + True + $(DefineConstants);USE_UITESTS + + + diff --git a/FrontendPlaformUno/FrontendPlaformUno/GlobalUsings.cs b/FrontendPlaformUno/FrontendPlaformUno/GlobalUsings.cs new file mode 100644 index 0000000..f67143e --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno/GlobalUsings.cs @@ -0,0 +1,13 @@ +global using System.Collections.Immutable; +global using FrontendPlaformUno.DataContracts; +global using FrontendPlaformUno.DataContracts.Serialization; +global using FrontendPlaformUno.Models; +global using FrontendPlaformUno.Presentation; +global using FrontendPlaformUno.Services.Caching; +global using FrontendPlaformUno.Services.Endpoints; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Hosting; +global using Microsoft.Extensions.Localization; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; +global using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState; diff --git a/FrontendPlaformUno/FrontendPlaformUno/IGameNightOptions.cs b/FrontendPlaformUno/FrontendPlaformUno/IGameNightOptions.cs new file mode 100644 index 0000000..ea986c3 --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno/IGameNightOptions.cs @@ -0,0 +1,5 @@ +namespace FrontendPlaformUno; + +internal interface IGameNightOptions +{ +} \ No newline at end of file diff --git a/FrontendPlaformUno/FrontendPlaformUno/Models/AppConfig.cs b/FrontendPlaformUno/FrontendPlaformUno/Models/AppConfig.cs new file mode 100644 index 0000000..2d4f656 --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno/Models/AppConfig.cs @@ -0,0 +1,6 @@ +namespace FrontendPlaformUno.Models; + +public record AppConfig +{ + public string? Environment { get; init; } +} diff --git a/FrontendPlaformUno/FrontendPlaformUno/Models/Entity.cs b/FrontendPlaformUno/FrontendPlaformUno/Models/Entity.cs new file mode 100644 index 0000000..27ae99b --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno/Models/Entity.cs @@ -0,0 +1,3 @@ +namespace FrontendPlaformUno.Models; + +public record Entity(string Name); diff --git a/FrontendPlaformUno/FrontendPlaformUno/Models/WeatherForecast.cs b/FrontendPlaformUno/FrontendPlaformUno/Models/WeatherForecast.cs new file mode 100644 index 0000000..5838077 --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno/Models/WeatherForecast.cs @@ -0,0 +1,15 @@ +namespace FrontendPlaformUno.DataContracts; + +/// +/// A Weather Forecast for a specific date +/// +/// Gets the Date of the Forecast. +/// Gets the Forecast Temperature in Celsius. +/// Get a description of how the weather will feel. +public record WeatherForecast(DateOnly Date, double TemperatureC, string? Summary) +{ + /// + /// Gets the Forecast Temperature in Fahrenheit + /// + public double TemperatureF => 32 + (TemperatureC * 9 / 5); +} diff --git a/FrontendPlatformUno/FrontendPlatformUno.Skia.Gtk/Package.appxmanifest b/FrontendPlaformUno/FrontendPlaformUno/Package.appxmanifest similarity index 63% rename from FrontendPlatformUno/FrontendPlatformUno.Skia.Gtk/Package.appxmanifest rename to FrontendPlaformUno/FrontendPlaformUno/Package.appxmanifest index 03ed548..9ef3814 100644 --- a/FrontendPlatformUno/FrontendPlatformUno.Skia.Gtk/Package.appxmanifest +++ b/FrontendPlaformUno/FrontendPlaformUno/Package.appxmanifest @@ -1,20 +1,12 @@ - - + - - - - FrontendPlatformUno - FrontendPlatformUno - + + @@ -29,11 +21,7 @@ - - - + diff --git a/FrontendPlatformUno/FrontendPlatformUno.Mobile/Android/AndroidManifest.xml b/FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/AndroidManifest.xml similarity index 100% rename from FrontendPlatformUno/FrontendPlatformUno.Mobile/Android/AndroidManifest.xml rename to FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/AndroidManifest.xml diff --git a/FrontendPlatformUno/FrontendPlatformUno.Mobile/Android/Assets/AboutAssets.txt b/FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/Assets/AboutAssets.txt similarity index 88% rename from FrontendPlatformUno/FrontendPlatformUno.Mobile/Android/Assets/AboutAssets.txt rename to FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/Assets/AboutAssets.txt index 210a93b..89ab409 100644 --- a/FrontendPlatformUno/FrontendPlatformUno.Mobile/Android/Assets/AboutAssets.txt +++ b/FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/Assets/AboutAssets.txt @@ -4,7 +4,7 @@ in the shared project instead. Assets in this folder are Android-only assets. Any raw assets you want to be deployed with your application can be placed in this directory (and child directories) and given a Build Action of "AndroidAsset". -These files will be deployed with you package and will be accessible using Android's +These files will be deployed with your package and will be accessible using Android's AssetManager, like this: public class ReadAsset : Activity diff --git a/FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/Main.Android.cs b/FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/Main.Android.cs new file mode 100644 index 0000000..7f52b86 --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/Main.Android.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Android.App; +using Android.Content; +using Android.OS; +using Android.Runtime; +using Android.Views; +using Android.Widget; +using Com.Nostra13.Universalimageloader.Core; +using Microsoft.UI.Xaml.Media; + +namespace FrontendPlaformUno.Droid; +[global::Android.App.ApplicationAttribute( + Label = "@string/ApplicationName", + Icon = "@mipmap/icon", + LargeHeap = true, + HardwareAccelerated = true, + Theme = "@style/AppTheme" +)] +public class Application : Microsoft.UI.Xaml.NativeApplication +{ + + public Application(IntPtr javaReference, JniHandleOwnership transfer) + : base(() => new App(), javaReference, transfer) + { + ConfigureUniversalImageLoader(); + } + + private static void ConfigureUniversalImageLoader() + { + // Create global configuration and initialize ImageLoader with this config + ImageLoaderConfiguration config = new ImageLoaderConfiguration + .Builder(Context) + .Build(); + + ImageLoader.Instance.Init(config); + + ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync; + } +} + diff --git a/FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/MainActivity.Android.cs b/FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/MainActivity.Android.cs new file mode 100644 index 0000000..c49e3ad --- /dev/null +++ b/FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/MainActivity.Android.cs @@ -0,0 +1,15 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; +using Android.Views; +using Android.Widget; + +namespace FrontendPlaformUno.Droid; +[Activity( + MainLauncher = true, + ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges, + WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden +)] +public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity +{ +} diff --git a/FrontendPlatformUno/FrontendPlatformUno.Mobile/Android/Resources/AboutResources.txt b/FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/Resources/AboutResources.txt similarity index 100% rename from FrontendPlatformUno/FrontendPlatformUno.Mobile/Android/Resources/AboutResources.txt rename to FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/Resources/AboutResources.txt diff --git a/FrontendPlatformUno/FrontendPlatformUno.Mobile/Android/Resources/values/Strings.xml b/FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/Resources/values/Strings.xml similarity index 65% rename from FrontendPlatformUno/FrontendPlatformUno.Mobile/Android/Resources/values/Strings.xml rename to FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/Resources/values/Strings.xml index 27299d4..f4f8292 100644 --- a/FrontendPlatformUno/FrontendPlatformUno.Mobile/Android/Resources/values/Strings.xml +++ b/FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/Resources/values/Strings.xml @@ -1,5 +1,5 @@ Hello World, Click Me! - FrontendPlatformUno + FrontendPlaformUno diff --git a/FrontendPlatformUno/FrontendPlatformUno.Mobile/Android/Resources/values/Styles.xml b/FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/Resources/values/Styles.xml similarity index 64% rename from FrontendPlatformUno/FrontendPlatformUno.Mobile/Android/Resources/values/Styles.xml rename to FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/Resources/values/Styles.xml index fd16cd7..c02bd06 100644 --- a/FrontendPlatformUno/FrontendPlatformUno.Mobile/Android/Resources/values/Styles.xml +++ b/FrontendPlaformUno/FrontendPlaformUno/Platforms/Android/Resources/values/Styles.xml @@ -1,6 +1,6 @@ - - - - - diff --git a/FrontendPlatformUno/FrontendPlatformUno/Styles/MaterialFontsOverride.xaml b/FrontendPlatformUno/FrontendPlatformUno/Styles/MaterialFontsOverride.xaml deleted file mode 100644 index 385d659..0000000 --- a/FrontendPlatformUno/FrontendPlatformUno/Styles/MaterialFontsOverride.xaml +++ /dev/null @@ -1,8 +0,0 @@ - - - ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Light.ttf#Roboto - ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Medium.ttf#Roboto - ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Regular.ttf#Roboto - - diff --git a/FrontendPlatformUno/FrontendPlatformUno/ViewModels/GamenightsViewModel.cs b/FrontendPlatformUno/FrontendPlatformUno/ViewModels/GamenightsViewModel.cs deleted file mode 100644 index 8237cfb..0000000 --- a/FrontendPlatformUno/FrontendPlatformUno/ViewModels/GamenightsViewModel.cs +++ /dev/null @@ -1,31 +0,0 @@ -using CommunityToolkit.Mvvm.ComponentModel; -using CommunityToolkit.Mvvm.Input; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Input; -using System.Xml.Linq; - -namespace FrontendPlatformUno.ViewModels -{ - public class GamenightsViewModel : ObservableObject - { - private INavigator Navigator { get; } - public string? Title { get; } - public ICommand GoToLogin { get; } - - public GamenightsViewModel(INavigator navigator, IStringLocalizer stringLocalizer) - { - Navigator = navigator; - Title = $"{stringLocalizer["ApplicationName"]}"; - GoToLogin = new AsyncRelayCommand(GoToLoginView); - } - - private async Task GoToLoginView() - { - await Navigator.NavigateViewModelAsync(this); - } - } -} diff --git a/FrontendPlatformUno/FrontendPlatformUno/ViewModels/LoginViewModel.cs b/FrontendPlatformUno/FrontendPlatformUno/ViewModels/LoginViewModel.cs deleted file mode 100644 index b152720..0000000 --- a/FrontendPlatformUno/FrontendPlatformUno/ViewModels/LoginViewModel.cs +++ /dev/null @@ -1,59 +0,0 @@ -using CommunityToolkit.Mvvm.ComponentModel; -using CommunityToolkit.Mvvm.Input; -using FrontendPlatformUno.Services.Api; -using FrontendPlatformUno.Services.Client; -using FrontendPlatformUno.Services.Model; -using FrontendPlatformUno.Views; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Input; - -namespace FrontendPlatformUno.ViewModels -{ - public class LoginViewModel : ObservableObject - { - private INavigator Navigator { get; } - public string? Title { get; } - public ICommand GoToLogin { get; } - - public string? Username { get; set; } - - public string? Password { get; set; } - public ICommand LoginCommand { get; internal set; } - - private IDefaultApi GamenightApi { get; } - - public LoginViewModel(INavigator navigator, IStringLocalizer stringLocalizer, IDefaultApi gamenightApi) - { - Navigator = navigator; - GamenightApi = gamenightApi; - Title = $"{stringLocalizer["ApplicationName"]} - Login"; - GoToLogin = new AsyncRelayCommand(GoToLoginView); - LoginCommand = new AsyncRelayCommand(Login); - } - - private async Task GoToLoginView() - { - await Navigator.NavigateViewModelAsync(this); - } - - private async Task Login() - { - var req = new GetTokenRequest(Username, Password); - GetToken200Response tokenResponse; - try - { - tokenResponse = await GamenightApi.GetTokenAsync(req); - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - return; - } - ((Configuration)GamenightApi.Configuration).AccessToken = tokenResponse.JwtToken; - } - } -} diff --git a/FrontendPlatformUno/FrontendPlatformUno/ViewModels/ShellViewModel.cs b/FrontendPlatformUno/FrontendPlatformUno/ViewModels/ShellViewModel.cs deleted file mode 100644 index 3f758df..0000000 --- a/FrontendPlatformUno/FrontendPlatformUno/ViewModels/ShellViewModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace FrontendPlatformUno.ViewModels -{ - public class ShellViewModel - { - private INavigator Navigator { get; } - - public ShellViewModel(INavigator navigator) - { - Navigator = navigator; - - _ = Start(); - } - - public async Task Start() - { - await Navigator.NavigateViewModelAsync(this); - } - } -} \ No newline at end of file diff --git a/FrontendPlatformUno/FrontendPlatformUno/Views/GamenightsPage.xaml b/FrontendPlatformUno/FrontendPlatformUno/Views/GamenightsPage.xaml deleted file mode 100644 index 76f42d1..0000000 --- a/FrontendPlatformUno/FrontendPlatformUno/Views/GamenightsPage.xaml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - diff --git a/FrontendPlatformUno/FrontendPlatformUno/Views/GamenightsPage.xaml.cs b/FrontendPlatformUno/FrontendPlatformUno/Views/GamenightsPage.xaml.cs deleted file mode 100644 index 5f62773..0000000 --- a/FrontendPlatformUno/FrontendPlatformUno/Views/GamenightsPage.xaml.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Controls.Primitives; -using Microsoft.UI.Xaml.Data; -using Microsoft.UI.Xaml.Input; -using Microsoft.UI.Xaml.Media; -using Microsoft.UI.Xaml.Navigation; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.Foundation; -using Windows.Foundation.Collections; - -// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 - -namespace FrontendPlatformUno.Views -{ - /// - /// An empty page that can be used on its own or navigated to within a Frame. - /// - public sealed partial class GamenightsPage : Page - { - public GamenightsPage() - { - this.InitializeComponent(); - } - } -} diff --git a/FrontendPlatformUno/FrontendPlatformUno/Views/LoginPage.xaml b/FrontendPlatformUno/FrontendPlatformUno/Views/LoginPage.xaml deleted file mode 100644 index 1ee6a83..0000000 --- a/FrontendPlatformUno/FrontendPlatformUno/Views/LoginPage.xaml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -