From c2f89b1b092c06a09a11e475b0f45365159554a8 Mon Sep 17 00:00:00 2001 From: Leon Hoppe Date: Tue, 4 Mar 2025 14:28:50 +0100 Subject: [PATCH] Added client abstractions for backend functions --- .gitlab-ci.yml | 14 +- .idea/.idea.WorkTime/.idea/indexLayout.xml | 1 + WorkTime.sln | 12 +- src/WorkTime.Mobile/App.xaml | 14 + src/WorkTime.Mobile/App.xaml.cs | 11 + src/WorkTime.Mobile/AppShell.xaml | 15 + src/WorkTime.Mobile/AppShell.xaml.cs | 7 + src/WorkTime.Mobile/DatabaseContext.cs | 10 + src/WorkTime.Mobile/MainPage.xaml | 36 + src/WorkTime.Mobile/MainPage.xaml.cs | 20 + src/WorkTime.Mobile/MauiProgram.cs | 42 + .../Platforms/Android/AndroidManifest.xml | 6 + .../Platforms/Android/MainActivity.cs | 10 + .../Platforms/Android/MainApplication.cs | 12 + .../Android/Resources/values/colors.xml | 6 + .../Platforms/MacCatalyst/AppDelegate.cs | 8 + .../Platforms/MacCatalyst/Entitlements.plist | 14 + .../Platforms/MacCatalyst/Info.plist | 38 + .../Platforms/MacCatalyst/Program.cs | 13 + src/WorkTime.Mobile/Platforms/Tizen/Main.cs | 14 + .../Platforms/Tizen/tizen-manifest.xml | 15 + .../Platforms/Windows/App.xaml | 8 + .../Platforms/Windows/App.xaml.cs | 21 + .../Platforms/Windows/Package.appxmanifest | 46 + .../Platforms/Windows/app.manifest | 15 + .../Platforms/iOS/AppDelegate.cs | 8 + src/WorkTime.Mobile/Platforms/iOS/Info.plist | 32 + src/WorkTime.Mobile/Platforms/iOS/Program.cs | 13 + .../iOS/Resources/PrivacyInfo.xcprivacy | 51 + .../Properties/launchSettings.json | 8 + .../Repositories/ClientEntryRepository.cs | 39 + .../Repositories/ServerEntryRepository.cs | 35 + .../Resources/AppIcon/appicon.svg | 4 + .../Resources/AppIcon/appiconfg.svg | 8 + .../Resources/Fonts/FluentUI.cs | 7919 +++++++++++++++++ .../Resources/Fonts/OpenSans-Regular.ttf | Bin 0 -> 107280 bytes .../Resources/Fonts/OpenSans-Semibold.ttf | Bin 0 -> 111184 bytes .../Resources/Images/dotnet_bot.png | Bin 0 -> 93437 bytes .../Resources/Raw/AboutAssets.txt | 15 + .../Resources/Splash/splash.svg | 8 + .../Resources/Styles/Colors.xaml | 45 + .../Resources/Styles/Styles.xaml | 451 + src/WorkTime.Mobile/Services/AuthService.cs | 28 + src/WorkTime.Mobile/WorkTime.Mobile.csproj | 72 + 44 files changed, 9135 insertions(+), 9 deletions(-) create mode 100644 src/WorkTime.Mobile/App.xaml create mode 100644 src/WorkTime.Mobile/App.xaml.cs create mode 100644 src/WorkTime.Mobile/AppShell.xaml create mode 100644 src/WorkTime.Mobile/AppShell.xaml.cs create mode 100644 src/WorkTime.Mobile/DatabaseContext.cs create mode 100644 src/WorkTime.Mobile/MainPage.xaml create mode 100644 src/WorkTime.Mobile/MainPage.xaml.cs create mode 100644 src/WorkTime.Mobile/MauiProgram.cs create mode 100644 src/WorkTime.Mobile/Platforms/Android/AndroidManifest.xml create mode 100644 src/WorkTime.Mobile/Platforms/Android/MainActivity.cs create mode 100644 src/WorkTime.Mobile/Platforms/Android/MainApplication.cs create mode 100644 src/WorkTime.Mobile/Platforms/Android/Resources/values/colors.xml create mode 100644 src/WorkTime.Mobile/Platforms/MacCatalyst/AppDelegate.cs create mode 100644 src/WorkTime.Mobile/Platforms/MacCatalyst/Entitlements.plist create mode 100644 src/WorkTime.Mobile/Platforms/MacCatalyst/Info.plist create mode 100644 src/WorkTime.Mobile/Platforms/MacCatalyst/Program.cs create mode 100644 src/WorkTime.Mobile/Platforms/Tizen/Main.cs create mode 100644 src/WorkTime.Mobile/Platforms/Tizen/tizen-manifest.xml create mode 100644 src/WorkTime.Mobile/Platforms/Windows/App.xaml create mode 100644 src/WorkTime.Mobile/Platforms/Windows/App.xaml.cs create mode 100644 src/WorkTime.Mobile/Platforms/Windows/Package.appxmanifest create mode 100644 src/WorkTime.Mobile/Platforms/Windows/app.manifest create mode 100644 src/WorkTime.Mobile/Platforms/iOS/AppDelegate.cs create mode 100644 src/WorkTime.Mobile/Platforms/iOS/Info.plist create mode 100644 src/WorkTime.Mobile/Platforms/iOS/Program.cs create mode 100644 src/WorkTime.Mobile/Platforms/iOS/Resources/PrivacyInfo.xcprivacy create mode 100644 src/WorkTime.Mobile/Properties/launchSettings.json create mode 100644 src/WorkTime.Mobile/Repositories/ClientEntryRepository.cs create mode 100644 src/WorkTime.Mobile/Repositories/ServerEntryRepository.cs create mode 100644 src/WorkTime.Mobile/Resources/AppIcon/appicon.svg create mode 100644 src/WorkTime.Mobile/Resources/AppIcon/appiconfg.svg create mode 100644 src/WorkTime.Mobile/Resources/Fonts/FluentUI.cs create mode 100644 src/WorkTime.Mobile/Resources/Fonts/OpenSans-Regular.ttf create mode 100644 src/WorkTime.Mobile/Resources/Fonts/OpenSans-Semibold.ttf create mode 100644 src/WorkTime.Mobile/Resources/Images/dotnet_bot.png create mode 100644 src/WorkTime.Mobile/Resources/Raw/AboutAssets.txt create mode 100644 src/WorkTime.Mobile/Resources/Splash/splash.svg create mode 100644 src/WorkTime.Mobile/Resources/Styles/Colors.xaml create mode 100644 src/WorkTime.Mobile/Resources/Styles/Styles.xaml create mode 100644 src/WorkTime.Mobile/Services/AuthService.cs create mode 100644 src/WorkTime.Mobile/WorkTime.Mobile.csproj diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aeb86ea..0d29d07 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,9 +15,9 @@ install-mobile: cache: key: files: - - src/WorkTime.Mobile/package.json + - src/WorkTime.WebMobile/package.json paths: - - src/WorkTime.Mobile/node_modules + - src/WorkTime.WebMobile/node_modules install-backend: stage: install @@ -36,9 +36,9 @@ lint-mobile: cache: key: files: - - src/WorkTime.Mobile/package.json + - src/WorkTime.WebMobile/package.json paths: - - src/WorkTime.Mobile/node_modules + - src/WorkTime.WebMobile/node_modules policy: pull build-mobile: @@ -51,14 +51,14 @@ build-mobile: - npm run build artifacts: paths: - - $CI_PROJECT_DIR/src/WorkTime.Mobile/www + - $CI_PROJECT_DIR/src/WorkTime.WebMobile/www expire_in: 10 minutes cache: key: files: - - src/WorkTime.Mobile/package.json + - src/WorkTime.WebMobile/package.json paths: - - src/WorkTime.Mobile/node_modules + - src/WorkTime.WebMobile/node_modules policy: pull build-backend: diff --git a/.idea/.idea.WorkTime/.idea/indexLayout.xml b/.idea/.idea.WorkTime/.idea/indexLayout.xml index 4cf8b16..e97996b 100644 --- a/.idea/.idea.WorkTime/.idea/indexLayout.xml +++ b/.idea/.idea.WorkTime/.idea/indexLayout.xml @@ -3,6 +3,7 @@ src/WorkTime.Mobile + src/WorkTime.WebMobile diff --git a/WorkTime.sln b/WorkTime.sln index 48f1361..3356fff 100644 --- a/WorkTime.sln +++ b/WorkTime.sln @@ -1,6 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{25C5A6B2-A1F9-4244-9538-18E3FE76D382}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Server", "Server", "{25C5A6B2-A1F9-4244-9538-18E3FE76D382}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkTime.Host", "src\WorkTime.Host\WorkTime.Host.csproj", "{6F5D4D47-1484-44EA-A5DD-D00AAD2F2F68}" EndProject @@ -10,6 +10,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkTime.Shared", "src\Work EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkTime.Api", "src\WorkTime.Api\WorkTime.Api.csproj", "{CED653D6-A0B6-432B-9C36-FBB58EEA8229}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Client", "Client", "{8CB1F4C6-F95B-4935-81AA-751015E69FEC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkTime.Mobile", "src\WorkTime.Mobile\WorkTime.Mobile.csproj", "{640DF179-F955-4497-B798-43ABE2AAABF6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -18,8 +22,8 @@ Global GlobalSection(NestedProjects) = preSolution {6F5D4D47-1484-44EA-A5DD-D00AAD2F2F68} = {25C5A6B2-A1F9-4244-9538-18E3FE76D382} {B66AA463-03D5-4814-B1D4-71663804248C} = {25C5A6B2-A1F9-4244-9538-18E3FE76D382} - {E6A73E21-39B8-4FA7-8D6D-D5DDB8FB8AF0} = {25C5A6B2-A1F9-4244-9538-18E3FE76D382} {CED653D6-A0B6-432B-9C36-FBB58EEA8229} = {25C5A6B2-A1F9-4244-9538-18E3FE76D382} + {640DF179-F955-4497-B798-43ABE2AAABF6} = {8CB1F4C6-F95B-4935-81AA-751015E69FEC} EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {6F5D4D47-1484-44EA-A5DD-D00AAD2F2F68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -38,5 +42,9 @@ Global {CED653D6-A0B6-432B-9C36-FBB58EEA8229}.Debug|Any CPU.Build.0 = Debug|Any CPU {CED653D6-A0B6-432B-9C36-FBB58EEA8229}.Release|Any CPU.ActiveCfg = Release|Any CPU {CED653D6-A0B6-432B-9C36-FBB58EEA8229}.Release|Any CPU.Build.0 = Release|Any CPU + {640DF179-F955-4497-B798-43ABE2AAABF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {640DF179-F955-4497-B798-43ABE2AAABF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {640DF179-F955-4497-B798-43ABE2AAABF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {640DF179-F955-4497-B798-43ABE2AAABF6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/src/WorkTime.Mobile/App.xaml b/src/WorkTime.Mobile/App.xaml new file mode 100644 index 0000000..690f1d6 --- /dev/null +++ b/src/WorkTime.Mobile/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/src/WorkTime.Mobile/App.xaml.cs b/src/WorkTime.Mobile/App.xaml.cs new file mode 100644 index 0000000..b079cca --- /dev/null +++ b/src/WorkTime.Mobile/App.xaml.cs @@ -0,0 +1,11 @@ +namespace WorkTime.Mobile; + +public partial class App : Application { + public App() { + InitializeComponent(); + } + + protected override Window CreateWindow(IActivationState? activationState) { + return new Window(new AppShell()); + } +} \ No newline at end of file diff --git a/src/WorkTime.Mobile/AppShell.xaml b/src/WorkTime.Mobile/AppShell.xaml new file mode 100644 index 0000000..19d4bd6 --- /dev/null +++ b/src/WorkTime.Mobile/AppShell.xaml @@ -0,0 +1,15 @@ + + + + + + diff --git a/src/WorkTime.Mobile/AppShell.xaml.cs b/src/WorkTime.Mobile/AppShell.xaml.cs new file mode 100644 index 0000000..68fb7d4 --- /dev/null +++ b/src/WorkTime.Mobile/AppShell.xaml.cs @@ -0,0 +1,7 @@ +namespace WorkTime.Mobile; + +public partial class AppShell : Shell { + public AppShell() { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/src/WorkTime.Mobile/DatabaseContext.cs b/src/WorkTime.Mobile/DatabaseContext.cs new file mode 100644 index 0000000..2149c9d --- /dev/null +++ b/src/WorkTime.Mobile/DatabaseContext.cs @@ -0,0 +1,10 @@ +using Microsoft.EntityFrameworkCore; +using WorkTime.Shared.Models; + +namespace WorkTime.Mobile; + +public class DatabaseContext(DbContextOptions options) : DbContext(options) { + + public DbSet Entries { get; set; } + +} \ No newline at end of file diff --git a/src/WorkTime.Mobile/MainPage.xaml b/src/WorkTime.Mobile/MainPage.xaml new file mode 100644 index 0000000..c017f15 --- /dev/null +++ b/src/WorkTime.Mobile/MainPage.xaml @@ -0,0 +1,36 @@ + + + + + + + +