-
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
* Fix #494: Moved from WASM to ServerSide * test * Rebase and dotsettings update
- Loading branch information
1 parent
0cc7091
commit 70c640c
Showing
21 changed files
with
489 additions
and
228 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
COMETwebapp.Tests/Extensions/ServiceCollectionExtensionsTestFixtures.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,50 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="ServiceCollectionExtensionsTestFixtures.cs" company="RHEA System S.A."> | ||
// Copyright (c) 2024 RHEA System S.A. | ||
// | ||
// Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Jaime Bernar, Théate Antoine | ||
// | ||
// 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.Tests.Extensions | ||
{ | ||
using COMETwebapp.Extensions; | ||
|
||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
using Moq; | ||
|
||
using NUnit.Framework; | ||
|
||
[TestFixture] | ||
public class ServiceCollectionExtensionsTestFixtures | ||
{ | ||
[Test] | ||
public void VerifyRegistration() | ||
{ | ||
var serviceCollection = new Mock<IServiceCollection>(); | ||
|
||
Assert.Multiple(() => | ||
{ | ||
Assert.That(() => serviceCollection.Object.RegisterServices(), Throws.Nothing); | ||
Assert.That(() => serviceCollection.Object.RegisterViewModels(), Throws.Nothing); | ||
}); | ||
} | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="ServiceCollectionExtensions.cs" company="RHEA System S.A."> | ||
// Copyright (c) 2024 RHEA System S.A. | ||
// | ||
// Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Jaime Bernar, Théate Antoine | ||
// | ||
// 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.Extensions | ||
{ | ||
using COMETwebapp.Model.Viewer; | ||
using COMETwebapp.Services.Interoperability; | ||
using COMETwebapp.Services.ShowHideDeprecatedThingsService; | ||
using COMETwebapp.Services.SubscriptionService; | ||
using COMETwebapp.Utilities; | ||
using COMETwebapp.ViewModels.Components.BookEditor; | ||
using COMETwebapp.ViewModels.Components.ModelDashboard; | ||
using COMETwebapp.ViewModels.Components.ModelDashboard.ParameterValues; | ||
using COMETwebapp.ViewModels.Components.ModelEditor; | ||
using COMETwebapp.ViewModels.Components.ParameterEditor; | ||
using COMETwebapp.ViewModels.Components.ReferenceData; | ||
using COMETwebapp.ViewModels.Components.SubscriptionDashboard; | ||
using COMETwebapp.ViewModels.Components.SystemRepresentation; | ||
using COMETwebapp.ViewModels.Components.UserManagement; | ||
using COMETwebapp.ViewModels.Components.Viewer; | ||
using COMETwebapp.ViewModels.Shared.TopMenuEntry; | ||
|
||
/// <summary> | ||
/// Extension class for the <see cref="IServiceCollection" /> | ||
/// </summary> | ||
public static class ServiceCollectionExtensions | ||
{ | ||
/// <summary> | ||
/// Register all services required to run the application inside the <see cref="IServiceCollection" /> | ||
/// </summary> | ||
/// <param name="serviceCollection">The <see cref="IServiceCollection" /></param> | ||
public static void RegisterServices(this IServiceCollection serviceCollection) | ||
{ | ||
serviceCollection.AddScoped<ISubscriptionService, SubscriptionService>(); | ||
serviceCollection.AddScoped<IShowHideDeprecatedThingsService, ShowHideDeprecatedThingsService>(); | ||
serviceCollection.AddScoped<ISceneSettings, SceneSettings>(); | ||
serviceCollection.AddScoped<ISelectionMediator, SelectionMediator>(); | ||
serviceCollection.AddScoped<IDraggableElementService, DraggableElementService>(); | ||
serviceCollection.AddScoped<IBabylonInterop, BabylonInterop>(); | ||
serviceCollection.AddScoped<IDomDataService, DomDataService>(); | ||
serviceCollection.AddHttpClient(); | ||
serviceCollection.AddAntDesign(); | ||
} | ||
|
||
/// <summary> | ||
/// Register all view models required to run the application inside the <see cref="IServiceCollection" /> | ||
/// </summary> | ||
/// <param name="serviceCollection">The <see cref="IServiceCollection" /></param> | ||
public static void RegisterViewModels(this IServiceCollection serviceCollection) | ||
{ | ||
serviceCollection.AddScoped<IShowHideDeprecatedThingsViewModel, ShowHideDeprecatedThingsViewModel>(); | ||
serviceCollection.AddTransient<IParameterTableViewModel, ParameterTableViewModel>(); | ||
serviceCollection.AddTransient<IParameterDashboardViewModel, ParameterDashboardViewModel>(); | ||
serviceCollection.AddTransient<IModelDashboardBodyViewModel, ModelDashboardBodyViewModel>(); | ||
serviceCollection.AddTransient<ISubscriptionDashboardBodyViewModel, SubscriptionDashboardBodyViewModel>(); | ||
serviceCollection.AddTransient<ISubscribedTableViewModel, SubscribedTableViewModel>(); | ||
serviceCollection.AddTransient<IParameterEditorBodyViewModel, ParameterEditorBodyViewModel>(); | ||
serviceCollection.AddTransient<IViewerBodyViewModel, ViewerBodyViewModel>(); | ||
serviceCollection.AddTransient<IElementDefinitionDetailsViewModel, ElementDefinitionDetailsViewModel>(); | ||
serviceCollection.AddTransient<IParameterTypeTableViewModel, ParameterTypeTableViewModel>(); | ||
serviceCollection.AddTransient<IUserManagementTableViewModel, UserManagementTableViewModel>(); | ||
serviceCollection.AddTransient<ICategoriesTableViewModel, CategoriesTableViewModel>(); | ||
serviceCollection.AddTransient<ISystemRepresentationBodyViewModel, SystemRepresentationBodyViewModel>(); | ||
serviceCollection.AddTransient<IElementDefinitionTableViewModel, ElementDefinitionTableViewModel>(); | ||
serviceCollection.AddTransient<IBookEditorBodyViewModel, BookEditorBodyViewModel>(); | ||
} | ||
} | ||
} |
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,50 @@ | ||
@page | ||
<!------------------------------------------------------------------------------ | ||
// Copyright (c) 2023 INNOVET LLC | ||
// | ||
// Authors: Sam Gerené, Antoine Théate, Jaime Bernar, Martin Risseeuw, Roberto Alves, João Rua | ||
// | ||
// This file is part of DMAP-CDAO application | ||
// The DMAP-CDAO application is a Web Application implementation of ECSS-E-TM-10-25 for DMAP-CDAO. | ||
-------------------------------------------------------------------------------> | ||
@model COMETwebapp.Pages.ErrorModel | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> | ||
<title>Error</title> | ||
<link href="~/css/bootstrap/bootstrap.min.css" rel="stylesheet"/> | ||
<link href="~/css/site.css" rel="stylesheet" asp-append-version="true"/> | ||
</head> | ||
|
||
<body> | ||
<div class="main"> | ||
<div class="content px-4"> | ||
<h1 class="text-danger">Error.</h1> | ||
<h2 class="text-danger">An error occurred while processing your request.</h2> | ||
|
||
@if (this.Model.ShowRequestId) | ||
{ | ||
<p> | ||
<strong>Request ID:</strong> <code>@(this.Model.RequestId)</code> | ||
</p> | ||
} | ||
|
||
<h3>Development Mode</h3> | ||
<p> | ||
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred. | ||
</p> | ||
<p> | ||
<strong>The Development environment shouldn't be enabled for deployed applications.</strong> | ||
It can result in displaying sensitive information from exceptions to end users. | ||
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong> | ||
and restarting the app. | ||
</p> | ||
</div> | ||
</div> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.