diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 00:08:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 00:08:35 +0300 |
commit | 93003eb1155fdc2ce078fa03c74d7f15e83a80de (patch) | |
tree | 31c2dbc649c83c1979fc5f2493c4c31ea9d22182 /app/assets/javascripts/issues | |
parent | 1038f06b8654472558735796de54647888dabec4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/issues')
-rw-r--r-- | app/assets/javascripts/issues/list/components/issues_list_app.vue | 15 | ||||
-rw-r--r-- | app/assets/javascripts/issues/list/constants.js | 10 | ||||
-rw-r--r-- | app/assets/javascripts/issues/list/utils.js | 11 |
3 files changed, 22 insertions, 14 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 04b444c5f26..a532fa5b771 100644 --- a/app/assets/javascripts/issues/list/components/issues_list_app.vue +++ b/app/assets/javascripts/issues/list/components/issues_list_app.vue @@ -42,6 +42,8 @@ import { ISSUE_REFERENCE, MAX_LIST_SIZE, PAGE_SIZE, + PARAM_PAGE_AFTER, + PARAM_PAGE_BEFORE, PARAM_STATE, RELATIVE_POSITION_ASC, TOKEN_TYPE_ASSIGNEE, @@ -135,6 +137,8 @@ export default { }, }, data() { + const pageAfter = getParameterByName(PARAM_PAGE_AFTER); + const pageBefore = getParameterByName(PARAM_PAGE_BEFORE); const state = getParameterByName(PARAM_STATE); const defaultSortKey = state === IssuableStates.Closed ? UPDATED_DESC : CREATED_DESC; const dashboardSortKey = getSortKey(this.initialSort); @@ -166,7 +170,7 @@ export default { issuesCounts: {}, issuesError: null, pageInfo: {}, - pageParams: getInitialPageParams(sortKey), + pageParams: getInitialPageParams(sortKey, pageAfter, pageBefore), showBulkEditSidebar: false, sortKey, state: state || IssuableStates.Opened, @@ -237,7 +241,12 @@ export default { return this.isProject ? ITEM_TYPE.PROJECT : ITEM_TYPE.GROUP; }, hasSearch() { - return this.searchQuery || Object.keys(this.urlFilterParams).length; + return ( + this.searchQuery || + Object.keys(this.urlFilterParams).length || + this.pageParams.afterCursor || + this.pageParams.beforeCursor + ); }, isBulkEditButtonDisabled() { return this.showBulkEditSidebar || !this.issues.length; @@ -394,6 +403,8 @@ export default { }, urlParams() { return { + page_after: this.pageParams.afterCursor, + page_before: this.pageParams.beforeCursor, search: this.searchQuery, sort: urlSortParams[this.sortKey], state: this.state, diff --git a/app/assets/javascripts/issues/list/constants.js b/app/assets/javascripts/issues/list/constants.js index f7b4da963ab..4b07a078512 100644 --- a/app/assets/javascripts/issues/list/constants.js +++ b/app/assets/javascripts/issues/list/constants.js @@ -56,17 +56,11 @@ export const ISSUE_REFERENCE = /^#\d+$/; export const MAX_LIST_SIZE = 10; export const PAGE_SIZE = 20; export const PAGE_SIZE_MANUAL = 100; +export const PARAM_PAGE_AFTER = 'page_after'; +export const PARAM_PAGE_BEFORE = 'page_before'; export const PARAM_STATE = 'state'; export const RELATIVE_POSITION = 'relative_position'; -export const defaultPageSizeParams = { - firstPageSize: PAGE_SIZE, -}; - -export const largePageSizeParams = { - firstPageSize: PAGE_SIZE_MANUAL, -}; - export const BLOCKING_ISSUES_ASC = 'BLOCKING_ISSUES_ASC'; export const BLOCKING_ISSUES_DESC = 'BLOCKING_ISSUES_DESC'; export const CREATED_ASC = 'CREATED_ASC'; diff --git a/app/assets/javascripts/issues/list/utils.js b/app/assets/javascripts/issues/list/utils.js index 6322968b3f0..4b77bd9bc5f 100644 --- a/app/assets/javascripts/issues/list/utils.js +++ b/app/assets/javascripts/issues/list/utils.js @@ -10,16 +10,16 @@ import { BLOCKING_ISSUES_DESC, CREATED_ASC, CREATED_DESC, - defaultPageSizeParams, DUE_DATE_ASC, DUE_DATE_DESC, filters, LABEL_PRIORITY_ASC, LABEL_PRIORITY_DESC, - largePageSizeParams, MILESTONE_DUE_ASC, MILESTONE_DUE_DESC, NORMAL_FILTER, + PAGE_SIZE, + PAGE_SIZE_MANUAL, POPULARITY_ASC, POPULARITY_DESC, PRIORITY_ASC, @@ -43,8 +43,11 @@ import { WEIGHT_DESC, } from './constants'; -export const getInitialPageParams = (sortKey) => - sortKey === RELATIVE_POSITION_ASC ? largePageSizeParams : defaultPageSizeParams; +export const getInitialPageParams = (sortKey, afterCursor, beforeCursor) => ({ + firstPageSize: sortKey === RELATIVE_POSITION_ASC ? PAGE_SIZE_MANUAL : PAGE_SIZE, + afterCursor, + beforeCursor, +}); export const getSortKey = (sort) => Object.keys(urlSortParams).find((key) => urlSortParams[key] === sort); |