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 a settings per projects and per tables for the pagination and number of rows shown #8360

Closed
wants to merge 13 commits into from

Conversation

gercokim
Copy link

@gercokim gercokim commented Apr 28, 2024

Change Summary

Addresses #7872

  • Added an quick action menu on the base dashboard for users to set a custom pagination limit for all tables in the base
  • Added a setting in the table view for users to set a custom pagination limit for the table.

Change type

  • feat: (new feature for the user, not a new feature for build script)
  • fix: (bug fix for the user, not a fix to a build script)
  • docs: (changes to the documentation)
  • style: (formatting, missing semi colons, etc; no production code change)
  • refactor: (refactoring production code, eg. renaming a variable)
  • test: (adding missing tests, refactoring tests; no production code change)
  • chore: (updating grunt tasks etc; no production code change)

Test/ Verification

Wrote a playwright test for the tabel level pagination limit setting to ensure that changing the pagination limit via the new setting changes the number of rows on a page for a table.

Additional information / screenshots (optional)

Anything for maintainers to be made aware of

Summary by CodeRabbit

  • New Features
    • Introduced a new component for modifying pagination limits, enhancing user control over page sizes.
    • Added functionality for custom page size input in pagination settings.
    • Implemented a dialog for adjusting pagination directly from the interface.
  • Bug Fixes
    • Ensured pagination resets to default when no user input is provided.
  • Tests
    • Added Playwright tests for new pagination features to ensure functionality.
  • Chores
    • Updated .gitignore to exclude venv directory for cleaner project management.

@CLAassistant
Copy link

CLAassistant commented Apr 28, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

coderabbitai bot commented Apr 28, 2024

Walkthrough

Walkthrough

The recent changes focus on enhancing pagination controls throughout the UI and SDK. These updates introduce new features like custom pagination limits, support for Databricks in the API, and additional interfaces for diverse data representations. The modifications aim to improve user interaction and broaden compatibility with various data sources, while also extending the test suite to cover the new pagination functionalities.

Changes

Files Summary of Changes
.gitignore Added venv to ignore list.
.../nc-gui/components.d.ts Added AResult type from ant-design-vue.
.../components/dlg/PaginationLimit.vue Introduced PaginationLimit.vue component for pagination settings.
.../components/nc/Pagination.vue Enhanced pagination logic and UI for custom page sizes.
.../components/project/AllTables.vue Added functionality to open a pagination limit dialog.
nocodb-sdk/src/lib/Api.ts Expanded API to include databricks and new data representation types.
tests/playwright/pages/Dashboard/Grid/index.ts Added methods for pagination limit testing.
tests/playwright/tests/db/features/pagination.spec.ts Added test for changing pagination limits.

Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between ba338d3 and 2a5043f.
Files ignored due to path filters (2)
  • packages/nc-gui/lang/en.json is excluded by !**/*.json
  • pnpm-lock.yaml is excluded by !pnpm-lock.yaml, !**/*.yaml
Files selected for processing (8)
  • .gitignore (1 hunks)
  • packages/nc-gui/components.d.ts (1 hunks)
  • packages/nc-gui/components/dlg/PaginationLimit.vue (1 hunks)
  • packages/nc-gui/components/nc/Pagination.vue (8 hunks)
  • packages/nc-gui/components/project/AllTables.vue (2 hunks)
  • packages/nocodb-sdk/src/lib/Api.ts (7 hunks)
  • tests/playwright/pages/Dashboard/Grid/index.ts (1 hunks)
  • tests/playwright/tests/db/features/pagination.spec.ts (1 hunks)
Files skipped from review as they are similar to previous changes (7)
  • .gitignore
  • packages/nc-gui/components.d.ts
  • packages/nc-gui/components/dlg/PaginationLimit.vue
  • packages/nc-gui/components/nc/Pagination.vue
  • packages/nc-gui/components/project/AllTables.vue
  • tests/playwright/pages/Dashboard/Grid/index.ts
  • tests/playwright/tests/db/features/pagination.spec.ts
Additional comments not posted (5)
packages/nocodb-sdk/src/lib/Api.ts (5)

299-300: Addition of 'databricks' to source types is correct and aligns with the PR's objectives.


2922-2998: New interfaces for Kanban, Gallery, and Calendar column requests, as well as extensions, are well-defined and documented. Consider making critical properties non-optional if applicable to ensure robust data handling.


9905-9906: Addition of 'databricks' to source types within this context is correct.


9967-9967: Correct addition of 'databricks' to the list of client types, expanding database support.


11542-11638: The new methods for managing extensions are well-documented and correctly implement RESTful API principles. Good use of type safety and optional parameters.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Out of diff range and nitpick comments (1)
packages/nc-gui/components/project/AllTables.vue (1)

168-174: Add an accessible label to the button for setting pagination limits to improve accessibility for users who rely on screen readers.

Comment on lines +346 to +347
| 'sqlite3'
| 'databricks';
Copy link
Contributor

Choose a reason for hiding this comment

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

Addition of 'databricks' to the source types is correct. Consider refactoring to avoid defining the same union type in multiple places.

Comment on lines +10013 to +10014
| 'sqlite3'
| 'databricks';
Copy link
Contributor

Choose a reason for hiding this comment

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

Addition of 'databricks' to the client types is correct. Consider refactoring to avoid defining the same union type in multiple places.

Comment on lines +56 to +57
if (!val) {
val = 25
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using a constant for the default page size instead of hardcoding '25' in multiple places. This would make the code cleaner and easier to maintain if the default size needs to be changed in the future.

Comment on lines +40 to +43
// reset to default value if user input is empty
if (!val) {
val = 25
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using a constant for the default page size instead of hardcoding '25' in multiple places. This would make the code cleaner and easier to maintain if the default size needs to be changed in the future.

@dstala
Copy link
Member

dstala commented Apr 29, 2024

@gercokim custom pagination is now supported in development mode already & will be included in our next OSS release

@Perspirator
Copy link

@dstala is custom pagination across base/projects and for selected tables already supported?

@dstala
Copy link
Member

dstala commented Apr 30, 2024

custom pagination would be available in limited page size options (25, 50, 75, 100). this will be configuration at browser level- and will be applied to all base & projects for that user on that browser.

@dstala
Copy link
Member

dstala commented May 6, 2024

Closing this. Pagination limit configuration available in new release. Reopen this PR if you wish to add more details to the submitted feature.

@dstala dstala closed this May 6, 2024
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.

None yet

7 participants