Class: Karafka::Web::Pro::Ui::Controllers::Requests::Params

Inherits:
Ui::Controllers::Requests::Params show all
Defined in:
lib/karafka/web/pro/ui/controllers/requests/params.rb

Overview

Extends the OSS request params with the Pro-only filtering (search) readers, so the filtering query parsing never lives in the shared OSS params.

Instance Method Summary collapse

Methods inherited from Ui::Controllers::Requests::Params

#[], #bool, #current_offset, #current_page, #current_partition, #current_range, #current_search, #current_sort, #fetch, #initialize, #int, #str

Constructor Details

This class inherits a constructor from Karafka::Web::Ui::Controllers::Requests::Params

Instance Method Details

#current_filterString

Returns filtering keyword or empty string when no filtering is requested. Supports both the plain filter=keyword form (keyword filtering) and the field-selectable filter[field]=...&filter[value]=... form (its value part).

Returns:

  • (String)

    filtering keyword or empty string when no filtering is requested. Supports both the plain filter=keyword form (keyword filtering) and the field-selectable filter[field]=...&filter[value]=... form (its value part).



44
45
46
47
48
49
50
# File 'lib/karafka/web/pro/ui/controllers/requests/params.rb', line 44

def current_filter
  @current_filter ||= begin
    filter = @request_params["filter"]

    filter.is_a?(Hash) ? filter["value"].to_s.strip : filter.to_s.strip
  end
end

#current_filter_fieldString

Returns the attribute selected for field-scoped filtering, or empty string when filtering across all allowed attributes (keyword filtering).

Returns:

  • (String)

    the attribute selected for field-scoped filtering, or empty string when filtering across all allowed attributes (keyword filtering)



54
55
56
57
58
59
60
# File 'lib/karafka/web/pro/ui/controllers/requests/params.rb', line 54

def current_filter_field
  @current_filter_field ||= begin
    filter = @request_params["filter"]

    filter.is_a?(Hash) ? filter["field"].to_s.strip : ""
  end
end