-
Notifications
You must be signed in to change notification settings - Fork 8
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
IA-3955: Ignore paging param on datasource api querry used to filter groups #1975
base: main
Are you sure you want to change the base?
IA-3955: Ignore paging param on datasource api querry used to filter groups #1975
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is working but:
- We should totally remove pagination params rom the payload, we still have page=1
- like describe on the ticket we should use a dedicated url for the dropdown values, this api is returning way to much infos
…i-querry-used-to-filter-groups
Updated the PR by adding and using dropdown endpoint for: The previous changes was breaking the data source page. But it's now fixed by the latest commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thi s is ok for me, much better with a specific endpoint ! maybe a back-end review can be nice here @tdethier ?
…i-querry-used-to-filter-groups
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only checked the backend, but it looks like it's working fine 👍
However, I would definitely add more tests if you have time.
iaso/tests/api/test_data_sources.py
Outdated
def test_dropdown_datasource(self): | ||
self.client.force_authenticate(self.joe) | ||
response = self.client.get("/api/datasources/dropdown/?order=name") | ||
self.assertJSONResponse(response, 200) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add more asserts here:
- at least check if the received number of data sources matches what was expected
- maybe check the details of some of them (just the first one for instance), provided that there is some stable order
…thentication/permission for drop down datasource endpoint
What problem is this PR solving? Explain here in one sentence.
Related JIRA tickets : IA-3955, IA-3894
Self proofreading checklist
Doc
Tell us where the doc can be found (docs folder, wiki, in the code...).
Changes
Get all data source linked to projects on the account!
How to test
From org unit groups page, try to filter on datasource and check in the browser network tab. The data source api query return all data source without page size.
Also try from the browser to access to dropdown endpoints for:
You can also sort group by source version.
Print screen / video
DataSource_Source-Version-List-.-Django-REST-framework.webm
Sort-Groups-by-sourceVersion.webm
Notes
Things that the reviewers should know:
Follow the Conventional Commits specification
The merge message of a pull request must follow the Conventional Commits specification.
This convention helps to automatically generate release notes.
Use lowercase for consistency.
Example:
Note that the Jira reference is preceded by a line break.
Both the line break and the Jira reference are entered in the Add an optional extended description… field.