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

Enhancement: Format columns width with widthWeightagePercentage #401

Merged
merged 28 commits into from
Jan 30, 2024

Conversation

mayan-000
Copy link
Collaborator

@mayan-000 mayan-000 commented Jan 5, 2024

Description

This PR adds an optional widthWeightagePercentage key to allow the columns' width to be formatted depending on the priority provided in the table columns data array.
Alongside, it handles the logic for resetting the width of the column(by widthWeightagePercentage) when all the columns are toggled.

Additional Information:

  • If the percentage is provided for columns,
    • Whenever the user opens PSAT for the first time in a tab, the widthWeighatePercentage is used to render the width
    • Whenever all of the columns' visibility is toggled, the columns' width is reset to zero and recalculated when readded according to widthWeighatePercentage.
  • If the percentage is not provided,
    • The columns' width is distributed equally concerning table width.
    • If all columns are toggled, equal distribution is considered.

Screenshot/Screencast

Screenshot 2024-01-05 at 3 03 00 PM

Checklist

  • I have thoroughly tested this code to the best of my abilities.
  • I have reviewed the code myself before requesting a review.
  • This code is covered by unit tests to verify that it works as intended.
  • The QA of this PR is done by a member of the QA team (to be checked by QA).

Fixes #255 #342 #374

@mayan-000 mayan-000 self-assigned this Jan 5, 2024
@mayan-000 mayan-000 linked an issue Jan 11, 2024 that may be closed by this pull request
@mayan-000 mayan-000 marked this pull request as ready for review January 17, 2024 08:24
@mohdsayed

This comment was marked as resolved.

@mohdsayed

This comment was marked as resolved.

@mohdsayed mohdsayed merged commit 0bc4677 into develop Jan 30, 2024
4 checks passed
@mohdsayed mohdsayed deleted the table branch January 30, 2024 13:05
@mohdsayed mohdsayed mentioned this pull request Feb 7, 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
2 participants