You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "tirkarthi (via GitHub)" <gi...@apache.org> on 2025/04/24 04:38:02 UTC
[PR] Add link to tag to filter dags associated with the tag. [airflow]
tirkarthi opened a new pull request, #49680:
URL: https://github.com/apache/airflow/pull/49680
In Airflow 2 the tag used to be a link on click filters the dags associated with the tag. This adds the same in Airflow 3.
Closes #49673
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add link to tag to filter dags associated with the tag. [airflow]
Posted by "kaxil (via GitHub)" <gi...@apache.org>.
kaxil commented on code in PR #49680:
URL: https://github.com/apache/airflow/pull/49680#discussion_r2058591865
##########
airflow-core/src/airflow/ui/src/pages/Dag/DagHeader.test.tsx:
##########
@@ -41,9 +41,9 @@ afterAll(() => server.close());
describe("Dag Documentation Modal", () => {
it("Display documentation button when doc_md is present", async () => {
render(
- <BaseWrapper>
+ <Wrapper>
Review Comment:
Sounds good
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add link to tag to filter dags associated with the tag. [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi merged PR #49680:
URL: https://github.com/apache/airflow/pull/49680
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add link to tag to filter dags associated with the tag. [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #49680:
URL: https://github.com/apache/airflow/pull/49680#discussion_r2058974028
##########
airflow-core/src/airflow/ui/src/pages/DagsList/DagTags.tsx:
##########
@@ -31,7 +32,11 @@ type Props = {
export const DagTags = ({ hideIcon = false, tags }: Props) => (
<LimitedItemsList
icon={hideIcon ? undefined : <FiTag data-testid="dag-tag" />}
- items={tags.map(({ name }) => name)}
+ items={tags.map(({ name }) => (
+ <RouterLink key={name} to={`/dags?tags=${name}`}>
Review Comment:
nice!
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add link to tag to filter dags associated with the tag. [airflow]
Posted by "tirkarthi (via GitHub)" <gi...@apache.org>.
tirkarthi commented on code in PR #49680:
URL: https://github.com/apache/airflow/pull/49680#discussion_r2059985978
##########
airflow-core/src/airflow/ui/src/pages/DagsList/DagTags.tsx:
##########
@@ -31,7 +32,12 @@ type Props = {
export const DagTags = ({ hideIcon = false, tags }: Props) => (
<LimitedItemsList
icon={hideIcon ? undefined : <FiTag data-testid="dag-tag" />}
- items={tags.map(({ name }) => name)}
+ interactive
+ items={tags.map(({ name }) => (
+ <RouterLink key={name} to={`/dags?tags=${name}`}>
+ {name}
Review Comment:
I just tried Link from Chakra and on the tooltip the link has background color inverted E.g dark-mode has background as white in interactive tooltip making it harder to read while the normal link appears correctly in non-tooltip and RouterLink appears correctly in tooltip. Maybe some issue with chakra tooltip and link so will try the change in another PR if I figure it out.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add link to tag to filter dags associated with the tag. [airflow]
Posted by "tirkarthi (via GitHub)" <gi...@apache.org>.
tirkarthi commented on code in PR #49680:
URL: https://github.com/apache/airflow/pull/49680#discussion_r2058588981
##########
airflow-core/src/airflow/ui/src/pages/Dag/DagHeader.test.tsx:
##########
@@ -41,9 +41,9 @@ afterAll(() => server.close());
describe("Dag Documentation Modal", () => {
it("Display documentation button when doc_md is present", async () => {
render(
- <BaseWrapper>
+ <Wrapper>
Review Comment:
Yes, a Router is required for `Link` from react-router-dom since tags are now links in `DagHeader`. `BaseWrapper` doesn't have a router but `Wrapper` has a `MemoryRouter` and also wraps around `BaseWrapper`. This is only required for testing and the UI is already wrapped with a router.
Error message :
```
Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.
❯ src/pages/Dag/DagHeader.test.tsx (2) 359ms
❯ Dag Documentation Modal (2) 353ms
✓ Display documentation button when doc_md is present
× Do not display documentation button only doc_md is not present
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
FAIL src/pages/Dag/DagHeader.test.tsx > Dag Documentation Modal > Do not display documentation button only doc_md is not present
TypeError: Cannot destructure property 'basename' of 'React__namespace.useContext(...)' as it is null.
```
Ref : https://stackoverflow.com/a/75728680/2610955
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add link to tag to filter dags associated with the tag. [airflow]
Posted by "tirkarthi (via GitHub)" <gi...@apache.org>.
tirkarthi commented on code in PR #49680:
URL: https://github.com/apache/airflow/pull/49680#discussion_r2058943346
##########
airflow-core/src/airflow/ui/src/pages/DagsList/DagTags.tsx:
##########
@@ -31,7 +32,11 @@ type Props = {
export const DagTags = ({ hideIcon = false, tags }: Props) => (
<LimitedItemsList
icon={hideIcon ? undefined : <FiTag data-testid="dag-tag" />}
- items={tags.map(({ name }) => name)}
+ items={tags.map(({ name }) => (
+ <RouterLink key={name} to={`/dags?tags=${name}`}>
Review Comment:
Thanks for the catch. I have made `interactive` to be opt in and on hover it just display the tags with a separator. Then user can select the relevant tag. Also removed an extra comma which resulted in ", , +2 more" which seems to be not correct.

--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add link to tag to filter dags associated with the tag. [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #49680:
URL: https://github.com/apache/airflow/pull/49680#discussion_r2058835310
##########
airflow-core/src/airflow/ui/src/pages/DagsList/DagTags.tsx:
##########
@@ -31,7 +32,11 @@ type Props = {
export const DagTags = ({ hideIcon = false, tags }: Props) => (
<LimitedItemsList
icon={hideIcon ? undefined : <FiTag data-testid="dag-tag" />}
- items={tags.map(({ name }) => name)}
+ items={tags.map(({ name }) => (
+ <RouterLink key={name} to={`/dags?tags=${name}`}>
Review Comment:
If you have more than 3 tags, the rest will be displayed in a tooltip. We might want to see if passing `interactive` to the tooltip will be enough to make those ones linkable too
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add link to tag to filter dags associated with the tag. [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #49680:
URL: https://github.com/apache/airflow/pull/49680#discussion_r2058835310
##########
airflow-core/src/airflow/ui/src/pages/DagsList/DagTags.tsx:
##########
@@ -31,7 +32,11 @@ type Props = {
export const DagTags = ({ hideIcon = false, tags }: Props) => (
<LimitedItemsList
icon={hideIcon ? undefined : <FiTag data-testid="dag-tag" />}
- items={tags.map(({ name }) => name)}
+ items={tags.map(({ name }) => (
+ <RouterLink key={name} to={`/dags?tags=${name}`}>
Review Comment:
If you have more than 3 tags, the rest will be displayed in a tooltip. We might want to see if editng LimitedItemsList to add `interactive` to the tooltip will be enough to make those ones linkable too
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add link to tag to filter dags associated with the tag. [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #49680:
URL: https://github.com/apache/airflow/pull/49680#issuecomment-2842798494
### Backport successfully created: v3-0-test
<table>
<tr>
<th>Status</th>
<th>Branch</th>
<th>Result</th>
</tr>
<tr>
<td>✅</td>
<td>v3-0-test</td>
<td><a href="https://github.com/apache/airflow/pull/50042"><img src="https://img.shields.io/badge/PR-50042-blue" alt="PR Link"></a></td>
</tr>
</table>
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add link to tag to filter dags associated with the tag. [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #49680:
URL: https://github.com/apache/airflow/pull/49680#discussion_r2058975918
##########
airflow-core/src/airflow/ui/src/pages/DagsList/DagTags.tsx:
##########
@@ -31,7 +32,12 @@ type Props = {
export const DagTags = ({ hideIcon = false, tags }: Props) => (
<LimitedItemsList
icon={hideIcon ? undefined : <FiTag data-testid="dag-tag" />}
- items={tags.map(({ name }) => name)}
+ interactive
+ items={tags.map(({ name }) => (
+ <RouterLink key={name} to={`/dags?tags=${name}`}>
+ {name}
Review Comment:
Actually, I wonder if we want to include Chakra.Link here to have a underline on hover so it is obvious to the user that it is a link?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add link to tag to filter dags associated with the tag. [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #49680:
URL: https://github.com/apache/airflow/pull/49680#discussion_r2060158383
##########
airflow-core/src/airflow/ui/src/pages/DagsList/DagTags.tsx:
##########
@@ -31,7 +32,12 @@ type Props = {
export const DagTags = ({ hideIcon = false, tags }: Props) => (
<LimitedItemsList
icon={hideIcon ? undefined : <FiTag data-testid="dag-tag" />}
- items={tags.map(({ name }) => name)}
+ interactive
+ items={tags.map(({ name }) => (
+ <RouterLink key={name} to={`/dags?tags=${name}`}>
+ {name}
Review Comment:
Right, the inverted colorscheme for tooltips can be tricky.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add link to tag to filter dags associated with the tag. [airflow]
Posted by "XD-DENG (via GitHub)" <gi...@apache.org>.
XD-DENG commented on PR #49680:
URL: https://github.com/apache/airflow/pull/49680#issuecomment-2836975050
Great, thanks for the quick fix
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add link to tag to filter dags associated with the tag. [airflow]
Posted by "kaxil (via GitHub)" <gi...@apache.org>.
kaxil commented on code in PR #49680:
URL: https://github.com/apache/airflow/pull/49680#discussion_r2058396495
##########
airflow-core/src/airflow/ui/src/pages/Dag/DagHeader.test.tsx:
##########
@@ -41,9 +41,9 @@ afterAll(() => server.close());
describe("Dag Documentation Modal", () => {
it("Display documentation button when doc_md is present", async () => {
render(
- <BaseWrapper>
+ <Wrapper>
Review Comment:
Do we need this change?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org