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

Fix: Update button position when number of rows per page is large #3797

Merged
merged 4 commits into from
Apr 14, 2023

Conversation

curq
Copy link
Collaborator

@curq curq commented Apr 6, 2023

Description

After the fix the table component no longer renders unused space for extra rows. Before the fix when the option max rows per page was larger than actual number of results, the table component was rendered with height that could fit max number of rows per page and not the actual number. Screenshot from the issue #3756:
image
The number of results in this screen is 50, while the max number of rows per page is 100. As the result, half of the table component is empty and the update button is pushed far below. I have checked the component from the docs in the sandbox and this is expected behavior.
Therefore, to prevent this bug I assumed that we need to ensure that max number of rows is never larger than number of rows in resulting table. This fix does exactly that. The same case (50 resulting rows, 100 max number of rows),
image
The fix is achieved by updating usePagination hook.

Issues Resolved

Fixes #3756

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
    • yarn test:ftr
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@ananzh
Copy link
Member

ananzh commented Apr 7, 2023

@curq Added comment here
#3737 (comment)

Let me know if you want to combine the bug fixes into one PR. I am okay with one or two PRs. If you prefer two PRs, I could approve this one. You just need to update CHANGELOG. Once this PR #3397 is merged, I might open an issue and assign you to update unit test.

curq added 2 commits April 10, 2023 23:43
Signed-off-by: Sirazh Gabdullin <[email protected]>
Signed-off-by: Sirazh Gabdullin <[email protected]>
@curq
Copy link
Collaborator Author

curq commented Apr 10, 2023

@ananzh I decided to make two PR instead of combining both. I made separate PR #3816. and added more explanation here
I'm also open to updating unit tests when the PR you mentioned will be merged.

ananzh
ananzh previously approved these changes Apr 10, 2023
@ananzh
Copy link
Member

ananzh commented Apr 10, 2023

@ananzh I decided to make two PR instead of combining both. I made separate PR #3816. and added more explanation here I'm also open to updating unit tests when the PR you mentioned will be merged.

Got it. I approved.

@ananzh ananzh requested a review from joshuarrrr April 10, 2023 20:07
@codecov-commenter
Copy link

codecov-commenter commented Apr 10, 2023

Codecov Report

Merging #3797 (fbc5a52) into main (0a83c47) will decrease coverage by 0.01%.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main    #3797      +/-   ##
==========================================
- Coverage   66.37%   66.36%   -0.01%     
==========================================
  Files        3209     3209              
  Lines       61732    61732              
  Branches     9533     9533              
==========================================
- Hits        40974    40970       -4     
- Misses      18466    18469       +3     
- Partials     2292     2293       +1     
Flag Coverage Δ
Linux 66.36% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 3 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@joshuarrrr joshuarrrr self-assigned this Apr 11, 2023
@joshuarrrr joshuarrrr added the OSCI Open Source Contributor Initiative label Apr 11, 2023
@joshuarrrr
Copy link
Member

@curq Thanks for the fix!

I have checked the component from the docs in the sandbox and this is expected behavior.

This strikes me as not ideal. Do you mind opening an issue in OUI where we can discuss whether this behavior is actually desired or useful?

joshuarrrr
joshuarrrr previously approved these changes Apr 11, 2023
@curq
Copy link
Collaborator Author

curq commented Apr 12, 2023

This strikes me as not ideal. Do you mind opening an issue in OUI where we can discuss whether this behavior is actually desired or useful?

@joshuarrrr as you requested, I opened a new issue in OUI repo where I have provided a more detailed description of the behavior, along with examples.

@joshuarrrr
Copy link
Member

all checks passed, but I need to resolve a changelog conflict

@joshuarrrr joshuarrrr dismissed stale reviews from ananzh and themself via fbc5a52 April 13, 2023 00:28
@joshuarrrr
Copy link
Member

data source manager cypress test failures are safe to ignore.

@joshuarrrr joshuarrrr merged commit 01c5a92 into opensearch-project:main Apr 14, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-3797-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 01c5a92858f531c87aa5508ed991c63f4e3af5f7
# Push it to GitHub
git push --set-upstream origin backport/backport-3797-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-3797-to-2.x.

joshuarrrr pushed a commit to joshuarrrr/OpenSearch-Dashboards that referenced this pull request Apr 18, 2023
…ensearch-project#3797)

* Fix: Update button position when number of rows per page is large
* Update CHANGELOG.md

Signed-off-by: Sirazh Gabdullin <[email protected]>

---------

Signed-off-by: Sirazh Gabdullin <[email protected]>
Co-authored-by: Josh Romero <[email protected]>
(cherry picked from commit 01c5a92)
@joshuarrrr
Copy link
Member

No need to backport - incorporated into #3397

sikhote pushed a commit to sikhote/OpenSearch-Dashboards that referenced this pull request Apr 24, 2023
…ensearch-project#3797)

* Fix: Update button position when number of rows per page is large
* Update CHANGELOG.md

Signed-off-by: Sirazh Gabdullin <[email protected]>

---------

Signed-off-by: Sirazh Gabdullin <[email protected]>
Co-authored-by: Josh Romero <[email protected]>
Signed-off-by: David Sinclair <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time-contributor OSCI Open Source Contributor Initiative tableVis table visualization v2.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] In Data Table visualisations the Update button is no longer locked to the bottom of the screen
5 participants