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

Add feature to revert tasks set as unavailable by a specific user #5955

Merged
merged 8 commits into from
Jul 12, 2023

Conversation

Aadesh-Baral
Copy link
Contributor

@Aadesh-Baral Aadesh-Baral commented Jun 29, 2023

closes #5943

Backend changes:

  • Rename endpoint projects/<int:project_id>/tasks/actions/reset-validated-by-user/ to projects/<int:project_id>/tasks/actions/reset-by-user/.
  • Introduce a query param action in the endpoint above which is used to revert tasks of specific action performed by the user. The value of this action can only be VALIDATED and BADIMAGERY.
  • Add and update test case for endpoint and its associated function.
  • Better handling of exceptions on the particular endpoint.
  • Add badImagery and badImageryTasks in the response of projects/<project_id>/contributions/ endpoint.

unavailable_tasks

------------------------------------------
In the previous implementation this endpoint was only able to revert validated tasks by a user to mapped state.
Now this endpoint has been modified so that it is able to revert validated and bad imagery tasks set by a user.
------------------------------------------
- Renames endpoint url to `projects/<int:project_id>/tasks/actions/reset-by-user/` from `projects/<int:project_id>/tasks/actions/reset-validated-by-user/`.
- Introduces a query param action which is used to revert tasks of specific action performed by user. The value of this action can only be VALIDATED and BADIMAGERY.
- Renames DTO and function so  that it matches that task performed by them.
@Aadesh-Baral Aadesh-Baral force-pushed the feature/5943-revert-unavailable-tasks branch 2 times, most recently from 189f94d to ee08814 Compare June 29, 2023 05:53
…ing multiple actions

- Add support for revert actions in `RevertTasks` component; now supporting both revert actions for `VALIDATED` and `BADIMAGERY` tasks
- Update messages for `BADIMAGERY` action and also `VALIDATED` action to use dynamically generated messages in the `RevertTasks` component
…points.

------------------------------------------
In the previous implementation bad imagery tasks were counted as mapped by user so this commit adds new fields in `UserContribution` dto for bad imagery tasks count and bad imagery tasks list.
@Aadesh-Baral Aadesh-Baral marked this pull request as ready for review July 5, 2023 10:50
@Aadesh-Baral Aadesh-Baral requested a review from d-rita July 5, 2023 10:50
…adding `badImagery` and `badImageryTasks` fields.
@Aadesh-Baral Aadesh-Baral force-pushed the feature/5943-revert-unavailable-tasks branch from 1600a65 to d0929f2 Compare July 5, 2023 11:18
@HelNershingThapa HelNershingThapa changed the title Add feature to revert tasks set as unavailabe by a specific user Add feature to revert tasks set as unavailable by a specific user Jul 7, 2023
Copy link
Contributor

@d-rita d-rita left a comment

Choose a reason for hiding this comment

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

Tested via both the front-end and api-docs. Works as expected on the UI🎉. Via the API-docs, we get a 500 internal server error if the string entered is not ALL CAPS. The change request is for the removal of case sensitivity.

… can be converted into desired format within the dto.
@Aadesh-Baral Aadesh-Baral requested a review from d-rita July 12, 2023 07:56
@sonarcloud
Copy link

sonarcloud bot commented Jul 12, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.9% 1.9% Duplication

@Aadesh-Baral
Copy link
Contributor Author

Aadesh-Baral commented Jul 12, 2023

I've updated the PR with the issue reported. Can you please re-review ?

Copy link
Contributor

@d-rita d-rita left a comment

Choose a reason for hiding this comment

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

LGTM!

@Aadesh-Baral Aadesh-Baral merged commit beb87bf into develop Jul 12, 2023
8 checks passed
@Aadesh-Baral Aadesh-Baral deleted the feature/5943-revert-unavailable-tasks branch July 12, 2023 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revert unavailable tasks set by a specific user
3 participants