File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
components/ConditionalAccess Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,8 @@ export const mockConditionRules = [
91
91
properties : {
92
92
kinds : {
93
93
type : 'array' ,
94
- items : { type : 'string' } ,
94
+ items : { type : 'string' } , // TODO: should be enum?
95
+ minItems : 1 ,
95
96
description : 'List of kinds to match at least one of' ,
96
97
} ,
97
98
} ,
@@ -110,6 +111,7 @@ export const mockConditionRules = [
110
111
claims : {
111
112
type : 'array' ,
112
113
items : { type : 'string' } ,
114
+ minItems : 1 ,
113
115
description :
114
116
'List of claims to match at least one on within ownedBy' ,
115
117
} ,
Original file line number Diff line number Diff line change @@ -123,14 +123,14 @@ export const ConditionsFormRowFields = ({
123
123
{ schema ? (
124
124
< Form
125
125
schema = { paramsSchema }
126
- formData = { oldCondition ?. params ?? null }
126
+ formData = { oldCondition ?. params || { } }
127
127
validator = { validator }
128
128
uiSchema = { uiSchema }
129
129
fields = { customFields }
130
130
onChange = { data =>
131
131
handleConditionChange ( {
132
132
...oldCondition ,
133
- params : data . formData ?? { } ,
133
+ params : data . formData || { } ,
134
134
} )
135
135
}
136
136
transformErrors = { errors => {
Original file line number Diff line number Diff line change @@ -35,8 +35,9 @@ export const CustomArrayField = (props: FieldProps) => {
35
35
label = { name }
36
36
value = { fieldVal }
37
37
onChange = { e => {
38
- setFieldVal ( e . target . value ) ;
39
- onChange ( e . target . value . split ( ',' ) . map ( val => val . trim ( ) ) ) ;
38
+ const value = e . target . value ;
39
+ setFieldVal ( value ) ;
40
+ onChange ( value ? value . split ( ',' ) . map ( val => val . trim ( ) ) : [ ] ) ;
40
41
} }
41
42
className = { classes . bgPaper }
42
43
required = { required }
You can’t perform that action at this time.
0 commit comments