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(grid): add FormattedValuesSortingStrategy for sorting by formatted values - master #14538

Merged
merged 20 commits into from
Sep 19, 2024

Conversation

georgianastasov
Copy link
Contributor

Closes #14442

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

@kacheshmarova kacheshmarova requested a review from hanastasov July 17, 2024 11:45
@RivaIvanova RivaIvanova self-assigned this Jul 25, 2024
@RivaIvanova RivaIvanova added 💥 status: in-test PRs currently being tested ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification 💥 status: in-test PRs currently being tested labels Jul 25, 2024
Copy link
Contributor

@hanastasov hanastasov left a comment

Choose a reason for hiding this comment

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

  1. Use the tree-grid groupby sample

  2. Add formatter to the Cntacttitle column:
    image

  3. Add the strategy in the class:
    public formattedValuesSortingStrategy = new FormattedValuesSortingStrategy();

    Run the sample, error is thrown in console:

image

This is a good ocasion to apply TDD approach :) First add a unit test for this scenario that will be failing with this error, and then add the fix.

@georgianastasov georgianastasov added ❌ status: awaiting-test PRs awaiting manual verification and removed ✅ status: verified Applies to PRs that have passed manual verification labels Jul 26, 2024
@georgianastasov
Copy link
Contributor Author

@hanastasov It appears that the error you're encountering is due to the fact that FormattedValuesSortingStrategy is designed to be a column-level sort strategy, not a grid-level sort strategy. Applying it at the grid level leads to the observed error because the strategy cannot properly handle the sorting logic across the entire grid context, it is particularly for columns with formatted values.

The scenario you described might differ and could be indicative of another underlying issue and further investigation into the specific implementation details might be required.

@georgianastasov georgianastasov added ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification labels Jul 26, 2024
hanastasov
hanastasov previously approved these changes Jul 26, 2024
@georgianastasov
Copy link
Contributor Author

Adding a "do-not-merge" tag to this pull request so we can accommodate the upcoming mass merges more effectively.

@hanastasov hanastasov changed the title feat(grid): add FormattedValuesSortingStrategy for sorting by formatted values - master feat(grid): add FormattedValuesSortingStrategy for sorting by formatted values - master [DO NOT MERGE] Jul 29, 2024
@ddaribo ddaribo changed the title feat(grid): add FormattedValuesSortingStrategy for sorting by formatted values - master [DO NOT MERGE] feat(grid): add FormattedValuesSortingStrategy for sorting by formatted values - master Aug 19, 2024
@hanastasov hanastasov merged commit daa4509 into master Sep 19, 2024
5 checks passed
@hanastasov hanastasov deleted the ganastasov/feat-14442-master branch September 19, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grid: sorting grid version: 18.2.x ✅ status: verified Applies to PRs that have passed manual verification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Grids: provide a more straightforward approach to sort by formatted values
5 participants