-
Notifications
You must be signed in to change notification settings - Fork 33
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
base: master
Are you sure you want to change the base?
Conversation
|
There was a problem hiding this comment.
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
@@ -72,6 +72,7 @@ class ProjectPhaseStarted < Notification | |||
|
|||
def self.make_notifications_on(activity) | |||
phase = activity.item | |||
return [] unless phase.project.published? |
There was a problem hiding this comment.
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
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) |
There was a problem hiding this comment.
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
Changes in a nutshell:
internal_role: 'community_monitor
on project andpublication_status: hidden
on admin publicationnative_survey
phase on this project with new attributenative_survey_method
which will work in a similar way to voting_method to make the small tweaks to the participation method we needcommunity_monitor
which also stores the project ID for this projectChangelog
Technical