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): add new license decision #2466

Closed
wants to merge 1 commit into from

Conversation

dushimsam
Copy link
Contributor

@dushimsam dushimsam commented Jun 13, 2023

Description

Added the API to set the clearing decision 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 POST /uploads/{id}/items/{itemId}/licenses.
  4. Updated the openapi.yaml file to write the new API's documentation.

How to test

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

Screenshots

image

Related Issue:

Fixes #2459

cc: @shaheemazmalmmd @GMishx

Signed-off-by: dushimsam <dushsam@gmail.com>
@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
@GMishx
Copy link
Member

GMishx commented Jun 28, 2023

While reviewing the PR, I got an idea to merge #2466, #2469 and #2471 with a single PUT request.

So, the idea is to have a single endpoint PUT /uploads/{id}/items/{itemId}/licenses with following body:

[
  {
    "shortName": "MIT",
    "add": true,
    "text": "Updated license text",
    "ack": "Updated acknowledgement text",
    "comment": "Updated comment text"
  },
  {
    "shortName": "BSD-3-Clause",
    "add": true,
    "ack": "Updated acknowledgement text"
  },
  {
    "shortName": "GPL-2.0-only",
    "add": false
  }
]

In this 1 single request, one can add "MIT" and "BSD-3-Clause" license to the file. Also provide or update the text/ack/comment of the license. And at the same time remove the "GPL-2.0-only" license.

What do you think @dushimsam @soham4abc ?

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

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

@dushimsam
Copy link
Contributor Author

dushimsam commented Jun 29, 2023

While reviewing the PR, I got an idea to merge #2466, #2469 and #2471 with a single PUT request.

So, the idea is to have a single endpoint PUT /uploads/{id}/items/{itemId}/licenses with following body:

[
  {
    "shortName": "MIT",
    "add": true,
    "text": "Updated license text",
    "ack": "Updated acknowledgement text",
    "comment": "Updated comment text"
  },
  {
    "shortName": "BSD-3-Clause",
    "add": true,
    "ack": "Updated acknowledgement text"
  },
  {
    "shortName": "GPL-2.0-only",
    "add": false
  }
]

In this 1 single request, one can add "MIT" and "BSD-3-Clause" license to the file. Also provide or update the text/ack/comment of the license. And at the same time remove the "GPL-2.0-only" license.

What do you think @dushimsam @soham4abc ?

Great, done. Please check this PR #2509 @GMishx

@GMishx
Copy link
Member

GMishx commented Jun 30, 2023

Great, done. Please check this PR #2509 @GMishx

Awesome. Then I will close the 3 PRs.

@GMishx
Copy link
Member

GMishx commented Jun 30, 2023

Closed in favor of #2509

@GMishx GMishx closed this Jun 30, 2023
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 has merge conflicts PR to be rebased needs code review needs test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

License File View - Details
2 participants