vatsrahul1001 commented on code in PR #54210:
URL: https://github.com/apache/airflow/pull/54210#discussion_r2272140646
##########
airflow-core/src/airflow/ui/src/pages/Events/Events.tsx:
##########
@@ -141,31 +145,91 @@ const eventsColumn = (
},
];
+const {
+ AFTER: AFTER_PARAM,
+ BEFORE: BEFORE_PARAM,
+ DAG_ID: DAG_ID_PARAM,
+ EVENT_TYPE: EVENT_TYPE_PARAM,
+ MAP_INDEX: MAP_INDEX_PARAM,
+ RUN_ID: RUN_ID_PARAM,
+ TASK_ID: TASK_ID_PARAM,
+ TRY_NUMBER: TRY_NUMBER_PARAM,
+ USER: USER_PARAM,
+}: SearchParamsKeysType = SearchParamsKeys;
+
export const Events = () => {
const { t: translate } = useTranslation("browse");
const { dagId, runId, taskId } = useParams();
+ const [searchParams, setSearchParams] = useSearchParams();
const { setTableURLState, tableURLState } = useTableURLState();
const { pagination, sorting } = tableURLState;
const [sort] = sorting;
const { onClose, onOpen, open } = useDisclosure();
+ const afterFilter = searchParams.get(AFTER_PARAM);
+ const beforeFilter = searchParams.get(BEFORE_PARAM);
+ const dagIdFilter = searchParams.get(DAG_ID_PARAM);
+ const eventTypeFilter = searchParams.get(EVENT_TYPE_PARAM);
+ const mapIndexFilter = searchParams.get(MAP_INDEX_PARAM);
+ const runIdFilter = searchParams.get(RUN_ID_PARAM);
+ const taskIdFilter = searchParams.get(TASK_ID_PARAM);
+ const tryNumberFilter = searchParams.get(TRY_NUMBER_PARAM);
+ const userFilter = searchParams.get(USER_PARAM);
+
const orderBy = sort ? [`${sort.desc ? "-" : ""}${sort.id}`] : ["-when"];
+ const resetPagination = useCallback(() => {
+ setTableURLState({
+ pagination: { ...pagination, pageIndex: 0 },
+ sorting,
+ });
+ }, [pagination, setTableURLState, sorting]);
+
+ const handleClearFilters = useCallback(() => {
+ searchParams.delete(AFTER_PARAM);
+ searchParams.delete(BEFORE_PARAM);
+ searchParams.delete(DAG_ID_PARAM);
+ searchParams.delete(EVENT_TYPE_PARAM);
+ searchParams.delete(MAP_INDEX_PARAM);
+ searchParams.delete(RUN_ID_PARAM);
+ searchParams.delete(TASK_ID_PARAM);
+ searchParams.delete(TRY_NUMBER_PARAM);
+ searchParams.delete(USER_PARAM);
+
+ resetPagination();
+ setSearchParams(searchParams);
+ }, [resetPagination, searchParams, setSearchParams]);
Review Comment:
Moved to eventfilter page
--
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]