From 009e0060bc07fcf16058efb66a7840676ec597fb Mon Sep 17 00:00:00 2001 From: Henri Nieminen <118905702+henrinie-nc@users.noreply.github.com> Date: Thu, 29 Aug 2024 11:26:12 +0300 Subject: [PATCH] fix intended use issue for readonly perms (#516) * fix intended use issue for readonly perms tried to render an object which is not possible as text. * add textarea to be viewable as readonly in edit mode field `note` was not showing up in edit mode for users that only had readonly perms for it --- src/components/form/FormField.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/form/FormField.tsx b/src/components/form/FormField.tsx index 03fec029..570b11b4 100644 --- a/src/components/form/FormField.tsx +++ b/src/components/form/FormField.tsx @@ -171,9 +171,12 @@ const FormFieldInput = ({ case FieldTypeOptions.STRING: case FieldTypeOptions.HIDDEN: case FieldTypeOptions.FRACTIONAL: - case FieldTypeOptions.INTENDED_USE: + case FieldTypeOptions.TEXTAREA: return value; + case FieldTypeOptions.INTENDED_USE: + return value?.name ?? '-'; + case FieldTypeOptions.REFERENCE_NUMBER: return value ? : null;