<commit_before>class GlobalNavManager
  class Page

    attr_reader :name, :text, :urls, :user

    def initialize(name, text, urls, tab_settings, user)
      @name = name
      @text = text
      @urls = urls.is_a?(Array) ? urls : [urls]
      @tab_settings = tab_settings || {}
      @user = user
    end

    def url
      @urls.first
    end

    def tabs
      @tabs ||= @tab_settings.map do |name, params|
        Tab.new(name, url, finder, params)
      end
    end

    def finder
      @finder ||= CaseFinderService.new(user, name)
    end
  end
end<commit_msg>CT-696 use first tab's url when linking to page that has tabs<commit_after>class GlobalNavManager
  class Page

    attr_reader :name, :text, :urls, :user

    def initialize(name, text, urls, tab_settings, user)
      @name = name
      @text = text
      @urls = urls.is_a?(Array) ? urls : [urls]
      @tab_settings = tab_settings || {}
      @user = user
    end

    def url
      if @tab_settings.empty?
        @urls.first
      else
        tabs.first.url
      end
    end

    def tabs
      @tabs ||= @tab_settings.map do |tab_name, params|
        Tab.new(name, tab_name, @urls.first, finder, params)
      end
    end

    def finder
      @finder ||= CaseFinderService.new(user, name)
    end
  end
end
{'fraction_non_alphanumeric': 0.1057542768273717, 'fraction_numerical': 0.0023328149300155523, 'mean_word_length': 2.2094763092269325, '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': '3002046', 'n_tokens_mistral': 443, 'n_tokens_neox': 433, 'n_words': 122}