MCPcopy Create free account
hub / github.com/eclipsesource/jsonforms / evalEnablement

Function evalEnablement

packages/core/src/util/runtime.ts:141–159  ·  view source on GitHub ↗
(
  uischema: UISchemaElement,
  data: any,
  path: string = undefined,
  ajv: Ajv,
  config: unknown
)

Source from the content-addressed store, hash-verified

139};
140
141export const evalEnablement = (
142 uischema: UISchemaElement,
143 data: any,
144 path: string = undefined,
145 ajv: Ajv,
146 config: unknown
147): boolean => {
148 const fulfilled = isRuleFulfilled(uischema, data, path, ajv, config);
149
150 switch (uischema.rule.effect) {
151 case RuleEffect.DISABLE:
152 return !fulfilled;
153 case RuleEffect.ENABLE:
154 return fulfilled;
155 // enabled by default
156 default:
157 return true;
158 }
159};
160
161export const evalReadonly = (
162 uischema: UISchemaElement,

Callers 2

runtime.test.tsFile · 0.90
isEnabledFunction · 0.85

Calls 1

isRuleFulfilledFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…