Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions airflow-core/src/airflow/ui/src/pages/Events/Events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ const eventsColumn = (
const {
AFTER: AFTER_PARAM,
BEFORE: BEFORE_PARAM,
DAG_ID: DAG_ID_PARAM,
DAG_DISPLAY_NAME_PATTERN: DAG_DISPLAY_NAME_PATTERN_PARAM,
EVENT_TYPE: EVENT_TYPE_PARAM,
MAP_INDEX: MAP_INDEX_PARAM,
RUN_ID: RUN_ID_PARAM,
TASK_ID: TASK_ID_PARAM,
RUN_ID_PATTERN: RUN_ID_PATTERN_PARAM,
TASK_ID_PATTERN: TASK_ID_PATTERN_PARAM,
TRY_NUMBER: TRY_NUMBER_PARAM,
USER: USER_PARAM,
}: SearchParamsKeysType = SearchParamsKeys;
Expand All @@ -168,11 +168,11 @@ export const Events = () => {

const afterFilter = searchParams.get(AFTER_PARAM);
const beforeFilter = searchParams.get(BEFORE_PARAM);
const dagIdFilter = searchParams.get(DAG_ID_PARAM);
const dagDisplayNameFilter = searchParams.get(DAG_DISPLAY_NAME_PATTERN_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 runIdFilter = searchParams.get(RUN_ID_PATTERN_PARAM);
const taskIdFilter = searchParams.get(TASK_ID_PATTERN_PARAM);
const tryNumberFilter = searchParams.get(TRY_NUMBER_PARAM);
const userFilter = searchParams.get(USER_PARAM);

Expand All @@ -191,7 +191,9 @@ export const Events = () => {
// Use exact match for URL params (dag/run/task context)
dagId: dagId ?? undefined,
// Use pattern search for filter inputs (partial matching)
dagIdPattern: dagIdFilter ?? undefined,
// NOTE: keeping API param name the same for minimal change;
// we feed it from the display-name URL param.
dagIdPattern: dagDisplayNameFilter ?? undefined,
eventPattern: eventTypeFilter ?? undefined,
limit: pagination.pageSize,
mapIndex: mapIndexNumber,
Expand Down
15 changes: 11 additions & 4 deletions airflow-core/src/airflow/ui/src/pages/Events/EventsFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { VStack } from "@chakra-ui/react";
import { useMemo } from "react";

import { FilterBar, type FilterValue } from "src/components/FilterBar";
Expand All @@ -41,17 +42,17 @@ export const EventsFilters = ({ urlDagId, urlRunId, urlTaskId }: EventsFiltersPr

// Only add DAG ID filter if not in URL context
if (urlDagId === undefined) {
keys.push(SearchParamsKeys.DAG_ID);
keys.push(SearchParamsKeys.DAG_DISPLAY_NAME_PATTERN);
}

// Only add Run ID filter if not in URL context
if (urlRunId === undefined) {
keys.push(SearchParamsKeys.RUN_ID);
keys.push(SearchParamsKeys.RUN_ID_PATTERN);
}

// Only add Task ID filter if not in URL context
if (urlTaskId === undefined) {
keys.push(SearchParamsKeys.TASK_ID);
keys.push(SearchParamsKeys.TASK_ID_PATTERN);
}

return keys;
Expand Down Expand Up @@ -80,6 +81,12 @@ export const EventsFilters = ({ urlDagId, urlRunId, urlTaskId }: EventsFiltersPr
}, [searchParams, filterConfigs]);

return (
<FilterBar configs={filterConfigs} initialValues={initialValues} onFiltersChange={handleFiltersChange} />
<VStack align="start" gap={4} paddingY="4px">
<FilterBar
configs={filterConfigs}
initialValues={initialValues}
onFiltersChange={handleFiltersChange}
/>
</VStack>
);
};