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


##########
airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx:
##########
@@ -203,29 +203,24 @@ export const DagsList = () => {
   const { setTableURLState, tableURLState } = useTableURLState();
 
   const { pagination, sorting } = tableURLState;
-  const [savedSearchPattern, setSavedSearchPattern] = 
useSessionStorage("dags_search_temp", "");
-  const [dagDisplayNamePattern, setDagDisplayNamePattern] = useState(
-    searchParams.get(NAME_PATTERN) ?? savedSearchPattern,
-  );
+  const dagDisplayNamePattern = searchParams.get(NAME_PATTERN) ?? undefined;

Review Comment:
   ```suggestion
     const dagDisplayNamePattern = searchParams.get(NAME_PATTERN) ?? "";
   ```
   
   



##########
airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx:
##########
@@ -277,7 +272,7 @@ export const DagsList = () => {
       <VStack alignItems="none">
         <SearchBar
           buttonProps={{ disabled: true }}
-          defaultValue={dagDisplayNamePattern}
+          defaultValue={dagDisplayNamePattern ?? ""}

Review Comment:
   ```suggestion
             defaultValue={dagDisplayNamePattern}
   ```



##########
airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx:
##########
@@ -246,7 +241,7 @@ export const DagsList = () => {
   }
 
   const { data, error, isLoading } = useDags({
-    dagDisplayNamePattern: Boolean(dagDisplayNamePattern) ? 
dagDisplayNamePattern : undefined,
+    dagDisplayNamePattern: Boolean(dagDisplayNamePattern) ? 
`${dagDisplayNamePattern}` : undefined,

Review Comment:
   ```suggestion
       dagDisplayNamePattern: Boolean(dagDisplayNamePattern) ? 
dagDisplayNamePattern : undefined,
   ```



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