-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* categories hierarchy * remove code smell * category hierarchy style (IsAbstract and IsDeprecated) * fix test * code coverage * code coverage * css isolation * eof * css isolation * change hierarchy direction * using inside namespace * update diagram hierarchy when a category is updated
- Loading branch information
1 parent
dcdc296
commit 8547461
Showing
17 changed files
with
520 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
COMETwebapp/Components/ReferenceData/CategoryHierarchyDiagram.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!------------------------------------------------------------------------------ | ||
Copyright (c) 2023 RHEA System S.A. | ||
Authors: Justine Veirier d'aiguebonne, Sam Gerené, Alex Vorobiev, Alexander van Delft, Nabil Abbar | ||
This file is part of COMET WEB Community Edition | ||
The COMET WEB Community Edition is the RHEA 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 http://www.gnu.org/licenses/. | ||
-------------------------------------------------------------------------------> | ||
|
||
<CascadingValue Value="this.ViewModel.Diagram"> | ||
<DiagramCanvas></DiagramCanvas> | ||
</CascadingValue> |
77 changes: 77 additions & 0 deletions
77
COMETwebapp/Components/ReferenceData/CategoryHierarchyDiagram.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="CategoryHierarchyDiagram.razor.cs" company="RHEA System S.A."> | ||
// Copyright (c) 2023 RHEA System S.A. | ||
// | ||
// Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Jaime Bernar, Nabil Abbar | ||
// | ||
// This file is part of COMET WEB Community Edition | ||
// The COMET WEB Community Edition is the RHEA 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 <http://www.gnu.org/licenses/>. | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
|
||
namespace COMETwebapp.Components.ReferenceData | ||
{ | ||
using COMETwebapp.ViewModels.Components.ReferenceData; | ||
|
||
using Blazor.Diagrams.Core; | ||
using Blazor.Diagrams.Core.Models; | ||
|
||
using Microsoft.AspNetCore.Components; | ||
|
||
/// <summary> | ||
/// Support class for the <see cref="ParameterTypeTable"/> | ||
/// </summary> | ||
public partial class CategoryHierarchyDiagram | ||
{ | ||
/// <summary> | ||
/// The <see cref="ICategoryHierarchyDiagramViewModel" /> for the component | ||
/// </summary> | ||
[Parameter] | ||
public ICategoryHierarchyDiagramViewModel ViewModel { get; set; } | ||
|
||
/// <summary> | ||
/// Method invoked when the component is ready to start, having received its | ||
/// initial parameters from its parent in the render tree. | ||
/// </summary> | ||
protected override void OnInitialized() | ||
{ | ||
base.OnInitialized(); | ||
|
||
var options = new DiagramOptions | ||
{ | ||
DefaultNodeComponent = null, // Default component for nodes | ||
AllowMultiSelection = false, | ||
Links = new DiagramLinkOptions | ||
{ | ||
Factory = (diagram, sourcePort) => | ||
{ | ||
return new LinkModel(sourcePort, null) | ||
{ | ||
Router = Routers.Orthogonal, | ||
PathGenerator = PathGenerators.Straight, | ||
}; | ||
} | ||
}, | ||
Zoom = new DiagramZoomOptions | ||
{ | ||
Enabled = false, | ||
}, | ||
}; | ||
this.ViewModel.Diagram = new Diagram(options); | ||
this.ViewModel.Diagram.RegisterModelComponent<CategoryNode, CategoryNodeComponent>(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="CategoryNode.cs" company="RHEA System S.A."> | ||
// Copyright (c) 2023 RHEA System S.A. | ||
// | ||
// Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Jaime Bernar, Nabil Abbar | ||
// | ||
// This file is part of COMET WEB Community Edition | ||
// The COMET WEB Community Edition is the RHEA 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 <http://www.gnu.org/licenses/>. | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
using Blazor.Diagrams.Core.Geometry; | ||
using Blazor.Diagrams.Core.Models; | ||
|
||
using CDP4Common.SiteDirectoryData; | ||
|
||
|
||
namespace COMETwebapp.Components.ReferenceData | ||
{ | ||
/// <summary> | ||
/// represent the Category diagram node | ||
/// </summary> | ||
public class CategoryNode : NodeModel | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="CategoryNode" /> class. | ||
/// </summary> | ||
/// <param name="category">The <see cref="Category" /></param> | ||
/// <param name="position">The <see cref="Point" /></param> | ||
public CategoryNode(Category category, Point position = null) : base(position, RenderLayer.HTML) | ||
{ | ||
this.Category = category; | ||
} | ||
|
||
/// <summary> | ||
/// Get or set the <see cref="Category" /> | ||
/// </summary> | ||
public Category Category { get; set; } | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
COMETwebapp/Components/ReferenceData/CategoryNodeComponent.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!------------------------------------------------------------------------------ | ||
Copyright (c) 2023 RHEA System S.A. | ||
Authors: Justine Veirier d'aiguebonne, Sam Gerené, Alex Vorobiev, Alexander van Delft, Nabil Abbar | ||
This file is part of COMET WEB Community Edition | ||
The COMET WEB Community Edition is the RHEA 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 http://www.gnu.org/licenses/. | ||
-------------------------------------------------------------------------------> | ||
@using Blazor.Diagrams.Components.Renderers; | ||
|
||
<div class="card @(Node.Category.IsDeprecated ? "dotted" : "")" style="width: auto; text-align:center;"> | ||
<div class="card-body"> | ||
@if (Node.Category.IsAbstract) | ||
{ | ||
<h5 class="card-title"> | ||
<i>@Node.Category.Name</i> | ||
</h5> | ||
} | ||
else | ||
{ | ||
<h5 class="card-title"> | ||
<b>@Node.Category.Name</b> | ||
</h5> | ||
} | ||
</div> | ||
|
||
@foreach (var port in Node.Ports) | ||
{ | ||
<PortRenderer Port="port" /> | ||
} | ||
</div> |
39 changes: 39 additions & 0 deletions
39
COMETwebapp/Components/ReferenceData/CategoryNodeComponent.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="CategoryNodeComponent.razor.cs" company="RHEA System S.A."> | ||
// Copyright (c) 2023 RHEA System S.A. | ||
// | ||
// Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Jaime Bernar, Nabil Abbar | ||
// | ||
// This file is part of COMET WEB Community Edition | ||
// The COMET WEB Community Edition is the RHEA 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 <http://www.gnu.org/licenses/>. | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
namespace COMETwebapp.Components.ReferenceData | ||
{ | ||
using Microsoft.AspNetCore.Components; | ||
|
||
/// <summary> | ||
/// Support class for the <see cref="CategoryNodeComponent"/> | ||
/// </summary> | ||
public partial class CategoryNodeComponent | ||
{ | ||
/// <summary> | ||
/// The <see cref="CategoryNode" /> for the component | ||
/// </summary> | ||
[Parameter] | ||
public CategoryNode Node { get; set; } | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
COMETwebapp/Components/ReferenceData/CategoryNodeComponent.razor.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.card.dotted { | ||
border: 2px dotted #000; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.