From 65fc7de12ccc2ffe9223f9e65cd43eca82092ea0 Mon Sep 17 00:00:00 2001 From: Jeremy Myers Date: Wed, 24 Jan 2024 15:27:54 -0500 Subject: [PATCH 1/2] Change conditional logic for text component rendered; increase TextBox size --- .../src/Service/Decoders/QuestionDecoders.ts | 3 ++- packages/libs/wdk-client/src/Utils/WdkModel.ts | 1 + .../src/Views/Question/Params/StringParam.tsx | 17 +++++++++-------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/libs/wdk-client/src/Service/Decoders/QuestionDecoders.ts b/packages/libs/wdk-client/src/Service/Decoders/QuestionDecoders.ts index 373faaea95..2f224385ab 100644 --- a/packages/libs/wdk-client/src/Service/Decoders/QuestionDecoders.ts +++ b/packages/libs/wdk-client/src/Service/Decoders/QuestionDecoders.ts @@ -95,7 +95,8 @@ const timestampParamDecoder: Decode.Decoder = Decode.combine( const stringParamDecoder: Decode.Decoder = Decode.combine( paramSharedDecoder, Decode.field('type', Decode.constant('string')), - Decode.field('length', Decode.number) + Decode.field('length', Decode.number), + Decode.field('isMultiLine', Decode.boolean) ); /* FilterParamNew */ diff --git a/packages/libs/wdk-client/src/Utils/WdkModel.ts b/packages/libs/wdk-client/src/Utils/WdkModel.ts index 880a55700c..bd0b31d1ed 100644 --- a/packages/libs/wdk-client/src/Utils/WdkModel.ts +++ b/packages/libs/wdk-client/src/Utils/WdkModel.ts @@ -65,6 +65,7 @@ interface ParameterBase extends NamedModelEntity { export interface StringParam extends ParameterBase { type: 'string'; length: number; + isMultiLine: boolean; } export interface TimestampParam extends ParameterBase { diff --git a/packages/libs/wdk-client/src/Views/Question/Params/StringParam.tsx b/packages/libs/wdk-client/src/Views/Question/Params/StringParam.tsx index db68a8e4d6..1a4beb6ab2 100644 --- a/packages/libs/wdk-client/src/Views/Question/Params/StringParam.tsx +++ b/packages/libs/wdk-client/src/Views/Question/Params/StringParam.tsx @@ -25,22 +25,23 @@ function Component(props: Props) { const { parameter, value, onParamValueChange } = props; const cols = DEFAULT_COLS; const rows = calculateRows(parameter, cols); - return parameter.length <= 50 ? ( - ) : ( -