topcoat-data / topcoat-public

TopCoat components, visualizations and themes
MIT License
1 stars 3 forks source link

Server sort #142

Closed AriSorsko closed 2 years ago

AriSorsko commented 2 years ago

Goal: provide server-side sorting that is done in the sql to the table.

To test:

  1. In snyk-insights, check out the "server_sort" branch and run "build and sync modules"
  2. Open snyk-insights in the iFrame
  3. Verify that the table starts sorted by "SCORE" descending, "ISSUE" ascending, and that the "PRODUCT" column is sortable but not currently sorted.
  4. Click the up/down/up-down icons to sort by columns
  5. Open the URL in a new tab and verify that the updated sorting is preserved- not just which columns are sorted, but also the order in which they are sorted
  6. Export a pdf and verify that the sorted table in the pdf matches the page
  7. Export csv and verify that the rows are sorted in the same way as the table.

Known issues: The table has grown into a cluster, I'm aware that the sorting data is stored in 4 places which is ridiculous. But the correct fix for that is a complete refactor of the table to split the layer handling into a wrapper and turn the table back into a "dumb" non-topcoat component, plus a refactor of the export to csv component- both of which are far outside the scope of this PR. I will tackle those refactors ASAP, so if you see anything here please feel free to call it out- I will make a note of it even if it falls outside of the scope of this sorting PR.

AriSorsko commented 2 years ago

I noticed a few things when testing. Where would you like them to be captured?

Yes please!