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

Add sortByColumnType param to fix number sorting in TableWidget #593

Merged
merged 6 commits into from
Feb 6, 2023

Conversation

eamador
Copy link
Contributor

@eamador eamador commented Feb 3, 2023

TableWidget - sortByColumnType param + number format

Shortcut: https://app.shortcut.com/cartoteam/story/286648/ac-x5e68ikj-table-widget-ordering-is-wrong-for-numeric-data-type-column

TableWidget accepts a new sortByColumnType parameter, if its value is integer or float 'number' we will apply number sorting

TableWidgetSorting.mov

Type of change

  • Fix

Acceptance

Sorting by a number column should work properly

@eamador eamador added the builder label Feb 3, 2023
@eamador eamador requested review from bbecquet and a team February 3, 2023 08:17
@coveralls
Copy link
Collaborator

coveralls commented Feb 3, 2023

Pull Request Test Coverage Report for Build 4106367214

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 71.456%

Totals Coverage Status
Change from base Build 4084065269: 0.0%
Covered Lines: 1891
Relevant Lines: 2449

💛 - Coveralls

Copy link
Contributor

@bbecquet bbecquet left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -21,20 +25,21 @@ export function applySorting(features, { sortBy, sortByDirection = 'asc' } = {})
if (!isValidSortBy) {
throw new Error('Sorting options are bad formatted');
}

const isNumberColumn = sortByColumnType === 'integer' || sortByColumnType === 'float';
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this should be better a simple 'number'

@VictorVelarde VictorVelarde changed the title TableWidget - sortByColumnType param + number sorting Add sortByColumnType param to fix number sorting in TableWidget Feb 6, 2023
Copy link
Contributor

@VictorVelarde VictorVelarde left a comment

Choose a reason for hiding this comment

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

👍🏻

@VictorVelarde VictorVelarde merged commit dc4754c into master Feb 6, 2023
@VictorVelarde VictorVelarde deleted the bug/table-widget-sorting branch February 6, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants