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


##########
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:
   Let make this `filteredData` func in `Assets` folder since it's not reusable 
for other filter. After then, we could remove whole function here. You could 
take at look at this one https://github.com/apache/airflow/pull/54671



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