broadening hidden field usage

This commit is contained in:
2023-03-06 16:49:32 +01:00
parent ac34dd1663
commit d8c8ebdc48

View File

@@ -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";