How to test for specific Group Layouts?

Hi,

I want to use a specific Group Layout, but only if a specific property was set on the uislchema for the Group Layout.

For Controls I have done this with succes, using the schemaMatches helper like so:

...
and(
    isNumberControl,
    schemaMatches((schema) => schema.hasOwnProperty('acl')),
  ),
...

I would expect this for Group Layouts to be the same, but it isn’t…

...
and(
    isGroup,
    schemaMatches((schema) => schema.hasOwnProperty('acl')),
  ),
...

to be able to match for customer renderers by adding an ‘acl’ prop, like so:

...
{
    "type": "Group",
    "acl": "private",
    "elements": [ ... ]
}
...

Hi @Sewdn,

This is definitely possible. However schemaMatches is the wrong util. It will return the JSON Schema which is referred by a scoped UI Schema element.

The UI Schema is handed over directly so you can just check it, e.g.

and(
    isGroup,
    uischema => uischema.hasOwnProperty('acl'),
  ),
1 Like