Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAG list sorting lost when switching page #29756

Merged
merged 6 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion airflow/www/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,16 @@ def get_params(**kwargs):
return urlencode({d: v for d, v in kwargs.items() if v is not None}, True)


def generate_pages(current_page, num_of_pages, search=None, status=None, tags=None, window=7):
def generate_pages(
current_page,
num_of_pages,
search=None,
status=None,
tags=None,
window=7,
sorting_key=None,
sorting_direction=None,
amoghrajesh marked this conversation as resolved.
Show resolved Hide resolved
):
"""
Generates the HTML for a paging component using a similar logic to the paging
auto-generated by Flask managed views. The paging component defines a number of
Expand Down
7 changes: 3 additions & 4 deletions airflow/www/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,8 @@ def _iter_parsed_moved_data_table_names():
search=escape(arg_search_query) if arg_search_query else None,
status=arg_status_filter if arg_status_filter else None,
tags=arg_tags_filter if arg_tags_filter else None,
sorting_key=arg_sorting_key,
amoghrajesh marked this conversation as resolved.
Show resolved Hide resolved
sorting_direction=arg_sorting_direction,
),
num_runs=num_runs,
tags=tags,
Expand Down Expand Up @@ -3861,10 +3863,7 @@ def audit_log(self, dag_id: str, session=None):
num_log_to=min(end, audit_logs_count),
audit_logs_count=audit_logs_count,
page_size=PAGE_SIZE,
paging=wwwutils.generate_pages(
current_page,
num_of_pages,
),
paging=wwwutils.generate_pages(current_page, num_of_pages),
sorting_key=arg_sorting_key,
sorting_direction=arg_sorting_direction,
)
Expand Down