From acd0c803167e03f649e4f56ccdfdfac4b6f65cb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mose=20M=C3=BCller?= Date: Tue, 27 Feb 2024 12:58:28 +0100 Subject: [PATCH] updated use of method components --- frontend/src/components/DeviceConnection.tsx | 2 +- frontend/src/components/GenericComponent.tsx | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/DeviceConnection.tsx b/frontend/src/components/DeviceConnection.tsx index 5fad9e4..3b8cf81 100644 --- a/frontend/src/components/DeviceConnection.tsx +++ b/frontend/src/components/DeviceConnection.tsx @@ -38,11 +38,11 @@ export const DeviceConnectionComponent = React.memo( )} diff --git a/frontend/src/components/GenericComponent.tsx b/frontend/src/components/GenericComponent.tsx index 91ae477..f477fca 100644 --- a/frontend/src/components/GenericComponent.tsx +++ b/frontend/src/components/GenericComponent.tsx @@ -37,8 +37,8 @@ export type SerializedValue = { value?: ValueType | ValueType[]; readonly: boolean; doc?: string | null; - parameters?: Record; async?: boolean; + frontend_render?: boolean; enum?: Record; }; type GenericComponentProps = { @@ -147,6 +147,7 @@ export const GenericComponent = React.memo( parentPath={parentPath} docString={attribute.doc} value={String(attribute.value)} + readOnly={attribute.readonly} enumDict={attribute.enum} addNotification={addNotification} changeCallback={changeCallback} @@ -161,10 +162,10 @@ export const GenericComponent = React.memo( name={name} parentPath={parentPath} docString={attribute.doc} - parameters={attribute.parameters} addNotification={addNotification} displayName={displayName} id={id} + render={attribute.frontend_render} /> ); } else { @@ -173,11 +174,11 @@ export const GenericComponent = React.memo( name={name} parentPath={parentPath} docString={attribute.doc} - parameters={attribute.parameters} value={attribute.value as Record} addNotification={addNotification} displayName={displayName} id={id} + render={attribute.frontend_render} /> ); }