Class: Crm::QuickSearchResultCardComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Crm::QuickSearchResultCardComponent
- Includes:
- ActionView::Helpers::TagHelper, ActionView::Helpers::UrlHelper
- Defined in:
- app/components/crm/quick_search_result_card_component.rb
Overview
Renders a quick search result card with profile image support.
Works with QuickSearch::*Presenter classes - accepts presenter data via as_json.
Constant Summary collapse
- RESULT_CLASS_ICONS =
{ contact: 'address-card', customer: 'user-friends', supplier: 'warehouse', publication: 'book', opportunity: 'business-time', item: 'box-full', catalog_item: 'box-full', room_configuration: 'ruler-triangle', quote: 'ruler-combined', shipment: 'pallet', order: 'box-usd', invoice: 'file-invoice-dollar', support_case: 'user-headset', rma: 'hand-holding-box', history: 'clock-rotate-left', credit_memo: 'file-invoice-dollar', delivery: 'truck', voucher: 'ticket', purchase_order: 'clipboard-list', activity: 'calendar-check', address: 'map-marker-alt', email_preference: 'envelope-open-text', contact_point: 'phone' }.freeze
Instance Method Summary collapse
-
#initialize(title:, url:, result_class:, sub_header: nil, text_sub_header: nil, type_label: nil, ref: nil, profile_image_url: nil) ⇒ QuickSearchResultCardComponent
constructor
Initialize with presenter data (from as_json) or direct attributes.
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(title:, url:, result_class:, sub_header: nil, text_sub_header: nil, type_label: nil, ref: nil, profile_image_url: nil) ⇒ QuickSearchResultCardComponent
Initialize with presenter data (from as_json) or direct attributes
61 62 63 64 65 66 67 68 69 70 71 |
# File 'app/components/crm/quick_search_result_card_component.rb', line 61 def initialize(title:, url:, result_class:, sub_header: nil, text_sub_header: nil, type_label: nil, ref: nil, profile_image_url: nil) super() @title = title @sub_header = sub_header @text_sub_header = text_sub_header @url = url @result_class = result_class&.to_sym @type_label_override = type_label @ref = ref @profile_image_url = profile_image_url end |