-
Notifications
You must be signed in to change notification settings - Fork 136
fixed #1352 taking constant for project listing chunk size. #1429
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
Conversation
src/api/projects.js
Outdated
| import _ from 'lodash' | ||
| import { axiosInstance as axios } from './requestInterceptor' | ||
| import { TC_API_URL } from '../config/constants' | ||
| import { TC_API_URL, PROJECT_LIST_CHUNK } from '../config/constants' |
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.
I would prefer PROJECT_LIST_PAGE_SIZE and for now we can use the same constant for card view page size.
vikasrohit
left a comment
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.
@sachin-maheshwari I guess src/api/projects.js is not the only place where we are using magic number 20 for page size. I saw it some other places as well e.g. https://github.com/appirio-tech/connect-app/blob/dev/src/projects/list/components/Projects/ProjectsGridView.jsx#L191 and https://github.com/appirio-tech/connect-app/blob/dev/src/projects/list/components/Projects/ProjectsCardView.jsx#L44. Can you please check other possible areas as well where we might be hard coding the page size?
|
@vikasrohit , sure..I'll check and make changes accordingly. I observed some abnormal behavior of corresponding back-end API, which is giving maximum 20 results . If it is known behavior, need to tune in front-end according - otherwise pagination functionality at front-end will be broken for value PROJECT_LIST_PAGE_SIZE > 20 (as we are using same constant in offset). https://api.topcoder-dev.com/v4/projects/?limit=50&offset=0&fields=id,name,description,members,status,type,actualPrice,estimatedPrice,createdAt,updatedAt,details&sort=updatedAt+desc |
|
Yes 20 is the max page size that any one can pass to the API. I don't think that has any effect front end except that we should never set page size > 20. So, you can add comment to the newly introduced constant about the same. |
|
LGTM 👍 |
No description provided.