Skip to content

Public tasks -- updates to ensure public tasks can be viewed and used

Placeholder Ihsan Ullah requested to merge public_tasks into develop

@ mention of reviewers`

@Didayolo`

A brief description of the purpose of the changes contained in this PR.

This PR solves all the issues related to making tasks public and using them in competitions either by owners or other users. The following changes are made to enable this functionality.

  1. From Task model, condition removed that forced tasks to be validated first before making them public
  2. Fron-end updated to show making a task public/private button. There was a condition to show this button only when a task is validated. Now that is removed
  3. Updated task update method on the backend to enable updating is_public status of a task.
  4. Task updation was never tested and there was a problem in the response of the update API. Now that is fixed and the API returns a serialized response to show updated status.
  5. Removed key from the task detail serializer. In the task detail, there was always key present. That was not needed and is now removed
  6. Some modifications were needed in TaskListSerializer to properly use validated status and sharedwith list. Now that is fixed.
  7. Added is_public to TaskListSerializer to show a checkmark in the tasks list table.
  8. Public tasks were shown in the tasks interface when a checkbox Show public tasks was checked but when this public task was clicked, details were not shown because it was not permitted from the backend. Now the backend is updated to return details for public tasks.
  9. When you edit a competition->phase from the UI, public tasks were not shown in the tasks list, now users can see and select public tasks in their phases

Issues this PR resolves

A checklist for hand testing

  • With user 1 create a task and make it public using the task detail interface. Make sure that you can make the task public and private
  • With user 2 go to Resource interface -> Tasks tab, click show public tasks checkbox. Check that the task made public by user 1 is shown here. Check that you can click the task and check its details
  • With user 2 create a competition, go to edit competition->Phases. In one phase search the same task in the task dropdown and check that you can select this task for your phase and save changes.
  • Now run a submission to check that the task works.
  • check that only owners of tasks can make them public/private

Checklist

  • Code review by me
  • Hand tested by me
  • I'm proud of my work
  • Code review by reviewer
  • Hand tested by reviewer
  • CircleCi tests are passing
  • Ready to merge

Merge request reports

Loading