jscheffl commented on code in PR #45790:
URL: https://github.com/apache/airflow/pull/45790#discussion_r1922901529
##########
airflow/ui/src/components/FlexibleForm/FieldDropdown.tsx:
##########
@@ -32,24 +33,37 @@ const labelLookup = (key: string, valuesDisplay:
Record<string, string> | undefi
};
const enumTypes = ["string", "number", "integer"];
-export const FieldDropdown = ({ name, param }: FlexibleFormElementProps) => {
+export const FieldDropdown = ({ name }: FlexibleFormElementProps) => {
+ const { paramsDict, setParamsDict } = useParamStore();
+ const param = paramsDict[name] ?? paramPlaceholder;
+
const selectOptions = createListCollection({
items:
param.schema.enum?.map((value) => ({
label: labelLookup(value, param.schema.values_display),
value,
})) ?? [],
});
+
const contentRef = useRef<HTMLDivElement>(null);
+ const handleChange = (value: Array<string>) => {
+ if (paramsDict[name]) {
+ paramsDict[name].value = value;
Review Comment:
In the case of dropdown we know it will be a single value only. Need to pick
first element from list?
```suggestion
paramsDict[name].value = value[0];
```
--
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]