Skip to content

Commit

Permalink
fix: remove unsupported operators in angular material object renderer
Browse files Browse the repository at this point in the history
The Angular Material object renderer sometimes also takes over the responsibility to render
'oneOf', 'anyOf' and 'allOf' because we don't support these constructs in Angular Material yet.
However this then leads to errors. Therefore we no longer consider these combinators
during rendering.

closes #2083
  • Loading branch information
LukasBoll authored Aug 7, 2023
1 parent e80a873 commit d8d261e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/angular-material/src/other/object.renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ import {
import {
ControlWithDetailProps,
findUISchema,
Generate,
GroupLayout,
isObjectControl,
RankedTester,
rankWith,
setReadonly,
UISchemaElement,
} from '@jsonforms/core';
import { cloneDeep } from 'lodash';

@Component({
selector: 'ObjectRenderer',
Expand All @@ -65,7 +67,14 @@ export class ObjectControlRenderer extends JsonFormsControlWithDetail {
props.schema,
props.uischema.scope,
props.path,
'Group',
() => {
const newSchema = cloneDeep(props.schema);
// delete unsupported operators
delete newSchema.oneOf;
delete newSchema.anyOf;
delete newSchema.allOf;
return Generate.uiSchema(newSchema, 'Group');
},
props.uischema,
props.rootSchema
);
Expand Down

0 comments on commit d8d261e

Please sign in to comment.