CrowdStrike / ember-headless-table

https://ember-headless-table.pages.dev
MIT License
23 stars 8 forks source link

fix: Use generic column types in resize-handle and data-sorting plugins (#247) #248

Open johanrd opened 5 months ago

johanrd commented 5 months ago

Proposed fix for #247 for Resize-handle and data-sorting

changeset-bot[bot] commented 5 months ago

⚠️ No Changeset found

Latest commit: e26a127904874eb1dfbd3622b91b6ba25fb7285a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

johanrd commented 4 months ago

I had to wait with the sort, sortDescending and sortAscending helpers:

https://github.com/CrowdStrike/ember-headless-table/blob/8111252521665b76957bf3741678f0a8d6e5b10e/ember-headless-table/src/plugins/data-sorting/helpers.ts#L38-L50

For some reason, I didn't get the generics to work for the meta.forTable(column.table, Sorting).handleSort(column) (reverted here: https://github.com/CrowdStrike/ember-headless-table/pull/248/commits/10a9e268dc6df4e2ae12fd844b5379f74baff1b7, see failing test: https://github.com/CrowdStrike/ember-headless-table/actions/runs/7989097110/job/21815050164?pr=248#step:4:67

@NullVoxPopuli perhaps you know how to pass on the generic Column through meta.forTable? thanks,