diff options
| author | Mike Greiling <mike@pixelcog.com> | 2018-01-31 14:06:25 -0600 |
|---|---|---|
| committer | Mike Greiling <mike@pixelcog.com> | 2018-01-31 14:06:25 -0600 |
| commit | 3a565d5d3a0cc610ea0bd114125606bed6e4dc34 (patch) | |
| tree | 1012e38a6efa6edf2f26b1acf17f94e8e38de6d1 /app/controllers/concerns | |
| parent | e25f383ddc6b867dc4010be10518d79c663d7409 (diff) | |
| parent | 560c93e60efd0ae5a1a6bed68a1ee3e74bf23737 (diff) | |
| download | gitlab-ce-3a565d5d3a0cc610ea0bd114125606bed6e4dc34.tar.gz | |
Merge branch 'master' into pawel/connect_to_prometheus_through_proxy-30480
* master: (119 commits)
[ci skip] Fix example commands to refer to the correct versions
Use axios instead of jquery ajax for setCiStatusFavicon
refactor groups controller to match EE
Fix broken test
Introduce a new QA::Gitlab::Page::Component::Dropzone class
Gitaly Server info for admin panel
Add note about being in the `qa` directory for `bin/qa` to work
Remove N+1 queries with /projects/:project_id/{access_requests,members} API endpoints
Fix not all events being shown in group dashboard
Add support for PreReceiveError in UserMergeBranch RPC
Migrate Git::Repository#delete_refs to Gitaly
Replace $.get in render math with axios
Move mr widget related links into a vue file
Make those files as close as EE to reduce conflicts
Don't assume postgresql in two initializers
Move Repository#can_be_merged? to Gitlab::Git::Repository
Remove brakeman from .codeclimate.yml since it's now covered by the sast CI job
Update Nokogiri to 1.8.2
Ignore conflicts in db/schema.rb in Gitlab::EeCompatCheck
Remove Rugged exception in cache rescue
...
Diffstat (limited to 'app/controllers/concerns')
| -rw-r--r-- | app/controllers/concerns/issuable_collections.rb | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/app/controllers/concerns/issuable_collections.rb b/app/controllers/concerns/issuable_collections.rb index b25e753a5ad..2fa0f98e344 100644 --- a/app/controllers/concerns/issuable_collections.rb +++ b/app/controllers/concerns/issuable_collections.rb @@ -12,11 +12,9 @@ module IssuableCollections # rubocop:disable Gitlab/ModuleWithInstanceVariables def set_issuables_index - @issuables = issuables_collection - @issuables = @issuables.page(params[:page]) - @issuable_meta_data = issuable_meta_data(@issuables, collection_type) - @total_pages = issuable_page_count + @issuables = issuables_collection + set_pagination return if redirect_out_of_range(@total_pages) if params[:label_name].present? @@ -35,14 +33,26 @@ module IssuableCollections @users.push(author) if author end end + + def set_pagination + return if pagination_disabled? + + @issuables = @issuables.page(params[:page]) + @issuable_meta_data = issuable_meta_data(@issuables, collection_type) + @total_pages = issuable_page_count + end # rubocop:enable Gitlab/ModuleWithInstanceVariables + def pagination_disabled? + false + end + def issuables_collection finder.execute.preload(preload_for_collection) end def redirect_out_of_range(total_pages) - return false if total_pages.zero? + return false if total_pages.nil? || total_pages.zero? out_of_range = @issuables.current_page > total_pages # rubocop:disable Gitlab/ModuleWithInstanceVariables |
