Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add global events page to browse along with support to display only events for the dag. #43793

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tirkarthi
Copy link
Contributor

This adds support to display all events under browse page. This also adds support to display events only related to the dag under events tab in dag details which is basically filter by dag_id in the API when dag_id is present in the URL. The events per dag skips dag_id column which is redundant.

Add support to filter by when, event_log_id which needs to be replaced in the backend before querying. This was done in the legacy API connexion code and the same support is added here

to_replace = {"event_log_id": "id", "when": "dttm"}

Notes for self and review :

  1. eslint fails with below error that <Time /> cannot be constructed for when column but I have seen this pattern used elsewhere and also previously when dags list page only had timestamp for next/last dagrun as <Time />

/home/karthikeyan/stuff/python/airflow/airflow/ui/src/pages/Events/Events.tsx
56:13 error Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “Events” and pass data as props. If you want to allow component creation in props, set allowAsProps option to true react/no-unstable-nested-component

  1. Legacy UI does sorting by when in descending manner by default to display latest events first. I have passed it to useTableURLState as default yet somehow this is not working.
  2. When there are no events the page displays No Eventss found where Events has a double s which needs to be fixed.
  3. extra column is usually a json and might need a followup PR in new UI to pretty display JSON like legacy UI.
  4. The events table under the dag details tab on scroll pushes the column of the table up and needs to be fixed. This is not observed in the code page.

Related

#43704
#43705

Screenshots

image

image

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Nov 7, 2024
Copy link
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will work on a fix for the scroll state and search params in a separate PR.

For extra you can try to use the renderSubComponent field on DataTable. But I'm not sure yet if that will be a great UX

orderBy,
});

const columns: Array<ColumnDef<EventLogResponse>> = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can define columns just outside of the Events component on line 29

initialState={tableURLState}
isFetching={isFetching}
isLoading={isLoading}
modelName="Events"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
modelName="Events"
modelName="Event"

skeletonWidth: 10,
},
},
...(Boolean(dagId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With columns defined outside of the react component. we might need to turn const columns into a function in order to accept a dagId

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:UI Related to UI/UX. For Frontend Developers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants