sunilkunchoor commented on issue #64336:
URL: https://github.com/apache/airflow/issues/64336#issuecomment-4145355691

   I am happy to open a PR for this! Here is the proposed implementation plan:
   
   1. **Python Backend (airflow/models/baseoperator.py):**
   Add a target class attribute to BaseOperatorLink with a default of "_blank" 
to maintain strict backward compatibility.
   ```python
   class BaseOperatorLink:
       name: str = "<Please specify name>"
       target: str = "_blank" # New attribute
   ```
   
   2. REST API / Serialization:
   Update the FastAPI endpoint/Pydantic schemas responsible for serving Task 
Instance extra links to include the `target` property in the response payload.
   (Note: The current API might return a simple `dict[str, str]` mapping names 
to URLs; this would need to be updated to a structured object, or we can 
discuss the best API contract approach in the PR).
   
   3. React UI 
(`airflow-core/src/airflow/ui/src/pages/TaskInstance/ExtraLinks.tsx`):
   Update the component responsible for rendering the extra links (within Task 
Instance details) to dynamically read the target prop from the API payload, 
falling back to `_blank` if undefined.
   ```js
   <Button as="a" href={link.url} target={link.target || "_blank"}>
     {link.name}
   </Button>
   ```
   


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