1. 01 Jun, 2016 1 commit
    • Yorick Peterse's avatar
      Refactor Participable · 580d2501
      Yorick Peterse authored
      There are several changes to this module:
      
      1. The use of an explicit stack in Participable#participants
      2. Proc behaviour has been changed
      3. Batch permissions checking
      
      == Explicit Stack
      
      Participable#participants no longer uses recursion to process "self" and
      all child objects, instead it uses an Array and processes objects in
      breadth-first order. This allows us to for example create a single
      Gitlab::ReferenceExtractor instance and pass this to any Procs. Re-using
      a ReferenceExtractor removes the need for running potentially many SQL
      queries every time a Proc is called on a new object.
      
      == Proc Behaviour Changed
      
      Previously a Proc in Participable was expected to return an Array of
      User instances. This has been changed and instead it's now expected that
      a Proc modifies the Gitlab::ReferenceExtractor passed to it. The return
      value of the Proc is ignored.
      
      == Permissions Checking
      
      The method Participable#participants uses
      Ability.users_that_can_read_project to check if the returned users have
      access to the project of "self" _without_ running multiple SQL queries
      for every user.
      580d2501
  2. 26 May, 2016 8 commits
    • Yorick Peterse's avatar
      Refactor Mentionable · 35e977d6
      Yorick Peterse authored
      Caching is now always enabled when rendering attributes as there's no
      reason to not cache them. The method Mentionable#all_references has also
      been modified to take an optional Gitlab::ReferenceExtractor instance to
      allow other code to create one and re-use it between multiple calls.
      35e977d6
    • Yorick Peterse's avatar
      Added author to various Markdown calls in views · 25c08d11
      Yorick Peterse authored
      This ensures all these calls have an author set, allowing the use of
      "all" mentions where possible.
      25c08d11
    • Yorick Peterse's avatar
      Split Markdown rendering & reference gathering · 86166d28
      Yorick Peterse authored
      This splits the Markdown rendering and reference extraction phases into
      two distinct code bases. The reference extraction phase no longer relies
      on the html-pipeline Gem (and any related code) and allows for
      extracting of references from multiple HTML nodes in a single pass. This
      means that if you want to extract user references from 200 comments you
      no longer need to run 200 times N number of queries, instead only a
      handful of queries may be needed.
      86166d28
    • Yorick Peterse's avatar
      Added Gitlab::Lazy · 94d5416d
      Yorick Peterse authored
      This class can be used to lazy-evaluate blocks of code the first time
      they're called. This can be useful when a method performs a certain
      heavy operation (e.g. a SQL query) that you only want to perform
      whenever the result is used for the first time.
      94d5416d
    • Yorick Peterse's avatar
      Don't modify arguments in CommitRange#initialize · 309ca405
      Yorick Peterse authored
      This method used to call strip! on input strings which will mess with
      the strings if they're re-used or frozen.
      309ca405
    • Jacob Schatz's avatar
      Merge branch 'sidebar-expand-collapse' into 'master' · f2caad24
      Jacob Schatz authored
      Fix right sidebar expand/collapse issue
      
      Fixed branch name of the !4117
      
      
      ------------------
      
      Fixes #15643 
      
      - Fixed a typo in `toggleSidebar` method of `Sidebar` class.
      - Fixed a minor styling issue to fix the sidebar to the top of the page.
      - Added tests for Sidebar.
      
      
      ## Before
      ![before](/uploads/c4efe9a64e0ae35f423302753caa6dfd/sFBwnVEpQB.gif)
      
      ## After
      ![after](/uploads/23e6b80888dae475a385912c8c40bdbd/rerKiYC4dk.gif)
      
      
      See merge request !4292
      f2caad24
    • Fatih Acet's avatar
    • Dmitriy Zaporozhets's avatar
  3. 25 May, 2016 31 commits