From d8c8ebdc489423413d7e0cd3200c8e41260b34e0 Mon Sep 17 00:00:00 2001 From: ewandor Date: Mon, 6 Mar 2023 16:49:32 +0100 Subject: [PATCH] broadening hidden field usage --- front/app/src/common/crud/crud-formly-jsonschema.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/front/app/src/common/crud/crud-formly-jsonschema.service.ts b/front/app/src/common/crud/crud-formly-jsonschema.service.ts index 5ef8bec9..6b575dae 100644 --- a/front/app/src/common/crud/crud-formly-jsonschema.service.ts +++ b/front/app/src/common/crud/crud-formly-jsonschema.service.ts @@ -43,7 +43,10 @@ export class CrudFormlyJsonschemaOptions implements FormlyJsonschemaOptions { field.type = "datetime"; } else if (schema.format === 'date') { field.type = "date"; - } else if (schema.hasOwnProperty('enum') && schema.enum.length == 1 && schema.enum[0] == schema.default ) { + } else if ( + (schema.hasOwnProperty('hidden') && schema.hidden) + || (schema.hasOwnProperty('enum') && schema.enum.length == 1 && schema.enum[0] == schema.default) + ) { field.type = "hidden"; } else if (schema.type == "array" && schema.format == "dictionary") { field.type = "dictionary";