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

IA-3955: Ignore paging param on datasource api querry used to filter groups #1975

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

butofleury
Copy link
Member

@butofleury butofleury commented Feb 17, 2025

What problem is this PR solving? Explain here in one sentence.

Related JIRA tickets : IA-3955, IA-3894

Self proofreading checklist

  • Did I use eslint and black formatters
  • Is my code clear enough and well documented
  • Are my typescript files well typed
  • New translations have been added or updated if new strings have been introduced in the frontend
  • My migrations file are included
  • Are there enough tests
  • Documentation has been included (for new feature)

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:

  • known bugs that are out of the scope of the PR
  • other trade-offs that were made
  • does the PR depends on a PR in bluesquare-components?
  • should the PR be merged into another PR?

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:

fix: empty instance pop up

Refs: IA-3665

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.

Copy link
Collaborator

@beygorghor beygorghor left a 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

@butofleury
Copy link
Member Author

butofleury commented Feb 19, 2025

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

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.

@butofleury butofleury requested a review from quang-le February 20, 2025 07:46
@beygorghor beygorghor added the release Should be released in production at next deploy label Feb 20, 2025
Copy link
Collaborator

@beygorghor beygorghor left a 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 ?

Copy link
Member

@tdethier tdethier 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 checked the backend, but it looks like it's working fine 👍

However, I would definitely add more tests if you have time.

def test_dropdown_datasource(self):
self.client.force_authenticate(self.joe)
response = self.client.get("/api/datasources/dropdown/?order=name")
self.assertJSONResponse(response, 200)
Copy link
Member

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

@butofleury butofleury requested a review from tdethier February 24, 2025 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release Should be released in production at next deploy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants