guan404ming commented on code in PR #53035:
URL: https://github.com/apache/airflow/pull/53035#discussion_r2240459289
##########
airflow-core/src/airflow/ui/src/components/FlexibleForm/FlexibleForm.tsx:
##########
@@ -93,55 +103,83 @@ export const FlexibleForm = ({
}
};
- return Object.entries(params).some(([, param]) => typeof
param.schema.section !== "string")
- ? Object.entries(params).map(([, secParam]) => {
- const currentSection = secParam.schema.section ??
flexibleFormDefaultSection;
-
- if (processedSections.has(currentSection)) {
- return undefined;
- } else {
- processedSections.set(currentSection, true);
-
- return (
- <Accordion.Item
- // We need to make the item content overflow visible for
dropdowns to work, but directly applying the style does not work
- css={{
- "& > :nth-child(2)": {
- overflow: "visible",
- },
- }}
- key={currentSection}
- value={currentSection}
- >
- <Accordion.ItemTrigger cursor="button">
- <Text color={sectionError.get(currentSection) ? "fg.error" :
undefined}>
- {currentSection}
- </Text>
- {sectionError.get(currentSection) ? (
- <Icon color="fg.error" margin="-1">
- <MdError />
- </Icon>
- ) : undefined}
- </Accordion.ItemTrigger>
-
- <Accordion.ItemContent pt={0}>
- <Accordion.ItemBody>
- <Stack separator={<StackSeparator />}>
- {Object.entries(params)
- .filter(
- ([, param]) =>
- param.schema.section === currentSection ||
- (currentSection === flexibleFormDefaultSection &&
!Boolean(param.schema.section)),
- )
- .map(([name]) => (
- <Row key={name} name={name} onUpdate={onUpdate} />
- ))}
- </Stack>
- </Accordion.ItemBody>
- </Accordion.ItemContent>
- </Accordion.Item>
- );
- }
- })
- : undefined;
+ return Object.entries(params).some(([, param]) => typeof
param.schema.section !== "string") ? (
+ Object.entries(params).map(([, secParam]) => {
+ const currentSection = secParam.schema.section ??
flexibleFormDefaultSection;
+
+ if (processedSections.has(currentSection)) {
+ return undefined;
+ } else {
+ processedSections.set(currentSection, true);
+
+ return (
+ <Accordion.Item
+ // We need to make the item content overflow visible for dropdowns
to work, but directly applying the style does not work
+ css={{
+ "& > :nth-child(2)": {
+ overflow: "visible",
+ },
+ }}
+ key={currentSection}
+ value={currentSection}
+ >
+ <Accordion.ItemTrigger cursor="button">
+ <Text color={sectionError.get(currentSection) ? "fg.error" :
undefined}>{currentSection}</Text>
+ {sectionError.get(currentSection) ? (
+ <Icon color="fg.error" margin="-1">
+ <MdError />
+ </Icon>
+ ) : undefined}
+ </Accordion.ItemTrigger>
+
+ <Accordion.ItemContent pt={0}>
+ <Accordion.ItemBody>
+ <Stack separator={<StackSeparator py={2} />}>
+ {Boolean(flexFormDescription) ? <Text
mb={2}>{flexFormDescription}</Text> : undefined}
+ {Object.entries(params)
+ .filter(
+ ([, param]) =>
+ param.schema.section === currentSection ||
+ (currentSection === flexibleFormDefaultSection &&
!Boolean(param.schema.section)),
+ )
+ .map(([name]) => (
+ <Row key={name} name={name} onUpdate={onUpdate} />
+ ))}
+ </Stack>
+ </Accordion.ItemBody>
+ </Accordion.ItemContent>
+ </Accordion.Item>
+ );
+ }
+ })
+ ) : isHITL ? (
+ <Accordion.Item
+ css={{
+ "& > :nth-child(2)": {
+ overflow: "visible",
+ },
Review Comment:
I found we could remove this section in this scenario without breaking
layout.
--
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]