From 7e803bc17669cdd22c5643b6d2feecc1367054fa Mon Sep 17 00:00:00 2001 From: Joao Rua Date: Fri, 21 Jun 2024 11:19:22 +0100 Subject: [PATCH] sidebar icons replaced --- COMET.Web.Common/Model/Application.cs | 37 +++++---- COMETwebapp/Model/Applications.cs | 83 ++++++++++--------- .../Shared/SideBarEntry/AboutSideBar.razor | 2 +- .../SideBarEntry/ApplicationsSideBar.razor | 4 +- .../Shared/SideBarEntry/ModelSideBar.razor | 2 +- .../Shared/SideBarEntry/SessionSideBar.razor | 2 +- .../ShowHideDeprecatedThingsSideBar.razor | 2 +- .../Shared/SideBarEntry/SideBarItem.razor | 14 +++- .../Shared/SideBarEntry/SideBarItem.razor.cs | 17 ++++ .../Shared/SideBarEntry/SideBarItem.razor.css | 8 +- COMETwebapp/wwwroot/css/app.css | 1 + COMETwebapp/wwwroot/css/overwrite.css | 5 ++ COMETwebapp/wwwroot/css/vars.css | 2 +- 13 files changed, 111 insertions(+), 68 deletions(-) diff --git a/COMET.Web.Common/Model/Application.cs b/COMET.Web.Common/Model/Application.cs index ef5bc57f..7fca619b 100644 --- a/COMET.Web.Common/Model/Application.cs +++ b/COMET.Web.Common/Model/Application.cs @@ -1,25 +1,24 @@ // -------------------------------------------------------------------------------------------------------------------- // -// Copyright (c) 2023-2024 Starion Group S.A. +// Copyright (c) 2024 Starion Group S.A. // -// Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Jaime Bernar, Théate Antoine, Nabil Abbar +// Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Jaime Bernar, Théate Antoine, João Rua // -// This file is part of CDP4-COMET WEB Community Edition -// The CDP4-COMET WEB Community Edition is the Starion Web Application implementation of ECSS-E-TM-10-25 -// Annex A and Annex C. +// This file is part of COMET WEB Community Edition +// The COMET WEB Community Edition is the Starion Group Web Application implementation of ECSS-E-TM-10-25 Annex A and Annex C. // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// The COMET WEB Community Edition is free software; you can redistribute it and/or +// modify it under the terms of the GNU Affero General Public +// License as published by the Free Software Foundation; either +// version 3 of the License, or (at your option) any later version. // -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// The COMET WEB Community Edition is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Affero General Public License for more details. // +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . // // -------------------------------------------------------------------------------------------------------------------- @@ -50,13 +49,19 @@ public class Application /// public string Icon { get; set; } + /// + /// The icon type to be displayed as a dynamic component, instead of a css class + /// + /// Setting this value will likely override the selected property when displayed + public Type IconType { get; set; } + /// /// The navigation url for the current application /// public string Url { get; set; } /// - /// Value asserting that the current is currently disabled + /// Value asserting that the current is currently disabled /// public bool IsDisabled { get; set; } } diff --git a/COMETwebapp/Model/Applications.cs b/COMETwebapp/Model/Applications.cs index 0f8bc218..af79db6b 100644 --- a/COMETwebapp/Model/Applications.cs +++ b/COMETwebapp/Model/Applications.cs @@ -1,26 +1,26 @@ // -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2023-2024 Starion Group S.A. -// -// Authors: Justine Veirier d'aiguebonne, Sam Gerené, Alex Vorobiev, Alexander van Delft -// -// This file is part of CDP4-COMET WEB Community Edition -// The CDP4-COMET WEB Community Edition is the Starion Web Application implementation of ECSS-E-TM-10-25 Annex A and Annex C. -// -// The CDP4-COMET WEB Community Edition is free software; you can redistribute it and/or -// modify it under the terms of the GNU Affero General Public -// License as published by the Free Software Foundation; either -// version 3 of the License, or (at your option) any later version. -// -// The CDP4-COMET WEB Community Edition is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// Copyright (c) 2024 Starion Group S.A. +// +// Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Jaime Bernar, Théate Antoine, João Rua +// +// This file is part of COMET WEB Community Edition +// The COMET WEB Community Edition is the Starion Group Web Application implementation of ECSS-E-TM-10-25 Annex A and Annex C. +// +// The COMET WEB Community Edition is free software; you can redistribute it and/or +// modify it under the terms of the GNU Affero General Public +// License as published by the Free Software Foundation; either +// version 3 of the License, or (at your option) any later version. +// +// The COMET WEB Community Edition is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Affero General Public License for more details. -// +// // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -// -// -------------------------------------------------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------------------------------------------------- namespace COMETwebapp.Model { @@ -34,9 +34,10 @@ namespace COMETwebapp.Model using COMETwebapp.Components.SubscriptionDashboard; using COMETwebapp.Components.SystemRepresentation; using COMETwebapp.Components.Viewer; - using COMETwebapp.Pages.ModelEditor; using COMETwebapp.Utilities; + using Feather.Blazor.Icons; + /// /// Provides all available application contained into the current web application /// @@ -60,31 +61,31 @@ private static List InitializesApplications() { applications = [ - new TabbedApplication - { - Name = "Parameter Editor", - Color = "#76b8fc", - Icon = "spreadsheet", - Description = "Table of element usages with their associated parameters.", - Url = WebAppConstantValues.ParameterEditorPage, - ComponentType = typeof(ParameterEditorBody) - }, - new TabbedApplication { Name = "Model Dashboard", Color = "#c3cffd", - Icon = "task", + IconType = typeof(FeatherPieChart), Description = "Summarize the model progress.", Url = WebAppConstantValues.ModelDashboardPage, ComponentType = typeof(ModelDashboardBody) }, + new TabbedApplication + { + Name = "Parameter Editor", + Color = "#76b8fc", + IconType = typeof(FeatherLayout), + Description = "Table of element usages with their associated parameters.", + Url = WebAppConstantValues.ParameterEditorPage, + ComponentType = typeof(ParameterEditorBody) + }, + new TabbedApplication { Name = "Subscription Dashboard", Color = "#76fd98", - Icon = "person", + IconType = typeof(FeatherActivity), Description = "Table of subscribed values.", Url = WebAppConstantValues.SubscriptionDashboardPage, ComponentType = typeof(SubscriptionDashboardBody) @@ -94,7 +95,7 @@ private static List InitializesApplications() { Name = "System Representation", Color = "#a7f876", - Icon = "fork", + IconType = typeof(FeatherShare2), Description = "Represent relations between elements.", Url = WebAppConstantValues.SystemRepresentationPage, ComponentType = typeof(SystemRepresentationBody) @@ -124,7 +125,7 @@ private static List InitializesApplications() { Name = "3D Viewer", Color = "#76fd98", - Icon = "eye", + IconType = typeof(FeatherPackage), Description = "Show 3D Viewer", Url = WebAppConstantValues.ViewerPage, ComponentType = typeof(ViewerBody) @@ -134,7 +135,7 @@ private static List InitializesApplications() { Name = "Reference Data", Color = "#fc3a1aad", - Icon = "file", + IconType = typeof(FeatherFile), Description = "Visualize reference data", Url = WebAppConstantValues.ReferenceDataPage }, @@ -143,7 +144,7 @@ private static List InitializesApplications() { Name = "Server Administration", Color = "#fc3a1aad", - Icon = "folder", + IconType = typeof(FeatherServer), Description = "Visualize site directory data", Url = WebAppConstantValues.SiteDirectoryPage }, @@ -152,7 +153,7 @@ private static List InitializesApplications() { Name = "Engineering Model", Color = "#c3cffd", - Icon = "cog", + IconType = typeof(FeatherSettings), Description = "Visualize the engineering model data", Url = WebAppConstantValues.EngineeringModelPage, ComponentType = typeof(EngineeringModelBody) @@ -162,17 +163,17 @@ private static List InitializesApplications() { Name = "Model Editor", Color = "#76fd98", - Icon = "box", + IconType = typeof(FeatherBox), Description = "Populate model", Url = WebAppConstantValues.ModelEditorPage, ComponentType = typeof(ElementDefinitionTable) }, - new TabbedApplication() + new TabbedApplication { Name = "Book Editor", Color = "#76fd98", - Icon = "book", + IconType = typeof(FeatherBook), Description = "Manage books", Url = WebAppConstantValues.BookEditorPage, ComponentType = typeof(BookEditorBody) @@ -184,7 +185,7 @@ private static List InitializesApplications() Url = WebAppConstantValues.TabsPage, Color = "#76fd98", Icon = "list", - Description = "Access applications via tabs", + Description = "Access applications via tabs" } ]; diff --git a/COMETwebapp/Shared/SideBarEntry/AboutSideBar.razor b/COMETwebapp/Shared/SideBarEntry/AboutSideBar.razor index 1a678b0f..685b10e6 100644 --- a/COMETwebapp/Shared/SideBarEntry/AboutSideBar.razor +++ b/COMETwebapp/Shared/SideBarEntry/AboutSideBar.razor @@ -23,7 +23,7 @@ + Icon="@(typeof(FeatherInfo))"/> diff --git a/COMETwebapp/Shared/SideBarEntry/ApplicationsSideBar.razor b/COMETwebapp/Shared/SideBarEntry/ApplicationsSideBar.razor index 36178b75..5aeb5464 100644 --- a/COMETwebapp/Shared/SideBarEntry/ApplicationsSideBar.razor +++ b/COMETwebapp/Shared/SideBarEntry/ApplicationsSideBar.razor @@ -32,7 +32,7 @@ } @@ -45,7 +45,7 @@ } diff --git a/COMETwebapp/Shared/SideBarEntry/ModelSideBar.razor b/COMETwebapp/Shared/SideBarEntry/ModelSideBar.razor index 20d33f05..1fde8deb 100644 --- a/COMETwebapp/Shared/SideBarEntry/ModelSideBar.razor +++ b/COMETwebapp/Shared/SideBarEntry/ModelSideBar.razor @@ -37,7 +37,7 @@ diff --git a/COMETwebapp/Shared/SideBarEntry/SessionSideBar.razor b/COMETwebapp/Shared/SideBarEntry/SessionSideBar.razor index e20fc3f9..1da7477b 100644 --- a/COMETwebapp/Shared/SideBarEntry/SessionSideBar.razor +++ b/COMETwebapp/Shared/SideBarEntry/SessionSideBar.razor @@ -25,7 +25,7 @@ diff --git a/COMETwebapp/Shared/SideBarEntry/ShowHideDeprecatedThingsSideBar.razor b/COMETwebapp/Shared/SideBarEntry/ShowHideDeprecatedThingsSideBar.razor index fc00ac44..e1817845 100644 --- a/COMETwebapp/Shared/SideBarEntry/ShowHideDeprecatedThingsSideBar.razor +++ b/COMETwebapp/Shared/SideBarEntry/ShowHideDeprecatedThingsSideBar.razor @@ -23,6 +23,6 @@ diff --git a/COMETwebapp/Shared/SideBarEntry/SideBarItem.razor b/COMETwebapp/Shared/SideBarEntry/SideBarItem.razor index 5a9df3ba..ae948638 100644 --- a/COMETwebapp/Shared/SideBarEntry/SideBarItem.razor +++ b/COMETwebapp/Shared/SideBarEntry/SideBarItem.razor @@ -28,8 +28,18 @@ } else { -
- +
+ @if (this.Icon is not null) + { +
+ +
+ } + else + { + + } @(this.Text)
if (this.DropdownSelector) diff --git a/COMETwebapp/Shared/SideBarEntry/SideBarItem.razor.cs b/COMETwebapp/Shared/SideBarEntry/SideBarItem.razor.cs index 1e6f54ab..73737eeb 100644 --- a/COMETwebapp/Shared/SideBarEntry/SideBarItem.razor.cs +++ b/COMETwebapp/Shared/SideBarEntry/SideBarItem.razor.cs @@ -55,6 +55,12 @@ public partial class SideBarItem [Parameter] public string IconCssClass { get; set; } + /// + /// Gets or sets the icon to be displayed, overriding the selected , if set + /// + [Parameter] + public Type Icon { get; set; } + /// /// Gets or sets the text to be displayed /// @@ -79,6 +85,17 @@ public partial class SideBarItem [Parameter] public RenderFragment ChildContent { get; set; } + /// + /// Gets the icon configuration to display + /// + private static Dictionary IconConfiguration => new() + { + { "Size", 22 }, + { "Color", "currentColor" }, + { "StrokeWidth", 1.8f }, + { "CssClass", "cursor-pointer" } + }; + /// /// Executes the onclick action if the component is enabled /// diff --git a/COMETwebapp/Shared/SideBarEntry/SideBarItem.razor.css b/COMETwebapp/Shared/SideBarEntry/SideBarItem.razor.css index 25cdf97d..247b2420 100644 --- a/COMETwebapp/Shared/SideBarEntry/SideBarItem.razor.css +++ b/COMETwebapp/Shared/SideBarEntry/SideBarItem.razor.css @@ -29,7 +29,11 @@ } .application-sidebar-icon { - padding-right: 10px; margin-top: -1.5px; - padding-left: 10px; } + +.application-item-content { + display: flex; + align-items: center; + gap: 8px; +} \ No newline at end of file diff --git a/COMETwebapp/wwwroot/css/app.css b/COMETwebapp/wwwroot/css/app.css index 569dc6df..7ed23be5 100644 --- a/COMETwebapp/wwwroot/css/app.css +++ b/COMETwebapp/wwwroot/css/app.css @@ -244,6 +244,7 @@ div[id^="dropdown-customization-target-container-"] { display: flex; } .collapsed .application-item-container { width: 70px !important; + padding: 22px; } sub { diff --git a/COMETwebapp/wwwroot/css/overwrite.css b/COMETwebapp/wwwroot/css/overwrite.css index 5a373619..c9e6b5f0 100644 --- a/COMETwebapp/wwwroot/css/overwrite.css +++ b/COMETwebapp/wwwroot/css/overwrite.css @@ -78,4 +78,9 @@ h3, .h3 { .dxbl-toolbar.dxbl-toolbar-adaptive > .dxbl-btn-toolbar{ bottom: 0!important; +} + +.open-tab-box-container .dxbl-fl-cpt.dxbl-text { + color: var(--colors-gray-950); + font-weight: 500; } \ No newline at end of file diff --git a/COMETwebapp/wwwroot/css/vars.css b/COMETwebapp/wwwroot/css/vars.css index ffdc8d37..d90dde54 100644 --- a/COMETwebapp/wwwroot/css/vars.css +++ b/COMETwebapp/wwwroot/css/vars.css @@ -9,7 +9,7 @@ --colors-gray-700: #374151; --colors-gray-800: #1F2937; --colors-gray-900: #111827; - --colors-gray-950: #030712; + --colors-gray-950: #0B0C0E; --colors-primary-25: #F9FBFC; --colors-primary-50: #F4F5F8; --colors-primary-100: #EAECF1;