lidalei opened a new issue #10046:
URL: https://github.com/apache/airflow/issues/10046


   **Apache Airflow version**:
   1.10.11
   
   **What happened**:
   I have `hide_paused_dags_by_default = True` is set in airflow.cfg. In 
Airflow UI, when paused dags are shown (after clicking the button "Show Paused 
DAGs"), I search for a paused dag. The search bar shows the dag id, but when I 
click on the dag id, the UI returns "No data available in table".
   
   **What you expected to happen**:
   When `hide_paused_dags_by_default = True` and paused dags are shown, I 
expect the paused dag can be shown when searching for it.
   
   The bug can be identified by reading the Javascript code 
   ```
       const DAGS_INDEX = "{{ url_for('Airflow.index') }}";
       const ENTER_KEY_CODE = 13;
       const STATE_COLOR = {{ state_color|tojson }};
   
       $('#tags_filter').select2({
         placeholder: "Filter dags",
         allowClear: true
       });
   
       $('#dag_query').on('keypress', function (e) {
         // check for key press on ENTER (key code 13) to trigger the search
         if (e.which === ENTER_KEY_CODE) {
           var query = new URLSearchParams(window.location.search);
           query.set("search", e.target.value.trim());
           query.delete("page");
           window.location = DAGS_INDEX + "?" + query.toString();
           e.preventDefault();
         }
       });
   ```
   
[dags.htm#L251-L269](https://github.com/apache/airflow/blob/273e28cc2547cd552ea9c88cce086459b64e6257/airflow/www/templates/airflow/dags.html#L251-L269).
   
   DAGS_INDEX should take "show paused dags" toggle status into consideration. 
For example, when paused dags are hidden, `dags_index = "{{ 
url_for('Airflow.index', status='active') }}";`. When paused dags are shown, 
`dags_index = "{{ url_for('Airflow.index', status='all') }}";`.
   
   
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to