Skip to content

Conversation

@longshuicy
Copy link
Member

@longshuicy longshuicy commented Jan 22, 2024

This PR has below features:

  1. Paged model that contains page metadata and data.
  2. Using aggregation and facet to calculate the total counts and paged data.
  3. Change all the PyObjectId to PydanticObjectId due to serialization issue
  4. Refactoring backend response and frontend parsing of the new structured body. e.g.
{
    "metadata": {
        "total_count": 5,
        "skip": 0,
        "limit": 5
    },
    "data": [
        {
            "name": "LatLon",
            "description": "A set of Latitude/Longitude coordinates",
            "created": "2024-01-18T16:21:18.444000",
            ...
        },
  1. Frontend using MUI Pagination component and wired the flipping page logic with backend
  2. For extraction history table, wire the MUI TablePagination component with backend so it now does backend pagination

To Test

Try below frontend view:
- Datasets view /
image

- File view /datasets/{datasetId}
image

- List and search extractors --> Analysis tab under /datasets/{datasetId}
image

- List and search users /manage-users
image

- List and search groups /groups
image

- List and search metadata /metadata-definitions
image

- Extractors and Extractor History pagination /extractions
image

- APIKey pagination /apikeys
image


TODOs

@longshuicy longshuicy linked an issue Jan 22, 2024 that may be closed by this pull request
@longshuicy longshuicy requested review from ddey2, lmarini and tcnichol and removed request for max-zilla January 23, 2024 15:59
longshuicy and others added 14 commits February 2, 2024 09:59
* fix folder pagination

* fix metadata pagination bug

* fix another one

* flipping logic clean up

* frontend pagination is impossible...

* Revert "frontend pagination is impossible..."

This reverts commit 41702ac.

* the view is working

* redux for folder and files

* listing works

* fix query bug

* nested folder correct now

* allow fancy sorting

* fix subfolder and file pagination issue

* remove outdated redux action and states

* black

* adjust file folder per page
* fix folder pagination

* fix metadata pagination bug

* fix another one

* flipping logic clean up

* frontend pagination is impossible...

* Revert "frontend pagination is impossible..."

This reverts commit 41702ac.

* the view is working

* redux for folder and files

* listing works

* fix query bug

* nested folder correct now

* allow fancy sorting

* fix subfolder and file pagination issue

* remove outdated redux action and states

* black

* public endpoint pagination conversion

* public folder paths not working

* fix public folder path

* black

* use utility function to construct page metadata
Copy link
Contributor

@tcnichol tcnichol left a comment

Choose a reason for hiding this comment

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

Checked pagination with files and folders, public and not public. Looks good, marking approved.

@longshuicy longshuicy merged commit 331b943 into main Feb 6, 2024
@longshuicy longshuicy deleted the 872-refactoring-pagination branch February 6, 2024 04:46
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.

Refactoring pagination

4 participants