-
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.
organizations can be edited/created + unit tests
- Loading branch information
Showing
8 changed files
with
228 additions
and
70 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
46 changes: 46 additions & 0 deletions
46
COMETwebapp/Components/SiteDirectory/OrganizationsForm.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,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 http://www.gnu.org/licenses/. | ||
-------------------------------------------------------------------------------> | ||
@inherits SelectedDataItemForm | ||
|
||
<EditForm Context="editFormContext" Model="@(this.ViewModel.Thing)" OnValidSubmit="@(this.OnValidSubmit)"> | ||
<FluentValidationValidator /> | ||
<DxFormLayout CssClass="w-100"> | ||
<DxFormLayoutItem Caption="Shortname:" ColSpanMd="10"> | ||
<DxTextBox @bind-Text="@this.ViewModel.Thing.ShortName"/> | ||
</DxFormLayoutItem> | ||
<DxFormLayoutItem Caption="Name:" ColSpanMd="10"> | ||
<DxTextBox @bind-Text="@this.ViewModel.Thing.Name"/> | ||
</DxFormLayoutItem> | ||
<DxFormLayoutItem Caption="Deprecated:" ColSpanMd="6"> | ||
<DxCheckBox @bind-Checked="@this.ViewModel.Thing.IsDeprecated"/> | ||
</DxFormLayoutItem> | ||
</DxFormLayout> | ||
<div class="pt-3"></div> | ||
<ValidationSummary /> | ||
<div class="dxbl-grid-edit-form-buttons"> | ||
<DxButton Id="saveOrganizationButton" | ||
SubmitFormOnClick="true"> | ||
Save | ||
</DxButton> | ||
|
||
<DxButton Id="cancelOrganizationButton" | ||
Click="@(() => this.OnCancel())" | ||
RenderStyle="ButtonRenderStyle.Secondary"> | ||
Cancel | ||
</DxButton> | ||
</div> | ||
</EditForm> |
55 changes: 55 additions & 0 deletions
55
COMETwebapp/Components/SiteDirectory/OrganizationsForm.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,55 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="OrganizationsForm.razor.cs" company="RHEA System S.A."> | ||
// 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 <http://www.gnu.org/licenses/>. | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
|
||
namespace COMETwebapp.Components.SiteDirectory | ||
{ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
using COMETwebapp.Components.Common; | ||
using COMETwebapp.ViewModels.Components.SiteDirectory.Organizations; | ||
|
||
using Microsoft.AspNetCore.Components; | ||
|
||
/// <summary> | ||
/// Support class for the <see cref="OrganizationsForm"/> | ||
/// </summary> | ||
public partial class OrganizationsForm : SelectedDataItemForm | ||
{ | ||
/// <summary> | ||
/// The <see cref="IOrganizationsTableViewModel" /> for this component | ||
/// </summary> | ||
[Parameter, Required] | ||
public IOrganizationsTableViewModel ViewModel { get; set; } | ||
|
||
/// <summary> | ||
/// Method that is executed when there is a valid submit | ||
/// </summary> | ||
/// <returns>A <see cref="Task"/></returns> | ||
protected override async Task OnValidSubmit() | ||
{ | ||
await this.ViewModel.CreateOrEditOrganization(this.ShouldCreate); | ||
await base.OnValidSubmit(); | ||
} | ||
} | ||
} |
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