Propagate the ModelState errors on dynamic forms

This commit is contained in:
nicolas.dorier
2022-11-25 18:14:33 +09:00
parent 5ff1a59a99
commit 31b25ca169
19 changed files with 206 additions and 155 deletions

View File

@@ -1,12 +1,23 @@
using System.Linq;
using System.Collections.Generic;
using System.Linq;
using BTCPayServer.Abstractions.Form;
namespace BTCPayServer.Forms;
public class HtmlFieldsetFormProvider: IFormComponentProvider
{
public string CanHandle(Field field)
public string View => "Forms/FieldSetElement";
public void Register(Dictionary<string, IFormComponentProvider> typeToComponentProvider)
{
return new[] { "fieldset"}.Contains(field.Type) ? "Forms/FieldSetElement" : null;
typeToComponentProvider.Add("fieldset", this);
}
}
public void Validate(Field field)
{
}
public void Validate(Form form, Field field)
{
}
}