diff --git a/FrontEnd.sln.DotSettings b/FrontEnd.sln.DotSettings index 740b88a..dda91d3 100644 --- a/FrontEnd.sln.DotSettings +++ b/FrontEnd.sln.DotSettings @@ -1,4 +1,59 @@ <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> + <s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=Acsanyi/@EntryIndexedValue"><?xml version="1.0" encoding="utf-16"?><Profile name="Acsanyi"><GherkinReformatCode>True</GherkinReformatCode><XAMLCollapseEmptyTags>False</XAMLCollapseEmptyTags><HtmlReformatCode>True</HtmlReformatCode><CSReformatCode>True</CSReformatCode><CSharpFormatDocComments>True</CSharpFormatDocComments><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings><EmbraceInRegion>True</EmbraceInRegion></CSOptimizeUsings><CSShortenReferences>True</CSShortenReferences><AspOptimizeRegisterDirectives>True</AspOptimizeRegisterDirectives><CSReorderTypeMembers>True</CSReorderTypeMembers><IDEA_SETTINGS>&lt;profile version="1.0"&gt; + &lt;option name="myName" value="Acsanyi" /&gt; + &lt;inspection_tool class="WrongPropertyKeyValueDelimiter" enabled="false" level="WEAK WARNING" enabled_by_default="false" /&gt; +&lt;/profile&gt;</IDEA_SETTINGS><RIDER_SETTINGS>&lt;profile&gt; + &lt;Language id="CSS"&gt; + &lt;Rearrange&gt;true&lt;/Rearrange&gt; + &lt;Reformat&gt;true&lt;/Reformat&gt; + &lt;/Language&gt; + &lt;Language id="EditorConfig"&gt; + &lt;Reformat&gt;true&lt;/Reformat&gt; + &lt;/Language&gt; + &lt;Language id="GraphQL"&gt; + &lt;Reformat&gt;true&lt;/Reformat&gt; + &lt;/Language&gt; + &lt;Language id="HTML"&gt; + &lt;Rearrange&gt;true&lt;/Rearrange&gt; + &lt;OptimizeImports&gt;true&lt;/OptimizeImports&gt; + &lt;Reformat&gt;true&lt;/Reformat&gt; + &lt;/Language&gt; + &lt;Language id="Handlebars"&gt; + &lt;Reformat&gt;true&lt;/Reformat&gt; + &lt;/Language&gt; + &lt;Language id="Ini"&gt; + &lt;Reformat&gt;true&lt;/Reformat&gt; + &lt;/Language&gt; + &lt;Language id="JSON"&gt; + &lt;Reformat&gt;true&lt;/Reformat&gt; + &lt;/Language&gt; + &lt;Language id="Markdown"&gt; + &lt;Reformat&gt;true&lt;/Reformat&gt; + &lt;/Language&gt; + &lt;Language id="Mermaid"&gt; + &lt;Reformat&gt;true&lt;/Reformat&gt; + &lt;/Language&gt; + &lt;Language id="Properties"&gt; + &lt;Reformat&gt;true&lt;/Reformat&gt; + &lt;/Language&gt; + &lt;Language id="RELAX-NG"&gt; + &lt;Reformat&gt;true&lt;/Reformat&gt; + &lt;/Language&gt; + &lt;Language id="SQL"&gt; + &lt;Reformat&gt;true&lt;/Reformat&gt; + &lt;/Language&gt; + &lt;Language id="XML"&gt; + &lt;Rearrange&gt;true&lt;/Rearrange&gt; + &lt;OptimizeImports&gt;true&lt;/OptimizeImports&gt; + &lt;Reformat&gt;true&lt;/Reformat&gt; + &lt;/Language&gt; + &lt;Language id="liquid"&gt; + &lt;Reformat&gt;true&lt;/Reformat&gt; + &lt;/Language&gt; + &lt;Language id="yaml"&gt; + &lt;Reformat&gt;true&lt;/Reformat&gt; + &lt;/Language&gt; +&lt;/profile&gt;</RIDER_SETTINGS></Profile></s:String> <s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/MAX_ATTRIBUTE_LENGTH_FOR_SAME_LINE/@EntryValue">1</s:Int64> <s:String x:Key="/Default/Environment/Hierarchy/NuGetOptions/ConfigRestoreAuto/@EntryValue">Enable</s:String> <s:String x:Key="/Default/Environment/Hierarchy/NuGetOptions/ConfigRestoreEnabled/@EntryValue">Enable</s:String> diff --git a/UIWasm/Components/Modules/Documents/Application/EGAddApplicationDialog.razor b/UIWasm/Components/Modules/Documents/ApplicationGrid/EGAddApplicationDialog.razor similarity index 100% rename from UIWasm/Components/Modules/Documents/Application/EGAddApplicationDialog.razor rename to UIWasm/Components/Modules/Documents/ApplicationGrid/EGAddApplicationDialog.razor diff --git a/UIWasm/Components/Modules/Documents/Application/EGAddApplicationDialog.razor.cs b/UIWasm/Components/Modules/Documents/ApplicationGrid/EGAddApplicationDialog.razor.cs similarity index 84% rename from UIWasm/Components/Modules/Documents/Application/EGAddApplicationDialog.razor.cs rename to UIWasm/Components/Modules/Documents/ApplicationGrid/EGAddApplicationDialog.razor.cs index 54b79e7..d1006c9 100644 --- a/UIWasm/Components/Modules/Documents/Application/EGAddApplicationDialog.razor.cs +++ b/UIWasm/Components/Modules/Documents/ApplicationGrid/EGAddApplicationDialog.razor.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Components; using Microsoft.FluentUI.AspNetCore.Components; -namespace UIWasm.Components.Modules.Documents.Application; +namespace UIWasm.Components.Modules.Documents.ApplicationGrid; public partial class EGAddApplicationDialog { diff --git a/UIWasm/Components/Modules/Documents/Application/EGApplicationGrid.razor b/UIWasm/Components/Modules/Documents/ApplicationGrid/EGApplicationGrid.razor similarity index 100% rename from UIWasm/Components/Modules/Documents/Application/EGApplicationGrid.razor rename to UIWasm/Components/Modules/Documents/ApplicationGrid/EGApplicationGrid.razor diff --git a/UIWasm/Components/Modules/Documents/Application/EGApplicationGrid.razor.cs b/UIWasm/Components/Modules/Documents/ApplicationGrid/EGApplicationGrid.razor.cs similarity index 91% rename from UIWasm/Components/Modules/Documents/Application/EGApplicationGrid.razor.cs rename to UIWasm/Components/Modules/Documents/ApplicationGrid/EGApplicationGrid.razor.cs index 43c276f..c2205bc 100644 --- a/UIWasm/Components/Modules/Documents/Application/EGApplicationGrid.razor.cs +++ b/UIWasm/Components/Modules/Documents/ApplicationGrid/EGApplicationGrid.razor.cs @@ -1,10 +1,9 @@ using EncyclopediaGalactica.BusinessLogic.Contracts; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Web; using Microsoft.FluentUI.AspNetCore.Components; using UIWasm.Services; -namespace UIWasm.Components.Modules.Documents.Application; +namespace UIWasm.Components.Modules.Documents.ApplicationGrid; public partial class EGApplicationGrid { @@ -34,7 +33,7 @@ protected override Task OnInitializedAsync() private async Task HandleAddClick() { - DialogService.ShowDialogAsync<EGAddApplicationDialog>( + DialogService.ShowDialogAsync<ApplicationGrid.EGAddApplicationDialog>( new ApplicationResult(), new DialogParameters { diff --git a/UIWasm/Components/Modules/Documents/DocumentTypeGrid/EGAddDocumentTypeDialog.razor.cs b/UIWasm/Components/Modules/Documents/DocumentTypeGrid/EGAddDocumentTypeDialog.razor.cs index a11033f..abfe1c9 100644 --- a/UIWasm/Components/Modules/Documents/DocumentTypeGrid/EGAddDocumentTypeDialog.razor.cs +++ b/UIWasm/Components/Modules/Documents/DocumentTypeGrid/EGAddDocumentTypeDialog.razor.cs @@ -1,7 +1,7 @@ using EncyclopediaGalactica.BusinessLogic.Contracts; using Microsoft.AspNetCore.Components; using Microsoft.FluentUI.AspNetCore.Components; -using UIWasm.Components.Modules.Documents.Application; +using UIWasm.Components.Modules.Documents.ApplicationGrid; namespace UIWasm.Components.Modules.Documents.DocumentTypeGrid; @@ -15,4 +15,4 @@ public partial class EGAddDocumentTypeDialog [Parameter] public DocumentTypeResult Content { get; set; } -} \ No newline at end of file +} diff --git a/UIWasm/Components/Modules/Documents/DocumentTypeGrid/EGDeleteDocumentTypeDialog.razor.cs b/UIWasm/Components/Modules/Documents/DocumentTypeGrid/EGDeleteDocumentTypeDialog.razor.cs index be6b5c2..c405a50 100644 --- a/UIWasm/Components/Modules/Documents/DocumentTypeGrid/EGDeleteDocumentTypeDialog.razor.cs +++ b/UIWasm/Components/Modules/Documents/DocumentTypeGrid/EGDeleteDocumentTypeDialog.razor.cs @@ -1,7 +1,7 @@ using EncyclopediaGalactica.BusinessLogic.Contracts; using Microsoft.AspNetCore.Components; using Microsoft.FluentUI.AspNetCore.Components; -using UIWasm.Components.Modules.Documents.Application; +using UIWasm.Components.Modules.Documents.ApplicationGrid; namespace UIWasm.Components.Modules.Documents.DocumentTypeGrid; @@ -15,4 +15,4 @@ public partial class EGDeleteDocumentTypeDialog [Parameter] public DocumentTypeResult Content { get; set; } -} \ No newline at end of file +} diff --git a/UIWasm/Components/Modules/Documents/DocumentTypeGrid/EGEditDocumentTypeDialog.razor.cs b/UIWasm/Components/Modules/Documents/DocumentTypeGrid/EGEditDocumentTypeDialog.razor.cs index f4bca81..ee7d216 100644 --- a/UIWasm/Components/Modules/Documents/DocumentTypeGrid/EGEditDocumentTypeDialog.razor.cs +++ b/UIWasm/Components/Modules/Documents/DocumentTypeGrid/EGEditDocumentTypeDialog.razor.cs @@ -1,7 +1,7 @@ using EncyclopediaGalactica.BusinessLogic.Contracts; using Microsoft.AspNetCore.Components; using Microsoft.FluentUI.AspNetCore.Components; -using UIWasm.Components.Modules.Documents.Application; +using UIWasm.Components.Modules.Documents.ApplicationGrid; namespace UIWasm.Components.Modules.Documents.DocumentTypeGrid; @@ -15,4 +15,4 @@ public partial class EGEditDocumentTypeDialog [Parameter] public DocumentTypeResult Content { get; set; } -} \ No newline at end of file +} diff --git a/UIWasm/Components/Modules/Documents/EGDocumentsMainContent.razor b/UIWasm/Components/Modules/Documents/EGDocumentsMainContent.razor index 74ec502..60581f0 100644 --- a/UIWasm/Components/Modules/Documents/EGDocumentsMainContent.razor +++ b/UIWasm/Components/Modules/Documents/EGDocumentsMainContent.razor @@ -27,8 +27,12 @@ else <EGRelationTypeGrid/> break; + case "relations": + <EGRelationGrid/> + break; + case "applications": <EGApplicationGrid/> break; } -} \ No newline at end of file +} diff --git a/UIWasm/Components/Modules/Documents/RelationGrid/EGAddRelationDialog.razor b/UIWasm/Components/Modules/Documents/RelationGrid/EGAddRelationDialog.razor new file mode 100644 index 0000000..534925a --- /dev/null +++ b/UIWasm/Components/Modules/Documents/RelationGrid/EGAddRelationDialog.razor @@ -0,0 +1,12 @@ +@implements IDialogContentComponent<EncyclopediaGalactica.BusinessLogic.Contracts.RelationResult> + +<FluentDialogHeader ShowDismiss="true">Add new Relation</FluentDialogHeader> +<FluentDialogBody> + <FluentNumberField TValue="long" @bind-Value="Content.Id" Disabled="true">File format id:</FluentNumberField> + <FluentNumberField TValue="long" @bind-Value="Content.LeftDocument.Id">Left Document Name:</FluentNumberField> + <FluentTextField @bind-Value="Content.LeftDocument.Name">Left Document Name:</FluentTextField> + <FluentNumberField TValue="long" @bind-Value="Content.RelationType.Id">Relation type id:</FluentNumberField> + <FluentTextField @bind-Value="Content.RelationType.Name">Relation Type Name:</FluentTextField> + <FluentNumberField TValue="long" @bind-Value="Content.RightDocument.Id">Right Document Name:</FluentNumberField> + <FluentTextField @bind-Value="Content.RightDocument.Name">Right Document Name:</FluentTextField> +</FluentDialogBody> diff --git a/UIWasm/Components/Modules/Documents/RelationGrid/EGAddRelationDialog.razor.cs b/UIWasm/Components/Modules/Documents/RelationGrid/EGAddRelationDialog.razor.cs new file mode 100644 index 0000000..6bbfa2b --- /dev/null +++ b/UIWasm/Components/Modules/Documents/RelationGrid/EGAddRelationDialog.razor.cs @@ -0,0 +1,18 @@ +#region + +using EncyclopediaGalactica.BusinessLogic.Contracts; +using Microsoft.AspNetCore.Components; +using Microsoft.FluentUI.AspNetCore.Components; + +#endregion + +namespace UIWasm.Components.Modules.Documents.RelationGrid; + +public partial class EGAddRelationDialog +{ + [CascadingParameter] + public FluentDialog? FluentDialog { get; set; } + + [Parameter] + public RelationResult Content { get; set; } +} \ No newline at end of file diff --git a/UIWasm/Components/Modules/Documents/RelationGrid/EGDeleteRelationDialog.razor b/UIWasm/Components/Modules/Documents/RelationGrid/EGDeleteRelationDialog.razor new file mode 100644 index 0000000..378ebdf --- /dev/null +++ b/UIWasm/Components/Modules/Documents/RelationGrid/EGDeleteRelationDialog.razor @@ -0,0 +1,15 @@ +@implements IDialogContentComponent<EncyclopediaGalactica.BusinessLogic.Contracts.RelationResult> + +<FluentDialogHeader ShowDismiss="true">Delete Relation</FluentDialogHeader> +<FluentDialogBody> + <FluentNumberField TValue="long" @bind-Value="Content.Id" Disabled="true">File format id:</FluentNumberField> + <FluentNumberField TValue="long" @bind-Value="Content.LeftDocument.Id" Disabled="true">Left Document Name: + </FluentNumberField> + <FluentTextField @bind-Value="Content.LeftDocument.Name" Disabled="true">Left Document Name:</FluentTextField> + <FluentNumberField TValue="long" @bind-Value="Content.RelationType.Id" Disabled="true">Relation type id: + </FluentNumberField> + <FluentTextField @bind-Value="Content.RelationType.Name" Disabled="true">Relation Type Name:</FluentTextField> + <FluentNumberField TValue="long" @bind-Value="Content.RightDocument.Id" Disabled="true">Right Document Name: + </FluentNumberField> + <FluentTextField @bind-Value="Content.RightDocument.Name" Disabled="true">Right Document Name:</FluentTextField> +</FluentDialogBody> diff --git a/UIWasm/Components/Modules/Documents/RelationGrid/EGDeleteRelationDialog.razor.cs b/UIWasm/Components/Modules/Documents/RelationGrid/EGDeleteRelationDialog.razor.cs new file mode 100644 index 0000000..eebff36 --- /dev/null +++ b/UIWasm/Components/Modules/Documents/RelationGrid/EGDeleteRelationDialog.razor.cs @@ -0,0 +1,18 @@ +#region + +using EncyclopediaGalactica.BusinessLogic.Contracts; +using Microsoft.AspNetCore.Components; +using Microsoft.FluentUI.AspNetCore.Components; + +#endregion + +namespace UIWasm.Components.Modules.Documents.RelationGrid; + +public partial class EGDeleteRelationDialog +{ + [CascadingParameter] + public FluentDialog? FluentDialog { get; set; } + + [Parameter] + public RelationResult Content { get; set; } +} \ No newline at end of file diff --git a/UIWasm/Components/Modules/Documents/RelationGrid/EGEditRelationDialog.razor b/UIWasm/Components/Modules/Documents/RelationGrid/EGEditRelationDialog.razor new file mode 100644 index 0000000..8f357c9 --- /dev/null +++ b/UIWasm/Components/Modules/Documents/RelationGrid/EGEditRelationDialog.razor @@ -0,0 +1,12 @@ +@implements IDialogContentComponent<EncyclopediaGalactica.BusinessLogic.Contracts.RelationResult> + +<FluentDialogHeader ShowDismiss="true">Edit Relation</FluentDialogHeader> +<FluentDialogBody> + <FluentNumberField TValue="long" @bind-Value="Content.Id" Disabled="true">File format id:</FluentNumberField> + <FluentNumberField TValue="long" @bind-Value="Content.LeftDocument.Id">Left Document Name:</FluentNumberField> + <FluentTextField @bind-Value="Content.LeftDocument.Name">Left Document Name:</FluentTextField> + <FluentNumberField TValue="long" @bind-Value="Content.RelationType.Id">Relation type id:</FluentNumberField> + <FluentTextField @bind-Value="Content.RelationType.Name">Relation Type Name:</FluentTextField> + <FluentNumberField TValue="long" @bind-Value="Content.RightDocument.Id">Right Document Name:</FluentNumberField> + <FluentTextField @bind-Value="Content.RightDocument.Name">Right Document Name:</FluentTextField> +</FluentDialogBody> diff --git a/UIWasm/Components/Modules/Documents/RelationGrid/EGEditRelationDialog.razor.cs b/UIWasm/Components/Modules/Documents/RelationGrid/EGEditRelationDialog.razor.cs new file mode 100644 index 0000000..dbb1f99 --- /dev/null +++ b/UIWasm/Components/Modules/Documents/RelationGrid/EGEditRelationDialog.razor.cs @@ -0,0 +1,18 @@ +#region + +using EncyclopediaGalactica.BusinessLogic.Contracts; +using Microsoft.AspNetCore.Components; +using Microsoft.FluentUI.AspNetCore.Components; + +#endregion + +namespace UIWasm.Components.Modules.Documents.RelationGrid; + +public partial class EGEditRelationDialog +{ + [CascadingParameter] + public FluentDialog? FluentDialog { get; set; } + + [Parameter] + public RelationResult Content { get; set; } +} diff --git a/UIWasm/Components/Modules/Documents/RelationGrid/EGRelationGrid.razor b/UIWasm/Components/Modules/Documents/RelationGrid/EGRelationGrid.razor new file mode 100644 index 0000000..3db1d31 --- /dev/null +++ b/UIWasm/Components/Modules/Documents/RelationGrid/EGRelationGrid.razor @@ -0,0 +1,33 @@ +@using EncyclopediaGalactica.BusinessLogic.Contracts +@inherits Fluxor.Blazor.Web.Components.FluxorComponent +<FluentGrid Justify="JustifyContent.SpaceEvenly" Style="border: #1b6ec2; border-style: solid; border-width: 1px;"> + <FluentGridItem xs="2">Relations</FluentGridItem> + <FluentGridItem xs="8"></FluentGridItem> + <FluentGridItem xs="2"> + <FluentButton IconStart="@(new Icons.Filled.Size24.AddCircle())" + OnClick="@(async () => await HandleClickOnAddAsync().ConfigureAwait(false))"> + Add + </FluentButton> + </FluentGridItem> + <FluentGridItem xs="12"> + <FluentDataGrid TGridItem="RelationResult" + ItemsProvider="GridItemsProvider" + Virtualize="true" + @ref="Grid"> + <PropertyColumn Title="Id" Property="@(item => item.Id)"/> + <PropertyColumn Title="Left Document Id" Property="@(item => item.LeftDocument.Id)"/> + <PropertyColumn Title="Left Document Title" Property="@(item => item.LeftDocument.Name)"/> + <PropertyColumn Title="Relation Type" Property="@(item => item.RelationType.Name)"/> + <PropertyColumn Title="Right Document Id" Property="@(item => item.RightDocument.Id)"/> + <PropertyColumn Title="Right Document Title" Property="@(item => item.RightDocument.Name)"/> + <TemplateColumn Title="Actions"> + <FluentButton IconEnd="@(new Icons.Regular.Size16.Edit())" + OnClick="@(async e => await HandleOnClickEditAsync(e, context).ConfigureAwait(false))"> + </FluentButton> + <FluentButton IconEnd="@(new Icons.Regular.Size16.Delete())" + OnClick="@(async e => await HandleOnClickDeleteAsync(e, context).ConfigureAwait(false))"> + </FluentButton> + </TemplateColumn> + </FluentDataGrid> + </FluentGridItem> +</FluentGrid> diff --git a/UIWasm/Components/Modules/Documents/RelationGrid/EGRelationGrid.razor.cs b/UIWasm/Components/Modules/Documents/RelationGrid/EGRelationGrid.razor.cs new file mode 100644 index 0000000..6432998 --- /dev/null +++ b/UIWasm/Components/Modules/Documents/RelationGrid/EGRelationGrid.razor.cs @@ -0,0 +1,107 @@ +#region + +using EncyclopediaGalactica.BusinessLogic.Contracts; +using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components.Web; +using Microsoft.FluentUI.AspNetCore.Components; +using UIWasm.Services; + +#endregion + +namespace UIWasm.Components.Modules.Documents.RelationGrid; + +public partial class EGRelationGrid +{ + private FluentDataGrid<RelationResult> Grid; + private GridItemsProvider<RelationResult> GridItemsProvider; + + [Inject] + private ILogger<EGRelationGrid> Logger { get; set; } + + [Inject] + private IRelationService RelationService { get; set; } + + [Inject] + private IDialogService DialogService { get; set; } + + protected override async Task OnInitializedAsync() + { + GridItemsProvider = async request => + { + ICollection<RelationResult> r = await RelationService.GetAllAsync().ConfigureAwait(false); + return GridItemsProviderResult.From<RelationResult>(r, r.Count); + }; + } + + private async Task HandleClickOnAddAsync() + { + await DialogService.ShowDialogAsync<EGAddRelationDialog>( + new RelationResult(), + new DialogParameters + { + Width = "600px", + Height = "400px", + PrimaryAction = "Save", + PrimaryActionEnabled = true, + OnDialogResult = DialogService.CreateDialogCallback(this, HandleAddSaveAsync), + PreventScroll = true, + PreventDismissOnOverlayClick = true + }).ConfigureAwait(false); + } + + private async Task HandleAddSaveAsync(DialogResult dialogResult) + { + if (dialogResult is { Cancelled: false, Data: not null }) + { + Logger.LogInformation("Add is saved"); + } + } + + private async Task HandleOnClickEditAsync(MouseEventArgs mouseEventArgs, RelationResult context) + { + await DialogService.ShowDialogAsync<EGEditRelationDialog>( + context, + new DialogParameters + { + Width = "600px", + Height = "400px", + PrimaryAction = "Delete", + PrimaryActionEnabled = true, + OnDialogResult = DialogService.CreateDialogCallback(this, HandleEditSaveAsync), + PreventScroll = true, + PreventDismissOnOverlayClick = true + }).ConfigureAwait(false); + } + + private async Task HandleEditSaveAsync(DialogResult dialogResult) + { + if (dialogResult is { Cancelled: false, Data: not null }) + { + Logger.LogInformation("Edit is saved"); + } + } + + private async Task HandleOnClickDeleteAsync(MouseEventArgs mouseEventArgs, RelationResult context) + { + await DialogService.ShowDialogAsync<EGDeleteRelationDialog>( + context, + new DialogParameters + { + Width = "600px", + Height = "400px", + PrimaryAction = "Delete", + PrimaryActionEnabled = true, + OnDialogResult = DialogService.CreateDialogCallback(this, HandleDeleteSaveAsync), + PreventScroll = true, + PreventDismissOnOverlayClick = true + }).ConfigureAwait(false); + } + + private async Task HandleDeleteSaveAsync(DialogResult dialogResult) + { + if (dialogResult is { Cancelled: false, Data: not null }) + { + Logger.LogInformation("Delete is saved"); + } + } +} diff --git a/UIWasm/Components/Modules/Documents/RelationGrid/RelationGrid.razor b/UIWasm/Components/Modules/Documents/RelationGrid/RelationGrid.razor deleted file mode 100644 index 0f680e5..0000000 --- a/UIWasm/Components/Modules/Documents/RelationGrid/RelationGrid.razor +++ /dev/null @@ -1,5 +0,0 @@ -<h3>RelationGrid</h3> - -@code { - -} \ No newline at end of file diff --git a/UIWasm/Components/Modules/Documents/RelationGrid/RelationGrid.razor.cs b/UIWasm/Components/Modules/Documents/RelationGrid/RelationGrid.razor.cs deleted file mode 100644 index e11c407..0000000 --- a/UIWasm/Components/Modules/Documents/RelationGrid/RelationGrid.razor.cs +++ /dev/null @@ -1,7 +0,0 @@ -using Microsoft.AspNetCore.Components; - -namespace UIWasm.Components.Modules.Documents.RelationGrid; - -public partial class RelationGrid : ComponentBase -{ -} \ No newline at end of file diff --git a/UIWasm/Program.cs b/UIWasm/Program.cs index 80bce85..f19e7c5 100644 --- a/UIWasm/Program.cs +++ b/UIWasm/Program.cs @@ -1,3 +1,5 @@ +#region + using Fluxor; using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; @@ -5,6 +7,8 @@ using UIWasm; using UIWasm.Services; +#endregion + var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add<App>("#app"); builder.RootComponents.Add<HeadOutlet>("head::after"); @@ -23,6 +27,7 @@ .AddScoped<IDocumentService, DocumentService>() .AddScoped<IDocumentTypeService, DocumentTypeService>() .AddScoped<IFileFormatService, FileFormatService>() + .AddScoped<IRelationService, RelationService>() ; builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); @@ -30,4 +35,4 @@ builder.Services.AddFluxor(options => options.ScanAssemblies(typeof(Program).Assembly)); -await builder.Build().RunAsync(); \ No newline at end of file +await builder.Build().RunAsync(); diff --git a/UIWasm/Services/IRelationService.cs b/UIWasm/Services/IRelationService.cs new file mode 100644 index 0000000..3814ede --- /dev/null +++ b/UIWasm/Services/IRelationService.cs @@ -0,0 +1,8 @@ +using EncyclopediaGalactica.BusinessLogic.Contracts; + +namespace UIWasm.Services; + +public interface IRelationService +{ + Task<ICollection<RelationResult>> GetAllAsync(); +} \ No newline at end of file diff --git a/UIWasm/Services/RelationService.cs b/UIWasm/Services/RelationService.cs new file mode 100644 index 0000000..40914fa --- /dev/null +++ b/UIWasm/Services/RelationService.cs @@ -0,0 +1,65 @@ +using EncyclopediaGalactica.BusinessLogic.Contracts; + +namespace UIWasm.Services; + +public class RelationService : IRelationService +{ + private ICollection<RelationResult> _storage = new List<RelationResult> + { + new RelationResult + { + Id = 1, + LeftDocument = new DocumentResult + { + Id = 1, + Name = "Karman Todor Wikipedia page", + Description = "Karman Todor Wikipedia page" + }, + LeftDocumentId = 1, + RelationType = new RelationTypeResult + { + Id = 3, + Name = "RelatesTo", + Description = "Describes a connection between two related document." + }, + RelationTypeId = 3, + RightDocument = new DocumentResult + { + Id = 2, + Name = "NeoVim Editor Wikipedia page", + Description = "NeoVim Editor Wikipedia Page" + }, + RightDocumentId = 2 + }, + new RelationResult + { + Id = 1, + LeftDocument = new DocumentResult + { + Id = 1, + Name = "Karman Todor Wikipedia page", + Description = "Karman Todor Wikipedia page" + }, + LeftDocumentId = 1, + RelationType = new RelationTypeResult + { + Id = 3, + Name = "RelatesTo", + Description = "Describes a connection between two related document." + }, + RelationTypeId = 3, + RightDocument = new DocumentResult + { + Id = 3, + Name = "Jules Verne book from Gutenberg.org", + Description = "Jules Verne book from Gutenberg.org" + }, + RightDocumentId = 3 + }, + }; + + public async Task<ICollection<RelationResult>> GetAllAsync() + { + return _storage; + } +} \ No newline at end of file diff --git a/UIWasm/Services/RelationTypeService.cs b/UIWasm/Services/RelationTypeService.cs index 2fcf258..8138f93 100644 --- a/UIWasm/Services/RelationTypeService.cs +++ b/UIWasm/Services/RelationTypeService.cs @@ -18,6 +18,12 @@ public class RelationTypeService : IRelationTypeService Name = "Extends", Description = "The item at the right side extends the item at the left side." }, + new RelationTypeResult + { + Id = 3, + Name = "RelatesTo", + Description = "Describes a connection between two related document." + } }; public async Task<ICollection<RelationTypeResult>> GetAllAsync() diff --git a/UIWasm/Services/ScreenService.cs b/UIWasm/Services/ScreenService.cs index 9692b5d..c15122d 100644 --- a/UIWasm/Services/ScreenService.cs +++ b/UIWasm/Services/ScreenService.cs @@ -1,5 +1,9 @@ +#region + using EncyclopediaGalactica.BusinessLogic.Contracts; +#endregion + namespace UIWasm.Services; public class ScreenService : IScreenService @@ -10,12 +14,16 @@ public class ScreenService : IScreenService new ScreenResult { Id = 120, Name = "Document Type", UnifiedName = "document_type", ModuleId = 1 }, new ScreenResult { Id = 130, Name = "Documents Catalog", UnifiedName = "document_catalog", ModuleId = 1 }, new ScreenResult { Id = 140, Name = "File format", UnifiedName = "file_format", ModuleId = 1 }, + new ScreenResult { Id = 150, Name = "Relations", UnifiedName = "relations", ModuleId = 1 }, new ScreenResult { Id = 101, Name = "Relation Types", UnifiedName = "relation_types", ModuleId = 1 }, new ScreenResult { Id = 110, Name = "Applications", UnifiedName = "applications", ModuleId = 1 }, + new ScreenResult { Id = 102, Name = "Incomes", UnifiedName = "incomes", ModuleId = 2 }, new ScreenResult { Id = 103, Name = "Expenses", UnifiedName = "expenses", ModuleId = 2 }, + new ScreenResult { Id = 104, Name = "Stellar items", UnifiedName = "stellar_items", ModuleId = 3 }, new ScreenResult { Id = 105, Name = "Route planner", UnifiedName = "route_planner", ModuleId = 3 }, + new ScreenResult { Id = 106, Name = "Users", UnifiedName = "users", ModuleId = 4 }, new ScreenResult { Id = 107, Name = "Roles", UnifiedName = "roles", ModuleId = 4 }, }; @@ -29,4 +37,4 @@ public IEnumerable<ScreenResult> GetScreensOfModule(long moduleId) { return _storage.Where(w => w.ModuleId == moduleId).ToList(); } -} \ No newline at end of file +} diff --git a/UIWasm/UIWasm.csproj b/UIWasm/UIWasm.csproj index 669921b..f2e3e8b 100644 --- a/UIWasm/UIWasm.csproj +++ b/UIWasm/UIWasm.csproj @@ -7,7 +7,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="encyclopediagalactica.businesslogic.contracts" Version="0.42.0"/> + <PackageReference Include="encyclopediagalactica.businesslogic.contracts" Version="0.44.1"/> <PackageReference Include="Fluxor" Version="5.9.1"/> <PackageReference Include="Fluxor.Blazor.Web" Version="5.9.1"/> <PackageReference Include="Fluxor.Blazor.Web.ReduxDevTools" Version="5.9.1"/> diff --git a/UIWasm/_Imports.razor b/UIWasm/_Imports.razor index 20af58f..92ab937 100644 --- a/UIWasm/_Imports.razor +++ b/UIWasm/_Imports.razor @@ -19,7 +19,8 @@ @using UIWasm.Components.Modules.Documents.DocumentStructuresGrid @using UIWasm.Components.Modules.Documents.DocumentTypeGrid @using UIWasm.Components.Modules.Documents.RelationTypeGrid -@using UIWasm.Components.Modules.Documents.Application +@using UIWasm.Components.Modules.Documents.ApplicationGrid @using UIWasm.Components.Modules.Documents.FileFormatGrid +@using UIWasm.Components.Modules.Documents.RelationGrid @using UIWasm.Components.Modules.Finance -@using UIWasm.Components.Modules.StarMap \ No newline at end of file +@using UIWasm.Components.Modules.StarMap