From e373bef4f19daef3a43878c474569a4334abfe10 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Tue, 25 Jun 2024 01:41:03 -0400 Subject: [PATCH] fix lint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - revert to old style with `newParameters` variable - it feels more readable than what `prettier` wants 😅 - my editor was apparently lagging quite heavily in showing this in my previous commit (I only saw it when I re-opened the file), seemed like a stale lint cache or something Signed-off-by: Anton Gilgur --- ui/src/app/shared/components/parameters-input.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/src/app/shared/components/parameters-input.tsx b/ui/src/app/shared/components/parameters-input.tsx index 1440f4e0ad3b..895e68c45255 100644 --- a/ui/src/app/shared/components/parameters-input.tsx +++ b/ui/src/app/shared/components/parameters-input.tsx @@ -12,10 +12,11 @@ interface ParametersInputProps { export function ParametersInput(props: ParametersInputProps) { function onParameterChange(parameter: Parameter, value: string) { - props.onChange(props.parameters.map(p => ({ + const newParameters: Parameter[] = props.parameters.map(p => ({ ...p, - value: p.name === parameter.name ? value : Utils.getValueFromParameter(p), - }))); + value: p.name === parameter.name ? value : Utils.getValueFromParameter(p) + })); + props.onChange(newParameters); } function displaySelectFieldForEnumValues(parameter: Parameter) {