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

Add preferred contact mode for teams/committees #9333

Merged
merged 3 commits into from
May 3, 2024

Conversation

danieljames-dj
Copy link
Member

Currently the email IDs of all the teams/committees are exposed. There can be some teams/committees who prefers not to show their email address instead allow to contact only via contact form. Then there can be some other teams/committees who prefers not to have their email ID in public. To accommodate all their needs, added a column in groups_metadata_teams_committees.

@@ -3,6 +3,12 @@
class GroupsMetadataTeamsCommittees < ApplicationRecord
has_one :user_group, as: :metadata

enum :preferred_contact_mode, {
no_public_way: "no_public_way",
Copy link
Member

Choose a reason for hiding this comment

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

Naming choice here feels a bit odd. What about private?

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to no_contact as per discussion.

Comment on lines 12 to 15
if (group.metadata.friendly_id === 'wrt') {
return contactRecipientUrl('results_team');
}
return contactRecipientUrl('communications_team');
Copy link
Member

Choose a reason for hiding this comment

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

Lots of hard-coded strings. At the very least, the references to results_team and communications_team should be exposed through some ContactForm constants.

Ideally, this would use the new "preferred contact mode" feature like so: (pseudo-code)

if (group.metadata.preferred_contact_mode === 'private') { // perhaps store string as constant somewhere
  return contactRecipientUrl(group.metadata.friendly_id);
}
return contactRecipientUrl(someFallback);

The parameter to pass to contactRecipientUrl is a bit tricky here, because we generally use friendly IDs for T/Cs but the contact form expects humanized values instead (might be worth changing this?!)
Also not sure what fallback should be or whether we even need it. If a T/C set their preferred communication mode to private, they should definitely have a corresponding contact form recipient. So there really shouldn't be the case where we even need a fallback.

Copy link
Member Author

Choose a reason for hiding this comment

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

Now I'm thinking should I change the contact recipient to friendly ID, because it's safer to do this now than later. What do you think?

@@ -788,7 +789,7 @@ en:
wac: "The WAC is responsible for maintaining feedback and communication between the WCA Community and the WCA Staff. They maintain the WCA Forums and summarize surveys and attempt to increase reach across the worldwide community."
contacts:
title: "WCA Contact Form"
faq_note_html: 'Before making an inquiry, you may wish to take a look at our <a href="/faq">Frequently Asked Questions</a>! If you wish to contact a specific committee or team not listed here, you can find their contact information on <a href="/teams-committees-councils">this page</a>.'
faq_note_html: 'Before making an inquiry, you may wish to take a look at our <a href="/faq">Frequently Asked Questions</a>! If you wish to contact a specific committee or team not listed here, you can find their contact information on <a href="/teams-committees-councils">this page</a> (Some committee/team might have also opted out from contacting, you will not be able to contact them).'
Copy link
Member

Choose a reason for hiding this comment

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

This extra snippet of text should appear on the T/C overview page directly. Perhaps you can change the previously existing "you can find their contact information on" to something like "you can contact them on this page", which still holds true even with email opt-out (we don't guarantee that you will be able to contact them via email, but if they opt out you will still be able to ultimately contact them via the form)

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually the thing is there are cases like WCAT where they don't want public to contact them in any way. I've changed it to another way, does it look good now?

change_column_default :groups_metadata_teams_committees, :preferred_contact_mode, GroupsMetadataTeamsCommittees.preferred_contact_modes[:email]
UserGroup.teams_committees_group_wrt.metadata.update!(preferred_contact_mode: GroupsMetadataTeamsCommittees.preferred_contact_modes[:contact_form])
UserGroup.teams_committees_group_wct.metadata.update!(preferred_contact_mode: GroupsMetadataTeamsCommittees.preferred_contact_modes[:contact_form])
UserGroup.teams_committees_group_wcat.metadata.update!(preferred_contact_mode: GroupsMetadataTeamsCommittees.preferred_contact_modes[:no_public_way])
Copy link
Member

Choose a reason for hiding this comment

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

Follow-up change if you rename the constant as per my other comment above

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed.

@danieljames-dj danieljames-dj merged commit 281e778 into thewca:main May 3, 2024
1 check passed
@danieljames-dj danieljames-dj deleted the preferred_contact_mode branch May 3, 2024 09:26
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.

None yet

2 participants