( uischema: UISchemaElement, data: any, path: string = undefined, ajv: Ajv, config: unknown )
| 159 | }; |
| 160 | |
| 161 | export const evalReadonly = ( |
| 162 | uischema: UISchemaElement, |
| 163 | data: any, |
| 164 | path: string = undefined, |
| 165 | ajv: Ajv, |
| 166 | config: unknown |
| 167 | ): boolean => { |
| 168 | const fulfilled = isRuleFulfilled(uischema, data, path, ajv, config); |
| 169 | |
| 170 | switch (uischema.rule.effect) { |
| 171 | case RuleEffect.WRITABLE: |
| 172 | return !fulfilled; |
| 173 | case RuleEffect.READONLY: |
| 174 | return fulfilled; |
| 175 | // writable by default |
| 176 | default: |
| 177 | return false; |
| 178 | } |
| 179 | }; |
| 180 | |
| 181 | export const hasShowRule = (uischema: UISchemaElement): boolean => { |
| 182 | if ( |
no test coverage detected
searching dependent graphs…