-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Restructure matchmaking.yml * Introduce class to wrap matchmaking config * Add #has_group? to Matchmaking::Config * Refactor CollectGroups * Support size_strategy and config in MatchmakingGroup * Specifies option for PairByFewestEncounters strategy * Add #[] method to matchmaking config class * Introduce strict sizing to genetic strategy * Update slack-ruby-client * Add #complete_as! method to ProtractedMatch * Refactor participant collection to take protractions into account * Add reason to PendingNotification * Save completion_check notifications * Add slack-ruby-block-kit gem * Refactor login message service * Refactor new_match message service * Add body key for slack message locales * Add quest_protraction message service * Refactor tests for slack message building * Handle quest_protraction reason * Refactor logic around sending login link * Refactor SendSlackMessage to support block kit * Add faraday gem explicitly * Use match id for action_id * Create initial protracted match for quests * Add protract! method and delegates * Add SendResponseMessage service for slack hooks * Add HandleInteraction service * Add interaction endpoint * Add way to run a single group * Update a message text * Enable quest group
- Loading branch information
Showing
66 changed files
with
1,460 additions
and
463 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module Slack | ||
class InteractionController < SlashCommandController | ||
def handle | ||
if block_actions? | ||
Slack::HandleInteraction.new(payload).call | ||
end | ||
|
||
head :ok | ||
end | ||
|
||
private | ||
|
||
def payload | ||
@payload ||= JSON.parse(params[:payload]) | ||
end | ||
|
||
def block_actions? | ||
payload["type"] == "block_actions" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class ProtractedMatch < ApplicationRecord | ||
belongs_to :historical_match | ||
|
||
validates :historical_match, presence: true | ||
validates :completed_by, :completed_at, presence: true, if: -> { completed_at.present? || completed_by.present? } | ||
|
||
def complete!(completed_by) | ||
update!(completed_by: completed_by, completed_at: Time.zone.now) | ||
end | ||
|
||
def protract!(protracted_by) | ||
update!(last_protracted_by: protracted_by) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.