@@ -40,6 +40,7 @@ import { useState } from "react";
40
40
import type { FC } from "react" ;
41
41
import { docs } from "utils/docs" ;
42
42
import { OrganizationPills } from "./OrganizationPills" ;
43
+ import * as Yup from "yup" ;
43
44
44
45
interface IdpSyncPageViewProps {
45
46
organizationSyncSettings : OrganizationSyncSettings | undefined ;
@@ -48,6 +49,14 @@ interface IdpSyncPageViewProps {
48
49
error ?: unknown ;
49
50
}
50
51
52
+ const validationSchema = Yup . object ( {
53
+ field : Yup . string ( ) . trim ( ) ,
54
+ organization_assign_default : Yup . boolean ( ) ,
55
+ mapping : Yup . object ( ) . shape ( {
56
+ [ `${ String } ` ] : Yup . array ( ) . of ( Yup . string ( ) ) ,
57
+ } ) ,
58
+ } ) ;
59
+
51
60
export const IdpOrgSyncPageView : FC < IdpSyncPageViewProps > = ( {
52
61
organizationSyncSettings,
53
62
organizations,
@@ -61,7 +70,7 @@ export const IdpOrgSyncPageView: FC<IdpSyncPageViewProps> = ({
61
70
organizationSyncSettings ?. organization_assign_default ?? true ,
62
71
mapping : organizationSyncSettings ?. mapping ?? { } ,
63
72
} ,
64
- // validationSchema,
73
+ validationSchema : validationSchema ,
65
74
onSubmit,
66
75
enableReinitialize : Boolean ( organizationSyncSettings ) ,
67
76
} ) ;
0 commit comments