mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
refactor(app): app service form to react [EE-5415] (#8994)
This commit is contained in:
parent
2d05103fed
commit
69776b4863
26 changed files with 1224 additions and 538 deletions
|
@ -3,7 +3,8 @@ import { SchemaOf } from 'yup';
|
|||
|
||||
export async function validateForm<T>(
|
||||
schemaBuilder: () => SchemaOf<T>,
|
||||
formValues: T
|
||||
formValues: T,
|
||||
validationContext?: object
|
||||
) {
|
||||
const validationSchema = schemaBuilder();
|
||||
|
||||
|
@ -11,6 +12,8 @@ export async function validateForm<T>(
|
|||
await validationSchema.validate(formValues, {
|
||||
strict: true,
|
||||
abortEarly: false,
|
||||
// workaround to access all parents for nested fields. See clusterIpFormValidation for a use case.
|
||||
context: { formValues, validationContext },
|
||||
});
|
||||
return undefined;
|
||||
} catch (error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue