Sage-Bionetworks / rocc-service

ROCC REST API service
Apache License 2.0
1 stars 0 forks source link

Update challenge filters and sorting #201

Closed tschaffter closed 2 years ago

tschaffter commented 2 years ago

Implements recent changes made to the schemas on challenge filtering and sorting. This PR also implements the changes suggested in this PR.

Swagger UI tips

Example of selecting multiple values in Swagger UI. Unfortunately, it's not possible to deselect the items. Selecting -- will result in the select of an empty value, which in this example, will trigger an error because an empty string is not a valid challenge status. A solution is to refresh the Swagger UI page.

image

Filtering

Filtering by organizers and sponsors

The filtering could be done using ids or name. The former would results in a better user experience and contributes to reduce the issue of of homonyms by showing to the user additional information about the selected organizers or sponsors like their picture, affiliation for the organizers, etc. One potential drawback is that the organizers and sponsors must have User or Org account in the registry. If the registry is widely adopted by the community, this limitation would decrease as the number of User and Org account increases. This first approach could also be an incentive to organizers and sponsors to create an account.

The second solution is for the user to type a name and for the registry to then show a list of matching names from the list of all challenge organizers, for instance. Because an organizer who organize two challenges would appear twice in this list, the filter behavior would only make sense if we show the user a list of unique names (i.e. aggregate identical name). Therefore the organizer options shown to the user are "string" in this second approach, while their were "User" in the first approach. The "string" has less information than a "User" object and so it would not be possible (or rather difficult) to show information about organizer affiliation, avatar, etc. The benefit of this solution is that it enables to search organizers or sponsors that have not created account in the registry.

Sorting

tschaffter commented 2 years ago

@rrchai This PR should allow us to implement all the challenge filters and sorting strategies that we have identified. The exceptions are filtering by organizers and sponsors (see note above).

The next steps are: