jscheffl commented on code in PR #45790:
URL: https://github.com/apache/airflow/pull/45790#discussion_r1922904051
##########
airflow/ui/src/components/FlexibleForm/FieldStringArray.tsx:
##########
@@ -19,15 +19,32 @@
import { Textarea } from "@chakra-ui/react";
import type { FlexibleFormElementProps } from ".";
+import { paramPlaceholder, useParamStore } from "../TriggerDag/useParamStore";
-export const FieldStringArray = ({ name, param }: FlexibleFormElementProps) =>
(
- <Textarea
- defaultValue={
- Array.isArray(param.value) ? (param.value as Array<string>).join("\n") :
String(param.value ?? "")
+export const FieldStringArray = ({ name }: FlexibleFormElementProps) => {
+ const { paramsDict, setParamsDict } = useParamStore();
+ const param = paramsDict[name] ?? paramPlaceholder;
+ const handleChange = (newValue: string) => {
+ const newValueArray = newValue.split("\n");
+
+ if (paramsDict[name]) {
+ paramsDict[name].value = newValueArray;
Review Comment:
Same like above. In old UI an empty array was returned as `null` here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]