Skip to content
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

feat: Add pagination to data browser #2659

Merged
merged 21 commits into from
Apr 6, 2025

Conversation

dblythy
Copy link
Member

@dblythy dblythy commented Feb 28, 2025

New Pull Request Checklist

Issue Description

Closes: #2571

Approach

TODOs before merging

  • Add tests
  • Add changes to documentation (guides, repository pages, in-code descriptions)

Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title feat: add paging feat: Add paging Feb 28, 2025
Copy link

parse-github-assistant bot commented Feb 28, 2025

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Copy link

uffizzi-cloud bot commented Feb 28, 2025

Uffizzi Ephemeral Environment deployment-61441

⌚ Updated Feb 28, 2025, 14:54 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2659

📄 View Application Logs etc.

What is Uffizzi? Learn more

@dblythy dblythy requested a review from a team March 2, 2025 06:55
@mtrezza mtrezza changed the title feat: Add paging feat: Add paging to data browser Mar 3, 2025
@mtrezza mtrezza changed the title feat: Add paging to data browser feat: Add pagination to data browser Mar 3, 2025
Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Great feature!

  •  There are the vars const MAX_ROWS = 200; and const MAX_ROWS_FETCHED = 200; which set a hard limit to 200 rows. I think these need to be dynamic now that the number of rows per page can be set manually. For example, if we add a new value like 500 to the list of {[10, 20, 50, 100, 200, 500].map((size) , there should be 500 rows rendered. I think query.limit(MAX_ROWS_FETCHED); essentially makes the dashboard fetch 200 rows, but if the rows/page value is lower, less rows get displayed, so the dashboard may be fetching rows that are not even shown?
  •  When clicking on the next / previous button, the data browser should jump to the top. Otherwise, especially when clicking on "next", the user'd have to scroll up to continue seeing data that is sorted by a date for example.
  •  Instead of adding an empty space to the top of the BrowserFooter, add a light gray line and ensure the bar is the same hight as the bottom bar in the menu column on the left. Also reduce size of next/previous buttons.
  •  The number of items per page should be set dashboard wide and remembered across sessions. I assume dashboard already has a data store for that. Let's do this: after install, dashboard has a default rows/page of 100. If the user changes the value, that value is stored in the data store and used as default rows/page value for all newly opened dashboard tabs and sessions. In other words, changing the value in any tab simply sets that value as the new default for all newly opened tabs.
  • Reset current page when changing class or applying filter. For example, currently, when on page 2 and then navigating to a class that has only 1 page, no objects are displayed because page 2 does not exist.
  • Adjust font size

@dblythy
Copy link
Member Author

dblythy commented Mar 4, 2025

What do you mean by

Instead of adding an empty space to the top of the BrowserFooter, add a light gray line and ensure the bar is the same hight as the bottom bar in the menu column on the left. Also reduce size of next/previous buttons.

@mtrezza mtrezza closed this Mar 6, 2025
@mtrezza mtrezza reopened this Mar 6, 2025
Copy link

uffizzi-cloud bot commented Mar 6, 2025

Uffizzi Ephemeral Environment deployment-61596

⌚ Updated Mar 06, 2025, 00:08 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2659

📄 View Application Logs etc.

What is Uffizzi? Learn more

@mtrezza
Copy link
Member

mtrezza commented Mar 6, 2025

I was referring to the height difference between the top edge of the new FooterBar for pagination and the existing menu bar on the left side, see red lines in screenshot. I also meant that there is no visible separation between the new footer bar and the data cells, so maybe add a light gray line for the top corner, or add a light gray background color, see green circle in screenshot

image

Btw, there's also a new issue since the last commits where the pagination buttons are disabled.

@dblythy
Copy link
Member Author

dblythy commented Mar 18, 2025

Btw, there's also a new issue since the last commits where the pagination buttons are disabled.

What do you mean? From my testing they only disable when there isn't enough data

@mtrezza
Copy link
Member

mtrezza commented Mar 18, 2025

Yes, I have observed the buttons disabled even though there was more data. I was able to reproduce the issue several times. Have there been any changes in the recent commits that could have caused this? I haven't observed that when I wrote the previous feedback.

@dblythy
Copy link
Member Author

dblythy commented Mar 18, 2025

Screenshot 2025-03-18 at 8 35 11 pm

If you don't mind, could you possibly provide some replication steps and/or a screenshot? I've been unable to replicate the bug

@mtrezza
Copy link
Member

mtrezza commented Mar 18, 2025

Sure, let me try

@dblythy
Copy link
Member Author

dblythy commented Mar 23, 2025

@mtrezza let me know how you go when you get the chance 😊

@mtrezza
Copy link
Member

mtrezza commented Mar 23, 2025

Sure, I'll take a look in a bit...

@mtrezza mtrezza closed this Mar 23, 2025
@mtrezza mtrezza reopened this Mar 23, 2025
Copy link

uffizzi-cloud bot commented Mar 23, 2025

Uffizzi Ephemeral Environment deployment-62155

⌚ Updated Mar 23, 2025, 14:21 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2659

📄 View Application Logs etc.

What is Uffizzi? Learn more

@mtrezza
Copy link
Member

mtrezza commented Mar 23, 2025

I was able to reproduce.

  1. Open Uffizi
  2. Create class "Test".
  3. Run the following to the JS API console:
    const promises = [];
      for (let i = 0; i<100; i++) {
        const myObj = new Parse.Object('Test');
          for (let f = 0; f<30; f++) {
            myObj.set(`field${f}`, 'Hello World!')
          }
        promises.push(myObj.save());
      }
      await Promise.all(promises);
    
  4. Navigate to "Test" class.
  5. The buttons are disabled, the page values show "1 / 0".

I think that is because the total number of records in the class is also determined to be "0", as shown next to the class name. After refreshing the browser tab, the records counter updates to the correct value and paging works. I understand that the paging is depending on that counter value, that's fine. If the number of total records in a class did not update also before this PR, i.e. the bug was not introduced by this PR, then we can ignore it in this PR.

And could you please fix the merge conflicts?

Screen.Recording.2025-03-23.at.15.56.24.mov

@mtrezza mtrezza closed this Mar 24, 2025
@mtrezza mtrezza reopened this Mar 24, 2025
@mtrezza
Copy link
Member

mtrezza commented Mar 24, 2025

@dblythy could you please fix the lint issues, and when this is ready, could you please request a review?

Copy link

uffizzi-cloud bot commented Mar 24, 2025

Uffizzi Ephemeral Environment deployment-62182

⌚ Updated Mar 24, 2025, 14:18 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2659

📄 View Application Logs etc.

What is Uffizzi? Learn more

@mtrezza mtrezza closed this Mar 27, 2025
@mtrezza mtrezza reopened this Mar 27, 2025
Copy link

uffizzi-cloud bot commented Mar 27, 2025

Uffizzi Ephemeral Environment deployment-62253

⌚ Updated Mar 27, 2025, 01:11 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2659

📄 View Application Logs etc.

What is Uffizzi? Learn more

@dblythy dblythy requested a review from a team March 31, 2025 07:44
@mtrezza mtrezza merged commit a3c8a11 into parse-community:alpha Apr 6, 2025
9 of 10 checks passed
parseplatformorg pushed a commit that referenced this pull request Apr 6, 2025
# [7.1.0-alpha.1](7.0.1-alpha.1...7.1.0-alpha.1) (2025-04-06)

### Features

* Add pagination to data browser ([#2659](#2659)) ([a3c8a11](a3c8a11))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.1.0-alpha.1

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released-alpha Released as alpha version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add page size and current page index to data browser
3 participants