<commit_before>module Admin::ResourcesHelper

  def admin_search(resource = @resource, params = self.params)
    if (typus_search = resource.typus_defaults_for(:search)) && typus_search.any?

      hidden_filters = params.dup
      rejections = %w(controller action locale utf8 sort_order order_by search page)
      hidden_filters.delete_if { |k, _| rejections.include?(k) }

      render 'helpers/admin/resources/search', hidden_filters: hidden_filters
    end
  end

  def build_sidebar
    app_name = @resource.typus_application
    resources = admin_user.application(app_name).map(&:constantize).delete_if { |k| k.typus_options_for(:hide_from_sidebar) }

    if resources.any?
      render 'helpers/admin/resources/sidebar', resources: resources
    else
      render 'admin/dashboard/sidebar'
    end
  end

end<commit_msg>bugfix: 'id' parameter take over to next page's and pollute searh result.<commit_after>module Admin::ResourcesHelper

  def admin_search(resource = @resource, params = self.params)
    if (typus_search = resource.typus_defaults_for(:search)) && typus_search.any?

      hidden_filters = params.dup
      rejections = %w(id controller action locale utf8 sort_order order_by search page)
      hidden_filters.delete_if { |k, _| rejections.include?(k) }

      render 'helpers/admin/resources/search', hidden_filters: hidden_filters
    end
  end

  def build_sidebar
    app_name = @resource.typus_application
    resources = admin_user.application(app_name).map(&:constantize).delete_if { |k| k.typus_options_for(:hide_from_sidebar) }

    if resources.any?
      render 'helpers/admin/resources/sidebar', resources: resources
    else
      render 'admin/dashboard/sidebar'
    end
  end

end
{'fraction_non_alphanumeric': 0.09587449157466589, 'fraction_numerical': 0.0011621150493898896, 'mean_word_length': 4.125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5756305', 'n_tokens_mistral': 519, 'n_tokens_neox': 515, 'n_words': 113}