Class: Integrations::SlackInteractions::IncidentManagement::IncidentModalOpenedService
- Inherits:
-
Object
- Object
- Integrations::SlackInteractions::IncidentManagement::IncidentModalOpenedService
- Defined in:
- app/services/integrations/slack_interactions/incident_management/incident_modal_opened_service.rb
Constant Summary collapse
- MAX_PROJECTS =
100
- CACHE_EXPIRES_IN =
5.minutes
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(slack_installation, current_user, params) ⇒ IncidentModalOpenedService
constructor
A new instance of IncidentModalOpenedService.
Constructor Details
#initialize(slack_installation, current_user, params) ⇒ IncidentModalOpenedService
Returns a new instance of IncidentModalOpenedService.
10 11 12 13 14 15 16 |
# File 'app/services/integrations/slack_interactions/incident_management/incident_modal_opened_service.rb', line 10 def initialize(slack_installation, current_user, params) @slack_installation = slack_installation @current_user = current_user @team_id = params[:team_id] @response_url = params[:response_url] @trigger_id = params[:trigger_id] end |
Class Method Details
.cache_read(view_id) ⇒ Object
30 31 32 |
# File 'app/services/integrations/slack_interactions/incident_management/incident_modal_opened_service.rb', line 30 def self.cache_read(view_id) Rails.cache.read(cache_build_key(view_id)) end |
.cache_write(view_id, project_id) ⇒ Object
26 27 28 |
# File 'app/services/integrations/slack_interactions/incident_management/incident_modal_opened_service.rb', line 26 def self.cache_write(view_id, project_id) Rails.cache.write(cache_build_key(view_id), project_id, expires_in: CACHE_EXPIRES_IN) end |
Instance Method Details
#execute ⇒ Object
18 19 20 21 22 23 24 |
# File 'app/services/integrations/slack_interactions/incident_management/incident_modal_opened_service.rb', line 18 def execute if user_projects.empty? return ServiceResponse.error(message: _('You do not have access to any projects for creating incidents.')) end post_modal end |