diff --git a/COMET.Web.Common.Tests/Shared/TopMenuTestFixture.cs b/COMET.Web.Common.Tests/Shared/TopMenuTestFixture.cs index 2408d0b9..3c4e0c7e 100644 --- a/COMET.Web.Common.Tests/Shared/TopMenuTestFixture.cs +++ b/COMET.Web.Common.Tests/Shared/TopMenuTestFixture.cs @@ -87,7 +87,12 @@ public void Setup() this.autoRefreshService = new Mock(); this.sourceList = new SourceList(); this.sessionService.Setup(x => x.OpenIterations).Returns(this.sourceList); - this.registeredMenuEntries = new List(); + this.registeredMenuEntries = new List() + { + typeof(ApplicationMenu), + typeof(ModelMenu), + typeof(SessionMenu) + }; this.registeredApplications = new List(); this.registrationService = new Mock(); this.registrationService.Setup(x => x.RegisteredAuthorizedMenuEntries).Returns(this.registeredMenuEntries); diff --git a/COMET.Web.Common/Shared/TopMenu.razor b/COMET.Web.Common/Shared/TopMenu.razor index 3a1861de..f7bbdab4 100644 --- a/COMET.Web.Common/Shared/TopMenu.razor +++ b/COMET.Web.Common/Shared/TopMenu.razor @@ -39,10 +39,6 @@ } - - - - @foreach (var menuEntry in this.RegistrationService.RegisteredAuthorizedMenuEntries.Where(x => x.IsSubclassOf(typeof(MenuEntryBase)))) { diff --git a/COMETwebapp/Program.cs b/COMETwebapp/Program.cs index 5f7f0f0c..943652ba 100644 --- a/COMETwebapp/Program.cs +++ b/COMETwebapp/Program.cs @@ -50,6 +50,7 @@ namespace COMETwebapp using System.Reflection; using COMET.Web.Common; + using COMET.Web.Common.Shared.TopMenuEntry; using COMETwebapp.ViewModels.Components.BookEditor; @@ -75,7 +76,7 @@ public static async Task Main(string[] args) { options.Applications = Applications.ExistingApplications; options.AdditionalAssemblies.Add(Assembly.GetAssembly(typeof(Program))); - options.AdditionalMenuEntries.AddRange(new List{typeof(ShowHideDeprecatedThings), typeof(AboutMenu)}); + options.AdditionalMenuEntries.AddRange(new List{ typeof(ApplicationMenu), typeof(ModelMenu), typeof(SessionMenu), typeof(ShowHideDeprecatedThings), typeof(AboutMenu)}); }); builder.Services.AddScoped(_ => new HttpClient()