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

feat(api): get list of license decisions for an item #2470

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

dushimsam
Copy link
Contributor

@dushimsam dushimsam commented Jun 13, 2023

Description

Added the API to retrieve a list of license decisions for a particular item.

Changes

  1. Added a new method in UploadTreeController to handle the logic.
  2. Created the method in UploadTreeController for adding the new license on the selected item.
  3. Updated the main file(index.php) by adding a new route GET /uploads/{id}/items/{itemId}/licenses.
  4. Updated the openapi.yaml file to write the new API's documentation.

How to test

Make a GET request on the endpoint: /uploads/{id}/items/{itemId}/licenses,

Screenshots

image

Related Issue:

Fixes #2459

cc: @shaheemazmalmmd @GMishx

@dushimsam dushimsam force-pushed the get-license-decisions branch 2 times, most recently from 5651870 to 3d8a3e2 Compare June 19, 2023 09:33
@GMishx GMishx added needs code review needs test GSOC-23 Label to tag pull request which are part of the GSOC 2023 labels Jun 22, 2023
@github-actions
Copy link

This pull request has conflicts, please rebase with master to resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the has merge conflicts PR to be rebased label Jun 29, 2023
@github-actions github-actions bot removed the has merge conflicts PR to be rebased label Jun 29, 2023
@github-actions github-actions bot added the has merge conflicts PR to be rebased label Jun 30, 2023
@github-actions
Copy link

This pull request has conflicts, please rebase with master to resolve those before we can evaluate the pull request.

@GMishx
Copy link
Member

GMishx commented Jun 30, 2023

Out of 3 licenses, I am getting only 1 which is selected.
image

image

I was expecting all 3 here.

@GMishx
Copy link
Member

GMishx commented Jun 30, 2023

Also for clarification, what is the id 3 here?

@dushimsam
Copy link
Contributor Author

dushimsam commented Jul 2, 2023

Out of 3 licenses, I am getting only 1 which is selected. image

image

I was expecting all 3 here.

I think we shall have to discuss about this in the meeting because currently, the API returns the list of the selected licenses for the item, not with the suggested ones. I am actually struggling to know how those two additional licenses got there. May you will illustrate this for me in the meeting.

@dushimsam
Copy link
Contributor Author

Also for clarification, what is the id 3 here?

The response is a list of the licenses, obviously the "id" property should the license's id.

@dushimsam dushimsam force-pushed the get-license-decisions branch 2 times, most recently from 98b68d9 to 3a780be Compare July 5, 2023 16:26
@dushimsam
Copy link
Contributor Author

dushimsam commented Jul 5, 2023

Out of 3 licenses, I am getting only 1 which is selected. image

image

I was expecting all 3 here.

Hello @GMishx
I updated the PR. I added a new field "isRemoved" to indicate which licenses are and not removed.

image

image
image

Hope this solves the issue, let me know how it looks 😉

@github-actions github-actions bot added has merge conflicts PR to be rebased and removed has merge conflicts PR to be rebased labels Jul 5, 2023
@github-actions
Copy link

github-actions bot commented Jul 7, 2023

This pull request has conflicts, please rebase with master to resolve those before we can evaluate the pull request.

Copy link
Member

@GMishx GMishx left a comment

Choose a reason for hiding this comment

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

Small changes required

src/www/ui/api/Controllers/UploadTreeController.php Outdated Show resolved Hide resolved
src/www/ui/api/Controllers/UploadTreeController.php Outdated Show resolved Hide resolved
@GMishx
Copy link
Member

GMishx commented Jul 24, 2023

Tested, working as expected.

@GMishx GMishx removed the needs test label Jul 24, 2023
@github-actions github-actions bot removed the has merge conflicts PR to be rebased label Jul 24, 2023
@github-actions
Copy link

This pull request has conflicts, please rebase with master to resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the has merge conflicts PR to be rebased label Jul 26, 2023
Signed-off-by: dushimsam <dushsam@gmail.com>
@github-actions github-actions bot removed the has merge conflicts PR to be rebased label Jul 26, 2023
Copy link
Member

@GMishx GMishx left a comment

Choose a reason for hiding this comment

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

Changes looks good.

@GMishx GMishx merged commit 6805d8b into fossology:master Jul 26, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GSOC-23 Label to tag pull request which are part of the GSOC 2023 ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

License File View - Details
2 participants