Commit f175fb22 authored by Marvin Karegyeya's avatar Marvin Karegyeya Committed by Kushal Pandya

Remove nextpage function logic from list model

parent 7843e90b
/* eslint-disable no-underscore-dangle, class-methods-use-this, consistent-return */
/* eslint-disable no-underscore-dangle, class-methods-use-this */
import ListIssue from 'ee_else_ce/boards/models/issue';
import { __ } from '~/locale';
......@@ -8,8 +8,6 @@ import flash from '~/flash';
import boardsStore from '../stores/boards_store';
import ListMilestone from './milestone';
const PER_PAGE = 20;
const TYPES = {
backlog: {
isPreset: true,
......@@ -91,13 +89,7 @@ class List {
}
nextPage() {
if (this.issuesSize > this.issues.length) {
if (this.issues.length / PER_PAGE >= 1) {
this.page += 1;
}
return this.getIssues(false);
}
return boardsStore.goToNextPage(this);
}
getIssues(emptyIssues = true) {
......
/* eslint-disable no-shadow, no-param-reassign */
/* eslint-disable no-shadow, no-param-reassign,consistent-return */
/* global List */
import $ from 'jquery';
......@@ -22,6 +22,7 @@ import ListLabel from '../models/label';
import ListAssignee from '../models/assignee';
import ListMilestone from '../models/milestone';
const PER_PAGE = 20;
const boardsStore = {
disabled: false,
timeTracking: {
......@@ -137,6 +138,17 @@ const boardsStore = {
findIssueLabel(issue, findLabel) {
return issue.labels.find(label => label.id === findLabel.id);
},
goToNextPage(list) {
if (list.issuesSize > list.issues.length) {
if (list.issues.length / PER_PAGE >= 1) {
list.page += 1;
}
return list.getIssues(false);
}
},
addListIssue(list, issue, listFrom, newIndex) {
let moveBeforeId = null;
let moveAfterId = null;
......
---
title: Remove nextpage function logic from list model
merge_request: 31904
author: nuwe1
type: other
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment