diff --git a/COMET.Web.Common/COMET.Web.Common.csproj b/COMET.Web.Common/COMET.Web.Common.csproj index cab7d65a..1b0339e6 100644 --- a/COMET.Web.Common/COMET.Web.Common.csproj +++ b/COMET.Web.Common/COMET.Web.Common.csproj @@ -38,6 +38,7 @@ + diff --git a/COMETwebapp.Tests/Components/EngineeringModel/PublicationsTableTestFixture.cs b/COMETwebapp.Tests/Components/EngineeringModel/PublicationsTableTestFixture.cs index 05d05d2d..a6dba648 100644 --- a/COMETwebapp.Tests/Components/EngineeringModel/PublicationsTableTestFixture.cs +++ b/COMETwebapp.Tests/Components/EngineeringModel/PublicationsTableTestFixture.cs @@ -144,7 +144,7 @@ public async Task VerifyPublicationDetails() Assert.Multiple(() => { - Assert.That(this.renderer.Instance.IsPublicationDetailsPopupOpen, Is.EqualTo(true)); + Assert.That(this.renderer.Instance.IsOnEditMode, Is.EqualTo(true)); Assert.That(this.renderer.Instance.SelectedRow, Is.EqualTo(this.viewModel.Object.Rows.Items.First())); }); } diff --git a/COMETwebapp.Tests/Components/SiteDirectory/DomainsOfExpertiseTableTestFixture.cs b/COMETwebapp.Tests/Components/SiteDirectory/DomainsOfExpertiseTableTestFixture.cs index f01eacc1..a9d7c979 100644 --- a/COMETwebapp.Tests/Components/SiteDirectory/DomainsOfExpertiseTableTestFixture.cs +++ b/COMETwebapp.Tests/Components/SiteDirectory/DomainsOfExpertiseTableTestFixture.cs @@ -42,6 +42,7 @@ namespace COMETwebapp.Tests.Components.SiteDirectory using DynamicData; + using Microsoft.AspNetCore.Components.Forms; using Microsoft.Extensions.DependencyInjection; using Moq; @@ -142,16 +143,21 @@ public async Task VerifyAddingOrEditingDomainOfExpertise() Assert.Multiple(() => { - Assert.That(renderer.Instance.ShouldCreateThing, Is.EqualTo(true)); + Assert.That(renderer.Instance.IsOnEditMode, Is.EqualTo(false)); Assert.That(this.viewModel.Object.Thing, Is.InstanceOf(typeof(DomainOfExpertise))); }); - var editDomainOfExpertiseButton = renderer.FindComponents().First(x => x.Instance.Id == "editDomainOfExpertiseButton"); - await renderer.InvokeAsync(editDomainOfExpertiseButton.Instance.Click.InvokeAsync); + var domainsGrid = renderer.FindComponent(); + await renderer.InvokeAsync(() => domainsGrid.Instance.SelectedDataItemChanged.InvokeAsync(new DomainOfExpertiseRowViewModel(this.domainOfExpertise1))); + Assert.That(renderer.Instance.IsOnEditMode, Is.EqualTo(true)); + + var domainsForm = renderer.FindComponents()[1]; + var domainsEditForm = domainsForm.FindComponent(); + await domainsForm.InvokeAsync(domainsEditForm.Instance.OnValidSubmit.InvokeAsync); Assert.Multiple(() => { - Assert.That(renderer.Instance.ShouldCreateThing, Is.EqualTo(false)); + this.viewModel.Verify(x => x.CreateOrEditDomainOfExpertise(false), Times.Once); Assert.That(this.viewModel.Object.Thing, Is.InstanceOf(typeof(DomainOfExpertise))); }); diff --git a/COMETwebapp.Tests/Components/SiteDirectory/EngineeringModels/ActiveDomainsTableTestFixture.cs b/COMETwebapp.Tests/Components/SiteDirectory/EngineeringModels/ActiveDomainsTableTestFixture.cs index e1e504c1..9f44d9bf 100644 --- a/COMETwebapp.Tests/Components/SiteDirectory/EngineeringModels/ActiveDomainsTableTestFixture.cs +++ b/COMETwebapp.Tests/Components/SiteDirectory/EngineeringModels/ActiveDomainsTableTestFixture.cs @@ -120,12 +120,12 @@ public void VerifyOnInitialized() [Test] public async Task VerifyEditActiveDomains() { - Assert.That(this.renderer.Instance.IsEditPopupVisible, Is.EqualTo(false)); + Assert.That(this.renderer.Instance.IsOnEditMode, Is.EqualTo(false)); var editActiveDomainsClickableItem = this.renderer.FindComponent(); await this.renderer.InvokeAsync(editActiveDomainsClickableItem.Instance.Click.InvokeAsync); - Assert.That(this.renderer.Instance.IsEditPopupVisible, Is.EqualTo(true)); + Assert.That(this.renderer.Instance.IsOnEditMode, Is.EqualTo(true)); var saveActiveDomainsButton = this.renderer.FindComponents().First(x => x.Instance.Id == "saveActiveDomainsButton"); await this.renderer.InvokeAsync(saveActiveDomainsButton.Instance.Click.InvokeAsync); @@ -140,7 +140,7 @@ public async Task VerifyEditActiveDomains() Assert.Multiple(() => { this.viewModel.Verify(x => x.ResetSelectedDomainsOfExpertise(), Times.Once); - Assert.That(this.renderer.Instance.IsEditPopupVisible, Is.EqualTo(false)); + Assert.That(this.renderer.Instance.IsOnEditMode, Is.EqualTo(false)); }); } } diff --git a/COMETwebapp.Tests/Components/SiteDirectory/EngineeringModels/EngineeringModelsTableTestFixture.cs b/COMETwebapp.Tests/Components/SiteDirectory/EngineeringModels/EngineeringModelsTableTestFixture.cs index 679ea7c1..79b45c8e 100644 --- a/COMETwebapp.Tests/Components/SiteDirectory/EngineeringModels/EngineeringModelsTableTestFixture.cs +++ b/COMETwebapp.Tests/Components/SiteDirectory/EngineeringModels/EngineeringModelsTableTestFixture.cs @@ -141,13 +141,13 @@ public async Task VerifyAddEngineeringModel() [Test] public async Task VerifyRowClick() { - Assert.That(this.renderer.Instance.IsModelSelected, Is.EqualTo(false)); + Assert.That(this.renderer.Instance.IsOnEditMode, Is.EqualTo(false)); var firstRow = this.viewModel.Object.Rows.Items.First(); var grid = this.renderer.FindComponent(); await this.renderer.InvokeAsync(async () => await grid.Instance.SelectedDataItemChanged.InvokeAsync(firstRow)); - Assert.That(this.renderer.Instance.IsModelSelected, Is.EqualTo(true)); + Assert.That(this.renderer.Instance.IsOnEditMode, Is.EqualTo(true)); } } } diff --git a/COMETwebapp.Tests/Components/SiteDirectory/EngineeringModels/ParticipantsTableTestFixture.cs b/COMETwebapp.Tests/Components/SiteDirectory/EngineeringModels/ParticipantsTableTestFixture.cs index e960fa3b..4e7add78 100644 --- a/COMETwebapp.Tests/Components/SiteDirectory/EngineeringModels/ParticipantsTableTestFixture.cs +++ b/COMETwebapp.Tests/Components/SiteDirectory/EngineeringModels/ParticipantsTableTestFixture.cs @@ -133,7 +133,7 @@ public void VerifyOnInitialized() var details = this.renderer.Find("a"); details.ClickAsync(new MouseEventArgs()); - Assert.That(this.renderer.Instance.IsActiveDomainsDetailsOpen, Is.EqualTo(true)); + Assert.That(this.renderer.Instance.IsOnEditMode, Is.EqualTo(true)); } [Test] diff --git a/COMETwebapp.Tests/Components/SiteDirectory/Roles/ParticipantRolesTableTestFixture.cs b/COMETwebapp.Tests/Components/SiteDirectory/Roles/ParticipantRolesTableTestFixture.cs index 92d16183..ea8beecf 100644 --- a/COMETwebapp.Tests/Components/SiteDirectory/Roles/ParticipantRolesTableTestFixture.cs +++ b/COMETwebapp.Tests/Components/SiteDirectory/Roles/ParticipantRolesTableTestFixture.cs @@ -117,20 +117,20 @@ public async Task VerifyAddParticipantRoleClick() [Test] public async Task VerifyRowClick() { - Assert.That(this.renderer.Instance.IsRoleSelected, Is.EqualTo(false)); + Assert.That(this.renderer.Instance.IsOnEditMode, Is.EqualTo(false)); var firstRow = this.viewModel.Object.Rows.Items.First(); var grid = this.renderer.FindComponent(); await this.renderer.InvokeAsync(async () => await grid.Instance.SelectedDataItemChanged.InvokeAsync(firstRow)); - Assert.That(this.renderer.Instance.IsRoleSelected, Is.EqualTo(true)); + Assert.That(this.renderer.Instance.IsOnEditMode, Is.EqualTo(true)); var details = this.renderer.FindComponent(); await this.renderer.InvokeAsync(details.Instance.OnSubmit.InvokeAsync); this.viewModel.Verify(x => x.CreateOrEditParticipantRole(false), Times.Once); await this.renderer.InvokeAsync(details.Instance.OnCancel.InvokeAsync); - Assert.That(this.renderer.Instance.IsRoleSelected, Is.EqualTo(false)); + Assert.That(this.renderer.Instance.IsOnEditMode, Is.EqualTo(false)); } } } diff --git a/COMETwebapp.Tests/Components/SiteDirectory/Roles/PersonRolesTableTestFixture.cs b/COMETwebapp.Tests/Components/SiteDirectory/Roles/PersonRolesTableTestFixture.cs index c6795a2d..12c42d83 100644 --- a/COMETwebapp.Tests/Components/SiteDirectory/Roles/PersonRolesTableTestFixture.cs +++ b/COMETwebapp.Tests/Components/SiteDirectory/Roles/PersonRolesTableTestFixture.cs @@ -117,20 +117,20 @@ public async Task VerifyAddPersonRoleClick() [Test] public async Task VerifyRowClick() { - Assert.That(this.renderer.Instance.IsRoleSelected, Is.EqualTo(false)); + Assert.That(this.renderer.Instance.IsOnEditMode, Is.EqualTo(false)); var firstRow = this.viewModel.Object.Rows.Items.First(); var grid = this.renderer.FindComponent(); await this.renderer.InvokeAsync(async () => await grid.Instance.SelectedDataItemChanged.InvokeAsync(firstRow)); - Assert.That(this.renderer.Instance.IsRoleSelected, Is.EqualTo(true)); + Assert.That(this.renderer.Instance.IsOnEditMode, Is.EqualTo(true)); var details = this.renderer.FindComponent(); await this.renderer.InvokeAsync(details.Instance.OnSubmit.InvokeAsync); this.viewModel.Verify(x => x.CreateOrEditPersonRole(false), Times.Once); await this.renderer.InvokeAsync(details.Instance.OnCancel.InvokeAsync); - Assert.That(this.renderer.Instance.IsRoleSelected, Is.EqualTo(false)); + Assert.That(this.renderer.Instance.IsOnEditMode, Is.EqualTo(false)); } } } diff --git a/COMETwebapp/Components/Common/DataItemDetailsComponent.razor b/COMETwebapp/Components/Common/DataItemDetailsComponent.razor new file mode 100644 index 00000000..d165df59 --- /dev/null +++ b/COMETwebapp/Components/Common/DataItemDetailsComponent.razor @@ -0,0 +1,31 @@ + + +@namespace COMETwebapp.Components.Common + +
+ @if (this.IsSelected) + { + @this.ChildContent + } + else + { +
Select an item to view or edit
+ Comet Web + } +
+ diff --git a/COMETwebapp/Components/Common/DataItemDetailsComponent.razor.cs b/COMETwebapp/Components/Common/DataItemDetailsComponent.razor.cs new file mode 100644 index 00000000..cba32465 --- /dev/null +++ b/COMETwebapp/Components/Common/DataItemDetailsComponent.razor.cs @@ -0,0 +1,46 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright (c) 2023-2024 RHEA System S.A. +// +// Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Jaime Bernar, Antoine Théate, João Rua +// +// This file is part of CDP4-COMET WEB Community Edition +// The CDP4-COMET WEB Community Edition is the RHEA 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 +// 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.Components.Common +{ + using Microsoft.AspNetCore.Components; + + /// + /// The is used to display the details of a selected data item + /// + public partial class DataItemDetailsComponent + { + /// + /// Value asserting that the is selected or not + /// + [Parameter] + public bool IsSelected { get; set; } + + /// + /// The child content of the component + /// + [Parameter] + public RenderFragment ChildContent { get; set; } + } +} diff --git a/COMETwebapp/Components/Common/DataItemDetailsComponent.razor.css b/COMETwebapp/Components/Common/DataItemDetailsComponent.razor.css new file mode 100644 index 00000000..efc58176 --- /dev/null +++ b/COMETwebapp/Components/Common/DataItemDetailsComponent.razor.css @@ -0,0 +1,10 @@ +.data-item-details-section { + width: 50%; + padding: 30px; +} + +.data-item-details-image { + margin: auto; + display: block; + width: 300px; +} diff --git a/COMETwebapp/Components/Common/SelectedDataItemBase.razor.cs b/COMETwebapp/Components/Common/SelectedDataItemBase.razor.cs index 11779081..c714da11 100644 --- a/COMETwebapp/Components/Common/SelectedDataItemBase.razor.cs +++ b/COMETwebapp/Components/Common/SelectedDataItemBase.razor.cs @@ -53,6 +53,11 @@ public abstract partial class SelectedDataItemBase : DisposableComponen /// public bool ShouldCreateThing { get; protected set; } + /// + /// Gets or sets the condition to check if the current component is on edit mode + /// + public bool IsOnEditMode { get; protected set; } + /// /// Gets or sets the grid control that is being customized. /// diff --git a/COMETwebapp/Components/EngineeringModel/CommonFileStoresTable.razor b/COMETwebapp/Components/EngineeringModel/CommonFileStoresTable.razor index 5bfd0f5a..160fa89f 100644 --- a/COMETwebapp/Components/EngineeringModel/CommonFileStoresTable.razor +++ b/COMETwebapp/Components/EngineeringModel/CommonFileStoresTable.razor @@ -14,12 +14,11 @@ Copyright (c) 2023-2024 RHEA System S.A. You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/. -------------------------------------------------------------------------------> - @using COMETwebapp.Components.EngineeringModel.FileStore @inherits SelectedDataItemBase -
+
+ PageSizeSelectorAllRowsItemVisible="true" + CssClass="height-fit-content"> @@ -67,18 +67,14 @@ Copyright (c) 2023-2024 RHEA System S.A. - @if (this.IsOnEditMode) - { -
- - - See Folder-File Structure - -
- } - + + + + See Folder-File Structure + +
diff --git a/COMETwebapp/Components/EngineeringModel/CommonFileStoresTable.razor.cs b/COMETwebapp/Components/EngineeringModel/CommonFileStoresTable.razor.cs index e0a576cc..b486fe27 100644 --- a/COMETwebapp/Components/EngineeringModel/CommonFileStoresTable.razor.cs +++ b/COMETwebapp/Components/EngineeringModel/CommonFileStoresTable.razor.cs @@ -47,11 +47,6 @@ public partial class CommonFileStoresTable : SelectedDataItemBase - /// Gets the value to check if component is on edit mode - /// - public bool IsOnEditMode { get; private set; } - /// /// Gets the value to check if the folder file structure component is visible /// diff --git a/COMETwebapp/Components/EngineeringModel/OptionsTable.razor b/COMETwebapp/Components/EngineeringModel/OptionsTable.razor index 00e5bbf3..47786c94 100644 --- a/COMETwebapp/Components/EngineeringModel/OptionsTable.razor +++ b/COMETwebapp/Components/EngineeringModel/OptionsTable.razor @@ -14,11 +14,10 @@ Copyright (c) 2023-2024 RHEA System S.A. You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/. -------------------------------------------------------------------------------> -@using COMETwebapp.ViewModels.Components.EngineeringModel.Rows -@inherits SelectedDataItemBase +@inherits SelectedDataItemBase -
+
+ PageSizeSelectorAllRowsItemVisible="true" + CssClass="height-fit-content"> @@ -68,15 +68,11 @@ Copyright (c) 2023-2024 RHEA System S.A. - @if (this.IsOnEditMode) - { -
- -
- } - + + +
diff --git a/COMETwebapp/Components/EngineeringModel/OptionsTable.razor.cs b/COMETwebapp/Components/EngineeringModel/OptionsTable.razor.cs index 7241b397..9692bbe2 100644 --- a/COMETwebapp/Components/EngineeringModel/OptionsTable.razor.cs +++ b/COMETwebapp/Components/EngineeringModel/OptionsTable.razor.cs @@ -47,11 +47,6 @@ public partial class OptionsTable : SelectedDataItemBase - /// Gets the value to check if component is on edit mode - /// - public bool IsOnEditMode { get; private 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/COMETwebapp/Components/EngineeringModel/PublicationsTable.razor b/COMETwebapp/Components/EngineeringModel/PublicationsTable.razor index e9919902..bd3f2c72 100644 --- a/COMETwebapp/Components/EngineeringModel/PublicationsTable.razor +++ b/COMETwebapp/Components/EngineeringModel/PublicationsTable.razor @@ -73,7 +73,7 @@ Copyright (c) 2023-2024 RHEA System S.A. - + diff --git a/COMETwebapp/Components/EngineeringModel/PublicationsTable.razor.cs b/COMETwebapp/Components/EngineeringModel/PublicationsTable.razor.cs index 437314b7..6cf91a71 100644 --- a/COMETwebapp/Components/EngineeringModel/PublicationsTable.razor.cs +++ b/COMETwebapp/Components/EngineeringModel/PublicationsTable.razor.cs @@ -54,11 +54,6 @@ public partial class PublicationsTable : SelectedDataItemBase public PublicationRowViewModel SelectedRow { get; private set; } - /// - /// Gets the value to check if the publication details popup is open - /// - public bool IsPublicationDetailsPopupOpen { get; private set; } - /// /// Method invoked when the component is ready to start, having received its /// initial parameters from its parent in the render tree. @@ -78,7 +73,7 @@ protected override void OnInitialized() private void OnSelectedDataItemChanged(PublicationRowViewModel row) { this.SelectedRow = row; - this.IsPublicationDetailsPopupOpen = true; + this.IsOnEditMode = true; } /// diff --git a/COMETwebapp/Components/SiteDirectory/DomainsOfExpertiseForm.razor b/COMETwebapp/Components/SiteDirectory/DomainsOfExpertiseForm.razor new file mode 100644 index 00000000..546495f7 --- /dev/null +++ b/COMETwebapp/Components/SiteDirectory/DomainsOfExpertiseForm.razor @@ -0,0 +1,46 @@ + +@inherits SelectedDataItemForm + + + + + + + + + + + + + + +
+ +
+ + Save + + + + Cancel + +
+
diff --git a/COMETwebapp/Components/SiteDirectory/DomainsOfExpertiseForm.razor.cs b/COMETwebapp/Components/SiteDirectory/DomainsOfExpertiseForm.razor.cs new file mode 100644 index 00000000..081a6cc7 --- /dev/null +++ b/COMETwebapp/Components/SiteDirectory/DomainsOfExpertiseForm.razor.cs @@ -0,0 +1,55 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright (c) 2023-2024 RHEA System S.A. +// +// 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 RHEA 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 +// 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.Components.SiteDirectory +{ + using System.ComponentModel.DataAnnotations; + + using COMETwebapp.Components.Common; + using COMETwebapp.ViewModels.Components.SiteDirectory.DomainsOfExpertise; + + using Microsoft.AspNetCore.Components; + + /// + /// Support class for the + /// + public partial class DomainsOfExpertiseForm : SelectedDataItemForm + { + /// + /// The for this component + /// + [Parameter, Required] + public IDomainsOfExpertiseTableViewModel ViewModel { get; set; } + + /// + /// Method that is executed when there is a valid submit + /// + /// A + protected override async Task OnValidSubmit() + { + await this.ViewModel.CreateOrEditDomainOfExpertise(this.ShouldCreate); + await base.OnValidSubmit(); + } + } +} diff --git a/COMETwebapp/Components/SiteDirectory/DomainsOfExpertiseTable.razor b/COMETwebapp/Components/SiteDirectory/DomainsOfExpertiseTable.razor index 922b7f37..661b78b1 100644 --- a/COMETwebapp/Components/SiteDirectory/DomainsOfExpertiseTable.razor +++ b/COMETwebapp/Components/SiteDirectory/DomainsOfExpertiseTable.razor @@ -18,65 +18,65 @@ Copyright (c) 2023-2024 RHEA System S.A. @inherits COMETwebapp.Components.Common.SelectedDeprecatableDataItemBase - - - - - - - - - - - @{ - var row = (DomainOfExpertiseRowViewModel)context.DataItem; +
+ + + + + + + + + + + @{ + var row = (DomainOfExpertiseRowViewModel)context.DataItem; - + + } + + + - - } - - - - - - - - - - - - - - - - - - + + + + - - - + + + - +
diff --git a/COMETwebapp/Components/SiteDirectory/DomainsOfExpertiseTable.razor.cs b/COMETwebapp/Components/SiteDirectory/DomainsOfExpertiseTable.razor.cs index 29573fc9..c050b2fd 100644 --- a/COMETwebapp/Components/SiteDirectory/DomainsOfExpertiseTable.razor.cs +++ b/COMETwebapp/Components/SiteDirectory/DomainsOfExpertiseTable.razor.cs @@ -74,16 +74,18 @@ protected override void CustomizeEditThing(GridCustomizeEditModelEventArgs e) var dataItem = (DomainOfExpertiseRowViewModel)e.DataItem; this.ShouldCreateThing = e.IsNew; + this.ViewModel.Thing = dataItem == null ? new DomainOfExpertise() : dataItem.Thing.Clone(true); + e.EditModel = this.ViewModel.Thing; + } - if (dataItem == null) - { - this.ViewModel.Thing = new DomainOfExpertise(); - e.EditModel = this.ViewModel.Thing; - return; - } - - e.EditModel = dataItem; - this.ViewModel.Thing = dataItem.Thing.Clone(true); + /// + /// Method invoked every time a row is selected + /// + /// The selected row + private void OnSelectedDataItemChanged(DomainOfExpertiseRowViewModel row) + { + this.ViewModel.Thing = row.Thing.Clone(true); + this.IsOnEditMode = true; } } } diff --git a/COMETwebapp/Components/SiteDirectory/EngineeringModel/ActiveDomainsTable.razor b/COMETwebapp/Components/SiteDirectory/EngineeringModel/ActiveDomainsTable.razor index 39c874a5..cfa55519 100644 --- a/COMETwebapp/Components/SiteDirectory/EngineeringModel/ActiveDomainsTable.razor +++ b/COMETwebapp/Components/SiteDirectory/EngineeringModel/ActiveDomainsTable.razor @@ -46,7 +46,7 @@ Copyright (c) 2023-2024 RHEA System S.A. - - /// Gets or sets the condition to check if the edit popup is visible - ///
- public bool IsEditPopupVisible { get; private set; } - /// /// Method invoked when the component is ready to start, having received its /// initial parameters from its parent in the render tree. @@ -80,7 +75,7 @@ protected override void OnParametersSet() /// The visibility of the popup private void SetEditPopupVisibility(bool visible) { - this.IsEditPopupVisible = visible; + this.IsOnEditMode = visible; } /// diff --git a/COMETwebapp/Components/SiteDirectory/EngineeringModel/EngineeringModelsTable.razor b/COMETwebapp/Components/SiteDirectory/EngineeringModel/EngineeringModelsTable.razor index 40c62358..b65c7a18 100644 --- a/COMETwebapp/Components/SiteDirectory/EngineeringModel/EngineeringModelsTable.razor +++ b/COMETwebapp/Components/SiteDirectory/EngineeringModel/EngineeringModelsTable.razor @@ -36,7 +36,7 @@ Copyright (c) 2023-2024 RHEA System S.A. PageSizeSelectorVisible="true" PageSizeSelectorItems="@(new[] { 20, 35, 50 })" PageSizeSelectorAllRowsItemVisible="true" - CssClass="d-inline"> + CssClass="d-inline height-fit-content"> @@ -159,29 +159,25 @@ Copyright (c) 2023-2024 RHEA System S.A. - @if (this.IsModelSelected) - { -
- - - @foreach (var mappedValue in this.mapOfComponentsAndNames) - { - - } - - - - @if (this.SelectedComponent != null) - { - - } + + + + @foreach (var mappedValue in this.mapOfComponentsAndNames) + { + + } + + -
- } + @if (this.SelectedComponent != null) + { + + } +
diff --git a/COMETwebapp/Components/SiteDirectory/EngineeringModel/EngineeringModelsTable.razor.cs b/COMETwebapp/Components/SiteDirectory/EngineeringModel/EngineeringModelsTable.razor.cs index 97a0d7bc..2a1ea2b8 100644 --- a/COMETwebapp/Components/SiteDirectory/EngineeringModel/EngineeringModelsTable.razor.cs +++ b/COMETwebapp/Components/SiteDirectory/EngineeringModel/EngineeringModelsTable.razor.cs @@ -45,11 +45,6 @@ public partial class EngineeringModelsTable : SelectedDataItemBase - /// Gets or sets the value to check if a model has been selected - /// - public bool IsModelSelected { get; private set; } - /// /// Gets the condition to check if the source model was selected in creation form /// @@ -116,7 +111,7 @@ protected override void CustomizeEditThing(GridCustomizeEditModelEventArgs e) private void OnSelectedDataItemChanged(EngineeringModelRowViewModel row) { this.ViewModel.Thing = row.Thing; - this.IsModelSelected = true; + this.IsOnEditMode = true; this.parameters[nameof(EngineeringModelSetup)] = row.Thing; } diff --git a/COMETwebapp/Components/SiteDirectory/EngineeringModel/ParticipantsTable.razor b/COMETwebapp/Components/SiteDirectory/EngineeringModel/ParticipantsTable.razor index 47667161..6bc7ac0b 100644 --- a/COMETwebapp/Components/SiteDirectory/EngineeringModel/ParticipantsTable.razor +++ b/COMETwebapp/Components/SiteDirectory/EngineeringModel/ParticipantsTable.razor @@ -127,7 +127,7 @@ Copyright (c) 2023-2024 RHEA System S.A.
-
    @foreach (var assignedDomain in this.AssignedDomainsPopupText.Split(ParticipantRowViewModel.Separator)) diff --git a/COMETwebapp/Components/SiteDirectory/EngineeringModel/ParticipantsTable.razor.cs b/COMETwebapp/Components/SiteDirectory/EngineeringModel/ParticipantsTable.razor.cs index 1ffbd5c6..2c722fc1 100644 --- a/COMETwebapp/Components/SiteDirectory/EngineeringModel/ParticipantsTable.razor.cs +++ b/COMETwebapp/Components/SiteDirectory/EngineeringModel/ParticipantsTable.razor.cs @@ -51,11 +51,6 @@ public partial class ParticipantsTable : SelectedDataItemBase - /// Gets or sets the condition to check if the active domains details popup is open - /// - public bool IsActiveDomainsDetailsOpen { get; private set; } - /// /// Gets or sets the active domains details text /// @@ -124,7 +119,7 @@ protected override void CustomizeEditThing(GridCustomizeEditModelEventArgs e) private void OpenAssignedDomainDetailsPopup(string text) { this.AssignedDomainsPopupText = text; - this.IsActiveDomainsDetailsOpen = true; + this.IsOnEditMode = true; } /// diff --git a/COMETwebapp/Components/SiteDirectory/Roles/ParticipantRolesTable.razor b/COMETwebapp/Components/SiteDirectory/Roles/ParticipantRolesTable.razor index 42eb500c..e8de84b4 100644 --- a/COMETwebapp/Components/SiteDirectory/Roles/ParticipantRolesTable.razor +++ b/COMETwebapp/Components/SiteDirectory/Roles/ParticipantRolesTable.razor @@ -17,7 +17,7 @@ Copyright (c) 2023-2024 RHEA System S.A. @inherits SelectedDeprecatableDataItemBase -
    +
    + CssClass="d-inline height-fit-content"> @@ -46,6 +46,16 @@ Copyright (c) 2023-2024 RHEA System S.A. + + @{ + var row = (ParticipantRoleRowViewModel)context.DataItem; + + + } + @@ -61,14 +71,11 @@ Copyright (c) 2023-2024 RHEA System S.A. - @if (this.IsRoleSelected) - { -
    - -
    - } + + +
    diff --git a/COMETwebapp/Components/SiteDirectory/Roles/ParticipantRolesTable.razor.cs b/COMETwebapp/Components/SiteDirectory/Roles/ParticipantRolesTable.razor.cs index f7be0cc3..55cd555b 100644 --- a/COMETwebapp/Components/SiteDirectory/Roles/ParticipantRolesTable.razor.cs +++ b/COMETwebapp/Components/SiteDirectory/Roles/ParticipantRolesTable.razor.cs @@ -45,11 +45,6 @@ public partial class ParticipantRolesTable : SelectedDeprecatableDataItemBase - /// Gets the value to check if a role has been selected - ///
    - public bool IsRoleSelected { get; private set; } - /// /// Method invoked when the component is ready to start, having received its /// initial parameters from its parent in the render tree. @@ -88,7 +83,7 @@ protected override void CustomizeEditThing(GridCustomizeEditModelEventArgs e) private void OnSelectedDataItemChanged(ParticipantRoleRowViewModel row) { this.ViewModel.Thing = row.Thing.Clone(true); - this.IsRoleSelected = true; + this.IsOnEditMode = true; } } } diff --git a/COMETwebapp/Components/SiteDirectory/Roles/PersonRolesTable.razor b/COMETwebapp/Components/SiteDirectory/Roles/PersonRolesTable.razor index 585de590..1bbd28a9 100644 --- a/COMETwebapp/Components/SiteDirectory/Roles/PersonRolesTable.razor +++ b/COMETwebapp/Components/SiteDirectory/Roles/PersonRolesTable.razor @@ -17,7 +17,7 @@ Copyright (c) 2023-2024 RHEA System S.A. @inherits SelectedDeprecatableDataItemBase -
    +
    + CssClass="d-inline height-fit-content"> @@ -46,6 +46,16 @@ Copyright (c) 2023-2024 RHEA System S.A. + + @{ + var row = (PersonRoleRowViewModel)context.DataItem; + + + } + @@ -61,14 +71,11 @@ Copyright (c) 2023-2024 RHEA System S.A. - @if (this.IsRoleSelected) - { -
    - -
    - } + + +
    diff --git a/COMETwebapp/Components/SiteDirectory/Roles/PersonRolesTable.razor.cs b/COMETwebapp/Components/SiteDirectory/Roles/PersonRolesTable.razor.cs index 5914391d..fbe664d1 100644 --- a/COMETwebapp/Components/SiteDirectory/Roles/PersonRolesTable.razor.cs +++ b/COMETwebapp/Components/SiteDirectory/Roles/PersonRolesTable.razor.cs @@ -24,8 +24,6 @@ namespace COMETwebapp.Components.SiteDirectory.Roles { - using System.ComponentModel.DataAnnotations; - using CDP4Common.SiteDirectoryData; using COMETwebapp.Components.Common; @@ -47,11 +45,6 @@ public partial class PersonRolesTable : SelectedDeprecatableDataItemBase - /// Gets the value to check if a role has been selected - ///
    - public bool IsRoleSelected { get; private set; } - /// /// Method invoked when the component is ready to start, having received its /// initial parameters from its parent in the render tree. @@ -90,7 +83,7 @@ protected override void CustomizeEditThing(GridCustomizeEditModelEventArgs e) private void OnSelectedDataItemChanged(PersonRoleRowViewModel row) { this.ViewModel.Thing = row.Thing.Clone(true); - this.IsRoleSelected = true; + this.IsOnEditMode = true; } } } diff --git a/COMETwebapp/ViewModels/Components/Common/DeprecatableDataItemTable/IDeprecatableDataItemTableViewModel.cs b/COMETwebapp/ViewModels/Components/Common/DeprecatableDataItemTable/IDeprecatableDataItemTableViewModel.cs index 37f57ae4..c0703029 100644 --- a/COMETwebapp/ViewModels/Components/Common/DeprecatableDataItemTable/IDeprecatableDataItemTableViewModel.cs +++ b/COMETwebapp/ViewModels/Components/Common/DeprecatableDataItemTable/IDeprecatableDataItemTableViewModel.cs @@ -27,8 +27,6 @@ namespace COMETwebapp.ViewModels.Components.Common.DeprecatableDataItemTable using COMETwebapp.Services.ShowHideDeprecatedThingsService; using COMETwebapp.ViewModels.Components.Common.BaseDataItemTable; - using DynamicData; - /// /// View model that provides the basic functionalities for a reference data item /// diff --git a/COMETwebapp/wwwroot/css/app.css b/COMETwebapp/wwwroot/css/app.css index 520eeb2d..9eb1c9d8 100644 --- a/COMETwebapp/wwwroot/css/app.css +++ b/COMETwebapp/wwwroot/css/app.css @@ -51,6 +51,8 @@ html, body, #app { .width-fit-content { width: fit-content; } +.height-fit-content { height: fit-content; } + .max-width-40 { max-width: 40%; } .margin-top-120 { margin-top: 120px; } diff --git a/COMETwebapp/wwwroot/images/comet-logo-black.png b/COMETwebapp/wwwroot/images/comet-logo-black.png new file mode 100644 index 00000000..21039642 Binary files /dev/null and b/COMETwebapp/wwwroot/images/comet-logo-black.png differ diff --git a/COMETwebapp/wwwroot/images/comet-logo-white.png b/COMETwebapp/wwwroot/images/comet-logo-white.png new file mode 100644 index 00000000..c348f7df Binary files /dev/null and b/COMETwebapp/wwwroot/images/comet-logo-white.png differ