From 20f9a35888fd9ca6c81a6d6781f41e7754b66020 Mon Sep 17 00:00:00 2001 From: Nabil Abbar Date: Fri, 8 Sep 2023 11:53:33 +0200 Subject: [PATCH] add configurationService for navigation menu --- .../Enumerations/TextConfigurationKind.cs | 17 ++++++++++++++++- .../Shared/TopMenuEntry/ApplicationMenu.razor | 3 ++- .../TopMenuEntry/ApplicationMenu.razor.cs | 7 +++++++ .../Shared/TopMenuEntry/ModelMenu.razor | 5 +++-- .../Shared/TopMenuEntry/ModelMenu.razor.cs | 7 +++++++ .../wwwroot/DefaultTextConfiguration.json | 5 ++++- 6 files changed, 39 insertions(+), 5 deletions(-) diff --git a/COMET.Web.Common/Enumerations/TextConfigurationKind.cs b/COMET.Web.Common/Enumerations/TextConfigurationKind.cs index 761fca2e..c33fd1dc 100644 --- a/COMET.Web.Common/Enumerations/TextConfigurationKind.cs +++ b/COMET.Web.Common/Enumerations/TextConfigurationKind.cs @@ -63,6 +63,21 @@ public enum TextConfigurationKind /// /// The title to use in the landing page /// - LandingPageTitle = 6 + LandingPageTitle = 6, + + /// + /// The caption to use as navigation application selector title + /// + NavigationApplicationSelectorTitle = 7, + + /// + /// The caption to use as navigation model selector title + /// + NavigationModelSelectorTitle = 8, + + /// + /// The caption to use as title for the open button + /// + ModelOpenButtonCaption = 9, } } diff --git a/COMET.Web.Common/Shared/TopMenuEntry/ApplicationMenu.razor b/COMET.Web.Common/Shared/TopMenuEntry/ApplicationMenu.razor index 2461a9e1..61af3c6f 100644 --- a/COMET.Web.Common/Shared/TopMenuEntry/ApplicationMenu.razor +++ b/COMET.Web.Common/Shared/TopMenuEntry/ApplicationMenu.razor @@ -21,9 +21,10 @@ -------------------------------------------------------------------------------> @namespace COMET.Web.Common.Shared.TopMenuEntry +@using COMET.Web.Common.Enumerations @inherits AuthorizedMenuEntry - + @foreach (var applicationEntry in this.RegistrationService.RegisteredApplications) { diff --git a/COMET.Web.Common/Shared/TopMenuEntry/ApplicationMenu.razor.cs b/COMET.Web.Common/Shared/TopMenuEntry/ApplicationMenu.razor.cs index 25e42c43..6d7d00b6 100644 --- a/COMET.Web.Common/Shared/TopMenuEntry/ApplicationMenu.razor.cs +++ b/COMET.Web.Common/Shared/TopMenuEntry/ApplicationMenu.razor.cs @@ -26,6 +26,7 @@ namespace COMET.Web.Common.Shared.TopMenuEntry { using COMET.Web.Common.Model; + using COMET.Web.Common.Services.ConfigurationService; using COMET.Web.Common.Services.RegistrationService; using Microsoft.AspNetCore.Components; @@ -40,5 +41,11 @@ public partial class ApplicationMenu /// [Inject] internal IRegistrationService RegistrationService { get; set; } + + /// + /// The + /// + [Inject] + public IConfigurationService ConfigurationService { get; set; } } } diff --git a/COMET.Web.Common/Shared/TopMenuEntry/ModelMenu.razor b/COMET.Web.Common/Shared/TopMenuEntry/ModelMenu.razor index 76a650b0..204e98bc 100644 --- a/COMET.Web.Common/Shared/TopMenuEntry/ModelMenu.razor +++ b/COMET.Web.Common/Shared/TopMenuEntry/ModelMenu.razor @@ -20,6 +20,7 @@ // limitations under the License. -------------------------------------------------------------------------------> @namespace COMET.Web.Common.Shared.TopMenuEntry +@using COMET.Web.Common.Enumerations @inherits AuthorizedMenuEntry @@ -32,14 +33,14 @@ - + @context.Text - + @contextSwitch.Text diff --git a/COMET.Web.Common/Shared/TopMenuEntry/ModelMenu.razor.cs b/COMET.Web.Common/Shared/TopMenuEntry/ModelMenu.razor.cs index afb83274..9fb9d332 100644 --- a/COMET.Web.Common/Shared/TopMenuEntry/ModelMenu.razor.cs +++ b/COMET.Web.Common/Shared/TopMenuEntry/ModelMenu.razor.cs @@ -27,6 +27,7 @@ namespace COMET.Web.Common.Shared.TopMenuEntry { using CDP4Common.EngineeringModelData; + using COMET.Web.Common.Services.ConfigurationService; using COMET.Web.Common.ViewModels.Shared.TopMenuEntry; using Microsoft.AspNetCore.Components; @@ -44,6 +45,12 @@ public partial class ModelMenu [Inject] public IModelMenuViewModel ViewModel { get; set; } + /// + /// The + /// + [Inject] + public IConfigurationService ConfigurationService { get; set; } + /// /// Method invoked when the component is ready to start, having received its /// initial parameters from its parent in the render tree. diff --git a/COMET.Web.Common/wwwroot/DefaultTextConfiguration.json b/COMET.Web.Common/wwwroot/DefaultTextConfiguration.json index 1fd073a8..618c17a3 100644 --- a/COMET.Web.Common/wwwroot/DefaultTextConfiguration.json +++ b/COMET.Web.Common/wwwroot/DefaultTextConfiguration.json @@ -5,5 +5,8 @@ "ModelTitleCaption": "Model", "IterationTitleCaption": "Iteration", "DomainTitleCaption": "Domain", - "LandingPageTitle" : "" + "LandingPageTitle": "", + "NavigationApplicationSelectorTitle": "Application", + "NavigationModelSelectorTitle": "Models", + "ModelOpenButtonCaption": "Open Model" }