Class: Crm::DailyFocusSummaryComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Crm::DailyFocusSummaryComponent
- Defined in:
- app/components/crm/daily_focus_summary_component.rb
Overview
ViewComponent: renders the daily focus summary block.
Instance Attribute Summary collapse
-
#approved_count ⇒ Integer
readonly
Reps approved for the day.
-
#audience ⇒ Object
readonly
Returns the value of attribute audience.
-
#missing_count ⇒ Integer
readonly
Reps with no daily focus submitted.
-
#pending_count ⇒ Integer
readonly
Reps awaiting review.
-
#processing_count ⇒ Integer
readonly
Reps whose daily focus is still being processed.
Instance Method Summary collapse
-
#frame_id ⇒ String
CrmHelper#panel wraps a lazy body in
frame-<panel id>, and the dashboard now renders one panel per audience. -
#initialize(pending_count:, approved_count:, missing_count:, processing_count: 0, audience: 'sales') ⇒ DailyFocusSummaryComponent
constructor
A new instance of DailyFocusSummaryComponent.
Methods inherited from ApplicationComponent
#cms_link, #fetch_or_fallback, #image_asset_tag, #image_tag, #number_to_currency, #number_with_delimiter, #post_path, #post_url, #strip_tags
Constructor Details
#initialize(pending_count:, approved_count:, missing_count:, processing_count: 0, audience: 'sales') ⇒ DailyFocusSummaryComponent
Returns a new instance of DailyFocusSummaryComponent.
11 12 13 14 15 16 17 18 |
# File 'app/components/crm/daily_focus_summary_component.rb', line 11 def initialize(pending_count:, approved_count:, missing_count:, processing_count: 0, audience: 'sales') super() @processing_count = processing_count @pending_count = pending_count @approved_count = approved_count @missing_count = missing_count @audience = audience end |
Instance Attribute Details
#approved_count ⇒ Integer (readonly)
Returns reps approved for the day.
30 |
# File 'app/components/crm/daily_focus_summary_component.rb', line 30 attr_reader :processing_count, :pending_count, :approved_count, :missing_count, :audience |
#audience ⇒ Object (readonly)
Returns the value of attribute audience.
30 |
# File 'app/components/crm/daily_focus_summary_component.rb', line 30 attr_reader :processing_count, :pending_count, :approved_count, :missing_count, :audience |
#missing_count ⇒ Integer (readonly)
Returns reps with no daily focus submitted.
30 |
# File 'app/components/crm/daily_focus_summary_component.rb', line 30 attr_reader :processing_count, :pending_count, :approved_count, :missing_count, :audience |
#pending_count ⇒ Integer (readonly)
Returns reps awaiting review.
30 |
# File 'app/components/crm/daily_focus_summary_component.rb', line 30 attr_reader :processing_count, :pending_count, :approved_count, :missing_count, :audience |
#processing_count ⇒ Integer (readonly)
Returns reps whose daily focus is still being processed.
30 31 32 |
# File 'app/components/crm/daily_focus_summary_component.rb', line 30 def processing_count @processing_count end |
Instance Method Details
#frame_id ⇒ String
CrmHelper#panel wraps a lazy body in frame-<panel id>, and the dashboard
now renders one panel per audience. The response has to carry the SAME id
or Turbo finds no matching frame and falls back to a full-page navigation —
which is what a hardcoded frame-panel-daily-focus-review did to both
cards the moment they were split.
39 40 41 |
# File 'app/components/crm/daily_focus_summary_component.rb', line 39 def frame_id "frame-panel-daily-focus-review-#{audience}" end |