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


##########
airflow-core/src/airflow/ui/src/components/Clear/TaskInstance/ClearTaskInstanceDialog.tsx:
##########
@@ -34,20 +34,53 @@ import { isStatePending, useAutoRefresh } from "src/utils";
 
 import ClearTaskInstanceConfirmationDialog from 
"./ClearTaskInstanceConfirmationDialog";
 
-type Props = {
+type CommonProps = {
+  readonly allMapped?: boolean;
   readonly onClose: () => void;
   readonly open: boolean;
-  readonly taskInstance: TaskInstanceResponse;
 };
 
-const ClearTaskInstanceDialog = ({ onClose: onCloseDialog, open: openDialog, 
taskInstance }: Props) => {
-  const taskId = taskInstance.task_id;
-  const mapIndex = taskInstance.map_index;
+type Props = (
+  | {
+      readonly dagId: string;
+      readonly dagRunId: string;
+      readonly mapIndex?: number;
+      readonly taskId: string;
+      readonly taskInstance?: never; // Ensure taskInstance is not present
+    }
+  | {
+      readonly dagId?: never; // Ensure individual props are not present
+      readonly dagRunId?: never;
+      readonly mapIndex?: never;
+      readonly taskId?: never;
+      readonly taskInstance: TaskInstanceResponse;
+    }
+) &
+  CommonProps;
+
+const ClearTaskInstanceDialog = ({
+  allMapped = false,
+  onClose: onCloseDialog,
+  open: openDialog,
+  ...rest

Review Comment:
   Don't collect everything from `...rest`, explicitely write the props



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