Added a docker image and compose file for the application
This commit is contained in:
@@ -31,13 +31,20 @@
|
||||
@inject IDialogService DialogService;
|
||||
|
||||
@code {
|
||||
/*
|
||||
public async Task ShowAddGroupingDialog(ArtifactGroupingRowElement validationModel)
|
||||
{
|
||||
var parameters = new DialogParameters { ["Model"] = validationModel, ["IsUpdate"] = true};
|
||||
var parameters = new DialogParameters { ["Model"] = validationModel};
|
||||
|
||||
var options = new DialogOptions { CloseOnEscapeKey = true, BackdropClick = false };
|
||||
|
||||
var dialog = await DialogService.ShowAsync<AddGroupingDialog>("Create a Group", parameters, options);
|
||||
var result = await dialog.Result;
|
||||
|
||||
if (result is not null && !result.Canceled)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -81,7 +81,8 @@
|
||||
<UploadDropBox
|
||||
@ref="@_uploadComponent"
|
||||
FilesUploaded="OnFilesUploaded"
|
||||
ClearClicked="OnClearFilesClicked"></UploadDropBox>
|
||||
ClearClicked="OnClearFilesClicked"
|
||||
ExistingFiles="ExistingFiles"></UploadDropBox>
|
||||
</MudPaper>
|
||||
@if (Model is not null)
|
||||
{
|
||||
@@ -101,19 +102,22 @@
|
||||
</div>
|
||||
|
||||
<MudGrid Justify="Justify.FlexEnd" Class="pt-6">
|
||||
<MudItem>
|
||||
<MudCheckBox Label="Publicly Visible" T="bool"></MudCheckBox>
|
||||
@*<MudCheckBox Label="Publicly Visible" T="bool" @bind-Value=Model.IsPublic></MudCheckBox>*@
|
||||
</MudItem>
|
||||
|
||||
<MudItem>
|
||||
<MudCheckBox Label="Publicly Visible" T="bool"></MudCheckBox>
|
||||
@*<MudCheckBox Label="Publicly Visible" T="bool" @bind-Value=Model.IsPublic></MudCheckBox>*@
|
||||
</MudItem>
|
||||
|
||||
@if (FormButtonsEnabled)
|
||||
{
|
||||
<MudItem Class="pr-0">
|
||||
<MudButton Color="Color.Primary" Variant="Variant.Filled" Class="ml-4" OnClick="CancelClicked">Cancel</MudButton>
|
||||
</MudItem>
|
||||
<MudButton Color="Color.Primary" Variant="Variant.Filled" Class="ml-4" OnClick="CancelClicked">Cancel</MudButton>
|
||||
</MudItem>
|
||||
|
||||
<MudItem Class="pl-2">
|
||||
<MudButton Color="Color.Primary" Variant="Variant.Filled" Class="ml-4" OnClick="PublishClicked" Disabled="@(!IsValid)" >Publish</MudButton>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
<MudItem Class="pl-2">
|
||||
<MudButton Color="Color.Primary" Variant="Variant.Filled" Class="ml-4" OnClick="PublishClicked" Disabled="@(!IsValid)" >Publish</MudButton>
|
||||
</MudItem>
|
||||
}
|
||||
</MudGrid>
|
||||
|
||||
|
||||
@code {
|
||||
@@ -144,6 +148,13 @@
|
||||
[Parameter]
|
||||
public ArtifactGroupingValidationModel Model { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Determines if the cancel and publish buttons should be show to the user or if the containing component will
|
||||
/// handle their functionality (ie if used in a dialog and you want to use the dialog buttons instead of this component's handlers)
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public bool FormButtonsEnabled { get; set; } = true;
|
||||
|
||||
private UploadDropBox _uploadComponent = default!;
|
||||
|
||||
private IdentifierTextBox _identifierTextBox = default!;
|
||||
@@ -166,6 +177,10 @@
|
||||
|
||||
public List<ValidationResult> ValidationResults { get; private set; } = [];
|
||||
|
||||
// Used to store the files that have already been uploaded if this component is being displayed
|
||||
// with a filled in model. Used to populate the upload drop box
|
||||
private List<FilePathListing> ExistingFiles { get; set; } = new();
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
// Ensure to reload the component if a model has been supplied so that the full
|
||||
@@ -174,7 +189,21 @@
|
||||
{
|
||||
await OnCategoryChanged();
|
||||
}
|
||||
_isFormDivVisible = true;
|
||||
|
||||
if (Model is not null && Model.Category is not null)
|
||||
{
|
||||
// The data entry should only be shown if a category has been selected
|
||||
_isFormDivVisible = true;
|
||||
}
|
||||
|
||||
if (Model is not null)
|
||||
{
|
||||
ExistingFiles = Model.ArtifactEntries
|
||||
.Where(e => e.Files.Any())
|
||||
.Select(e => e.Files[0])
|
||||
.ToList();
|
||||
}
|
||||
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
</TitleContent>
|
||||
|
||||
<DialogContent>
|
||||
<AddArchiveGroupingComponent Model="Model"></AddArchiveGroupingComponent>
|
||||
<AddArchiveGroupingComponent
|
||||
Model="Model"
|
||||
FormButtonsEnabled=false></AddArchiveGroupingComponent>
|
||||
</DialogContent>
|
||||
|
||||
<DialogActions>
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
<Columns>
|
||||
<SelectColumn T="ArtifactGroupingRowElement"/>
|
||||
|
||||
|
||||
<PropertyColumn
|
||||
Title="Id"
|
||||
@@ -112,8 +111,11 @@
|
||||
|
||||
var result = await dialog.Result;
|
||||
|
||||
if (!result.Canceled)
|
||||
if (result is not null && !result.Canceled)
|
||||
{
|
||||
var validationModel = (ArtifactGroupingValidationModel)result.Data!;
|
||||
await GroupingProvider.UpdateGroupingAsync(validationModel.ToArtifactGrouping());
|
||||
|
||||
await DataGrid.ReloadServerData();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using OpenArchival.DataAccess;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenArchival.Blazor;
|
||||
|
||||
public class ArtifactGroupingValidationModel : IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Used by update code to track the database record that corresponds to the data within this DTO
|
||||
/// </summary>
|
||||
public int? Id { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "A grouping title is required.")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
@@ -37,6 +41,7 @@ public class ArtifactGroupingValidationModel : IValidatableObject
|
||||
|
||||
var grouping = new ArtifactGrouping()
|
||||
{
|
||||
Id = Id ?? default,
|
||||
Title = Title,
|
||||
Description = Description,
|
||||
Category = Category,
|
||||
@@ -101,6 +106,7 @@ public class ArtifactGroupingValidationModel : IValidatableObject
|
||||
}
|
||||
return new ArtifactGroupingValidationModel()
|
||||
{
|
||||
Id = grouping.Id,
|
||||
Title = grouping.Title,
|
||||
ArtifactEntries = entries,
|
||||
Category = grouping.Category,
|
||||
|
||||
Reference in New Issue
Block a user