-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
799 admin campaign list loading #816
Conversation
9351504
to
6d5b5fc
Compare
Some notes/thoughts.
|
@schuyler1d so is the suggestion to use |
@schuyler1d doing some research, it looks like we're running a version that has the initial implementation of |
so I'm ++ to skipping the whole fetchMore thing -- just wanted to bring it up. |
…s if statements inside campaign filter check
9798ad5
to
f6dc928
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style nits. no more approval necessary
@@ -3,6 +3,8 @@ import { Campaign, JobRequest, r } from '../models' | |||
|
|||
export function buildCampaignQuery(queryParam, organizationId, campaignsFilter, addFromClause = true) { | |||
let query = queryParam | |||
const resultSize = (campaignsFilter.listSize ? campaignsFilter.listSize : 0) | |||
const pageSize = (campaignsFilter.pageSize ? campaignsFilter.pageSize : 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's default pagesize to something other than 0 -- maybe 10?
If pageSize
is offset' -- then maybe rename to
pageOffset` -- 'pagesize' sounds like it would mean the same thing as listsize/resultsize
@@ -17,6 +19,12 @@ export function buildCampaignQuery(queryParam, organizationId, campaignsFilter, | |||
if ('campaignId' in campaignsFilter) { | |||
query = query.where('campaign.id', parseInt(campaignsFilter.campaignId, 10)) | |||
} | |||
if (resultSize && !pageSize) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's have cleaner conditionals
if (resultSize) {
query = query.limit(resultSize)
}
if (pageSize) {
query = query.offset(pageSize)
}
For #799 - changes initial page load for campaign list to be 25 and then gives options to reveal 10,25,50 and all.