Skip to content

Commit

Permalink
Implement July 2024 Motions changes: Teams, Commitees, Councils (#9759)
Browse files Browse the repository at this point in the history
* Rename WDC to WIC

* Remove WEC, absorb permissions into new WIC

* Introduce WCA Appeals committee

* Retire WAC

* Run migrations

* Make RuboCop happy

* Set archived team end roles to 2024-07-31 per Board feedback

* Introduce WIC as new group rather than renaming WDC

* Implement updated descriptions as per Board feedback

* Add back empty Councils seeds file
  • Loading branch information
gregorbg authored Aug 13, 2024
1 parent 6ac77a7 commit 7a72e48
Show file tree
Hide file tree
Showing 43 changed files with 241 additions and 236 deletions.
4 changes: 2 additions & 2 deletions app/controllers/delegate_reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ def update
:posted,
:wrc_feedback_requested,
:wrc_incidents,
:wdc_feedback_requested,
:wdc_incidents,
:wic_feedback_requested,
:wic_incidents,
)
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def update
end

private def sso_moderator?(user)
UserGroup.council_group_wac.active_users.include?(user)
user.communication_team?
end

def sso_discourse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

class WdcController < ApplicationController
class WicController < ApplicationController
def root
@posts = Post.joins(:post_tags).where('post_tags.tag = ?', "wdc")
@posts = Post.joins(:post_tags).where('post_tags.tag = ?', "wic")
@posts = @posts.order(sticky: :desc, created_at: :desc).includes(:author).page(params[:page])
end
end
1 change: 0 additions & 1 deletion app/jobs/sync_mailing_lists_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def perform
GsuiteMailingLists.sync_group("[email protected]", User.delegate_reports_receivers_emails)

UserGroup.teams_committees.active_groups.each { |team_committee| GsuiteMailingLists.sync_group(team_committee.metadata.email, team_committee.active_users.map(&:email)) }
UserGroup.councils.each { |council| GsuiteMailingLists.sync_group(council.metadata.email, council.active_users.map(&:email)) }

treasurers = UserGroup.officers.flat_map(&:active_roles).filter { |role| role.metadata.status == RolesMetadataOfficers.statuses[:treasurer] }
GsuiteMailingLists.sync_group("[email protected]", treasurers.map(&:user).map(&:email))
Expand Down
2 changes: 1 addition & 1 deletion app/mailers/competitions_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def notify_of_delegate_report_submission(competition)
to: "[email protected]",
cc: competition.delegates.pluck(:email) +
(competition.delegate_report.wrc_feedback_requested ? ["[email protected]"] : []) +
(competition.delegate_report.wdc_feedback_requested ? ["disciplinary@worldcubeassociation.org"] : []),
(competition.delegate_report.wic_feedback_requested ? ["integrity@worldcubeassociation.org"] : []),
reply_to: competition.delegates.pluck(:email),
subject: delegate_report_email_subject(competition),
)
Expand Down
8 changes: 4 additions & 4 deletions app/mailers/role_change_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ def notify_role_start(role, user_who_made_the_change)
when UserGroup.group_types[:banned_competitors]
@to_list.push(
UserRole::UserRoleEmailRecipient.new(
name: 'WDC',
email: UserGroup.teams_committees_group_wdc.metadata.email,
name: 'WIC',
email: UserGroup.teams_committees_group_wic.metadata.email,
message: 'Informing as a competitor is newly banned.',
),
)
Expand Down Expand Up @@ -177,8 +177,8 @@ def notify_role_change(role, user_who_made_the_change, changes)
when UserGroup.group_types[:banned_competitors]
@to_list.push(
UserRole::UserRoleEmailRecipient.new(
name: 'WDC',
email: UserGroup.teams_committees_group_wdc.metadata.email,
name: 'WIC',
email: UserGroup.teams_committees_group_wic.metadata.email,
message: 'Informing as there was a change in banned details of a competitor.',
),
)
Expand Down
2 changes: 1 addition & 1 deletion app/models/delegate_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def incidents_default
validates :discussion_url, presence: true, if: :schedule_and_disussion_urls_required?
validates :discussion_url, url: true
validates :wrc_incidents, presence: true, if: :wrc_feedback_requested
validates :wdc_incidents, presence: true, if: :wdc_feedback_requested
validates :wic_incidents, presence: true, if: :wic_feedback_requested

