bbovenzi commented on code in PR #64185:
URL: https://github.com/apache/airflow/pull/64185#discussion_r3017715534
##########
airflow-core/src/airflow/ui/src/pages/TaskInstance/Logs/TaskLogHeader.tsx:
##########
@@ -123,15 +125,24 @@ export const TaskLogHeader = ({
if (((val === undefined || val === "all") && rest.length === 0) ||
rest.includes("all")) {
searchParams.delete(SearchParamsKeys.SOURCE);
+ searchParams.append(SearchParamsKeys.SOURCE, "all");
} else {
searchParams.delete(SearchParamsKeys.SOURCE);
value
- .filter((state) => state !== "all")
- .map((state) => searchParams.append(SearchParamsKeys.SOURCE, state));
+ .filter((state: string) => state !== "all")
+ .forEach((state: string) =>
searchParams.append(SearchParamsKeys.SOURCE, state));
}
setSearchParams(searchParams);
};
+ const defaultLogSource = useConfig("default_ui_log_source") as string |
undefined;
+ const sourcesToSelect =
+ sources.length > 0
+ ? sources
+ : defaultLogSource !== undefined && defaultLogSource !== "" &&
defaultLogSource !== "All Sources"
+ ? [defaultLogSource]
Review Comment:
+1 Log source is an ope-ended string. We can't actually guarantee it will
match anything
##########
airflow-core/src/airflow/ui/src/pages/TaskInstance/Logs/TaskLogHeader.tsx:
##########
@@ -123,15 +125,24 @@ export const TaskLogHeader = ({
if (((val === undefined || val === "all") && rest.length === 0) ||
rest.includes("all")) {
searchParams.delete(SearchParamsKeys.SOURCE);
+ searchParams.append(SearchParamsKeys.SOURCE, "all");
} else {
searchParams.delete(SearchParamsKeys.SOURCE);
value
- .filter((state) => state !== "all")
- .map((state) => searchParams.append(SearchParamsKeys.SOURCE, state));
+ .filter((state: string) => state !== "all")
+ .forEach((state: string) =>
searchParams.append(SearchParamsKeys.SOURCE, state));
}
setSearchParams(searchParams);
};
+ const defaultLogSource = useConfig("default_ui_log_source") as string |
undefined;
+ const sourcesToSelect =
+ sources.length > 0
+ ? sources
+ : defaultLogSource !== undefined && defaultLogSource !== "" &&
defaultLogSource !== "All Sources"
+ ? [defaultLogSource]
Review Comment:
+1 Log source is an open-ended string. We can't actually guarantee it will
match anything
--
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]