pierrejeambrun commented on code in PR #56920:
URL: https://github.com/apache/airflow/pull/56920#discussion_r2466426461
##########
airflow-core/src/airflow/ui/src/constants/filterConfigs.tsx:
##########
@@ -150,6 +153,30 @@ export const useFilterConfigs = () => {
min: -1,
type: FilterTypes.NUMBER,
},
+ [SearchParamsKeys.NAME_PATTERN]: {
+ hotkeyDisabled: true,
+ icon: <TaskIcon />,
+ label: translate("common:taskId"),
+ type: FilterTypes.TEXT,
+ },
+ [SearchParamsKeys.OPERATOR]: {
+ hotkeyDisabled: true,
+ icon: <MdBuild />,
+ label: translate("common:taskInstance.operator"),
+ type: FilterTypes.TEXT,
+ },
+ [SearchParamsKeys.POOL]: {
+ hotkeyDisabled: true,
+ icon: <BiTargetLock />,
+ label: translate("common:taskInstance.pool"),
+ type: FilterTypes.TEXT,
+ },
Review Comment:
This is not 'search' but a 'filter'. We should probably query 'pools' and
populate a dropdown menu with available pool values. Or something similar.
Otherwise add a backend `pool_name_pattern` search filter.
For the same reasons mentioned above.
##########
airflow-core/src/airflow/ui/src/constants/filterConfigs.tsx:
##########
@@ -247,6 +274,20 @@ export const useFilterConfigs = () => {
label: translate("common:taskId"),
type: FilterTypes.TEXT,
},
+ [SearchParamsKeys.TASK_STATE]: {
+ icon: <MdCheckCircle />,
+ label: translate("common:state"),
+ options: taskInstanceStateOptions.items.map((option) => ({
+ label:
+ option.value === "all" ? (
+ translate(option.label)
+ ) : (
+ <StateBadge state={option.value as TaskInstanceState
}>{translate(option.label)}</StateBadge>
+ ),
+ value: option.value,
+ })),
+ type: FilterTypes.SELECT,
Review Comment:
Clicking on 'all' state filter yield an error, this should 'reset' the
filter, no query with `state=all`
<img width="1278" height="607" alt="Image"
src="https://github.com/user-attachments/assets/b66939b6-6582-4e60-a075-b51cf9ead304"
/>
##########
airflow-core/src/airflow/ui/src/constants/filterConfigs.tsx:
##########
@@ -150,6 +153,30 @@ export const useFilterConfigs = () => {
min: -1,
type: FilterTypes.NUMBER,
},
+ [SearchParamsKeys.NAME_PATTERN]: {
+ hotkeyDisabled: true,
+ icon: <TaskIcon />,
+ label: translate("common:taskId"),
+ type: FilterTypes.TEXT,
+ },
+ [SearchParamsKeys.OPERATOR]: {
+ hotkeyDisabled: true,
+ icon: <MdBuild />,
+ label: translate("common:taskInstance.operator"),
+ type: FilterTypes.TEXT,
+ },
+ [SearchParamsKeys.POOL]: {
+ hotkeyDisabled: true,
+ icon: <BiTargetLock />,
+ label: translate("common:taskInstance.pool"),
+ type: FilterTypes.TEXT,
+ },
+ [SearchParamsKeys.QUEUE]: {
+ hotkeyDisabled: true,
+ icon: <PiQueue />,
+ label: translate("common:taskInstance.queue"),
+ type: FilterTypes.TEXT,
+ },
Review Comment:
same, we display a 'search' bar for a 'filter' that is not a search.
##########
airflow-core/src/airflow/ui/src/pages/TaskInstances/TaskInstances.tsx:
##########
@@ -210,6 +219,19 @@ const taskInstanceColumns = ({
},
];
+// filter for operator_name, since the frontend show operator_name, instead of
operator for user
+const filterTaskInstances = ({
+ instances,
+ operatorNames,
+}: {
+ instances: Array<TaskInstanceResponse>;
+ operatorNames: Array<string>;
+}) =>
+ instances.filter(
+ (instance) =>
+ (operatorNames.length === 0 ||
operatorNames.includes(instance.operator_name as string))
+ );
+
Review Comment:
This is not working and breaking pagination. We should use the backend
filter instead similarly to other filters.
Also this makes me realise that this should probably be a 'search' instead.
Typing in an operator name to have 0 result returned until we fully typed the
name is not a great UX.
<img width="1302" height="814" alt="Image"
src="https://github.com/user-attachments/assets/b57f7243-8f40-4da7-8ec9-799694a97cf6"
/>
--
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]