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

TAN-3815 - Add community monitor survey BE (OLD) #10313

Open
wants to merge 37 commits into
base: master
Choose a base branch
from

Conversation

jamesspeake
Copy link
Contributor

@jamesspeake jamesspeake commented Feb 11, 2025

Changes in a nutshell:

  • hidden project - flagged using both internal_role: 'community_monitor on project and publication_status: hidden on admin publication
  • exclude emails/followers/notifications being created for hidden projects
  • single native_survey phase on this project with new attribute native_survey_method which will work in a similar way to voting_method to make the small tweaks to the participation method we need
  • new endpoint to get/create this project/phase
  • new feature flag community_monitor which also stores the project ID for this project

Changelog

Technical

  • Added APIs for new community monitor survey
  • Prevented native_surveys from creating idea followers

@jamesspeake jamesspeake added this to the Community Monitor milestone Feb 11, 2025
Copy link

@cl-dev-bot
Copy link
Collaborator

cl-dev-bot commented Feb 11, 2025

Messages
📖 Changelog provided 🎉
📖 Notion issue: TAN-3815
📖

Run the e2e tests

📖 Check translation progress

Generated by 🚫 dangerJS against 0220682

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: Just an example of the default form override at the moment

@jamesspeake jamesspeake marked this pull request as ready for review February 12, 2025 08:55
@@ -72,6 +72,7 @@ class ProjectPhaseStarted < Notification

def self.make_notifications_on(activity)
phase = activity.item
return [] unless phase.project.published?
Copy link
Contributor Author

@jamesspeake jamesspeake Feb 18, 2025

Choose a reason for hiding this comment

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

Could have just used unless phase.project.hidden? for this use case but felt there was actually no need to notify on these unless the project was published - draft or archived has no real use

Comment on lines +52 to +57
hidden_project = create(:project, internal_role: 'community_monitor', admin_publication_attributes: { publication_status: 'hidden' })
expect(status).to eq(200)
json_response = json_parse(response_body)
expect(json_response[:data].size).to eq 10
expect(json_response[:data].map { |d| d.dig(:relationships, :publication, :data, :type) }.count('project')).to eq 8
expect(json_response[:data].map { |d| d.dig(:relationships, :publication, :data, :type) }.count('folder')).to eq 2
expect(response_data.size).to eq 10
expect(response_data.map { |d| d.dig(:relationships, :publication, :data, :type) }.count('project')).to eq 8
expect(response_data.map { |d| d.dig(:relationships, :publication, :data, :type) }.count('folder')).to eq 2
expect(response_data.pluck(:id)).not_to include(hidden_project.admin_publication.id)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the only actual test change. The rest of the changes are only changes to use the response_data helper

@jamesspeake jamesspeake changed the title TAN-3815 - Add community monitor project & native survey BE TAN-3815 - Add community monitor survey BE (OLD) Feb 18, 2025
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.

2 participants