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

Sorting in CPT Dashboard #138

Open
wants to merge 7 commits into
base: revamp
Choose a base branch
from

Conversation

MVarshini
Copy link
Collaborator

Type of change

  • Refactor
  • New feature
  • Bug fix
  • Optimization
  • Documentation Update

Description

As part of Dynamic Pagination, Sorting is moved to the backend. On clicking the arrow icon next to the table column header, hits the server with sort param in the payload. It takes the format sort=<field_name>:<sort_dir>

Also, formatted the .py files with black formatter.

Related Tickets & Documents

  • Related Issue #
  • Closes #

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please describe the System Under Test.
  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

@MVarshini MVarshini self-assigned this Nov 29, 2024
@MVarshini MVarshini closed this Nov 30, 2024
@MVarshini MVarshini reopened this Nov 30, 2024
@MVarshini MVarshini marked this pull request as draft November 30, 2024 13:51
Copy link
Collaborator

@dbutenhof dbutenhof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the reformatting, but I want to be able to find the real functional changes here without scanning hundreds of reformatted lines to figure out where they are. I'm going to defer this review until we can see it without the reformatting.

backend/app/api/api.py Outdated Show resolved Hide resolved
@MVarshini MVarshini marked this pull request as ready for review December 12, 2024 12:57
@MVarshini MVarshini requested a review from dbutenhof December 12, 2024 12:57
Copy link
Collaborator

@dbutenhof dbutenhof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only got through the Python code; I'll take another look at the JavaScript.

I think this would benefit from a consistent output in the getJobs methods, with the data/total dict rather than having the callers check whether a key exist. There are several other patterns here that we modified in #135 that I think should be carried through to this ...

backend/app/api/v1/commons/hce.py Outdated Show resolved Hide resolved
backend/app/api/v1/commons/hce.py Outdated Show resolved Hide resolved
backend/app/api/v1/commons/quay.py Outdated Show resolved Hide resolved
backend/app/api/v1/commons/telco.py Outdated Show resolved Hide resolved
backend/app/api/v1/endpoints/cpt/cptJobs.py Outdated Show resolved Hide resolved
backend/app/services/search.py Outdated Show resolved Hide resolved
backend/app/services/search.py Outdated Show resolved Hide resolved
backend/app/services/search.py Outdated Show resolved Hide resolved
backend/app/services/search.py Outdated Show resolved Hide resolved
backend/app/api/v1/commons/ocp.py Outdated Show resolved Hide resolved
@MVarshini
Copy link
Collaborator Author

@dbutenhof Let's merge 135 into the revamp branch. Once this branch is rebased with the revamp branch, all other changes will be incorporated here.

@dbutenhof
Copy link
Collaborator

@dbutenhof Let's merge 135 into the revamp branch. Once this branch is rebased with the revamp branch, all other changes will be incorporated here.

Right ... I've gotten so used to chaining one PR on top of the other I hadn't really considered that these changes are independent of #135 and they'll get merged after that drops. So, sure: we'll review again after you've rebased. 😁

@dbutenhof
Copy link
Collaborator

Oops ... I hit approve in the wrong tab. I still need to re-review this. 😁

backend/app/api/v1/commons/utils.py Outdated Show resolved Hide resolved
backend/app/api/v1/endpoints/ocp/ocpJobs.py Outdated Show resolved Hide resolved
backend/app/api/v1/endpoints/quay/quayJobs.py Outdated Show resolved Hide resolved
backend/app/services/splunk.py Outdated Show resolved Hide resolved
frontend/src/actions/commonActions.js Outdated Show resolved Hide resolved
@MVarshini MVarshini requested a review from dbutenhof December 13, 2024 16:54
@@ -0,0 +1,23 @@
# Define the keywords for sorting.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this is hard-coded and not retrieved from an API?
What does this apply to?

I think it would be beneficial to mention some of this in the comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants