feat: Custom server page length
SUMMARY
This contribution delivers usability enhancements to the Custom Server Page Length feature in Superset. This upgrade now enables custom input values to persist in the drop-down list. The previous version of this feature posed an inconvenience as any new custom value entered by the user would disappear from the drop-down list when the user moved to a different choice.
The new implementation, however, ensures any custom value entered by the user remains in the drop-down list, thereby enriching user accessibility for frequent inputs. Moreover, the system now auto-arranges the drop-down list every time a new value is included, facilitating easy and efficient navigation.
Additional modifications include introducing a cap on the maximum custom page length value. The cap will be equivalent to either the total rows of data results or a fixed 10k rows in scenarios where the total rows of data exceed 10,000.
BEFORE SCREENSHOTS OR ANIMATED GIF
https://github.com/apache/superset/assets/87610632/d6462d1f-1a74-4505-89f2-bf8f459147c5
AFTER SCREENSHOTS OR ANIMATED GIF
https://github.com/apache/superset/assets/87610632/dbb1d509-5886-4452-a559-4bd465bb6e30
TESTING INSTRUCTIONS
- Navigate to the Charts page
- Choose any dataset
- Choose table chart
- Check the Server Pagination checkbox
- Enter a new value in the selection drop-down list
- Verify that the new input is sticky in the drop-down list
ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in SIP-59)
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
Thanks @aobapirak for the PR. Would you mind adding some tests?
Codecov Report
Attention: Patch coverage is 80.64516% with 6 lines in your changes are missing coverage. Please review.
Project coverage is 67.30%. Comparing base (
c54fbe6) to head (88bc89c). Report is 3 commits behind head on master.
| Files | Patch % | Lines |
|---|---|---|
| ...d/plugins/plugin-chart-table/src/transformProps.ts | 76.19% | 3 Missing and 2 partials :warning: |
| ...tend/plugins/plugin-chart-table/src/TableChart.tsx | 50.00% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #26847 +/- ##
==========================================
- Coverage 69.57% 67.30% -2.28%
==========================================
Files 1905 1907 +2
Lines 74580 74415 -165
Branches 8330 8313 -17
==========================================
- Hits 51892 50086 -1806
- Misses 20638 22280 +1642
+ Partials 2050 2049 -1
| Flag | Coverage Δ | |
|---|---|---|
| hive | ? |
|
| javascript | 57.20% <80.64%> (+0.19%) |
:arrow_up: |
| presto | ? |
|
| unit | ? |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks @aobapirak for the PR. Would you mind adding some tests?
Yes, sure! I will let you know once I'm done.
Ping @john-bodley, could you please review? I have added some tests.
Thanks @aobapirak. Sorry I was out last week and thus wasn't able to respond. I've added a couple of frontend reviewers to your PR.
/testenv up
Thanks for the contribution @aobapirak. Left a couple of comments. Looking forward to @michael-s-molina and @justinpark feedback as well
/testenv up
@aobapirak it seems you might need to update your branch with master in order for me to spin up a test environment for this PR. Would you mind doing that, please?
/testenv up
@geido Ephemeral environment spinning up at http://54.218.80.169:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.