Class: Avo::Index::ResourceTableComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Avo::Index::ResourceTableComponent
- Includes:
- ApplicationHelper
- Defined in:
- app/components/avo/index/resource_table_component.rb
Instance Attribute Summary collapse
-
#pagy ⇒ Object
readonly
Returns the value of attribute pagy.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
- #encrypted_query ⇒ Object
-
#initialize(resources: nil, resource: nil, reflection: nil, parent_record: nil, parent_resource: nil, pagy: nil, query: nil, actions: nil) ⇒ ResourceTableComponent
constructor
A new instance of ResourceTableComponent.
Methods included from ApplicationHelper
#a_button, #a_link, #button_classes, #decode_filter_params, #empty_state, #encode_filter_params, #get_model_class, #input_classes, #mount_path, #number_to_social, #render_license_warning, #root_path_without_url, #svg, #white_panel_classes
Methods included from ResourcesHelper
#field_wrapper, #filter_wrapper, #index_field_wrapper, #item_select_all_input, #item_selector_init, #item_selector_input, #resource_grid, #resource_table
Constructor Details
#initialize(resources: nil, resource: nil, reflection: nil, parent_record: nil, parent_resource: nil, pagy: nil, query: nil, actions: nil) ⇒ ResourceTableComponent
Returns a new instance of ResourceTableComponent.
7 8 9 10 11 12 13 14 15 16 |
# File 'app/components/avo/index/resource_table_component.rb', line 7 def initialize(resources: nil, resource: nil, reflection: nil, parent_record: nil, parent_resource: nil, pagy: nil, query: nil, actions: nil) @resources = resources @resource = resource @reflection = reflection @parent_record = parent_record @parent_resource = parent_resource @pagy = pagy @query = query @actions = actions end |
Instance Attribute Details
#pagy ⇒ Object (readonly)
Returns the value of attribute pagy.
5 6 7 |
# File 'app/components/avo/index/resource_table_component.rb', line 5 def pagy @pagy end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
5 6 7 |
# File 'app/components/avo/index/resource_table_component.rb', line 5 def query @query end |
Instance Method Details
#encrypted_query ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/components/avo/index/resource_table_component.rb', line 18 def encrypted_query # TODO: move this to the resource where we can apply the adapter pattern if Module.const_defined?("Ransack::Search") && query.instance_of?(Ransack::Search) @query = @query.result end Avo::Services::EncryptionService.encrypt( message: Marshal.dump(@query), purpose: :select_all ) end |