From 91f1b1dff9437781f19ee8913bfd9a1aaf572f4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 10:46:57 +0000 Subject: [PATCH 01/18] Bump NUnit from 4.2.1 to 4.2.2 Bumps [NUnit](https://github.com/nunit/nunit) from 4.2.1 to 4.2.2. - [Release notes](https://github.com/nunit/nunit/releases) - [Changelog](https://github.com/nunit/nunit/blob/main/CHANGES.md) - [Commits](https://github.com/nunit/nunit/compare/4.2.1...4.2.2) --- updated-dependencies: - dependency-name: NUnit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- PlaywrightTests/PlaywrightTests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlaywrightTests/PlaywrightTests.csproj b/PlaywrightTests/PlaywrightTests.csproj index f7a17785..9822d564 100644 --- a/PlaywrightTests/PlaywrightTests.csproj +++ b/PlaywrightTests/PlaywrightTests.csproj @@ -11,7 +11,7 @@ - + all From 1f6262b0da971e22cea962fe581b5e474b275e0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 10:14:32 +0000 Subject: [PATCH 02/18] Bump MudBlazor from 7.6.0 to 7.8.0 Bumps [MudBlazor](https://github.com/MudBlazor/MudBlazor) from 7.6.0 to 7.8.0. - [Release notes](https://github.com/MudBlazor/MudBlazor/releases) - [Changelog](https://github.com/MudBlazor/MudBlazor/blob/dev/CHANGELOG.md) - [Commits](https://github.com/MudBlazor/MudBlazor/compare/v7.6.0...v7.8.0) --- updated-dependencies: - dependency-name: MudBlazor dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- BLAZAM/BLAZAM.csproj | 2 +- BLAZAMEmailMessage/BLAZAMEmailMessage.csproj | 2 +- BLAZAMGui/BLAZAMGui.csproj | 2 +- BLAZAMJobs/BLAZAMJobs.csproj | 2 +- BLAZAMNotifications/BLAZAMNotifications.csproj | 2 +- BLAZAMThemes/BLAZAMThemes.csproj | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/BLAZAM/BLAZAM.csproj b/BLAZAM/BLAZAM.csproj index fef3ba55..da48ed38 100644 --- a/BLAZAM/BLAZAM.csproj +++ b/BLAZAM/BLAZAM.csproj @@ -74,7 +74,7 @@ - + diff --git a/BLAZAMEmailMessage/BLAZAMEmailMessage.csproj b/BLAZAMEmailMessage/BLAZAMEmailMessage.csproj index 165c664b..a53fff73 100644 --- a/BLAZAMEmailMessage/BLAZAMEmailMessage.csproj +++ b/BLAZAMEmailMessage/BLAZAMEmailMessage.csproj @@ -15,7 +15,7 @@ - + diff --git a/BLAZAMGui/BLAZAMGui.csproj b/BLAZAMGui/BLAZAMGui.csproj index 0fa6a739..79af9e1d 100644 --- a/BLAZAMGui/BLAZAMGui.csproj +++ b/BLAZAMGui/BLAZAMGui.csproj @@ -26,7 +26,7 @@ - + diff --git a/BLAZAMJobs/BLAZAMJobs.csproj b/BLAZAMJobs/BLAZAMJobs.csproj index cf8cb6ee..de7e12f3 100644 --- a/BLAZAMJobs/BLAZAMJobs.csproj +++ b/BLAZAMJobs/BLAZAMJobs.csproj @@ -9,7 +9,7 @@ - + diff --git a/BLAZAMNotifications/BLAZAMNotifications.csproj b/BLAZAMNotifications/BLAZAMNotifications.csproj index 6d86eb86..3a00c644 100644 --- a/BLAZAMNotifications/BLAZAMNotifications.csproj +++ b/BLAZAMNotifications/BLAZAMNotifications.csproj @@ -9,7 +9,7 @@ - + diff --git a/BLAZAMThemes/BLAZAMThemes.csproj b/BLAZAMThemes/BLAZAMThemes.csproj index 5c2bb324..1a747b54 100644 --- a/BLAZAMThemes/BLAZAMThemes.csproj +++ b/BLAZAMThemes/BLAZAMThemes.csproj @@ -9,7 +9,7 @@ - + From d309a545a72a68a42a7e360e68b3a6af3724e852 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 10:15:03 +0000 Subject: [PATCH 03/18] Bump Microsoft.NET.Test.Sdk from 17.11.0 to 17.11.1 Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.11.0 to 17.11.1. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.11.0...v17.11.1) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- BLAZAM.Tests/BLAZAM.Tests.csproj | 2 +- BLAZAMCommon.Tests/BLAZAMCommon.Tests.csproj | 2 +- PlaywrightTests/PlaywrightTests.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BLAZAM.Tests/BLAZAM.Tests.csproj b/BLAZAM.Tests/BLAZAM.Tests.csproj index f0d27a0f..af0685ce 100644 --- a/BLAZAM.Tests/BLAZAM.Tests.csproj +++ b/BLAZAM.Tests/BLAZAM.Tests.csproj @@ -9,7 +9,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/BLAZAMCommon.Tests/BLAZAMCommon.Tests.csproj b/BLAZAMCommon.Tests/BLAZAMCommon.Tests.csproj index fe54456a..50665102 100644 --- a/BLAZAMCommon.Tests/BLAZAMCommon.Tests.csproj +++ b/BLAZAMCommon.Tests/BLAZAMCommon.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/PlaywrightTests/PlaywrightTests.csproj b/PlaywrightTests/PlaywrightTests.csproj index f7a17785..2e434207 100644 --- a/PlaywrightTests/PlaywrightTests.csproj +++ b/PlaywrightTests/PlaywrightTests.csproj @@ -10,7 +10,7 @@ - + From d1828ea8976bbc2cbbbce695fd1eb9a86a84046d Mon Sep 17 00:00:00 2001 From: Chris Jacobsen Date: Thu, 12 Sep 2024 20:57:14 -0400 Subject: [PATCH 04/18] Add Locked Out Alert Message in view pages --- BLAZAM/BLAZAM.csproj | 2 +- BLAZAM/Pages/Computers/ViewComputer.razor | 9 ++++++++- BLAZAM/Pages/Users/ViewUser.razor | 5 ++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/BLAZAM/BLAZAM.csproj b/BLAZAM/BLAZAM.csproj index fef3ba55..c4ddc90e 100644 --- a/BLAZAM/BLAZAM.csproj +++ b/BLAZAM/BLAZAM.csproj @@ -6,7 +6,7 @@ enable false 1.0.1 - 2024.08.31.2028 + 2024.09.13.0051 false BLAZAM False diff --git a/BLAZAM/Pages/Computers/ViewComputer.razor b/BLAZAM/Pages/Computers/ViewComputer.razor index cbabb8e2..127828d3 100644 --- a/BLAZAM/Pages/Computers/ViewComputer.razor +++ b/BLAZAM/Pages/Computers/ViewComputer.razor @@ -60,7 +60,14 @@ - + @if (Computer.Disabled) + { + @AppLocalization["Computer is disabled"] + } + @if (Computer.LockedOut) + { + @AppLocalization["Computer is locked out"] + } diff --git a/BLAZAM/Pages/Users/ViewUser.razor b/BLAZAM/Pages/Users/ViewUser.razor index 586ae5aa..04ee2f38 100644 --- a/BLAZAM/Pages/Users/ViewUser.razor +++ b/BLAZAM/Pages/Users/ViewUser.razor @@ -175,7 +175,10 @@ { @AppLocalization["User is disabled"] } - + @if (User.LockedOut) + { + @AppLocalization["User is locked out"] + } From f3f4abf6d1d943188cee08e7542b163c0782a192 Mon Sep 17 00:00:00 2001 From: Chris Jacobsen Date: Thu, 12 Sep 2024 21:28:38 -0400 Subject: [PATCH 05/18] Add colors to switches --- BLAZAM/BLAZAM.csproj | 2 +- BLAZAM/Pages/Benchmark.razor | 15 +-------------- .../Models/Templates/DirectoryTemplate.cs | 6 +++--- BLAZAMGui/UI/Inputs/DynamicMudInput.razor | 6 +++++- .../UI/Outputs/ApplicationNewsProvider.razor | 2 ++ BLAZAMGui/UI/Settings/DirectorySettings.razor | 10 ++++++++-- .../Permissions/AddPrivilegeLevelModal.razor | 15 ++++++++++----- .../Settings/Permissions/DelegateListItem.razor | 14 +++++++++----- .../UI/Settings/Permissions/EditAccessLevel.razor | 2 ++ BLAZAMGui/UI/Settings/SystemSettings.razor | 2 ++ .../Templates/EditDirectoryTemplate.razor | 12 ++++++++---- .../UI/Users/ChangeUserPasswordModalContent.razor | 5 ++++- 12 files changed, 55 insertions(+), 36 deletions(-) diff --git a/BLAZAM/BLAZAM.csproj b/BLAZAM/BLAZAM.csproj index c4ddc90e..07f9a87f 100644 --- a/BLAZAM/BLAZAM.csproj +++ b/BLAZAM/BLAZAM.csproj @@ -6,7 +6,7 @@ enable false 1.0.1 - 2024.09.13.0051 + 2024.09.13.0125 false BLAZAM False diff --git a/BLAZAM/Pages/Benchmark.razor b/BLAZAM/Pages/Benchmark.razor index 8a46cd81..d45b984a 100644 --- a/BLAZAM/Pages/Benchmark.razor +++ b/BLAZAM/Pages/Benchmark.razor @@ -24,20 +24,7 @@ -@* -

Tree View

- -@if (!adTree) -{ - - -} -else -{ - - -} *@ +s @code { #nullable disable warnings //ActiveDirectoryContext ad; diff --git a/BLAZAMDatabase/Models/Templates/DirectoryTemplate.cs b/BLAZAMDatabase/Models/Templates/DirectoryTemplate.cs index 2cab05f3..44b18a6c 100644 --- a/BLAZAMDatabase/Models/Templates/DirectoryTemplate.cs +++ b/BLAZAMDatabase/Models/Templates/DirectoryTemplate.cs @@ -60,7 +60,7 @@ public string? EffectivePasswordFormula set => PasswordFormula = value; } - public bool? RequirePasswordChange { get; set; } + public bool? RequirePasswordChange { get; set; } = false; [NotMapped] public bool? EffectiveRequirePasswordChange { @@ -170,7 +170,7 @@ public bool? EffectiveAllowCustomGroups set => AllowCustomGroups = value; } - public bool? AskForAlternateEmail { get; set; } + public bool? AskForAlternateEmail { get; set; } = false; [NotMapped] public bool? EffectiveAskForAlternateEmail { @@ -188,7 +188,7 @@ public bool? EffectiveAskForAlternateEmail } - public bool? SendWelcomeEmail { get; set; } + public bool? SendWelcomeEmail { get; set; } = false; [NotMapped] public bool? EffectiveSendWelcomeEmail { diff --git a/BLAZAMGui/UI/Inputs/DynamicMudInput.razor b/BLAZAMGui/UI/Inputs/DynamicMudInput.razor index ddcb21f6..aa990e49 100644 --- a/BLAZAMGui/UI/Inputs/DynamicMudInput.razor +++ b/BLAZAMGui/UI/Inputs/DynamicMudInput.razor @@ -37,6 +37,8 @@ case "Boolean": ValueChanged { get; set; } [Parameter] - public Color Color { get; set; } + public Color Color { get; set; } = Color.Success; + [Parameter] + public Color UncheckedColor { get; set; } = Color.Error; /// diff --git a/BLAZAMGui/UI/Outputs/ApplicationNewsProvider.razor b/BLAZAMGui/UI/Outputs/ApplicationNewsProvider.razor index b5e93cbc..b7b7559f 100644 --- a/BLAZAMGui/UI/Outputs/ApplicationNewsProvider.razor +++ b/BLAZAMGui/UI/Outputs/ApplicationNewsProvider.razor @@ -61,6 +61,8 @@ @if (readItems.Count > 0) { } diff --git a/BLAZAMGui/UI/Settings/DirectorySettings.razor b/BLAZAMGui/UI/Settings/DirectorySettings.razor index 7a62512b..9613d70a 100644 --- a/BLAZAMGui/UI/Settings/DirectorySettings.razor +++ b/BLAZAMGui/UI/Settings/DirectorySettings.razor @@ -110,7 +110,10 @@ - + @@ -118,7 +121,10 @@ - + diff --git a/BLAZAMGui/UI/Settings/Permissions/AddPrivilegeLevelModal.razor b/BLAZAMGui/UI/Settings/Permissions/AddPrivilegeLevelModal.razor index f4a20038..dca89dbc 100644 --- a/BLAZAMGui/UI/Settings/Permissions/AddPrivilegeLevelModal.razor +++ b/BLAZAMGui/UI/Settings/Permissions/AddPrivilegeLevelModal.razor @@ -4,16 +4,21 @@ - + Will have complete and total acceess to the application if enabled - - + + @@ -63,7 +68,7 @@ catch (Exception ex) { - Loggers.ActiveDirectoryLogger.Error("Error attempting to add delegate " + selectedDelegate.CanonicalName + " {@Error}",ex); + Loggers.ActiveDirectoryLogger.Error("Error attempting to add delegate " + selectedDelegate.CanonicalName + " {@Error}", ex); NotificationService.Error("An unexpected error has occured."); } diff --git a/BLAZAMGui/UI/Settings/Permissions/DelegateListItem.razor b/BLAZAMGui/UI/Settings/Permissions/DelegateListItem.razor index eb4ce7fe..aa85dc7b 100644 --- a/BLAZAMGui/UI/Settings/Permissions/DelegateListItem.razor +++ b/BLAZAMGui/UI/Settings/Permissions/DelegateListItem.razor @@ -8,9 +8,11 @@ + UncheckedColor="Color.Error" + Color="Color.Success" + Label="Super User Group" + Value="Delegate.IsSuperAdmin" + Disabled=true /> @@ -31,6 +33,8 @@ @@ -39,8 +43,8 @@ - @* @AppLocalization["Show All Members"] *@ + @* @AppLocalization["Show All Members"] *@ @AppLocalization["Save Changes"] diff --git a/BLAZAMGui/UI/Settings/Permissions/EditAccessLevel.razor b/BLAZAMGui/UI/Settings/Permissions/EditAccessLevel.razor index 194d5934..2c29a2fc 100644 --- a/BLAZAMGui/UI/Settings/Permissions/EditAccessLevel.razor +++ b/BLAZAMGui/UI/Settings/Permissions/EditAccessLevel.razor @@ -72,6 +72,8 @@ @if (objectMap.ObjectType == ActiveDirectoryObjectType.User && objectMap.ObjectAccessLevelId != ObjectAccessLevels.Deny.Id) { } diff --git a/BLAZAMGui/UI/Settings/SystemSettings.razor b/BLAZAMGui/UI/Settings/SystemSettings.razor index 450cec8a..4f41672b 100644 --- a/BLAZAMGui/UI/Settings/SystemSettings.razor +++ b/BLAZAMGui/UI/Settings/SystemSettings.razor @@ -36,6 +36,7 @@ We ask that you allow developer logging so we can quickly and transparently improve Blazam and to aid in our developement efforts. @@ -47,6 +48,7 @@ efforts on what our users think matters most. diff --git a/BLAZAMGui/UI/Settings/Templates/EditDirectoryTemplate.razor b/BLAZAMGui/UI/Settings/Templates/EditDirectoryTemplate.razor index 6227e9f2..29869f6f 100644 --- a/BLAZAMGui/UI/Settings/Templates/EditDirectoryTemplate.razor +++ b/BLAZAMGui/UI/Settings/Templates/EditDirectoryTemplate.razor @@ -51,7 +51,8 @@ await ParentTemplateChanged(null); })" /> @if (DirectoryTemplate.ParentTemplate != null && DirectoryTemplate.ParentTemplate.EffectiveRequirePasswordChange != DirectoryTemplate.EffectiveRequirePasswordChange) @@ -173,7 +175,8 @@ await ParentTemplateChanged(null); @if (DirectoryTemplate.EffectiveSendWelcomeEmail == true && DirectoryTemplate.EffectiveAskForAlternateEmail != true && (DirectoryTemplate.EffectiveFieldValues.Any(fv => fv.Field.Id == ActiveDirectoryFields.Mail.Id) && !DirectoryTemplate.EffectiveFieldValues.First(fv => fv.Field.Id == ActiveDirectoryFields.Mail.Id).Value.IsNullOrEmpty())) @@ -187,7 +190,8 @@ await ParentTemplateChanged(null); diff --git a/BLAZAMGui/UI/Users/ChangeUserPasswordModalContent.razor b/BLAZAMGui/UI/Users/ChangeUserPasswordModalContent.razor index 29921135..510dc9fd 100644 --- a/BLAZAMGui/UI/Users/ChangeUserPasswordModalContent.razor +++ b/BLAZAMGui/UI/Users/ChangeUserPasswordModalContent.razor @@ -14,7 +14,10 @@ - @AppLocalization["Require change"] + @AppLocalization["Require change"] From bf55a38e988f0502e39761a8820b53dd4c8e1a98 Mon Sep 17 00:00:00 2001 From: Chris Jacobsen Date: Thu, 12 Sep 2024 21:46:13 -0400 Subject: [PATCH 06/18] Remove old code --- BLAZAM/BLAZAM.csproj | 2 +- .../Models/Templates/DirectoryTemplate.cs | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/BLAZAM/BLAZAM.csproj b/BLAZAM/BLAZAM.csproj index da48ed38..13d8cfc7 100644 --- a/BLAZAM/BLAZAM.csproj +++ b/BLAZAM/BLAZAM.csproj @@ -6,7 +6,7 @@ enable false 1.0.1 - 2024.08.31.2028 + 2024.09.13.0142 false BLAZAM False diff --git a/BLAZAMDatabase/Models/Templates/DirectoryTemplate.cs b/BLAZAMDatabase/Models/Templates/DirectoryTemplate.cs index 2cab05f3..a828b661 100644 --- a/BLAZAMDatabase/Models/Templates/DirectoryTemplate.cs +++ b/BLAZAMDatabase/Models/Templates/DirectoryTemplate.cs @@ -162,10 +162,6 @@ public bool? EffectiveAllowCustomGroups get { return GetEffectiveValue(t => t.AllowCustomGroups, t => t.EffectiveAllowCustomGroups); - if (AllowCustomGroups == null) - return ParentTemplate?.EffectiveAllowCustomGroups; - else - return AllowCustomGroups; } set => AllowCustomGroups = value; } @@ -178,11 +174,6 @@ public bool? EffectiveAskForAlternateEmail { return GetEffectiveValue(t => t.AskForAlternateEmail, t => t.EffectiveAskForAlternateEmail); - - if (AskForAlternateEmail == null) - return ParentTemplate?.EffectiveAskForAlternateEmail; - else - return AskForAlternateEmail; } set => AskForAlternateEmail = value; } @@ -195,11 +186,6 @@ public bool? EffectiveSendWelcomeEmail get { return GetEffectiveValue(t => t.SendWelcomeEmail, t => t.EffectiveSendWelcomeEmail); - - if (SendWelcomeEmail == null) - return ParentTemplate?.EffectiveSendWelcomeEmail; - else - return SendWelcomeEmail; } set => SendWelcomeEmail = value; } From 6cb7e633cca212f1e046bbdc8518e86a6a7b69d0 Mon Sep 17 00:00:00 2001 From: Chris Jacobsen Date: Sun, 15 Sep 2024 21:44:53 -0400 Subject: [PATCH 07/18] Start of ItemsPerPage parameter --- BLAZAM/BLAZAM.csproj | 2 +- .../MySqlDatabaseContextModelSnapshot.cs | 84 +++++++++---------- .../Sql/SqlDatabaseContextModelSnapshot.cs | 84 +++++++++---------- .../SqliteDatabaseContextModelSnapshot.cs | 84 +++++++++---------- .../Models/User/UserDashboardWidget.cs | 4 +- .../CurrentUserDashboardWidgets.razor | 3 +- .../Widgets/ChangedEntriesWidget.razor | 2 +- BLAZAMGui/UI/Dashboard/Widgets/Widget.razor | 1 + 8 files changed, 134 insertions(+), 130 deletions(-) diff --git a/BLAZAM/BLAZAM.csproj b/BLAZAM/BLAZAM.csproj index 13d8cfc7..0d8fe358 100644 --- a/BLAZAM/BLAZAM.csproj +++ b/BLAZAM/BLAZAM.csproj @@ -6,7 +6,7 @@ enable false 1.0.1 - 2024.09.13.0142 + 2024.09.16.0127 false BLAZAM False diff --git a/BLAZAMDatabase/Migrations/MySql/MySqlDatabaseContextModelSnapshot.cs b/BLAZAMDatabase/Migrations/MySql/MySqlDatabaseContextModelSnapshot.cs index 4233ea5f..8121bb1b 100644 --- a/BLAZAMDatabase/Migrations/MySql/MySqlDatabaseContextModelSnapshot.cs +++ b/BLAZAMDatabase/Migrations/MySql/MySqlDatabaseContextModelSnapshot.cs @@ -31,7 +31,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldMapId"); - b.ToTable("AccessLevelFieldAccessMapping"); + b.ToTable("AccessLevelFieldAccessMapping", (string)null); }); modelBuilder.Entity("AccessLevelObjectAccessMapping", b => @@ -46,7 +46,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectMapId"); - b.ToTable("AccessLevelObjectAccessMapping"); + b.ToTable("AccessLevelObjectAccessMapping", (string)null); }); modelBuilder.Entity("AccessLevelPermissionMapping", b => @@ -61,7 +61,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("PermissionMapsId"); - b.ToTable("AccessLevelPermissionMapping"); + b.ToTable("AccessLevelPermissionMapping", (string)null); }); modelBuilder.Entity("AppUserChatRoom", b => @@ -76,7 +76,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("MembersId"); - b.ToTable("AppUserChatRoom"); + b.ToTable("AppUserChatRoom", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.ADSettings", b => @@ -112,7 +112,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ActiveDirectorySettings", t => + b.ToTable("ActiveDirectorySettings", null, t => { t.HasCheckConstraint("CK_Table_Column", "Id = 1"); }); @@ -137,7 +137,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ActiveDirectoryFields"); + b.ToTable("ActiveDirectoryFields", (string)null); b.HasData( new @@ -420,7 +420,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("CustomActiveDirectoryFieldId"); - b.ToTable("ActiveDirectoryFieldObjectMappings"); + b.ToTable("ActiveDirectoryFieldObjectMappings", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.AppSettings", b => @@ -492,7 +492,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AppSettings", t => + b.ToTable("AppSettings", null, t => { t.HasCheckConstraint("CK_Table_Column", "Id = 1") .HasName("CK_Table_Column1"); @@ -534,7 +534,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("DirectoryEntryAuditLogs"); + b.ToTable("DirectoryEntryAuditLogs", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.LogonAuditLog", b => @@ -568,7 +568,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("LogonAuditLog"); + b.ToTable("LogonAuditLog", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.PermissionsAuditLog", b => @@ -602,7 +602,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("PermissionsAuditLog"); + b.ToTable("PermissionsAuditLog", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.RequestAuditLog", b => @@ -636,7 +636,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("RequestAuditLog"); + b.ToTable("RequestAuditLog", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.SettingsAuditLog", b => @@ -670,7 +670,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("SettingsAuditLog"); + b.ToTable("SettingsAuditLog", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.SystemAuditLog", b => @@ -704,7 +704,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("SystemAuditLog"); + b.ToTable("SystemAuditLog", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.AuthenticationSettings", b => @@ -736,7 +736,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AuthenticationSettings", t => + b.ToTable("AuthenticationSettings", null, t => { t.HasCheckConstraint("CK_Table_Column", "Id = 1") .HasName("CK_Table_Column2"); @@ -777,7 +777,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ChatRooms"); + b.ToTable("ChatRooms", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Chat.UnreadChatMessage", b => @@ -799,7 +799,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ChatMessageId"); - b.ToTable("UnreadChatMessages"); + b.ToTable("UnreadChatMessages", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.CustomActiveDirectoryField", b => @@ -824,7 +824,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("CustomActiveDirectoryFields"); + b.ToTable("CustomActiveDirectoryFields", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.EmailSettings", b => @@ -871,7 +871,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("EmailSettings", t => + b.ToTable("EmailSettings", null, t => { t.HasCheckConstraint("CK_Table_Column", "Id = 1") .HasName("CK_Table_Column3"); @@ -897,7 +897,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("EmailTemplates"); + b.ToTable("EmailTemplates", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Notifications.NotificationSubscription", b => @@ -929,7 +929,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("NotificationSubscriptions"); + b.ToTable("NotificationSubscriptions", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Notifications.SubscriptionNotificationType", b => @@ -948,7 +948,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("NotificationSubscriptionId"); - b.ToTable("SubscriptionNotificationType"); + b.ToTable("SubscriptionNotificationType", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.AccessLevel", b => @@ -966,7 +966,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AccessLevels"); + b.ToTable("AccessLevels", (string)null); b.HasData( new @@ -1000,7 +1000,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectActionId"); - b.ToTable("ActionAccessMapping"); + b.ToTable("ActionAccessMapping", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.FieldAccessLevel", b => @@ -1018,7 +1018,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("FieldAccessLevel"); + b.ToTable("FieldAccessLevel", (string)null); b.HasData( new @@ -1067,7 +1067,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldId"); - b.ToTable("AccessLevelFieldMapping"); + b.ToTable("AccessLevelFieldMapping", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessLevel", b => @@ -1085,7 +1085,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ObjectAccessLevel"); + b.ToTable("ObjectAccessLevel", (string)null); b.HasData( new @@ -1124,7 +1124,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectAccessLevelId"); - b.ToTable("AccessLevelObjectMapping"); + b.ToTable("AccessLevelObjectMapping", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAction", b => @@ -1142,7 +1142,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ObjectActionFlag"); + b.ToTable("ObjectActionFlag", (string)null); b.HasData( new @@ -1225,7 +1225,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("DelegateSid") .IsUnique(); - b.ToTable("PermissionDelegate"); + b.ToTable("PermissionDelegate", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.PermissionMapping", b => @@ -1243,7 +1243,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("PermissionMap"); + b.ToTable("PermissionMap", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplate", b => @@ -1302,7 +1302,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ParentTemplateId"); - b.ToTable("DirectoryTemplates"); + b.ToTable("DirectoryTemplates", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateFieldValue", b => @@ -1337,7 +1337,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldId"); - b.ToTable("DirectoryTemplateFieldValues"); + b.ToTable("DirectoryTemplateFieldValues", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateGroup", b => @@ -1357,7 +1357,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("DirectoryTemplateId"); - b.ToTable("DirectoryTemplateGroups"); + b.ToTable("DirectoryTemplateGroups", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.AppUser", b => @@ -1399,7 +1399,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserGUID") .IsUnique(); - b.ToTable("UserSettings"); + b.ToTable("UserSettings", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.NotificationMessage", b => @@ -1431,7 +1431,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("NotificationMessages"); + b.ToTable("NotificationMessages", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.ReadNewsItem", b => @@ -1453,7 +1453,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("ReadNewsItems"); + b.ToTable("ReadNewsItems", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserDashboardWidget", b => @@ -1479,7 +1479,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserDashboardWidgets"); + b.ToTable("UserDashboardWidgets", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserFavoriteEntry", b => @@ -1499,7 +1499,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserFavoriteEntries"); + b.ToTable("UserFavoriteEntries", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserNotification", b => @@ -1523,7 +1523,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserNotifications"); + b.ToTable("UserNotifications", (string)null); }); modelBuilder.Entity("BLAZAM.Server.Data.ChatMessage", b => @@ -1551,7 +1551,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("ChatMessages"); + b.ToTable("ChatMessages", (string)null); }); modelBuilder.Entity("PermissionDelegatePermissionMapping", b => @@ -1566,7 +1566,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("PermissionsMapsId"); - b.ToTable("PermissionDelegatePermissionMapping"); + b.ToTable("PermissionDelegatePermissionMapping", (string)null); }); modelBuilder.Entity("AccessLevelFieldAccessMapping", b => diff --git a/BLAZAMDatabase/Migrations/Sql/SqlDatabaseContextModelSnapshot.cs b/BLAZAMDatabase/Migrations/Sql/SqlDatabaseContextModelSnapshot.cs index bad44e4d..fb627c77 100644 --- a/BLAZAMDatabase/Migrations/Sql/SqlDatabaseContextModelSnapshot.cs +++ b/BLAZAMDatabase/Migrations/Sql/SqlDatabaseContextModelSnapshot.cs @@ -34,7 +34,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldMapId"); - b.ToTable("AccessLevelFieldAccessMapping"); + b.ToTable("AccessLevelFieldAccessMapping", (string)null); }); modelBuilder.Entity("AccessLevelObjectAccessMapping", b => @@ -49,7 +49,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectMapId"); - b.ToTable("AccessLevelObjectAccessMapping"); + b.ToTable("AccessLevelObjectAccessMapping", (string)null); }); modelBuilder.Entity("AccessLevelPermissionMapping", b => @@ -64,7 +64,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("PermissionMapsId"); - b.ToTable("AccessLevelPermissionMapping"); + b.ToTable("AccessLevelPermissionMapping", (string)null); }); modelBuilder.Entity("AppUserChatRoom", b => @@ -79,7 +79,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("MembersId"); - b.ToTable("AppUserChatRoom"); + b.ToTable("AppUserChatRoom", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.ADSettings", b => @@ -115,7 +115,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ActiveDirectorySettings", t => + b.ToTable("ActiveDirectorySettings", null, t => { t.HasCheckConstraint("CK_Table_Column", "[Id] = 1"); }); @@ -142,7 +142,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ActiveDirectoryFields"); + b.ToTable("ActiveDirectoryFields", (string)null); b.HasData( new @@ -427,7 +427,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("CustomActiveDirectoryFieldId"); - b.ToTable("ActiveDirectoryFieldObjectMappings"); + b.ToTable("ActiveDirectoryFieldObjectMappings", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.AppSettings", b => @@ -499,7 +499,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AppSettings", t => + b.ToTable("AppSettings", null, t => { t.HasCheckConstraint("CK_Table_Column", "[Id] = 1") .HasName("CK_Table_Column1"); @@ -543,7 +543,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("DirectoryEntryAuditLogs"); + b.ToTable("DirectoryEntryAuditLogs", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.LogonAuditLog", b => @@ -579,7 +579,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("LogonAuditLog"); + b.ToTable("LogonAuditLog", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.PermissionsAuditLog", b => @@ -615,7 +615,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("PermissionsAuditLog"); + b.ToTable("PermissionsAuditLog", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.RequestAuditLog", b => @@ -651,7 +651,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("RequestAuditLog"); + b.ToTable("RequestAuditLog", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.SettingsAuditLog", b => @@ -687,7 +687,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("SettingsAuditLog"); + b.ToTable("SettingsAuditLog", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.SystemAuditLog", b => @@ -723,7 +723,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("SystemAuditLog"); + b.ToTable("SystemAuditLog", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.AuthenticationSettings", b => @@ -755,7 +755,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AuthenticationSettings", t => + b.ToTable("AuthenticationSettings", null, t => { t.HasCheckConstraint("CK_Table_Column", "[Id] = 1") .HasName("CK_Table_Column2"); @@ -798,7 +798,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ChatRooms"); + b.ToTable("ChatRooms", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Chat.UnreadChatMessage", b => @@ -822,7 +822,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ChatMessageId"); - b.ToTable("UnreadChatMessages"); + b.ToTable("UnreadChatMessages", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.CustomActiveDirectoryField", b => @@ -849,7 +849,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("CustomActiveDirectoryFields"); + b.ToTable("CustomActiveDirectoryFields", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.EmailSettings", b => @@ -896,7 +896,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("EmailSettings", t => + b.ToTable("EmailSettings", null, t => { t.HasCheckConstraint("CK_Table_Column", "[Id] = 1") .HasName("CK_Table_Column3"); @@ -924,7 +924,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("EmailTemplates"); + b.ToTable("EmailTemplates", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Notifications.NotificationSubscription", b => @@ -958,7 +958,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("NotificationSubscriptions"); + b.ToTable("NotificationSubscriptions", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Notifications.SubscriptionNotificationType", b => @@ -979,7 +979,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("NotificationSubscriptionId"); - b.ToTable("SubscriptionNotificationType"); + b.ToTable("SubscriptionNotificationType", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.AccessLevel", b => @@ -999,7 +999,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AccessLevels"); + b.ToTable("AccessLevels", (string)null); b.HasData( new @@ -1035,7 +1035,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectActionId"); - b.ToTable("ActionAccessMapping"); + b.ToTable("ActionAccessMapping", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.FieldAccessLevel", b => @@ -1055,7 +1055,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("FieldAccessLevel"); + b.ToTable("FieldAccessLevel", (string)null); b.HasData( new @@ -1106,7 +1106,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldId"); - b.ToTable("AccessLevelFieldMapping"); + b.ToTable("AccessLevelFieldMapping", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessLevel", b => @@ -1126,7 +1126,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ObjectAccessLevel"); + b.ToTable("ObjectAccessLevel", (string)null); b.HasData( new @@ -1167,7 +1167,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectAccessLevelId"); - b.ToTable("AccessLevelObjectMapping"); + b.ToTable("AccessLevelObjectMapping", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAction", b => @@ -1187,7 +1187,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ObjectActionFlag"); + b.ToTable("ObjectActionFlag", (string)null); b.HasData( new @@ -1272,7 +1272,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("DelegateSid") .IsUnique(); - b.ToTable("PermissionDelegate"); + b.ToTable("PermissionDelegate", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.PermissionMapping", b => @@ -1292,7 +1292,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("PermissionMap"); + b.ToTable("PermissionMap", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplate", b => @@ -1353,7 +1353,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ParentTemplateId"); - b.ToTable("DirectoryTemplates"); + b.ToTable("DirectoryTemplates", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateFieldValue", b => @@ -1390,7 +1390,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldId"); - b.ToTable("DirectoryTemplateFieldValues"); + b.ToTable("DirectoryTemplateFieldValues", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateGroup", b => @@ -1412,7 +1412,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("DirectoryTemplateId"); - b.ToTable("DirectoryTemplateGroups"); + b.ToTable("DirectoryTemplateGroups", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.AppUser", b => @@ -1456,7 +1456,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserGUID") .IsUnique(); - b.ToTable("UserSettings"); + b.ToTable("UserSettings", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.NotificationMessage", b => @@ -1490,7 +1490,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("NotificationMessages"); + b.ToTable("NotificationMessages", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.ReadNewsItem", b => @@ -1514,7 +1514,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("ReadNewsItems"); + b.ToTable("ReadNewsItems", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserDashboardWidget", b => @@ -1542,7 +1542,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserDashboardWidgets"); + b.ToTable("UserDashboardWidgets", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserFavoriteEntry", b => @@ -1564,7 +1564,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserFavoriteEntries"); + b.ToTable("UserFavoriteEntries", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserNotification", b => @@ -1590,7 +1590,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserNotifications"); + b.ToTable("UserNotifications", (string)null); }); modelBuilder.Entity("BLAZAM.Server.Data.ChatMessage", b => @@ -1620,7 +1620,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("ChatMessages"); + b.ToTable("ChatMessages", (string)null); }); modelBuilder.Entity("PermissionDelegatePermissionMapping", b => @@ -1635,7 +1635,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("PermissionsMapsId"); - b.ToTable("PermissionDelegatePermissionMapping"); + b.ToTable("PermissionDelegatePermissionMapping", (string)null); }); modelBuilder.Entity("AccessLevelFieldAccessMapping", b => diff --git a/BLAZAMDatabase/Migrations/Sqlite/SqliteDatabaseContextModelSnapshot.cs b/BLAZAMDatabase/Migrations/Sqlite/SqliteDatabaseContextModelSnapshot.cs index 393f84de..865c8aea 100644 --- a/BLAZAMDatabase/Migrations/Sqlite/SqliteDatabaseContextModelSnapshot.cs +++ b/BLAZAMDatabase/Migrations/Sqlite/SqliteDatabaseContextModelSnapshot.cs @@ -29,7 +29,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldMapId"); - b.ToTable("AccessLevelFieldAccessMapping"); + b.ToTable("AccessLevelFieldAccessMapping", (string)null); }); modelBuilder.Entity("AccessLevelObjectAccessMapping", b => @@ -44,7 +44,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectMapId"); - b.ToTable("AccessLevelObjectAccessMapping"); + b.ToTable("AccessLevelObjectAccessMapping", (string)null); }); modelBuilder.Entity("AccessLevelPermissionMapping", b => @@ -59,7 +59,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("PermissionMapsId"); - b.ToTable("AccessLevelPermissionMapping"); + b.ToTable("AccessLevelPermissionMapping", (string)null); }); modelBuilder.Entity("AppUserChatRoom", b => @@ -74,7 +74,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("MembersId"); - b.ToTable("AppUserChatRoom"); + b.ToTable("AppUserChatRoom", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.ADSettings", b => @@ -110,7 +110,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ActiveDirectorySettings", t => + b.ToTable("ActiveDirectorySettings", null, t => { t.HasCheckConstraint("CK_Table_Column", "[Id] = 1"); }); @@ -135,7 +135,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ActiveDirectoryFields"); + b.ToTable("ActiveDirectoryFields", (string)null); b.HasData( new @@ -418,7 +418,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("CustomActiveDirectoryFieldId"); - b.ToTable("ActiveDirectoryFieldObjectMappings"); + b.ToTable("ActiveDirectoryFieldObjectMappings", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.AppSettings", b => @@ -490,7 +490,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AppSettings", t => + b.ToTable("AppSettings", null, t => { t.HasCheckConstraint("CK_Table_Column", "[Id] = 1"); }); @@ -531,7 +531,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("DirectoryEntryAuditLogs"); + b.ToTable("DirectoryEntryAuditLogs", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.LogonAuditLog", b => @@ -565,7 +565,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("LogonAuditLog"); + b.ToTable("LogonAuditLog", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.PermissionsAuditLog", b => @@ -599,7 +599,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("PermissionsAuditLog"); + b.ToTable("PermissionsAuditLog", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.RequestAuditLog", b => @@ -633,7 +633,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("RequestAuditLog"); + b.ToTable("RequestAuditLog", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.SettingsAuditLog", b => @@ -667,7 +667,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("SettingsAuditLog"); + b.ToTable("SettingsAuditLog", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.SystemAuditLog", b => @@ -701,7 +701,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("SystemAuditLog"); + b.ToTable("SystemAuditLog", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.AuthenticationSettings", b => @@ -733,7 +733,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AuthenticationSettings", t => + b.ToTable("AuthenticationSettings", null, t => { t.HasCheckConstraint("CK_Table_Column", "[Id] = 1"); }); @@ -773,7 +773,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ChatRooms"); + b.ToTable("ChatRooms", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Chat.UnreadChatMessage", b => @@ -795,7 +795,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ChatMessageId"); - b.ToTable("UnreadChatMessages"); + b.ToTable("UnreadChatMessages", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.CustomActiveDirectoryField", b => @@ -820,7 +820,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("CustomActiveDirectoryFields"); + b.ToTable("CustomActiveDirectoryFields", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.EmailSettings", b => @@ -867,7 +867,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("EmailSettings", t => + b.ToTable("EmailSettings", null, t => { t.HasCheckConstraint("CK_Table_Column", "[Id] = 1"); }); @@ -892,7 +892,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("EmailTemplates"); + b.ToTable("EmailTemplates", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Notifications.NotificationSubscription", b => @@ -924,7 +924,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("NotificationSubscriptions"); + b.ToTable("NotificationSubscriptions", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Notifications.SubscriptionNotificationType", b => @@ -943,7 +943,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("NotificationSubscriptionId"); - b.ToTable("SubscriptionNotificationType"); + b.ToTable("SubscriptionNotificationType", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.AccessLevel", b => @@ -961,7 +961,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AccessLevels"); + b.ToTable("AccessLevels", (string)null); b.HasData( new @@ -995,7 +995,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectActionId"); - b.ToTable("ActionAccessMapping"); + b.ToTable("ActionAccessMapping", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.FieldAccessLevel", b => @@ -1013,7 +1013,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("FieldAccessLevel"); + b.ToTable("FieldAccessLevel", (string)null); b.HasData( new @@ -1062,7 +1062,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldId"); - b.ToTable("AccessLevelFieldMapping"); + b.ToTable("AccessLevelFieldMapping", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessLevel", b => @@ -1080,7 +1080,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ObjectAccessLevel"); + b.ToTable("ObjectAccessLevel", (string)null); b.HasData( new @@ -1119,7 +1119,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectAccessLevelId"); - b.ToTable("AccessLevelObjectMapping"); + b.ToTable("AccessLevelObjectMapping", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAction", b => @@ -1137,7 +1137,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ObjectActionFlag"); + b.ToTable("ObjectActionFlag", (string)null); b.HasData( new @@ -1220,7 +1220,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("DelegateSid") .IsUnique(); - b.ToTable("PermissionDelegate"); + b.ToTable("PermissionDelegate", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.PermissionMapping", b => @@ -1238,7 +1238,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("PermissionMap"); + b.ToTable("PermissionMap", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplate", b => @@ -1297,7 +1297,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ParentTemplateId"); - b.ToTable("DirectoryTemplates"); + b.ToTable("DirectoryTemplates", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateFieldValue", b => @@ -1332,7 +1332,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldId"); - b.ToTable("DirectoryTemplateFieldValues"); + b.ToTable("DirectoryTemplateFieldValues", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateGroup", b => @@ -1352,7 +1352,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("DirectoryTemplateId"); - b.ToTable("DirectoryTemplateGroups"); + b.ToTable("DirectoryTemplateGroups", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.AppUser", b => @@ -1394,7 +1394,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserGUID") .IsUnique(); - b.ToTable("UserSettings"); + b.ToTable("UserSettings", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.NotificationMessage", b => @@ -1426,7 +1426,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("NotificationMessages"); + b.ToTable("NotificationMessages", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.ReadNewsItem", b => @@ -1448,7 +1448,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("ReadNewsItems"); + b.ToTable("ReadNewsItems", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserDashboardWidget", b => @@ -1474,7 +1474,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserDashboardWidgets"); + b.ToTable("UserDashboardWidgets", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserFavoriteEntry", b => @@ -1494,7 +1494,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserFavoriteEntries"); + b.ToTable("UserFavoriteEntries", (string)null); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserNotification", b => @@ -1518,7 +1518,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserNotifications"); + b.ToTable("UserNotifications", (string)null); }); modelBuilder.Entity("BLAZAM.Server.Data.ChatMessage", b => @@ -1546,7 +1546,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("ChatMessages"); + b.ToTable("ChatMessages", (string)null); }); modelBuilder.Entity("PermissionDelegatePermissionMapping", b => @@ -1561,7 +1561,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("PermissionsMapsId"); - b.ToTable("PermissionDelegatePermissionMapping"); + b.ToTable("PermissionDelegatePermissionMapping", (string)null); }); modelBuilder.Entity("AccessLevelFieldAccessMapping", b => diff --git a/BLAZAMDatabase/Models/User/UserDashboardWidget.cs b/BLAZAMDatabase/Models/User/UserDashboardWidget.cs index 7c9b8dcd..fa5d1834 100644 --- a/BLAZAMDatabase/Models/User/UserDashboardWidget.cs +++ b/BLAZAMDatabase/Models/User/UserDashboardWidget.cs @@ -1,6 +1,7 @@  -using System.ComponentModel.DataAnnotations.Schema; + +using System.ComponentModel; namespace BLAZAM.Database.Models.User { @@ -22,6 +23,7 @@ public class UserDashboardWidget : AppDbSetBase public DashboardWidgetType WidgetType { get; set; } public string Slot { get; set; } public int Order { get; set; } + public int ItemsPerPage { get; set; } = 5; public AppUser User { get; set; } public int UserId { get; set; } diff --git a/BLAZAMGui/UI/Dashboard/CurrentUserDashboardWidgets.razor b/BLAZAMGui/UI/Dashboard/CurrentUserDashboardWidgets.razor index 77105026..14a9c1cc 100644 --- a/BLAZAMGui/UI/Dashboard/CurrentUserDashboardWidgets.razor +++ b/BLAZAMGui/UI/Dashboard/CurrentUserDashboardWidgets.razor @@ -58,11 +58,12 @@ @widget.Title + s {await RemoveWidget(context);}) /> - + } } diff --git a/BLAZAMGui/UI/Dashboard/Widgets/ChangedEntriesWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/ChangedEntriesWidget.razor index a81dd60f..aaf355aa 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/ChangedEntriesWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/ChangedEntriesWidget.razor @@ -7,7 +7,7 @@ RowClass="cursor-pointer" Dense=true Filterable=true - RowsPerPage="5" + RowsPerPage="@ItemsPerPage" FilterMode="DataGridFilterMode.Simple" Loading=@LoadingData Square=true diff --git a/BLAZAMGui/UI/Dashboard/Widgets/Widget.razor b/BLAZAMGui/UI/Dashboard/Widgets/Widget.razor index 175da2ed..49922efd 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/Widget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/Widget.razor @@ -5,6 +5,7 @@ public RenderFragment? WidgetContent { get; set; } public string Title{ get; set; } public DashboardWidgetType WidgetType{ get; set; } + public int ItemsPerPage { get; set; } = 5; protected virtual void RowClicked(DataGridRowClickEventArgs args) { From 6ee7b6a2f989a19e5177035121da080a3fa460b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:51:49 +0000 Subject: [PATCH 08/18] Bump Microsoft.VisualStudio.Web.CodeGeneration.Design Bumps [Microsoft.VisualStudio.Web.CodeGeneration.Design](https://github.com/dotnet/Scaffolding) from 8.0.4 to 8.0.5. - [Release notes](https://github.com/dotnet/Scaffolding/releases) - [Commits](https://github.com/dotnet/Scaffolding/commits) --- updated-dependencies: - dependency-name: Microsoft.VisualStudio.Web.CodeGeneration.Design dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- BLAZAM/BLAZAM.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BLAZAM/BLAZAM.csproj b/BLAZAM/BLAZAM.csproj index 13d8cfc7..4362dcd6 100644 --- a/BLAZAM/BLAZAM.csproj +++ b/BLAZAM/BLAZAM.csproj @@ -73,7 +73,7 @@ - + From dd04711fa6462636196f1fd59ce9c2fc441d9b6d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:53:14 +0000 Subject: [PATCH 09/18] Bump Microsoft.Playwright.NUnit from 1.46.0 to 1.47.0 Bumps [Microsoft.Playwright.NUnit](https://github.com/microsoft/playwright-dotnet) from 1.46.0 to 1.47.0. - [Release notes](https://github.com/microsoft/playwright-dotnet/releases) - [Commits](https://github.com/microsoft/playwright-dotnet/compare/v1.46.0...v1.47.0) --- updated-dependencies: - dependency-name: Microsoft.Playwright.NUnit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- PlaywrightTests/PlaywrightTests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlaywrightTests/PlaywrightTests.csproj b/PlaywrightTests/PlaywrightTests.csproj index 55081225..75fe2bdc 100644 --- a/PlaywrightTests/PlaywrightTests.csproj +++ b/PlaywrightTests/PlaywrightTests.csproj @@ -17,7 +17,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + From 9502bd24a8758fbb7a41ec901a890aa820be5fc6 Mon Sep 17 00:00:00 2001 From: Chris Jacobsen Date: Mon, 16 Sep 2024 21:59:44 -0400 Subject: [PATCH 10/18] Persist Rows Per Page for Widgets --- BLAZAM/BLAZAM.csproj | 2 +- .../CurrentUserDashboardWidgets.razor | 17 ++++++++----- .../Widgets/ChangedEntriesWidget.razor | 3 ++- .../Widgets/ChangedPasswordsWidget.razor | 24 ++----------------- .../Widgets/DeletedEntriesWidget.razor | 3 ++- .../Dashboard/Widgets/FavoritesWidget.razor | 5 ++-- .../UI/Dashboard/Widgets/LockedOutUsers.razor | 5 ++-- .../Widgets/NewComputersWidget.razor | 7 +++++- .../Widgets/NewEntriesWidgetDataGrid.razor | 5 ++-- .../Dashboard/Widgets/NewGroupsWidget.razor | 7 +++++- .../UI/Dashboard/Widgets/NewOUsWidget.razor | 7 +++++- .../Dashboard/Widgets/NewPrintersWidget.razor | 7 +++++- .../UI/Dashboard/Widgets/NewUsersWidget.razor | 7 +++++- BLAZAMGui/UI/Dashboard/Widgets/Widget.razor | 7 ++++++ BLAZAMSession/ApplicationUserState.cs | 1 + 15 files changed, 65 insertions(+), 42 deletions(-) diff --git a/BLAZAM/BLAZAM.csproj b/BLAZAM/BLAZAM.csproj index 0d8fe358..756dad13 100644 --- a/BLAZAM/BLAZAM.csproj +++ b/BLAZAM/BLAZAM.csproj @@ -6,7 +6,7 @@ enable false 1.0.1 - 2024.09.16.0127 + 2024.09.17.0155 false BLAZAM False diff --git a/BLAZAMGui/UI/Dashboard/CurrentUserDashboardWidgets.razor b/BLAZAMGui/UI/Dashboard/CurrentUserDashboardWidgets.razor index 14a9c1cc..3638b6fa 100644 --- a/BLAZAMGui/UI/Dashboard/CurrentUserDashboardWidgets.razor +++ b/BLAZAMGui/UI/Dashboard/CurrentUserDashboardWidgets.razor @@ -42,11 +42,10 @@ @{ - Widget? widget =null; + Widget? widget = null; try { widget = allWidgets.First(w => w.WidgetType == context.WidgetType); - } catch { @@ -58,16 +57,22 @@ @widget.Title - s + @** **@ {await RemoveWidget(context);}) /> - + 5?context.ItemsPerPage:5}, + {"WidgetType",context.WidgetType} + })" + Type="@widget.GetType()" /> } } - + } @@ -85,7 +90,7 @@ } - + diff --git a/BLAZAMGui/UI/Dashboard/Widgets/ChangedEntriesWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/ChangedEntriesWidget.razor index aaf355aa..bfa419d0 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/ChangedEntriesWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/ChangedEntriesWidget.razor @@ -8,6 +8,7 @@ Dense=true Filterable=true RowsPerPage="@ItemsPerPage" + RowsPerPageChanged="@SetRowsPerPage" FilterMode="DataGridFilterMode.Simple" Loading=@LoadingData Square=true @@ -39,7 +40,7 @@ - + diff --git a/BLAZAMGui/UI/Dashboard/Widgets/ChangedPasswordsWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/ChangedPasswordsWidget.razor index 9d654d68..b5cbddac 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/ChangedPasswordsWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/ChangedPasswordsWidget.razor @@ -7,7 +7,8 @@ RowClass="cursor-pointer" Dense=true Filterable=true - RowsPerPage="5" + RowsPerPage="@ItemsPerPage" + RowsPerPageChanged="@SetRowsPerPage" FilterMode="DataGridFilterMode.Simple" Loading=@LoadingData Square=true @@ -39,27 +40,6 @@ -@*
- - -
- @foreach (var user in LockedUsers) - { - - - - - @user.DisplayName
- @user.SamAccountName
- @DirectoryTools.PrettifyOu(user.OU)
- - @user.PasswordLastSet
- -
- - } -
-
*@ @code { List LockedUsers = new(); diff --git a/BLAZAMGui/UI/Dashboard/Widgets/DeletedEntriesWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/DeletedEntriesWidget.razor index 4d97fe00..398fbc33 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/DeletedEntriesWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/DeletedEntriesWidget.razor @@ -7,7 +7,8 @@ RowClass="cursor-pointer" Dense=true Filterable=true - RowsPerPage="5" + RowsPerPage="@ItemsPerPage" + RowsPerPageChanged="@SetRowsPerPage" FilterMode="DataGridFilterMode.Simple" Loading=@LoadingData Square=true diff --git a/BLAZAMGui/UI/Dashboard/Widgets/FavoritesWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/FavoritesWidget.razor index 23a9ae7d..2df86f6b 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/FavoritesWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/FavoritesWidget.razor @@ -7,7 +7,8 @@ RowClass="cursor-pointer" Dense=true Filterable=true - RowsPerPage="5" + RowsPerPage="@ItemsPerPage" + RowsPerPageChanged="@SetRowsPerPage" FilterMode="DataGridFilterMode.Simple" Loading=@LoadingData Square=true @@ -38,7 +39,7 @@ - + diff --git a/BLAZAMGui/UI/Dashboard/Widgets/LockedOutUsers.razor b/BLAZAMGui/UI/Dashboard/Widgets/LockedOutUsers.razor index dac9fc1e..82475fdc 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/LockedOutUsers.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/LockedOutUsers.razor @@ -4,7 +4,8 @@ Items="@LockedUsers" Dense=true Filterable=true - RowsPerPage="5" + RowsPerPage="@ItemsPerPage" + RowsPerPageChanged="@SetRowsPerPage" FilterMode="DataGridFilterMode.Simple" Loading=@LoadingData Square=true @@ -51,7 +52,7 @@ - + diff --git a/BLAZAMGui/UI/Dashboard/Widgets/NewComputersWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/NewComputersWidget.razor index 4e9ec25e..e085cc54 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/NewComputersWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/NewComputersWidget.razor @@ -1,6 +1,11 @@ @inherits Widget @attribute [Authorize] - + @code { List NewComputers diff --git a/BLAZAMGui/UI/Dashboard/Widgets/NewEntriesWidgetDataGrid.razor b/BLAZAMGui/UI/Dashboard/Widgets/NewEntriesWidgetDataGrid.razor index bf23f6bc..65e51ce7 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/NewEntriesWidgetDataGrid.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/NewEntriesWidgetDataGrid.razor @@ -6,7 +6,7 @@ Items="@Items" Dense=true Filterable=true - RowsPerPage="5" + RowsPerPage="@RowsPerPage" FilterMode="DataGridFilterMode.Simple" Loading=@Loading Square=true @@ -14,6 +14,7 @@ Virtualize=true RowClass="cursor-pointer" RowClick=@RowClick + RowsPerPageChanged="@RowsPerPageChanged" Class="py-0" SortMode="SortMode.Single"> @@ -34,7 +35,7 @@ - + diff --git a/BLAZAMGui/UI/Dashboard/Widgets/NewGroupsWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/NewGroupsWidget.razor index ba7d7c78..fe146a83 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/NewGroupsWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/NewGroupsWidget.razor @@ -1,6 +1,11 @@ @inherits Widget @attribute [Authorize] - + @code { List NewGroups diff --git a/BLAZAMGui/UI/Dashboard/Widgets/NewOUsWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/NewOUsWidget.razor index 8f030018..4695ccf0 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/NewOUsWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/NewOUsWidget.razor @@ -1,6 +1,11 @@ @inherits Widget @attribute [Authorize] - + @code { List NewOUs diff --git a/BLAZAMGui/UI/Dashboard/Widgets/NewPrintersWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/NewPrintersWidget.razor index 1d562361..aa683fe9 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/NewPrintersWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/NewPrintersWidget.razor @@ -1,6 +1,11 @@ @inherits Widget @attribute [Authorize] - + @code { List NewPrinters diff --git a/BLAZAMGui/UI/Dashboard/Widgets/NewUsersWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/NewUsersWidget.razor index 3963c28b..851102f6 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/NewUsersWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/NewUsersWidget.razor @@ -1,6 +1,11 @@ @inherits Widget @attribute [Authorize] - + @code { List NewUsers diff --git a/BLAZAMGui/UI/Dashboard/Widgets/Widget.razor b/BLAZAMGui/UI/Dashboard/Widgets/Widget.razor index 49922efd..c9f1bec1 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/Widget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/Widget.razor @@ -4,7 +4,9 @@ [Parameter] public RenderFragment? WidgetContent { get; set; } public string Title{ get; set; } + [Parameter] public DashboardWidgetType WidgetType{ get; set; } + [Parameter] public int ItemsPerPage { get; set; } = 5; protected virtual void RowClicked(DataGridRowClickEventArgs args) @@ -18,4 +20,9 @@ { Nav.NavigateTo(args.SearchUri); } + protected async void SetRowsPerPage(int rowPerPage) + { + CurrentUser.State.Preferences.DashboardWidgets.FirstOrDefault(w=>w.WidgetType.Equals(WidgetType)).ItemsPerPage=rowPerPage; + CurrentUser.State.SaveUserSettings(); + } } diff --git a/BLAZAMSession/ApplicationUserState.cs b/BLAZAMSession/ApplicationUserState.cs index aa2fb0ea..6d5524a7 100644 --- a/BLAZAMSession/ApplicationUserState.cs +++ b/BLAZAMSession/ApplicationUserState.cs @@ -224,6 +224,7 @@ private void SaveDashboardWidgets(AppUser? dbUserSettings) { matchingWidget.Slot = widget.Slot; matchingWidget.Order = widget.Order; + matchingWidget.ItemsPerPage = widget.ItemsPerPage; } else { From 66e97467386c55f430e48e41eee2a668c87d3120 Mon Sep 17 00:00:00 2001 From: Chris Jacobsen Date: Mon, 16 Sep 2024 22:10:22 -0400 Subject: [PATCH 11/18] Add migration --- BLAZAM/BLAZAM.csproj | 2 +- ...2_Add_ItemsPerWidgetPage_MySql.Designer.cs | 1969 +++++++++++++++++ ...0917020532_Add_ItemsPerWidgetPage_MySql.cs | 624 ++++++ .../MySqlDatabaseContextModelSnapshot.cs | 158 +- ...513_Add_ItemsPerWidgetPage_Sql.Designer.cs | 1969 +++++++++++++++++ ...240917020513_Add_ItemsPerWidgetPage_Sql.cs | 29 + .../Sql/SqlDatabaseContextModelSnapshot.cs | 89 +- ..._Add_ItemsPerWidgetPage_Sqlite.Designer.cs | 1895 ++++++++++++++++ ...917020454_Add_ItemsPerWidgetPage_Sqlite.cs | 29 + .../SqliteDatabaseContextModelSnapshot.cs | 89 +- 10 files changed, 6723 insertions(+), 130 deletions(-) create mode 100644 BLAZAMDatabase/Migrations/MySql/20240917020532_Add_ItemsPerWidgetPage_MySql.Designer.cs create mode 100644 BLAZAMDatabase/Migrations/MySql/20240917020532_Add_ItemsPerWidgetPage_MySql.cs create mode 100644 BLAZAMDatabase/Migrations/Sql/20240917020513_Add_ItemsPerWidgetPage_Sql.Designer.cs create mode 100644 BLAZAMDatabase/Migrations/Sql/20240917020513_Add_ItemsPerWidgetPage_Sql.cs create mode 100644 BLAZAMDatabase/Migrations/Sqlite/20240917020454_Add_ItemsPerWidgetPage_Sqlite.Designer.cs create mode 100644 BLAZAMDatabase/Migrations/Sqlite/20240917020454_Add_ItemsPerWidgetPage_Sqlite.cs diff --git a/BLAZAM/BLAZAM.csproj b/BLAZAM/BLAZAM.csproj index 756dad13..6f09b172 100644 --- a/BLAZAM/BLAZAM.csproj +++ b/BLAZAM/BLAZAM.csproj @@ -6,7 +6,7 @@ enable false 1.0.1 - 2024.09.17.0155 + 2024.09.17.0207 false BLAZAM False diff --git a/BLAZAMDatabase/Migrations/MySql/20240917020532_Add_ItemsPerWidgetPage_MySql.Designer.cs b/BLAZAMDatabase/Migrations/MySql/20240917020532_Add_ItemsPerWidgetPage_MySql.Designer.cs new file mode 100644 index 00000000..456765ef --- /dev/null +++ b/BLAZAMDatabase/Migrations/MySql/20240917020532_Add_ItemsPerWidgetPage_MySql.Designer.cs @@ -0,0 +1,1969 @@ +// +using System; +using BLAZAM.Database.Context; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace BLAZAM.Database.Migrations.MySql +{ + [DbContext(typeof(MySqlDatabaseContext))] + [Migration("20240917020532_Add_ItemsPerWidgetPage_MySql")] + partial class Add_ItemsPerWidgetPage_MySql + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.8") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("AccessLevelFieldAccessMapping", b => + { + b.Property("AccessLevelsId") + .HasColumnType("int"); + + b.Property("FieldMapId") + .HasColumnType("int"); + + b.HasKey("AccessLevelsId", "FieldMapId"); + + b.HasIndex("FieldMapId"); + + b.ToTable("AccessLevelFieldAccessMapping"); + }); + + modelBuilder.Entity("AccessLevelObjectAccessMapping", b => + { + b.Property("AccessLevelsId") + .HasColumnType("int"); + + b.Property("ObjectMapId") + .HasColumnType("int"); + + b.HasKey("AccessLevelsId", "ObjectMapId"); + + b.HasIndex("ObjectMapId"); + + b.ToTable("AccessLevelObjectAccessMapping"); + }); + + modelBuilder.Entity("AccessLevelPermissionMapping", b => + { + b.Property("AccessLevelsId") + .HasColumnType("int"); + + b.Property("PermissionMapsId") + .HasColumnType("int"); + + b.HasKey("AccessLevelsId", "PermissionMapsId"); + + b.HasIndex("PermissionMapsId"); + + b.ToTable("AccessLevelPermissionMapping"); + }); + + modelBuilder.Entity("AppUserChatRoom", b => + { + b.Property("ChatRoomId") + .HasColumnType("int"); + + b.Property("MembersId") + .HasColumnType("int"); + + b.HasKey("ChatRoomId", "MembersId"); + + b.HasIndex("MembersId"); + + b.ToTable("AppUserChatRoom"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.ADSettings", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("ApplicationBaseDN") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("FQDN") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Password") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ServerAddress") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ServerPort") + .HasColumnType("int"); + + b.Property("UseTLS") + .HasColumnType("tinyint(1)"); + + b.Property("Username") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("ActiveDirectorySettings", t => + { + t.HasCheckConstraint("CK_Table_Column", "Id = 1"); + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.ActiveDirectoryField", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("FieldName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("FieldType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("ActiveDirectoryFields"); + + b.HasData( + new + { + Id = 1, + DisplayName = "Last Name", + FieldName = "sn", + FieldType = 0 + }, + new + { + Id = 2, + DisplayName = "First Name", + FieldName = "givenname", + FieldType = 0 + }, + new + { + Id = 3, + DisplayName = "Office", + FieldName = "physicalDeliveryOfficeName", + FieldType = 0 + }, + new + { + Id = 4, + DisplayName = "Employee ID", + FieldName = "employeeId", + FieldType = 0 + }, + new + { + Id = 5, + DisplayName = "Home Directory", + FieldName = "homeDirectory", + FieldType = 0 + }, + new + { + Id = 6, + DisplayName = "Logon Script Path", + FieldName = "scriptPath", + FieldType = 0 + }, + new + { + Id = 7, + DisplayName = "Profile Path", + FieldName = "profilePath", + FieldType = 0 + }, + new + { + Id = 8, + DisplayName = "Home Phone Number", + FieldName = "homePhone", + FieldType = 0 + }, + new + { + Id = 9, + DisplayName = "Street Address", + FieldName = "streetAddress", + FieldType = 0 + }, + new + { + Id = 10, + DisplayName = "City", + FieldName = "l", + FieldType = 0 + }, + new + { + Id = 11, + DisplayName = "State", + FieldName = "st", + FieldType = 0 + }, + new + { + Id = 12, + DisplayName = "Zip Code", + FieldName = "postalCode", + FieldType = 0 + }, + new + { + Id = 13, + DisplayName = "Site", + FieldName = "site", + FieldType = 0 + }, + new + { + Id = 14, + DisplayName = "Name", + FieldName = "name", + FieldType = 0 + }, + new + { + Id = 15, + DisplayName = "Username", + FieldName = "samaccountname", + FieldType = 0 + }, + new + { + Id = 16, + DisplayName = "SID", + FieldName = "objectSID", + FieldType = 2 + }, + new + { + Id = 17, + DisplayName = "E-Mail Address", + FieldName = "mail", + FieldType = 0 + }, + new + { + Id = 18, + DisplayName = "Description", + FieldName = "description", + FieldType = 0 + }, + new + { + Id = 19, + DisplayName = "Display Name", + FieldName = "displayName", + FieldType = 0 + }, + new + { + Id = 20, + DisplayName = "Distinguished Name", + FieldName = "distinguishedName", + FieldType = 0 + }, + new + { + Id = 21, + DisplayName = "Member Of", + FieldName = "memberOf", + FieldType = 4 + }, + new + { + Id = 22, + DisplayName = "Company", + FieldName = "company", + FieldType = 0 + }, + new + { + Id = 23, + DisplayName = "Title", + FieldName = "title", + FieldType = 0 + }, + new + { + Id = 24, + DisplayName = "User Principal Name", + FieldName = "userPrincipalName", + FieldType = 0 + }, + new + { + Id = 25, + DisplayName = "Telephone Number", + FieldName = "telephoneNumber", + FieldType = 0 + }, + new + { + Id = 26, + DisplayName = "PO Box", + FieldName = "postOfficeBox", + FieldType = 0 + }, + new + { + Id = 27, + DisplayName = "Canonical Name", + FieldName = "cn", + FieldType = 0 + }, + new + { + Id = 28, + DisplayName = "Home Drive", + FieldName = "homeDrive", + FieldType = 3 + }, + new + { + Id = 29, + DisplayName = "Department", + FieldName = "department", + FieldType = 0 + }, + new + { + Id = 30, + DisplayName = "Middle Name", + FieldName = "middleName", + FieldType = 0 + }, + new + { + Id = 31, + DisplayName = "Pager", + FieldName = "pager", + FieldType = 0 + }, + new + { + Id = 32, + DisplayName = "OS", + FieldName = "operatingSystemVersion", + FieldType = 0 + }, + new + { + Id = 33, + DisplayName = "Account Expiration", + FieldName = "accountExpires", + FieldType = 1 + }, + new + { + Id = 34, + DisplayName = "Manager", + FieldName = "manager", + FieldType = 0 + }, + new + { + Id = 35, + DisplayName = "Photo", + FieldName = "thumbnail", + FieldType = 2 + }, + new + { + Id = 36, + DisplayName = "Log On To", + FieldName = "userWorkstations", + FieldType = 0 + }, + new + { + Id = 37, + DisplayName = "Logon Hours", + FieldName = "logonHours", + FieldType = 2 + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.ActiveDirectoryFieldObjectType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ActiveDirectoryFieldId") + .HasColumnType("int"); + + b.Property("CustomActiveDirectoryFieldId") + .HasColumnType("int"); + + b.Property("ObjectType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CustomActiveDirectoryFieldId"); + + b.ToTable("ActiveDirectoryFieldObjectMappings"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.AppSettings", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("AnalyticsId") + .HasColumnType("longtext"); + + b.Property("AppFQDN") + .HasColumnType("longtext"); + + b.Property("AppIcon") + .HasColumnType("longblob"); + + b.Property("AppName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("AutoUpdate") + .HasColumnType("tinyint(1)"); + + b.Property("AutoUpdateTime") + .HasColumnType("time(6)"); + + b.Property("ForceHTTPS") + .HasColumnType("tinyint(1)"); + + b.Property("InstallationCompleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastUpdateCheck") + .HasColumnType("datetime(6)"); + + b.Property("MOTD") + .HasColumnType("longtext"); + + b.Property("MyrtilleURL") + .HasColumnType("longtext"); + + b.Property("SSLCertificateCipher") + .HasColumnType("longtext"); + + b.Property("SendDeveloperAnalytics") + .HasColumnType("tinyint(1)"); + + b.Property("SendLogsToDeveloper") + .HasColumnType("tinyint(1)"); + + b.Property("UpdateBranch") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("UpdateDomain") + .HasColumnType("longtext"); + + b.Property("UpdatePassword") + .HasColumnType("longtext"); + + b.Property("UpdateUsername") + .HasColumnType("longtext"); + + b.Property("UseUpdateCredentials") + .HasColumnType("tinyint(1)"); + + b.Property("UserHelpdeskURL") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AppSettings", t => + { + t.HasCheckConstraint("CK_Table_Column", "Id = 1") + .HasName("CK_Table_Column1"); + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.DirectoryEntryAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Action") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("AfterAction") + .HasColumnType("longtext"); + + b.Property("BeforeAction") + .HasColumnType("longtext"); + + b.Property("IpAddress") + .HasColumnType("longtext"); + + b.Property("Sid") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Target") + .HasColumnType("longtext"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("Username") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("DirectoryEntryAuditLogs"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.LogonAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Action") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("AfterAction") + .HasColumnType("longtext"); + + b.Property("BeforeAction") + .HasColumnType("longtext"); + + b.Property("IpAddress") + .HasColumnType("longtext"); + + b.Property("Target") + .HasColumnType("longtext"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("Username") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("LogonAuditLog"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.PermissionsAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Action") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("AfterAction") + .HasColumnType("longtext"); + + b.Property("BeforeAction") + .HasColumnType("longtext"); + + b.Property("IpAddress") + .HasColumnType("longtext"); + + b.Property("Target") + .HasColumnType("longtext"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("Username") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("PermissionsAuditLog"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.RequestAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Action") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("AfterAction") + .HasColumnType("longtext"); + + b.Property("BeforeAction") + .HasColumnType("longtext"); + + b.Property("IpAddress") + .HasColumnType("longtext"); + + b.Property("Target") + .HasColumnType("longtext"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("Username") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("RequestAuditLog"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.SettingsAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Action") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("AfterAction") + .HasColumnType("longtext"); + + b.Property("BeforeAction") + .HasColumnType("longtext"); + + b.Property("IpAddress") + .HasColumnType("longtext"); + + b.Property("Target") + .HasColumnType("longtext"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("Username") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("SettingsAuditLog"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.SystemAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Action") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("AfterAction") + .HasColumnType("longtext"); + + b.Property("BeforeAction") + .HasColumnType("longtext"); + + b.Property("IpAddress") + .HasColumnType("longtext"); + + b.Property("Target") + .HasColumnType("longtext"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("Username") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("SystemAuditLog"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.AuthenticationSettings", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("AdminPassword") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("DuoApiHost") + .HasColumnType("longtext"); + + b.Property("DuoClientId") + .HasColumnType("longtext"); + + b.Property("DuoClientSecret") + .HasColumnType("longtext"); + + b.Property("DuoEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("DuoUnreachableBehavior") + .HasColumnType("int"); + + b.Property("SessionTimeout") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AuthenticationSettings", t => + { + t.HasCheckConstraint("CK_Table_Column", "Id = 1") + .HasName("CK_Table_Column2"); + }); + + b.HasData( + new + { + Id = 1, + AdminPassword = "password", + DuoEnabled = false, + DuoUnreachableBehavior = 0, + SessionTimeout = 15 + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Chat.ChatRoom", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("DeletedAt") + .HasColumnType("datetime(6)"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)"); + + b.Property("MembersHash") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("ChatRooms"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Chat.UnreadChatMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ChatMessageId") + .HasColumnType("int"); + + b.Property("ChatRoomId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ChatMessageId"); + + b.ToTable("UnreadChatMessages"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.CustomActiveDirectoryField", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("DeletedAt") + .HasColumnType("datetime(6)"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("FieldName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("FieldType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("CustomActiveDirectoryFields"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.EmailSettings", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("AdminBcc") + .HasColumnType("longtext"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("FromAddress") + .HasColumnType("longtext"); + + b.Property("FromName") + .HasColumnType("longtext"); + + b.Property("ReplyToAddress") + .HasColumnType("longtext"); + + b.Property("ReplyToName") + .HasColumnType("longtext"); + + b.Property("SMTPPassword") + .HasColumnType("longtext"); + + b.Property("SMTPPort") + .HasColumnType("int"); + + b.Property("SMTPServer") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("SMTPUsername") + .HasColumnType("longtext"); + + b.Property("UseSMTPAuth") + .HasColumnType("tinyint(1)"); + + b.Property("UseTLS") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("EmailSettings", t => + { + t.HasCheckConstraint("CK_Table_Column", "Id = 1") + .HasName("CK_Table_Column3"); + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.EmailTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Body") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Subject") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TemplateType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("EmailTemplates"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Notifications.NotificationSubscription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Block") + .HasColumnType("tinyint(1)"); + + b.Property("ByEmail") + .HasColumnType("tinyint(1)"); + + b.Property("DeletedAt") + .HasColumnType("datetime(6)"); + + b.Property("InApp") + .HasColumnType("tinyint(1)"); + + b.Property("OU") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("NotificationSubscriptions"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Notifications.SubscriptionNotificationType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("NotificationSubscriptionId") + .HasColumnType("int"); + + b.Property("NotificationType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("NotificationSubscriptionId"); + + b.ToTable("SubscriptionNotificationType"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.AccessLevel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("DeletedAt") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("AccessLevels"); + + b.HasData( + new + { + Id = 1, + Name = "Deny All" + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ActionAccessMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AccessLevelId") + .HasColumnType("int"); + + b.Property("AllowOrDeny") + .HasColumnType("tinyint(1)"); + + b.Property("ObjectActionId") + .HasColumnType("int"); + + b.Property("ObjectType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AccessLevelId"); + + b.HasIndex("ObjectActionId"); + + b.ToTable("ActionAccessMapping"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.FieldAccessLevel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("FieldAccessLevel"); + + b.HasData( + new + { + Id = 1, + Level = 10, + Name = "Deny" + }, + new + { + Id = 2, + Level = 100, + Name = "Read" + }, + new + { + Id = 3, + Level = 1000, + Name = "Edit" + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.FieldAccessMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CustomFieldId") + .HasColumnType("int"); + + b.Property("FieldAccessLevelId") + .HasColumnType("int"); + + b.Property("FieldId") + .HasColumnType("int"); + + b.Property("ObjectType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CustomFieldId"); + + b.HasIndex("FieldAccessLevelId"); + + b.HasIndex("FieldId"); + + b.ToTable("AccessLevelFieldMapping"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessLevel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("ObjectAccessLevel"); + + b.HasData( + new + { + Id = 1, + Level = 10, + Name = "Deny" + }, + new + { + Id = 2, + Level = 1000, + Name = "Read" + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AllowDisabled") + .HasColumnType("tinyint(1)"); + + b.Property("DeletedAt") + .HasColumnType("datetime(6)"); + + b.Property("ObjectAccessLevelId") + .HasColumnType("int"); + + b.Property("ObjectType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ObjectAccessLevelId"); + + b.ToTable("AccessLevelObjectMapping"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Action") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("ObjectActionFlag"); + + b.HasData( + new + { + Id = 1, + Action = 4, + Name = "Assign" + }, + new + { + Id = 2, + Action = 3, + Name = "UnAssign" + }, + new + { + Id = 3, + Action = 8, + Name = "Unlock" + }, + new + { + Id = 4, + Action = 5, + Name = "Enable" + }, + new + { + Id = 5, + Action = 6, + Name = "Disable" + }, + new + { + Id = 6, + Action = 7, + Name = "Rename" + }, + new + { + Id = 7, + Action = 0, + Name = "Move" + }, + new + { + Id = 8, + Action = 2, + Name = "Create" + }, + new + { + Id = 9, + Action = 1, + Name = "Delete" + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.PermissionDelegate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("DelegateName") + .HasColumnType("longtext"); + + b.Property("DelegateSid") + .IsRequired() + .HasColumnType("varbinary(3072)"); + + b.Property("DeletedAt") + .HasColumnType("datetime(6)"); + + b.Property("IsSuperAdmin") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("DelegateSid") + .IsUnique(); + + b.ToTable("PermissionDelegate"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.PermissionMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("DeletedAt") + .HasColumnType("datetime(6)"); + + b.Property("OU") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("PermissionMap"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AllowCustomGroups") + .HasColumnType("tinyint(1)"); + + b.Property("AskForAlternateEmail") + .HasColumnType("tinyint(1)"); + + b.Property("Category") + .HasColumnType("longtext"); + + b.Property("DeletedAt") + .HasColumnType("datetime(6)"); + + b.Property("DisplayNameFormula") + .HasColumnType("longtext"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("ObjectType") + .HasColumnType("int"); + + b.Property("ParentOU") + .HasColumnType("longtext"); + + b.Property("ParentTemplateId") + .HasColumnType("int"); + + b.Property("PasswordFormula") + .HasColumnType("longtext"); + + b.Property("RequirePasswordChange") + .HasColumnType("tinyint(1)"); + + b.Property("SendWelcomeEmail") + .HasColumnType("tinyint(1)"); + + b.Property("UsernameFormula") + .HasColumnType("longtext"); + + b.Property("Visible") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.HasIndex("ParentTemplateId"); + + b.ToTable("DirectoryTemplates"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateFieldValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CustomFieldId") + .HasColumnType("int"); + + b.Property("DirectoryTemplateId") + .HasColumnType("int"); + + b.Property("Editable") + .HasColumnType("tinyint(1)"); + + b.Property("FieldId") + .HasColumnType("int"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("CustomFieldId"); + + b.HasIndex("DirectoryTemplateId"); + + b.HasIndex("FieldId"); + + b.ToTable("DirectoryTemplateFieldValues"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("DirectoryTemplateId") + .HasColumnType("int"); + + b.Property("GroupSid") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("DirectoryTemplateId"); + + b.ToTable("DirectoryTemplateGroups"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.AppUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("APIToken") + .HasColumnType("longtext"); + + b.Property("DarkMode") + .HasColumnType("tinyint(1)"); + + b.Property("Email") + .HasColumnType("longtext"); + + b.Property("ProfilePicture") + .HasColumnType("longblob"); + + b.Property("SearchDisabledComputers") + .HasColumnType("tinyint(1)"); + + b.Property("SearchDisabledUsers") + .HasColumnType("tinyint(1)"); + + b.Property("Theme") + .HasColumnType("longtext"); + + b.Property("UserGUID") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.Property("Username") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("UserGUID") + .IsUnique(); + + b.ToTable("UserSettings"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.NotificationMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Created") + .HasColumnType("datetime(6)"); + + b.Property("Dismissable") + .HasColumnType("tinyint(1)"); + + b.Property("Expires") + .HasColumnType("datetime(6)"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Link") + .HasColumnType("longtext"); + + b.Property("Message") + .HasColumnType("longtext"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("NotificationMessages"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.ReadNewsItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("NewsItemId") + .HasColumnType("double"); + + b.Property("NewsItemUpdatedAt") + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("ReadNewsItems"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserDashboardWidget", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ItemsPerPage") + .HasColumnType("int"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("Slot") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("UserId") + .HasColumnType("int"); + + b.Property("WidgetType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserDashboardWidgets"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserFavoriteEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("DN") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserFavoriteEntries"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserNotification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("IsRead") + .HasColumnType("tinyint(1)"); + + b.Property("NotificationId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("NotificationId"); + + b.HasIndex("UserId"); + + b.ToTable("UserNotifications"); + }); + + modelBuilder.Entity("BLAZAM.Server.Data.ChatMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ChatRoomId") + .HasColumnType("int"); + + b.Property("Message") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ChatRoomId"); + + b.HasIndex("UserId"); + + b.ToTable("ChatMessages"); + }); + + modelBuilder.Entity("PermissionDelegatePermissionMapping", b => + { + b.Property("PermissionDelegatesId") + .HasColumnType("int"); + + b.Property("PermissionsMapsId") + .HasColumnType("int"); + + b.HasKey("PermissionDelegatesId", "PermissionsMapsId"); + + b.HasIndex("PermissionsMapsId"); + + b.ToTable("PermissionDelegatePermissionMapping"); + }); + + modelBuilder.Entity("AccessLevelFieldAccessMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.AccessLevel", null) + .WithMany() + .HasForeignKey("AccessLevelsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.Permissions.FieldAccessMapping", null) + .WithMany() + .HasForeignKey("FieldMapId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AccessLevelObjectAccessMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.AccessLevel", null) + .WithMany() + .HasForeignKey("AccessLevelsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.Permissions.ObjectAccessMapping", null) + .WithMany() + .HasForeignKey("ObjectMapId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AccessLevelPermissionMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.AccessLevel", null) + .WithMany() + .HasForeignKey("AccessLevelsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.Permissions.PermissionMapping", null) + .WithMany() + .HasForeignKey("PermissionMapsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AppUserChatRoom", b => + { + b.HasOne("BLAZAM.Database.Models.Chat.ChatRoom", null) + .WithMany() + .HasForeignKey("ChatRoomId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.User.AppUser", null) + .WithMany() + .HasForeignKey("MembersId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.ActiveDirectoryFieldObjectType", b => + { + b.HasOne("BLAZAM.Database.Models.CustomActiveDirectoryField", null) + .WithMany("ObjectTypes") + .HasForeignKey("CustomActiveDirectoryFieldId"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Chat.UnreadChatMessage", b => + { + b.HasOne("BLAZAM.Server.Data.ChatMessage", "ChatMessage") + .WithMany("NotReadBy") + .HasForeignKey("ChatMessageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ChatMessage"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Notifications.NotificationSubscription", b => + { + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany("NotificationSubscriptions") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Notifications.SubscriptionNotificationType", b => + { + b.HasOne("BLAZAM.Database.Models.Notifications.NotificationSubscription", "NotificationSubscription") + .WithMany("NotificationTypes") + .HasForeignKey("NotificationSubscriptionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NotificationSubscription"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ActionAccessMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.AccessLevel", null) + .WithMany("ActionMap") + .HasForeignKey("AccessLevelId"); + + b.HasOne("BLAZAM.Database.Models.Permissions.ObjectAction", "ObjectAction") + .WithMany() + .HasForeignKey("ObjectActionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ObjectAction"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.FieldAccessMapping", b => + { + b.HasOne("BLAZAM.Database.Models.CustomActiveDirectoryField", "CustomField") + .WithMany() + .HasForeignKey("CustomFieldId"); + + b.HasOne("BLAZAM.Database.Models.Permissions.FieldAccessLevel", "FieldAccessLevel") + .WithMany() + .HasForeignKey("FieldAccessLevelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.ActiveDirectoryField", "Field") + .WithMany() + .HasForeignKey("FieldId"); + + b.Navigation("CustomField"); + + b.Navigation("Field"); + + b.Navigation("FieldAccessLevel"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.ObjectAccessLevel", "ObjectAccessLevel") + .WithMany("ObjectAccessMappings") + .HasForeignKey("ObjectAccessLevelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ObjectAccessLevel"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplate", b => + { + b.HasOne("BLAZAM.Database.Models.Templates.DirectoryTemplate", "ParentTemplate") + .WithMany() + .HasForeignKey("ParentTemplateId"); + + b.Navigation("ParentTemplate"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateFieldValue", b => + { + b.HasOne("BLAZAM.Database.Models.CustomActiveDirectoryField", "CustomField") + .WithMany() + .HasForeignKey("CustomFieldId"); + + b.HasOne("BLAZAM.Database.Models.Templates.DirectoryTemplate", null) + .WithMany("FieldValues") + .HasForeignKey("DirectoryTemplateId"); + + b.HasOne("BLAZAM.Database.Models.ActiveDirectoryField", "Field") + .WithMany() + .HasForeignKey("FieldId"); + + b.Navigation("CustomField"); + + b.Navigation("Field"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateGroup", b => + { + b.HasOne("BLAZAM.Database.Models.Templates.DirectoryTemplate", null) + .WithMany("AssignedGroupSids") + .HasForeignKey("DirectoryTemplateId"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.ReadNewsItem", b => + { + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany("ReadNewsItems") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserDashboardWidget", b => + { + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany("DashboardWidgets") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserFavoriteEntry", b => + { + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany("FavoriteEntries") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserNotification", b => + { + b.HasOne("BLAZAM.Database.Models.User.NotificationMessage", "Notification") + .WithMany() + .HasForeignKey("NotificationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany("Messages") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Notification"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BLAZAM.Server.Data.ChatMessage", b => + { + b.HasOne("BLAZAM.Database.Models.Chat.ChatRoom", "ChatRoom") + .WithMany("Messages") + .HasForeignKey("ChatRoomId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ChatRoom"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("PermissionDelegatePermissionMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.PermissionDelegate", null) + .WithMany() + .HasForeignKey("PermissionDelegatesId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.Permissions.PermissionMapping", null) + .WithMany() + .HasForeignKey("PermissionsMapsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Chat.ChatRoom", b => + { + b.Navigation("Messages"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.CustomActiveDirectoryField", b => + { + b.Navigation("ObjectTypes"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Notifications.NotificationSubscription", b => + { + b.Navigation("NotificationTypes"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.AccessLevel", b => + { + b.Navigation("ActionMap"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessLevel", b => + { + b.Navigation("ObjectAccessMappings"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplate", b => + { + b.Navigation("AssignedGroupSids"); + + b.Navigation("FieldValues"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.AppUser", b => + { + b.Navigation("DashboardWidgets"); + + b.Navigation("FavoriteEntries"); + + b.Navigation("Messages"); + + b.Navigation("NotificationSubscriptions"); + + b.Navigation("ReadNewsItems"); + }); + + modelBuilder.Entity("BLAZAM.Server.Data.ChatMessage", b => + { + b.Navigation("NotReadBy"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/BLAZAMDatabase/Migrations/MySql/20240917020532_Add_ItemsPerWidgetPage_MySql.cs b/BLAZAMDatabase/Migrations/MySql/20240917020532_Add_ItemsPerWidgetPage_MySql.cs new file mode 100644 index 00000000..0e6fe1a1 --- /dev/null +++ b/BLAZAMDatabase/Migrations/MySql/20240917020532_Add_ItemsPerWidgetPage_MySql.cs @@ -0,0 +1,624 @@ +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BLAZAM.Database.Migrations.MySql +{ + /// + public partial class Add_ItemsPerWidgetPage_MySql : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Id", + table: "UserSettings", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "UserNotifications", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "UserFavoriteEntries", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "UserDashboardWidgets", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AddColumn( + name: "ItemsPerPage", + table: "UserDashboardWidgets", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AlterColumn( + name: "Id", + table: "UnreadChatMessages", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "SystemAuditLog", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "SubscriptionNotificationType", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "SettingsAuditLog", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "RequestAuditLog", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "ReadNewsItems", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "PermissionsAuditLog", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "PermissionMap", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "PermissionDelegate", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "ObjectActionFlag", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "ObjectAccessLevel", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "NotificationSubscriptions", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "NotificationMessages", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "LogonAuditLog", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "FieldAccessLevel", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "EmailTemplates", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "DirectoryTemplates", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "DirectoryTemplateGroups", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "DirectoryTemplateFieldValues", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "DirectoryEntryAuditLogs", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "CustomActiveDirectoryFields", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "ChatRooms", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "ChatMessages", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "ActiveDirectoryFields", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "ActiveDirectoryFieldObjectMappings", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "ActionAccessMapping", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AccessLevels", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AccessLevelObjectMapping", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AccessLevelFieldMapping", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ItemsPerPage", + table: "UserDashboardWidgets"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "UserSettings", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "UserNotifications", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "UserFavoriteEntries", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "UserDashboardWidgets", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "UnreadChatMessages", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "SystemAuditLog", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "SubscriptionNotificationType", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "SettingsAuditLog", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "RequestAuditLog", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "ReadNewsItems", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "PermissionsAuditLog", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "PermissionMap", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "PermissionDelegate", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "ObjectActionFlag", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "ObjectAccessLevel", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "NotificationSubscriptions", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "NotificationMessages", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "LogonAuditLog", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "FieldAccessLevel", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "EmailTemplates", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "DirectoryTemplates", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "DirectoryTemplateGroups", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "DirectoryTemplateFieldValues", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "DirectoryEntryAuditLogs", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "CustomActiveDirectoryFields", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "ChatRooms", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "ChatMessages", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "ActiveDirectoryFields", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "ActiveDirectoryFieldObjectMappings", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "ActionAccessMapping", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AccessLevels", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AccessLevelObjectMapping", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AccessLevelFieldMapping", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + } + } +} diff --git a/BLAZAMDatabase/Migrations/MySql/MySqlDatabaseContextModelSnapshot.cs b/BLAZAMDatabase/Migrations/MySql/MySqlDatabaseContextModelSnapshot.cs index 8121bb1b..880a3843 100644 --- a/BLAZAMDatabase/Migrations/MySql/MySqlDatabaseContextModelSnapshot.cs +++ b/BLAZAMDatabase/Migrations/MySql/MySqlDatabaseContextModelSnapshot.cs @@ -3,6 +3,7 @@ using BLAZAM.Database.Context; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable @@ -16,9 +17,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "7.0.20") + .HasAnnotation("ProductVersion", "8.0.8") .HasAnnotation("Relational:MaxIdentifierLength", 64); + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + modelBuilder.Entity("AccessLevelFieldAccessMapping", b => { b.Property("AccessLevelsId") @@ -31,7 +34,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldMapId"); - b.ToTable("AccessLevelFieldAccessMapping", (string)null); + b.ToTable("AccessLevelFieldAccessMapping"); }); modelBuilder.Entity("AccessLevelObjectAccessMapping", b => @@ -46,7 +49,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectMapId"); - b.ToTable("AccessLevelObjectAccessMapping", (string)null); + b.ToTable("AccessLevelObjectAccessMapping"); }); modelBuilder.Entity("AccessLevelPermissionMapping", b => @@ -61,7 +64,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("PermissionMapsId"); - b.ToTable("AccessLevelPermissionMapping", (string)null); + b.ToTable("AccessLevelPermissionMapping"); }); modelBuilder.Entity("AppUserChatRoom", b => @@ -76,7 +79,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("MembersId"); - b.ToTable("AppUserChatRoom", (string)null); + b.ToTable("AppUserChatRoom"); }); modelBuilder.Entity("BLAZAM.Database.Models.ADSettings", b => @@ -112,7 +115,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ActiveDirectorySettings", null, t => + b.ToTable("ActiveDirectorySettings", t => { t.HasCheckConstraint("CK_Table_Column", "Id = 1"); }); @@ -124,6 +127,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("DisplayName") .IsRequired() .HasColumnType("longtext"); @@ -137,7 +142,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ActiveDirectoryFields", (string)null); + b.ToTable("ActiveDirectoryFields"); b.HasData( new @@ -407,6 +412,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("ActiveDirectoryFieldId") .HasColumnType("int"); @@ -420,7 +427,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("CustomActiveDirectoryFieldId"); - b.ToTable("ActiveDirectoryFieldObjectMappings", (string)null); + b.ToTable("ActiveDirectoryFieldObjectMappings"); }); modelBuilder.Entity("BLAZAM.Database.Models.AppSettings", b => @@ -492,7 +499,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AppSettings", null, t => + b.ToTable("AppSettings", t => { t.HasCheckConstraint("CK_Table_Column", "Id = 1") .HasName("CK_Table_Column1"); @@ -505,6 +512,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Action") .IsRequired() .HasColumnType("longtext"); @@ -534,7 +543,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("DirectoryEntryAuditLogs", (string)null); + b.ToTable("DirectoryEntryAuditLogs"); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.LogonAuditLog", b => @@ -543,6 +552,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Action") .IsRequired() .HasColumnType("longtext"); @@ -568,7 +579,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("LogonAuditLog", (string)null); + b.ToTable("LogonAuditLog"); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.PermissionsAuditLog", b => @@ -577,6 +588,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Action") .IsRequired() .HasColumnType("longtext"); @@ -602,7 +615,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("PermissionsAuditLog", (string)null); + b.ToTable("PermissionsAuditLog"); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.RequestAuditLog", b => @@ -611,6 +624,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Action") .IsRequired() .HasColumnType("longtext"); @@ -636,7 +651,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("RequestAuditLog", (string)null); + b.ToTable("RequestAuditLog"); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.SettingsAuditLog", b => @@ -645,6 +660,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Action") .IsRequired() .HasColumnType("longtext"); @@ -670,7 +687,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("SettingsAuditLog", (string)null); + b.ToTable("SettingsAuditLog"); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.SystemAuditLog", b => @@ -679,6 +696,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Action") .IsRequired() .HasColumnType("longtext"); @@ -704,7 +723,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("SystemAuditLog", (string)null); + b.ToTable("SystemAuditLog"); }); modelBuilder.Entity("BLAZAM.Database.Models.AuthenticationSettings", b => @@ -736,7 +755,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AuthenticationSettings", null, t => + b.ToTable("AuthenticationSettings", t => { t.HasCheckConstraint("CK_Table_Column", "Id = 1") .HasName("CK_Table_Column2"); @@ -759,6 +778,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("CreatedAt") .HasColumnType("datetime(6)"); @@ -777,7 +798,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ChatRooms", (string)null); + b.ToTable("ChatRooms"); }); modelBuilder.Entity("BLAZAM.Database.Models.Chat.UnreadChatMessage", b => @@ -786,6 +807,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("ChatMessageId") .HasColumnType("int"); @@ -799,7 +822,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ChatMessageId"); - b.ToTable("UnreadChatMessages", (string)null); + b.ToTable("UnreadChatMessages"); }); modelBuilder.Entity("BLAZAM.Database.Models.CustomActiveDirectoryField", b => @@ -808,6 +831,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("DeletedAt") .HasColumnType("datetime(6)"); @@ -824,7 +849,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("CustomActiveDirectoryFields", (string)null); + b.ToTable("CustomActiveDirectoryFields"); }); modelBuilder.Entity("BLAZAM.Database.Models.EmailSettings", b => @@ -871,7 +896,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("EmailSettings", null, t => + b.ToTable("EmailSettings", t => { t.HasCheckConstraint("CK_Table_Column", "Id = 1") .HasName("CK_Table_Column3"); @@ -884,6 +909,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Body") .IsRequired() .HasColumnType("longtext"); @@ -897,7 +924,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("EmailTemplates", (string)null); + b.ToTable("EmailTemplates"); }); modelBuilder.Entity("BLAZAM.Database.Models.Notifications.NotificationSubscription", b => @@ -906,6 +933,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Block") .HasColumnType("tinyint(1)"); @@ -929,7 +958,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("NotificationSubscriptions", (string)null); + b.ToTable("NotificationSubscriptions"); }); modelBuilder.Entity("BLAZAM.Database.Models.Notifications.SubscriptionNotificationType", b => @@ -938,6 +967,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("NotificationSubscriptionId") .HasColumnType("int"); @@ -948,7 +979,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("NotificationSubscriptionId"); - b.ToTable("SubscriptionNotificationType", (string)null); + b.ToTable("SubscriptionNotificationType"); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.AccessLevel", b => @@ -957,6 +988,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("DeletedAt") .HasColumnType("datetime(6)"); @@ -966,7 +999,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AccessLevels", (string)null); + b.ToTable("AccessLevels"); b.HasData( new @@ -982,6 +1015,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("AccessLevelId") .HasColumnType("int"); @@ -1000,7 +1035,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectActionId"); - b.ToTable("ActionAccessMapping", (string)null); + b.ToTable("ActionAccessMapping"); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.FieldAccessLevel", b => @@ -1009,6 +1044,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Level") .HasColumnType("int"); @@ -1018,7 +1055,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("FieldAccessLevel", (string)null); + b.ToTable("FieldAccessLevel"); b.HasData( new @@ -1047,6 +1084,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("CustomFieldId") .HasColumnType("int"); @@ -1067,7 +1106,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldId"); - b.ToTable("AccessLevelFieldMapping", (string)null); + b.ToTable("AccessLevelFieldMapping"); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessLevel", b => @@ -1076,6 +1115,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Level") .HasColumnType("int"); @@ -1085,7 +1126,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ObjectAccessLevel", (string)null); + b.ToTable("ObjectAccessLevel"); b.HasData( new @@ -1108,6 +1149,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("AllowDisabled") .HasColumnType("tinyint(1)"); @@ -1124,7 +1167,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectAccessLevelId"); - b.ToTable("AccessLevelObjectMapping", (string)null); + b.ToTable("AccessLevelObjectMapping"); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAction", b => @@ -1133,6 +1176,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Action") .HasColumnType("int"); @@ -1142,7 +1187,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ObjectActionFlag", (string)null); + b.ToTable("ObjectActionFlag"); b.HasData( new @@ -1207,6 +1252,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("DelegateName") .HasColumnType("longtext"); @@ -1225,7 +1272,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("DelegateSid") .IsUnique(); - b.ToTable("PermissionDelegate", (string)null); + b.ToTable("PermissionDelegate"); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.PermissionMapping", b => @@ -1234,6 +1281,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("DeletedAt") .HasColumnType("datetime(6)"); @@ -1243,7 +1292,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("PermissionMap", (string)null); + b.ToTable("PermissionMap"); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplate", b => @@ -1252,6 +1301,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("AllowCustomGroups") .HasColumnType("tinyint(1)"); @@ -1302,7 +1353,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ParentTemplateId"); - b.ToTable("DirectoryTemplates", (string)null); + b.ToTable("DirectoryTemplates"); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateFieldValue", b => @@ -1311,6 +1362,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("CustomFieldId") .HasColumnType("int"); @@ -1337,7 +1390,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldId"); - b.ToTable("DirectoryTemplateFieldValues", (string)null); + b.ToTable("DirectoryTemplateFieldValues"); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateGroup", b => @@ -1346,6 +1399,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("DirectoryTemplateId") .HasColumnType("int"); @@ -1357,7 +1412,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("DirectoryTemplateId"); - b.ToTable("DirectoryTemplateGroups", (string)null); + b.ToTable("DirectoryTemplateGroups"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.AppUser", b => @@ -1366,6 +1421,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("APIToken") .HasColumnType("longtext"); @@ -1399,7 +1456,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserGUID") .IsUnique(); - b.ToTable("UserSettings", (string)null); + b.ToTable("UserSettings"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.NotificationMessage", b => @@ -1408,6 +1465,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Created") .HasColumnType("datetime(6)"); @@ -1431,7 +1490,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("NotificationMessages", (string)null); + b.ToTable("NotificationMessages"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.ReadNewsItem", b => @@ -1440,6 +1499,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("NewsItemId") .HasColumnType("double"); @@ -1453,7 +1514,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("ReadNewsItems", (string)null); + b.ToTable("ReadNewsItems"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserDashboardWidget", b => @@ -1462,6 +1523,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ItemsPerPage") + .HasColumnType("int"); + b.Property("Order") .HasColumnType("int"); @@ -1479,7 +1545,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserDashboardWidgets", (string)null); + b.ToTable("UserDashboardWidgets"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserFavoriteEntry", b => @@ -1488,6 +1554,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("DN") .IsRequired() .HasColumnType("longtext"); @@ -1499,7 +1567,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserFavoriteEntries", (string)null); + b.ToTable("UserFavoriteEntries"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserNotification", b => @@ -1508,6 +1576,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("IsRead") .HasColumnType("tinyint(1)"); @@ -1523,7 +1593,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserNotifications", (string)null); + b.ToTable("UserNotifications"); }); modelBuilder.Entity("BLAZAM.Server.Data.ChatMessage", b => @@ -1532,6 +1602,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("ChatRoomId") .HasColumnType("int"); @@ -1551,7 +1623,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("ChatMessages", (string)null); + b.ToTable("ChatMessages"); }); modelBuilder.Entity("PermissionDelegatePermissionMapping", b => @@ -1566,7 +1638,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("PermissionsMapsId"); - b.ToTable("PermissionDelegatePermissionMapping", (string)null); + b.ToTable("PermissionDelegatePermissionMapping"); }); modelBuilder.Entity("AccessLevelFieldAccessMapping", b => diff --git a/BLAZAMDatabase/Migrations/Sql/20240917020513_Add_ItemsPerWidgetPage_Sql.Designer.cs b/BLAZAMDatabase/Migrations/Sql/20240917020513_Add_ItemsPerWidgetPage_Sql.Designer.cs new file mode 100644 index 00000000..8ee4b254 --- /dev/null +++ b/BLAZAMDatabase/Migrations/Sql/20240917020513_Add_ItemsPerWidgetPage_Sql.Designer.cs @@ -0,0 +1,1969 @@ +// +using System; +using BLAZAM.Database.Context; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace BLAZAM.Database.Migrations.Sql +{ + [DbContext(typeof(SqlDatabaseContext))] + [Migration("20240917020513_Add_ItemsPerWidgetPage_Sql")] + partial class Add_ItemsPerWidgetPage_Sql + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.8") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("AccessLevelFieldAccessMapping", b => + { + b.Property("AccessLevelsId") + .HasColumnType("int"); + + b.Property("FieldMapId") + .HasColumnType("int"); + + b.HasKey("AccessLevelsId", "FieldMapId"); + + b.HasIndex("FieldMapId"); + + b.ToTable("AccessLevelFieldAccessMapping"); + }); + + modelBuilder.Entity("AccessLevelObjectAccessMapping", b => + { + b.Property("AccessLevelsId") + .HasColumnType("int"); + + b.Property("ObjectMapId") + .HasColumnType("int"); + + b.HasKey("AccessLevelsId", "ObjectMapId"); + + b.HasIndex("ObjectMapId"); + + b.ToTable("AccessLevelObjectAccessMapping"); + }); + + modelBuilder.Entity("AccessLevelPermissionMapping", b => + { + b.Property("AccessLevelsId") + .HasColumnType("int"); + + b.Property("PermissionMapsId") + .HasColumnType("int"); + + b.HasKey("AccessLevelsId", "PermissionMapsId"); + + b.HasIndex("PermissionMapsId"); + + b.ToTable("AccessLevelPermissionMapping"); + }); + + modelBuilder.Entity("AppUserChatRoom", b => + { + b.Property("ChatRoomId") + .HasColumnType("int"); + + b.Property("MembersId") + .HasColumnType("int"); + + b.HasKey("ChatRoomId", "MembersId"); + + b.HasIndex("MembersId"); + + b.ToTable("AppUserChatRoom"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.ADSettings", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("ApplicationBaseDN") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FQDN") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Password") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ServerAddress") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ServerPort") + .HasColumnType("int"); + + b.Property("UseTLS") + .HasColumnType("bit"); + + b.Property("Username") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("ActiveDirectorySettings", t => + { + t.HasCheckConstraint("CK_Table_Column", "[Id] = 1"); + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.ActiveDirectoryField", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FieldName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FieldType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("ActiveDirectoryFields"); + + b.HasData( + new + { + Id = 1, + DisplayName = "Last Name", + FieldName = "sn", + FieldType = 0 + }, + new + { + Id = 2, + DisplayName = "First Name", + FieldName = "givenname", + FieldType = 0 + }, + new + { + Id = 3, + DisplayName = "Office", + FieldName = "physicalDeliveryOfficeName", + FieldType = 0 + }, + new + { + Id = 4, + DisplayName = "Employee ID", + FieldName = "employeeId", + FieldType = 0 + }, + new + { + Id = 5, + DisplayName = "Home Directory", + FieldName = "homeDirectory", + FieldType = 0 + }, + new + { + Id = 6, + DisplayName = "Logon Script Path", + FieldName = "scriptPath", + FieldType = 0 + }, + new + { + Id = 7, + DisplayName = "Profile Path", + FieldName = "profilePath", + FieldType = 0 + }, + new + { + Id = 8, + DisplayName = "Home Phone Number", + FieldName = "homePhone", + FieldType = 0 + }, + new + { + Id = 9, + DisplayName = "Street Address", + FieldName = "streetAddress", + FieldType = 0 + }, + new + { + Id = 10, + DisplayName = "City", + FieldName = "l", + FieldType = 0 + }, + new + { + Id = 11, + DisplayName = "State", + FieldName = "st", + FieldType = 0 + }, + new + { + Id = 12, + DisplayName = "Zip Code", + FieldName = "postalCode", + FieldType = 0 + }, + new + { + Id = 13, + DisplayName = "Site", + FieldName = "site", + FieldType = 0 + }, + new + { + Id = 14, + DisplayName = "Name", + FieldName = "name", + FieldType = 0 + }, + new + { + Id = 15, + DisplayName = "Username", + FieldName = "samaccountname", + FieldType = 0 + }, + new + { + Id = 16, + DisplayName = "SID", + FieldName = "objectSID", + FieldType = 2 + }, + new + { + Id = 17, + DisplayName = "E-Mail Address", + FieldName = "mail", + FieldType = 0 + }, + new + { + Id = 18, + DisplayName = "Description", + FieldName = "description", + FieldType = 0 + }, + new + { + Id = 19, + DisplayName = "Display Name", + FieldName = "displayName", + FieldType = 0 + }, + new + { + Id = 20, + DisplayName = "Distinguished Name", + FieldName = "distinguishedName", + FieldType = 0 + }, + new + { + Id = 21, + DisplayName = "Member Of", + FieldName = "memberOf", + FieldType = 4 + }, + new + { + Id = 22, + DisplayName = "Company", + FieldName = "company", + FieldType = 0 + }, + new + { + Id = 23, + DisplayName = "Title", + FieldName = "title", + FieldType = 0 + }, + new + { + Id = 24, + DisplayName = "User Principal Name", + FieldName = "userPrincipalName", + FieldType = 0 + }, + new + { + Id = 25, + DisplayName = "Telephone Number", + FieldName = "telephoneNumber", + FieldType = 0 + }, + new + { + Id = 26, + DisplayName = "PO Box", + FieldName = "postOfficeBox", + FieldType = 0 + }, + new + { + Id = 27, + DisplayName = "Canonical Name", + FieldName = "cn", + FieldType = 0 + }, + new + { + Id = 28, + DisplayName = "Home Drive", + FieldName = "homeDrive", + FieldType = 3 + }, + new + { + Id = 29, + DisplayName = "Department", + FieldName = "department", + FieldType = 0 + }, + new + { + Id = 30, + DisplayName = "Middle Name", + FieldName = "middleName", + FieldType = 0 + }, + new + { + Id = 31, + DisplayName = "Pager", + FieldName = "pager", + FieldType = 0 + }, + new + { + Id = 32, + DisplayName = "OS", + FieldName = "operatingSystemVersion", + FieldType = 0 + }, + new + { + Id = 33, + DisplayName = "Account Expiration", + FieldName = "accountExpires", + FieldType = 1 + }, + new + { + Id = 34, + DisplayName = "Manager", + FieldName = "manager", + FieldType = 0 + }, + new + { + Id = 35, + DisplayName = "Photo", + FieldName = "thumbnail", + FieldType = 2 + }, + new + { + Id = 36, + DisplayName = "Log On To", + FieldName = "userWorkstations", + FieldType = 0 + }, + new + { + Id = 37, + DisplayName = "Logon Hours", + FieldName = "logonHours", + FieldType = 2 + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.ActiveDirectoryFieldObjectType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ActiveDirectoryFieldId") + .HasColumnType("int"); + + b.Property("CustomActiveDirectoryFieldId") + .HasColumnType("int"); + + b.Property("ObjectType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CustomActiveDirectoryFieldId"); + + b.ToTable("ActiveDirectoryFieldObjectMappings"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.AppSettings", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("AnalyticsId") + .HasColumnType("nvarchar(max)"); + + b.Property("AppFQDN") + .HasColumnType("nvarchar(max)"); + + b.Property("AppIcon") + .HasColumnType("varbinary(max)"); + + b.Property("AppName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("AutoUpdate") + .HasColumnType("bit"); + + b.Property("AutoUpdateTime") + .HasColumnType("time"); + + b.Property("ForceHTTPS") + .HasColumnType("bit"); + + b.Property("InstallationCompleted") + .HasColumnType("bit"); + + b.Property("LastUpdateCheck") + .HasColumnType("datetime2"); + + b.Property("MOTD") + .HasColumnType("nvarchar(max)"); + + b.Property("MyrtilleURL") + .HasColumnType("nvarchar(max)"); + + b.Property("SSLCertificateCipher") + .HasColumnType("nvarchar(max)"); + + b.Property("SendDeveloperAnalytics") + .HasColumnType("bit"); + + b.Property("SendLogsToDeveloper") + .HasColumnType("bit"); + + b.Property("UpdateBranch") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UpdateDomain") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatePassword") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdateUsername") + .HasColumnType("nvarchar(max)"); + + b.Property("UseUpdateCredentials") + .HasColumnType("bit"); + + b.Property("UserHelpdeskURL") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("AppSettings", t => + { + t.HasCheckConstraint("CK_Table_Column", "[Id] = 1") + .HasName("CK_Table_Column1"); + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.DirectoryEntryAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Action") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("AfterAction") + .HasColumnType("nvarchar(max)"); + + b.Property("BeforeAction") + .HasColumnType("nvarchar(max)"); + + b.Property("IpAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("Sid") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Target") + .HasColumnType("nvarchar(max)"); + + b.Property("Timestamp") + .HasColumnType("datetime2"); + + b.Property("Username") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("DirectoryEntryAuditLogs"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.LogonAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Action") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("AfterAction") + .HasColumnType("nvarchar(max)"); + + b.Property("BeforeAction") + .HasColumnType("nvarchar(max)"); + + b.Property("IpAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("Target") + .HasColumnType("nvarchar(max)"); + + b.Property("Timestamp") + .HasColumnType("datetime2"); + + b.Property("Username") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("LogonAuditLog"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.PermissionsAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Action") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("AfterAction") + .HasColumnType("nvarchar(max)"); + + b.Property("BeforeAction") + .HasColumnType("nvarchar(max)"); + + b.Property("IpAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("Target") + .HasColumnType("nvarchar(max)"); + + b.Property("Timestamp") + .HasColumnType("datetime2"); + + b.Property("Username") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("PermissionsAuditLog"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.RequestAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Action") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("AfterAction") + .HasColumnType("nvarchar(max)"); + + b.Property("BeforeAction") + .HasColumnType("nvarchar(max)"); + + b.Property("IpAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("Target") + .HasColumnType("nvarchar(max)"); + + b.Property("Timestamp") + .HasColumnType("datetime2"); + + b.Property("Username") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("RequestAuditLog"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.SettingsAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Action") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("AfterAction") + .HasColumnType("nvarchar(max)"); + + b.Property("BeforeAction") + .HasColumnType("nvarchar(max)"); + + b.Property("IpAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("Target") + .HasColumnType("nvarchar(max)"); + + b.Property("Timestamp") + .HasColumnType("datetime2"); + + b.Property("Username") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("SettingsAuditLog"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.SystemAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Action") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("AfterAction") + .HasColumnType("nvarchar(max)"); + + b.Property("BeforeAction") + .HasColumnType("nvarchar(max)"); + + b.Property("IpAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("Target") + .HasColumnType("nvarchar(max)"); + + b.Property("Timestamp") + .HasColumnType("datetime2"); + + b.Property("Username") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("SystemAuditLog"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.AuthenticationSettings", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("AdminPassword") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DuoApiHost") + .HasColumnType("nvarchar(max)"); + + b.Property("DuoClientId") + .HasColumnType("nvarchar(max)"); + + b.Property("DuoClientSecret") + .HasColumnType("nvarchar(max)"); + + b.Property("DuoEnabled") + .HasColumnType("bit"); + + b.Property("DuoUnreachableBehavior") + .HasColumnType("int"); + + b.Property("SessionTimeout") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AuthenticationSettings", t => + { + t.HasCheckConstraint("CK_Table_Column", "[Id] = 1") + .HasName("CK_Table_Column2"); + }); + + b.HasData( + new + { + Id = 1, + AdminPassword = "password", + DuoEnabled = false, + DuoUnreachableBehavior = 0, + SessionTimeout = 15 + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Chat.ChatRoom", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("DeletedAt") + .HasColumnType("datetime2"); + + b.Property("IsPublic") + .HasColumnType("bit"); + + b.Property("MembersHash") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("ChatRooms"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Chat.UnreadChatMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ChatMessageId") + .HasColumnType("int"); + + b.Property("ChatRoomId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ChatMessageId"); + + b.ToTable("UnreadChatMessages"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.CustomActiveDirectoryField", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DeletedAt") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FieldName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FieldType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("CustomActiveDirectoryFields"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.EmailSettings", b => + { + b.Property("Id") + .HasColumnType("int"); + + b.Property("AdminBcc") + .HasColumnType("nvarchar(max)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("FromAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("FromName") + .HasColumnType("nvarchar(max)"); + + b.Property("ReplyToAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("ReplyToName") + .HasColumnType("nvarchar(max)"); + + b.Property("SMTPPassword") + .HasColumnType("nvarchar(max)"); + + b.Property("SMTPPort") + .HasColumnType("int"); + + b.Property("SMTPServer") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("SMTPUsername") + .HasColumnType("nvarchar(max)"); + + b.Property("UseSMTPAuth") + .HasColumnType("bit"); + + b.Property("UseTLS") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("EmailSettings", t => + { + t.HasCheckConstraint("CK_Table_Column", "[Id] = 1") + .HasName("CK_Table_Column3"); + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.EmailTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Body") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Subject") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TemplateType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("EmailTemplates"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Notifications.NotificationSubscription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Block") + .HasColumnType("bit"); + + b.Property("ByEmail") + .HasColumnType("bit"); + + b.Property("DeletedAt") + .HasColumnType("datetime2"); + + b.Property("InApp") + .HasColumnType("bit"); + + b.Property("OU") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("NotificationSubscriptions"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Notifications.SubscriptionNotificationType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("NotificationSubscriptionId") + .HasColumnType("int"); + + b.Property("NotificationType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("NotificationSubscriptionId"); + + b.ToTable("SubscriptionNotificationType"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.AccessLevel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DeletedAt") + .HasColumnType("datetime2"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("AccessLevels"); + + b.HasData( + new + { + Id = 1, + Name = "Deny All" + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ActionAccessMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AccessLevelId") + .HasColumnType("int"); + + b.Property("AllowOrDeny") + .HasColumnType("bit"); + + b.Property("ObjectActionId") + .HasColumnType("int"); + + b.Property("ObjectType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AccessLevelId"); + + b.HasIndex("ObjectActionId"); + + b.ToTable("ActionAccessMapping"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.FieldAccessLevel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("FieldAccessLevel"); + + b.HasData( + new + { + Id = 1, + Level = 10, + Name = "Deny" + }, + new + { + Id = 2, + Level = 100, + Name = "Read" + }, + new + { + Id = 3, + Level = 1000, + Name = "Edit" + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.FieldAccessMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CustomFieldId") + .HasColumnType("int"); + + b.Property("FieldAccessLevelId") + .HasColumnType("int"); + + b.Property("FieldId") + .HasColumnType("int"); + + b.Property("ObjectType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CustomFieldId"); + + b.HasIndex("FieldAccessLevelId"); + + b.HasIndex("FieldId"); + + b.ToTable("AccessLevelFieldMapping"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessLevel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("ObjectAccessLevel"); + + b.HasData( + new + { + Id = 1, + Level = 10, + Name = "Deny" + }, + new + { + Id = 2, + Level = 1000, + Name = "Read" + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AllowDisabled") + .HasColumnType("bit"); + + b.Property("DeletedAt") + .HasColumnType("datetime2"); + + b.Property("ObjectAccessLevelId") + .HasColumnType("int"); + + b.Property("ObjectType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ObjectAccessLevelId"); + + b.ToTable("AccessLevelObjectMapping"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Action") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("ObjectActionFlag"); + + b.HasData( + new + { + Id = 1, + Action = 4, + Name = "Assign" + }, + new + { + Id = 2, + Action = 3, + Name = "UnAssign" + }, + new + { + Id = 3, + Action = 8, + Name = "Unlock" + }, + new + { + Id = 4, + Action = 5, + Name = "Enable" + }, + new + { + Id = 5, + Action = 6, + Name = "Disable" + }, + new + { + Id = 6, + Action = 7, + Name = "Rename" + }, + new + { + Id = 7, + Action = 0, + Name = "Move" + }, + new + { + Id = 8, + Action = 2, + Name = "Create" + }, + new + { + Id = 9, + Action = 1, + Name = "Delete" + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.PermissionDelegate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DelegateName") + .HasColumnType("nvarchar(max)"); + + b.Property("DelegateSid") + .IsRequired() + .HasColumnType("varbinary(900)"); + + b.Property("DeletedAt") + .HasColumnType("datetime2"); + + b.Property("IsSuperAdmin") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DelegateSid") + .IsUnique(); + + b.ToTable("PermissionDelegate"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.PermissionMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DeletedAt") + .HasColumnType("datetime2"); + + b.Property("OU") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("PermissionMap"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AllowCustomGroups") + .HasColumnType("bit"); + + b.Property("AskForAlternateEmail") + .HasColumnType("bit"); + + b.Property("Category") + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedAt") + .HasColumnType("datetime2"); + + b.Property("DisplayNameFormula") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("ObjectType") + .HasColumnType("int"); + + b.Property("ParentOU") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentTemplateId") + .HasColumnType("int"); + + b.Property("PasswordFormula") + .HasColumnType("nvarchar(max)"); + + b.Property("RequirePasswordChange") + .HasColumnType("bit"); + + b.Property("SendWelcomeEmail") + .HasColumnType("bit"); + + b.Property("UsernameFormula") + .HasColumnType("nvarchar(max)"); + + b.Property("Visible") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.HasIndex("ParentTemplateId"); + + b.ToTable("DirectoryTemplates"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateFieldValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CustomFieldId") + .HasColumnType("int"); + + b.Property("DirectoryTemplateId") + .HasColumnType("int"); + + b.Property("Editable") + .HasColumnType("bit"); + + b.Property("FieldId") + .HasColumnType("int"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CustomFieldId"); + + b.HasIndex("DirectoryTemplateId"); + + b.HasIndex("FieldId"); + + b.ToTable("DirectoryTemplateFieldValues"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DirectoryTemplateId") + .HasColumnType("int"); + + b.Property("GroupSid") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DirectoryTemplateId"); + + b.ToTable("DirectoryTemplateGroups"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.AppUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("APIToken") + .HasColumnType("nvarchar(max)"); + + b.Property("DarkMode") + .HasColumnType("bit"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("ProfilePicture") + .HasColumnType("varbinary(max)"); + + b.Property("SearchDisabledComputers") + .HasColumnType("bit"); + + b.Property("SearchDisabledUsers") + .HasColumnType("bit"); + + b.Property("Theme") + .HasColumnType("nvarchar(max)"); + + b.Property("UserGUID") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Username") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("UserGUID") + .IsUnique(); + + b.ToTable("UserSettings"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.NotificationMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Created") + .HasColumnType("datetime2"); + + b.Property("Dismissable") + .HasColumnType("bit"); + + b.Property("Expires") + .HasColumnType("datetime2"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Link") + .HasColumnType("nvarchar(max)"); + + b.Property("Message") + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("NotificationMessages"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.ReadNewsItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("NewsItemId") + .HasColumnType("float"); + + b.Property("NewsItemUpdatedAt") + .HasColumnType("datetime2"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("ReadNewsItems"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserDashboardWidget", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ItemsPerPage") + .HasColumnType("int"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("Slot") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("int"); + + b.Property("WidgetType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserDashboardWidgets"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserFavoriteEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DN") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserFavoriteEntries"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserNotification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("IsRead") + .HasColumnType("bit"); + + b.Property("NotificationId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("NotificationId"); + + b.HasIndex("UserId"); + + b.ToTable("UserNotifications"); + }); + + modelBuilder.Entity("BLAZAM.Server.Data.ChatMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ChatRoomId") + .HasColumnType("int"); + + b.Property("Message") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Timestamp") + .HasColumnType("datetime2"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ChatRoomId"); + + b.HasIndex("UserId"); + + b.ToTable("ChatMessages"); + }); + + modelBuilder.Entity("PermissionDelegatePermissionMapping", b => + { + b.Property("PermissionDelegatesId") + .HasColumnType("int"); + + b.Property("PermissionsMapsId") + .HasColumnType("int"); + + b.HasKey("PermissionDelegatesId", "PermissionsMapsId"); + + b.HasIndex("PermissionsMapsId"); + + b.ToTable("PermissionDelegatePermissionMapping"); + }); + + modelBuilder.Entity("AccessLevelFieldAccessMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.AccessLevel", null) + .WithMany() + .HasForeignKey("AccessLevelsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.Permissions.FieldAccessMapping", null) + .WithMany() + .HasForeignKey("FieldMapId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AccessLevelObjectAccessMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.AccessLevel", null) + .WithMany() + .HasForeignKey("AccessLevelsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.Permissions.ObjectAccessMapping", null) + .WithMany() + .HasForeignKey("ObjectMapId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AccessLevelPermissionMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.AccessLevel", null) + .WithMany() + .HasForeignKey("AccessLevelsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.Permissions.PermissionMapping", null) + .WithMany() + .HasForeignKey("PermissionMapsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AppUserChatRoom", b => + { + b.HasOne("BLAZAM.Database.Models.Chat.ChatRoom", null) + .WithMany() + .HasForeignKey("ChatRoomId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.User.AppUser", null) + .WithMany() + .HasForeignKey("MembersId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.ActiveDirectoryFieldObjectType", b => + { + b.HasOne("BLAZAM.Database.Models.CustomActiveDirectoryField", null) + .WithMany("ObjectTypes") + .HasForeignKey("CustomActiveDirectoryFieldId"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Chat.UnreadChatMessage", b => + { + b.HasOne("BLAZAM.Server.Data.ChatMessage", "ChatMessage") + .WithMany("NotReadBy") + .HasForeignKey("ChatMessageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ChatMessage"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Notifications.NotificationSubscription", b => + { + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany("NotificationSubscriptions") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Notifications.SubscriptionNotificationType", b => + { + b.HasOne("BLAZAM.Database.Models.Notifications.NotificationSubscription", "NotificationSubscription") + .WithMany("NotificationTypes") + .HasForeignKey("NotificationSubscriptionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NotificationSubscription"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ActionAccessMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.AccessLevel", null) + .WithMany("ActionMap") + .HasForeignKey("AccessLevelId"); + + b.HasOne("BLAZAM.Database.Models.Permissions.ObjectAction", "ObjectAction") + .WithMany() + .HasForeignKey("ObjectActionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ObjectAction"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.FieldAccessMapping", b => + { + b.HasOne("BLAZAM.Database.Models.CustomActiveDirectoryField", "CustomField") + .WithMany() + .HasForeignKey("CustomFieldId"); + + b.HasOne("BLAZAM.Database.Models.Permissions.FieldAccessLevel", "FieldAccessLevel") + .WithMany() + .HasForeignKey("FieldAccessLevelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.ActiveDirectoryField", "Field") + .WithMany() + .HasForeignKey("FieldId"); + + b.Navigation("CustomField"); + + b.Navigation("Field"); + + b.Navigation("FieldAccessLevel"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.ObjectAccessLevel", "ObjectAccessLevel") + .WithMany("ObjectAccessMappings") + .HasForeignKey("ObjectAccessLevelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ObjectAccessLevel"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplate", b => + { + b.HasOne("BLAZAM.Database.Models.Templates.DirectoryTemplate", "ParentTemplate") + .WithMany() + .HasForeignKey("ParentTemplateId"); + + b.Navigation("ParentTemplate"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateFieldValue", b => + { + b.HasOne("BLAZAM.Database.Models.CustomActiveDirectoryField", "CustomField") + .WithMany() + .HasForeignKey("CustomFieldId"); + + b.HasOne("BLAZAM.Database.Models.Templates.DirectoryTemplate", null) + .WithMany("FieldValues") + .HasForeignKey("DirectoryTemplateId"); + + b.HasOne("BLAZAM.Database.Models.ActiveDirectoryField", "Field") + .WithMany() + .HasForeignKey("FieldId"); + + b.Navigation("CustomField"); + + b.Navigation("Field"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateGroup", b => + { + b.HasOne("BLAZAM.Database.Models.Templates.DirectoryTemplate", null) + .WithMany("AssignedGroupSids") + .HasForeignKey("DirectoryTemplateId"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.ReadNewsItem", b => + { + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany("ReadNewsItems") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserDashboardWidget", b => + { + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany("DashboardWidgets") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserFavoriteEntry", b => + { + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany("FavoriteEntries") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserNotification", b => + { + b.HasOne("BLAZAM.Database.Models.User.NotificationMessage", "Notification") + .WithMany() + .HasForeignKey("NotificationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany("Messages") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Notification"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BLAZAM.Server.Data.ChatMessage", b => + { + b.HasOne("BLAZAM.Database.Models.Chat.ChatRoom", "ChatRoom") + .WithMany("Messages") + .HasForeignKey("ChatRoomId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ChatRoom"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("PermissionDelegatePermissionMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.PermissionDelegate", null) + .WithMany() + .HasForeignKey("PermissionDelegatesId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.Permissions.PermissionMapping", null) + .WithMany() + .HasForeignKey("PermissionsMapsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Chat.ChatRoom", b => + { + b.Navigation("Messages"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.CustomActiveDirectoryField", b => + { + b.Navigation("ObjectTypes"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Notifications.NotificationSubscription", b => + { + b.Navigation("NotificationTypes"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.AccessLevel", b => + { + b.Navigation("ActionMap"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessLevel", b => + { + b.Navigation("ObjectAccessMappings"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplate", b => + { + b.Navigation("AssignedGroupSids"); + + b.Navigation("FieldValues"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.AppUser", b => + { + b.Navigation("DashboardWidgets"); + + b.Navigation("FavoriteEntries"); + + b.Navigation("Messages"); + + b.Navigation("NotificationSubscriptions"); + + b.Navigation("ReadNewsItems"); + }); + + modelBuilder.Entity("BLAZAM.Server.Data.ChatMessage", b => + { + b.Navigation("NotReadBy"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/BLAZAMDatabase/Migrations/Sql/20240917020513_Add_ItemsPerWidgetPage_Sql.cs b/BLAZAMDatabase/Migrations/Sql/20240917020513_Add_ItemsPerWidgetPage_Sql.cs new file mode 100644 index 00000000..92aee16a --- /dev/null +++ b/BLAZAMDatabase/Migrations/Sql/20240917020513_Add_ItemsPerWidgetPage_Sql.cs @@ -0,0 +1,29 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BLAZAM.Database.Migrations.Sql +{ + /// + public partial class Add_ItemsPerWidgetPage_Sql : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ItemsPerPage", + table: "UserDashboardWidgets", + type: "int", + nullable: false, + defaultValue: 0); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ItemsPerPage", + table: "UserDashboardWidgets"); + } + } +} diff --git a/BLAZAMDatabase/Migrations/Sql/SqlDatabaseContextModelSnapshot.cs b/BLAZAMDatabase/Migrations/Sql/SqlDatabaseContextModelSnapshot.cs index fb627c77..6cc49ea4 100644 --- a/BLAZAMDatabase/Migrations/Sql/SqlDatabaseContextModelSnapshot.cs +++ b/BLAZAMDatabase/Migrations/Sql/SqlDatabaseContextModelSnapshot.cs @@ -17,7 +17,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "7.0.20") + .HasAnnotation("ProductVersion", "8.0.8") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); @@ -34,7 +34,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldMapId"); - b.ToTable("AccessLevelFieldAccessMapping", (string)null); + b.ToTable("AccessLevelFieldAccessMapping"); }); modelBuilder.Entity("AccessLevelObjectAccessMapping", b => @@ -49,7 +49,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectMapId"); - b.ToTable("AccessLevelObjectAccessMapping", (string)null); + b.ToTable("AccessLevelObjectAccessMapping"); }); modelBuilder.Entity("AccessLevelPermissionMapping", b => @@ -64,7 +64,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("PermissionMapsId"); - b.ToTable("AccessLevelPermissionMapping", (string)null); + b.ToTable("AccessLevelPermissionMapping"); }); modelBuilder.Entity("AppUserChatRoom", b => @@ -79,7 +79,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("MembersId"); - b.ToTable("AppUserChatRoom", (string)null); + b.ToTable("AppUserChatRoom"); }); modelBuilder.Entity("BLAZAM.Database.Models.ADSettings", b => @@ -115,7 +115,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ActiveDirectorySettings", null, t => + b.ToTable("ActiveDirectorySettings", t => { t.HasCheckConstraint("CK_Table_Column", "[Id] = 1"); }); @@ -142,7 +142,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ActiveDirectoryFields", (string)null); + b.ToTable("ActiveDirectoryFields"); b.HasData( new @@ -427,7 +427,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("CustomActiveDirectoryFieldId"); - b.ToTable("ActiveDirectoryFieldObjectMappings", (string)null); + b.ToTable("ActiveDirectoryFieldObjectMappings"); }); modelBuilder.Entity("BLAZAM.Database.Models.AppSettings", b => @@ -499,7 +499,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AppSettings", null, t => + b.ToTable("AppSettings", t => { t.HasCheckConstraint("CK_Table_Column", "[Id] = 1") .HasName("CK_Table_Column1"); @@ -543,7 +543,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("DirectoryEntryAuditLogs", (string)null); + b.ToTable("DirectoryEntryAuditLogs"); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.LogonAuditLog", b => @@ -579,7 +579,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("LogonAuditLog", (string)null); + b.ToTable("LogonAuditLog"); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.PermissionsAuditLog", b => @@ -615,7 +615,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("PermissionsAuditLog", (string)null); + b.ToTable("PermissionsAuditLog"); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.RequestAuditLog", b => @@ -651,7 +651,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("RequestAuditLog", (string)null); + b.ToTable("RequestAuditLog"); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.SettingsAuditLog", b => @@ -687,7 +687,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("SettingsAuditLog", (string)null); + b.ToTable("SettingsAuditLog"); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.SystemAuditLog", b => @@ -723,7 +723,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("SystemAuditLog", (string)null); + b.ToTable("SystemAuditLog"); }); modelBuilder.Entity("BLAZAM.Database.Models.AuthenticationSettings", b => @@ -755,7 +755,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AuthenticationSettings", null, t => + b.ToTable("AuthenticationSettings", t => { t.HasCheckConstraint("CK_Table_Column", "[Id] = 1") .HasName("CK_Table_Column2"); @@ -798,7 +798,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ChatRooms", (string)null); + b.ToTable("ChatRooms"); }); modelBuilder.Entity("BLAZAM.Database.Models.Chat.UnreadChatMessage", b => @@ -822,7 +822,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ChatMessageId"); - b.ToTable("UnreadChatMessages", (string)null); + b.ToTable("UnreadChatMessages"); }); modelBuilder.Entity("BLAZAM.Database.Models.CustomActiveDirectoryField", b => @@ -849,7 +849,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("CustomActiveDirectoryFields", (string)null); + b.ToTable("CustomActiveDirectoryFields"); }); modelBuilder.Entity("BLAZAM.Database.Models.EmailSettings", b => @@ -896,7 +896,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("EmailSettings", null, t => + b.ToTable("EmailSettings", t => { t.HasCheckConstraint("CK_Table_Column", "[Id] = 1") .HasName("CK_Table_Column3"); @@ -924,7 +924,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("EmailTemplates", (string)null); + b.ToTable("EmailTemplates"); }); modelBuilder.Entity("BLAZAM.Database.Models.Notifications.NotificationSubscription", b => @@ -958,7 +958,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("NotificationSubscriptions", (string)null); + b.ToTable("NotificationSubscriptions"); }); modelBuilder.Entity("BLAZAM.Database.Models.Notifications.SubscriptionNotificationType", b => @@ -979,7 +979,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("NotificationSubscriptionId"); - b.ToTable("SubscriptionNotificationType", (string)null); + b.ToTable("SubscriptionNotificationType"); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.AccessLevel", b => @@ -999,7 +999,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AccessLevels", (string)null); + b.ToTable("AccessLevels"); b.HasData( new @@ -1035,7 +1035,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectActionId"); - b.ToTable("ActionAccessMapping", (string)null); + b.ToTable("ActionAccessMapping"); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.FieldAccessLevel", b => @@ -1055,7 +1055,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("FieldAccessLevel", (string)null); + b.ToTable("FieldAccessLevel"); b.HasData( new @@ -1106,7 +1106,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldId"); - b.ToTable("AccessLevelFieldMapping", (string)null); + b.ToTable("AccessLevelFieldMapping"); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessLevel", b => @@ -1126,7 +1126,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ObjectAccessLevel", (string)null); + b.ToTable("ObjectAccessLevel"); b.HasData( new @@ -1167,7 +1167,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectAccessLevelId"); - b.ToTable("AccessLevelObjectMapping", (string)null); + b.ToTable("AccessLevelObjectMapping"); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAction", b => @@ -1187,7 +1187,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ObjectActionFlag", (string)null); + b.ToTable("ObjectActionFlag"); b.HasData( new @@ -1272,7 +1272,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("DelegateSid") .IsUnique(); - b.ToTable("PermissionDelegate", (string)null); + b.ToTable("PermissionDelegate"); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.PermissionMapping", b => @@ -1292,7 +1292,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("PermissionMap", (string)null); + b.ToTable("PermissionMap"); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplate", b => @@ -1353,7 +1353,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ParentTemplateId"); - b.ToTable("DirectoryTemplates", (string)null); + b.ToTable("DirectoryTemplates"); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateFieldValue", b => @@ -1390,7 +1390,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldId"); - b.ToTable("DirectoryTemplateFieldValues", (string)null); + b.ToTable("DirectoryTemplateFieldValues"); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateGroup", b => @@ -1412,7 +1412,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("DirectoryTemplateId"); - b.ToTable("DirectoryTemplateGroups", (string)null); + b.ToTable("DirectoryTemplateGroups"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.AppUser", b => @@ -1456,7 +1456,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserGUID") .IsUnique(); - b.ToTable("UserSettings", (string)null); + b.ToTable("UserSettings"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.NotificationMessage", b => @@ -1490,7 +1490,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("NotificationMessages", (string)null); + b.ToTable("NotificationMessages"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.ReadNewsItem", b => @@ -1514,7 +1514,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("ReadNewsItems", (string)null); + b.ToTable("ReadNewsItems"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserDashboardWidget", b => @@ -1525,6 +1525,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + b.Property("ItemsPerPage") + .HasColumnType("int"); + b.Property("Order") .HasColumnType("int"); @@ -1542,7 +1545,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserDashboardWidgets", (string)null); + b.ToTable("UserDashboardWidgets"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserFavoriteEntry", b => @@ -1564,7 +1567,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserFavoriteEntries", (string)null); + b.ToTable("UserFavoriteEntries"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserNotification", b => @@ -1590,7 +1593,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserNotifications", (string)null); + b.ToTable("UserNotifications"); }); modelBuilder.Entity("BLAZAM.Server.Data.ChatMessage", b => @@ -1620,7 +1623,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("ChatMessages", (string)null); + b.ToTable("ChatMessages"); }); modelBuilder.Entity("PermissionDelegatePermissionMapping", b => @@ -1635,7 +1638,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("PermissionsMapsId"); - b.ToTable("PermissionDelegatePermissionMapping", (string)null); + b.ToTable("PermissionDelegatePermissionMapping"); }); modelBuilder.Entity("AccessLevelFieldAccessMapping", b => diff --git a/BLAZAMDatabase/Migrations/Sqlite/20240917020454_Add_ItemsPerWidgetPage_Sqlite.Designer.cs b/BLAZAMDatabase/Migrations/Sqlite/20240917020454_Add_ItemsPerWidgetPage_Sqlite.Designer.cs new file mode 100644 index 00000000..1adc6677 --- /dev/null +++ b/BLAZAMDatabase/Migrations/Sqlite/20240917020454_Add_ItemsPerWidgetPage_Sqlite.Designer.cs @@ -0,0 +1,1895 @@ +// +using System; +using BLAZAM.Database.Context; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace BLAZAM.Database.Migrations.Sqlite +{ + [DbContext(typeof(SqliteDatabaseContext))] + [Migration("20240917020454_Add_ItemsPerWidgetPage_Sqlite")] + partial class Add_ItemsPerWidgetPage_Sqlite + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "8.0.8"); + + modelBuilder.Entity("AccessLevelFieldAccessMapping", b => + { + b.Property("AccessLevelsId") + .HasColumnType("INTEGER"); + + b.Property("FieldMapId") + .HasColumnType("INTEGER"); + + b.HasKey("AccessLevelsId", "FieldMapId"); + + b.HasIndex("FieldMapId"); + + b.ToTable("AccessLevelFieldAccessMapping"); + }); + + modelBuilder.Entity("AccessLevelObjectAccessMapping", b => + { + b.Property("AccessLevelsId") + .HasColumnType("INTEGER"); + + b.Property("ObjectMapId") + .HasColumnType("INTEGER"); + + b.HasKey("AccessLevelsId", "ObjectMapId"); + + b.HasIndex("ObjectMapId"); + + b.ToTable("AccessLevelObjectAccessMapping"); + }); + + modelBuilder.Entity("AccessLevelPermissionMapping", b => + { + b.Property("AccessLevelsId") + .HasColumnType("INTEGER"); + + b.Property("PermissionMapsId") + .HasColumnType("INTEGER"); + + b.HasKey("AccessLevelsId", "PermissionMapsId"); + + b.HasIndex("PermissionMapsId"); + + b.ToTable("AccessLevelPermissionMapping"); + }); + + modelBuilder.Entity("AppUserChatRoom", b => + { + b.Property("ChatRoomId") + .HasColumnType("INTEGER"); + + b.Property("MembersId") + .HasColumnType("INTEGER"); + + b.HasKey("ChatRoomId", "MembersId"); + + b.HasIndex("MembersId"); + + b.ToTable("AppUserChatRoom"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.ADSettings", b => + { + b.Property("Id") + .HasColumnType("INTEGER"); + + b.Property("ApplicationBaseDN") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("FQDN") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Password") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ServerAddress") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ServerPort") + .HasColumnType("INTEGER"); + + b.Property("UseTLS") + .HasColumnType("INTEGER"); + + b.Property("Username") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("ActiveDirectorySettings", t => + { + t.HasCheckConstraint("CK_Table_Column", "[Id] = 1"); + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.ActiveDirectoryField", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("FieldName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("FieldType") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("ActiveDirectoryFields"); + + b.HasData( + new + { + Id = 1, + DisplayName = "Last Name", + FieldName = "sn", + FieldType = 0 + }, + new + { + Id = 2, + DisplayName = "First Name", + FieldName = "givenname", + FieldType = 0 + }, + new + { + Id = 3, + DisplayName = "Office", + FieldName = "physicalDeliveryOfficeName", + FieldType = 0 + }, + new + { + Id = 4, + DisplayName = "Employee ID", + FieldName = "employeeId", + FieldType = 0 + }, + new + { + Id = 5, + DisplayName = "Home Directory", + FieldName = "homeDirectory", + FieldType = 0 + }, + new + { + Id = 6, + DisplayName = "Logon Script Path", + FieldName = "scriptPath", + FieldType = 0 + }, + new + { + Id = 7, + DisplayName = "Profile Path", + FieldName = "profilePath", + FieldType = 0 + }, + new + { + Id = 8, + DisplayName = "Home Phone Number", + FieldName = "homePhone", + FieldType = 0 + }, + new + { + Id = 9, + DisplayName = "Street Address", + FieldName = "streetAddress", + FieldType = 0 + }, + new + { + Id = 10, + DisplayName = "City", + FieldName = "l", + FieldType = 0 + }, + new + { + Id = 11, + DisplayName = "State", + FieldName = "st", + FieldType = 0 + }, + new + { + Id = 12, + DisplayName = "Zip Code", + FieldName = "postalCode", + FieldType = 0 + }, + new + { + Id = 13, + DisplayName = "Site", + FieldName = "site", + FieldType = 0 + }, + new + { + Id = 14, + DisplayName = "Name", + FieldName = "name", + FieldType = 0 + }, + new + { + Id = 15, + DisplayName = "Username", + FieldName = "samaccountname", + FieldType = 0 + }, + new + { + Id = 16, + DisplayName = "SID", + FieldName = "objectSID", + FieldType = 2 + }, + new + { + Id = 17, + DisplayName = "E-Mail Address", + FieldName = "mail", + FieldType = 0 + }, + new + { + Id = 18, + DisplayName = "Description", + FieldName = "description", + FieldType = 0 + }, + new + { + Id = 19, + DisplayName = "Display Name", + FieldName = "displayName", + FieldType = 0 + }, + new + { + Id = 20, + DisplayName = "Distinguished Name", + FieldName = "distinguishedName", + FieldType = 0 + }, + new + { + Id = 21, + DisplayName = "Member Of", + FieldName = "memberOf", + FieldType = 4 + }, + new + { + Id = 22, + DisplayName = "Company", + FieldName = "company", + FieldType = 0 + }, + new + { + Id = 23, + DisplayName = "Title", + FieldName = "title", + FieldType = 0 + }, + new + { + Id = 24, + DisplayName = "User Principal Name", + FieldName = "userPrincipalName", + FieldType = 0 + }, + new + { + Id = 25, + DisplayName = "Telephone Number", + FieldName = "telephoneNumber", + FieldType = 0 + }, + new + { + Id = 26, + DisplayName = "PO Box", + FieldName = "postOfficeBox", + FieldType = 0 + }, + new + { + Id = 27, + DisplayName = "Canonical Name", + FieldName = "cn", + FieldType = 0 + }, + new + { + Id = 28, + DisplayName = "Home Drive", + FieldName = "homeDrive", + FieldType = 3 + }, + new + { + Id = 29, + DisplayName = "Department", + FieldName = "department", + FieldType = 0 + }, + new + { + Id = 30, + DisplayName = "Middle Name", + FieldName = "middleName", + FieldType = 0 + }, + new + { + Id = 31, + DisplayName = "Pager", + FieldName = "pager", + FieldType = 0 + }, + new + { + Id = 32, + DisplayName = "OS", + FieldName = "operatingSystemVersion", + FieldType = 0 + }, + new + { + Id = 33, + DisplayName = "Account Expiration", + FieldName = "accountExpires", + FieldType = 1 + }, + new + { + Id = 34, + DisplayName = "Manager", + FieldName = "manager", + FieldType = 0 + }, + new + { + Id = 35, + DisplayName = "Photo", + FieldName = "thumbnail", + FieldType = 2 + }, + new + { + Id = 36, + DisplayName = "Log On To", + FieldName = "userWorkstations", + FieldType = 0 + }, + new + { + Id = 37, + DisplayName = "Logon Hours", + FieldName = "logonHours", + FieldType = 2 + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.ActiveDirectoryFieldObjectType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ActiveDirectoryFieldId") + .HasColumnType("INTEGER"); + + b.Property("CustomActiveDirectoryFieldId") + .HasColumnType("INTEGER"); + + b.Property("ObjectType") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("CustomActiveDirectoryFieldId"); + + b.ToTable("ActiveDirectoryFieldObjectMappings"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.AppSettings", b => + { + b.Property("Id") + .HasColumnType("INTEGER"); + + b.Property("AnalyticsId") + .HasColumnType("TEXT"); + + b.Property("AppFQDN") + .HasColumnType("TEXT"); + + b.Property("AppIcon") + .HasColumnType("BLOB"); + + b.Property("AppName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("AutoUpdate") + .HasColumnType("INTEGER"); + + b.Property("AutoUpdateTime") + .HasColumnType("TEXT"); + + b.Property("ForceHTTPS") + .HasColumnType("INTEGER"); + + b.Property("InstallationCompleted") + .HasColumnType("INTEGER"); + + b.Property("LastUpdateCheck") + .HasColumnType("TEXT"); + + b.Property("MOTD") + .HasColumnType("TEXT"); + + b.Property("MyrtilleURL") + .HasColumnType("TEXT"); + + b.Property("SSLCertificateCipher") + .HasColumnType("TEXT"); + + b.Property("SendDeveloperAnalytics") + .HasColumnType("INTEGER"); + + b.Property("SendLogsToDeveloper") + .HasColumnType("INTEGER"); + + b.Property("UpdateBranch") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("UpdateDomain") + .HasColumnType("TEXT"); + + b.Property("UpdatePassword") + .HasColumnType("TEXT"); + + b.Property("UpdateUsername") + .HasColumnType("TEXT"); + + b.Property("UseUpdateCredentials") + .HasColumnType("INTEGER"); + + b.Property("UserHelpdeskURL") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("AppSettings", t => + { + t.HasCheckConstraint("CK_Table_Column", "[Id] = 1"); + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.DirectoryEntryAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Action") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("AfterAction") + .HasColumnType("TEXT"); + + b.Property("BeforeAction") + .HasColumnType("TEXT"); + + b.Property("IpAddress") + .HasColumnType("TEXT"); + + b.Property("Sid") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Target") + .HasColumnType("TEXT"); + + b.Property("Timestamp") + .HasColumnType("TEXT"); + + b.Property("Username") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("DirectoryEntryAuditLogs"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.LogonAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Action") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("AfterAction") + .HasColumnType("TEXT"); + + b.Property("BeforeAction") + .HasColumnType("TEXT"); + + b.Property("IpAddress") + .HasColumnType("TEXT"); + + b.Property("Target") + .HasColumnType("TEXT"); + + b.Property("Timestamp") + .HasColumnType("TEXT"); + + b.Property("Username") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("LogonAuditLog"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.PermissionsAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Action") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("AfterAction") + .HasColumnType("TEXT"); + + b.Property("BeforeAction") + .HasColumnType("TEXT"); + + b.Property("IpAddress") + .HasColumnType("TEXT"); + + b.Property("Target") + .HasColumnType("TEXT"); + + b.Property("Timestamp") + .HasColumnType("TEXT"); + + b.Property("Username") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("PermissionsAuditLog"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.RequestAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Action") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("AfterAction") + .HasColumnType("TEXT"); + + b.Property("BeforeAction") + .HasColumnType("TEXT"); + + b.Property("IpAddress") + .HasColumnType("TEXT"); + + b.Property("Target") + .HasColumnType("TEXT"); + + b.Property("Timestamp") + .HasColumnType("TEXT"); + + b.Property("Username") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("RequestAuditLog"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.SettingsAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Action") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("AfterAction") + .HasColumnType("TEXT"); + + b.Property("BeforeAction") + .HasColumnType("TEXT"); + + b.Property("IpAddress") + .HasColumnType("TEXT"); + + b.Property("Target") + .HasColumnType("TEXT"); + + b.Property("Timestamp") + .HasColumnType("TEXT"); + + b.Property("Username") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("SettingsAuditLog"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Audit.SystemAuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Action") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("AfterAction") + .HasColumnType("TEXT"); + + b.Property("BeforeAction") + .HasColumnType("TEXT"); + + b.Property("IpAddress") + .HasColumnType("TEXT"); + + b.Property("Target") + .HasColumnType("TEXT"); + + b.Property("Timestamp") + .HasColumnType("TEXT"); + + b.Property("Username") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("SystemAuditLog"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.AuthenticationSettings", b => + { + b.Property("Id") + .HasColumnType("INTEGER"); + + b.Property("AdminPassword") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("DuoApiHost") + .HasColumnType("TEXT"); + + b.Property("DuoClientId") + .HasColumnType("TEXT"); + + b.Property("DuoClientSecret") + .HasColumnType("TEXT"); + + b.Property("DuoEnabled") + .HasColumnType("INTEGER"); + + b.Property("DuoUnreachableBehavior") + .HasColumnType("INTEGER"); + + b.Property("SessionTimeout") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("AuthenticationSettings", t => + { + t.HasCheckConstraint("CK_Table_Column", "[Id] = 1"); + }); + + b.HasData( + new + { + Id = 1, + AdminPassword = "password", + DuoEnabled = false, + DuoUnreachableBehavior = 0, + SessionTimeout = 15 + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Chat.ChatRoom", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CreatedAt") + .HasColumnType("TEXT"); + + b.Property("DeletedAt") + .HasColumnType("TEXT"); + + b.Property("IsPublic") + .HasColumnType("INTEGER"); + + b.Property("MembersHash") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("ChatRooms"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Chat.UnreadChatMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ChatMessageId") + .HasColumnType("INTEGER"); + + b.Property("ChatRoomId") + .HasColumnType("INTEGER"); + + b.Property("UserId") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("ChatMessageId"); + + b.ToTable("UnreadChatMessages"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.CustomActiveDirectoryField", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("DeletedAt") + .HasColumnType("TEXT"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("FieldName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("FieldType") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("CustomActiveDirectoryFields"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.EmailSettings", b => + { + b.Property("Id") + .HasColumnType("INTEGER"); + + b.Property("AdminBcc") + .HasColumnType("TEXT"); + + b.Property("Enabled") + .HasColumnType("INTEGER"); + + b.Property("FromAddress") + .HasColumnType("TEXT"); + + b.Property("FromName") + .HasColumnType("TEXT"); + + b.Property("ReplyToAddress") + .HasColumnType("TEXT"); + + b.Property("ReplyToName") + .HasColumnType("TEXT"); + + b.Property("SMTPPassword") + .HasColumnType("TEXT"); + + b.Property("SMTPPort") + .HasColumnType("INTEGER"); + + b.Property("SMTPServer") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("SMTPUsername") + .HasColumnType("TEXT"); + + b.Property("UseSMTPAuth") + .HasColumnType("INTEGER"); + + b.Property("UseTLS") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("EmailSettings", t => + { + t.HasCheckConstraint("CK_Table_Column", "[Id] = 1"); + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.EmailTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Body") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Subject") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("TemplateType") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("EmailTemplates"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Notifications.NotificationSubscription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Block") + .HasColumnType("INTEGER"); + + b.Property("ByEmail") + .HasColumnType("INTEGER"); + + b.Property("DeletedAt") + .HasColumnType("TEXT"); + + b.Property("InApp") + .HasColumnType("INTEGER"); + + b.Property("OU") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("UserId") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("NotificationSubscriptions"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Notifications.SubscriptionNotificationType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("NotificationSubscriptionId") + .HasColumnType("INTEGER"); + + b.Property("NotificationType") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("NotificationSubscriptionId"); + + b.ToTable("SubscriptionNotificationType"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.AccessLevel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("DeletedAt") + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("AccessLevels"); + + b.HasData( + new + { + Id = 1, + Name = "Deny All" + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ActionAccessMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccessLevelId") + .HasColumnType("INTEGER"); + + b.Property("AllowOrDeny") + .HasColumnType("INTEGER"); + + b.Property("ObjectActionId") + .HasColumnType("INTEGER"); + + b.Property("ObjectType") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("AccessLevelId"); + + b.HasIndex("ObjectActionId"); + + b.ToTable("ActionAccessMapping"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.FieldAccessLevel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Level") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("FieldAccessLevel"); + + b.HasData( + new + { + Id = 1, + Level = 10, + Name = "Deny" + }, + new + { + Id = 2, + Level = 100, + Name = "Read" + }, + new + { + Id = 3, + Level = 1000, + Name = "Edit" + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.FieldAccessMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CustomFieldId") + .HasColumnType("INTEGER"); + + b.Property("FieldAccessLevelId") + .HasColumnType("INTEGER"); + + b.Property("FieldId") + .HasColumnType("INTEGER"); + + b.Property("ObjectType") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("CustomFieldId"); + + b.HasIndex("FieldAccessLevelId"); + + b.HasIndex("FieldId"); + + b.ToTable("AccessLevelFieldMapping"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessLevel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Level") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("ObjectAccessLevel"); + + b.HasData( + new + { + Id = 1, + Level = 10, + Name = "Deny" + }, + new + { + Id = 2, + Level = 1000, + Name = "Read" + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AllowDisabled") + .HasColumnType("INTEGER"); + + b.Property("DeletedAt") + .HasColumnType("TEXT"); + + b.Property("ObjectAccessLevelId") + .HasColumnType("INTEGER"); + + b.Property("ObjectType") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("ObjectAccessLevelId"); + + b.ToTable("AccessLevelObjectMapping"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Action") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("ObjectActionFlag"); + + b.HasData( + new + { + Id = 1, + Action = 4, + Name = "Assign" + }, + new + { + Id = 2, + Action = 3, + Name = "UnAssign" + }, + new + { + Id = 3, + Action = 8, + Name = "Unlock" + }, + new + { + Id = 4, + Action = 5, + Name = "Enable" + }, + new + { + Id = 5, + Action = 6, + Name = "Disable" + }, + new + { + Id = 6, + Action = 7, + Name = "Rename" + }, + new + { + Id = 7, + Action = 0, + Name = "Move" + }, + new + { + Id = 8, + Action = 2, + Name = "Create" + }, + new + { + Id = 9, + Action = 1, + Name = "Delete" + }); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.PermissionDelegate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("DelegateName") + .HasColumnType("TEXT"); + + b.Property("DelegateSid") + .IsRequired() + .HasColumnType("BLOB"); + + b.Property("DeletedAt") + .HasColumnType("TEXT"); + + b.Property("IsSuperAdmin") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("DelegateSid") + .IsUnique(); + + b.ToTable("PermissionDelegate"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.PermissionMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("DeletedAt") + .HasColumnType("TEXT"); + + b.Property("OU") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("PermissionMap"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AllowCustomGroups") + .HasColumnType("INTEGER"); + + b.Property("AskForAlternateEmail") + .HasColumnType("INTEGER"); + + b.Property("Category") + .HasColumnType("TEXT"); + + b.Property("DeletedAt") + .HasColumnType("TEXT"); + + b.Property("DisplayNameFormula") + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ObjectType") + .HasColumnType("INTEGER"); + + b.Property("ParentOU") + .HasColumnType("TEXT"); + + b.Property("ParentTemplateId") + .HasColumnType("INTEGER"); + + b.Property("PasswordFormula") + .HasColumnType("TEXT"); + + b.Property("RequirePasswordChange") + .HasColumnType("INTEGER"); + + b.Property("SendWelcomeEmail") + .HasColumnType("INTEGER"); + + b.Property("UsernameFormula") + .HasColumnType("TEXT"); + + b.Property("Visible") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.HasIndex("ParentTemplateId"); + + b.ToTable("DirectoryTemplates"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateFieldValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CustomFieldId") + .HasColumnType("INTEGER"); + + b.Property("DirectoryTemplateId") + .HasColumnType("INTEGER"); + + b.Property("Editable") + .HasColumnType("INTEGER"); + + b.Property("FieldId") + .HasColumnType("INTEGER"); + + b.Property("Required") + .HasColumnType("INTEGER"); + + b.Property("Value") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("CustomFieldId"); + + b.HasIndex("DirectoryTemplateId"); + + b.HasIndex("FieldId"); + + b.ToTable("DirectoryTemplateFieldValues"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("DirectoryTemplateId") + .HasColumnType("INTEGER"); + + b.Property("GroupSid") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("DirectoryTemplateId"); + + b.ToTable("DirectoryTemplateGroups"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.AppUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("APIToken") + .HasColumnType("TEXT"); + + b.Property("DarkMode") + .HasColumnType("INTEGER"); + + b.Property("Email") + .HasColumnType("TEXT"); + + b.Property("ProfilePicture") + .HasColumnType("BLOB"); + + b.Property("SearchDisabledComputers") + .HasColumnType("INTEGER"); + + b.Property("SearchDisabledUsers") + .HasColumnType("INTEGER"); + + b.Property("Theme") + .HasColumnType("TEXT"); + + b.Property("UserGUID") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Username") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("UserGUID") + .IsUnique(); + + b.ToTable("UserSettings"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.NotificationMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Created") + .HasColumnType("TEXT"); + + b.Property("Dismissable") + .HasColumnType("INTEGER"); + + b.Property("Expires") + .HasColumnType("TEXT"); + + b.Property("Level") + .HasColumnType("INTEGER"); + + b.Property("Link") + .HasColumnType("TEXT"); + + b.Property("Message") + .HasColumnType("TEXT"); + + b.Property("Title") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("NotificationMessages"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.ReadNewsItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("NewsItemId") + .HasColumnType("REAL"); + + b.Property("NewsItemUpdatedAt") + .HasColumnType("TEXT"); + + b.Property("UserId") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("ReadNewsItems"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserDashboardWidget", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ItemsPerPage") + .HasColumnType("INTEGER"); + + b.Property("Order") + .HasColumnType("INTEGER"); + + b.Property("Slot") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("UserId") + .HasColumnType("INTEGER"); + + b.Property("WidgetType") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserDashboardWidgets"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserFavoriteEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("DN") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("UserId") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserFavoriteEntries"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserNotification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("IsRead") + .HasColumnType("INTEGER"); + + b.Property("NotificationId") + .HasColumnType("INTEGER"); + + b.Property("UserId") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("NotificationId"); + + b.HasIndex("UserId"); + + b.ToTable("UserNotifications"); + }); + + modelBuilder.Entity("BLAZAM.Server.Data.ChatMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ChatRoomId") + .HasColumnType("INTEGER"); + + b.Property("Message") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Timestamp") + .HasColumnType("TEXT"); + + b.Property("UserId") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("ChatRoomId"); + + b.HasIndex("UserId"); + + b.ToTable("ChatMessages"); + }); + + modelBuilder.Entity("PermissionDelegatePermissionMapping", b => + { + b.Property("PermissionDelegatesId") + .HasColumnType("INTEGER"); + + b.Property("PermissionsMapsId") + .HasColumnType("INTEGER"); + + b.HasKey("PermissionDelegatesId", "PermissionsMapsId"); + + b.HasIndex("PermissionsMapsId"); + + b.ToTable("PermissionDelegatePermissionMapping"); + }); + + modelBuilder.Entity("AccessLevelFieldAccessMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.AccessLevel", null) + .WithMany() + .HasForeignKey("AccessLevelsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.Permissions.FieldAccessMapping", null) + .WithMany() + .HasForeignKey("FieldMapId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AccessLevelObjectAccessMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.AccessLevel", null) + .WithMany() + .HasForeignKey("AccessLevelsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.Permissions.ObjectAccessMapping", null) + .WithMany() + .HasForeignKey("ObjectMapId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AccessLevelPermissionMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.AccessLevel", null) + .WithMany() + .HasForeignKey("AccessLevelsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.Permissions.PermissionMapping", null) + .WithMany() + .HasForeignKey("PermissionMapsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AppUserChatRoom", b => + { + b.HasOne("BLAZAM.Database.Models.Chat.ChatRoom", null) + .WithMany() + .HasForeignKey("ChatRoomId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.User.AppUser", null) + .WithMany() + .HasForeignKey("MembersId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.ActiveDirectoryFieldObjectType", b => + { + b.HasOne("BLAZAM.Database.Models.CustomActiveDirectoryField", null) + .WithMany("ObjectTypes") + .HasForeignKey("CustomActiveDirectoryFieldId"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Chat.UnreadChatMessage", b => + { + b.HasOne("BLAZAM.Server.Data.ChatMessage", "ChatMessage") + .WithMany("NotReadBy") + .HasForeignKey("ChatMessageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ChatMessage"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Notifications.NotificationSubscription", b => + { + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany("NotificationSubscriptions") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Notifications.SubscriptionNotificationType", b => + { + b.HasOne("BLAZAM.Database.Models.Notifications.NotificationSubscription", "NotificationSubscription") + .WithMany("NotificationTypes") + .HasForeignKey("NotificationSubscriptionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NotificationSubscription"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ActionAccessMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.AccessLevel", null) + .WithMany("ActionMap") + .HasForeignKey("AccessLevelId"); + + b.HasOne("BLAZAM.Database.Models.Permissions.ObjectAction", "ObjectAction") + .WithMany() + .HasForeignKey("ObjectActionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ObjectAction"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.FieldAccessMapping", b => + { + b.HasOne("BLAZAM.Database.Models.CustomActiveDirectoryField", "CustomField") + .WithMany() + .HasForeignKey("CustomFieldId"); + + b.HasOne("BLAZAM.Database.Models.Permissions.FieldAccessLevel", "FieldAccessLevel") + .WithMany() + .HasForeignKey("FieldAccessLevelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.ActiveDirectoryField", "Field") + .WithMany() + .HasForeignKey("FieldId"); + + b.Navigation("CustomField"); + + b.Navigation("Field"); + + b.Navigation("FieldAccessLevel"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.ObjectAccessLevel", "ObjectAccessLevel") + .WithMany("ObjectAccessMappings") + .HasForeignKey("ObjectAccessLevelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ObjectAccessLevel"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplate", b => + { + b.HasOne("BLAZAM.Database.Models.Templates.DirectoryTemplate", "ParentTemplate") + .WithMany() + .HasForeignKey("ParentTemplateId"); + + b.Navigation("ParentTemplate"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateFieldValue", b => + { + b.HasOne("BLAZAM.Database.Models.CustomActiveDirectoryField", "CustomField") + .WithMany() + .HasForeignKey("CustomFieldId"); + + b.HasOne("BLAZAM.Database.Models.Templates.DirectoryTemplate", null) + .WithMany("FieldValues") + .HasForeignKey("DirectoryTemplateId"); + + b.HasOne("BLAZAM.Database.Models.ActiveDirectoryField", "Field") + .WithMany() + .HasForeignKey("FieldId"); + + b.Navigation("CustomField"); + + b.Navigation("Field"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateGroup", b => + { + b.HasOne("BLAZAM.Database.Models.Templates.DirectoryTemplate", null) + .WithMany("AssignedGroupSids") + .HasForeignKey("DirectoryTemplateId"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.ReadNewsItem", b => + { + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany("ReadNewsItems") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserDashboardWidget", b => + { + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany("DashboardWidgets") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserFavoriteEntry", b => + { + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany("FavoriteEntries") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.UserNotification", b => + { + b.HasOne("BLAZAM.Database.Models.User.NotificationMessage", "Notification") + .WithMany() + .HasForeignKey("NotificationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany("Messages") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Notification"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BLAZAM.Server.Data.ChatMessage", b => + { + b.HasOne("BLAZAM.Database.Models.Chat.ChatRoom", "ChatRoom") + .WithMany("Messages") + .HasForeignKey("ChatRoomId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.User.AppUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ChatRoom"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("PermissionDelegatePermissionMapping", b => + { + b.HasOne("BLAZAM.Database.Models.Permissions.PermissionDelegate", null) + .WithMany() + .HasForeignKey("PermissionDelegatesId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BLAZAM.Database.Models.Permissions.PermissionMapping", null) + .WithMany() + .HasForeignKey("PermissionsMapsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Chat.ChatRoom", b => + { + b.Navigation("Messages"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.CustomActiveDirectoryField", b => + { + b.Navigation("ObjectTypes"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Notifications.NotificationSubscription", b => + { + b.Navigation("NotificationTypes"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.AccessLevel", b => + { + b.Navigation("ActionMap"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessLevel", b => + { + b.Navigation("ObjectAccessMappings"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplate", b => + { + b.Navigation("AssignedGroupSids"); + + b.Navigation("FieldValues"); + }); + + modelBuilder.Entity("BLAZAM.Database.Models.User.AppUser", b => + { + b.Navigation("DashboardWidgets"); + + b.Navigation("FavoriteEntries"); + + b.Navigation("Messages"); + + b.Navigation("NotificationSubscriptions"); + + b.Navigation("ReadNewsItems"); + }); + + modelBuilder.Entity("BLAZAM.Server.Data.ChatMessage", b => + { + b.Navigation("NotReadBy"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/BLAZAMDatabase/Migrations/Sqlite/20240917020454_Add_ItemsPerWidgetPage_Sqlite.cs b/BLAZAMDatabase/Migrations/Sqlite/20240917020454_Add_ItemsPerWidgetPage_Sqlite.cs new file mode 100644 index 00000000..730717a7 --- /dev/null +++ b/BLAZAMDatabase/Migrations/Sqlite/20240917020454_Add_ItemsPerWidgetPage_Sqlite.cs @@ -0,0 +1,29 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BLAZAM.Database.Migrations.Sqlite +{ + /// + public partial class Add_ItemsPerWidgetPage_Sqlite : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ItemsPerPage", + table: "UserDashboardWidgets", + type: "INTEGER", + nullable: false, + defaultValue: 0); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ItemsPerPage", + table: "UserDashboardWidgets"); + } + } +} diff --git a/BLAZAMDatabase/Migrations/Sqlite/SqliteDatabaseContextModelSnapshot.cs b/BLAZAMDatabase/Migrations/Sqlite/SqliteDatabaseContextModelSnapshot.cs index 865c8aea..763d3846 100644 --- a/BLAZAMDatabase/Migrations/Sqlite/SqliteDatabaseContextModelSnapshot.cs +++ b/BLAZAMDatabase/Migrations/Sqlite/SqliteDatabaseContextModelSnapshot.cs @@ -15,7 +15,7 @@ partial class SqliteDatabaseContextModelSnapshot : ModelSnapshot protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.20"); + modelBuilder.HasAnnotation("ProductVersion", "8.0.8"); modelBuilder.Entity("AccessLevelFieldAccessMapping", b => { @@ -29,7 +29,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldMapId"); - b.ToTable("AccessLevelFieldAccessMapping", (string)null); + b.ToTable("AccessLevelFieldAccessMapping"); }); modelBuilder.Entity("AccessLevelObjectAccessMapping", b => @@ -44,7 +44,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectMapId"); - b.ToTable("AccessLevelObjectAccessMapping", (string)null); + b.ToTable("AccessLevelObjectAccessMapping"); }); modelBuilder.Entity("AccessLevelPermissionMapping", b => @@ -59,7 +59,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("PermissionMapsId"); - b.ToTable("AccessLevelPermissionMapping", (string)null); + b.ToTable("AccessLevelPermissionMapping"); }); modelBuilder.Entity("AppUserChatRoom", b => @@ -74,7 +74,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("MembersId"); - b.ToTable("AppUserChatRoom", (string)null); + b.ToTable("AppUserChatRoom"); }); modelBuilder.Entity("BLAZAM.Database.Models.ADSettings", b => @@ -110,7 +110,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ActiveDirectorySettings", null, t => + b.ToTable("ActiveDirectorySettings", t => { t.HasCheckConstraint("CK_Table_Column", "[Id] = 1"); }); @@ -135,7 +135,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ActiveDirectoryFields", (string)null); + b.ToTable("ActiveDirectoryFields"); b.HasData( new @@ -418,7 +418,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("CustomActiveDirectoryFieldId"); - b.ToTable("ActiveDirectoryFieldObjectMappings", (string)null); + b.ToTable("ActiveDirectoryFieldObjectMappings"); }); modelBuilder.Entity("BLAZAM.Database.Models.AppSettings", b => @@ -490,7 +490,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AppSettings", null, t => + b.ToTable("AppSettings", t => { t.HasCheckConstraint("CK_Table_Column", "[Id] = 1"); }); @@ -531,7 +531,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("DirectoryEntryAuditLogs", (string)null); + b.ToTable("DirectoryEntryAuditLogs"); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.LogonAuditLog", b => @@ -565,7 +565,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("LogonAuditLog", (string)null); + b.ToTable("LogonAuditLog"); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.PermissionsAuditLog", b => @@ -599,7 +599,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("PermissionsAuditLog", (string)null); + b.ToTable("PermissionsAuditLog"); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.RequestAuditLog", b => @@ -633,7 +633,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("RequestAuditLog", (string)null); + b.ToTable("RequestAuditLog"); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.SettingsAuditLog", b => @@ -667,7 +667,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("SettingsAuditLog", (string)null); + b.ToTable("SettingsAuditLog"); }); modelBuilder.Entity("BLAZAM.Database.Models.Audit.SystemAuditLog", b => @@ -701,7 +701,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("SystemAuditLog", (string)null); + b.ToTable("SystemAuditLog"); }); modelBuilder.Entity("BLAZAM.Database.Models.AuthenticationSettings", b => @@ -733,7 +733,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AuthenticationSettings", null, t => + b.ToTable("AuthenticationSettings", t => { t.HasCheckConstraint("CK_Table_Column", "[Id] = 1"); }); @@ -773,7 +773,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ChatRooms", (string)null); + b.ToTable("ChatRooms"); }); modelBuilder.Entity("BLAZAM.Database.Models.Chat.UnreadChatMessage", b => @@ -795,7 +795,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ChatMessageId"); - b.ToTable("UnreadChatMessages", (string)null); + b.ToTable("UnreadChatMessages"); }); modelBuilder.Entity("BLAZAM.Database.Models.CustomActiveDirectoryField", b => @@ -820,7 +820,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("CustomActiveDirectoryFields", (string)null); + b.ToTable("CustomActiveDirectoryFields"); }); modelBuilder.Entity("BLAZAM.Database.Models.EmailSettings", b => @@ -867,7 +867,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("EmailSettings", null, t => + b.ToTable("EmailSettings", t => { t.HasCheckConstraint("CK_Table_Column", "[Id] = 1"); }); @@ -892,7 +892,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("EmailTemplates", (string)null); + b.ToTable("EmailTemplates"); }); modelBuilder.Entity("BLAZAM.Database.Models.Notifications.NotificationSubscription", b => @@ -924,7 +924,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("NotificationSubscriptions", (string)null); + b.ToTable("NotificationSubscriptions"); }); modelBuilder.Entity("BLAZAM.Database.Models.Notifications.SubscriptionNotificationType", b => @@ -943,7 +943,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("NotificationSubscriptionId"); - b.ToTable("SubscriptionNotificationType", (string)null); + b.ToTable("SubscriptionNotificationType"); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.AccessLevel", b => @@ -961,7 +961,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("AccessLevels", (string)null); + b.ToTable("AccessLevels"); b.HasData( new @@ -995,7 +995,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectActionId"); - b.ToTable("ActionAccessMapping", (string)null); + b.ToTable("ActionAccessMapping"); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.FieldAccessLevel", b => @@ -1013,7 +1013,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("FieldAccessLevel", (string)null); + b.ToTable("FieldAccessLevel"); b.HasData( new @@ -1062,7 +1062,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldId"); - b.ToTable("AccessLevelFieldMapping", (string)null); + b.ToTable("AccessLevelFieldMapping"); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAccessLevel", b => @@ -1080,7 +1080,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ObjectAccessLevel", (string)null); + b.ToTable("ObjectAccessLevel"); b.HasData( new @@ -1119,7 +1119,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ObjectAccessLevelId"); - b.ToTable("AccessLevelObjectMapping", (string)null); + b.ToTable("AccessLevelObjectMapping"); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.ObjectAction", b => @@ -1137,7 +1137,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ObjectActionFlag", (string)null); + b.ToTable("ObjectActionFlag"); b.HasData( new @@ -1220,7 +1220,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("DelegateSid") .IsUnique(); - b.ToTable("PermissionDelegate", (string)null); + b.ToTable("PermissionDelegate"); }); modelBuilder.Entity("BLAZAM.Database.Models.Permissions.PermissionMapping", b => @@ -1238,7 +1238,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("PermissionMap", (string)null); + b.ToTable("PermissionMap"); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplate", b => @@ -1297,7 +1297,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ParentTemplateId"); - b.ToTable("DirectoryTemplates", (string)null); + b.ToTable("DirectoryTemplates"); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateFieldValue", b => @@ -1332,7 +1332,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FieldId"); - b.ToTable("DirectoryTemplateFieldValues", (string)null); + b.ToTable("DirectoryTemplateFieldValues"); }); modelBuilder.Entity("BLAZAM.Database.Models.Templates.DirectoryTemplateGroup", b => @@ -1352,7 +1352,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("DirectoryTemplateId"); - b.ToTable("DirectoryTemplateGroups", (string)null); + b.ToTable("DirectoryTemplateGroups"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.AppUser", b => @@ -1394,7 +1394,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserGUID") .IsUnique(); - b.ToTable("UserSettings", (string)null); + b.ToTable("UserSettings"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.NotificationMessage", b => @@ -1426,7 +1426,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("NotificationMessages", (string)null); + b.ToTable("NotificationMessages"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.ReadNewsItem", b => @@ -1448,7 +1448,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("ReadNewsItems", (string)null); + b.ToTable("ReadNewsItems"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserDashboardWidget", b => @@ -1457,6 +1457,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); + b.Property("ItemsPerPage") + .HasColumnType("INTEGER"); + b.Property("Order") .HasColumnType("INTEGER"); @@ -1474,7 +1477,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserDashboardWidgets", (string)null); + b.ToTable("UserDashboardWidgets"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserFavoriteEntry", b => @@ -1494,7 +1497,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserFavoriteEntries", (string)null); + b.ToTable("UserFavoriteEntries"); }); modelBuilder.Entity("BLAZAM.Database.Models.User.UserNotification", b => @@ -1518,7 +1521,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("UserNotifications", (string)null); + b.ToTable("UserNotifications"); }); modelBuilder.Entity("BLAZAM.Server.Data.ChatMessage", b => @@ -1546,7 +1549,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UserId"); - b.ToTable("ChatMessages", (string)null); + b.ToTable("ChatMessages"); }); modelBuilder.Entity("PermissionDelegatePermissionMapping", b => @@ -1561,7 +1564,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("PermissionsMapsId"); - b.ToTable("PermissionDelegatePermissionMapping", (string)null); + b.ToTable("PermissionDelegatePermissionMapping"); }); modelBuilder.Entity("AccessLevelFieldAccessMapping", b => From 87aa046efa38d08b9f448acaf0f380aa1a9f9054 Mon Sep 17 00:00:00 2001 From: Chris Jacobsen Date: Tue, 17 Sep 2024 19:34:02 -0400 Subject: [PATCH 12/18] Centered Search Controls in AppBar --- BLAZAM/BLAZAM.csproj | 2 +- BLAZAMGui/Layouts/MainAppBar.razor | 8 +++----- BLAZAMGui/UI/Search/SearchControls.razor | 3 ++- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/BLAZAM/BLAZAM.csproj b/BLAZAM/BLAZAM.csproj index 6f09b172..463caf50 100644 --- a/BLAZAM/BLAZAM.csproj +++ b/BLAZAM/BLAZAM.csproj @@ -6,7 +6,7 @@ enable false 1.0.1 - 2024.09.17.0207 + 2024.09.17.2333 false BLAZAM False diff --git a/BLAZAMGui/Layouts/MainAppBar.razor b/BLAZAMGui/Layouts/MainAppBar.razor index 35db00c4..53ed3a44 100644 --- a/BLAZAMGui/Layouts/MainAppBar.razor +++ b/BLAZAMGui/Layouts/MainAppBar.razor @@ -4,7 +4,6 @@ - @if (mainLayout != null) { @@ -24,10 +23,10 @@ - + - + @if (mainLayout?.Header != null) { @mainLayout.Header.ChildContent @@ -35,7 +34,7 @@ } else { - + } @@ -43,7 +42,6 @@ - diff --git a/BLAZAMGui/UI/Search/SearchControls.razor b/BLAZAMGui/UI/Search/SearchControls.razor index b2740b9c..7682c819 100644 --- a/BLAZAMGui/UI/Search/SearchControls.razor +++ b/BLAZAMGui/UI/Search/SearchControls.razor @@ -1,4 +1,5 @@ @inherits AppComponentBase + - + @code { } From f51e2c3297f31bf9c4c25c24c924923a48b5713a Mon Sep 17 00:00:00 2001 From: Chris Jacobsen Date: Tue, 17 Sep 2024 19:39:19 -0400 Subject: [PATCH 13/18] Add changes to release notes --- .github/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/release.yml b/.github/release.yml index 53b51fe5..6cdb5291 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -16,6 +16,9 @@ changelog: - title: Exciting New Features 🎉 labels: - enhancement + - title: Feature Changes ✏ + labels: + - change - title: Security Updates 🔐 labels: - security From 386314a153e5f83ba09131dcc8219e1f459c305b Mon Sep 17 00:00:00 2001 From: Chris Jacobsen Date: Tue, 17 Sep 2024 20:32:30 -0400 Subject: [PATCH 14/18] Performance improvements to user preference saving --- BLAZAM/BLAZAM.csproj | 2 +- BLAZAMGui/Layouts/AppUserButton.razor | 2 +- BLAZAMGui/Layouts/MainLayout.razor | 4 +- .../Layouts/UserNotificationPopover.razor | 4 +- .../CurrentUserDashboardWidgets.razor | 6 +- BLAZAMGui/UI/Dashboard/Widgets/Widget.razor | 2 +- BLAZAMGui/UI/DirectoryEntryViewHeader.razor | 2 +- BLAZAMGui/UI/Modals/AppNewsItemDialog.razor | 2 +- .../Modals/AppUserProfileModalContent.razor | 2 +- .../UI/Outputs/ApplicationNewsProvider.razor | 2 +- BLAZAMServices/SearchService.cs | 2 +- BLAZAMSession/ApplicationNewsService.cs | 2 +- BLAZAMSession/ApplicationUserState.cs | 173 +++++++++++------- .../Interfaces/IApplicationUserState.cs | 9 +- 14 files changed, 129 insertions(+), 85 deletions(-) diff --git a/BLAZAM/BLAZAM.csproj b/BLAZAM/BLAZAM.csproj index 463caf50..e82a7bc6 100644 --- a/BLAZAM/BLAZAM.csproj +++ b/BLAZAM/BLAZAM.csproj @@ -6,7 +6,7 @@ enable false 1.0.1 - 2024.09.17.2333 + 2024.09.18.0029 false BLAZAM False diff --git a/BLAZAMGui/Layouts/AppUserButton.razor b/BLAZAMGui/Layouts/AppUserButton.razor index a37cd516..6bc7e8f1 100644 --- a/BLAZAMGui/Layouts/AppUserButton.razor +++ b/BLAZAMGui/Layouts/AppUserButton.razor @@ -93,7 +93,7 @@ UserState = CurrentUser.State; Notifications = UserState.Notifications; if (UserState != null) - UserState.OnSettingsChanged += (settings) => + UserState.OnSettingsChanged += () => { InvokeAsync(StateHasChanged); }; diff --git a/BLAZAMGui/Layouts/MainLayout.razor b/BLAZAMGui/Layouts/MainLayout.razor index 8e6c38b7..a4f4dcf5 100644 --- a/BLAZAMGui/Layouts/MainLayout.razor +++ b/BLAZAMGui/Layouts/MainLayout.razor @@ -189,7 +189,7 @@ await InvokeAsync(StateHasChanged); try { CurrentUser.State.Preferences.Theme = theme.Name; - CurrentUser.State.SaveUserSettings(); + CurrentUser.State.SaveBasicUserPreferences(); Nav.NavigateTo(Nav.Uri, true); } catch (Exception ex) @@ -206,7 +206,7 @@ await InvokeAsync(StateHasChanged); try { CurrentUser.State.Preferences.DarkMode = darkMode; - CurrentUser.State.SaveUserSettings(); + CurrentUser.State.SaveBasicUserPreferences(); Nav.NavigateTo(Nav.Uri, true); } catch (Exception ex) diff --git a/BLAZAMGui/Layouts/UserNotificationPopover.razor b/BLAZAMGui/Layouts/UserNotificationPopover.razor index b8f70dda..d5798ea3 100644 --- a/BLAZAMGui/Layouts/UserNotificationPopover.razor +++ b/BLAZAMGui/Layouts/UserNotificationPopover.razor @@ -14,7 +14,7 @@ - @foreach (var notification in messages) + @foreach (var notification in messages.Where(m=>!m.IsRead)) { { @@ -68,6 +68,8 @@ if (UserState.Notifications == null) return; foreach (var message in UserState.Notifications) { + message.IsRead = true; + await UserState.MarkRead(message); } await InvokeAsync(StateHasChanged); diff --git a/BLAZAMGui/UI/Dashboard/CurrentUserDashboardWidgets.razor b/BLAZAMGui/UI/Dashboard/CurrentUserDashboardWidgets.razor index 3638b6fa..75bfef0f 100644 --- a/BLAZAMGui/UI/Dashboard/CurrentUserDashboardWidgets.razor +++ b/BLAZAMGui/UI/Dashboard/CurrentUserDashboardWidgets.razor @@ -152,7 +152,7 @@ } } - CurrentUser.State.SaveUserSettings(); + CurrentUser.State.SaveDashboardWidgets(); } } return Task.CompletedTask; @@ -176,7 +176,7 @@ WidgetType = widgetType, Order = order }); - await CurrentUser.State.SaveUserSettings(); + await CurrentUser.State.SaveDashboardWidgets(); await InvokeAsync(StateHasChanged); widgetContainer?.Refresh(); } @@ -187,7 +187,7 @@ if (CurrentUser.State != null) { CurrentUser.State.Preferences?.DashboardWidgets.Remove(widget); - await CurrentUser.State.SaveUserSettings(); + await CurrentUser.State.SaveDashboardWidgets(); await InvokeAsync(StateHasChanged); diff --git a/BLAZAMGui/UI/Dashboard/Widgets/Widget.razor b/BLAZAMGui/UI/Dashboard/Widgets/Widget.razor index c9f1bec1..9b68681c 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/Widget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/Widget.razor @@ -23,6 +23,6 @@ protected async void SetRowsPerPage(int rowPerPage) { CurrentUser.State.Preferences.DashboardWidgets.FirstOrDefault(w=>w.WidgetType.Equals(WidgetType)).ItemsPerPage=rowPerPage; - CurrentUser.State.SaveUserSettings(); + CurrentUser.State.SaveDashboardWidgets(); } } diff --git a/BLAZAMGui/UI/DirectoryEntryViewHeader.razor b/BLAZAMGui/UI/DirectoryEntryViewHeader.razor index 8c863691..ed42059c 100644 --- a/BLAZAMGui/UI/DirectoryEntryViewHeader.razor +++ b/BLAZAMGui/UI/DirectoryEntryViewHeader.razor @@ -326,7 +326,7 @@ { CurrentUser.State.Preferences.FavoriteEntries.Add(newFavorrite); } - await CurrentUser.State.SaveUserSettings(); + await CurrentUser.State.SaveBasicUserPreferences(); } catch (Exception ex) { diff --git a/BLAZAMGui/UI/Modals/AppNewsItemDialog.razor b/BLAZAMGui/UI/Modals/AppNewsItemDialog.razor index 997a7ca4..8839b11b 100644 --- a/BLAZAMGui/UI/Modals/AppNewsItemDialog.razor +++ b/BLAZAMGui/UI/Modals/AppNewsItemDialog.razor @@ -53,7 +53,7 @@ } MudDialog.Close(DialogResult.Ok(true)); - await CurrentUser.State.SaveUserSettings(); + await CurrentUser.State.SaveReadNewsItems(); OnAcknowledged?.Invoke(); } } diff --git a/BLAZAMGui/UI/Modals/AppUserProfileModalContent.razor b/BLAZAMGui/UI/Modals/AppUserProfileModalContent.razor index 9e8ab029..ad589f04 100644 --- a/BLAZAMGui/UI/Modals/AppUserProfileModalContent.razor +++ b/BLAZAMGui/UI/Modals/AppUserProfileModalContent.razor @@ -72,7 +72,7 @@ { LoadingData = true; await Modal.RefreshView(); - if (await CurrentUser.State.SaveUserSettings()) + if (await CurrentUser.State.SaveAllUserSettings()) { SnackBarService.Success(AppLocalization["Settings saved"]); diff --git a/BLAZAMGui/UI/Outputs/ApplicationNewsProvider.razor b/BLAZAMGui/UI/Outputs/ApplicationNewsProvider.razor index b7b7559f..1742663b 100644 --- a/BLAZAMGui/UI/Outputs/ApplicationNewsProvider.razor +++ b/BLAZAMGui/UI/Outputs/ApplicationNewsProvider.razor @@ -134,7 +134,7 @@ } } - await CurrentUser.State.SaveUserSettings(); + await CurrentUser.State.SaveReadNewsItems(); RefreshItems(); await InvokeAsync(StateHasChanged); diff --git a/BLAZAMServices/SearchService.cs b/BLAZAMServices/SearchService.cs index 7030eeb7..5094701c 100644 --- a/BLAZAMServices/SearchService.cs +++ b/BLAZAMServices/SearchService.cs @@ -47,7 +47,7 @@ async Task DisabledOptionChanged() try { _userStateService.CurrentUserState.Preferences.SearchDisabledUsers = IncludeDisabled; - await _userStateService.CurrentUserState.SaveUserSettings(); + await _userStateService.CurrentUserState.SaveBasicUserPreferences(); } catch { diff --git a/BLAZAMSession/ApplicationNewsService.cs b/BLAZAMSession/ApplicationNewsService.cs index 1f67e8af..f4f124d6 100644 --- a/BLAZAMSession/ApplicationNewsService.cs +++ b/BLAZAMSession/ApplicationNewsService.cs @@ -114,7 +114,7 @@ public List GetUnreadNewsItems(IApplicationUserState user) { user.ReadNewsItems.Remove(x); }); - user.SaveUserSettings(); + user.SaveReadNewsItems(); } } return unreadItems; diff --git a/BLAZAMSession/ApplicationUserState.cs b/BLAZAMSession/ApplicationUserState.cs index 6d5524a7..044f4769 100644 --- a/BLAZAMSession/ApplicationUserState.cs +++ b/BLAZAMSession/ApplicationUserState.cs @@ -30,7 +30,7 @@ namespace BLAZAM.Server.Data.Services public class ApplicationUserState : IApplicationUserState { - public AppEvent OnSettingsChanged { get; set; } + public AppEvent OnSettingsChanged { get; set; } public ClaimsPrincipal User { get; set; } @@ -47,7 +47,7 @@ public class ApplicationUserState : IApplicationUserState public string? IPAddress { get; set; } - public List FavoriteEntries => userSettings?.FavoriteEntries?? new List(); + public List FavoriteEntries => userSettings?.FavoriteEntries ?? new List(); public IList? Notifications { @@ -60,10 +60,10 @@ public IList? Notifications } } - public IList ReadNewsItems => Preferences?.ReadNewsItems??new(); + public IList ReadNewsItems => Preferences?.ReadNewsItems ?? new(); //public List ReadChatMessages => Preferences.ReadChatMessages.ToList(); - public int Id => Preferences!=null?Preferences.Id:0; + public int Id => Preferences != null ? Preferences.Id : 0; //public bool IsChatMessageRead(ChatMessage message) @@ -83,13 +83,8 @@ public ApplicationUserState(IAppDatabaseFactory factory) { _dbFactory = factory; - - OnSettingsChanged += (state) => { - if (Id == state.Id) - { - } - }; + } @@ -111,6 +106,7 @@ public AppUser? Preferences public async Task MarkRead(UserNotification notification) { + notification.IsRead = true; using var context = await _dbFactory.CreateDbContextAsync(); var message = context.UserNotifications.Where(un => un.Id == notification.Id).FirstOrDefault(); ; if (message != null) @@ -120,10 +116,10 @@ public async Task MarkRead(UserNotification notification) if (result == 1) { - GetUserSettingFromDB(); + //GetUserSettingFromDB(); if (userSettings != null) { - OnSettingsChanged?.Invoke(userSettings); + OnSettingsChanged?.Invoke(); } return true; @@ -139,7 +135,7 @@ private void GetUserSettingFromDB() if (User == null) return; using var context = _dbFactory.CreateDbContext(); - userSettings = context.UserSettings.Include(x=>x.NotificationSubscriptions).Where(us => us.UserGUID == User.FindFirstValue(ClaimTypes.Sid)).FirstOrDefault(); + userSettings = context.UserSettings.Include(x => x.NotificationSubscriptions).Where(us => us.UserGUID == User.FindFirstValue(ClaimTypes.Sid)).FirstOrDefault(); if (userSettings == null) { userSettings = new AppUser(); @@ -151,22 +147,23 @@ private void GetUserSettingFromDB() userSettings.UserGUID = User.FindFirstValue(ClaimTypes.Sid); userSettings.Username = User.Identity?.Name; context.UserSettings.Add(userSettings); - + context.SaveChanges(); } - else if (Preferences!=null && Preferences.Email == null) + else if (Preferences != null && Preferences.Email == null) { var emailClaim = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Email); if (emailClaim != null && !emailClaim.Value.IsNullOrEmpty()) { - - Preferences.Email = emailClaim.Value; - Task.Run(() => { - Task.Delay(1000).Wait(); - SaveUserSettings(); - }); + Preferences.Email = emailClaim.Value; + Task.Run(() => + { + Task.Delay(1000).Wait(); + SaveBasicUserPreferences(); + + }); } } @@ -179,67 +176,108 @@ private void GetUserSettingFromDB() } - public async Task SaveUserSettings() + public async Task SaveAllUserSettings() { - try - { - using var context = await _dbFactory.CreateDbContextAsync(); - var dbUserSettings = await context.UserSettings.Where(us => us.UserGUID == User.FindFirstValue(ClaimTypes.Sid)).FirstOrDefaultAsync(); - if (dbUserSettings != null) - { - dbUserSettings.Theme = this.Preferences?.Theme; - dbUserSettings.DarkMode = this.Preferences?.DarkMode == true; - dbUserSettings.ProfilePicture = this.Preferences?.ProfilePicture; - dbUserSettings.SearchDisabledUsers = this.Preferences?.SearchDisabledUsers == true; - dbUserSettings.SearchDisabledComputers = this.Preferences?.SearchDisabledComputers == true; - dbUserSettings.FavoriteEntries = this.Preferences?.FavoriteEntries??new(); - dbUserSettings.Email = this.Preferences?.Email; - dbUserSettings.ReadNewsItems = this.Preferences?.ReadNewsItems??new(); - SaveDashboardWidgets(dbUserSettings); - await context.SaveChangesAsync(); - GetUserSettingFromDB(); - OnSettingsChanged?.Invoke(dbUserSettings); - return true; - } + await SaveBasicUserPreferences(); + await SaveReadNewsItems(); + await SaveDashboardWidgets(); + //GetUserSettingFromDB(); + OnSettingsChanged?.Invoke(); - } - catch + return true; + + } + public async Task SaveBasicUserPreferences() + { + if (Preferences != null) { + try + { + using var context = await _dbFactory.CreateDbContextAsync(); + var dbUserSettings = await context.UserSettings.Where(us => us.UserGUID == User.FindFirstValue(ClaimTypes.Sid)).FirstOrDefaultAsync(); + if (dbUserSettings != null) + { + dbUserSettings.Theme = this.Preferences?.Theme; + dbUserSettings.DarkMode = this.Preferences?.DarkMode == true; + dbUserSettings.ProfilePicture = this.Preferences?.ProfilePicture; + dbUserSettings.SearchDisabledUsers = this.Preferences?.SearchDisabledUsers == true; + dbUserSettings.SearchDisabledComputers = this.Preferences?.SearchDisabledComputers == true; + dbUserSettings.FavoriteEntries = this.Preferences?.FavoriteEntries ?? new(); + dbUserSettings.Email = this.Preferences?.Email; + await context.SaveChangesAsync(); + + } + + } + catch { } } - return false; } - - private void SaveDashboardWidgets(AppUser? dbUserSettings) + public async Task SaveReadNewsItems() { if (Preferences != null) { - foreach (var widget in Preferences.DashboardWidgets) + try { - var matchingWidget = dbUserSettings?.DashboardWidgets.FirstOrDefault(w => w.WidgetType == widget.WidgetType); - if (matchingWidget != null) + using var context = await _dbFactory.CreateDbContextAsync(); + var dbUserSettings = await context.UserSettings.Where(us => us.UserGUID == User.FindFirstValue(ClaimTypes.Sid)).FirstOrDefaultAsync(); + if (dbUserSettings != null) { - matchingWidget.Slot = widget.Slot; - matchingWidget.Order = widget.Order; - matchingWidget.ItemsPerPage = widget.ItemsPerPage; - } - else - { - dbUserSettings?.DashboardWidgets.Add(widget); + dbUserSettings.ReadNewsItems = this.Preferences?.ReadNewsItems ?? new(); + + await context.SaveChangesAsync(); + } + } - var widgetsInDB = new List(dbUserSettings?.DashboardWidgets); - foreach (var widget in widgetsInDB) + catch { } + + } + } + + public async Task SaveDashboardWidgets() + { + if (Preferences != null) + { + try { - if (!this.Preferences.DashboardWidgets.Any(w => w.WidgetType == widget.WidgetType)) + using var context = await _dbFactory.CreateDbContextAsync(); + var dbUserSettings = await context.UserSettings.Where(us => us.UserGUID == User.FindFirstValue(ClaimTypes.Sid)).FirstOrDefaultAsync(); + if (dbUserSettings != null) { - dbUserSettings.DashboardWidgets.Remove(widget); + foreach (var widget in Preferences.DashboardWidgets) + { + var matchingWidget = dbUserSettings?.DashboardWidgets.FirstOrDefault(w => w.WidgetType == widget.WidgetType); + if (matchingWidget != null) + { + matchingWidget.Slot = widget.Slot; + matchingWidget.Order = widget.Order; + matchingWidget.ItemsPerPage = widget.ItemsPerPage; + } + else + { + dbUserSettings?.DashboardWidgets.Add(widget); + } + } + var widgetsInDB = new List(dbUserSettings?.DashboardWidgets); + foreach (var widget in widgetsInDB) + { + if (!this.Preferences.DashboardWidgets.Any(w => w.WidgetType == widget.WidgetType)) + { + dbUserSettings.DashboardWidgets.Remove(widget); + } + + } + await context.SaveChangesAsync(); + } } + catch { } + } } @@ -329,11 +367,11 @@ public bool HasRole(string userRole) public bool HasCreateOUPrivilege => HasObjectCreatePermissions(ActiveDirectoryObjectType.OU); public bool HasComputerPrivilege => HasObjectReadPermissions(ActiveDirectoryObjectType.Computer); - public bool CanUnlockUsers => HasObjectActionPermission(ActiveDirectoryObjectType.User,ObjectActions.Unlock); + public bool CanUnlockUsers => HasObjectActionPermission(ActiveDirectoryObjectType.User, ObjectActions.Unlock); public bool CanAssign => HasObjectActionPermission(ActiveDirectoryObjectType.Group, ObjectActions.Assign); public string DuoAuthState { get; set; } = ""; - public List NotificationSubscriptions { get => userSettings?.NotificationSubscriptions; set { userSettings.NotificationSubscriptions=value; } } + public List NotificationSubscriptions { get => userSettings?.NotificationSubscriptions; set { userSettings.NotificationSubscriptions = value; } } private bool HasObjectActionPermission(ActiveDirectoryObjectType objectType, ObjectAction actionType) { @@ -358,7 +396,8 @@ private bool HasObjectActionPermission(ActiveDirectoryObjectType objectType, Obj /// /// /// - private bool HasPermission(ActiveDirectoryObjectType objectType, Func, IEnumerable> allowSelector, Func, IEnumerable>? denySelector = null) { + private bool HasPermission(ActiveDirectoryObjectType objectType, Func, IEnumerable> allowSelector, Func, IEnumerable>? denySelector = null) + { if (IsSuperAdmin) return true; @@ -449,7 +488,7 @@ private bool HasObjectCreatePermissions(ActiveDirectoryObjectType objectType) public bool HasPermission(string dnTarget, Func, IEnumerable> allowSelector, Func, IEnumerable>? denySelector, bool nestedSearch) { if (IsSuperAdmin) return true; - + IOrderedEnumerable? baseSearch = null; if (!nestedSearch) { @@ -504,7 +543,7 @@ public bool HasPermission(string dnTarget, Func, } return false; } - + public bool HasActionPermission(string dnTarget, ObjectAction action, ActiveDirectoryObjectType objectType) { return HasPermission(dnTarget, p => p.Where(pm => @@ -516,7 +555,7 @@ public bool HasActionPermission(string dnTarget, ObjectAction action, ActiveDire pm.AccessLevels.Any(al => al.ActionMap.Any(am => !am.AllowOrDeny && am.ObjectAction.Id == action.Id && am.ObjectType == objectType - ))),false + ))), false ); } } diff --git a/BLAZAMSession/Interfaces/IApplicationUserState.cs b/BLAZAMSession/Interfaces/IApplicationUserState.cs index 72362c9a..e44306e2 100644 --- a/BLAZAMSession/Interfaces/IApplicationUserState.cs +++ b/BLAZAMSession/Interfaces/IApplicationUserState.cs @@ -14,7 +14,7 @@ namespace BLAZAM.Session.Interfaces public interface IApplicationUserState { public int Id { get; } - AppEvent OnSettingsChanged { get; set; } + AppEvent OnSettingsChanged { get; set; } /// /// Returns the combined names of the user, and if applicable, the impersonators username @@ -50,7 +50,7 @@ public interface IApplicationUserState /// /// /// Changes made to the returned object are not saved - /// until is called + /// until is called /// AppUser Preferences { get; } @@ -95,9 +95,12 @@ public interface IApplicationUserState /// Saves the current state of the to the database ///
/// - Task SaveUserSettings(); + Task SaveAllUserSettings(); Task MarkRead(UserNotification notification); bool HasPermission(string dnTarget, Func, IEnumerable> allowSelector, Func, IEnumerable>? denySelector, bool nestedSearch); bool HasActionPermission(string dnTarget, ObjectAction action, ActiveDirectoryObjectType objectType); + Task SaveDashboardWidgets(); + Task SaveReadNewsItems(); + Task SaveBasicUserPreferences(); } } \ No newline at end of file From b69239713810ec9745a9a4d6508b448b67f97c31 Mon Sep 17 00:00:00 2001 From: Chris Jacobsen Date: Wed, 18 Sep 2024 19:15:48 -0400 Subject: [PATCH 15/18] Fix for slow notification posting --- .../Background/OUNotificationService.cs | 144 +++++++++--------- 1 file changed, 73 insertions(+), 71 deletions(-) diff --git a/BLAZAMServices/Background/OUNotificationService.cs b/BLAZAMServices/Background/OUNotificationService.cs index 9a4b5730..02c904f4 100644 --- a/BLAZAMServices/Background/OUNotificationService.cs +++ b/BLAZAMServices/Background/OUNotificationService.cs @@ -30,88 +30,90 @@ public OUNotificationService(IAppDatabaseFactory databaseFactory, INotificationP private IDatabaseContext Context => _databaseFactory.CreateDbContext(); public async Task PostAsync(IDirectoryEntryAdapter source, NotificationType notificationType) { - await Task.Delay(150); - var context = Context; - string notificationTitle; - notificationTitle = _appLocalization[source.ObjectType.ToString()] + " "; - - string notificationBody; - NotificationTemplateComponent? emailMessage = null; - notificationBody = "" + source.CanonicalName + " "; + await Task.Run(async() => { + var context = Context; + string notificationTitle; + notificationTitle = _appLocalization[source.ObjectType.ToString()] + " "; - switch (notificationType) - { - case NotificationType.Create: - notificationTitle += _appLocalization["Created"]; - notificationBody += _appLocalization["was created at "] + source.Created?.ToLocalTime(); - var createdMessage = NotificationType.Create.ToNotification(); - createdMessage.EntryName = source.CanonicalName; - emailMessage = createdMessage; - break; - case NotificationType.Delete: - notificationTitle += _appLocalization["Deleted"]; - notificationBody += _appLocalization["was deleted at "] + source.LastChanged?.ToLocalTime(); - var deletedMessage = NotificationType.Delete.ToNotification(); - deletedMessage.EntryName = source.CanonicalName; - emailMessage = deletedMessage; - break; - case NotificationType.Modify: - notificationTitle += _appLocalization["Modified"]; - notificationBody += _appLocalization["was modified at "] + source.LastChanged?.ToLocalTime(); - var editedMessage = NotificationType.Modify.ToNotification(); - editedMessage.EntryName = source.CanonicalName; - emailMessage = editedMessage; - break; - case NotificationType.GroupAssignment: - notificationTitle += _appLocalization["Group Membership Changed"]; - notificationBody += _appLocalization["was modified at "] + source.LastChanged?.ToLocalTime(); - - var groupMembershipMessage = NotificationType.GroupAssignment.ToNotification(); - groupMembershipMessage.EntryName = source.CanonicalName; - emailMessage = groupMembershipMessage; - break; - case NotificationType.PasswordChange: - notificationTitle += _appLocalization["Password Reset"]; - notificationBody += _appLocalization["had a password reset at "] + source.LastChanged?.ToLocalTime(); - var passwordChangeMessage = NotificationType.PasswordChange.ToNotification(); - passwordChangeMessage.EntryName = source.CanonicalName; - emailMessage = passwordChangeMessage; - break; + string notificationBody; + NotificationTemplateComponent? emailMessage = null; + notificationBody = "" + source.CanonicalName + " "; - } - var notification = new NotificationMessage(); - notification.Title = notificationTitle; - notification.Message = notificationBody; - notification.Dismissable = true; - notification.Created = DateTime.Now; - notification.Level = NotificationLevel.Info; - var _emailConfigured = _emailService.IsConfigured; - - foreach (var user in Context.UserSettings.ToList()) - { - var effectiveInAppSubscriptions = CalculateEffectiveInAppSubscriptions(user, source); - var effectiveEmailSubscriptions = CalculateEffectiveEmailSubscriptions(user, source); - if (effectiveInAppSubscriptions.NotificationTypes.Any(x => x.NotificationType == notificationType)) + switch (notificationType) { - await _notificationPublisher.PublishNotification(user, notification); + case NotificationType.Create: + notificationTitle += _appLocalization["Created"]; + notificationBody += _appLocalization["was created at "] + source.Created?.ToLocalTime(); + var createdMessage = NotificationType.Create.ToNotification(); + createdMessage.EntryName = source.CanonicalName; + emailMessage = createdMessage; + break; + case NotificationType.Delete: + notificationTitle += _appLocalization["Deleted"]; + notificationBody += _appLocalization["was deleted at "] + source.LastChanged?.ToLocalTime(); + var deletedMessage = NotificationType.Delete.ToNotification(); + deletedMessage.EntryName = source.CanonicalName; + emailMessage = deletedMessage; + break; + case NotificationType.Modify: + notificationTitle += _appLocalization["Modified"]; + notificationBody += _appLocalization["was modified at "] + source.LastChanged?.ToLocalTime(); + var editedMessage = NotificationType.Modify.ToNotification(); + editedMessage.EntryName = source.CanonicalName; + emailMessage = editedMessage; + break; + case NotificationType.GroupAssignment: + notificationTitle += _appLocalization["Group Membership Changed"]; + notificationBody += _appLocalization["was modified at "] + source.LastChanged?.ToLocalTime(); + + var groupMembershipMessage = NotificationType.GroupAssignment.ToNotification(); + groupMembershipMessage.EntryName = source.CanonicalName; + emailMessage = groupMembershipMessage; + break; + case NotificationType.PasswordChange: + notificationTitle += _appLocalization["Password Reset"]; + notificationBody += _appLocalization["had a password reset at "] + source.LastChanged?.ToLocalTime(); + var passwordChangeMessage = NotificationType.PasswordChange.ToNotification(); + passwordChangeMessage.EntryName = source.CanonicalName; + emailMessage = passwordChangeMessage; + break; + } - if (effectiveEmailSubscriptions.NotificationTypes.Any(x => x.NotificationType == notificationType)) + var notification = new NotificationMessage(); + notification.Title = notificationTitle; + notification.Message = notificationBody; + notification.Dismissable = true; + notification.Created = DateTime.Now; + notification.Level = NotificationLevel.Info; + var _emailConfigured = _emailService.IsConfigured; + + foreach (var user in Context.UserSettings.ToList()) { - if (emailMessage != null) + var effectiveInAppSubscriptions = CalculateEffectiveInAppSubscriptions(user, source); + var effectiveEmailSubscriptions = CalculateEffectiveEmailSubscriptions(user, source); + if (effectiveInAppSubscriptions.NotificationTypes.Any(x => x.NotificationType == notificationType)) + { + await _notificationPublisher.PublishNotification(user, notification); + } + if (effectiveEmailSubscriptions.NotificationTypes.Any(x => x.NotificationType == notificationType)) { - if (_emailConfigured && !user.Email.IsNullOrEmpty()) + if (emailMessage != null) { - await _emailService.SendMessage(notificationTitle, emailMessage, user.Email); + if (_emailConfigured && !user.Email.IsNullOrEmpty()) + { + await _emailService.SendMessage(notificationTitle, emailMessage, user.Email); + } + } + else + { + var error = new ApplicationException(); + Loggers.SystemLogger.Error("Email message template was not found! {@Error}", error); } - } - else - { - var error = new ApplicationException(); - Loggers.SystemLogger.Error("Email message template was not found! {@Error}", error); } } - } + }); + } public NotificationSubscription CalculateEffectiveEmailSubscriptions(AppUser user, IDirectoryEntryAdapter ou) { From 507b2c658fb9eae79c60784bd2b4ccef14a57cef Mon Sep 17 00:00:00 2001 From: Chris Jacobsen Date: Wed, 18 Sep 2024 19:16:07 -0400 Subject: [PATCH 16/18] Improved User settings implementation --- BLAZAM/BLAZAM.csproj | 4 +- BLAZAMGui/Layouts/AppUserButton.razor | 4 +- .../Layouts/UserNotificationPopover.razor | 56 +++++++++++-------- BLAZAMSession/ApplicationUserStateService.cs | 2 +- 4 files changed, 37 insertions(+), 29 deletions(-) diff --git a/BLAZAM/BLAZAM.csproj b/BLAZAM/BLAZAM.csproj index e82a7bc6..611f55e3 100644 --- a/BLAZAM/BLAZAM.csproj +++ b/BLAZAM/BLAZAM.csproj @@ -5,8 +5,8 @@ enable enable false - 1.0.1 - 2024.09.18.0029 + 1.0.2 + 2024.09.18.2313 false BLAZAM False diff --git a/BLAZAMGui/Layouts/AppUserButton.razor b/BLAZAMGui/Layouts/AppUserButton.razor index 6bc7e8f1..de8ed046 100644 --- a/BLAZAMGui/Layouts/AppUserButton.razor +++ b/BLAZAMGui/Layouts/AppUserButton.razor @@ -8,9 +8,9 @@ var avatarBgColor = GenerateAvatarColor(UserState?.Username); } - @if (Notifications?.Count > 0) + @if (Notifications.Where(n=>!n.IsRead).Count() > 0) { - + } diff --git a/BLAZAMGui/Layouts/UserNotificationPopover.razor b/BLAZAMGui/Layouts/UserNotificationPopover.razor index d5798ea3..1c528832 100644 --- a/BLAZAMGui/Layouts/UserNotificationPopover.razor +++ b/BLAZAMGui/Layouts/UserNotificationPopover.razor @@ -3,34 +3,36 @@ @if (messages.Count > 0) { + TransformOrigin="Origin.TopRight" + AnchorOrigin="Origin.BottomRight"> Notifications - - + + {Open=false;}) /> - @foreach (var notification in messages.Where(m=>!m.IsRead)) - { + @foreach (var notification in messages.Where(m => !m.IsRead)) + { - { + { if(notification.Notification.Link!=null) - Nav.NavigateTo(notification.Notification.Link.ToString()); + Nav.NavigateTo(notification.Notification.Link.ToString()); }) ShowCloseIcon=notification.Notification.Dismissable - CloseIconClicked="@(async()=>{await UserState.MarkRead(notification); await InvokeAsync(StateHasChanged);})"> + CloseIconClicked="@(async()=>{ + await UserState.MarkRead(notification); + await InvokeAsync(StateHasChanged); + })"> @if (!notification.Notification.Title.IsNullOrEmpty()) - { - @notification.Notification.Title - } - + { + @notification.Notification.Title + } + @((MarkupString)notification.Notification.Message) - - } + + } @@ -39,26 +41,31 @@ @code { private bool _open; private IList messages = new List(); - protected override void OnInitialized(){ + protected override void OnInitialized() + { base.OnInitialized(); messages = UserState.Notifications; - NotificationPublisher.OnNotificationPublished += (notification) => { + NotificationPublisher.OnNotificationPublished += (notification) => + { messages = UserState.Notifications; - InvokeAsync(StateHasChanged); + InvokeAsync(StateHasChanged); }; } [Parameter] - public bool Open { get=>_open; set + public bool Open + { + get => _open; set { if (_open == value) return; _open = value; OpenChanged.InvokeAsync(value); - } } + } + } [Parameter] - public EventCallback OpenChanged { get; set; } + public EventCallback OpenChanged { get; set; } [Parameter] public IApplicationUserState UserState { get; set; } @@ -66,14 +73,15 @@ async Task MarkAllRead() { if (UserState.Notifications == null) return; - foreach (var message in UserState.Notifications) + foreach (var message in messages) { message.IsRead = true; await UserState.MarkRead(message); } + Open = false; await InvokeAsync(StateHasChanged); } - + } \ No newline at end of file diff --git a/BLAZAMSession/ApplicationUserStateService.cs b/BLAZAMSession/ApplicationUserStateService.cs index c604010f..c33d708a 100644 --- a/BLAZAMSession/ApplicationUserStateService.cs +++ b/BLAZAMSession/ApplicationUserStateService.cs @@ -193,7 +193,7 @@ private void AddUserState(IApplicationUserState state) public void SetMFAUserState(string mfaToken,IApplicationUserState state) { _mfaLoginQueue.Add(mfaToken, state); - Task.Delay(900000).ContinueWith((val) => { + Task.Delay(90000).ContinueWith((val) => { _mfaLoginQueue.Remove(mfaToken); }); SetUserState(state); From cb2dc3c685476d164667b7f68607fc79853a0edc Mon Sep 17 00:00:00 2001 From: Chris Jacobsen Date: Wed, 18 Sep 2024 20:16:44 -0400 Subject: [PATCH 17/18] Refresh individual widgets --- BLAZAM/BLAZAM.csproj | 2 +- .../CurrentUserDashboardWidgets.razor | 23 +++++--- .../Widgets/ChangedEntriesWidget.razor | 24 ++++++--- .../Widgets/ChangedPasswordsWidget.razor | 19 ++++++- .../Widgets/DeletedEntriesWidget.razor | 25 +++++++-- .../Widgets/DisabledUsersWidget.razor | 21 +++++++- .../Dashboard/Widgets/FavoritesWidget.razor | 42 ++++++++++----- .../UI/Dashboard/Widgets/LockedOutUsers.razor | 52 +++++++++++-------- .../Widgets/NewComputersWidget.razor | 18 +++++++ .../Widgets/NewEntriesWidgetDataGrid.razor | 1 + .../Dashboard/Widgets/NewGroupsWidget.razor | 18 +++++++ .../UI/Dashboard/Widgets/NewOUsWidget.razor | 18 +++++++ .../Dashboard/Widgets/NewPrintersWidget.razor | 18 +++++++ .../UI/Dashboard/Widgets/NewUsersWidget.razor | 22 +++++++- BLAZAMGui/UI/Dashboard/Widgets/Widget.razor | 8 +-- 15 files changed, 248 insertions(+), 63 deletions(-) diff --git a/BLAZAM/BLAZAM.csproj b/BLAZAM/BLAZAM.csproj index 611f55e3..e85f3a9a 100644 --- a/BLAZAM/BLAZAM.csproj +++ b/BLAZAM/BLAZAM.csproj @@ -6,7 +6,7 @@ enable false 1.0.2 - 2024.09.18.2313 + 2024.09.19.0014 false BLAZAM False diff --git a/BLAZAMGui/UI/Dashboard/CurrentUserDashboardWidgets.razor b/BLAZAMGui/UI/Dashboard/CurrentUserDashboardWidgets.razor index 75bfef0f..d9040267 100644 --- a/BLAZAMGui/UI/Dashboard/CurrentUserDashboardWidgets.razor +++ b/BLAZAMGui/UI/Dashboard/CurrentUserDashboardWidgets.razor @@ -57,18 +57,26 @@ @widget.Title - @** **@ - {await RemoveWidget(context);}) /> + + + + + + {await RemoveWidget(context);}) /> + + - (){ {"ItemsPerPage",context.ItemsPerPage>5?context.ItemsPerPage:5}, {"WidgetType",context.WidgetType} })" - Type="@widget.GetType()" /> + Type="@widget.GetType()" /> + + } } @@ -117,13 +125,14 @@ @code { - + public AppEvent OnRefreshWidget { get; set; } = (val) => { }; IApplicationUserState _currentUser; MudDropContainer? widgetContainer; List allWidgets = new List(); protected override Task OnInitializedAsync() { + allWidgets = new List(AllWidgets.Available(CurrentUser.State)); _currentUser = CurrentUser.State; return base.OnInitializedAsync(); diff --git a/BLAZAMGui/UI/Dashboard/Widgets/ChangedEntriesWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/ChangedEntriesWidget.razor index bfa419d0..564401ab 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/ChangedEntriesWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/ChangedEntriesWidget.razor @@ -58,18 +58,28 @@ protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); - Task.Run(async () => + CurrentUserDashboardWidgets.OnRefreshWidget += (Widget widget) => + { + if (widget.WidgetType.Equals(WidgetType)) { - var search = new ADSearch(Directory); - search.Fields.Changed = DateTime.Now.AddDays(-1); - changdEntries = (await search.SearchAsync()).Where(x => x.CanRead).ToList(); - LoadingData = false; - await InvokeAsync(StateHasChanged); + _ = RefreshData(); - }); + } + }; + _ = RefreshData(); + } + async Task RefreshData() + { + LoadingData = true; + await InvokeAsync(StateHasChanged); + var search = new ADSearch(Directory); + search.Fields.Changed = DateTime.Now.AddDays(-1); + changdEntries = (await search.SearchAsync()).Where(x => x.CanRead).ToList(); + LoadingData = false; + await InvokeAsync(StateHasChanged); } void RowClicked(DataGridRowClickEventArgs args) diff --git a/BLAZAMGui/UI/Dashboard/Widgets/ChangedPasswordsWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/ChangedPasswordsWidget.razor index b5cbddac..25d08590 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/ChangedPasswordsWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/ChangedPasswordsWidget.razor @@ -26,7 +26,7 @@ - @(((IADUser)context.Item).PasswordLastSet) + @(((IADUser)context.Item).PasswordLastSet) @@ -47,9 +47,24 @@ { await base.OnInitializedAsync(); - Title = "Disabled Users"; + CurrentUserDashboardWidgets.OnRefreshWidget += (Widget widget) => + { + if (widget.WidgetType.Equals(WidgetType)) + { + _ = RefreshData(); + + } + + }; + _ = RefreshData(); + } + async Task RefreshData() + { + LoadingData = true; + await InvokeAsync(StateHasChanged); LockedUsers = await Directory.Users.FindChangedPasswordUsersAsync(false); LoadingData = false; await InvokeAsync(StateHasChanged); + } } diff --git a/BLAZAMGui/UI/Dashboard/Widgets/DeletedEntriesWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/DeletedEntriesWidget.razor index 398fbc33..f1af6895 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/DeletedEntriesWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/DeletedEntriesWidget.razor @@ -50,17 +50,32 @@ protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); + CurrentUserDashboardWidgets.OnRefreshWidget += (Widget widget) => + { + if (widget.WidgetType.Equals(WidgetType)) + { + _ = RefreshData(); + } + + }; + + _ = RefreshData(); + + } + async Task RefreshData() + { + LoadingData = true; + await InvokeAsync(StateHasChanged); var search = new ADSearch(Directory) { SearchRoot = Directory.GetDeleteObjectsEntry() }; search.SearchDeleted = true; search.Fields.Changed = DateTime.Now.AddDays(-14); deletedObjects = await search.SearchAsync(); - LoadingData = false; - await InvokeAsync(StateHasChanged); - + LoadingData = false; + LoadingData = false; + await InvokeAsync(StateHasChanged); } - - + } diff --git a/BLAZAMGui/UI/Dashboard/Widgets/DisabledUsersWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/DisabledUsersWidget.razor index c7ddf8b5..d1be1dfa 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/DisabledUsersWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/DisabledUsersWidget.razor @@ -8,7 +8,7 @@ @foreach (var user in LockedUsers) { - + @user.DisplayName
@@ -30,10 +30,27 @@ protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); + CurrentUserDashboardWidgets.OnRefreshWidget += (Widget widget) => + { + if (widget.WidgetType.Equals(WidgetType)) + { + _ = RefreshData(); + + } + + }; + + _ = RefreshData(); + } - Title = "Disabled Users"; + async Task RefreshData() + { + LoadingData = true; + await InvokeAsync(StateHasChanged); LockedUsers = (await Directory.Users.FindChangedUsersAsync(false)).Where(u => u.Disabled).ToList(); + LoadingData = false; await InvokeAsync(StateHasChanged); + } } diff --git a/BLAZAMGui/UI/Dashboard/Widgets/FavoritesWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/FavoritesWidget.razor index 2df86f6b..9e55eaa8 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/FavoritesWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/FavoritesWidget.razor @@ -48,7 +48,7 @@ @code { - List FavoriteEntries + List FavoriteEntries { get => CurrentUser.State.Cache.Get>(this.GetType()); set => CurrentUser.State.Cache.Set(this.GetType(), value); @@ -56,23 +56,37 @@ protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); - await Task.Run(() => + CurrentUserDashboardWidgets.OnRefreshWidget += (Widget widget) => { - var favorites = new List(); - foreach (var entry in CurrentUser.State.Preferences.FavoriteEntries) + if (widget.WidgetType.Equals(WidgetType)) { - IDirectoryEntryAdapter match = Directory.GetDirectoryEntryByDN(entry.DN); - if (match != null && match.CanRead) - { - favorites.Add(match); - } + _ = RefreshData(); } - FavoriteEntries = favorites; - LoadingData = false; - InvokeAsync(StateHasChanged); - }); + }; + + _ = RefreshData(); + + + } + async Task RefreshData() + { + LoadingData = true; + await InvokeAsync(StateHasChanged); + var favorites = new List(); + foreach (var entry in CurrentUser.State.Preferences.FavoriteEntries) + { + IDirectoryEntryAdapter match = Directory.GetDirectoryEntryByDN(entry.DN); + if (match != null && match.CanRead) + { + favorites.Add(match); + } + + } + FavoriteEntries = favorites; + LoadingData = false; + await InvokeAsync(StateHasChanged); } void RowClicked(DataGridRowClickEventArgs args) @@ -82,7 +96,7 @@ GoTo(args.Item); } } - + void GoTo(IDirectoryEntryAdapter args) { Nav.NavigateTo(args.SearchUri); diff --git a/BLAZAMGui/UI/Dashboard/Widgets/LockedOutUsers.razor b/BLAZAMGui/UI/Dashboard/Widgets/LockedOutUsers.razor index 82475fdc..a7a532d0 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/LockedOutUsers.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/LockedOutUsers.razor @@ -2,15 +2,15 @@ @attribute [Authorize] - + - + @context.Item?.CanonicalName - + - @if (@context.Item.CanUnlock) - { + @if (@context.Item.CanUnlock) + { @AppLocalization["Unlock User"] - + - } + } - - + + @@ -67,11 +67,20 @@ { await base.OnInitializedAsync(); - Title = "Locked Out Users"; - await RefreshUsers(); + CurrentUserDashboardWidgets.OnRefreshWidget += (Widget widget) => + { + if (widget.WidgetType.Equals(WidgetType)) + { + _ = RefreshData(); + + } + + }; + + _ = RefreshData(); } - async Task RefreshUsers() + async Task RefreshData() { LoadingData = true; await InvokeAsync(StateHasChanged); @@ -86,22 +95,23 @@ } async void UnlockAccount(IADUser userToUnlock) { - if (userToUnlock.LockedOut){ + if (userToUnlock.LockedOut) + { - userToUnlock.LockedOut=false; + userToUnlock.LockedOut = false; var changes = userToUnlock.Changes; var unlockJob = await userToUnlock.CommitChangesAsync(); await AuditLogger.User.Changed(userToUnlock, changes); - if(unlockJob.Result== JobResult.Passed) + if (unlockJob.Result == JobResult.Passed) { - await RefreshUsers(); + await RefreshData(); SnackBarService.Success(userToUnlock.CanonicalName + AppLocalization[" unlocked"]); } else { - SnackBarService.Error("Could not unlock: "+unlockJob.Exception?.Message); + SnackBarService.Error("Could not unlock: " + unlockJob.Exception?.Message); } } } diff --git a/BLAZAMGui/UI/Dashboard/Widgets/NewComputersWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/NewComputersWidget.razor index e085cc54..c99cf65e 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/NewComputersWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/NewComputersWidget.razor @@ -17,9 +17,27 @@ protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); + CurrentUserDashboardWidgets.OnRefreshWidget += (Widget widget) => + { + if (widget.WidgetType.Equals(WidgetType)) + { + _ = RefreshData(); + + } + + }; + + _ = RefreshData(); + } + async Task RefreshData() + { + LoadingData = true; + await InvokeAsync(StateHasChanged); NewComputers = (await Directory.Computers.FindNewComputersAsync()).Where(u => u.CanRead).ToList(); + LoadingData = false; await InvokeAsync(StateHasChanged); + } void GoTo(DataGridRowClickEventArgs args) { diff --git a/BLAZAMGui/UI/Dashboard/Widgets/NewEntriesWidgetDataGrid.razor b/BLAZAMGui/UI/Dashboard/Widgets/NewEntriesWidgetDataGrid.razor index 65e51ce7..e04300d4 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/NewEntriesWidgetDataGrid.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/NewEntriesWidgetDataGrid.razor @@ -42,4 +42,5 @@ @code{ #nullable disable warnings + } \ No newline at end of file diff --git a/BLAZAMGui/UI/Dashboard/Widgets/NewGroupsWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/NewGroupsWidget.razor index fe146a83..5121e890 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/NewGroupsWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/NewGroupsWidget.razor @@ -17,9 +17,27 @@ protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); + CurrentUserDashboardWidgets.OnRefreshWidget += (Widget widget) => + { + if (widget.WidgetType.Equals(WidgetType)) + { + _ = RefreshData(); + + } + + }; + + _ = RefreshData(); + } + async Task RefreshData() + { + LoadingData = true; + await InvokeAsync(StateHasChanged); NewGroups = (await Directory.Groups.FindNewGroupsAsync()).Where(u => u.CanRead).ToList(); + LoadingData = false; await InvokeAsync(StateHasChanged); + } void GoTo(DataGridRowClickEventArgs args) { diff --git a/BLAZAMGui/UI/Dashboard/Widgets/NewOUsWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/NewOUsWidget.razor index 4695ccf0..aa2cd154 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/NewOUsWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/NewOUsWidget.razor @@ -17,9 +17,27 @@ protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); + CurrentUserDashboardWidgets.OnRefreshWidget += (Widget widget) => + { + if (widget.WidgetType.Equals(WidgetType)) + { + _ = RefreshData(); + + } + + }; + + _ = RefreshData(); + } + async Task RefreshData() + { + LoadingData = true; + await InvokeAsync(StateHasChanged); NewOUs = (await Directory.OUs.FindNewOUsAsync()).Where(u => u.CanRead).ToList(); + LoadingData = false; await InvokeAsync(StateHasChanged); + } void GoTo(DataGridRowClickEventArgs args) { diff --git a/BLAZAMGui/UI/Dashboard/Widgets/NewPrintersWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/NewPrintersWidget.razor index aa683fe9..292242a2 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/NewPrintersWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/NewPrintersWidget.razor @@ -17,9 +17,27 @@ protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); + CurrentUserDashboardWidgets.OnRefreshWidget += (Widget widget) => + { + if (widget.WidgetType.Equals(WidgetType)) + { + _ = RefreshData(); + + } + + }; + + _ = RefreshData(); + } + async Task RefreshData() + { + LoadingData = true; + await InvokeAsync(StateHasChanged); NewPrinters = (await Directory.Printers.FindNewPrintersAsync(14, false)).Where(u => u.CanRead).ToList(); + LoadingData = false; await InvokeAsync(StateHasChanged); + } void GoTo(DataGridRowClickEventArgs args) { diff --git a/BLAZAMGui/UI/Dashboard/Widgets/NewUsersWidget.razor b/BLAZAMGui/UI/Dashboard/Widgets/NewUsersWidget.razor index 851102f6..0129dcf6 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/NewUsersWidget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/NewUsersWidget.razor @@ -17,9 +17,29 @@ protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); - NewUsers = (await Directory.Users.FindNewUsersAsync(14,false)).Where(u => u.CanRead).OrderByDescending(u=>u.Created).ToList(); + + + CurrentUserDashboardWidgets.OnRefreshWidget += (Widget widget) => + { + if (widget.WidgetType.Equals(WidgetType)) + { + _ = RefreshData(); + + } + + }; + + _=RefreshData(); + } + async Task RefreshData() + { + LoadingData = true; + await InvokeAsync(StateHasChanged); + + NewUsers = (await Directory.Users.FindNewUsersAsync(14, false)).Where(u => u.CanRead).OrderByDescending(u => u.Created).ToList(); LoadingData = false; await InvokeAsync(StateHasChanged); + } void GoTo(DataGridRowClickEventArgs args) { diff --git a/BLAZAMGui/UI/Dashboard/Widgets/Widget.razor b/BLAZAMGui/UI/Dashboard/Widgets/Widget.razor index 9b68681c..4f4d48d0 100644 --- a/BLAZAMGui/UI/Dashboard/Widgets/Widget.razor +++ b/BLAZAMGui/UI/Dashboard/Widgets/Widget.razor @@ -3,11 +3,13 @@ @code { [Parameter] public RenderFragment? WidgetContent { get; set; } - public string Title{ get; set; } + public string Title { get; set; } [Parameter] - public DashboardWidgetType WidgetType{ get; set; } + public DashboardWidgetType WidgetType { get; set; } [Parameter] public int ItemsPerPage { get; set; } = 5; + [CascadingParameter] + public CurrentUserDashboardWidgets CurrentUserDashboardWidgets { get; set; } protected virtual void RowClicked(DataGridRowClickEventArgs args) { @@ -22,7 +24,7 @@ } protected async void SetRowsPerPage(int rowPerPage) { - CurrentUser.State.Preferences.DashboardWidgets.FirstOrDefault(w=>w.WidgetType.Equals(WidgetType)).ItemsPerPage=rowPerPage; + CurrentUser.State.Preferences.DashboardWidgets.FirstOrDefault(w => w.WidgetType.Equals(WidgetType)).ItemsPerPage = rowPerPage; CurrentUser.State.SaveDashboardWidgets(); } } From f3c6bf00c40fbe97cb57172d8e6e461774c6da08 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 00:34:16 +0000 Subject: [PATCH 18/18] Bump MudBlazor.Markdown from 1.0.2 to 7.8.0 Bumps [MudBlazor.Markdown](https://github.com/MyNihongo/MudBlazor.Markdown) from 1.0.2 to 7.8.0. - [Release notes](https://github.com/MyNihongo/MudBlazor.Markdown/releases) - [Commits](https://github.com/MyNihongo/MudBlazor.Markdown/compare/v1.0.2...v7.8.0) --- updated-dependencies: - dependency-name: MudBlazor.Markdown dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- BLAZAM/BLAZAM.csproj | 2 +- BLAZAMGui/BLAZAMGui.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BLAZAM/BLAZAM.csproj b/BLAZAM/BLAZAM.csproj index 0e01e952..3c7957b3 100644 --- a/BLAZAM/BLAZAM.csproj +++ b/BLAZAM/BLAZAM.csproj @@ -75,7 +75,7 @@ - + diff --git a/BLAZAMGui/BLAZAMGui.csproj b/BLAZAMGui/BLAZAMGui.csproj index 79af9e1d..6482c303 100644 --- a/BLAZAMGui/BLAZAMGui.csproj +++ b/BLAZAMGui/BLAZAMGui.csproj @@ -27,7 +27,7 @@ - +