<commit_before>module CasesHelper

  def accepted_case_attachment_types
    Settings.case_uploads_accepted_types.join ','
  end

  def case_link_with_hash(kase, field, page, position)
    page = 1 if page.blank?
    if position.nil?
      link_to kase.__send__(field), case_path(kase.id)
    else
      position += 1
      page_offset = Kaminari.config[:default_per_page] * (page.to_i - 1)
      link_to kase.__send__(field), case_path(kase.id, pos: page_offset + position)
    end

  end

  #rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength
  def action_button_for(event)
    case event
    when :assign_responder
      link_to I18n.t('common.case.assign'),
              new_case_assignment_path(@case),
              id: 'action--assign-to-responder',
              class: 'button'
    when :assign_to_new_team
      link_to 'Assign to another team',
              assign_to_new_team_case_assignment_path(@case, @case .responder_assignment),
              id: 'action--assign-new-team',
              class: 'button'
    when :add_responses, :add_response_to_flagged_case
      link_to t('common.case.upload_response'),
              new_response_upload_case_path(@case, 'mode' => determine_action),
              id: 'action--upload-response',
              class: 'button'
    when :respond
      link_to t('common.case.respond'),
              respond_case_path(@case),
              id: 'action--mark-response-as-sent',
              class: 'button'<commit_msg>dependabot - kaminari: update for new API<commit_after>module CasesHelper

  def accepted_case_attachment_types
    Settings.case_uploads_accepted_types.join ','
  end

  def case_link_with_hash(kase, field, page, position)
    page = 1 if page.blank?
    if position.nil?
      link_to kase.__send__(field), case_path(kase.id)
    else
      position += 1
      page_offset = Kaminari.config.default_per_page * (page.to_i - 1)
      link_to kase.__send__(field), case_path(kase.id, pos: page_offset + position)
    end

  end

  #rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength
  def action_button_for(event)
    case event
    when :assign_responder
      link_to I18n.t('common.case.assign'),
              new_case_assignment_path(@case),
              id: 'action--assign-to-responder',
              class: 'button'
    when :assign_to_new_team
      link_to 'Assign to another team',
              assign_to_new_team_case_assignment_path(@case, @case .responder_assignment),
              id: 'action--assign-new-team',
              class: 'button'
    when :add_responses, :add_response_to_flagged_case
      link_to t('common.case.upload_response'),
              new_response_upload_case_path(@case, 'mode' => determine_action),
              id: 'action--upload-response',
              class: 'button'
    when :respond
      link_to t('common.case.respond'),
              respond_case_path(@case),
              id: 'action--mark-response-as-sent',
              class: 'button'
{'fraction_non_alphanumeric': 0.10206804536357572, 'fraction_numerical': 0.00333555703802535, 'mean_word_length': 2.6888068880688807, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4197878', 'n_tokens_mistral': 953, 'n_tokens_neox': 928, 'n_words': 176}