diff --git a/src/Artemis.Core/Artemis.Core.csproj b/src/Artemis.Core/Artemis.Core.csproj index 71aeb0167..2c50920de 100644 --- a/src/Artemis.Core/Artemis.Core.csproj +++ b/src/Artemis.Core/Artemis.Core.csproj @@ -1,6 +1,6 @@ - net8.0 + net9.0 false false Artemis.Core diff --git a/src/Artemis.Storage.Legacy/Artemis.Storage.Legacy.csproj b/src/Artemis.Storage.Legacy/Artemis.Storage.Legacy.csproj index 2da8bd8c3..ede098742 100644 --- a/src/Artemis.Storage.Legacy/Artemis.Storage.Legacy.csproj +++ b/src/Artemis.Storage.Legacy/Artemis.Storage.Legacy.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable enable diff --git a/src/Artemis.Storage/Artemis.Storage.csproj b/src/Artemis.Storage/Artemis.Storage.csproj index fa7b8fe61..62503b361 100644 --- a/src/Artemis.Storage/Artemis.Storage.csproj +++ b/src/Artemis.Storage/Artemis.Storage.csproj @@ -1,6 +1,6 @@ - net8.0 + net9.0 false x64 enable diff --git a/src/Artemis.Storage/ArtemisDbContext.cs b/src/Artemis.Storage/ArtemisDbContext.cs index de514f79a..0893def84 100644 --- a/src/Artemis.Storage/ArtemisDbContext.cs +++ b/src/Artemis.Storage/ArtemisDbContext.cs @@ -8,6 +8,7 @@ using Artemis.Storage.Entities.Profile; using Artemis.Storage.Entities.Surface; using Artemis.Storage.Entities.Workshop; using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Diagnostics; namespace Artemis.Storage; @@ -35,9 +36,17 @@ public class ArtemisDbContext : DbContext protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity() - .OwnsOne(d => d.InputIdentifiers, builder => builder.ToJson()) - .OwnsOne(d => d.InputMappings, builder => builder.ToJson()); - + .Property(e => e.InputIdentifiers) + .HasConversion( + v => JsonSerializer.Serialize(v, JsonSerializerOptions), + v => JsonSerializer.Deserialize>(v, JsonSerializerOptions) ?? new List()); + + modelBuilder.Entity() + .Property(e => e.InputMappings) + .HasConversion( + v => JsonSerializer.Serialize(v, JsonSerializerOptions), + v => JsonSerializer.Deserialize>(v, JsonSerializerOptions) ?? new List()); + modelBuilder.Entity() .Property(e => e.Metadata) .HasConversion( diff --git a/src/Artemis.Storage/Migrations/20250204194848_DevicesClearBrokenJson.Designer.cs b/src/Artemis.Storage/Migrations/20250204194848_DevicesClearBrokenJson.Designer.cs new file mode 100644 index 000000000..08808feae --- /dev/null +++ b/src/Artemis.Storage/Migrations/20250204194848_DevicesClearBrokenJson.Designer.cs @@ -0,0 +1,337 @@ +// +using System; +using Artemis.Storage; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Artemis.Storage.Migrations +{ + [DbContext(typeof(ArtemisDbContext))] + [Migration("20250204194848_DevicesClearBrokenJson")] + partial class DevicesClearBrokenJson + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "9.0.1"); + + modelBuilder.Entity("Artemis.Storage.Entities.General.ReleaseEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("InstalledAt") + .HasColumnType("TEXT"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("InstalledAt"); + + b.HasIndex("Version") + .IsUnique(); + + b.ToTable("Releases"); + }); + + modelBuilder.Entity("Artemis.Storage.Entities.Plugins.PluginEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("IsEnabled") + .HasColumnType("INTEGER"); + + b.Property("PluginGuid") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("PluginGuid") + .IsUnique(); + + b.ToTable("Plugins"); + }); + + modelBuilder.Entity("Artemis.Storage.Entities.Plugins.PluginFeatureEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("IsEnabled") + .HasColumnType("INTEGER"); + + b.Property("PluginEntityId") + .HasColumnType("TEXT"); + + b.Property("Type") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("PluginEntityId"); + + b.ToTable("PluginFeatures"); + }); + + modelBuilder.Entity("Artemis.Storage.Entities.Plugins.PluginSettingEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("TEXT"); + + b.Property("PluginGuid") + .HasColumnType("TEXT"); + + b.Property("Value") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("PluginGuid"); + + b.HasIndex("Name", "PluginGuid") + .IsUnique(); + + b.ToTable("PluginSettings"); + }); + + modelBuilder.Entity("Artemis.Storage.Entities.Profile.ProfileCategoryEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("IsCollapsed") + .HasColumnType("INTEGER"); + + b.Property("IsSuspended") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("TEXT"); + + b.Property("Order") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("ProfileCategories"); + }); + + modelBuilder.Entity("Artemis.Storage.Entities.Profile.ProfileContainerEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("BLOB"); + + b.Property("Profile") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ProfileCategoryId") + .HasColumnType("TEXT"); + + b.Property("ProfileConfiguration") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ProfileCategoryId"); + + b.ToTable("ProfileContainers"); + }); + + modelBuilder.Entity("Artemis.Storage.Entities.Surface.DeviceEntity", b => + { + b.Property("Id") + .HasMaxLength(512) + .HasColumnType("TEXT"); + + b.Property("BlueScale") + .HasColumnType("REAL"); + + b.PrimitiveCollection("Categories") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("DeviceProvider") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("TEXT"); + + b.Property("GreenScale") + .HasColumnType("REAL"); + + b.Property("InputIdentifiers") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("InputMappings") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("IsEnabled") + .HasColumnType("INTEGER"); + + b.Property("LayoutParameter") + .HasMaxLength(512) + .HasColumnType("TEXT"); + + b.Property("LayoutType") + .HasMaxLength(64) + .HasColumnType("TEXT"); + + b.Property("LogicalLayout") + .HasMaxLength(32) + .HasColumnType("TEXT"); + + b.Property("PhysicalLayout") + .HasColumnType("INTEGER"); + + b.Property("RedScale") + .HasColumnType("REAL"); + + b.Property("Rotation") + .HasColumnType("REAL"); + + b.Property("Scale") + .HasColumnType("REAL"); + + b.Property("X") + .HasColumnType("REAL"); + + b.Property("Y") + .HasColumnType("REAL"); + + b.Property("ZIndex") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("Devices"); + }); + + modelBuilder.Entity("Artemis.Storage.Entities.Workshop.EntryEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("Author") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("AutoUpdate") + .HasColumnType("INTEGER"); + + b.Property("Categories") + .HasColumnType("TEXT"); + + b.Property("CreatedAt") + .HasColumnType("TEXT"); + + b.Property("Downloads") + .HasColumnType("INTEGER"); + + b.Property("EntryId") + .HasColumnType("INTEGER"); + + b.Property("EntryType") + .HasColumnType("INTEGER"); + + b.Property("InstalledAt") + .HasColumnType("TEXT"); + + b.Property("IsOfficial") + .HasColumnType("INTEGER"); + + b.Property("LatestReleaseId") + .HasColumnType("INTEGER"); + + b.Property("Metadata") + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ReleaseId") + .HasColumnType("INTEGER"); + + b.Property("ReleaseVersion") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Summary") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("EntryId") + .IsUnique(); + + b.ToTable("Entries"); + }); + + modelBuilder.Entity("Artemis.Storage.Entities.Plugins.PluginFeatureEntity", b => + { + b.HasOne("Artemis.Storage.Entities.Plugins.PluginEntity", null) + .WithMany("Features") + .HasForeignKey("PluginEntityId"); + }); + + modelBuilder.Entity("Artemis.Storage.Entities.Profile.ProfileContainerEntity", b => + { + b.HasOne("Artemis.Storage.Entities.Profile.ProfileCategoryEntity", "ProfileCategory") + .WithMany("ProfileConfigurations") + .HasForeignKey("ProfileCategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ProfileCategory"); + }); + + modelBuilder.Entity("Artemis.Storage.Entities.Plugins.PluginEntity", b => + { + b.Navigation("Features"); + }); + + modelBuilder.Entity("Artemis.Storage.Entities.Profile.ProfileCategoryEntity", b => + { + b.Navigation("ProfileConfigurations"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Artemis.Storage/Migrations/20250204194848_DevicesClearBrokenJson.cs b/src/Artemis.Storage/Migrations/20250204194848_DevicesClearBrokenJson.cs new file mode 100644 index 000000000..4aea1a315 --- /dev/null +++ b/src/Artemis.Storage/Migrations/20250204194848_DevicesClearBrokenJson.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Artemis.Storage.Migrations +{ + /// + public partial class DevicesClearBrokenJson : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.Sql("UPDATE Devices SET InputMappings = \"[]\", InputIdentifiers = \"[]\""); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.Sql("UPDATE Devices SET InputMappings = '{\"Capacity\":0}', InputIdentifiers = '{\"Capacity\":0}'"); + } + } +} diff --git a/src/Artemis.Storage/Migrations/ArtemisDbContextModelSnapshot.cs b/src/Artemis.Storage/Migrations/ArtemisDbContextModelSnapshot.cs index 04a34e87b..dfccb79fd 100644 --- a/src/Artemis.Storage/Migrations/ArtemisDbContextModelSnapshot.cs +++ b/src/Artemis.Storage/Migrations/ArtemisDbContextModelSnapshot.cs @@ -15,7 +15,7 @@ namespace Artemis.Storage.Migrations protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.6"); + modelBuilder.HasAnnotation("ProductVersion", "9.0.1"); modelBuilder.Entity("Artemis.Storage.Entities.General.ReleaseEntity", b => { @@ -177,7 +177,7 @@ namespace Artemis.Storage.Migrations b.Property("BlueScale") .HasColumnType("REAL"); - b.Property("Categories") + b.PrimitiveCollection("Categories") .IsRequired() .HasColumnType("TEXT"); @@ -189,6 +189,14 @@ namespace Artemis.Storage.Migrations b.Property("GreenScale") .HasColumnType("REAL"); + b.Property("InputIdentifiers") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("InputMappings") + .IsRequired() + .HasColumnType("TEXT"); + b.Property("IsEnabled") .HasColumnType("INTEGER"); @@ -311,51 +319,6 @@ namespace Artemis.Storage.Migrations b.Navigation("ProfileCategory"); }); - modelBuilder.Entity("Artemis.Storage.Entities.Surface.DeviceEntity", b => - { - b.OwnsOne("System.Collections.Generic.List", "InputIdentifiers", b1 => - { - b1.Property("DeviceEntityId") - .HasColumnType("TEXT"); - - b1.Property("Capacity") - .HasColumnType("INTEGER"); - - b1.HasKey("DeviceEntityId"); - - b1.ToTable("Devices"); - - b1.ToJson("InputIdentifiers"); - - b1.WithOwner() - .HasForeignKey("DeviceEntityId"); - }); - - b.OwnsOne("System.Collections.Generic.List", "InputMappings", b1 => - { - b1.Property("DeviceEntityId") - .HasColumnType("TEXT"); - - b1.Property("Capacity") - .HasColumnType("INTEGER"); - - b1.HasKey("DeviceEntityId"); - - b1.ToTable("Devices"); - - b1.ToJson("InputMappings"); - - b1.WithOwner() - .HasForeignKey("DeviceEntityId"); - }); - - b.Navigation("InputIdentifiers") - .IsRequired(); - - b.Navigation("InputMappings") - .IsRequired(); - }); - modelBuilder.Entity("Artemis.Storage.Entities.Plugins.PluginEntity", b => { b.Navigation("Features"); diff --git a/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj b/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj index ed8f08fda..64844bc6c 100644 --- a/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj +++ b/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj @@ -1,7 +1,7 @@ WinExe - net8.0 + net9.0 enable x64 x64 diff --git a/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj b/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj index f322b73d7..816f3cd77 100644 --- a/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj +++ b/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj @@ -1,7 +1,7 @@  WinExe - net8.0 + net9.0 enable x64 x64 diff --git a/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj b/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj index 42faecb23..ef6ed4e95 100644 --- a/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj +++ b/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj @@ -1,7 +1,7 @@ Library - net8.0 + net9.0 enable bin\ x64 diff --git a/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj b/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj index 0547102a2..074722051 100644 --- a/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj +++ b/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj @@ -1,7 +1,7 @@ WinExe - net8.0-windows10.0.17763.0 + net9.0-windows10.0.17763.0 enable x64 bin diff --git a/src/Artemis.UI/Artemis.UI.csproj b/src/Artemis.UI/Artemis.UI.csproj index 83e51d23a..268327347 100644 --- a/src/Artemis.UI/Artemis.UI.csproj +++ b/src/Artemis.UI/Artemis.UI.csproj @@ -1,7 +1,7 @@ Library - net8.0 + net9.0 enable bin/ x64 diff --git a/src/Artemis.UI/Screens/Workshop/SubmissionWizard/Steps/ValidateEmailStepViewModel.cs b/src/Artemis.UI/Screens/Workshop/SubmissionWizard/Steps/ValidateEmailStepViewModel.cs index 1321df067..b07414ce4 100644 --- a/src/Artemis.UI/Screens/Workshop/SubmissionWizard/Steps/ValidateEmailStepViewModel.cs +++ b/src/Artemis.UI/Screens/Workshop/SubmissionWizard/Steps/ValidateEmailStepViewModel.cs @@ -26,7 +26,7 @@ public class ValidateEmailStepViewModel : SubmissionViewModel Continue = ReactiveCommand.Create(() =>{}, Observable.Never()); Refresh = ReactiveCommand.CreateFromTask(ExecuteRefresh); - Resend = ReactiveCommand.Create(() => Utilities.OpenUrl(WorkshopConstants.AUTHORITY_URL + "/account/confirm/resend")); + Resend = ReactiveCommand.Create(() => Utilities.OpenUrl(WorkshopConstants.AUTHORITY_URL + "/account/email/confirm/resend")); ShowGoBack = false; ShowHeader = false; diff --git a/src/Artemis.WebClient.Updating/Artemis.WebClient.Updating.csproj b/src/Artemis.WebClient.Updating/Artemis.WebClient.Updating.csproj index f5d00c0f4..4ca738864 100644 --- a/src/Artemis.WebClient.Updating/Artemis.WebClient.Updating.csproj +++ b/src/Artemis.WebClient.Updating/Artemis.WebClient.Updating.csproj @@ -1,6 +1,6 @@ - net8.0 + net9.0 enable enable x64 diff --git a/src/Artemis.WebClient.Workshop/Artemis.WebClient.Workshop.csproj b/src/Artemis.WebClient.Workshop/Artemis.WebClient.Workshop.csproj index a51abe913..c3c32e403 100644 --- a/src/Artemis.WebClient.Workshop/Artemis.WebClient.Workshop.csproj +++ b/src/Artemis.WebClient.Workshop/Artemis.WebClient.Workshop.csproj @@ -1,6 +1,6 @@ - net8.0 + net9.0 enable enable x64 diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 7860fef04..95bbeb892 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -5,62 +5,65 @@ - + - + - + - + - + - - + + - + - + - - + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + - + - - - - - + + + + + \ No newline at end of file