You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "bbovenzi (via GitHub)" <gi...@apache.org> on 2024/03/12 17:00:20 UTC
[PR] Show if dag page filters are active [airflow]
bbovenzi opened a new pull request, #38080:
URL: https://github.com/apache/airflow/pull/38080
It is not always obvious that we have active filters on the DAG page. We should make it more obvious so users are less confused.
Clear button is disabled if no filters:
<img width="822" alt="Screenshot 2024-03-12 at 9 56 53 AM" src="https://github.com/apache/airflow/assets/4600967/3c191d7e-c070-4df6-8ad3-97e60f566c30">
Clear button is active and the active filter has a blue border color:
<img width="811" alt="Screenshot 2024-03-12 at 9 56 58 AM" src="https://github.com/apache/airflow/assets/4600967/745aaf61-72b4-4614-befb-89d69b77955e">
Also a minor styling fix (before and after):
<img width="477" alt="Screenshot 2024-03-12 at 9 57 18 AM" src="https://github.com/apache/airflow/assets/4600967/903ce782-9dec-46f5-983e-8100d6c3d7e3">
<img width="475" alt="Screenshot 2024-03-12 at 9 57 07 AM" src="https://github.com/apache/airflow/assets/4600967/37c85eeb-31fc-43fd-8937-d8674f184f06">
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
--
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] Show if dag page filters are active [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #38080:
URL: https://github.com/apache/airflow/pull/38080#discussion_r1522248857
##########
airflow/www/static/js/dag/nav/FilterBar.tsx:
##########
@@ -49,9 +63,23 @@ const FilterBar = () => {
transformArrayToMultiSelectOptions,
} = useFilters();
+ // @ts-ignore
+ const isBaseDateDefault = moment(now).isSame(baseDate, "minute");
+ const isNumRunsDefault = numRuns === defaultDagRunDisplayNumber.toString();
+ const isRunStateDefault = !runState || !runState.length;
+ const isRunTypeDefault = !runType || !runType.length;
+ const areFiltersDefault =
+ isBaseDateDefault &&
+ isNumRunsDefault &&
Review Comment:
That's right. it isn't a filter. Updated.
--
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] Show if dag page filters are active [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on PR #38080:
URL: https://github.com/apache/airflow/pull/38080#issuecomment-1994743185
Moved the Number of Runs input to be separate from the real filters:
<img width="1017" alt="Screenshot 2024-03-13 at 8 49 25 AM" src="https://github.com/apache/airflow/assets/4600967/414bd4f6-f6c5-4024-973d-7f668712826c">
--
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] Show if dag page filters are active [airflow]
Posted by "jscheffl (via GitHub)" <gi...@apache.org>.
jscheffl commented on code in PR #38080:
URL: https://github.com/apache/airflow/pull/38080#discussion_r1522197900
##########
airflow/www/static/js/dag/nav/FilterBar.tsx:
##########
@@ -152,6 +208,7 @@ const FilterBar = () => {
background="white"
variant="outline"
onClick={clearFilters}
+ disabled={areFiltersDefault}
Review Comment:
The "filter tasks" option on the right panel was influencing the state of the filter button - when tasks are filtered there, the "clear filters" button gets active, but clicking on it does not reset these. And as such the click does not have an effect.
##########
airflow/www/static/js/dag/nav/FilterBar.tsx:
##########
@@ -49,9 +63,23 @@ const FilterBar = () => {
transformArrayToMultiSelectOptions,
} = useFilters();
+ // @ts-ignore
+ const isBaseDateDefault = moment(now).isSame(baseDate, "minute");
+ const isNumRunsDefault = numRuns === defaultDagRunDisplayNumber.toString();
+ const isRunStateDefault = !runState || !runState.length;
+ const isRunTypeDefault = !runType || !runType.length;
+ const areFiltersDefault =
+ isBaseDateDefault &&
+ isNumRunsDefault &&
Review Comment:
Why do you count the "number of runs" into the filter setting? It is contained in the filter bar but it is actually not really a filter, it rather provides more data/visibility?
I believe so far it has been included in the reset and therefore the inclusion into coloring would be consistent but I am just thinking if we should exclude the number of runs from filter and reset?
--
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] Show if dag page filters are active [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi merged PR #38080:
URL: https://github.com/apache/airflow/pull/38080
--
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] Show if dag page filters are active [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #38080:
URL: https://github.com/apache/airflow/pull/38080#discussion_r1522248551
##########
airflow/www/static/js/dag/nav/FilterBar.tsx:
##########
@@ -152,6 +208,7 @@ const FilterBar = () => {
background="white"
variant="outline"
onClick={clearFilters}
+ disabled={areFiltersDefault}
Review Comment:
Fixed!
--
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