pierrejeambrun commented on code in PR #58921:
URL: https://github.com/apache/airflow/pull/58921#discussion_r2581912540


##########
airflow-core/src/airflow/ui/src/pages/XCom/XCom.tsx:
##########
@@ -125,6 +161,13 @@ export const XCom = () => {
   const { pagination } = tableURLState;
   const [searchParams] = useSearchParams();
   const { onClose, onOpen, open } = useDisclosure();
+  const queryClient = useQueryClient();
+
+  const { onClose: onCloseAdd, onOpen: onOpenAdd, open: openAdd } = 
useDisclosure();
+  const { onClose: onCloseEdit, onOpen: onOpenEdit, open: openEdit } = 
useDisclosure();
+  const { onClose: onCloseDelete, onOpen: onOpenDelete, open: openDelete } = 
useDisclosure();

Review Comment:
   Similarly to other connection files mentioned above, we should probably 
encapsulate the button as well as the modal into a single component. This will 
avoid having many duplication like this here.
   
   You can. take example on `EditConnectionButton``AddConnectionButton`.



##########
airflow-core/src/airflow/ui/src/pages/XCom/AddXComModal.tsx:
##########


Review Comment:
   There are a lot of code in common between the Add and Edit modal. Similarly 
to the Connections and Pools, we should probably merge those two file into a 
single modal with `isEditMode` true/false



##########
airflow-core/src/airflow/ui/src/pages/XCom/XCom.tsx:
##########
@@ -125,6 +161,13 @@ export const XCom = () => {
   const { pagination } = tableURLState;
   const [searchParams] = useSearchParams();
   const { onClose, onOpen, open } = useDisclosure();
+  const queryClient = useQueryClient();
+
+  const { onClose: onCloseAdd, onOpen: onOpenAdd, open: openAdd } = 
useDisclosure();
+  const { onClose: onCloseEdit, onOpen: onOpenEdit, open: openEdit } = 
useDisclosure();
+  const { onClose: onCloseDelete, onOpen: onOpenDelete, open: openDelete } = 
useDisclosure();
+
+  const [selectedXCom, setSelectedXCom] = useState<XComResponse | 
undefined>(undefined);

Review Comment:
   This state will not be necessary anymore.



-- 
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]

Reply via email to