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

RDISCROWD-6222 Show GIGwork users why no tasks are available #866

Merged
merged 3 commits into from
Jul 31, 2023

Conversation

peterkle
Copy link

Issue number of the reported bug or feature request: #RDISCROWD-6222

Describe your changes
As a user, I would like to be able to see why no more tasks are available to me even when a project is not yet completed, so that I can understand if there is a problem with the project or if I can work on more tasks.

A typical cause for this is that the project is using the User Preference or Task Queues scheduler and the remaining tasks have preferences configured that are different than the user's.

Notes

  • Notice that I refactored the "redirect_to_password" check by moving it earlier in the function to avoid needless computation of metrics. This change is unrelated to this feature.
  • JSON body shape:
  "notifications": {
    "project_incomplete_info": {
      "user_preferences": {
        "account_profile_link": "/account/user/", 
        "task_scheduler": "User Preference Scheduler"
      }
    }
  }

@coveralls
Copy link

coveralls commented Jul 27, 2023

Pull Request Test Coverage Report for Build 5717682690

  • 12 of 12 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 94.127%

Totals Coverage Status
Change from base Build 5648206489: 0.003%
Covered Lines: 16924
Relevant Lines: 17980

💛 - Coveralls

Copy link

@kbecker42 kbecker42 left a comment

Choose a reason for hiding this comment

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

Thank you.

test/test_web.py Show resolved Hide resolved
project.info['sched'] = Schedulers.task_queue
res = self.app_get_json(url)
data = json.loads(res.data)
assert 'notifications' in data.keys(), list(data.keys())

Choose a reason for hiding this comment

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

# Task Queue scheduler: verify notification message displays.

Also, is this updating the project repo and saving the new task queue preference via self.app_get_json(url)?

Copy link
Author

Choose a reason for hiding this comment

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

self.app_get_json(url) is a test helper which only fetches data. The update to project scheduler is done via assignment in project.info['sched'] = Schedulers.task_queue

test/test_web.py Show resolved Hide resolved
Copy link

@XiChenn XiChenn left a comment

Choose a reason for hiding this comment

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

lgtm

pybossa/view/projects.py Outdated Show resolved Hide resolved
Copy link

@XiChenn XiChenn left a comment

Choose a reason for hiding this comment

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

Feel free to "Squash and merge" upon all checks passed. You will also need to update the "pybossa-default-theme" pointer as it is merged to the main branch the hash could be different.

@peterkle peterkle merged commit 6c651bf into main Jul 31, 2023
4 checks passed
@peterkle peterkle deleted the RDISCROWD-6222 branch July 31, 2023 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants