Skip to content

"All Packages" table retreives all packages in the set, provides pagination and sorting#13

Open
minghao912 wants to merge 3 commits intomasterfrom
ming/list-all-packages
Open

"All Packages" table retreives all packages in the set, provides pagination and sorting#13
minghao912 wants to merge 3 commits intomasterfrom
ming/list-all-packages

Conversation

@minghao912
Copy link
Copy Markdown
Contributor

No description provided.

@minghao912 minghao912 self-assigned this Mar 8, 2022
@minghao912 minghao912 requested a review from changyang-liu March 8, 2022 05:48
Comment thread src/pages/HomePage.tsx Outdated
}

fetchPackages = async (pages?: number, ascending?: boolean) => {
if (pages == undefined)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

===


// Fetch new packages when either page or sorting order changes
useEffect(() => {
if (sortOrder == 'ascend')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use === to avoid bugs. Change the rest as well

@@ -41,11 +41,17 @@ export class ModelOperations {
async getPackages(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still partial to adding a search feature since it's quite hard to find a package that has a specific name that's in the middle of the pages. It doesn't have to update the page dynamically, just make a request when the user presses "search"

];

// Configure pagination
const paginationConfig = {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add something that allows you to change the page size, like we have in gallery maker? This is something that's built into antd. I feel like it will make it easier to browse the table if it's really big

];

// Configure pagination
const paginationConfig = {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think pagination is a bit slow for my liking. The main problem is that there's no visual indication that the page is loading when you click a different number. We could go about this two different ways:

  1. Make pagination faster (maybe with caching or maybe optimizing the query)
  2. Give a visual indication that the page is loading when the user goes to a different page

Comment thread src/pages/HomePage.tsx Outdated
packageSetSize: this.state.totalPackagesInSet
} as PackageSetInfo;

{/*
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nitpick, but I don' think the braces need to surround the comment. Also, could you line break this block so it fits into one page? (Both the comment and the AllPackagesTable)

Comment thread src/pages/HomePage.tsx
}

export default Homepage;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not great to have this here, unless we're going to work this immediately after. If you don't foresee working on this anytime soon, we can move it into a new branch

Comment thread package.json
"dependencies": {
"@types/lodash": "^4.14.121",
"@types/luxon": "^1.26.5",
"@types/lodash": "^4.14.175",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious why you updated the dependency versions? Nothing wrong with it just wondering if there was anything wrong with the previous versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants