superset icon indicating copy to clipboard operation
superset copied to clipboard

feat: Custom server page length

Open aobapirak opened this issue 1 year ago • 5 comments

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

  1. Navigate to the Charts page
  2. Choose any dataset
  3. Choose table chart
  4. Check the Server Pagination checkbox
  5. Enter a new value in the selection drop-down list
  6. 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

aobapirak avatar Jan 29 '24 10:01 aobapirak

Thanks @aobapirak for the PR. Would you mind adding some tests?

john-bodley avatar Jan 30 '24 17:01 john-bodley

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.

codecov[bot] avatar Jan 30 '24 18:01 codecov[bot]

Thanks @aobapirak for the PR. Would you mind adding some tests?

Yes, sure! I will let you know once I'm done.

aobapirak avatar Jan 31 '24 03:01 aobapirak

Ping @john-bodley, could you please review? I have added some tests.

aobapirak avatar Feb 06 '24 05:02 aobapirak

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.

john-bodley avatar Feb 12 '24 19:02 john-bodley

/testenv up

geido avatar Feb 19 '24 14:02 geido

Thanks for the contribution @aobapirak. Left a couple of comments. Looking forward to @michael-s-molina and @justinpark feedback as well

geido avatar Feb 19 '24 14:02 geido

/testenv up

geido avatar Feb 22 '24 13:02 geido

@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?

geido avatar Feb 22 '24 14:02 geido

/testenv up

geido avatar Feb 23 '24 18:02 geido

@geido Ephemeral environment spinning up at http://54.218.80.169:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Feb 23 '24 18:02 github-actions[bot]