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): list groups that can be deleted #2247

Merged
merged 1 commit into from Aug 12, 2022

Conversation

dushimsam
Copy link
Contributor

@dushimsam dushimsam commented Jun 30, 2022

Signed-off-by: dushimsam dushsam100@gmail.com

Description

To check if the user has any group that is possible to be deleted.

Changes

  1. Added a new function in GroupController. to check if the group exists.
  2. Updated the main file(index.php) by adding a new route /groups/has-deletable-group.
  3. Updated the openapi.yaml file to introduce a new API.

How to test

  1. Open and run the project then visit the url http://localhost/repo/api/v1/groups/has-deletable-group
  2. Response

The following property in the response body called available should be marked as true if you have any group that is deletable , else it will always be marked as false.

has-deletable-group

By default you have group fossy , this one is not deletable , the deletable groups are the one you add afterwards.
In other words , by default you don't have any deletable group , unless you start adding your own groups.

Related Issue:

Fixes #2246

cc: @shaheemazmalmmd @GMishx

@GMishx GMishx added needs code review needs test GSoC-22 Label to tag issues and pull request for GSOC 2022 activities labels Jul 1, 2022
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.

Some suggestions

src/www/ui/api/Controllers/GroupController.php Outdated Show resolved Hide resolved
src/www/ui/api/documentation/openapi.yaml Outdated Show resolved Hide resolved
src/www/ui/api/documentation/openapi.yaml Outdated Show resolved Hide resolved
@GMishx
Copy link
Member

GMishx commented Jul 6, 2022

@dushimsam , can you please fix the branch so we can merge it?

@dushimsam dushimsam force-pushed the dushimsam/feat/has-group branch 4 times, most recently from 4262e75 to 6a8601a Compare July 6, 2022 20:15
@dushimsam dushimsam changed the title feat(API): user has a deletable-group feat(API): list groups that can be deleted Jul 6, 2022
@dushimsam
Copy link
Contributor Author

Done, you can review and let me know what's next to update if still available.

@dushimsam dushimsam force-pushed the dushimsam/feat/has-group branch 2 times, most recently from 24443ab to b1292aa Compare July 12, 2022 15:03
@dushimsam
Copy link
Contributor Author

Completed tests for this controller.
Hope it can be merged now.

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.

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. Working as expected.

@dushimsam
Copy link
Contributor Author

Wow, thanks a lot sir.

@dushimsam
Copy link
Contributor Author

tested and working perfectly.
Please merge for me,

@dushimsam dushimsam requested a review from GMishx July 16, 2022 19:21
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.

A tiny change. Missed it earlier.

src/www/ui_tests/api/Controllers/GroupControllerTest.php Outdated Show resolved Hide resolved
@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 20, 2022
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.

@dushimsam Kindly rebase the branch with upstream master to resolve the merge conflicts.

src/www/ui_tests/api/Controllers/GroupControllerTest.php Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the has merge conflicts PR to be rebased label Aug 8, 2022
@dushimsam
Copy link
Contributor Author

Ready now sir, kindly review and merge for me.

@GMishx GMishx merged commit 62957e5 into fossology:master Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GSoC-22 Label to tag issues and pull request for GSOC 2022 activities ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check if user has a deletable group via REST API
2 participants