Skip to content

Commit

Permalink
HARMONY-1493: Tweak work items page paging
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnyinverso committed Jul 11, 2023
1 parent 589a825 commit a1e1978
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/frontends/workflow-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import { Logger } from 'winston';
import { serviceNames } from '../models/services';
import { getEdlGroupInformation, isAdminUser } from '../util/edl-api';

// Default to retrieving this number of work items per page
const defaultWorkItemPageSize = 100;

/**
* Maps job status to display class.
*/
Expand Down Expand Up @@ -295,7 +298,7 @@ export async function getJob(
try {
const isAdmin = await isAdminUser(req);
const job = await getJobIfAllowed(jobID, req.user, isAdmin, req.accessToken, true);
const { page, limit } = getPagingParams(req, 100);
const { page, limit } = getPagingParams(req, defaultWorkItemPageSize, true);
const requestQuery = keysToLowerCase(req.query);
const fromDateTime = requestQuery.fromdatetime;
const toDateTime = requestQuery.todatetime;
Expand Down Expand Up @@ -452,7 +455,7 @@ export async function getWorkItemsTable(
res.status(204).json({ status: job.status });
return;
}
const { page, limit } = getPagingParams(req, 100);
const { page, limit } = getPagingParams(req, defaultWorkItemPageSize, true);
const requestQuery = keysToLowerCase(req.query);
const { tableQuery } = parseQuery(requestQuery, WorkItemStatus);
const itemQuery = tableQueryToWorkItemQuery(tableQuery, jobID);
Expand Down

0 comments on commit a1e1978

Please sign in to comment.