guan404ming commented on code in PR #54640:
URL: https://github.com/apache/airflow/pull/54640#discussion_r2298480834


##########
airflow-core/src/airflow/ui/src/components/Assets/AssetEvents.tsx:
##########
@@ -64,6 +69,64 @@ export const AssetEvents = ({
       { label: translate("sortBy.oldestFirst"), value: "timestamp" },
     ],
   });
+  const runTypes = ["", "asset_triggered", "backfill", "manual", "scheduled"];
+  const runTypeOptions = createListCollection({
+    items: runTypes.map((type) => ({
+      label: type === "" ? "\u00A0" : translate(`common:runTypes.${type}`),
+      value: type,
+    })),
+  });
+  const [searchParams, setSearchParams] = useSearchParams();
+  const { DAG_ID_PATTERN, END_DATE, RUN_TYPE, START_DATE, TASK_ID_PATTERN } = 
SearchParamsKeys;
+  const startDate = searchParams.get(START_DATE) ?? "";
+  const endDate = searchParams.get(END_DATE) ?? "";
+  const dagIdPattern = searchParams.get(DAG_ID_PATTERN) ?? "";
+  const taskIdPattern = searchParams.get(TASK_ID_PATTERN) ?? "";
+  const runType = searchParams.get(RUN_TYPE) ?? "";
+
+  const handleFilterChange = useCallback(
+    (paramKey: string) => (value: string) => {
+      if (value === "") {
+        searchParams.delete(paramKey);
+      } else {
+        searchParams.set(paramKey, value);
+      }
+      setSearchParams(searchParams);
+    },
+    [searchParams, setSearchParams],
+  );
+  const filteredData = useMemo(() => {

Review Comment:
   Maybe we could move this to `utils` folder to make it more clear



##########
airflow-core/src/airflow/ui/src/components/Assets/AssetEvents.tsx:
##########
@@ -64,6 +69,64 @@ export const AssetEvents = ({
       { label: translate("sortBy.oldestFirst"), value: "timestamp" },
     ],
   });
+  const runTypes = ["", "asset_triggered", "backfill", "manual", "scheduled"];

Review Comment:
   I think make it not a empty string would be more intuitive for users



##########
airflow-core/src/airflow/ui/src/components/Assets/AssetEvents.tsx:
##########
@@ -64,6 +69,64 @@ export const AssetEvents = ({
       { label: translate("sortBy.oldestFirst"), value: "timestamp" },
     ],
   });
+  const runTypes = ["", "asset_triggered", "backfill", "manual", "scheduled"];
+  const runTypeOptions = createListCollection({
+    items: runTypes.map((type) => ({
+      label: type === "" ? "\u00A0" : translate(`common:runTypes.${type}`),

Review Comment:
   Not sure if we should use `\u00A0` or not, is there any special reason for 
using this?



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