informatics-isi-edu / ermrestjs

ERMrest client library in JavaScript
Apache License 2.0
4 stars 3 forks source link

Fix issues with sorting all-outbound paths #942

Closed RFSH closed 2 years ago

RFSH commented 2 years ago

This PR will ensure we're using proper aliases while sorting all-outbound paths.

When I modified the Reference.readPath to not ask for the whole row of data in scalar all-outbounds, I broke the sort functionality and didn't properly test the changes. This PR will fix the sort functionality and also adds more test cases.

Also, the code assumed that the all-outbound path table instances are using aliases in the F# format. While this is generally the case, the alias name might be different when the path with prefix syntax is deployed. With these changes, the code is now using the actual alias instead of assuming the format.

RFSH commented 2 years ago

While writing test cases, I realized that the shared prefix code is sometimes not correctly sharing prefixes when there are no facets in the URL. Since I wanted to test similar scenarios with sort, I fixed it as part of this PR.