Got the sliders extracted to their own page
This commit is contained in:
@@ -59,7 +59,8 @@
|
||||
T="string"
|
||||
For="@(() => Model.Title)"
|
||||
Placeholder="Grouping Title"
|
||||
@bind-Value=Model.Title></MudTextField>
|
||||
@bind-Value=Model.Title
|
||||
@bind-Value:after="OnChanged"></MudTextField>
|
||||
|
||||
<MudText Typo="Typo.h6" Color="Color.Primary" Class="pt-4 pb-0">Grouping Description</MudText>
|
||||
<MudDivider DividerType="DividerType.Middle"></MudDivider>
|
||||
@@ -68,7 +69,8 @@
|
||||
For="@(() => Model.Description)"
|
||||
Lines="5"
|
||||
Placeholder="Grouping Description"
|
||||
@bind-Value=Model.Description></MudTextField>
|
||||
@bind-Value=Model.Description
|
||||
@bind-Value:after="OnChanged"></MudTextField>
|
||||
|
||||
<MudText Typo="Typo.h6" Color="Color.Primary" Class="pt-4 pb-0">Grouping Type</MudText>
|
||||
<MudDivider DividerType="DividerType.Middle"></MudDivider>
|
||||
@@ -78,6 +80,7 @@
|
||||
Label="Artifact Type"
|
||||
Class="pt-0 mt-0 pl-2 pr-2"
|
||||
@bind-Value=Model.Type
|
||||
@bind-Value:after="OnChanged"
|
||||
SearchFunc="Helpers.SearchItemTypes"
|
||||
CoerceValue=true></MudAutocomplete>
|
||||
</MudPaper>
|
||||
@@ -184,7 +187,7 @@
|
||||
// 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
|
||||
@@ -222,7 +225,7 @@
|
||||
var validationContext = new ValidationContext(Model);
|
||||
var validationResult = new List<ValidationResult>();
|
||||
|
||||
IsValid = Validator.TryValidateObject(Model, validationContext, validationResult);
|
||||
IsValid = Validator.TryValidateObject(Model, validationContext, validationResult, validateAllProperties:true);
|
||||
ArtifactGroupingValidationModel oldModel = Model;
|
||||
if (ForwardLink is not null)
|
||||
{
|
||||
@@ -234,11 +237,11 @@
|
||||
|
||||
if (IsValid && ClearOnPublish)
|
||||
{
|
||||
Model = new();
|
||||
Model = new();
|
||||
await _uploadComponent.ClearClicked.InvokeAsync();
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
ValidationResults = new List<ValidationResult>();
|
||||
await GroupingPublished.InvokeAsync(oldModel);
|
||||
}
|
||||
|
||||
@@ -294,18 +297,27 @@
|
||||
StateHasChanged();
|
||||
await OnChanged();
|
||||
}
|
||||
|
||||
/*
|
||||
async Task OnChanged()
|
||||
{
|
||||
var validationContext = new ValidationContext(Model);
|
||||
var validationResult = new List<ValidationResult>();
|
||||
|
||||
IsValid = Validator.TryValidateObject(Model, validationContext, validationResult);
|
||||
IsValid = Validator.TryValidateObject(Model, validationContext, validationResult, validateAllProperties: true);
|
||||
|
||||
if (IsValid)
|
||||
{
|
||||
StateHasChanged();
|
||||
StateHasChanged();
|
||||
}
|
||||
*/
|
||||
|
||||
async Task OnChanged()
|
||||
{
|
||||
var validationResults = new List<ValidationResult>();
|
||||
var validationContext = new ValidationContext(Model);
|
||||
|
||||
IsValid = Validator.TryValidateObject(Model, validationContext, validationResults, validateAllProperties: true);
|
||||
ValidationResults = validationResults;
|
||||
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
async Task OnCategoryChanged()
|
||||
|
||||
Reference in New Issue
Block a user