Closed LucaFumis closed 6 months ago
We should look into this as well tomorrow
@LucaFumis @prashantuniyal02 Would this be a valid response { "data": { "target": { "id": "ENSG00000073756", "knownDrugs": { "count": 0, "cursor": null, "rows": [], "__typename": "KnownDrugs" }, "__typename": "Target" } } }
@LucaFumis @prashantuniyal02 Would this be a valid response
{ "data": { "target": { "id": "ENSG00000073756", "knownDrugs": { "count": 0, "cursor": null, "rows": [], "__typename": "KnownDrugs" }, "__typename": "Target" } } }
@remo87 yes that the expected response
The widget was still disappearing after the change in the API, so I created this PR with a fix for the frontend
@carcruz @chinmehta
Safety
widget on the target profile page. ExampleOrphanet
widget in the AOTF page. ExampleReactome
widget in the AOTF page. ExampleIMPC
widget in the AOTF page. ExampleGene2phenotype
widget in the AOTF page. ExampleThe search is not crashing now for the above widgets in dev platform. We should ideally fix the root cause which is handling the case when the search results are not found inside the widgets.
Describe the bug Issue observed in the Known Drugs widget table in profile and evidence pages. When searching the widget's table, the whole widget disappears from the page. This problem was first observed and reported by @HelenaCornu .
Observed behaviour When searching the widget's table, a set of results matching the search are displayed in the table. If however the search term is not found, the whole widget is removed from the page. The known drugs table uses server side pagination. So when searching the table, a new API request is fired. If no rows match the search term, the API returns
null
. The newly refactored sections in the front end check fornull
in order to determine which sections to display, and so at it point it removes the widget.I need to investigate this a little further, but it might need to be fixed with help from the @opentargets/be-team: possible idea perhaps return an empty array with also the search term?
Expected behaviour When searching the known drugs table and no match is found, then the widget should display some message, e.g. "no data".
To Reproduce Steps to reproduce the behaviour: