OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Change how watchers data is returned to front-end, blocked users are not returned
bsatarnejad3676ead9aa82
diff --git a/lib/api/v3/work_packages/watchers_api.rb b/lib/api/v3/work_packages/watchers_api.rbindex b3e51a863cc..c74e70cf564 100644--- a/lib/api/v3/work_packages/watchers_api.rb+++ b/lib/api/v3/work_packages/watchers_api.rb@@ -57,7 +57,7 @@ module APIresources :watchers dohelpers dodef watchers_collection- watchers = @work_package.watcher_users+ watchers = @work_package.watcher_users.active_or_registeredself_link = api_v3_paths.work_package_watchers(@work_package.id)Users::UserCollectionRepresenter.new(watchers,self_link,diff --git a/spec/requests/api/v3/watcher_resource_spec.rb b/spec/requests/api/v3/watcher_resource_spec.rbindex e3f2e65adc6..dc7c6bcf490 100644--- a/spec/requests/api/v3/watcher_resource_spec.rb+++ b/spec/requests/api/v3/watcher_resource_spec.rb@@ -58,6 +58,19 @@ describe 'API v3 Watcher resource', type: :request, content_type: :json doFactoryBot.create(:watcher, watchable: work_package, user: watching_user)end+ let!(:watching_blocked_user) do+ FactoryBot.create :user,+ login: 'lockedUser',+ mail: '[email protected]',+ member_in_project: project,+ member_through_role: view_work_packages_role+ end+ let!(:existing_blocked_watcher) do+ FactoryBot.create(:watcher, watchable: work_package, user: watching_blocked_user).tap do+ watching_blocked_user.lock!+ end+ end+subject(:response) { last_response }before do