-
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.
Fix #494: Moved from WASM to ServerSide
- Loading branch information
antoineatrhea
committed
Jan 3, 2024
1 parent
fa14eca
commit 9cfc0b9
Showing
20 changed files
with
437 additions
and
226 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
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> |
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,58 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="Error.cshtml.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. | ||
// | ||
// 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 | ||
// | ||
// 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. | ||
// | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
|
||
namespace COMETwebapp.Pages | ||
{ | ||
using System.Diagnostics; | ||
|
||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
|
||
/// <summary> | ||
/// Data model that provide information about request when an error occurs | ||
/// </summary> | ||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] | ||
[IgnoreAntiforgeryToken] | ||
public class ErrorModel : PageModel | ||
{ | ||
/// <summary> | ||
/// Gets or sets the request id | ||
/// </summary> | ||
public string RequestId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets the assert the the <see cref="RequestId" /> should be shown | ||
/// </summary> | ||
public bool ShowRequestId => !string.IsNullOrEmpty(this.RequestId); | ||
|
||
/// <summary> | ||
/// Sets the <see cref="RequestId" /> based on context | ||
/// </summary> | ||
public void OnGet() | ||
{ | ||
this.RequestId = Activity.Current?.Id ?? this.HttpContext.TraceIdentifier; | ||
} | ||
} | ||
} |
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.