diff options
Diffstat (limited to 'app/assets/javascripts/issues')
-rw-r--r-- | app/assets/javascripts/issues/list/components/issues_list_app.vue | 19 | ||||
-rw-r--r-- | app/assets/javascripts/issues/list/constants.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/issues/list/utils.js | 11 |
3 files changed, 27 insertions, 5 deletions
diff --git a/app/assets/javascripts/issues/list/components/issues_list_app.vue b/app/assets/javascripts/issues/list/components/issues_list_app.vue index b81ab103271..9d8b339e813 100644 --- a/app/assets/javascripts/issues/list/components/issues_list_app.vue +++ b/app/assets/javascripts/issues/list/components/issues_list_app.vue @@ -23,6 +23,7 @@ import CsvImportExportButtons from '~/issuable/components/csv_import_export_butt import IssuableByEmail from '~/issuable/components/issuable_by_email.vue'; import { IssuableStatus } from '~/issues/constants'; import axios from '~/lib/utils/axios_utils'; +import { isPositiveInteger } from '~/lib/utils/number_utils'; import { scrollUp } from '~/lib/utils/scroll_utils'; import { getParameterByName, joinPaths } from '~/lib/utils/url_utility'; import { @@ -45,6 +46,8 @@ import { ISSUE_REFERENCE, MAX_LIST_SIZE, PAGE_SIZE, + PARAM_FIRST_PAGE_SIZE, + PARAM_LAST_PAGE_SIZE, PARAM_PAGE_AFTER, PARAM_PAGE_BEFORE, PARAM_SORT, @@ -390,12 +393,14 @@ export default { }, urlParams() { return { - page_after: this.pageParams.afterCursor, - page_before: this.pageParams.beforeCursor, search: this.searchQuery, sort: urlSortParams[this.sortKey], state: this.state, ...this.urlFilterParams, + first_page_size: this.pageParams.firstPageSize, + last_page_size: this.pageParams.lastPageSize, + page_after: this.pageParams.afterCursor, + page_before: this.pageParams.beforeCursor, }; }, hasCrmParameter() { @@ -632,6 +637,8 @@ export default { this.showBulkEditSidebar = showBulkEditSidebar; }, updateData(sortValue) { + const firstPageSize = getParameterByName(PARAM_FIRST_PAGE_SIZE); + const lastPageSize = getParameterByName(PARAM_LAST_PAGE_SIZE); const pageAfter = getParameterByName(PARAM_PAGE_AFTER); const pageBefore = getParameterByName(PARAM_PAGE_BEFORE); const state = getParameterByName(PARAM_STATE); @@ -660,7 +667,13 @@ export default { this.exportCsvPathWithQuery = this.getExportCsvPathWithQuery(); this.filterTokens = isSearchDisabled ? [] : getFilterTokens(window.location.search); - this.pageParams = getInitialPageParams(sortKey, pageAfter, pageBefore); + this.pageParams = getInitialPageParams( + sortKey, + isPositiveInteger(firstPageSize) ? parseInt(firstPageSize, 10) : undefined, + isPositiveInteger(lastPageSize) ? parseInt(lastPageSize, 10) : undefined, + pageAfter, + pageBefore, + ); this.sortKey = sortKey; this.state = state || IssuableStates.Opened; }, diff --git a/app/assets/javascripts/issues/list/constants.js b/app/assets/javascripts/issues/list/constants.js index 0795df10a7c..c7098d048ad 100644 --- a/app/assets/javascripts/issues/list/constants.js +++ b/app/assets/javascripts/issues/list/constants.js @@ -57,6 +57,8 @@ export const MAX_LIST_SIZE = 10; export const PAGE_SIZE = 20; export const PAGE_SIZE_MANUAL = 100; export const PARAM_ASSIGNEE_ID = 'assignee_id'; +export const PARAM_FIRST_PAGE_SIZE = 'first_page_size'; +export const PARAM_LAST_PAGE_SIZE = 'last_page_size'; export const PARAM_PAGE_AFTER = 'page_after'; export const PARAM_PAGE_BEFORE = 'page_before'; export const PARAM_SORT = 'sort'; diff --git a/app/assets/javascripts/issues/list/utils.js b/app/assets/javascripts/issues/list/utils.js index 3ca93069628..dfdc6e27f0d 100644 --- a/app/assets/javascripts/issues/list/utils.js +++ b/app/assets/javascripts/issues/list/utils.js @@ -46,8 +46,15 @@ import { WEIGHT_DESC, } from './constants'; -export const getInitialPageParams = (sortKey, afterCursor, beforeCursor) => ({ - firstPageSize: sortKey === RELATIVE_POSITION_ASC ? PAGE_SIZE_MANUAL : PAGE_SIZE, +export const getInitialPageParams = ( + sortKey, + firstPageSize = sortKey === RELATIVE_POSITION_ASC ? PAGE_SIZE_MANUAL : PAGE_SIZE, + lastPageSize, + afterCursor, + beforeCursor, +) => ({ + firstPageSize: lastPageSize ? undefined : firstPageSize, + lastPageSize, afterCursor, beforeCursor, }); |