def schedule_and_disussion_urls_required?
posted? && created_at > Date.new(2019, 7, 21)
Expand Down
2 changes: 1 addition & 1 deletion app/models/groups_metadata_teams_committees.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def cachable_id
self.friendly_id
end

cached_entity :wct, :wcat, :wdc, :wdpc, :wec, :weat, :wfc, :wmt, :wqac, :wrc, :wrt, :wst, :wst_admin, :wct_china, :wat, :wsot
cached_entity :wct, :wcat, :wic, :wdpc, :weat, :wfc, :wmt, :wqac, :wrc, :wrt, :wst, :wst_admin, :wct_china, :wat, :wsot, :wapc

enum :preferred_contact_mode, {
no_contact: "no_contact",
Expand Down
46 changes: 19 additions & 27 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,8 @@ def competition_announcement_team?
group_member?(UserGroup.teams_committees_group_wcat)
end

def wdc_team?
group_member?(UserGroup.teams_committees_group_wdc)
end

def ethics_committee?
group_member?(UserGroup.teams_committees_group_wec)
def wic_team?
group_member?(UserGroup.teams_committees_group_wic)
end

def weat_team?
Expand All @@ -508,6 +504,10 @@ def results_team?
group_member?(UserGroup.teams_committees_group_wrt)
end

def appeals_committee?
group_member?(UserGroup.teams_committees_group_wapc)
end

private def senior_results_team?
at_least_senior_teams_committees_member?(UserGroup.teams_committees_group_wrt)
end
Expand Down Expand Up @@ -598,7 +598,7 @@ def banned_at_date?(date)
end

private def can_view_past_banned_competitors?
wdc_team? || ethics_committee? || board_member? || weat_team? || results_team? || admin?
wic_team? || board_member? || weat_team? || results_team? || admin?
end

private def groups_with_read_access_for_current
Expand Down Expand Up @@ -754,14 +754,8 @@ def self.panel_list
panel_pages[:subordinateUpcomingCompetitions],
],
},
wdc: {
name: 'WDC panel',
pages: [
panel_pages[:bannedCompetitors],
],
},
wec: {
name: 'WEC panel',
wic: {
name: 'WIC panel',
pages: [
panel_pages[:bannedCompetitors],
panel_pages[:downloadVoters],
Expand Down Expand Up @@ -826,7 +820,7 @@ def has_permission?(permission_name, scope = nil)
end

def can_view_all_users?
admin? || board_member? || results_team? || communication_team? || wdc_team? || any_kind_of_delegate? || weat_team? || wrc_team?
admin? || board_member? || results_team? || communication_team? || wic_team? || any_kind_of_delegate? || weat_team? || wrc_team?
end

def can_edit_user?(user)
Expand Down Expand Up @@ -855,7 +849,7 @@ def can_admin_finances?
end

def can_edit_banned_competitors?
can_edit_any_groups? || group_leader?(UserGroup.teams_committees_group_wdc) || group_leader?(UserGroup.teams_committees_group_wec)
can_edit_any_groups? || group_leader?(UserGroup.teams_committees_group_wic)
end

def can_manage_regional_organizations?
Expand All @@ -867,7 +861,7 @@ def can_create_competitions?
end

def can_create_posts?
wdc_team? || wrc_team? || communication_team? || can_announce_competitions?
wic_team? || wrc_team? || communication_team? || can_announce_competitions?
end

def can_upload_images?
Expand All @@ -890,7 +884,7 @@ def can_manage_competition?(competition)
competition.organizers.include?(self) ||
competition.delegates.include?(self) ||
competition.delegates.flat_map(&:senior_delegates).compact.include?(self) ||
ethics_committee?
wic_team?
)
end

Expand Down Expand Up @@ -951,7 +945,7 @@ def can_submit_competition_results?(competition, upload_only: false)
end

def can_create_poll?
admin? || board_member? || wrc_team? || wdc_team? || quality_assurance_committee?
admin? || board_member? || wrc_team? || wic_team? || quality_assurance_committee?
end

def can_vote_in_poll?
Expand All @@ -963,7 +957,7 @@ def can_view_poll?
end

def can_view_delegate_matters?
any_kind_of_delegate? || can_admin_results? || wrc_team? || wdc_team? || quality_assurance_committee? || competition_announcement_team? || weat_team? || communication_team? || ethics_committee? || financial_committee?
any_kind_of_delegate? || can_admin_results? || wrc_team? || wic_team? || quality_assurance_committee? || competition_announcement_team? || weat_team? || communication_team? || financial_committee?
end

def can_manage_incidents?
Expand All @@ -982,7 +976,7 @@ def can_view_delegate_report?(delegate_report)
if delegate_report.posted?
can_view_delegate_matters?
else
can_edit_delegate_report?(delegate_report) || ethics_committee?
can_edit_delegate_report?(delegate_report) || wic_team?
end
end

Expand Down Expand Up @@ -1013,7 +1007,7 @@ def can_approve_media?
end

def can_see_eligible_voters?
can_admin_results? || ethics_committee?
can_admin_results? || wic_team?
end

def get_cannot_delete_competition_reason(competition)
Expand Down Expand Up @@ -1481,10 +1475,8 @@ def can_access_senior_delegate_panel?
active_roles.any? { |role| role.is_lead? && (role.group.teams_committees? || role.group.councils?) }
when :senior_delegate
senior_delegate?
when :wdc
wdc_team?
when :wec
ethics_committee?
when :wic
wic_team?
when :weat
weat_team?
else
Expand Down
16 changes: 6 additions & 10 deletions app/models/user_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,14 @@ def self.teams_committees_group_wcat
GroupsMetadataTeamsCommittees.wcat.user_group
end

def self.teams_committees_group_wdc
GroupsMetadataTeamsCommittees.wdc.user_group
def self.teams_committees_group_wic
GroupsMetadataTeamsCommittees.wic.user_group
end

def self.teams_committees_group_wdpc
GroupsMetadataTeamsCommittees.wdpc.user_group
end

def self.teams_committees_group_wec
GroupsMetadataTeamsCommittees.wec.user_group
end

def self.teams_committees_group_weat
GroupsMetadataTeamsCommittees.weat.user_group
end
Expand All @@ -145,10 +141,6 @@ def self.teams_committees_group_wrt
GroupsMetadataTeamsCommittees.wrt.user_group
end

def self.council_group_wac
GroupsMetadataCouncils.find_by(friendly_id: 'wac').user_group
end

def self.teams_committees_group_wst
GroupsMetadataTeamsCommittees.wst.user_group
end
Expand All @@ -169,6 +161,10 @@ def self.teams_committees_group_wsot
GroupsMetadataTeamsCommittees.wsot.user_group
end

def self.teams_committees_group_wapc
GroupsMetadataTeamsCommittees.wapc.user_group
end

def self.banned_competitors_group
UserGroup.banned_competitors.first
end
Expand Down
4 changes: 2 additions & 2 deletions app/views/delegate_reports/_delegate_report.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
@WRC: Feedback requested on incidents: <%= delegate_report.wrc_incidents %>
</p>
<% end %>
<% if delegate_report.wdc_feedback_requested %>
<% if delegate_report.wic_feedback_requested %>
<p style="color: red; font-weight: bold">
@WDC: Feedback requested on incidents: <%= delegate_report.wdc_incidents %>
@WIC: Feedback requested on incidents: <%= delegate_report.wic_incidents %>
</p>
<% end %>

Expand Down
4 changes: 2 additions & 2 deletions app/views/delegate_reports/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<%= f.input :incidents, input_html: { class: "markdown-editor markdown-editor-image-upload" } %>
<%= f.input :wrc_feedback_requested, as: :boolean %>
<%= f.input :wrc_incidents %>
<%= f.input :wdc_feedback_requested, as: :boolean %>
<%= f.input :wdc_incidents %>
<%= f.input :wic_feedback_requested, as: :boolean %>
<%= f.input :wic_incidents %>
<%= f.input :remarks, input_html: { class: "markdown-editor markdown-editor-image-upload" } %>

<%= f.button :submit, class: "btn-primary" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/_navigation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<li><a href="<%= db_dev_export_path %>"><%= ui_icon('computer') %> <%= t '.db_dev_export' %></a></li>
</ul>
</li>
<li class="dropdown <%= Set['incidents', 'regulations', 'wdc'].include?(params[:controller]) ? 'active' : '' %>">
<li class="dropdown <%= Set['incidents', 'regulations', 'wic'].include?(params[:controller]) ? 'active' : '' %>">
<a href="#" class="dropdown-toggle top-nav" data-toggle="dropdown" data-hover="dropdown">
<%= ui_icon('book') %> <span class="hidden-sm hidden-md"><%= t '.regulations' %></span> <span class="caret"></span>
</a>
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions app/webpacker/lib/markdown-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ $(() => {
$('input#delegate_report_wrc_incidents').prop('disabled', !feedbackRequested);
}).trigger('change');

$('input[name="delegate_report[wdc_feedback_requested]"]').on('change', function toggleInput() {
$('input[name="delegate_report[wic_feedback_requested]"]').on('change', function toggleInput() {
const feedbackRequested = this.checked;
$('div.delegate_report_wdc_incidents').toggle(feedbackRequested);
$('input#delegate_report_wdc_incidents').prop('disabled', !feedbackRequested);
$('div.delegate_report_wic_incidents').toggle(feedbackRequested);
$('input#delegate_report_wic_incidents').prop('disabled', !feedbackRequested);
}).trigger('change');

$('.markdown-editor').each(function toggleInput() {
Expand Down
20 changes: 9 additions & 11 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ en:
incidents: "Incidents"
wrc_feedback_requested: "I would like feedback from the WRC on some of the incidents above."
wrc_incidents: "Incidents Needing WRC Feedback"
wdc_feedback_requested: "I would like feedback from the WDC on some of the incidents above."
wdc_incidents: "Incidents Needing WDC Feedback"
wic_feedback_requested: "I would like feedback from the WIC on some of the incidents above."
wic_incidents: "Incidents Needing WIC Feedback"
remarks: "Remarks"
#context: a person
person:
Expand Down Expand Up @@ -488,8 +488,8 @@ en:
incidents: "Please report all incidents which are non-standard cases. Number the incidents starting from 1., so that other Delegates can comment referring to them by their numbers. Even if everything seemed generic, just list at least the most noteworthy cases. Please check off the appropriate boxes below if you are actively seeking feedback."
wrc_feedback_requested: ""
wrc_incidents: "List of numbers referencing any incidents that you would like the WRC's feedback on."
wdc_feedback_requested: ""
wdc_incidents: "List of numbers referencing any incidents that you would like the WDC's feedback on."
wic_feedback_requested: ""
wic_incidents: "List of numbers referencing any incidents that you would like the WIC's feedback on."
remarks: "Talk about any other detail that you'd like to share (e.g., improvement/regression within the community, future plans for this region). If for the sake of conciseness you left something unsaid in the previous sections, feel free to comment them here."
discussion_url: ""
#context: for a competition tab
Expand Down Expand Up @@ -766,8 +766,7 @@ en:
wat: "WCA Archive Team"
wct: "WCA Communication Team"
wcat: "WCA Competition Announcement Team"
wdc: "WCA Disciplinary Committee"
wec: "WCA Ethics Committee"
wic: "WCA Integrity Committee"
weat: "WCA Executive Assistants Team"
wfc: "WCA Financial Committee"
wmt: "WCA Marketing Team"
Expand All @@ -776,13 +775,12 @@ en:
wrt: "WCA Results Team"
wst: "WCA Software Team"
wsot: "WCA Sports Organization Team"
wac: "WCA Advisory Council"
wapc: "WCA Appeals Committee"
groups_description:
wat: "The WAT is responsible for managing the development and maintenance of the WCA's historical archive. They document key speedcubing events and notable WCA milestones to be presented as part of a broader WCA timeline, to preserve the legacy of the WCA in speedcubing."
wct: "The WCA Communication Team (WCT) has the role to oversee and support communications of the WCA with the Community and the general public. The communication of the WCA should contribute to the Objectives of the WCA and support a general positive culture of friendliness, transparency, inclusiveness, openness, and responsiveness."
wcat: "The WCA Competition Announcement Team (WCAT) has the role to approve and announce WCA Competitions submitted by delegates, and ensure such announcements adhere to WCA quality standards. This team is also responsible for maintaining proper competition submission protocol from documents such as the WCA Competition Requirements Policy. WCAT is NOT responsible for the organization and delegation of individual competitions."
wdc: "The WCA Disciplinary Committee (WDC) performs independent investigations regarding Registered Speedcubers and incidents during WCA Competitions or on official, online WCA platforms. These incidents are alleged violations of the Spirit, Code of Conduct, and/or Regulations of the WCA."
wec: "This committee's role is to ensure that all the procedures followed by the WCA Staff abide by the Code of Ethics, and to perform independent investigations if the conduct of any of these members is not compliant with the Code. The WEC is a confidant for Registered Speedcubers who may report concerns and request an investigation. This committee also functions as the board of appeal if anyone involved disagrees with a decision made by the WCA Disciplinary Committee."
wic: "The WCA Integrity Committee (WIC) performs independent investigations regarding WCA community members and incidents during WCA Competitions or on official, online WCA platforms. These incidents are alleged violations of the Spirit, Code of Conduct, Code of Ethics and/or Regulations of the WCA."
weat: "This team is responsible for carrying out the administrative tasks of the WCA Board of Directors."
wfc: "This committee is responsible for managing the overall finances of the WCA, including budgeting, reporting, analysis, bookkeeping, and tax filings. They also manage the WCA's largest source of income, the WCA Dues System, along with various funding programs that provide support to local communities at different stages of development, including Travel Funding, Equipment Funding, and Regional Organization Support."
wmt: "This team is responsible for developing and managing the WCA Brand, seeking sponsorships, supporting the distribution of WCA Competition Gear, and marketing WCA Merchandise."
Expand All @@ -791,7 +789,7 @@ en:
wrt: "The WRT is responsible for managing all data in the databases of the WCA, most importantly competition results and persons data."
wst: "This team is responsible for managing the WCA's software (website, scramblers, workbooks, admin tools)."
wsot: "This team has the role to oversee and support the recognition of the WCA as an international sports organization."
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."
wapc: "The WCA Appeals Committee (WAC) is responsible for reviewing and resolving appeals regarding decisions made by other WCA Staff. The WAC provides an independent and impartial review process to ensure that decisions are fair, reasonable, and in accordance with WCA policies and regulations."
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 may check their details on <a href="/teams-committees-councils">this page</a>.'
Expand Down Expand Up @@ -1096,7 +1094,7 @@ en:
exceeds_event_limit:
one: "You must register in exactly 1 event."
other: "You must register for between 1 and %{count} events."
banned_html: "You are banned. If you believe this is an error, please contact the <a href='mailto:disciplinary@worldcubeassociation.org' target='_blank'>WDC</a>."
banned_html: "You are banned. If you believe this is an error, please contact the <a href='mailto:integrity@worldcubeassociation.org' target='_blank'>WIC</a>."
undelete_banned: "is a banned competitor and cannot be undeleted"
series_more_than_one_accepted: "You can only be accepted for one Series competition at a time."
can_only_register_for_qualified_events: "You cannot register for events you are not qualified for."
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
get 'organizations' => 'regional_organizations#index'
get 'admin/regional-organizations' => 'regional_organizations#admin'

get 'disciplinary' => 'wdc#root'
get 'disciplinary' => 'wic#root'

get 'contact' => 'contacts#index'
post 'contact' => 'contacts#contact'
Expand Down
Loading

0 comments on commit 7a72e48

Please sign in to comment.