jscheffl commented on code in PR #45215:
URL: https://github.com/apache/airflow/pull/45215#discussion_r1897787307
##########
airflow/ui/src/pages/Run/TaskInstances.tsx:
##########
@@ -101,13 +180,59 @@ export const TaskInstances = () => {
limit: pagination.pageSize,
offset: pagination.pageIndex * pagination.pageSize,
orderBy,
+ state: filteredState === null ? undefined : [filteredState],
+ taskDisplayNamePattern: Boolean(taskDisplayNamePattern)
+ ? taskDisplayNamePattern
+ : undefined,
},
undefined,
{ enabled: !isNaN(pagination.pageSize) },
);
return (
- <Box>
+ <Box pt={4}>
+ <HStack>
+ <Select.Root
+ collection={stateOptions}
+ maxW="250px"
+ onValueChange={handleStateChange}
+ value={[filteredState ?? "all"]}
+ >
+ <Select.Trigger colorPalette="blue"
isActive={Boolean(filteredState)}>
+ <Select.ValueText>
+ {() =>
+ filteredState === null ? (
Review Comment:
Not being a JavaScript pro but do we need to compare with `===` against null?
I would have assumed you just can say `filteredState ? (...`?
##########
airflow/ui/src/pages/Run/TaskInstances.tsx:
##########
@@ -86,12 +105,72 @@ const columns: Array<ColumnDef<TaskInstanceResponse>> = [
},
];
+const stateOptions = createListCollection({
+ items: [
+ { label: "All States", value: "all" },
+ { label: "Scheduled", value: "scheduled" },
+ { label: "Queued", value: "queued" },
+ { label: "Running", value: "running" },
+ { label: "Success", value: "success" },
+ { label: "Restarting", value: "restarting" },
+ { label: "Failed", value: "failed" },
+ { label: "Up For Retry", value: "up_for_retry" },
+ { label: "Up For Reschedule", value: "up_for_reschedule" },
+ { label: "Upstream failed", value: "upstream_failed" },
+ { label: "Skipped", value: "skipped" },
+ { label: "Deferred", value: "deferred" },
+ { label: "Removed", value: "removed" },
+ ],
Review Comment:
This list feels like a redundant definition of... what we have in Python in
the backend. Is there a way to ensure this list is consistent with the backend?
--
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]