tirkarthi commented on PR #46631:
URL: https://github.com/apache/airflow/pull/46631#issuecomment-2653897859

   @pierrejeambrun I have refactored them to a common component `DurationChart` 
. Most of the part is same for task instance and dag run except the queued 
duration calculation which needs `queued_when` and `queued_at` . I am passing 
`kind` to denote the type and also using it in switch case to use the correct 
attribute for queued duration. I am new to JS/React refactoring. Please let me 
know if there is a better way. Another approach I thought of was making the 
component as a base class and each class `TaskInstanceDurationChart` and 
`DagRunDurationChart` inherits from the base class to implement queued logic 
duration calculation as a function for the respective class.


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